jiuyiUniapp/jiuyi/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js

1 line
243 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("trtc-cloud-js-sdk"),require("@tencentcloud/chat")):"function"==typeof define&&define.amd?define(["trtc-cloud-js-sdk","@tencentcloud/chat"],e):"object"==typeof exports?exports["tuicall-engine-webrtc"]=e(require("trtc-cloud-js-sdk"),require("@tencentcloud/chat")):t["tuicall-engine-webrtc"]=e(t.TRTC_Cloud,t.ChatSDK)}(window,(function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e,n){"use strict";n.r(e),n.d(e,"mainUrl",(function(){return a})),n.d(e,"backupUrl",(function(){return o})),n.d(e,"Mode",(function(){return s})),n.d(e,"Role",(function(){return l})),n.d(e,"VIDEO_STAT_BIT",(function(){return u})),n.d(e,"AUDIO_STAT_BIT",(function(){return c})),n.d(e,"AUDIO_MUTE_BIT",(function(){return d})),n.d(e,"VIDEO_MUTE_BIT",(function(){return p})),n.d(e,"VIDEO_MUTED_MASK",(function(){return h})),n.d(e,"AUX_VIDEO_MUTED_MASK",(function(){return _})),n.d(e,"AUDIO_MUTED_MASK",(function(){return f})),n.d(e,"MAIN_STREAM_MSID",(function(){return E})),n.d(e,"AUX_STREAM_MSID",(function(){return g})),n.d(e,"StreamType",(function(){return I})),n.d(e,"TRTC_QUALITY_UNKNOWN",(function(){return v})),n.d(e,"TRTC_QUALITY_EXCELLENT",(function(){return C})),n.d(e,"TRTC_QUALITY_GOOD",(function(){return T})),n.d(e,"TRTC_QUALITY_POOR",(function(){return R})),n.d(e,"TRTC_QUALITY_BAD",(function(){return m})),n.d(e,"TRTC_QUALITY_VBAD",(function(){return A})),n.d(e,"TRTC_QUALITY_DISCONNECTED",(function(){return y})),n.d(e,"DTLS_STATE_UNKNOWN",(function(){return L})),n.d(e,"SuccessRate",(function(){return S})),n.d(e,"MTA_API_PENDING",(function(){return D})),n.d(e,"MTA_API_SUCCESS",(function(){return N})),n.d(e,"ConnectionState",(function(){return O})),n.d(e,"UPLINK_RECONNECTION_COUNT",(function(){return b})),n.d(e,"DOWNLINK_RECONNECTION_COUNT",(function(){return w})),n.d(e,"SIGNAL_RECONNECTION_COUNT",(function(){return U})),n.d(e,"KIBANA_EVENT",(function(){return M})),n.d(e,"SIGNAL_PING_TIMEOUT",(function(){return P})),n.d(e,"SIGNAL_PING_PONG_INTERVAL",(function(){return V})),n.d(e,"INNER_EVENT",(function(){return x})),n.d(e,"AI_NOISE_REDUCE_ASSETS_PATH",(function(){return k})),n.d(e,"MAX_NUMBER_ROOM_ID",(function(){return G})),n.d(e,"NAME",(function(){return j})),n.d(e,"CUSTOM_STATUS_MAP",(function(){return B})),n.d(e,"VIDEO_ENCODER_MAP",(function(){return H})),n.d(e,"CONSOLE_DOMESTIC",(function(){return F})),n.d(e,"CONSOLE_FOREIGN",(function(){return K})),n.d(e,"BUY_ADDRESS_DOMESTIC",(function(){return Y})),n.d(e,"BUY_ADDRESS_FOREIGN",(function(){return W})),n.d(e,"REGION_CHINA",(function(){return q})),n.d(e,"REGION_SINGAPORE",(function(){return Q})),n.d(e,"REGION_FRANKFURT",(function(){return J})),n.d(e,"REGION_SEOUL",(function(){return $})),n.d(e,"REGION_BOMBAY",(function(){return X})),n.d(e,"REGION_SILICON",(function(){return z}));var i=n(6),r=n(14);const a="wss://qcloud.rtc.qq.com:8687",o="wss://bk.rtc.qq.com:8687",s={RTC:1,LIVE:2},l={HOST:20,AUDIENCE:21},u=1,c=8,d=64,p=16,h=1,_=2,f=4,E="5Y2wZK8nANNAoVw6dSAHVjNxrD1ObBM2kBPV",g="224d130c-7b5c-415b-aaa2-79c2eb5a6df2",I={NONE:0,AUDIO:1,MAIN:2,AUX:7},v=0,C=1,T=2,R=3,m=4,A=5,y=6,L="unknown",S={JOIN:"join",PUBLISH:"publish",UNPUBLISH:"unpublish",LOCAL_STREAM_INITIALIZE:"local_stream_initialize",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscibe",UPLINK_CONNECTION:"uplink_connection",UPLINK_RECONNECTION:"uplink_reconnection",DOWNLINK_CONNECTION:"downlink_connection",DOWNLINK_RECONNECTION:"downlink_reconnection",SIGNAL_CONNECTION:"signal_connection",SIGNAL_RECONNECTION:"signal_reconnection",UPDATE_STREAM:"update_stream"},D="pending",N="success",O={CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected"},b=30,w=30,U=30,M={SDK_CONSTRUCT:"sdkConstruct",SDK_LOGIN:"sdkLogin",DELTA_JOIN:"delta-join",REJOIN:"rejoin",LEAVE:"leave",DELTA_LEAVE:"delta-leave",PUBLISH:"publish",DELTA_PUBLISH:"delta-publish",UNPUBLISH:"unpublish",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe",UPLINK_CONNECTION:"uplink-connection",UPLINK_RECONNECTION:"uplink-reconnection",DOWNLINK_CONNECTION:"downlink-connection",DOWNLINK_RECONNECTION:"downlink-reconnection",ON_TRACK:"ontrack",SET_LOCAL_DESCRIPTION:"setLocalDescription",SET_REMOTE_DESCRIPTION:"setRemoteDescription",ICE_CONNECTION_STATE:"iceConnectionState",LOCAL_STREAM_INITIALIZE:"stream-initialize",SIGNAL_CONNECTION:"websocketConnectionState",SIGNAL_RECONNECTION:"websocketReconnectionState",UPDATE_STREAM:"update-stream",RECOVER_SUBSCRIPTION:"recover-subscription"},P=6e3,V=1e4,x={SET_REMOTE_OFFER_FINISHED:"set-remote-offer-finished"},k="https://web.sdk.qcloud.com/trtc/webrtc/download/aiNoiseReduce/",G=2147483647,j={DEFAULT:"default",BOOLEAN:"boolean",STRING:"string",NUMBER:"number",OBJECT:"object",ARRAY:"array",FUNCTION:"function",FILE:"file",MAP:"map",SET:"set",UNDEFINED:"undefined",VIDEO:"video",AUDIO:"audio",ON_ERROR:"onError",MAIN:"main",RTC:"rtc",LIVE:"live",SMALL:"small",BIG:"big",AUXILIARY:"auxiliary",INVITER:"inviter",INVITEE:"invitee",VIDEO_INPUT:"videoinput",AUDIO_INPUT:"audioinput",LOCAL:"local",REMOTE:"remote",TRTC:"TRTC",WEB:"web",NORMAL:"normal",REJECT:"reject",IGNORE:"ignore",TIMEOUT:"timeout",RIC:"ric",RAF:"raf",INTERVAL:"interval",CANCEL:"cancel",BUSYLINE:"busyline",UNKNOWN:"unknown",SINGLE_CALL:"SingleCall",GROUP_CALL:"groupCall",CALLER:"caller",CALLEE:"callee",COVER:"cover",CONTAIN:"contain",FILL:"fill",AV_CALL:"av_call",CALLKIT_RECORDS_SVR:"callkit_records_svr",SINGLE:"single",GROUP:"group",START_CALL:"start_call",RECEIVE_CALL:"receive_call",CALL_ACCEPTED:"call_accepted",ACCEPT_CALL:"accept_call",CALL_MISSED:"call_missed",NOT_ANSWER_CALL:"not_answer_call",CALL_REJECTED:"call_rejected",REJECT_CALL:"reject_call",CALL_BUSY:"call_busy",IGNORE_CALL:"ignore_call",CANCEL_CALL:"cancel_call",CALL_CANCELED:"call_canceled",CALL_FAILED:"call_failed",CALL_END:"call_end",CALL_INTERRUPTED:"call_interrupted",INVITE_USER:"invite_user",JOIN_IN_GROUP_CALL:"join_in_group_call",EVENT_REPORT:"event_report",HEART_BEAT:"heartbeat",CALLING:"calling",BANNED:"banned",WAITING:"waiting",CONNECTED:"connected",MICROPHONE:"microphone",CAMERA:"camera",MICROPHONES:"microphones",SPEAKER:"speaker",ENABLE_VIRTUAL_BACKGROUND:"enableVirtualBackground",BLUR:"blur",IMAGE:"image"},B={"":i.CALL_STATUS.IDLE,call_wait:i.CALL_STATUS.CALLING,call_accept:i.CALL_STATUS.CONNECTED},H={"480p":{videoResolution:r.TRTCVideoResolution.TRTCVideoResolution_640_480,videoFps:15,videoBitrate:900},"720p":{videoResolution:r.TRTCVideoResolution.TRTCVideoResolution_1280_720,videoFps:15,videoBitrate:1500},"1080p":{videoResolution:r.TRTCVideoResolution.TRTCVideoResolution_1920_1080,videoFps:15,videoBitrate:2e3}},F="https://console.cloud.tencent.com/im/detail",K="https://console.intl.cloud.tencent.com/im/detail",Y="https://buy.cloud.tencent.com/avc?addRavLicense=1",W="https://buy.tencentcloud.com/avc?addRavLicense=1",q=1,Q=9,J=17,$=18,X=21,z=15},function(t,e,n){"use strict";n.r(e),n.d(e,"isMap",(function(){return o})),n.d(e,"isSet",(function(){return s})),n.d(e,"isFile",(function(){return l})),n.d(e,"isNumber",(function(){return u})),n.d(e,"isString",(function(){return c})),n.d(e,"isObject",(function(){return d})),n.d(e,"isBoolean",(function(){return p})),n.d(e,"isPlainObject",(function(){return h})),n.d(e,"isArray",(function(){return _})),n.d(e,"isUndefined",(function(){return f})),n.d(e,"isNativeClass",(function(){return g})),n.d(e,"isArrayOrObject",(function(){return I})),n.d(e,"isFunction",(function(){return v})),n.d(e,"isInstanceOfError",(function(){return C})),n.d(e,"getType",(function(){return T})),n.d(e,"TimeUtil",(function(){return m})),n.d(e,"stringifyError",(function(){return A})),n.d(e,"map2String",(function(){return y})),n.d(e,"randomString",(function(){return D})),n.d(e,"isValidType",(function(){return N})),n.d(e,"mapKeys",(function(){return O})),n.d(e,"mapValues",(function(){return b})),n.d(e,"generateRandomRoomID",(function(){return w})),n.d(e,"analyzeRoomId",(function(){return U})),n.d(e,"formatDuration",(function(){return P})),n.d(e,"compareVersion",(function(){return V})),n.d(e,"date2ISOString",(function(){return x})),n.d(e,"getHostType",(function(){return k})),n.d(e,"isCallSignaling",(function(){return G})),n.d(e,"performanceNow",(function(){return j})),n.d(e,"isDomesticSDKAppID",(function(){return B})),n.d(e,"getPurchaseAddress",(function(){return H})),n.d(e,"getRegionId",(function(){return F})),n.d(e,"timeoutForFun",(function(){return K})),n.d(e,"analyzeVideoRenderParams",(function(){return Y})),n.d(e,"getValueType",(function(){return W})),n.d(e,"safelyParse",(function(){return q})),n.d(e,"generateRandomString",(function(){return Q}));var i=n(5),r=n(9),a=n(0);const o=function(t){return T(t)===a.NAME.MAP},s=function(t){return T(t)===a.NAME.SET},l=function(t){return T(t)===a.NAME.FILE},u=function(t){return null!==t&&(typeof t===a.NAME.NUMBER&&!isNaN(t-0)||typeof t===a.NAME.OBJECT&&t.constructor===Number)},c=function(t){return typeof t===a.NAME.STRING},d=function(t){return null!==t&&typeof t===a.NAME.OBJECT},p=function(t){return typeof t===a.NAME.BOOLEAN},h=function(t){if(typeof t!==a.NAME.OBJECT||null===t)return!1;const e=Object.getPrototypeOf(t);if(null===e)return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},_=function(t){return typeof Array.isArray===a.NAME.FUNCTION?Array.isArray(t):T(t)===a.NAME.ARRAY},f=function(t){return typeof t===a.NAME.UNDEFINED},E=/^class\s/,g=function(t){return typeof t===a.NAME.FUNCTION&&E.test(t.toString())},I=function(t){return _(t)||d(t)},v=function(t){return typeof t===a.NAME.FUNCTION},C=function(t){return t instanceof Error},T=function(t){return Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase()};let R=0;Date.now||(Date.now=function(){return(new Date).getTime()});const m={now(){0===R&&(R=Date.now()-1);const t=Date.now()-R;return t>4294967295?(R+=4294967295,Date.now()-R):t},utc:()=>Math.round(Date.now()/1e3)},A=function(t){return JSON.stringify(t,["message","code"])},y=function(t){if(!o(t))return"not a map!!!";let e="";for(const[n,i]of t.entries()){if(o(i))return`[k=${n} -> ${y(i)}`;e+=`[k=${n} v=${i}] `}return e},L="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",S=L.length,D=function(){let t="";for(let e=32;e>0;--e)t+=L[Math.floor(Math.random()*S)];return t},N=function(t,e){for(const n in t)if(t[n]===e)return!0;return!1};function O(t,e){const n={};return Object.keys(t).forEach(i=>{n[e(t[i],i)]=t[i]}),n}function b(t,e){const n={};return Object.keys(t).forEach(i=>{n[i]=e(t[i],i)}),n}function w(){return Math.round(1e8*Math.random())}function U(t,e){return u(t)&&t>0?t:0===t&&e?e:w()}function M(t){return t<10?"0"+t:t}function P(t){if(t<60)return"00:00:"+M(t);if(t<3600){const e=parseInt(t/60),n=t-60*e;return`00:${M(e)}:${M(n)}`}const e=parseInt(t/3600),n=t-3600*e,i=parseInt(n/60),r=n-60*i;return`${M(e)}:${M(i)}:${M(r)}`}function V(t,e){t=t.split("."),e=e.split(".");const n=Math.max(t.length,e.length);for(;t.length<n;)t.push("0");for(;e.length<n;)e.push("0");for(let i=0;i<n;i++){const n=parseInt(t[i]),r=parseInt(e[i]);if(n>r)return 1;if(n<r)return-1}return 0}const x=function(){const t=new Date,e=t.toISOString(),n=t.getTimezoneOffset()/60;let i="";return i=n<0?n>-10?"+0"+Math.abs(100*n):"+"+Math.abs(100*n):n>=10?"-"+100*n:"-0"+100*n,e.replace("Z",i)};function k(){let t="unknown";return i.IS_MAC&&(t="mac"),i.IS_WIN&&(t="windows"),i.IS_IOS&&(t="ios"),i.IS_ANDROID&&(t="android"),t}function G(t){return t===a.NAME.AV_CALL}function j(){return performance&&performance.now?Math.floor(performance.now()):Date.now()}function B(t){const e=String(t);return e.startsWith("14")||e.startsWith("16")||e.startsWith("17")}function H(t){return`${B(t)?a.BUY_ADDRESS_DOMESTIC:a.BUY_ADDRESS_FOREIGN}&position=${t}&regionId=${F(t)}`}function F(t){return t>=2e7&&t<3e7||t>=172e7&&t<173e7?a.REGION_SINGAPORE:t>=3e7&&t<4e7||t>=173e7&&t<174e7?a.REGION_SEOUL:t>=4e7&&t<5e7||t>=174e7&&t<175e7?a.REGION_FRANKFURT:t>=5e7&&t<6e7||t>=175e7&&t<176e7?a.REGION_BOMBAY:t>=7e7&&t<8e7||t>=177e7&&t<178e7?a.REGION_SILICON:a.REGION_CHINA}async function K(t,e){return Promise.race([t(),new Promise((t,n)=>{setTimeout(()=>{t()},e)})])}function Y(t){const e={};return t.rotation&&(e.rotation=t.rotation),t.objectFit&&(t.objectFit===a.NAME.COVER?e.fillMode=r.TRTCVideoFillMode.TRTCVideoFillMode_Fill:e.fillMode=r.TRTCVideoFillMode.TRTCVideoFillMode_Fit),p(t.mirror)&&(e.mirrorType=t.mirror?r.TRTCVideoMirrorType.TRTCVideoMirrorType_Enable:r.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable),e}function W(t){return Reflect.apply(Object.prototype.toString,t,[]).replace(/^\[object\s(\w+)\]$/,"$1").toLowerCase()}function q(t){if("string"!=typeof t)return t;let e;try{const n=JSON.parse(t);e="object"==typeof n&&n?n:t}catch(n){e=t}return e}function Q(t){t=t||32;const e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";let n="";for(let i=0;i<t;i++)n+=e.charAt(Math.floor(Math.random()*e.length));return n}},function(t,e,n){"use strict";n.r(e),n.d(e,"LOGLEVEL_INFO",(function(){return o}));var i=n(4),r=n(1),a=n(5);const o=1;let s=0;const l=new Map,u="%cCallEngine%c%s",c="padding: 1px 4px;border-radius: 3px;color: #fff;background: #444;",d="display: inline",p=!(a.IS_IOS||a.IS_ANDROID||a.IS_HEADLESS_CHROME);function h(){const t=new Date;return`[${t.toLocaleTimeString("en-US",{hour12:!1})}.${function(t){let e;switch(t.toString().length){case 1:e="00"+t;break;case 2:e="0"+t;break;default:e=t}return e}(t.getMilliseconds())}]`}const _={_data:[],_length:0,_visible:!1,arguments2String(t,e){let n;if(1===e.length)n=`${h()} <${t}> ${e[0]}`;else{n=`${h()} <${t}> `;for(let t=0,{length:i}=e;t<i;t++)Object(r.isArrayOrObject)(e[t])?Object(r.isInstanceOfError)(e[t])?n+=Object(r.stringifyError)(e[t]):n+=JSON.stringify(e[t]):n+=e[t],n+=" "}return n},debug(){if(s<=-1){const t=this.arguments2String("DEBUG",arguments);_.record(t,"debug"),p?i.a.debug(u,c,d,t):i.a.debug(t)}},log(){if(s<=0){const t=this.arguments2String("LOG",arguments);_.record(t,"log"),p?i.a.log(u,c,d,t):i.a.log(t)}},info(){if(s<=o){const t=this.arguments2String("INFO",arguments);_.record(t,"info"),p?i.a.info(u,c,d,t):i.a.info(t)}},warn(){if(s<=2){const t=this.arguments2String("WARN",arguments);_.record(t,"warn"),p?i.a.warn(u,c,d,t):i.a.warn(t)}},error(){if(s<=3){const t=this.arguments2String("ERROR",arguments);_.record(t,"error"),p?i.a.error(u,c,d,t):i.a.error(t)}},time(t){l.set(t,r.TimeUtil.now())},timeEnd(t){if(l.has(t)){const e=r.TimeUtil.now()-l.get(t);return l.delete(t),e}return i.a.warn(`未找到对应label: ${t}, 请在调用 logger.timeEnd 前,调用 logger.time`),0},setLevel(t){t<4&&i.a.log(`${h()}set level from ${s} to ${t}`),s=t},getLevel:()=>s,record(t,e){1100===_._length&&(_._data.splice(0,100),_._length=1e3),_._length++,_._data.push(`${t} [${e}] \n`)},getLog:()=>_._data};e.default=_},function(t,e,n){"use strict";var i=n(21),r=Object.prototype.toString;function a(t){return"[object Array]"===r.call(t)}function o(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function l(t){if("[object Object]"!==r.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function u(t){return"[object Function]"===r.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.call(null,t[r],r,t)}t.exports={isArray:a,isArrayBuffer:function(t){return"[object ArrayBuffer]"===r.call(t)},isBuffer:function(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isPlainObject:l,isUndefined:o,isDate:function(t){return"[object Date]"===r.call(t)},isFile:function(t){return"[object File]"===r.call(t)},isBlob:function(t){return"[object Blob]"===r.call(t)},isFunction:u,isStream:function(t){return s(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function t(){var e={};function n(n,i){l(e[i])&&l(n)?e[i]=t(e[i],n):l(n)?e[i]=t({},n):a(n)?e[i]=n.slice():e[i]=n}for(var i=0,r=arguments.length;i<r;i++)c(arguments[i],n);return e},extend:function(t,e,n){return c(e,(function(e,r){t[r]=n&&"function"==typeof e?i(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},function(t,e,n){"use strict";(function(t){let n,i;n="undefined"!=typeof console?console:void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};const r=function(){},a=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"];let{length:o}=a;for(;o--;)i=a[o],console[i]||(n[i]=r);n.methods=a,e.a=n}).call(this,n(36))},function(t,e,n){"use strict";n.r(e),n.d(e,"IN_Browser",(function(){return i})),n.d(e,"IN_WXMiniProgram",(function(){return r})),n.d(e,"USER_AGENT",(function(){return a})),n.d(e,"IS_IPAD",(function(){return l})),n.d(e,"IS_IPHONE",(function(){return u})),n.d(e,"IS_IPOD",(function(){return c})),n.d(e,"IS_IOS",(function(){return d})),n.d(e,"IOS_VERSION",(function(){return p})),n.d(e,"IS_ANDROID",(function(){return h})),n.d(e,"ANDROID_VERSION",(function(){return _})),n.d(e,"IS_OLD_ANDROID",(function(){return f})),n.d(e,"IS_NATIVE_ANDROID",(function(){return E})),n.d(e,"IS_FIREFOX",(function(){return g})),n.d(e,"FIREFOX_VERSION",(function(){return I})),n.d(e,"IS_EDGE",(function(){return v})),n.d(e,"EDGE_VERSION",(function(){return C})),n.d(e,"IS_EDG",(function(){return T})),n.d(e,"EDG_VERSION",(function(){return R})),n.d(e,"IS_CHROME",(function(){return m})),n.d(e,"CHROME_MAJOR_VERSION",(function(){return A})),n.d(e,"CHROME_VERSION",(function(){return y})),n.d(e,"IS_IE8",(function(){return L})),n.d(e,"IE_VERSION",(function(){return S})),n.d(e,"IS_SAFARI",(function(){return D})),n.d(e,"IS_ANY_SAFARI",(function(){return N})),n.d(e,"SAFARI_VERSION",(function(){return O})),n.d(e,"IS_TBS",(function(){return b})),n.d(e,"TBS_VERSION",(function(){return w})),n.d(e,"IS_X5MQQB",(function(){return U})),n.d(e,"IS_MQQB",(function(){return M})),n.d(e,"MQQB_VERSION",(function(){return P})),n.d(e,"IS_QQB",(function(){return V})),n.d(e,"IS_WECHAT",(function(){return x})),n.d(e,"WECHAT_VERSION",(function(){return k})),n.d(e,"IS_WIN",(function(){return G})),n.d(e,"IS_MAC",(function(){return j})),n.d(e,"IS_LINUX",(function(){return B})),n.d(e,"IS_WX",(function(){return H})),n.d(e,"IS_UCBROWSER",(function(){return F})),n.d(e,"IS_MIUIBROWSER",(function(){return K})),n.d(e,"IS_HUAWEIBROWSER",(function(){return Y})),n.d(e,"HUAWEI_VERSION",(function(){return W})),n.d(e,"BROWSER_VERSION",(function(){return q})),n.d(e,"IS_LOCAL",(function(){return Q})),n.d(e,"IS_HEADLESS_CHROME",(function(){return J})),n.d(e,"getBrowserInfo",(function(){return X})),n.d(e,"getOsInfo",(function(){return z})),n.d(e,"isMobile",(function(){return Z}));const i="undefined"!=typeof window,r="undefined"!=typeof wx,a=window.navigator&&window.navigator.userAgent||"",o=/AppleWebKit\/([\d.]+)/i.exec(a),s=o?parseFloat(o.pop()):null,l=/iPad/i.test(a),u=/iPhone/i.test(a)&&!l,c=/iPod/i.test(a),d=u||l||c,p=function(){const t=a.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),h=/Android/i.test(a),_=function(){const t=a.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const e=t[1]&&parseFloat(t[1]),n=t[2]&&parseFloat(t[2]);return e&&n?parseFloat(`${t[1]}.${t[2]}`):e||null}(),f=h&&/webkit/i.test(a)&&_<2.3,E=h&&_<5&&s<537,g=/Firefox/i.test(a),I=function(){const t=a.match(/Firefox\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),v=/Edge\//i.test(a),C=v&&function(){const t=a.match(/Edge\/(\d+)/i);if(t&&t[1])return t[1]}(),T=/Edg\//i.test(a),R=function(){const t=a.match(/Edg\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),m=!v&&/Chrome/i.test(a),A=function(){const t=a.match(/Chrome\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),y=function(){const t=a.match(/Chrome\/([\d.]+)/);return t&&t[1]?t[1]:null}(),L=/MSIE\s8\.0/.test(a),S=function(){const t=/MSIE\s(\d+)\.\d/.exec(a);let e=t&&parseFloat(t[1]);return!e&&/Trident\/7.0/i.test(a)&&/rv:11.0/.test(a)&&(e=11),e}(),D=/Safari/i.test(a)&&!m&&!h&&!v,N=D||d,O=function(){const t=a.match(/Version\/([\d.]+)/);return t&&t[1]?t[1]:null}(),b=/TBS\/\d+/i.test(a),w=function(){const t=a.match(/TBS\/(\d+)/i);if(t&&t[1])return t[1]}(),U=!b&&/MQQBrowser\/\d+/i.test(a)&&/COVC\/\d+/i.test(a),M=!b&&/MQQBrowser\/\d+/i.test(a),P=(M||U)&&function(){const t=a.match(/ MQQBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),V=!b&&/ QQBrowser\/\d+/i.test(a),x=/(micromessenger|webbrowser)/i.test(a),k=x&&function(){const t=a.match(/MicroMessenger\/(\d+)/i);if(t&&t[1])return t[1]}(),G=/Windows/i.test(a),j=/MAC OS X/i.test(a),B=/Linux/i.test(a),H=/MicroMessenger/i.test(a),F=/UCBrowser/i.test(a),K=/MiuiBrowser/i.test(a),Y=/HuaweiBrowser/i.test(a),W=Y&&function(){const t=a.match(/HuaweiBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),q=m?"Chrome/"+y:D?"Safari/"+O:"NotSupportedBrowser",Q="file:"===location.protocol||"localhost"===location.hostname||/^\d+\.\d+\.\d+\.\d+$/.test(location.hostname),J=new RegExp("HeadlessChrome","i").test(a);const $=new Map([[g,["Firefox",I]],[T,["Edg",R]],[m,["Chrome",y]],[D,["Safari",O]],[b,["TBS",w]],[x&&u,["WeChat",k]],[M,["QQ(Mobile)",P]],[U,["QQ(Mobile X5)",P]],[Y,["HW",W]],[v,["EDGE",C]]]);function X(){let t="unknown",e="unknown";return $.get(!0)&&(t=$.get(!0)[0],e=$.get(!0)[1]),{name:t,version:e}}function z(){let t="unknown";return j&&(t="mac"),G&&(t="windows"),h&&(t="android"),d&&(t="iOS"),{name:t}}function Z(){return h||u||l}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.USER_CUSTOM_STATUS=e.CALL_EXPERMENTEL_API_TYPE=e.LOG_LEVEL=e.MODE_TYPE=e.VALID_VIDEO_PROFILE_LIST=e.BUSINESS_ID=e.ACTION_TYPE=e.CALL_ROLE=e.CALL_STATUS=e.CMD_TYPE=e.CMD_TYPE_LIST=e.CALL_TYPE=e.IOSOfflinePushType=void 0;var i=n(12);!function(t){t[t.APNs=0]="APNs",t[t.VoIP=1]="VoIP"}(e.IOSOfflinePushType||(e.IOSOfflinePushType={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.AUDIO_CALL=1]="AUDIO_CALL",t[t.VIDEO_CALL=2]="VIDEO_CALL"}(e.CALL_TYPE||(e.CALL_TYPE={})),e.CMD_TYPE_LIST=["","audioCall","videoCall"],function(t){t.AUDIO_CALL="audioCall",t.VIDEO_CALL="videoCall",t.HANG_UP="hangup",t.SWITCH_TO_AUDIO="switchToAudio",t.SWITCH_TO_AUDIO_CALL="switch_to_audio_call",t.SWITCH_TO_VIDEO="switchToVideo"}(e.CMD_TYPE||(e.CMD_TYPE={})),function(t){t.IDLE="idle",t.CALLING="calling",t.CONNECTED="connected"}(e.CALL_STATUS||(e.CALL_STATUS={})),function(t){t.UNKNOWN="",t.INVITER="inviter",t.INVITEE="invitee"}(e.CALL_ROLE||(e.CALL_ROLE={})),function(t){t[t.INVITE=1]="INVITE",t[t.CANCEL_INVITE=2]="CANCEL_INVITE",t[t.ACCEPT_INVITE=3]="ACCEPT_INVITE",t[t.REJECT_INVITE=4]="REJECT_INVITE",t[t.INVITE_TIMEOUT=5]="INVITE_TIMEOUT"}(e.ACTION_TYPE||(e.ACTION_TYPE={})),function(t){t[t.SIGNAL=1]="SIGNAL"}(e.BUSINESS_ID||(e.BUSINESS_ID={})),e.VALID_VIDEO_PROFILE_LIST=Object.keys(i.TUICommonDefine.VideoEncoderParams),function(t){t.AUDIO="audio",t.VIDEO="video"}(e.MODE_TYPE||(e.MODE_TYPE={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.RELEASE=1]="RELEASE",t[t.WARNING=2]="WARNING",t[t.ERROR=3]="ERROR",t[t.NONE=4]="NONE"}(e.LOG_LEVEL||(e.LOG_LEVEL={})),function(t){t[t.BASE=Math.pow(2,16)]="BASE",t[t.PRO=Math.pow(2,17)]="PRO",t[t.ULTIMATE=Math.pow(2,18)]="ULTIMATE"}(e.CALL_EXPERMENTEL_API_TYPE||(e.CALL_EXPERMENTEL_API_TYPE={})),function(t){t.NULL="",t.CALLING_USER_CUSTOM_STATUS_CALL_WAIT="call_wait",t.CALLING_USER_CUSTOM_STATUS_CALL_ACCEPT="call_accept"}(e.USER_CUSTOM_STATUS||(e.USER_CUSTOM_STATUS={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorCodeDictionary=void 0;!function(t){t[t.UNKNOWN=65535]="UNKNOWN",t[t.NO_NETWORK=2805]="NO_NETWORK",t[t.FAILURE_SWITCH_TO_AUDIO=60001]="FAILURE_SWITCH_TO_AUDIO",t[t.FAILURE_SWITCH_TO_VIDEO=60002]="FAILURE_SWITCH_TO_VIDEO",t[t.NOT_MICROPHONE_LIST=60003]="NOT_MICROPHONE_LIST",t[t.NOT_CAMERA_LIST=60004]="NOT_CAMERA_LIST",t[t.NOT_SUPPORT=60006]="NOT_SUPPORT",t[t.ERROR_PACKAGE_NOT_PURCHASED=-1001]="ERROR_PACKAGE_NOT_PURCHASED",t[t.ERROR_PACKAGE_NOT_SUPPORTED=-1002]="ERROR_PACKAGE_NOT_SUPPORTED",t[t.ERROR_TIM_VERSION_OUTDATED=-1003]="ERROR_TIM_VERSION_OUTDATED",t[t.ERROR_PERMISSION_DENIED=-1101]="ERROR_PERMISSION_DENIED",t[t.ERROR_GET_DEVICE_LIST_FAIL=-1102]="ERROR_GET_DEVICE_LIST_FAIL",t[t.ERROR_INIT_FAIL=-1201]="ERROR_INIT_FAIL",t[t.ERROR_PARAM_INVALID=-1202]="ERROR_PARAM_INVALID",t[t.ERROR_REQUEST_REFUSED=-1203]="ERROR_REQUEST_REFUSED",t[t.ERROR_REQUEST_REPEATED=-1204]="ERROR_REQUEST_REPEATED",t[t.ERROR_SCENE_NOT_SUPPORTED=-1205]="ERROR_SCENE_NOT_SUPPORTED",t[t.INVALID_PARAMETER_REQUIRED=-120200]="INVALID_PARAMETER_REQUIRED",t[t.INVALID_PARAMETER_TYPE=-120201]="INVALID_PARAMETER_TYPE",t[t.INVALID_PARAMETER_EMPTY=-120202]="INVALID_PARAMETER_EMPTY",t[t.INVALID_PARAMETER_RANGE=-120203]="INVALID_PARAMETER_RANGE",t[t.ERROR_SIGNALING_SEND_FAIL=-1401]="ERROR_SIGNALING_SEND_FAIL",t[t.ERROR_INVALID_INVITEID=8010]="ERROR_INVALID_INVITEID",t[t.ERROR_INVALID_SEND_FAIL=8021]="ERROR_INVALID_SEND_FAIL",t[t.ERROR_HTTP=3e4]="ERROR_HTTP",t[t.ERROR_BLACKLIST=20007]="ERROR_BLACKLIST"}(e.ErrorCodeDictionary||(e.ErrorCodeDictionary={})),e.default={UNKNOWN:65535,NO_NETWORK:2805,FAILURE_SWITCH_TO_AUDIO:60001,FAILURE_SWITCH_TO_VIDEO:60002,NOT_MICROPHONE_LIST:60003,NOT_CAMERA_LIST:60004,NOT_SUPPORT:60006,ERROR_PACKAGE_NOT_PURCHASED:-1001,ERROR_PACKAGE_NOT_SUPPORTED:-1002,ERROR_TIM_VERSION_OUTDATED:-1003,ERROR_PERMISSION_DENIED:-1101,ERROR_GET_DEVICE_LIST_FAIL:-1102,ERROR_INIT_FAIL:-1201,ERROR_PARAM_INVALID:-1202,ERROR_REQUEST_REFUSED:-1203,ERROR_REQUEST_REPEATED:-1204,ERROR_SCENE_NOT_SUPPORTED:-1205,INVALID_PARAMETER_REQUIRED:-120200,INVALID_PARAMETER_TYPE:-120201,INVALID_PARAMETER_EMPTY:-120202,INVALID_PARAMETER_RANGE:-120203,ERROR_SIGNALING_SEND_FAIL:-1401,ERROR_INVALID_INVITEID:8010,ERROR_INVALID_SEND_FAIL:8021,ERROR_HTTP:3e4,ERROR_BLACKLIST:20007}},function(t,e,n){var i;self,i=()=>(()=>{"use strict";var t={902:function(t,e,n){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(e,"__esModule",{value:!0});var o,s=n(266),l=n(466),u=n(402),c=n(882),d=n(271),p=n(884),h=n(900),_=n(172);!function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARING=2]="WARING",t[t.ERROR=3]="ERROR"}(o||(o={}));var f={metric:!0,context:!0},E=function(t,e,n){return void 0===n&&(n=0),(0,s.isPlainObject)(t)?(0,s.isPlainObject)(e)?(Object.keys(e).forEach((function(i){var r=t[i],a=e[i];t[i]=f[i]&&0===n?E(r,a,1):a})),t):t:(0,s.isPlainObject)(e)?e:{}},g={clsConfig:{endpoint:"",topicId:""}},I=function(){function t(t){var e=this;this.url="",this.uploadChannel="",this.sendClsPipe=null,this.sendEsPipe=null,this._logLevel=o.INFO,this._getReportDataList=[],this._blacklist=[];var n=t||g,i=n.clsConfig,s=n.esConfig,l=i.endpoint,_=i.topicId;this.esConfig=s,this.endpoint=l,this.topicId=_;var f=this.buildUploadUrl();this.url=f,this.initPageUnloadMonitor(),f&&(this.sendClsPipe=(0,u.createPipeline)([(0,h.filterSdkappIdPipe)(this),(0,p.createThrottlePipe)(this,5),(0,c.formatClsLog)(),(0,d.limitLengthPipe)(),function(t){return r(e,void 0,void 0,(function(){var e,n,i=this;return a(this,(function(o){return e=0,(n=function(){return r(i,void 0,void 0,(function(){var i;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.send({url:f,data:t})];case 1:return r.sent(),[3,3];case 2:return i=r.sent(),e<=2?(e++,setTimeout((function(){n()}),1e3)):console.debug(i),[3,3];case 3:return[2]}}))}))})(),[2]}))}))}])),this.updateBlacklist()}return t.prototype.initPageUnloadMonitor=function(){var t=this,e=this;!(0,s.isMiniProgram)()&&document&&"function"==typeof document.addEventListener&&document.addEventListener("visibilitychange",(function(){if("hidden"===document.visibilityState){var n=t.getCommonReportData(),i=E(n,{level:o.WARING,method:"PAGE_UNLOAD",type:"event"});if(e.esConfig)try{var s=e.esConfig,l=s.url,_=s.table;(0,u.createPipeline)([(0,h.filterSdkappIdPipe)(e),(0,p.createThrottlePipe)(e,1),(0,c.formatESLog)({table:_}),(0,d.limitLengthPipe)(),function(e){return r(t,void 0,void 0,(function(){var t;return a(this,(function(n){try{t=new Blob([JSON.stringify(e)],{type:"application/x-www-form-urlencoded"}),null===navigator||void 0===navigator||navigator.sendBeacon(l,t)}catch(t){console.debug(t)}return[2]}))}))}])(i)}catch(t){console.debug(t)}}}))},t.prototype.updateEsConfig=function(t){var e=this;try{if(t){this.esConfig=t;var n=t.url,i=t.table;n&&i&&(this.uploadChannel=n,this.sendEsPipe=(0,u.createPipeline)([(0,h.filterSdkappIdPipe)(this),(0,p.createThrottlePipe)(this,5),(0,c.formatESLog)({table:i}),(0,d.limitLengthPipe)(),function(t){return r(e,void 0,void 0,(function(){var e,i,o=this;return a(this,(function(s){return e=0,(i=function(){return r(o,void 0,void 0,(function(){var r;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.send({url:n,data:t})];case 1:return a.sent(),[3,3];case 2:return r=a.sent(),e<=2?(e++,setTimeout((function(){i()}),1e3)):console.debug(r),[3,3];case 3:return[2]}}))}))})(),[2]}))}))}]))}}catch(t){console.debug(t)}},t.prototype.updateGetReportData=function(t){"function"==typeof t&&this._getReportDataList.push(t)},t.prototype.updateBlacklist=function(){return r(this,void 0,void 0,(function(){var t,e,n;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(0,l.request)({url:_.RAINBOW_BLACK_LIST_API})];case 1:return t=i.sent().data,"string"==typeof(e=null==t?void 0:t.blackList)&&(this._blacklist=e.split(",")),[3,3];case 2:return n=i.sent(),console.debug("update blacklist fail",n),[3,3];case 3:return[2]}}))}))},t.prototype.getBlackList=function(){return this._blacklist},t.prototype.setLogLevel=function(t){"number"!=typeof t&&(t=o.INFO),this._logLevel=t},t.prototype.createLogFunc=function(t){var e=this;return function(n,i){e.log(n,i,{level:t})}},t.prototype.buildUploadUrl=function(){return this.endpoint&&this.topicId?"".concat(this.endpoint,"/tracklog?topic_id=").concat(this.topicId):""},t.prototype.sendPipe=function(t){"function"==typeof this.sendClsPipe&&this.sendClsPipe(t),"function"==typeof this.sendEsPipe&&this.sendEsPipe(t)},t.prototype.info=function(t,e){this.log(t,e,{level:o.INFO})},t.prototype.debug=function(t,e){this.log(t,e,{level:o.DEBUG})},t.prototype.warn=function(t,e){this.log(t,e,{level:o.WARING})},t.prototype.error=function(t,e){this.log(t,e,{level:o.ERROR})},t.prototype.log=function(t,e,n){try{var r=n||{},a=r.level;if(r.topicId,this._logLevel<=a){var o=this.getCommonReportData(),s=E(o,i({level:a,method:t},e));this.sendPipe(s)}}catch(t){console.debug(t)}},t.prototype.getCommonReportData=function(){for(var t={},e=0;e<this._getReportDataList.length;e++)t=E(t,this._getReportDataList[e]());return t},t.prototype.send=function(t){return r(this,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(a){switch(a.label){case 0:n=(e=t||{}).url,i=e.data,a.label=1;case 1:return a.trys.push([1,4,,5]),n?[4,(0,l.request)({url:n,data:i,method:"post"})]:[3,3];case 2:a.sent(),a.label=3;case 3:return[3,5];case 4:throw r=a.sent(),console.debug(r),new Error(r);case 5:return[2]}}))}))},t}();e.default=I},900:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.filterSdkappIdPipe=void 0,e.filterSdkappIdPipe=function(t){return function(e,n){try{var i=e.sdkappid,r=t.getBlackList();if(null==r?void 0:r.includes(String(i)))throw new Error("this sdkappid in blacklist");n(e)}catch(t){console.debug(t)}}}},793:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=void 0;var i=n(266);e.formatClsLog=function(){return function(t,e){try{e({logs:null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,i.isPlainObject)(t[n]))try{e[n]=(0,i.stringifyPlus)(t[n])}catch(t){console.debug(t)}else"time"===n&&(e[n]=new Date(t[n]).toISOString()),e[n]=t[n]+""})),{contents:e,time:t.time}})),source:""})}catch(t){console.debug(t)}}}},713:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatESLog=void 0;var i=n(266);e.formatESLog=function(t){var e=t.table;return function(t,n){try{var r=null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,i.isPlainObject)(t[n]))try{e[n]=(0,i.stringifyPlus)(t[n])}catch(t){console.debug(t)}else e[n]="level"===n?t[n]+"":"time"===n?new Date(t[n]).toISOString():t[n]})),e}));n({table:e,report:r})}catch(t){console.debug(t)}}}},882:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=e.formatESLog=void 0;var i=n(793);Object.defineProperty(e,"formatClsLog",{enumerable:!0,get:function(){return i.formatClsLog}});var r=n(713);Object.defineProperty(e,"formatESLog",{enumerable:!0,get:function(){return r.formatESLog}})},402:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createPipeline=void 0;var i=n(266);e.createPipeline=function(t){if(!t||!t.reduce||!t.length)throw new TypeError("createPipeline need at least one function param");return 1===t.length?function(e,n){t[0](e,n||i.noop)}:t.reduce((function(t,e){return function(n,r){return void 0===r&&(r=i.noop),t(n,(function(t){return null==e?void 0:e(t,r)}))}}))}},271:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.limitLengthPipe=e.MAX_LOG_LENGTH=void 0;var i=n(266);e.MAX_LOG_LENGTH=102400,e.limitLengthPipe=function(){return function(t,n){try{var r=(t=t||{}).logs,a=void 0===r?[]:r;t.logs=null==a?void 0:a.map((function(t){var n=e.MAX_LOG_LENGTH,r=t.contents;return Object.keys(r).forEach((function(t){var e=r[t];try{e&&e.length>n&&(r[t]=null==e?void 0:e.substring(0,n))}catch(a){console.debug("size of content > limitSize"),r[t]=(0,i.stringifyPlus)(e).substring(0,n)}})),t})),n(t)}catch(t){console.debug(t)}}}},884:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createThrottlePipe=void 0,e.createThrottlePipe=function(t,e){var n,i=[];return function(r,a){if(Array.isArray(r)?i=i.concat(r):i.push(r),e&&i.length>=e||t.sendNow&&i.length>0)return a(i.splice(0,i.length)),void(n&&clearTimeout(n));n&&clearTimeout(n),n=setTimeout((function(){n=null,i.length>0&&a(i.splice(0,i.length))}),t.delay||1e3)}}},466:function(t,e,n){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},o=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};Object.defineProperty(e,"__esModule",{value:!0}),e.request=void 0;var s=n(732),l=n(377),u=n(266);e.request=function(t){return r(void 0,void 0,void 0,(function(){var e=t.url,n=t.data,r=t.header,c=void 0===r?{}:r,d=t.method,p=void 0===d?"GET":d,h=t.dataType,_=t.responseType,f=o(t,["url","data","header","method","dataType","responseType"]);return a(this,(function(t){return(0,u.isBrowser)()?[2,(0,l.requestXHR)(e,n,{headers:c,method:p,responseType:_,dataType:h})]:(0,u.isMiniProgram)()?[2,(0,s.requestWeapp)(i({url:e,data:n,header:c,method:p,dataType:h,responseType:_},f))]:(console.debug("unsupport env"),[2])}))}))}},732:function(t,e,n){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.requestWeapp=function(t){return r(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:n.trys.push([0,5,6,7]),n.label=1;case 1:return l>=s?[4,(0,o.startBlocking)()]:[3,3];case 2:return n.sent(),[3,1];case 3:return l++,[4,new Promise((function(e,n){wx.request(i(i({},t),{success:function(t){e(t)},fail:function(t){n(t)}}))}))];case 4:return[2,n.sent()];case 5:return e=n.sent(),[2,Promise.reject(e)];case 6:return l--,(0,o.resolveFirstBlock)(),[7];case 7:return[2]}}))}))};var o=n(640),s=2,l=0},377:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=u,e.requestXHR=function(t){return i(this,arguments,void 0,(function(t,e,n){var c,d=this;return void 0===e&&(e={}),void 0===n&&(n={}),r(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,3,4]),[4,new Promise((function(c,p){return i(d,void 0,void 0,(function(){var i,d,h,_,f,E;return r(this,(function(r){switch(r.label){case 0:return l>=s?[4,(0,o.startBlocking)()]:[3,2];case 1:return r.sent(),[3,0];case 2:return l++,i=n.method,d=n.headers,h=void 0===d?{}:d,_=n.responseType,f=void 0===_?"json":_,i=(i||"get").toUpperCase(),Object.assign(h,{"Content-type":"application/json"}),(E=new window.XMLHttpRequest).responseType=f,E.timeout=1e4,E.onreadystatechange=function(){4===E.readyState&&(200===E.status?c({data:E.response}):p({code:E.status,msg:E.statusText}))},E.ontimeout=function(t){p({code:E.status,msg:E.statusText})},E.onloadend=function(){E&&(u((function(t){c(t)}),(function(t){p(t)}),{status:E.status,statusText:E.statusText}),E=null)},E.onabort=function(){E&&(p(new Error("Request aborted")),E=null)},E.onerror=function(){p(new Error("Network Error")),E=null},"GET"===i?t="".concat(t).concat(-1===t.indexOf("?")?"?":"&").concat(a.default.stringify(e)):"POST"===i&&(e=JSON.stringify(e)),E.open(i,t,!0),Object.keys(h).forEach((function(t){E.setRequestHeader(t,h[t])})),E.send("POST"===i?e:null),[2]}}))}))}))];case 1:return[2,p.sent()];case 2:throw c=p.sent(),new Error(c);case 3:return l--,(0,o.resolveFirstBlock)(),[7];case 4:return[2]}}))}))};var a=n(383),o=n(640),s=2,l=0;function u(t,e,n){n.status?e(new Error("Request failed with status code "+n.status)):t(n)}},172:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RAINBOW_BLACK_LIST_API=void 0,e.RAINBOW_BLACK_LIST_API="https://jsonschema.qpic.cn/87084b1b6d263426b92926cfa5fa23af/18f29786d25587b5eb162d5e9f724b1e/blackList"},266:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.date2ISOString=e.stringifyPlus=e.noop=e.isBrowser=e.isMiniProgram=e.isPlainObject=e.appendParams=void 0,e.appendParams=function(t,n){void 0===n&&(n={});var i=[];return Object.keys(n).forEach((function(t){var r=n[t];if(void 0!==r){if((0,e.isPlainObject)(r))try{r=JSON.stringify(r)}catch(t){}i.push("".concat(t,"=").concat(encodeURIComponent(r)))}})),i.length?(t.indexOf("?")>-1?"".concat(t,"&"):"".concat(t,"?"))+i.join("&"):t},e.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},e.isMiniProgram=function(){try{return!(!(null===wx||void 0===wx?void 0:wx.request)||!(null===wx||void 0===wx?void 0:wx.connectSocket))}catch(t){return!1}},e.isBrowser=function(){try{return!(0,e.isMiniProgram)()&&"undefined"!=typeof window&&void 0!==window.document}catch(t){return!1}},e.noop=function(){};var n=function(){var t=new WeakSet;return function(e,n){if(n instanceof Error)return"Error.message: ".concat(n.message," \n Error.stack: ").concat(n.stack);if("object"==typeof n&&null!==n){if(t.has(n))return"[Circular ".concat(e||"root","]");t.add(n)}return n}};e.stringifyPlus=function(t){if("string"==typeof t)return t;try{return t instanceof Error?(JSON.stringify(t,n())||"undefined").replace(/"/gim,""):JSON.stringify(t,n())||"undefined"}catch(t){return"error happen when aegis stringify: \n ".concat(t.message," \n ").concat(t.stack)}},e.date2ISOString=function(){var t,e=new Date,n=e.toISOString(),i=e.getTimezoneOffset()/60;return t=i<0?i>-10?"+0".concat(Math.abs(100*i)):"+".concat(Math.abs(100*i)):i>=10?"-".concat(100*i):"-0".concat(100*i),n.replace("Z",t)}},383:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=n(266);e.default={stringify:function(t){return t?Object.keys(t).map((function(e){var n=t[e];if((0,i.isPlainObject)(n))n=JSON.stringify(n);else{if("string"!=typeof n&&"number"!=typeof n)return"";n=+n}return encodeURIComponent(e)+"="+encodeURIComponent(n)})).filter((function(t){return t.length>0})).join("&"):""}}},640:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.startBlocking=e.resolveFirstBlock=void 0;var n=[];e.startBlocking=function(){var t,e=new Promise((function(e){t=e}));return n.push({promise:e,resolve:t}),e},e.resolveFirstBlock=function(){n.length&&(n[0].resolve(),n.shift())}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,n),a.exports}var i={};return(()=>{var t=i;Object.defineProperty(t,"__esModule",{value:!0});var e=n(902),r=null;t.default=function(t){return r||(r=new e.default(t)),r}})(),i})(),t.exports=i()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TRTCQuality=e.DEVICE_TYPE=e.TRTCVideoMirrorType=e.TRTCVideoFillMode=e.TRTCVideoRotation=void 0,function(t){t[t.TRTCVideoRotation0=0]="TRTCVideoRotation0",t[t.TRTCVideoRotation90=1]="TRTCVideoRotation90",t[t.TRTCVideoRotation180=2]="TRTCVideoRotation180",t[t.TRTCVideoRotation270=3]="TRTCVideoRotation270"}(e.TRTCVideoRotation||(e.TRTCVideoRotation={})),function(t){t[t.TRTCVideoFillMode_Fill=0]="TRTCVideoFillMode_Fill",t[t.TRTCVideoFillMode_Fit=1]="TRTCVideoFillMode_Fit"}(e.TRTCVideoFillMode||(e.TRTCVideoFillMode={})),function(t){t[t.TRTCVideoMirrorType_Auto=0]="TRTCVideoMirrorType_Auto",t[t.TRTCVideoMirrorType_Enable=1]="TRTCVideoMirrorType_Enable",t[t.TRTCVideoMirrorType_Disable=2]="TRTCVideoMirrorType_Disable"}(e.TRTCVideoMirrorType||(e.TRTCVideoMirrorType={})),function(t){t.CAMERA="camera",t.SPEAKER="speaker",t.MICROPHONES="microphones",t.MICROPHONE="microphone",t.AUDIO="audio",t.VIDEO="video"}(e.DEVICE_TYPE||(e.DEVICE_TYPE={})),function(t){t[t.TRTCQuality_Unknown=0]="TRTCQuality_Unknown",t[t.TRTCQuality_Excellent=1]="TRTCQuality_Excellent",t[t.TRTCQuality_Good=2]="TRTCQuality_Good",t[t.TRTCQuality_Poor=3]="TRTCQuality_Poor",t[t.TRTCQuality_Bad=4]="TRTCQuality_Bad",t[t.TRTCQuality_Vbad=5]="TRTCQuality_Vbad",t[t.TRTCQuality_Down=6]="TRTCQuality_Down"}(e.TRTCQuality||(e.TRTCQuality={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=n(7),s=n(15),l=function(t){function e(e){var n=e.name,i=void 0===n?"":n,r=e.code,l=void 0===r?o.default.UNKNOWN:r,u=e.message,c=void 0===u?"":u,d=e.messageParams,p=void 0===d?{}:d,h=(e.extraCode,e.fnName),_=void 0===h?"":h,f=t.call(this,c||s.getErrorMessage({code:l,params:a({fnName:_},p)}))||this;return f.name="TUICallEngineError",f.functionName="",f.name=i||f.name,f.code=l,f.functionName=_||f.functionName,f}return r(e,t),e.prototype.getCode=function(){return this.code},e}(Error);e.default=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERROR_CN_MESSAGE=e.ERROR_MESSAGE=void 0,e.ERROR_MESSAGE={NO_NETWORK:"未连接到网络",FAILURE_SWITCH_TO_AUDIO:"switch to audio call error",FAILURE_SWITCH_TO_VIDEO:"switch to video call error",NOT_MICROPHONE_LIST:"No microphone device",NOT_CAMERA_LIST:"No camera device",ERROR_PACKAGE_NOT_PURCHASED:"You do not have TUICallKit package, please open the free experience in the console: https://console.intl.cloud.tencent.com/im/detail or purchase the official package: ${purchaseAddress}",ERROR_PACKAGE_NOT_SUPPORTED:"The package you purchased does not support this ability. You can refer to here to purchase: ${purchaseAddress}",ERROR_TIM_VERSION_OUTDATED:"TIM SDK version is too old, Please upgrade version",ERROR_PERMISSION_DENIED:"camera permission refused / microphone permission refused. You can perform the trtc capability test at https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html to check whether the current environment supports audio and video calls",ERROR_GET_DEVICE_LIST_FAIL:"Failed to get device list",ERROR_INIT_FAIL:"init or login is not complete, this API needs to be used after init. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",ERROR_REQUEST_REFUSED:"The API is not support in the current state. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",ERROR_REQUEST_REPEATED:"The current method is being executed, please do not call it repeatedly",ERROR_REQUEST_REPEATED_SWITCH:"Consistent with the current call type, please do not switch repeatedly",ERROR_SCENE_NOT_SUPPORTED:"In the current call scene, this function is not supported",ERROR_SIGNALING_SEND_FAIL:"signaling failed to send",ERROR_INVALID_INVITEID:"inviteID is invalid or invitation has been processed. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/84363#e97ea97b-7812-42ed-89b7-2a3840ac0e3f",ERROR_INVALID_SEND_FAIL:"Failed to send message, common reasons: the called userID or groupID does not exist. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/84363#661be1b0-f649-4199-a343-958c3f4f4bbb",ERROR_PARAM_INVALID:"invalid parameter",ERROR_HTTP:"The current page is detected to be using the http protocol(or localhost). To ensure smooth access and experience of all functions of TUICallEngine SDK for production environment users, please use the https protocol to access the audio and video application page. More Info: https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/en/tutorial-05-info-browser.html#h2-3",NOT_SUPPORT:"The current page does not have webRTC capability. You can perform the trtc capability test at https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html to check whether the current environment supports audio and video calls"},e.ERROR_CN_MESSAGE={NO_NETWORK:"未连接到网络",FAILURE_SWITCH_TO_AUDIO:"切换语音通话失败",FAILURE_SWITCH_TO_VIDEO:"切换视频通话失败",NOT_MICROPHONE_LIST:"没有麦克风设备",NOT_CAMERA_LIST:"没有摄像头设备",ERROR_PACKAGE_NOT_PURCHASED:"您的应用还未开通音视频通话TUICallKit能力您可以去控制台申请免费体验: https://console.cloud.tencent.com/im/detail 或购买通话能力套餐包: ${purchaseAddress}",ERROR_PACKAGE_NOT_SUPPORTED:"您暂不支持使用该能力,请前往如下购买页购买开通: ${purchaseAddress}",ERROR_TIM_VERSION_OUTDATED:"TIM SDK 版本太旧,请升级版本",ERROR_PERMISSION_DENIED:"摄像头/麦克风权限被拒绝,可以前往: https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html 进行 trtc 能力测试,查看当前环境是否支持音视频通话",ERROR_GET_DEVICE_LIST_FAIL:"获取设备列表失败",ERROR_INIT_FAIL:"TUICallEngine 初始化登录未完成,需要在 init 或 login 完成后使用此 API 。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",ERROR_REQUEST_REFUSED:"当前通话状态无法使用该 API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",ERROR_REQUEST_REPEATED:"当前方法正在执行中,请勿重复调用",ERROR_REQUEST_REPEATED_SWITCH:"与当前通话类型一致,请勿重复切换",ERROR_SCENE_NOT_SUPPORTED:"当前通话场景不支持该功能",ERROR_SIGNALING_SEND_FAIL:"信令发送失败",ERROR_INVALID_INVITEID:"邀请 ID 无效或邀请已处理。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#e97ea97b-7812-42ed-89b7-2a3840ac0e3f",ERROR_INVALID_SEND_FAIL:"消息发送失败,常见原因:被叫用户 userID 或群 groupID 不存在。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#661be1b0-f649-4199-a343-958c3f4f4bbb",ERROR_PARAM_INVALID:"参数错误",ERROR_HTTP:"检测到当前页面正处于 http 协议下,为确保生产环境用户顺畅接入和体验 TUICallEngine SDK 的全部功能,请使用 https 协议(或 localhost)访问音视频应用页面。详情请前往https://web.sdk.qcloud.com/trtc/webrtc/v5/doc/zh-cn/tutorial-05-info-browser.html#h2-3",NOT_SUPPORT:"当前页面不具备 webRTC 能力。可以前往: https://web.sdk.qcloud.com/trtc/webrtc/demo/detect/index.html 进行 trtc 能力测试,查看当前环境是否支持音视频通话"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TUICallCameraPosition=e.TUICommonDefine=e.TUICallType=void 0,e.TUICallType={AUDIO_CALL:1,VIDEO_CALL:2,DEVCIED_CAMERA:"camera",DEVCIED_MICROPHONES:"microphones"},e.TUICommonDefine={VideoEncoderParams:{"120p":"120p","120p_2":"120p_2","180p":"180p","180p_2":"180p_2","240p":"240p","360p":"360p","360p_2":"360p_2","480p":"480p","480p_2":"480p_2","720p":"720p","1080p":"1080p","1440p":"1440p","4K":"4K"}},function(t){t[t.FRONT=0]="FRONT",t[t.BACK=1]="BACK"}(e.TUICallCameraPosition||(e.TUICallCameraPosition={}))},function(t,e,n){"use strict";n.r(e);var i=n(1),r=n(2),a=n(7),o=n.n(a),s=n(11);class l{constructor(t){this.sdkappid="",this.version="",this.userid="",this.platform="",this.useragent="",this.method=t,this.codeint=1,this.calltype=1,this.talktime=0,this.message="",this.text="",this.startts=Date.now(),this.endts=0,this.timespan=0,this.time="",this.networktype="",this.host=Object(i.getHostType)()}static bindController(t){l.prototype._eventStatController=t}setCommonInfo(t){const{SDKAppID:e,version:n,userID:r,platform:a,scene:o}=t;this.sdkappid=e,this.version=""+n,this.userid=r,this.platform=a,this.scene=o,this.time=Object(i.date2ISOString)(),this.startts&&this.endts&&!this.timespan&&(this.timespan=Math.abs(this.endts-this.startts))}setEnd(t=!1){this.endts=Date.now(),t?this._eventStatController.pushIn(this):setTimeout(()=>{this._eventStatController.pushIn(this)},0)}setError(t,e,n){return this.setNetworkType(n),e?(t.code&&this.setCode(t.code),t.message&&this.setMessage(t.message)):(this.setCode(o.a.NO_NETWORK),this.setMessage(s.ERROR_MESSAGE.NO_NETWORK)),this}setCode(t){return"ECONNABORTED"===t&&(this.codeint=103),Object(i.isNumber)(t)?this.codeint=t:r.default.warn("SSOLogData.setCode value not a number, please check!",t,typeof t),this}setMessage(t){return Object(i.isString)(t)?(this.message=t,this):this}setText(t){return Object(i.isNumber)(t)?this.text=t.toString():Object(i.isString)(t)&&(this.text=t),this}setTalkTime(t){return this.talktime=t,this}setMessageType(t){return this.msgType=t,this}setCallType(t){return this.calltype=t,this}setNetworkType(t){return Object(i.isUndefined)(t)?r.default.warn("SSOLogData.setNetworkType value is undefined, please check!"):this.networktype=t,this}}e.default=l},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorMessageCN=e.ErrorMessage=e.getErrorMessage=void 0;var i=n(1),r=n(7),a=n(11);e.getErrorMessage=function(t){var n,a=t.code,o=t.params,s=t.enableDocLink,l=void 0!==s&&s,u=t.languageList,c=void 0===u?["en","zh-CN"]:u,d="",p=r.ErrorCodeDictionary[a];try{c.forEach((function(t){switch(t){case"en":n=e.ErrorMessage[p];break;case"zh-CN":n=e.ErrorMessageCN[p]}i.isFunction(n)?(d=d?d+" ":d,d+=n(o)):i.isString(n)&&(d=n)}))}catch(t){n=e.ErrorMessage.UNKNOWN_ERROR}return l&&(d+=" doc:"),d},e.ErrorMessage={ERROR_INIT_FAIL:function(t){return t.fnName+": "+a.ERROR_MESSAGE.ERROR_INIT_FAIL+"."},ERROR_SCENE_NOT_SUPPORTED:function(t){return t.fnName+": "+a.ERROR_MESSAGE.ERROR_SCENE_NOT_SUPPORTED+"."},ERROR_REQUEST_REFUSED:function(t){var e=t.value;return a.ERROR_MESSAGE.ERROR_REQUEST_REFUSED+". customStatus: "+e+"."},ERROR_PARAM_INVALID:function(t){return"the parameters of the '"+t.fnName+"' you called does not meet the requirements, please check the API documentation."},INVALID_PARAMETER_REQUIRED:function(t){var e=t.key,n=t.rule,i=t.fnName,r=t.value;return"'"+(e||n.name)+"' is a required param when calling "+i+"(), received: "+r+"."},INVALID_PARAMETER_TYPE:function(t){var e=t.key,n=t.rule,r=t.fnName,a=t.value;return"'"+(""+(e||n.name))+"' must be type of "+(Array.isArray(n.type)?n.type.join("|"):n.type)+" when calling "+r+"(), received type: "+i.getValueType(a)+"."},INVALID_PARAMETER_EMPTY:function(t){var e=t.key,n=t.rule,i=t.fnName;return"'"+(e||n.name)+"' cannot be empty when calling "+i+"()."},INVALID_PARAMETER_RANGE:function(t){var e=t.key,n=t.rule,r=t.fnName,a=t.value;return i.isArray(n.values)?"'"+(e||n.name)+"' must be one of "+n.values.join("|")+" when calling "+r+"(), received: "+a+".":i.isString(n.values)&&-1!==n.values.indexOf("~")?"'"+(e||n.name)+"' must be the range of "+n.values+" when calling "+r+"(), received: "+a+".":void 0},ERROR_REQUEST_REPEATED:function(t){var e=t.fnName;return"you are already "+e+"(), cannot repeated call '"+e+"'."},ERROR_HTTP:function(){return a.ERROR_MESSAGE.ERROR_HTTP+"."},ERROR_TIM_VERSION_OUTDATED:function(){return a.ERROR_MESSAGE.ERROR_TIM_VERSION_OUTDATED+" >= 2.21.2."},ERROR_PACKAGE_NOT_SUPPORTED:function(){return a.ERROR_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED+"."},FAILURE_SWITCH_TO_AUDIO:function(){return a.ERROR_MESSAGE.FAILURE_SWITCH_TO_AUDIO+"."},NOT_MICROPHONE_LIST:function(t){var e=t.fnName,n=t.error;return"NotFoundError, no microphone detected, please check your device and the configuration on '"+e+"'"+(n?", error: "+n.toString()+".":".")},NOT_CAMERA_LIST:function(t){var e=t.fnName,n=t.error;return"NotFoundError, no camera detected, please check your device and the configuration on '"+e+"'"+(n?", error: "+n.toString()+".":".")},ERROR_PERMISSION_DENIED:function(t){var e=t.fnName,n=t.error;return"NotAllowedError, you have disabled camera/microphone access, please allow the current application "+e+" to use the camera/microphone. "+(n?", error: "+n.toString()+".":".")},ERROR_INVALID_SEND_FAIL:function(){return a.ERROR_MESSAGE.ERROR_INVALID_SEND_FAIL+"."},UNKNOWN_ERROR:function(t){var e=t.fnName,n=t.error;return"'"+e+"' throw unknown exception"+(n?", error: "+n.toString()+".":".")}},e.ErrorMessageCN={ERROR_INIT_FAIL:function(t){return t.fnName+": "+a.ERROR_CN_MESSAGE.ERROR_INIT_FAIL+"。"},ERROR_SCENE_NOT_SUPPORTED:function(t){return t.fnName+": "+a.ERROR_CN_MESSAGE.ERROR_SCENE_NOT_SUPPORTED+"。"},ERROR_REQUEST_REFUSED:function(t){var e=t.value;return a.ERROR_CN_MESSAGE.ERROR_REQUEST_REFUSED+". customStatus: "+e+"。"},ERROR_PARAM_INVALID:function(t){return"the parameters of the '"+t.fnName+"' you called does not meet the requirements, please check the API documentation."},INVALID_PARAMETER_REQUIRED:function(t){var e=t.key,n=t.rule,i=t.fnName,r=t.value;return"调用 "+i+"() 方法的时候 '"+(e||n.name)+"' 是必须的参数, 收到的值为: "+r+"。"},INVALID_PARAMETER_TYPE:function(t){var e=t.key,n=t.rule,r=t.fnName,a=t.value;return"调用 "+r+"() 方法的时候 '"+(""+(e||n.name))+"' 必须是 "+(Array.isArray(n.type)?n.type.join("|"):n.type)+" 类型, 收到的类型是: "+i.getValueType(a)+"。"},INVALID_PARAMETER_EMPTY:function(t){var e=t.key,n=t.rule,i=t.fnName;t.value;return"调用 "+i+"() 的时候 '"+(e||n.name)+"' 不能是空。"},INVALID_PARAMETER_RANGE:function(t){var e=t.key,n=t.rule,r=t.fnName,a=t.value;return i.isArray(n.values)?"调用 "+r+"() 的时候 '"+(e||n.name)+"' 必须是 "+n.values.join("|")+" 的其中一种, 收到的是: "+a+"。":i.isString(n.values)&&-1!==n.values.indexOf("~")?"调用 "+r+"() 的时候 '"+(e||n.name)+"' 范围是 "+n.values+", 收到的是: "+a+"。":void 0},ERROR_REQUEST_REPEATED:function(t){var e=t.fnName;return"你已经调用 "+e+"(), 请勿重复调用 '"+e+"'。"},ERROR_HTTP:function(){return a.ERROR_CN_MESSAGE.ERROR_HTTP+"。"},ERROR_TIM_VERSION_OUTDATED:function(){return a.ERROR_CN_MESSAGE.ERROR_TIM_VERSION_OUTDATED+" >= 2.21.2。"},ERROR_PACKAGE_NOT_SUPPORTED:function(){return a.ERROR_CN_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED+"。"},FAILURE_SWITCH_TO_AUDIO:function(){return a.ERROR_CN_MESSAGE.FAILURE_SWITCH_TO_AUDIO+"。"},NOT_MICROPHONE_LIST:function(t){var e=t.fnName,n=t.error;return"NotFoundError未检测到麦克风设备请检查您的设备和麦克风上的配置 '"+e+"'"+(n?", error: "+n.toString()+".":".")},NOT_CAMERA_LIST:function(t){var e=t.fnName,n=t.error;return"NotFoundError未检测到摄像头设备请检查您的设备和摄像头上的配置 '"+e+"'"+(n?", error: "+n.toString()+".":".")},ERROR_PERMISSION_DENIED:function(t){t.fnName;var e=t.error;return"NotAllowedError, 您已禁用摄像头/麦克风访问权限,请允许当前应用程序使用摄像头/麦克风。"+(e?", error: "+e.toString()+".":".")},ERROR_INVALID_SEND_FAIL:function(){return a.ERROR_CN_MESSAGE.ERROR_INVALID_SEND_FAIL+"."}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TUICallEvent=void 0,e.TUICallEvent={ERROR:"onError",SDK_READY:"sdkReady",ON_CALL_BEGIN:"onCallBegin",INVITED:"onInvited",ON_CALL_RECEIVED:"onCallReceived",USER_ACCEPT:"onUserAccept",USER_ENTER:"onUserEnter",USER_LEAVE:"onUserLeave",REJECT:"onReject",NO_RESP:"onNoResp",LINE_BUSY:"onLineBusy",CALLING_CANCEL:"onCallingCancel",ON_CALL_CANCELED:"onCallCanceled",KICKED_OUT:"onKickedOut",CALLING_TIMEOUT:"onCallingTimeout",CALL_END:"onCallEnd",CALLING_END:"onCallEnd",USER_VIDEO_AVAILABLE:"onUserVideoAvailable",USER_AUDIO_AVAILABLE:"onUserAudioAvailable",USER_VOICE_VOLUME:"onUserVoiceVolume",GROUP_CALL_INVITEE_LIST_UPDATE:"onGroupCallInviteeListUpdate",CALL_TYPE_CHANGED:"onCallTypeChanged",DEVICED_UPDATED:"onDeviceUpdated",ON_USER_NETWORK_QUALITY_CHANGED:"onUserNetworkQualityChanged",MESSAGE_SENT_BY_ME:"onMessageSentByMe",CALL_MESSAGE:"CALL_MESSAGE"}},function(t,e,n){"use strict";(function(e){var i=n(3),r=n(46),a=n(23),o={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!i.isUndefined(t)&&i.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var l,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(l=n(24)),l),transformRequest:[function(t,e){return r(e,"Accept"),r(e,"Content-Type"),i.isFormData(t)||i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t)?t:i.isArrayBufferView(t)?t.buffer:i.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):i.isObject(t)||e&&"application/json"===e["Content-Type"]?(s(e,"application/json"),function(t,e,n){if(i.isString(t))try{return(e||JSON.parse)(t),i.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional,n=e&&e.silentJSONParsing,r=e&&e.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||r&&i.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw a(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],(function(t){u.headers[t]={}})),i.forEach(["post","put","patch"],(function(t){u.headers[t]=i.merge(o)})),t.exports=u}).call(this,n(45))},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return _}));var i=n(2),r=n(1);class a{constructor(){this._table="timweb-trtccalling",this._report=[]}pushIn(t){i.default.debug("SSOLogBody.pushIn",this._report.length,t),this._report.push(t)}backfill(t){Object(r.isArray)(t)&&0!==t.length&&(i.default.debug("SSOLogBody.backfill",this._report.length,t.length),this._report.unshift(...t))}getLogsNumInMemory(){return this._report.length}isEmpty(){return 0===this._report.length}_reset(){this._report.length=0,this._report=[]}getTable(){return this._table}getLogsInMemory(){const t=this._report.slice();return this._reset(),t}}var o=n(13),s=n(19),l=n(31),u=n.n(l);const c={CURRENT:{COMMON:"https://webim.tim.qq.com"},PRODUCTION:{COMMON:"https://webim.tim.qq.com"},OVERSEA_PRODUCTION:{COMMON:"https://api.im.qcloud.com"},SANDBOX:{COMMON:"https://events.tim.qq.com"},TEST:{COMMON:"https://test.tim.qq.com"}},d={IM_OPEN_STAT:"imopenstat"},p={TIM_WEB_TRTCCALLING_REPORT:"tweb_trtccalling_report"},h={imopenstat:"v4"};class _{constructor(){this.TAG="trtccalling-ssolog-event",this._reportBody=new a,this._version=s.version||"",this.MIN_THRESHOLD=20,this.MAX_THRESHOLD=100,this.WAITING_TIME=6e4,this.INTERVAL=2e4,this._timerID=0,this._resetLastReportTime(),this._startReportTimer(),this._retryCount=0,this.MAX_RETRY_COUNT=3}reportAtOnce(){i.default.debug("EventStatController.reportAtOnce"),this._report()}pushIn(t){t instanceof o.default&&(t.setCommonInfo({SDKAppID:Number(sessionStorage.getItem("sdkAppId")),version:this._version,userID:sessionStorage.getItem("userId")}),this._reportBody.pushIn(t),this._report())}_resetLastReportTime(){this._lastReportTime=Date.now()}_startReportTimer(){this._timerID=setInterval(()=>{Date.now()<this._lastReportTime+this.WAITING_TIME||this._reportBody.isEmpty()||this._report()},this.INTERVAL)}_stopReportTimer(){this._timerID>0&&(clearInterval(this._timerID),this._timerID=0)}_report(){if(this._reportBody.isEmpty())return;const t=Math.ceil(+new Date/1e3),e=sessionStorage.getItem("sdkAppId"),n=this._reportBody.getLogsInMemory(),a={table:this._reportBody.getTable(),report:n},o=`${c.CURRENT.COMMON}/${h.imopenstat}/${d.IM_OPEN_STAT}/${p.TIM_WEB_TRTCCALLING_REPORT}/?sdkappid=${e}&reqtime=${t}`;u.a.post(o,JSON.stringify(a)).then(()=>{this._resetLastReportTime(),this._retryCount>0&&(i.default.debug("EventStatController.report retry success"),this._retryCount=0)}).catch(t=>{i.default.warn("EventStatController.report, error:"+Object(r.stringifyError)(t)),this._reportBody.backfill(n);this._reportBody.getLogsNumInMemory()>this.MAX_THRESHOLD||this._retryCount===this.MAX_RETRY_COUNT||0===this._timerID?this._retryCount=0:this._retryCount+=1})}reset(){i.default.log("EventStatController.reset"),this._stopReportTimer(),this._report()}}},function(t){t.exports=JSON.parse('{"name":"tuicall-engine-webrtc","version":"3.1.5","description":"腾讯云 tuicall-engine-webrtc","main":"index","private":true,"dependencies":{"@tencentcloud/chat":"latest","axios":"^0.21.0","EventEmitter":"^1.0.0","rtc-ai-denoiser":"latest","trtc-cloud-js-sdk":"^2.4.0","trtc-js-sdk":"latest","tuikit-logger":"latest"},"devDependencies":{"@babel/preset-typescript":"^7.12.7","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0","docdash-blue":"^1.1.9","eslint":"^7.27.0","eslint-config-google":"^0.14.0","eslint-plugin-prettier":"^4.0.0","fs-extra":"^9.0.1","jsdoc":"^3.6.11","prettier":"^2.5.0","pretty":"^2.0.0","replace":"^1.2.2","rimraf":"^4.1.2","ts-loader":"^8.4.0","typescript":"^3.9.7","watch":"^1.0.2","webpack":"^4.44.1","webpack-cli":"^3.3.12"},"scripts":{"watch":"watch \'npm run build_withcopy4\' src","dev":"npm run watch","build":"webpack --config webpack.config.js","build_withcopy":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ../../github/TUICalling/Web/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build_withcopy2":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ../sdk/trtc-calling-webrtc-demo/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build_withcopy3":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ./example-js/tuicall-engine-webrtc.js","build_withcopy4":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ./example/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build_demo3":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ./examples/call-engine-demo-vue3//node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build:package":"node build/package-bundle.js","lint":"./node_modules/.bin/eslint ./src; exit 0","fix":"./node_modules/.bin/eslint --fix ./src; exit 0","prerelease":"npm run lint && npm run build && npm run doc && npm run build:package","doc":"npm run doc:clean && tsc --target ESNEXT && npm run doc:build","doc:build":"npm run changelog && npm run main && ./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc.json && node ./build/jsdoc/fix-doc.js","doc:clean":"node ./build/jsdoc/clean-doc.js","doc-en":"npm run doc:clean && tsc --target ESNEXT && npm run doc:build-en","doc:build-en":"npm run changelog && npm run main && ./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc-en.json && node ./build/jsdoc/fix-doc-en.js","changelog":"cp CHANGELOG.md build/jsdoc/tutorials/20-CHANGELOG.md","main":"cp README.md build/jsdoc/main.md"},"repository":{"type":"git","url":"https://github.com/tencentyun/TUICallKit/tree/main/Web"},"author":"Tencent Cloud Terminal R&D Center","license":"ISC"}')},function(t,n){t.exports=e},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return t.apply(e,n)}}},function(t,e,n){"use strict";var i=n(3);function r(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var a;if(n)a=n(e);else if(i.isURLSearchParams(e))a=e.toString();else{var o=[];i.forEach(e,(function(t,e){null!=t&&(i.isArray(t)?e+="[]":t=[t],i.forEach(t,(function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),o.push(r(e)+"="+r(t))})))})),a=o.join("&")}if(a){var s=t.indexOf("#");-1!==s&&(t=t.slice(0,s)),t+=(-1===t.indexOf("?")?"?":"&")+a}return t}},function(t,e,n){"use strict";t.exports=function(t,e,n,i,r){return t.config=e,n&&(t.code=n),t.request=i,t.response=r,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,n){"use strict";var i=n(3),r=n(47),a=n(48),o=n(22),s=n(49),l=n(52),u=n(53),c=n(25);t.exports=function(t){return new Promise((function(e,n){var d=t.data,p=t.headers,h=t.responseType;i.isFormData(d)&&delete p["Content-Type"];var _=new XMLHttpRequest;if(t.auth){var f=t.auth.username||"",E=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";p.Authorization="Basic "+btoa(f+":"+E)}var g=s(t.baseURL,t.url);function I(){if(_){var i="getAllResponseHeaders"in _?l(_.getAllResponseHeaders()):null,a={data:h&&"text"!==h&&"json"!==h?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:i,config:t,request:_};r(e,n,a),_=null}}if(_.open(t.method.toUpperCase(),o(g,t.params,t.paramsSerializer),!0),_.timeout=t.timeout,"onloadend"in _?_.onloadend=I:_.onreadystatechange=function(){_&&4===_.readyState&&(0!==_.status||_.responseURL&&0===_.responseURL.indexOf("file:"))&&setTimeout(I)},_.onabort=function(){_&&(n(c("Request aborted",t,"ECONNABORTED",_)),_=null)},_.onerror=function(){n(c("Network Error",t,null,_)),_=null},_.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(c(e,t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",_)),_=null},i.isStandardBrowserEnv()){var v=(t.withCredentials||u(g))&&t.xsrfCookieName?a.read(t.xsrfCookieName):void 0;v&&(p[t.xsrfHeaderName]=v)}"setRequestHeader"in _&&i.forEach(p,(function(t,e){void 0===d&&"content-type"===e.toLowerCase()?delete p[e]:_.setRequestHeader(e,t)})),i.isUndefined(t.withCredentials)||(_.withCredentials=!!t.withCredentials),h&&"json"!==h&&(_.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&_.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&_.upload&&_.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){_&&(_.abort(),n(t),_=null)})),d||(d=null),_.send(d)}))}},function(t,e,n){"use strict";var i=n(23);t.exports=function(t,e,n,r,a){var o=new Error(t);return i(o,e,n,r,a)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";var i=n(3);t.exports=function(t,e){e=e||{};var n={},r=["url","method","data"],a=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function l(t,e){return i.isPlainObject(t)&&i.isPlainObject(e)?i.merge(t,e):i.isPlainObject(e)?i.merge({},e):i.isArray(e)?e.slice():e}function u(r){i.isUndefined(e[r])?i.isUndefined(t[r])||(n[r]=l(void 0,t[r])):n[r]=l(t[r],e[r])}i.forEach(r,(function(t){i.isUndefined(e[t])||(n[t]=l(void 0,e[t]))})),i.forEach(a,u),i.forEach(o,(function(r){i.isUndefined(e[r])?i.isUndefined(t[r])||(n[r]=l(void 0,t[r])):n[r]=l(void 0,e[r])})),i.forEach(s,(function(i){i in e?n[i]=l(t[i],e[i]):i in t&&(n[i]=l(void 0,t[i]))}));var c=r.concat(a).concat(o).concat(s),d=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===c.indexOf(t)}));return i.forEach(d,u),n}},function(t,e,n){"use strict";function i(t){this.message=t}i.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},i.prototype.__CANCEL__=!0,t.exports=i},function(t,e,n){"use strict";n.r(e);e.default={SDK_CONSTRUCT:"sdkConstruct",SDK_READY:"sdkReady",SDK_NOT_READY:"sdkNotReady",LOGIN:"login",LOGOUT:"logout",CALL:"call",GROUP_CALL:"groupCall",ACCEPT:"accept",REJECT:"reject",HANGUP:"hangup",START_REMOTE_VIEW:"startRemoteView",STOP_REMOTE_VIEW:"stopRemoteView",START_LOCAL_VIEW:"startLocalView",STOP_LOCAL_VIEW:"stopLocalView",OPEN_CAMERA:"openCamera",CLOSE_CAMERA:"closeCamera",SET_MIC_MUTE:"setMicMute",SET_VIDEO_QUALITY:"setVideoQuality",SWITCH_TO_AUDIO_CALL:"switchToAudioCall",SWITCH_TO_VIDEO_CALL:"switchToVideoCall",CHANGE_CALL_STATUS:"changeCallStatus",TALK_TIME:"talktime",ERROR:"error",INVITED:"invited",GROUP_CALL_INVITEE_LIST_UPDATE:"group_call_invitee_list_update",USER_ENTER:"user_enter",USER_LEAVE:"user_leave",NO_RESP:"no_resp",LINE_BUSY:"line_busy",CALLING_CANCEL:"calling_cancel",KICKED_OUT:"kicked_out",CALLING_TIMEOUT:"calling_timeout",CALLING_END:"calling_end",USER_VIDEO_AVAILABLE:"user_video_available",USER_AUDIO_AVAILABLE:"user_audio_available",USER_VOICE_VOLUME:"user_voice_volume",CALL_TYPE_CHANGED:"call_type_changed",DEVICED_UPDATED:"deviced_updated",QUALITY_REPORT:"quality_report"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.callRoleMapping=e.callTypeMapping=void 0;var i=n(6),r=n(0);e.callTypeMapping=function(t){var e=r.NAME.UNKNOWN;switch(t){case i.CALL_TYPE.AUDIO_CALL:e=r.NAME.AUDIO;break;case i.CALL_TYPE.VIDEO_CALL:e=r.NAME.VIDEO}return e},e.callRoleMapping=function(t){var e=t;return e===i.CALL_ROLE.INVITER?e=r.NAME.CALLER:e===i.CALL_ROLE.INVITEE&&(e=r.NAME.CALLEE),e}},function(t,e,n){t.exports=n(40)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(33),r=n(16),a=n(12);e.default={TUICallEngine:i.default,TUICallEvent:r.TUICallEvent,TUICallType:a.TUICallType,TUICallCameraPosition:a.TUICallCameraPosition}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__decorate||function(t,e,n,i){var r,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,n,o):r(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o},a=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},l=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i};Object.defineProperty(e,"__esModule",{value:!0});var u=n(34),c=n(8),d=n(1),p=n(35),h=n(20),_=n(38),f=n(39),E=n(13),g=n(29),I=n(18),v=n(5),C=n(59),T=n(2),R=n(6),m=n(9),A=n(10),y=n(7),L=n(11),S=n(0),D=n(60),N=n(67),O=n(69),b=n(71),w=(n(12),n(19)),U=c.default(),M=function(){function t(t){this._roomID=0,this._strRoomId="",this._quality="1080p",this._localPlayOptions={rotation:m.TRTCVideoRotation.TRTCVideoRotation0,fillMode:m.TRTCVideoFillMode.TRTCVideoFillMode_Fill,muted:!0},this._remotePlayOptions={rotation:m.TRTCVideoRotation.TRTCVideoRotation0,fillMode:m.TRTCVideoFillMode.TRTCVideoFillMode_Fill,mirrorType:m.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable,muted:!1},this._initialCallId="",this._isEnableMultiDeviceAbility=!1,this._logLevel=T.LOGLEVEL_INFO,this._component=17,this._uniqueLoginId="",this._sdkAppID=t.SDKAppID,this._isLogin=!1,this._trtcClient=null,this._userID="",this._userSig="",this._switchCallModeStatus=!0,this._timExternal=!1,this._inviterInviteID={},this._audioVideoSwitchIdList=[],this._acceptedUserObject={},this._callTimeout=30,this._callStatus=R.CALL_STATUS.IDLE,this._callType=R.CALL_TYPE.UNKNOWN,this._isInviter=!1,this._isGroupCall=!1,this._inviteeList=[],this._unHandledInviteeList=[],this._handledInviteeList=[],sessionStorage.setItem("sdkAppId",""+this._sdkAppID),this._language=t.language,this._initLogger(t),t.component&&this.setComponent(t.component),this._netMonitor=new C.default,this._outerEmitter=new u.default,this._delegate=new f.default(this._outerEmitter),this._callDataReport=new N.CallDataReport({version:w.version,sdkAppId:t.SDKAppID}),this._dataReportObserver=new N.TUICallEngineObserver(this._outerEmitter,this._callDataReport),this._connectStartTime=0,t.tim&&(this._timExternal=!0,d.isFunction(t.tim.addSignalingListener)||(this._logger.info("constructor.start",{text:{data:t},type:"api"}),T.default.error("constructor.start, you need to pass in an instance of @tencentcloud/chat, please use @tencentcloud/chat instead of tim-js-sdk. 需要传入 @tencentcloud/chat 的实例"))),this.tim=t.tim||h.create(t),this._tsignalingClient=new _.default(this,i(i({},t),{tim:this.tim,isRejectNotifyAll:!0})),this.setLogLevel(this._logLevel),this._callRecordReport=new O.CallRecordReport({version:w.version,tim:this.tim}),this._recordReportObserver=new O.TUICallEngineRecordObserver(this._outerEmitter,this._callRecordReport);var e=new E.default(g.default.SDK_CONSTRUCT);this._eventStatController=new I.default,E.default.bindController(this._eventStatController),e.setText("version="+w.version+"-ua="+v.USER_AGENT).setEnd(),this._logger.info("constructor.start",{text:{data:t},type:"api"}),T.default.info("SDK Version:"+w.version+", SDKAppID:"+t.SDKAppID+".")}return t.prototype._initLogger=function(t){var e=this;this._logger=U,this._logger.updateGetReportData((function(){return{app:"TUICallEngine-web",version:w.version,useragent:{userAgent:window.navigator.userAgent,language:window.navigator.language,platform:window.navigator.platform},platform:S.NAME.WEB,sdkappid:t.SDKAppID,time:+new Date,userid:e.getUserId(),uniqueloginid:e._uniqueLoginId,roomid:String(e.getRoomId()||e.getStrRoomId()),callinfo:{inviteid:e.getInitialCallId(),callrole:e.isInviter()?S.NAME.INVITER:S.NAME.INVITEE,groupid:e.getGroupId(),calltype:e.getCallType(),handledInviteeList:e.getHandledInviteeList(),unHandledInviteeList:e.getUnHandledInviteeList()},callkitversion:t.callkitVersion||S.NAME.UNKNOWN,framework:t.frameWork||S.NAME.UNKNOWN,isfromchat:t.chat?"true":"false"}}))},t.prototype.getCallType=function(){return this._callType},t.prototype.setCallType=function(t){this._callType=t},t.prototype.isInviter=function(){return this._isInviter},t.prototype.setConnectStartTime=function(t){this._connectStartTime=t},t.prototype.getConnectStartTime=function(){return this._connectStartTime},t.prototype.getInviteeList=function(){return this._inviteeList},t.prototype.setInviteeList=function(t){this._inviteeList=l(t)},t.prototype.getCallDataReport=function(){return this._callDataReport},t.prototype.getCallRecordReport=function(){return this._callRecordReport},t.prototype.getUnHandledInviteeList=function(){return this._unHandledInviteeList||[]},t.prototype.setUnHandledInviteeList=function(t){this._unHandledInviteeList=l(t),T.default.log("setUnHandledInviteeList",this._unHandledInviteeList)},t.prototype.addUnHandledInviteeList=function(t){var e=this;void 0===t&&(t=[]),0!==t.length&&t.forEach((function(t){-1===e._unHandledInviteeList.indexOf(t)&&e._unHandledInviteeList.push(t)}))},t.prototype.deleteUnHandledInviteeList=function(t){var e=this;void 0===t&&(t=[]),0!==t.length&&t.forEach((function(t){e._unHandledInviteeList=e._unHandledInviteeList.filter((function(e){return e!==t}))}))},t.prototype.getHandledInviteeList=function(){return this._handledInviteeList||[]},t.prototype.setHandledInviteeList=function(t){this._handledInviteeList=l(t),T.default.log("setHandledInviteeList",this._handledInviteeList)},t.prototype.addHandledInviteeList=function(t){var e=this;void 0===t&&(t=[]),0!==t.length&&t.forEach((function(t){-1===e._handledInviteeList.indexOf(t)&&e._handledInviteeList.push(t)}))},t.prototype.deleteHandledInviteeList=function(t){var e=this;void 0===t&&(t=[]),0!==t.length&&t.forEach((function(t){e._handledInviteeList=e._handledInviteeList.filter((function(e){return e!==t}))}))},t.prototype.isGroupCall=function(){return this._isGroupCall},t.prototype.setIsGroupCall=function(t){this._isGroupCall=t},t.prototype.getGroupId=function(){return this._groupID},t.prototype.setGroupId=function(t){this._groupID=t},t.prototype.getExcludeFromHistoryMessage=function(){return this._excludeFromHistoryMessage},t.prototype.setLocalPlayOptions=function(t){void 0===t&&(t={}),this._localPlayOptions=i(i({},this._localPlayOptions),t)},t.prototype.getLocalPlayOptions=function(){return this._localPlayOptions||{}},t.prototype.setRemotePlayOptions=function(t){void 0===t&&(t={}),this._remotePlayOptions=i(i({},this._remotePlayOptions),t)},t.prototype.getRemotePlayOptions=function(){return this._remotePlayOptions||{}},t.prototype.addAcceptedUserList=function(t,e){var n=this;if(0!==e.length)if(t)0===(this._acceptedUserObject[t]||[]).length?this._acceptedUserObject[t]=e:e.forEach((function(e){-1===n._acceptedUserObject[t].indexOf(e)&&n._acceptedUserObject[t].push(e)}));else for(var i=this.getInviterInviteIdList(),r=function(t){var r=i[t],o=a.getInviterInviteIdUserList(r),s=e.filter((function(t){return-1!==o.indexOf(t)}));0===(a._acceptedUserObject[r]||[]).length?a._acceptedUserObject[r]=s:s.forEach((function(t){-1===n._acceptedUserObject[r].indexOf(t)&&n._acceptedUserObject[r].push(t)}))},a=this,o=0;o<i.length;o++)r(o)},t.prototype.getAcceptedUserList=function(t){return this._acceptedUserObject[t]||[]},t.prototype.setIsLogin=function(t){this._isLogin=t},t.prototype.getIsLogin=function(){return this._isLogin},t.createInstance=function(e){return U.updateEsConfig({url:b.ES_URL+"?sdkappid="+(null==e?void 0:e.SDKAppID),table:b.ES_TABLE}),t.instance||(t.instance=new t(e)),t.instance},t.prototype.destroyInstance=function(){var e,n;return o(this,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return this.getIsLogin()?this._timExternal?[4,this.logout()]:[3,2]:[3,4];case 1:return i.sent(),[3,4];case 2:return[4,this.tim.destroy()];case 3:i.sent(),i.label=4;case 4:return this._callDataReport.reset(),this._dataReportObserver.removeLister(),this._callRecordReport.reset(),this._recordReportObserver.removeLister(),null===(e=this._trtcClient)||void 0===e||e.removeTRTCEvents(),this._trtcClient=null,null===(n=this._tsignalingClient)||void 0===n||n.removeTSignalEvents(),this._tsignalingClient=null,t.instance=null,[2]}}))}))},t.prototype.setLogLevel=function(t){T.default.info("setLogLevel level: "+t),this._logLevel=t,T.default.setLevel(t),this._tsignalingClient&&this._tsignalingClient.setLogLevel(t),this._trtcClient&&this._trtcClient.setLogLevel(t)},t.prototype.on=function(t,e,n){this._outerEmitter.on(t,e,n||this)},t.prototype.off=function(t,e,n){this._outerEmitter.off(t,e,n||this)},t.prototype.init=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.login(t)]}))}))},t.prototype.login=function(t){return o(this,void 0,void 0,(function(){var e,n,r,a,o,l=this;return s(this,(function(s){switch(s.label){case 0:if(this._uniqueLoginId=d.generateRandomString(6),this._logger.updateGetReportData((function(){return{userid:t.userID,uniqueloginid:l._uniqueLoginId}})),this._logger.info("login.start",{text:{data:i(i({},t),{userSig:""})},type:"api"}),this.getIsLogin())return this._logger.warn("login.fail",{text:{error:"userId has been login"},type:"api"}),T.default.warn("login - userId has been login"),[2];s.label=1;case 1:return s.trys.push([1,4,,5]),T.default.log("login - params:",t),this._netMonitor.start(),e=t.userID,n=t.userSig,r=t.assetsPath,this._userID=e,this._callDataReport.setUserID(e),this._userSig=n,this._trtcClient=new p.default({sdkAppID:this._sdkAppID,userID:e,userSig:n,tuiCallEngine:this,assetsPath:r,logLevel:this._logLevel}),sessionStorage.setItem("userId",""+this._userID),[4,this._tsignalingClient.login({userID:e,userSig:n})];case 2:return a=s.sent(),this.setIsLogin(!0),[4,this.setSelfIMCallStatus(R.CALL_STATUS.IDLE)];case 3:return s.sent(),[2,a];case 4:throw o=s.sent(),this._logger.error("login.fail",{text:{error:o},type:"api"}),new Error("login - userId: "+this._userID+" login failed, error: "+o+" ");case 5:return[2]}}))}))},t.prototype.logout=function(){var t;return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:if(this._logger.info("logout.start",{text:{data:{userID:this._userID,timExternal:this._timExternal}},type:"api"}),T.default.debug("logout"),!this.getIsLogin())return[2];this._userID="",this._uniqueLoginId="",this._userSig="",n.label=1;case 1:return n.trys.push([1,5,,6]),[4,this._resetTUICallEngine()];case 2:return n.sent(),null===(t=this._trtcClient)||void 0===t||t.removeTRTCEvents(),this._trtcClient=null,this.setIsLogin(!1),this._timExternal?[3,4]:[4,this._tsignalingClient.logout()];case 3:n.sent(),n.label=4;case 4:return[2,!0];case 5:throw e=n.sent(),this._logger.error("logout.fail",{text:{data:{userID:this._userID},error:e},type:"api"}),new Error("logout failed, error: "+e+" ");case 6:return[2]}}))}))},t.prototype.call=function(t){var e,n;return o(this,void 0,void 0,(function(){var r,a,o,l,u,c,p,h,_,f,E,g;return s(this,(function(s){switch(s.label){case 0:return this._logger.info("call.start",{text:{data:t},type:"api"}),T.default.info("call - params:",t),[4,this.getSelfIMCallStatus([this.getUserId()])];case 1:if((r=s.sent())!==R.CALL_STATUS.IDLE)throw this._logger.error("call.failed",{text:{data:{params:t,customStatus:r}},type:"api"}),new A.default({code:y.default.ERROR_REQUEST_REFUSED,messageParams:{value:r},fnName:"call"});return this._callDataReport.setAbilityBit(!0),this._callDataReport.setCallScene(S.NAME.SINGLE_CALL),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.getMediaDevicesAuth({audio:!0})];case 2:if(s.sent(),a=t.userID,o=t.type,l=t.offlinePushInfo,u=t.roomID,c=t.strRoomID,p=t.timeout,h=t.userData,this.getUserId()===a)throw this._logger.error("call.fail",{text:{error:"Called id can not be yourself. userId:"+this.getUserId()+", inviteeId:"+a},type:"api"}),T.default.error("call failed. Called id can't be yourself. userId:"+this.getUserId()+", inviteeId:"+a),new Error("call failed. Called id can't be yourself. userId:"+this.getUserId()+", inviteeId:"+a);this._callStatus=R.CALL_STATUS.CALLING,this._callType=o,this._isInviter=!0,this._inviterID=this._userID,this._inviteeID=a,this._isGroupCall=!1,this.setGroupId(""),this.analyzeAndSetRoomId(u,c),this._callTimeout=d.isUndefined(p)?this._callTimeout:p,_={callType:S.NAME.SINGLE,mediaType:o,inviteeList:[a]},s.label=3;case 3:return s.trys.push([3,9,,11]),[4,null===(n=this._trtcClient)||void 0===n?void 0:n.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 4:return s.sent(),this._callDataReport.setEnterRoomTime((new Date).getTime()),this._tsignalingClient.setTSignalingIsJoined(!0),f=this._callDataReport.getCallData(),f=i(i({},f),{roomID:this.getRoomId(),callRole:R.CALL_ROLE.INVITER,callType:this._callType,inviteeList:[a]}),this._callDataReport.setCallData(f),[4,this._tsignalingClient.invite({userID:a,type:o,roomId:this.getRoomId(),strRoomId:this.getStrRoomId(),timeout:this._callTimeout,offlinePushInfo:l,userIDList:[a],userData:h})];case 5:return E=s.sent(),this._callDataReport.setSendSignalingTime((new Date).getTime()),this.setHandledInviteeList([this._userID]),this.setUnHandledInviteeList([a]),0!==E.code?[3,6]:(this.addInviterInviteId(E.inviteID,[this._userID,a]),this._callDataReport.setInviteID(E.inviteID),this.setInitialCallId(E.inviteID),this._callRecordUpload(i({eventType:S.NAME.START_CALL},_)),this._callRecordReport.startHeartbeat(),[3,8]);case 6:return this._callDataReport.setCodeAndMessage(E.code,E.message),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:S.NAME.CALL_FAILED},_)),this._logger.error("call.fail",{text:{error:E},type:"api"}),[4,this._resetTUICallEngine()];case 7:s.sent(),s.label=8;case 8:return[2,E];case 9:return(g=s.sent()).getCode?this._callDataReport.setCodeAndMessage(g.getCode(),g.message):g.code===y.default.ERROR_BLACKLIST?(this._delegate.onError(y.default.ERROR_BLACKLIST,g.message),this._callDataReport.setCodeAndMessage(y.default.ERROR_BLACKLIST,g.message)):this._callDataReport.setCodeAndMessage(y.default.UNKNOWN,JSON.stringify(g)),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:S.NAME.CALL_FAILED},_)),this._logger.error("call.fail",{text:{error:g},type:"api"}),[4,this._resetTUICallEngine()];case 10:throw s.sent(),new A.default({message:"<call>: failed "+g.message,code:g.code});case 11:return[2]}}))}))},t.prototype.reportLog=function(t){var e,n;try{if(d.isObject(t)){var i=t||{},r=i.name,a=void 0===r?"":r,o=i.data,s=i.error,l=i.type,u=void 0===l?"api":l,c=i.level,p=void 0===c?"info":c,h="error"===p?{error:s,data:o}:{data:o};null===(n=null===(e=this._logger)||void 0===e?void 0:e[p])||void 0===n||n.call(e,a,{text:h,type:u})}}catch(s){console.debug("reportLog fail: ",s)}},t.prototype.addAudioVideoSwitchIdList=function(t){t&&this._audioVideoSwitchIdList.push(t)},t.prototype.getAudioVideoSwitchIdList=function(){return this._audioVideoSwitchIdList||[]},t.prototype.addInviterInviteId=function(t,e){0!==e.length&&(0===(this._inviterInviteID[t]||[]).length?this._inviterInviteID[t]=e:this._inviterInviteID[t]=l(this._inviterInviteID[t],e))},t.prototype.getInviterInviteIdList=function(){return Object.keys(this._inviterInviteID||{})},t.prototype.getTotalInviterInviteIdList=function(){var t=this.getInviterInviteIdList();return l(this._audioVideoSwitchIdList,t)},t.prototype.getInviterInviteIdUserList=function(t){var e=this,n=[];return t?n=this._inviterInviteID[t]||[]:this.getInviterInviteIdList().forEach((function(t){n=l(n,e.getInviterInviteIdUserList(t))})),n},t.prototype.getInviterID=function(){return this._inviterID},t.prototype.setInviterID=function(t){this._inviterID=t},t.prototype.groupCall=function(t){var e,n;return o(this,void 0,void 0,(function(){var r,a,o,u,c,p,h,_,f,E,g,I;return s(this,(function(s){switch(s.label){case 0:return this._logger.info("groupCall.start",{text:{data:t},type:"api"}),T.default.debug("groupCall - params:",t),[4,this.getSelfIMCallStatus([this.getUserId()])];case 1:if((r=s.sent())!==R.CALL_STATUS.IDLE)throw this._logger.error("groupCall.failed",{text:{data:{params:t,customStatus:r}},type:"api"}),new A.default({code:y.default.ERROR_REQUEST_REFUSED,messageParams:{value:r},fnName:"groupCall"});return[4,null===(e=this._trtcClient)||void 0===e?void 0:e.getMediaDevicesAuth({audio:!0})];case 2:if(s.sent(),a=t.userIDList,o=t.type,u=t.groupID,c=t.offlinePushInfo,p=t.roomID,h=t.strRoomID,_=t.timeout,f=t.userData,-1!==(a=l(a)).indexOf(this.getUserId()))throw T.default.error("groupCall failed. Called list can't contain yourself. userId:"+this.getUserId()+", inviteeIdList:"+a),new Error("groupCall failed. Called list can't contain yourself. userId:"+this.getUserId()+", inviteeIdList:"+a);this._callStatus=R.CALL_STATUS.CALLING,this._callType=o,this._isInviter=!0,this._isGroupCall=!0,this._inviterID=this._userID,this.setGroupId(u||""),this.setInviteeList(a),this.setHandledInviteeList([this._userID]),this.setUnHandledInviteeList(a),this.analyzeAndSetRoomId(p,h),this._callTimeout=d.isUndefined(_)?this._callTimeout:_,this._callDataReport.setCallScene(S.NAME.GROUP_CALL),E={callType:S.NAME.GROUP,mediaType:o,inviteeList:a},s.label=3;case 3:return s.trys.push([3,9,,11]),[4,null===(n=this._trtcClient)||void 0===n?void 0:n.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 4:return s.sent(),this._tsignalingClient.setTSignalingIsJoined(!0),[4,this._tsignalingClient.inviteInGroup({groupID:this.getGroupId(),userIDList:a,type:o,roomId:this.getRoomId(),strRoomId:this.getStrRoomId(),timeout:this._callTimeout,offlinePushInfo:c,userData:f})];case 5:return g=s.sent(),T.default.log("groupCall res",g),u?0!==g.code?[3,6]:(this.addInviterInviteId(g.inviteID,l([this._userID],a)),this.setInitialCallId(g.inviteID),this._callRecordUpload(i({eventType:S.NAME.START_CALL},E)),this._callRecordReport.startHeartbeat(),[3,8]):[3,8];case 6:return this._callRecordUpload(i({eventType:S.NAME.CALL_FAILED},E)),this._logger.error("inviteInGroup.fail",{text:{data:g},type:"api"}),[4,this._resetTUICallEngine()];case 7:s.sent(),s.label=8;case 8:return[2,g];case 9:return I=s.sent(),this._callRecordUpload(i({eventType:S.NAME.CALL_FAILED},E)),this._logger.error("groupCall.fail",{text:{error:I},type:"api"}),[4,this._resetTUICallEngine()];case 10:throw s.sent(),new A.default({message:"<groupCall>: failed "+I.message,code:I.code});case 11:return[2]}}))}))},t.prototype.joinInGroupCall=function(t){var e,n;return o(this,void 0,void 0,(function(){var i,r,a,o,l,u,c;return s(this,(function(s){switch(s.label){case 0:return this._logger.info("joinInGroupCall.start",{text:{data:t},type:"api"}),[4,this.getSelfIMCallStatus([this.getUserId()])];case 1:if((i=s.sent())!==R.CALL_STATUS.IDLE)throw this._logger.error("joinInGroupCall.failed",{text:{data:{params:t,customStatus:i}},type:"api"}),new A.default({code:y.default.ERROR_REQUEST_REFUSED,messageParams:{value:i},fnName:"joinInGroupCall"});return[4,null===(e=this._trtcClient)||void 0===e?void 0:e.getMediaDevicesAuth({audio:!0})];case 2:s.sent(),s.label=3;case 3:return s.trys.push([3,6,,8]),r=t.roomID,a=t.strRoomID,o=t.type,l=t.groupID,this._callType=o,this.setGroupId(l||""),this.analyzeAndSetRoomId(r,a),this._isGroupCall=!0,this._isInviter=!1,this.addHandledInviteeList([this.getUserId()]),this.changeCallStatus(R.CALL_STATUS.CALLING),[4,null===(n=this._trtcClient)||void 0===n?void 0:n.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 4:return s.sent(),[4,this.setSelfIMCallStatus(R.CALL_STATUS.CONNECTED)];case 5:return s.sent(),this.changeCallStatus(R.CALL_STATUS.CONNECTED),this.getCallRecordReport().setBodyStatus(R.CALL_STATUS.CONNECTED),T.default.log("joinInGroupCall roomID:"+r+",type:"+o+",userID:"+this.getUserId()),u={eventType:S.NAME.JOIN_IN_GROUP_CALL,callType:S.NAME.GROUP,mediaType:this._callType},this._callRecordUpload(u),this._callRecordReport.startHeartbeat(),[3,8];case 6:return c=s.sent(),this._logger.error("joinInGroupCall.fail",{text:{error:c},type:"api"}),[4,this._resetTUICallEngine()];case 7:throw s.sent(),new Error("joinInGroupCall failed error: "+c);case 8:return[2]}}))}))},t.prototype.inviteUser=function(t){return o(this,void 0,void 0,(function(){var e,n,i,r,a,o,u,c,d,p,h,_=this;return s(this,(function(s){switch(s.label){case 0:if(this._logger.info("inviteUser.start",{text:{data:t},type:"api"}),!this.isGroupCall())throw this._logger.error("inviteUser.fail",{text:{error:"inviteUser failed",data:t},type:"api"}),T.default.error("inviteUser failed - groupID:"+this.getGroupId()+", roomID:"+this.getRoomId()+", type:"+this._callType),new Error("inviteUser failed - groupID:"+this.getGroupId()+", roomID:"+this.getRoomId()+", type:"+this._callType);if(!this.isInviter()&&this._callStatus!==R.CALL_STATUS.CONNECTED)throw this._logger.error("inviteUser.fail",{text:{error:"current status:"+this._callStatus+" not support"},type:"api"}),T.default.error("inviteUser failed - current status:"+this._callStatus+" not support"),new Error("inviteUser failed - current status:"+this._callStatus+" not support");if(e=t.userIDList,n=void 0===e?[]:e,i=t.offlinePushInfo,0===n.length)throw this._logger.error("inviteUser.fail",{text:{error:"userIDList is empty"},type:"api"}),T.default.error("inviteUser failed - userIDList is empty"),new Error("inviteUser failed - userIDList is empty");if(r=this.getHandledInviteeList(),a=this.getUnHandledInviteeList(),o=l(r,a),0===(u=n.filter((function(t){return-1===o.indexOf(t)}))).length)return this._logger.error("inviteUser.fail",{text:{error:"userIDList in call list",data:{userIDList:n,totalUserList:o}},type:"api"}),T.default.error("inviteUser failed - userIDList in call list. userIDList:"+JSON.stringify(n)+", call list:"+JSON.stringify(o)),[2,Promise.reject("inviteUser failed - userIDList in call list. userIDList:"+JSON.stringify(n)+", call list:"+JSON.stringify(o))];n=u,s.label=1;case 1:return s.trys.push([1,3,,4]),c=this._handledInviteeList.filter((function(t){return t!==_._userID})),[4,this._tsignalingClient.inviteInGroup({groupID:this.getGroupId(),userIDList:n,type:this._callType,roomId:this.getRoomId(),strRoomId:this.getStrRoomId(),timeout:this._callTimeout,inCallUserIDs:l(this._unHandledInviteeList,c),offlinePushInfo:i,initialCallId:this.getInitialCallId()})];case 2:return d=s.sent(),T.default.log("inviteUser res",d),0===d.code?(this.addUnHandledInviteeList(n),this.addInviterInviteId(d.inviteID,l([this._userID],n)),p={eventType:S.NAME.INVITE_USER,callType:S.NAME.GROUP,mediaType:this._callType,inviteeList:n},this._callRecordUpload(p)):this._logger.error("inviteUser.fail",{type:"api"}),[2,d];case 3:throw h=s.sent(),new Error("inviteUser failed, userId:"+this.getUserId()+", inviteeIdList:"+n+", error: "+h);case 4:return[2]}}))}))},t.prototype.accept=function(){var t,e;return o(this,void 0,void 0,(function(){var n,r,a,o,l,u,c,d,p;return s(this,(function(s){switch(s.label){case 0:return this._logger.info("accept.start",{text:{data:{callStatus:this.getCallStatus(),inviteData:this._tsignalingClient.getInviteData()},type:"api"}}),T.default.debug("accept"),this.getCallStatus()===R.CALL_STATUS.CONNECTED?(this._logger.error("accept.fail",{text:{error:"already connected, avoid repeat accept"},type:"api"}),T.default.warn("accept - already connected, avoid repeat accept"),[2]):this._tsignalingClient.getInviteData()?(this._callDataReport.setCallAcceptTime((new Date).getTime()),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.getMediaDevicesAuth({audio:!0})]):(this._logger.error("accept.fail",{text:{error:"there are no calls to accept"},type:"api"}),T.default.warn("accept - there are no calls to accept"),[2]);case 1:return s.sent().audio?[3,3]:[4,this._resetTUICallEngine()];case 2:s.sent(),s.label=3;case 3:n=this._tsignalingClient.getInviteData(),r=n.inviteID,a=n.inviteData,o=a.roomID,l=a.callType,T.default.debug("accept - params","inviteID: "+r+",callType: "+l+",roomID: "+o+"."),this._callType=l,this._callStatus=R.CALL_STATUS.CALLING,console.log("accept roomId: "+o),u={},s.label=4;case 4:return s.trys.push([4,6,,8]),this._callDataReport.setEnterRoomTime((new Date).getTime()),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 5:return s.sent(),this.addHandledInviteeList([this.getUserId()]),this.deleteUnHandledInviteeList([this.getUserId()]),this.addAcceptedUserList(r,[this.getUserId()]),this._tsignalingClient.setInviteData(null),this.changeCallStatus(R.CALL_STATUS.CONNECTED),this.getCallRecordReport().setBodyStatus(R.CALL_STATUS.CONNECTED),[3,8];case 6:return c=s.sent(),this.isGroupCall()||(c.getCode?this._callDataReport.setCodeAndMessage(c.getCode(),c.message):this._callDataReport.setCodeAndMessage(y.default.UNKNOWN,JSON.stringify(c)),this._callDataReport.uploadToKibana()),this._logger.error("accept.join.fail",{text:{error:c},type:"api"}),[4,this._resetTUICallEngine()];case 7:throw s.sent(),new Error("accept failed, error: "+c);case 8:u={roomID:o,callType:l},s.label=9;case 9:return s.trys.push([9,13,,15]),[4,this.modifyInvitation(r)];case 10:return s.sent(),[4,this._tsignalingClient.accept({inviteID:r,callType:l})];case 11:return d=s.sent(),[4,this.setSelfIMCallStatus(R.CALL_STATUS.CONNECTED)];case 12:return s.sent(),this._callRecordUpload({eventType:S.NAME.ACCEPT_CALL}),[3,15];case 13:return p=s.sent(),this._logger.error("accept.fail",{text:{error:p},type:"api"}),T.default.error(p),[4,this._resetTUICallEngine()];case 14:throw s.sent(),this.isGroupCall()||(this._callDataReport.setCodeAndMessage(y.default.UNKNOWN,JSON.stringify(p)),this._callDataReport.uploadToKibana()),new A.default({message:"<accept>: failed "+p.message,code:p.code});case 15:return[2,i(i({},u),d)]}}))}))},t.prototype.reject=function(){return o(this,void 0,void 0,(function(){var t,e,n,r,a,o,l,u;return s(this,(function(s){switch(s.label){case 0:if(this._logger.info("reject.start",{text:{data:{inviteData:this._tsignalingClient.getInviteData(),callStatus:this._callStatus},type:"api"}}),!this._tsignalingClient.getInviteData())return T.default.warn("reject - there are no calls to reject"),[2];t=this._callStatus===R.CALL_STATUS.CONNECTED,e=this._tsignalingClient.getInviteData(),n=e.inviteID,r=e.inviteData,a=r.callType,T.default.warn("reject - params","inviteID: "+n+",callType: "+a+",isBusy: "+t+"."),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,this._tsignalingClient.reject({inviteID:n,callType:a,isBusy:t})];case 2:return o=s.sent(),this._callRecordUpload({eventType:S.NAME.REJECT_CALL}),t?[3,4]:(l=this.generateEventData(),[4,this._resetTUICallEngine()]);case 3:s.sent(),this._delegate.onCallingCancel(i(i({userID:this._userID},l),{reason:S.NAME.REJECT})),s.label=4;case 4:return[2,o];case 5:throw u=s.sent(),this._logger.error("reject.fail",{text:{error:u},type:"api"}),new A.default({message:"<reject>: failed "+u.message,code:u.code});case 6:return[2]}}))}))},t.prototype.hangup=function(){var t;return o(this,void 0,void 0,(function(){var e,n,r,a,o,u,c,d,p,h,_,f,E,g,I,v,C,m,A,y;return s(this,(function(L){switch(L.label){case 0:if(this._logger.info("hangup.start",{text:{data:{inviteData:this._tsignalingClient.getInviteData(),callStatus:this._callStatus,inviterInviteID:this._acceptedUserObject,inviteIdList:this.getInviterInviteIdList(),isInviter:this.isInviter(),isGroupCall:this.isGroupCall(),callType:this.getCallType(),currentUserID:this.getUserId()}},type:"api"}),T.default.warn(" - callStatus:"+this._callStatus+" _inviterInviteID:"+JSON.stringify(this._acceptedUserObject)),this._callStatus===R.CALL_STATUS.IDLE)throw this._logger.error("hangup.fail",{text:{error:"current status:"+this._callStatus,type:"api"}}),new Error("hangup failed. current status:"+this._callStatus);if(this._callStatus===R.CALL_STATUS.CALLING&&0===this.getInviterInviteIdList().length)throw this._logger.error("hangup.fail",{text:{error:"call/groupCall incomplete。please wait cancel"},type:"api"}),new Error("call/groupCall incomplete。please wait cancel");if(e=this.isGroupCall(),n=this.isInviter(),r=this.getUserId(),a=this.generateCallTotalTime(),o=this.getCallType(),c=this.getInviterInviteIdList(),this._callStatus!==R.CALL_STATUS.CONNECTED)return[3,7];L.label=1;case 1:return L.trys.push([1,5,,7]),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.exitRoom()];case 2:return L.sent(),0!==c.length?[3,4]:(f=this.generateCallEndData({callMediaType:o,totalTime:a}),this._delegate.onCallEnd(f),[4,this._resetTUICallEngine()]);case 3:L.sent(),L.label=4;case 4:return[3,7];case 5:return d=L.sent(),this._logger.error("hangup.fail",{text:{error:d},type:"api"}),[4,this._resetTUICallEngine()];case 6:throw L.sent(),new Error(d);case 7:p=this.getHandledInviteeList(),h=this.getUnHandledInviteeList(),_=this.generateEventData(),L.label=8;case 8:return L.trys.push([8,30,,31]),e?[3,15]:(f=this.generateCallEndData(),n?1!==h.length?[3,10]:[4,this._cancel()]:[3,12]);case 9:return u=L.sent(),this._delegate.onCallingCancel(i(i({userID:r},_),{reason:S.NAME.NORMAL})),[3,11];case 10:this._delegate.onCallEnd(f),L.label=11;case 11:return[3,13];case 12:this._delegate.onCallEnd(f),L.label=13;case 13:return[4,this._resetTUICallEngine()];case 14:return L.sent(),[3,29];case 15:return E=this.getCallStatus(),g={callType:o,userIDList:l(p.filter((function(t){return t!==r})),h),callEnd:a},n?E!==R.CALL_STATUS.CALLING?[3,18]:[4,this._cancel(this.getInviterInviteIdList())]:[3,23];case 16:return u=L.sent(),[4,this._resetTUICallEngine()];case 17:L.sent(),this._delegate.onCallingCancel(i(i({userID:r},_),{reason:S.NAME.NORMAL})),L.label=18;case 18:if(E!==R.CALL_STATUS.CONNECTED)return[3,22];I=function(t){var e,n,i,a,o,d;return s(this,(function(s){switch(s.label){case 0:return e=c[t],n=v.getInviterInviteIdUserList(e),(i=v.getAcceptedUserList(e)).length>0?(a=i.filter((function(t){return-1!==p.indexOf(t)})),o=n.filter((function(t){return-1!==h.indexOf(t)})),g.userIDList=l(a,o).filter((function(t){return t!==r})),T.default.warn("inviter emit hangup signal, notify userIDList:"+JSON.stringify(g.userIDList)),0===g.userIDList.length?[3,2]:[4,v._tsignalingClient.hangup(g)]):[3,5];case 1:return u=s.sent(),[3,4];case 2:return p.length>1?(g.userIDList=p.filter((function(t){return t!==r})),[4,v._tsignalingClient.hangup(g)]):[3,4];case 3:u=s.sent(),s.label=4;case 4:return[3,7];case 5:return d=v.getUnHandledInviteeList(),n.filter((function(t){return-1!==d.indexOf(t)})).length>0?(T.default.warn("inviter emit cancel signal, userIdList:"+n),[4,v._cancel([e])]):[3,7];case 6:u=s.sent(),s.label=7;case 7:return[2]}}))},v=this,A=0,L.label=19;case 19:return A<c.length?[5,I(A)]:[3,22];case 20:L.sent(),L.label=21;case 21:return A++,[3,19];case 22:return[3,27];case 23:C=function(t){var e,n,i,d,_,f,E;return s(this,(function(s){switch(s.label){case 0:return e=c[t],n=m.getInviterInviteIdUserList(e),(i=m.getAcceptedUserList(e)).length>0?(d=i.filter((function(t){return-1!==p.indexOf(t)})),_=n.filter((function(t){return-1!==h.indexOf(t)})),g.userIDList=l(d,_).filter((function(t){return t!==r})),T.default.warn("invitee emit hangup signal, notify userIDList:"+JSON.stringify(g.userIDList)),0!==g.userIDList.length?[3,1]:(f=m.generateCallEndData({callMediaType:o,totalTime:a}),m._delegate.onCallEnd(f),[3,3])):[3,4];case 1:return p.length>1&&(g.userIDList=p.filter((function(t){return t!==r}))),[4,m._tsignalingClient.hangup(g)];case 2:u=s.sent(),s.label=3;case 3:return[3,6];case 4:return E=m.getUnHandledInviteeList(),n.filter((function(t){return-1!==E.indexOf(t)})).length>0?(T.default.warn("invitee emit cancel signal, inviteID:"+e),[4,m._cancel([e])]):[3,6];case 5:u=s.sent(),s.label=6;case 6:return[2]}}))},m=this,A=0,L.label=24;case 24:return A<c.length?[5,C(A)]:[3,27];case 25:L.sent(),L.label=26;case 26:return A++,[3,24];case 27:return[4,this._resetTUICallEngine()];case 28:L.sent(),L.label=29;case 29:return[2,u];case 30:throw y=L.sent(),this._logger.error("hangup.fail",{text:{error:y},type:"api"}),T.default.warn("hangup failed, error: "+y),new Error("hangup failed, error: "+y);case 31:return[2]}}))}))},t.prototype._cancel=function(t){return o(this,void 0,void 0,(function(){var e,n,i,r,a,o;return s(this,(function(s){switch(s.label){case 0:this._logger.info("_cancel.start",{text:{data:{inviteIDList:t,inviterInviteID:this._inviterInviteID},type:"api"}}),T.default.info("_cancel _inviterInviteID",this._inviterInviteID),e=[],s.label=1;case 1:return s.trys.push([1,7,,8]),0===(t||[]).length&&(t=this.getInviterInviteIdList().slice(0,1)),[4,this.modifyInvitation(t[0])];case 2:s.sent(),n=0,s.label=3;case 3:return n<t.length?(i=t[n],[4,this._tsignalingClient.cancel({inviteID:i})]):[3,6];case 4:r=s.sent(),e.push(r),s.label=5;case 5:return n++,[3,3];case 6:return[3,8];case 7:throw a=s.sent(),this._logger.error("_cancel.fail",{text:{error:a},type:"api"}),new A.default({message:"<_cancel>: failed "+a.message,code:a.code});case 8:return o="cancel "+JSON.stringify(e)+" succeeded",T.default.log("_cancel "+o),[2,e]}}))}))},t.prototype.startRemoteView=function(t){var e;return o(this,void 0,void 0,(function(){var n,i,r,a;return s(this,(function(o){return this._logger.info("startRemoteView.start",{text:{data:t},type:"api"}),T.default.info("startRemoteView - params:",t),n=t.userID,i=t.videoViewDomID,(r=t.options)&&(a=d.analyzeVideoRenderParams(r),this.setRemotePlayOptions(a)),[2,null===(e=this._trtcClient)||void 0===e?void 0:e.startRemoteView({userId:n,videoViewDomId:i,options:r})]}))}))},t.prototype.stopRemoteView=function(t){var e;return o(this,void 0,void 0,(function(){return s(this,(function(n){return this._logger.info("stopRemoteView.start",{text:{data:t},type:"api"}),T.default.debug("stopRemoteView - params:",t),[2,null===(e=this._trtcClient)||void 0===e?void 0:e.stopRemoteView({userId:t.userID})]}))}))},t.prototype.startLocalView=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(t){return T.default.warn("startLocalView interface is deprecated after v3.0.0"),[2]}))}))},t.prototype.stopLocalView=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(t){return T.default.warn("stopLocalView interface is deprecated after v3.0.0"),[2]}))}))},t.prototype.openCamera=function(t,e){var n,i;return o(this,void 0,void 0,(function(){var r;return s(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),this._logger.info("openCamera.start",{text:{data:{videoViewDomID:t,isFrontCamera:e}},type:"api"}),[4,null===(n=this._trtcClient)||void 0===n?void 0:n.getMediaDevicesAuth({video:!0})];case 1:return a.sent(),[4,null===(i=this._trtcClient)||void 0===i?void 0:i.startLocalPreview(t,e)];case 2:return a.sent(),[3,4];case 3:throw r=a.sent(),this._logger.error("openCamera.fail",{text:{error:r},type:"api"}),T.default.error("openCamera failed. error: "+r),new Error("openCamera failed. error: "+r);case 4:return[2]}}))}))},t.prototype.closeCamera=function(){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){try{return this._logger.info("closeCamera.start",{type:"api"}),[2,null===(t=this._trtcClient)||void 0===t?void 0:t.stopLocalPreview()]}catch(t){throw new Error("closeCamera failed. error: "+t)}return[2]}))}))},t.prototype.openMicrophone=function(){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._logger.info("openMicrophone.start",{type:"api"}),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.unMuteLocalAudio()];case 1:return e.sent(),[2]}}))}))},t.prototype.closeMicrophone=function(){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._logger.info("closeMicrophone.start",{type:"api"}),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.muteLocalAudio()];case 1:return e.sent(),[2]}}))}))},t.prototype.setVideoQuality=function(t){var e;return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return this._logger.info("setVideoQuality.start",{text:{data:{profile:t,currentProfile:this.getVideoQuality(),hasTrtcClient:!!this._trtcClient}},type:"api"}),T.default.debug("setVideoQuality - quality:"+JSON.stringify(t)),t===this.getVideoQuality()?(T.default.warn("setVideoQuality failed - profile not change"),[2]):(this._quality=t,[4,null===(e=this._trtcClient)||void 0===e?void 0:e.setVideoEncoderParam(t)]);case 1:return n.sent(),[2]}}))}))},t.prototype.getVideoQuality=function(){return this._quality},t.prototype.setVideoRenderParams=function(t){var e;return o(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return this._logger.info("setVideoRenderParams.start",{text:{data:{params:t,hasTRTCClient:!!this._trtcClient}},type:"api"}),console.warn("setVideoRenderParams params: "+JSON.stringify(t)),n=d.analyzeVideoRenderParams(t),t.userID===this.getUserId()?(this.setLocalPlayOptions(n),n=this.getLocalPlayOptions()):(this.setRemotePlayOptions(n),n=this.getRemotePlayOptions()),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.setVideoRenderParams(i({userId:t.userID},n))];case 1:return r.sent(),[2]}}))}))},t.prototype.switchCallMediaType=function(t){return o(this,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:if(this._logger.info("switchCallMediaType.start",{text:{data:{newMediaType:t,currentCallType:this._callType}},type:"api"}),this._callType===t)throw this._logger.error("switchCallMediaType.fail",{text:{error:L.ERROR_MESSAGE.ERROR_REQUEST_REPEATED_SWITCH},type:"api"}),new A.default({message:"<switchCallMediaType>: "+L.ERROR_MESSAGE.ERROR_REQUEST_REPEATED_SWITCH,code:y.default.ERROR_REQUEST_REPEATED});if(!this._switchCallModeStatus)throw this._logger.error("switchCallMediaType.fail",{text:{error:"audio and video call switching"},type:"api"}),new Error("audio and video call switching.");T.default.info("switchCallMediaType",this._inviterID,this._inviteeID),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._tsignalingClient.switchCallMode({userID:this._isInviter?this._inviteeID:this._inviterID,callType:this._callType,roomID:this.getRoomId(),timeout:this._callTimeout,mode:t===R.CALL_TYPE.AUDIO_CALL?R.MODE_TYPE.AUDIO:R.MODE_TYPE.VIDEO})];case 2:return e=i.sent(),this.setSwitchCallModeStatus(!1),[2,e];case 3:throw n=i.sent(),this._logger.error("switchCallMediaType.fail",{text:{error:n},type:"api"}),new Error("switchCallMediaType failed, error: "+n);case 4:return[2]}}))}))},t.prototype.setSwitchCallModeStatus=function(t){this._switchCallModeStatus=t},t.prototype.getSwitchCallModeStatus=function(){return this._switchCallModeStatus},t.prototype.getDeviceList=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._logger.info("getDeviceList.start",{text:{data:{deviceType:t}},type:"api"}),(t=t===m.DEVICE_TYPE.MICROPHONES?m.DEVICE_TYPE.MICROPHONE:t)!==m.DEVICE_TYPE.MICROPHONE&&t!==m.DEVICE_TYPE.SPEAKER?[3,2]:[4,this._trtcClient.getMediaDevicesAuth({audio:!0})];case 1:e.sent(),e.label=2;case 2:return t!==m.DEVICE_TYPE.CAMERA?[3,4]:[4,this._trtcClient.getMediaDevicesAuth({video:!0,isThrowVideoError:!0})];case 3:e.sent(),e.label=4;case 4:return[4,this._trtcClient.getDeviceList(t)];case 5:return[2,e.sent()]}}))}))},t.prototype.getCurrentDevice=function(t){return this._trtcClient.getCurrentDevice(t)},t.prototype.switchCamera=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:this._logger.info("switchCamera.start",{text:{data:{cameraPosition:t}},type:"api"}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this._trtcClient.switchCamera(t)];case 2:return e.sent(),[3,4];case 3:throw e.sent();case 4:return[2]}}))}))},t.prototype.switchDevice=function(t){var e;return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(r){switch(r.label){case 0:return this._logger.info("switchDevice.start",{text:{data:{params:t}},type:"api"}),n=t.deviceType,i=t.deviceId,n===m.DEVICE_TYPE.VIDEO&&(n=m.DEVICE_TYPE.CAMERA),n!==m.DEVICE_TYPE.AUDIO&&n!==m.DEVICE_TYPE.MICROPHONES||(n=m.DEVICE_TYPE.MICROPHONE),T.default.debug("switchDevice - params: deviceType:"+n+",deviceID:"+i),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.switchDevice(n,i)];case 1:return[2,r.sent()]}}))}))},t.prototype.setSelfInfo=function(t){return o(this,void 0,void 0,(function(){var e,n,i;return s(this,(function(r){return this._logger.info("setSelfInfo.start",{text:{data:{params:t}},type:"api"}),e=t.nickName,n=t.avatar,i={nick:e,avatar:n},!e&&delete i.nick,!n&&delete i.avatar,T.default.info("setSelfInfo -params: nickName:"+i.nick+",avatar:"+i.avatar),[2,this.tim.updateMyProfile(i)]}))}))},t.prototype.generateCallEndData=function(t){var e=t||{},n=e.roomId,i=e.callMediaType,r=e.callRole,a=e.totalTime,o=e.userId;return n=n||this.getRoomId(),i=i||this.getCallType(),r||(r=this.isInviter()?R.CALL_ROLE.INVITER:R.CALL_ROLE.INVITEE),a=d.isUndefined(a)?this.generateCallTotalTime():a,o=o||this.getUserId(),{roomID:n,strRoomID:this.getStrRoomId(),callMediaType:i,callRole:r,totalTime:a,userID:o}},t.prototype.generateEventData=function(){return{callID:this.getInviterInviteIdList()[0],roomID:this.getRoomId(),strRoomID:this.getStrRoomId(),callRole:this._isInviter?S.NAME.INVITER:S.NAME.INVITEE,callMediaType:this._callType}},t.prototype.enableMultiDeviceAbility=function(t){this._logger.info("enableMultiDeviceAbility.start",{text:{data:{enable:t}},type:"api"}),this.setIsEnableMultiDeviceAbility(t)},t.prototype.enableAIVoice=function(t){var e;return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return this._logger.info("enableAIVoice.start",{text:{data:{enable:t}},type:"api"}),this._trtcClient?[4,null===(e=this._trtcClient)||void 0===e?void 0:e.enableAIVoice(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype.setBlurBackground=function(t){var e;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this._logger.info("setBlurBackground.start",{type:"api",text:{data:{blurLevel:t}}}),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.setVirtualBackground({enable:0!==t,type:S.NAME.BLUR,blurLevel:t})];case 1:return i.sent(),[3,3];case 2:throw n=i.sent(),this._logger.error("setBlurBackground.fail",{text:{error:n},type:"api"}),n;case 3:return[2]}}))}))},t.prototype.setVirtualBackground=function(t){var e;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this._logger.info("setVirtualBackground.start",{type:"api",text:{data:{imagePath:t}}}),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.setVirtualBackground({enable:!!t,type:S.NAME.IMAGE,imagePath:t})];case 1:return i.sent(),[3,3];case 2:throw n=i.sent(),this._logger.error("setVirtualBackground.fail",{text:{error:n},type:"api"}),n;case 3:return[2]}}))}))},t.prototype.getTRTCCloudInstance=function(){var t;return null===(t=this._trtcClient)||void 0===t?void 0:t.getTRTCCloud()},t.prototype._resetTUICallEngine=function(){var t;return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return this.getCallStatus()===R.CALL_STATUS.IDLE?[3,2]:(this._callStatus=R.CALL_STATUS.IDLE,this.getIsLogin()?[4,this.setSelfIMCallStatus(R.CALL_STATUS.IDLE)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return T.default.debug("_resetTUICallEngine"),this._roomID=0,this._strRoomId="",this._isInviter=!1,this._isGroupCall=!1,this.setSwitchCallModeStatus(!0),this._groupID="",this._inviteeList=[],this._unHandledInviteeList=[],this._handledInviteeList=[],this._inviterInviteID={},this._initialInviteData={},this._audioVideoSwitchIdList=[],this._acceptedUserObject={},this._connectStartTime=0,this._switchCallModeStatus=!0,this._initialCallId="",this._callTimeout=30,this.setIsEnableMultiDeviceAbility(!1),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.resetTRTCClient()];case 3:return n.sent(),this._tsignalingClient.setInviteData(null),this._tsignalingClient.resetJoined(),(e=document.getElementById("_trtc_calling_layer"))&&(e.innerHTML=""),[2]}}))}))},t.prototype.getCallStatus=function(){return this._callStatus},t.prototype.changeCallStatus=function(t){this._callStatus!==t&&(this._logger.info("changeCallStatus.start",{text:{data:{newCallStatus:t,currentStatus:this._callStatus}},type:"api"}),T.default.debug("changeCallStatus from "+this._callStatus+" to "+t),this._callStatus=t)},t.prototype.setInitialInviteData=function(t){this._initialInviteData=t},t.prototype.modifyInvitation=function(t){return o(this,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:if(this.isGroupCall())return[2];e=i(i({},this._initialInviteData.data),{consumed:!0}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.tim.modifyInvitation({inviteID:t,data:JSON.stringify(i(i({},this._initialInviteData),{data:e}))})];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),T.default.error("modifyInvitation fail "+n),[3,4];case 4:return[2]}}))}))},t.prototype._callRecordUpload=function(t){var e=i(i({},t),{callRole:this.isInviter()?S.NAME.INVITER:S.NAME.INVITEE,userID:this.getUserId(),roomID:this.getRoomId(),inviteID:this.getInitialCallId(),strRoomId:this.getStrRoomId(),groupId:this.getGroupId()});this._callRecordReport.eventUpload(e)},t.prototype.extractCallingInfoFromMessage=function(t){if(!t)return"";if("TIMCustomElem"!==t.type)return"";var e=JSON.parse(t.payload.data);if(T.default.debug("extractCallingInfoFromMessage - signalingData:",t.payload.data),e.businessID!==R.BUSINESS_ID.SIGNAL)return"";switch(e.actionType){case R.ACTION_TYPE.INVITE:var n=JSON.parse(e.data);return n.call_end>0?"结束通话,通话时长:"+d.formatDuration(n.call_end):0!==n.call_end&&n.room_id?"发起通话":"结束群聊";case R.ACTION_TYPE.CANCEL_INVITE:return"取消通话";case R.ACTION_TYPE.ACCEPT_INVITE:return"已接听";case R.ACTION_TYPE.REJECT_INVITE:return"拒绝通话";case R.ACTION_TYPE.INVITE_TIMEOUT:return"无应答";default:return""}},t.prototype.setInitialCallId=function(t){this._initialCallId=t},t.prototype.getInitialCallId=function(){return this._initialCallId},t.prototype.setIsEnableMultiDeviceAbility=function(t){this._isEnableMultiDeviceAbility=!!t},t.prototype.getIsEnableMultiDeviceAbility=function(){return this._isEnableMultiDeviceAbility},t.prototype.generateCallTotalTime=function(){return 0===this.getConnectStartTime()?0:Math.round((Date.now()-this.getConnectStartTime())/1e3)},t.prototype.setSelfIMCallStatus=function(t){var e;return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(r){switch(r.label){case 0:if(this._logger.info("setSelfIMCallStatus.start",{text:{data:{callStatus:t,isEnableMultiDeviceAbility:this.getIsEnableMultiDeviceAbility()}},type:"api"}),!this.getIsEnableMultiDeviceAbility())return[2];if(!this.tim||!t||!this.getIsLogin())return[2];n=R.USER_CUSTOM_STATUS.NULL,r.label=1;case 1:switch(r.trys.push([1,3,,4]),t){case R.CALL_STATUS.CALLING:n=R.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_WAIT;break;case R.CALL_STATUS.CONNECTED:n=R.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_ACCEPT}return[4,null===(e=this.tim)||void 0===e?void 0:e.setSelfStatus({customStatus:n})];case 2:return r.sent(),[3,4];case 3:return i=r.sent(),this._logger.error("setSelfIMCallStatus.fail",{text:{error:i},type:"api"}),[3,4];case 4:return[2]}}))}))},t.prototype.getSelfIMCallStatus=function(t){var e;return void 0===t&&(t=[]),o(this,void 0,void 0,(function(){var n,i,r,a;return s(this,(function(o){switch(o.label){case 0:if(n=R.CALL_STATUS.IDLE,!this.getIsEnableMultiDeviceAbility())return[2,n];o.label=1;case 1:return o.trys.push([1,3,,4]),this._logger.info("getSelfIMCallStatus.start",{text:{data:t},type:"api"}),this.tim&&0!==t.length&&this.getIsLogin()?[4,null===(e=this.tim)||void 0===e?void 0:e.getUserStatus({userIDList:t})]:[2,n];case 2:if(0===(i=o.sent()).code)switch(r=(i.data||{}).successUserList,((void 0===r?[]:r)[0]||{}).customStatus){case R.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_WAIT:n=R.CALL_STATUS.CALLING;break;case R.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_ACCEPT:n=R.CALL_STATUS.CONNECTED}return[3,4];case 3:return a=o.sent(),this._logger.error("getSelfIMCallStatus.fail",{text:{error:a},type:"api"}),[3,4];case 4:return[2,n]}}))}))},t.prototype.setSdkAppId=function(t){this._sdkAppID=t},t.prototype.getSdkAppId=function(){return this._sdkAppID},t.prototype.setUserId=function(t){this._userID=t},t.prototype.getUserId=function(){return this._userID},t.prototype.setRoomId=function(t){this._roomID=t},t.prototype.getRoomId=function(){return this._roomID},t.prototype.setStrRoomId=function(t){this._strRoomId=t},t.prototype.getStrRoomId=function(){return this._strRoomId},t.prototype.analyzeAndSetRoomId=function(t,e){var n=d.analyzeRoomId(t,e);d.isNumber(n)&&this.setRoomId(n),e&&this.setStrRoomId(e)},t.prototype.setUserSig=function(t){this._userSig=t},t.prototype.getUserSig=function(){return this._userSig},t.prototype.getLanguage=function(){return this._language},t.prototype.setComponent=function(t){this._component=t},t.prototype.getComponent=function(){return this._component},t.prototype.getDevicePermission=function(){var t;(null===(t=this._trtcClient)||void 0===t?void 0:t._getDevicePermission)&&this._trtcClient._getDevicePermission()},t.prototype.callExperimentalAPI=function(t){return o(this,void 0,void 0,(function(){var e,n,i,r,a,o;return s(this,(function(s){if(this._logger.info("callExperimentalAPI",{text:{data:t},type:"api"}),(e=d.safelyParse(t))===t)return[2];if(n=e.api,i=e.params,r=void 0===i?{}:i,!n||!r)return[2];try{switch(n){case"setExcludeFromHistoryMessage":a=r.excludeFromHistoryMessage,o=void 0!==a&&a,this._excludeFromHistoryMessage=o}}catch(t){throw t}return[2]}))}))},t.CALL_TYPE=R.CALL_TYPE,r([D.paramValidate(D.VALIDATE_PARAMS.login),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"init",null),r([D.paramValidate(D.VALIDATE_PARAMS.login),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"login",null),r([D.avoidRepeatedCall(),D.paramValidate(D.VALIDATE_PARAMS.call),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.IDLE]}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.BASE),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"call",null),r([D.avoidRepeatedCall(),D.paramValidate(D.VALIDATE_PARAMS.groupCall),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.IDLE]}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.PRO),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"groupCall",null),r([D.paramValidate(D.VALIDATE_PARAMS.joinInGroupCall),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.IDLE]}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.PRO),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"joinInGroupCall",null),r([D.paramValidate(D.VALIDATE_PARAMS.inviteUser),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.PRO),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"inviteUser",null),r([D.avoidRepeatedCall(),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"accept",null),r([D.avoidRepeatedCall(),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"reject",null),r([D.avoidRepeatedCall(),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"hangup",null),r([D.paramValidate(D.VALIDATE_PARAMS.startRemoteView),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"startRemoteView",null),r([D.paramValidate(D.VALIDATE_PARAMS.stopRemoteView),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"stopRemoteView",null),r([D.paramValidate(D.VALIDATE_PARAMS.startLocalView),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),D.apiCallQueue(),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"startLocalView",null),r([D.paramValidate(D.VALIDATE_PARAMS.stopLocalView),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),D.apiCallQueue(),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"stopLocalView",null),r([D.paramValidate(D.VALIDATE_PARAMS.openCamera),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[String,Boolean]),a("design:returntype",Promise)],t.prototype,"openCamera",null),r([D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"closeCamera",null),r([D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"openMicrophone",null),r([D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"closeMicrophone",null),r([D.paramValidate(D.VALIDATE_PARAMS.setVideoQuality),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype",Promise)],t.prototype,"setVideoQuality",null),r([D.paramValidate(D.VALIDATE_PARAMS.setVideoRenderParams),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"setVideoRenderParams",null),r([D.paramValidate(D.VALIDATE_PARAMS.switchCallMediaType),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CONNECTED,R.CALL_STATUS.CALLING],scene:!0}),a("design:type",Function),a("design:paramtypes",[Number]),a("design:returntype",Promise)],t.prototype,"switchCallMediaType",null),r([D.paramValidate(D.VALIDATE_PARAMS.getDeviceList),D.statusValidate({init:!0}),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype",Promise)],t.prototype,"getDeviceList",null),r([D.paramValidate(D.VALIDATE_PARAMS.getCurrentDevice),D.statusValidate({init:!0}),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype",void 0)],t.prototype,"getCurrentDevice",null),r([D.paramValidate(D.VALIDATE_PARAMS.switchCamera),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[Number]),a("design:returntype",Promise)],t.prototype,"switchCamera",null),r([D.paramValidate(D.VALIDATE_PARAMS.switchDevice),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"switchDevice",null),r([D.paramValidate(D.VALIDATE_PARAMS.setSelfInfo),D.statusValidate({init:!0}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"setSelfInfo",null),r([D.avoidRepeatedCall(),D.paramValidate(D.VALIDATE_PARAMS.enableMultiDeviceAbility),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.PRO),a("design:type",Function),a("design:paramtypes",[Boolean]),a("design:returntype",void 0)],t.prototype,"enableMultiDeviceAbility",null),r([D.statusValidate({init:!0}),a("design:type",Function),a("design:paramtypes",[Boolean]),a("design:returntype",Promise)],t.prototype,"enableAIVoice",null),r([D.statusValidate({init:!0}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.ULTIMATE),a("design:type",Function),a("design:paramtypes",[Number]),a("design:returntype",Promise)],t.prototype,"setBlurBackground",null),r([D.statusValidate({init:!0}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.ULTIMATE),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype",Promise)],t.prototype,"setVirtualBackground",null),r([D.paramValidate(D.VALIDATE_PARAMS.createInstance),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",void 0)],t,"createInstance",null),t}();e.default=M},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return o}));const i=Function.prototype.apply,r=new WeakMap;function a(t){return r.has(t)||r.set(t,{}),r.get(t)}class o{constructor(t=null,e=console){const n=a(this);return n._events=new Set,n._callbacks={},n._console=e,n._maxListeners=null===t?null:parseInt(t,10),this}_addCallback(t,e,n,i){return this._getCallbacks(t).push({callback:e,context:n,weight:i}),this._getCallbacks(t).sort((t,e)=>t.weight>e.weight),this}_getCallbacks(t){return a(this)._callbacks[t]}_getCallbackIndex(t,e){return this._has(t)?this._getCallbacks(t).findIndex(t=>t.callback===e):null}_achieveMaxListener(t){return null!==a(this)._maxListeners&&a(this)._maxListeners<=this.listenersNumber(t)}_callbackIsExists(t,e,n){const i=this._getCallbackIndex(t,e),r=-1!==i?this._getCallbacks(t)[i]:void 0;return-1!==i&&r&&r.context===n}_has(t){return a(this)._events.has(t)}on(t,e,n=null,i=1){const r=a(this);if("function"!=typeof e)throw new TypeError(e+" is not a function");return this._has(t)?(this._achieveMaxListener(t)&&r._console.warn(`Max listeners (${r._maxListeners}) for event "${t}" is reached!`),this._callbackIsExists(...arguments)&&r._console.warn(`Event "${t}" already has the callback ${e}.`)):(r._events.add(t),r._callbacks[t]=[]),this._addCallback(...arguments),this}once(t,e,n=null,r=1){const a=(...r)=>(this.off(t,a),i.call(e,n,r));return this.on(t,a,n,r)}off(t,e=null){const n=a(this);let i;return this._has(t)&&(null===e?(n._events.delete(t),n._callbacks[t]=null):(i=this._getCallbackIndex(t,e),-1!==i&&(n._callbacks[t].splice(i,1),this.off(...arguments)))),this}emit(t,...e){return this._has(t)&&this._getCallbacks(t).forEach(t=>i.call(t.callback,t.context,e)),this}clear(){const t=a(this);return t._events.clear(),t._callbacks={},this}listenersNumber(t){return this._has(t)?this._getCallbacks(t).length:null}}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},o=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i};Object.defineProperty(e,"__esModule",{value:!0});var s=n(14),l=n(8),u=n(2),c=n(37),d=n(1),p=n(10),h=n(7),_=n(11),f=n(6),E=n(9),g=n(0),I=n(5),v=n(12),C=n(15),T="TRTCClient",R=function(){function t(t){var e;this._trtcCloud=null,this._tuiCallEngine=null,this._isVideoPublish=!1,this._isAudioPublish=!1,this._isEnterRoom=!1,this._videoStreamType=s.TRTCVideoStreamType.TRTCVideoStreamTypeBig,this._frameWorkType=30,this._permission={audio:!1,video:!1},this._devices={microphone:[],camera:[],speaker:[]},this._currentDevices={microphone:null,camera:null,speaker:null},this._isRegisterVirtualBackgroundModelFile=!1,this._tuiCallEngine=t.tuiCallEngine,this._component=this._tuiCallEngine.getComponent(),((null===(e=null===window||void 0===window?void 0:window.localStorage)||void 0===e?void 0:e.getItem("_isTIMCallKit"))||(null===window||void 0===window?void 0:window._isTIMCallKit))&&(this._component=15),this._trtcCloud=s.default.getTRTCShareInstance({frameWorkType:this._frameWorkType,component:this._component,language:this._tuiCallEngine.getLanguage()}),d.isUndefined(t.logLevel)||this.setLogLevel(t.logLevel),this._addTRTCEvents(),this._logger=l.default(),c.isHttpProtocols()&&(this._logger.error(T+".constructor.error",{text:{data:{code:h.default.ERROR_HTTP,msg:_.ERROR_MESSAGE.ERROR_HTTP}},type:"api"}),u.default.error("code: "+h.default.ERROR_HTTP+", "+_.ERROR_MESSAGE.ERROR_HTTP+", "+_.ERROR_CN_MESSAGE.ERROR_HTTP))}return t.prototype.enterRoom=function(t){var e,n;return r(this,void 0,void 0,(function(){var r,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),this._logger.info(T+".enterRoom.start",{text:{data:t},type:"api"}),this.getIsEnterRoom()?[2]:(r=i(i({sdkAppId:null===(e=this._tuiCallEngine)||void 0===e?void 0:e.getSdkAppId(),userId:this._tuiCallEngine.getUserId(),userSig:this._tuiCallEngine.getUserSig()},t),{role:s.TRTCRoleType.TRTCRoleAnchor}),[4,null===(n=this._trtcCloud)||void 0===n?void 0:n.enterRoom(r)]);case 1:return a.sent(),this.setIsEnterRoom(!0),[3,3];case 2:throw o=a.sent(),this._logger.error(T+".enterRoom.fail",{text:{error:o},type:"api"}),u.default.error(T+".enterRoom failed error = "+o),new Error(T+".enterRoom failed! "+o);case 3:return[2]}}))}))},t.prototype.exitRoom=function(){var t;return r(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return this._logger.info(T+".exitRoom.start",{text:{data:{isJoined:this.getIsEnterRoom()}},type:"api"}),u.default.info(T+".exitRoom isEnterRoom = "+this.getIsEnterRoom()),this.getIsEnterRoom()?(this._closeAudioVolumeEvaluation(),this.getIsRegisterVirtualBackgroundModelFile()?[4,this.setVirtualBackground({enable:!1})]:[3,2]):[2];case 1:n.sent(),n.label=2;case 2:return[4,this.stopLocalPreview()];case 3:return n.sent(),[4,this._trtcCloud.stopLocalAudio()];case 4:return n.sent(),[4,null===(t=this._trtcCloud)||void 0===t?void 0:t.exitRoom()];case 5:return n.sent(),this.setIsEnterRoom(!1),this.resetTRTCClient(),e=(new Date).getTime(),this._tuiCallEngine.getCallDataReport().setExitRoomTime(e),[2]}}))}))},t.prototype.startLocalPreview=function(t,e){var n,i;return r(this,void 0,void 0,(function(){var r,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,8,,9]),r=e,I.isMobile()&&d.isUndefined(e)&&(r=!0),[4,null===(n=this._trtcCloud)||void 0===n?void 0:n.startLocalPreview(r,t)];case 1:return a.sent(),[4,this.setVideoEncoderParam()];case 2:return a.sent(),[4,null===(i=this._trtcCloud)||void 0===i?void 0:i.setLocalRenderParams(this._tuiCallEngine.getLocalPlayOptions())];case 3:return a.sent(),this._tuiCallEngine.isInviter()&&this._tuiCallEngine.getCallStatus()===f.CALL_STATUS.CALLING?[4,this.muteLocalVideo(!0)]:[3,5];case 4:a.sent(),a.label=5;case 5:return this._tuiCallEngine.isInviter()?[3,7]:[4,this.muteLocalVideo(!1)];case 6:a.sent(),a.label=7;case 7:return[3,9];case 8:throw o=a.sent(),this._logger.error(T+".startLocalPreview.fail",{text:{error:o},type:"api"}),new Error(T+".startLocalPreview failed, error:"+o);case 9:return[2]}}))}))},t.prototype.stopLocalPreview=function(){var t;return r(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this._logger.info(T+".stopLocalPreview.start",{text:{},type:"api"}),[4,null===(t=this._trtcCloud)||void 0===t?void 0:t.stopLocalPreview()];case 1:return n.sent(),this.setIsVideoPublish(!1),[3,3];case 2:throw e=n.sent(),this._logger.error(T+".stopLocalPreview.fail",{text:{error:e},type:"api"}),u.default.error(T+".stopLocalPreview failed to play local video "+e),new Error(T+".stopLocalPreview failed to play local video "+e);case 3:return[2]}}))}))},t.prototype.startRemoteView=function(t){var e,n;return r(this,void 0,void 0,(function(){var i,r,o,s,l;return a(this,(function(a){switch(a.label){case 0:u.default.info(T+".startRemoteView params = "+t),i=t.videoViewDomId,r=t.userId,a.label=1;case 1:return a.trys.push([1,4,,5]),o=this._tuiCallEngine.getRemotePlayOptions(),s=this.getVideoStreamType(),[4,null===(e=this._trtcCloud)||void 0===e?void 0:e.startRemoteView(r,i,s)];case 2:return a.sent(),[4,null===(n=this._trtcCloud)||void 0===n?void 0:n.setRemoteRenderParams(r,s,o)];case 3:return a.sent(),[3,5];case 4:throw l=a.sent(),this._logger.error(T+".startRemoteView.fail",{text:{error:l},type:"api"}),u.default.error(T+".startRemoteView failed error "+l),new Error(T+".startRemoteView failed error "+l);case 5:return[2]}}))}))},t.prototype.stopRemoteView=function(t){var e;return r(this,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:u.default.debug(T+".stopRemoteView params = "+t),r.label=1;case 1:return r.trys.push([1,3,,4]),n=this.getVideoStreamType(),[4,null===(e=this._trtcCloud)||void 0===e?void 0:e.stopRemoteView(t.userId,n)];case 2:return r.sent(),[3,4];case 3:throw i=r.sent(),this._logger.error(T+".stopRemoteView.fail",{text:{error:i},type:"api"}),u.default.error(T+".stopRemoteView failed error "+i),new Error(T+".stopRemoteView failed error "+i);case 4:return[2]}}))}))},t.prototype.muteLocalAudio=function(){var t;return r(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,null===(t=this._trtcCloud)||void 0===t?void 0:t.muteLocalAudio(!0)];case 1:return e.sent(),this.setIsAudioPublish(!1),[2]}}))}))},t.prototype.unMuteLocalAudio=function(){var t;return r(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,null===(t=this._trtcCloud)||void 0===t?void 0:t.muteLocalAudio(!1)];case 1:return e.sent(),this.setIsAudioPublish(!0),[2]}}))}))},t.prototype.muteLocalVideo=function(t){var e;return r(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,null===(e=this._trtcCloud)||void 0===e?void 0:e.muteLocalVideo(t)];case 1:return n.sent(),this.setIsVideoPublish(!t),[2]}}))}))},t.prototype.setVideoEncoderParam=function(t){var e;return r(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this._logger.info(T+".setVideoEncoderParam.start",{type:"api",text:{data:t}}),t=t||this._tuiCallEngine.getVideoQuality(),g.VIDEO_ENCODER_MAP[t]?[4,null===(e=this._trtcCloud)||void 0===e?void 0:e.setVideoEncoderParam(g.VIDEO_ENCODER_MAP[t])]:[3,2];case 1:i.sent(),i.label=2;case 2:return[3,4];case 3:return n=i.sent(),this._logger.error(T+".setVideoEncoderParam.fail",{text:{error:n},type:"api"}),u.default.error(T+".setVideoEncoderParam.failed, error: "+n),[3,4];case 4:return[2]}}))}))},t.prototype.setVideoRenderParams=function(t){var e,n;return r(this,void 0,void 0,(function(){var i,r;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),t.userId!==this._tuiCallEngine.getUserId()?[3,2]:[4,null===(e=this._trtcCloud)||void 0===e?void 0:e.setLocalRenderParams(t)];case 1:return a.sent(),[3,4];case 2:return i=this.getVideoStreamType(),[4,null===(n=this._trtcCloud)||void 0===n?void 0:n.setRemoteRenderParams(t.userId,i,t)];case 3:a.sent(),a.label=4;case 4:return[3,6];case 5:return r=a.sent(),this._logger.error(T+".setVideoRenderParams.fail",{text:{error:r},type:"api"}),u.default.warn(T+"._setVideoRenderParams failed error = "+r),[3,6];case 6:return[2]}}))}))},t.prototype.switchCallMode=function(t){return r(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:if(u.default.info(T+".switchCallMode - type",t),t!==f.CALL_TYPE.VIDEO_CALL)return[2];e=f.CALL_TYPE.AUDIO_CALL,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.stopLocalPreview()];case 2:return n.sent(),this._tuiCallEngine.setCallType(e),this._tuiCallEngine.setSwitchCallModeStatus(!0),this._tuiCallEngine._delegate.onCallTypeChanged(t,e),[3,4];case 3:return n.sent(),t===f.CALL_TYPE.VIDEO_CALL&&this._tuiCallEngine._delegate.onError(h.default.FAILURE_SWITCH_TO_AUDIO,C.getErrorMessage({code:h.default.FAILURE_SWITCH_TO_AUDIO})),[3,4];case 4:return[2]}}))}))},t.prototype.resetTRTCClient=function(){return r(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this.getIsEnterRoom()?[4,this.exitRoom()]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.setIsEnterRoom(!1),this.setIsVideoPublish(!1),this.setIsAudioPublish(!1),[2]}}))}))},t.prototype.getMediaDevicesAuth=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(a){switch(a.label){case 0:if(this._logger.info(T+".getMediaDevicesAuth.start",{text:{data:{params:t}},type:"api"}),c.isHttpProtocols())throw this._logger.error(T+".getMediaDevicesAuth.fail",{text:{error:_.ERROR_MESSAGE.ERROR_HTTP},type:"api"}),new p.default({code:h.default.ERROR_HTTP});if(e=this._getDevicePermission(),!t.audio)return[3,4];if(I.IS_IOS&&e.audio)return[2,e];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!0})];case 2:return i=a.sent(),this._releaseStream(i),this._setDevicePermission(g.NAME.AUDIO,!0),[3,4];case 3:return n=a.sent(),this._logger.error(T+".getMediaDevicesAuth.fail",{text:{error:n},type:"api"}),this._setDevicePermission(g.NAME.AUDIO,!1),this._handleMediaError(n,"getMediaDevicesAuth",g.NAME.AUDIO),[3,4];case 4:if(!t.video)return[3,8];if(I.IS_IOS&&e.video)return[2,e];a.label=5;case 5:return a.trys.push([5,7,,8]),[4,navigator.mediaDevices.getUserMedia({video:!0})];case 6:return i=a.sent(),this._releaseStream(i),this._setDevicePermission(g.NAME.VIDEO,!0),[3,8];case 7:return r=a.sent(),this._logger.error(T+".getMediaDevicesAuth.fail",{text:{error:r},type:"api"}),this._setDevicePermission(g.NAME.VIDEO,!1),t.isThrowVideoError&&this._handleMediaError(r,"getMediaDevicesAuth",g.NAME.VIDEO),[3,8];case 8:return[2,this._getDevicePermission()]}}))}))},t.prototype.switchDevice=function(t,e){return r(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return this._logger.info(T+".getMediaDevicesAuth.start",{text:{data:{deviceType:t,deviceId:e}},type:"api"}),n=!1,t!==E.DEVICE_TYPE.CAMERA?[3,2]:[4,this._trtcCloud.setCurrentCameraDevice(e)];case 1:n=i.sent(),i.label=2;case 2:return t!==E.DEVICE_TYPE.MICROPHONE?[3,4]:[4,this._trtcCloud.setCurrentMicDevice(e)];case 3:n=i.sent(),i.label=4;case 4:return t!==E.DEVICE_TYPE.SPEAKER?[3,6]:[4,this._trtcCloud.setCurrentSpeakerDevice(e)];case 5:n=i.sent(),i.label=6;case 6:return this._updateCurrentDevice(),this._tuiCallEngine._delegate.onDeviceUpdated(this._devices,this._currentDevices),[2,n]}}))}))},t.prototype.switchCamera=function(t){var e;return r(this,void 0,void 0,(function(){var n,i;return a(this,(function(r){switch(r.label){case 0:this._logger.info(T+".switchCamera.start",{text:{data:{cameraType:t}},type:"api"}),r.label=1;case 1:return r.trys.push([1,3,,4]),n=t===v.TUICallCameraPosition.FRONT,[4,null===(e=this._trtcCloud)||void 0===e?void 0:e.switchCamera(n)];case 2:return r.sent(),[3,4];case 3:throw i=r.sent(),this._logger.error(T+".switchCamera.fail",{text:{error:i},type:"api"}),i;case 4:return[2]}}))}))},t.prototype.getDeviceList=function(t){return r(this,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:this._logger.info(T+".getDeviceList.start",{text:{data:{deviceType:t}},type:"api"}),i.label=1;case 1:switch(i.trys.push([1,12,,13]),e=[],t){case E.DEVICE_TYPE.CAMERA:return[3,2];case E.DEVICE_TYPE.MICROPHONE:return[3,5];case E.DEVICE_TYPE.SPEAKER:return[3,8]}return[3,11];case 2:return this._getDevicePermission().video?[4,this._trtcCloud.getCameraDevicesList()]:[3,4];case 3:e=i.sent(),i.label=4;case 4:return[3,11];case 5:return this._getDevicePermission().audio?[4,this._trtcCloud.getMicDevicesList()]:[3,7];case 6:e=i.sent(),i.label=7;case 7:return[3,11];case 8:return this._getDevicePermission().audio?[4,this._trtcCloud.getSpeakerDevicesList()]:[3,10];case 9:e=i.sent(),i.label=10;case 10:return[3,11];case 11:return this._setDevice(t,e),[2,e];case 12:throw n=i.sent(),this._logger.error(T+".getDeviceList.fail",{text:{error:n},type:"api"}),n;case 13:return[2]}}))}))},t.prototype.getCurrentDevice=function(t){return this._updateCurrentDevice(),this._currentDevices[t]},t.prototype.setLogLevel=function(t){(null===s.default||void 0===s.default?void 0:s.default.setLogLevel)&&s.default.setLogLevel(t+1)},t.prototype.setVirtualBackground=function(t){var e;return r(this,void 0,void 0,(function(){var n,r,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),n=t.enable,this.getIsRegisterVirtualBackgroundModelFile()||!n?[3,2]:[4,this._trtcCloud.useVirtualBackground()];case 1:a.sent(),this.setIsRegisterVirtualBackgroundModelFile(!0),a.label=2;case 2:return r={api:g.NAME.ENABLE_VIRTUAL_BACKGROUND,params:i({sdkAppId:this._tuiCallEngine.getSdkAppId(),userId:this._tuiCallEngine.getUserId(),userSig:this._tuiCallEngine.getUserSig()},t)},this._logger.info(T+".setVirtualBackground.start",{type:"api",text:{data:r}}),[4,null===(e=this._trtcCloud)||void 0===e?void 0:e.callExperimentalAPI(JSON.stringify(r))];case 3:return a.sent(),[3,5];case 4:throw o=a.sent(),u.default.error(T+".setVirtualBackground.fail, "+o),this._logger.error(T+".setVirtualBackground.fail",{text:{error:o},type:"api"}),o;case 5:return[2]}}))}))},t.prototype._openAudioVolumeEvaluation=function(t){var e;void 0===t&&(t=1e3),null===(e=this._trtcCloud)||void 0===e||e.enableAudioVolumeEvaluation(t)},t.prototype._closeAudioVolumeEvaluation=function(){var t;null===(t=this._trtcCloud)||void 0===t||t.enableAudioVolumeEvaluation(-1)},t.prototype._releaseStream=function(t){for(var e=t.getTracks(),n=0;n<e.length;n++)e[n].stop()},t.prototype._handleMediaError=function(t,e,n){var i=h.default.UNKNOWN,r=g.NAME.UNKNOWN;switch(null==t?void 0:t.name){case"NotFoundError":n===E.DEVICE_TYPE.AUDIO&&(i=h.default.NOT_MICROPHONE_LIST),n===E.DEVICE_TYPE.VIDEO&&(i=h.default.NOT_CAMERA_LIST);break;case"NotAllowedError":i=h.default.ERROR_PERMISSION_DENIED}throw r=C.getErrorMessage({code:i,params:{error:t,fnName:e}}),this._tuiCallEngine._delegate.onError(i,JSON.stringify(r)),new p.default({code:i,message:r})},t.prototype._updateCurrentDevice=function(){this._currentDevices[g.NAME.CAMERA]=this._trtcCloud.getCurrentCameraDevice(),this._currentDevices[g.NAME.MICROPHONE]=this._trtcCloud.getCurrentMicDevice(),this._currentDevices[g.NAME.SPEAKER]=this._trtcCloud.getCurrentSpeakerDevice(),this._logger.info(T+"._getCurrentDevice.start",{text:{data:i({},this._currentDevices)},type:"api"})},t.prototype._addTRTCEvents=function(){var t,e,n,l,c,d,p,h,_,g,I,v=this;null===(t=this._trtcCloud)||void 0===t||t.on("onEnterRoom",(function(t){return r(v,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return this._logger.info(T+".enterRoom.success",{type:"api",text:{cost:t}}),t>0?[4,this._trtcCloud.startLocalAudio()]:[3,5];case 1:return n.sent(),this._tuiCallEngine.isInviter()?[4,this._tuiCallEngine.setSelfIMCallStatus(f.CALL_STATUS.CALLING)]:[3,4];case 2:return n.sent(),[4,this.muteLocalAudio()];case 3:return n.sent(),[3,5];case 4:this.setIsVideoPublish(!0),this.setIsAudioPublish(!0),e=this._tuiCallEngine.generateEventData(),this._tuiCallEngine._delegate.onCallBegin(e),n.label=5;case 5:return[2]}}))}))})),null===(e=this._trtcCloud)||void 0===e||e.on("onExitRoom",(function(t){return r(v,void 0,void 0,(function(){var e,n;return a(this,(function(r){switch(r.label){case 0:return u.default.warn("退房, reason = "+t),0===t?[3,4]:(u.default.warn("leave room, reason: "+t),this._tuiCallEngine.getCallStatus()===f.CALL_STATUS.CONNECTED&&(e=this._tuiCallEngine.generateCallEndData(),this._tuiCallEngine._delegate.onCallEnd(e)),this._tuiCallEngine.getCallStatus()!==f.CALL_STATUS.CALLING?[3,2]:(n=i(i({},this._tuiCallEngine.generateEventData()),{reason:t}),this._tuiCallEngine._delegate.onCallingCancel(i({userID:this._tuiCallEngine.getUserId()},n)),[4,this._tuiCallEngine._cancel()]));case 1:r.sent(),r.label=2;case 2:return[4,this._tuiCallEngine._resetTUICallEngine()];case 3:r.sent(),r.label=4;case 4:return[2]}}))}))})),null===(n=this._trtcCloud)||void 0===n||n.on("onRemoteUserEnterRoom",(function(t){return r(v,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return u.default.info(T+".onRemoteUserEnterRoom userId = "+t),this._tuiCallEngine.getConnectStartTime()||(this._tuiCallEngine.setConnectStartTime(Date.now()),this._openAudioVolumeEvaluation()),this._tuiCallEngine._delegate.onUserEnter(t),this._tuiCallEngine.addHandledInviteeList([t]),this._tuiCallEngine.deleteUnHandledInviteeList([t]),this._tuiCallEngine.addAcceptedUserList(null,[t]),this._tuiCallEngine.getCallStatus()!==f.CALL_STATUS.CALLING?[3,6]:(this._tuiCallEngine.changeCallStatus(f.CALL_STATUS.CONNECTED),this._tuiCallEngine.isInviter()?(e=this._tuiCallEngine.generateEventData(),this._tuiCallEngine._delegate.onCallBegin(e),!this.getIsVideoPublish()?[4,this.muteLocalVideo(!1)]:[3,2]):[3,6]);case 1:i.sent(),i.label=2;case 2:return!this.getIsAudioPublish()?[4,this.unMuteLocalAudio()]:[3,4];case 3:i.sent(),i.label=4;case 4:return[4,this._tuiCallEngine.setSelfIMCallStatus(f.CALL_STATUS.CONNECTED)];case 5:i.sent(),i.label=6;case 6:return this._tuiCallEngine.isGroupCall()&&(n=this._tuiCallEngine.getHandledInviteeList(),this._tuiCallEngine._delegate.onGroupCallInviteeListUpdate(n)),[2]}}))}))})),null===(l=this._trtcCloud)||void 0===l||l.on("onRemoteUserLeaveRoom",(function(t,e){return r(v,void 0,void 0,(function(){var n,i,r,o,s,l;return a(this,(function(a){switch(a.label){case 0:return u.default.info(T+".onRemoteUserLeaveRoom userId = "+t+", reason = "+e),this._tuiCallEngine.getCallStatus()===f.CALL_STATUS.IDLE?[2]:(n=this._tuiCallEngine.isGroupCall(),this._tuiCallEngine.deleteHandledInviteeList([t]),this._tuiCallEngine._delegate.onUserLeave(t),i=this._tuiCallEngine.getHandledInviteeList(),n?(r=this._tuiCallEngine.getUnHandledInviteeList(),0!==i.length&&this._tuiCallEngine._delegate.onGroupCallInviteeListUpdate(i),o=this._tuiCallEngine.getUserId(),1!==i.length||i[0]!==o||0!==r.length?[3,2]:(s=this._tuiCallEngine.generateCallEndData(),this._tuiCallEngine._delegate.onCallEnd(s),[4,this._tuiCallEngine._resetTUICallEngine()])):[3,3]);case 1:a.sent(),a.label=2;case 2:return[3,6];case 3:return l={callType:this._tuiCallEngine.getCallType(),userIDList:[t],callEnd:this._tuiCallEngine.generateCallTotalTime()},1!==i.length?[3,6]:[4,this._tuiCallEngine._tsignalingClient.hangup(l)];case 4:return a.sent(),[4,this._tuiCallEngine._resetTUICallEngine()];case 5:a.sent(),a.label=6;case 6:return[2]}}))}))})),null===(c=this._trtcCloud)||void 0===c||c.on("onUserVideoAvailable",(function(t,e){v._tuiCallEngine._delegate.onUserVideoAvailable({userID:t,isVideoAvailable:e})})),null===(d=this._trtcCloud)||void 0===d||d.on("onUserAudioAvailable",(function(t,e){v._tuiCallEngine._delegate.onUserAudioAvailable({userID:t,isAudioAvailable:e})})),null===(p=this._trtcCloud)||void 0===p||p.on("onUserVoiceVolume",(function(t){t=t.map((function(t){return{userId:""===t.userId?v._tuiCallEngine.getUserId():t.userId,audioVolume:t.volume}})),v._tuiCallEngine._delegate.onUserVoiceVolume(t)})),null===(h=this._trtcCloud)||void 0===h||h.on("onDeviceChange",(function(t,e,n){return r(v,void 0,void 0,(function(){var t,n;return a(this,(function(i){switch(i.label){case 0:return(n={})[s.TRTCDeviceType.TRTCDeviceTypeMi]=E.DEVICE_TYPE.MICROPHONE,n[s.TRTCDeviceType.TRTCDeviceTypeSpeaker]=E.DEVICE_TYPE.SPEAKER,n[s.TRTCDeviceType.TRTCDeviceTypeCamera]=E.DEVICE_TYPE.CAMERA,t=n,[4,this.getDeviceList(t[e])];case 1:return i.sent(),this._updateCurrentDevice(),this._tuiCallEngine._delegate.onDeviceUpdated(this._devices,this._currentDevices),[2]}}))}))})),null===(_=this._trtcCloud)||void 0===_||_.on("onNetworkQuality",(function(t,e){return r(v,void 0,void 0,(function(){var n;return a(this,(function(r){return n=this._tuiCallEngine.getUserId(),this._tuiCallEngine._delegate.onUserNetworkQualityChanged(o([i(i({},t),{userId:n})],e)),[2]}))}))})),null===(g=this._trtcCloud)||void 0===g||g.on("onError",(function(t,e){u.default.error(T+".onError, code = "+t+", message = "+e),v._tuiCallEngine._delegate.onError(t,e)})),null===(I=this._trtcCloud)||void 0===I||I.on("onWarning",(function(t){var e=t.code;if(10000003===e||10000006===e){var n="Insufficient device performance causes high latency, please turn off the virtual background";v._logger.info("setVirtualBackground.error",{text:{data:{code:e,message:n}},type:"api"}),v._tuiCallEngine._delegate.onError(e,n)}}))},t.prototype.removeTRTCEvents=function(){var t;null===(t=this._trtcCloud)||void 0===t||t.removeAllListeners()},t.prototype.getTRTCCloud=function(){return this._trtcCloud},t.prototype.setIsVideoPublish=function(t){this._isVideoPublish=t},t.prototype.getIsVideoPublish=function(){return this._isVideoPublish},t.prototype.setIsAudioPublish=function(t){this._isAudioPublish=t},t.prototype.getIsAudioPublish=function(){return this._isAudioPublish},t.prototype.setIsEnterRoom=function(t){this._isEnterRoom=t},t.prototype.getIsEnterRoom=function(){return this._isEnterRoom},t.prototype.setVideoStreamType=function(t){this._videoStreamType=t||this._videoStreamType},t.prototype.getVideoStreamType=function(){return this._videoStreamType},t.prototype.enableAIVoice=function(t){},t.prototype._setDevice=function(t,e){this._devices[t]=e},t.prototype._getDevicePermission=function(){return this._permission},t.prototype._setDevicePermission=function(t,e){this._permission[t]=e},t.prototype.setIsRegisterVirtualBackgroundModelFile=function(t){this._isRegisterVirtualBackgroundModelFile=t},t.prototype.getIsRegisterVirtualBackgroundModelFile=function(){return this._isRegisterVirtualBackgroundModelFile},t}();e.default=R},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isHttpProtocols=void 0,e.isHttpProtocols=function(){if(!window)return!1;if(!window.location)return!1;var t=window.location,e=t.protocol,n=t.hostname;return"http:"===e&&"localhost"!==n&&"127.0.0.1"!==n}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},o=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},s=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i};Object.defineProperty(e,"__esModule",{value:!0});var l=n(20),u=n(8),c=n(2),d=n(6),p="TSignalClient",h=n(0),_=n(1),f=function(){function t(t,e){this._loginResolveList=[],this._tuiCallEngine=t,this._chat=e.tim,this._joined=!1,this._newInvitationData=null,this._logger=u.default(),this.addTSignalEvents()}return t.prototype.setTSignalingIsJoined=function(t){this._joined=t},t.prototype.getTSignalingIsJoined=function(){return this._joined},t.prototype.setLogLevel=function(t){this._chat.setLogLevel(t)},t.prototype.addTSignalEvents=function(){var t,e,n,i,r,a=l,o=a.EVENT,s=a.TSignaling;this._chat.on(o.SDK_READY,this.onSdkReady,this),this._chat.on(o.SDK_NOT_READY,this.onSdkNotReady,this),this._chat.on(o.KICKED_OUT,this.onKickedOut,this),this._chat.on(o.NET_STATE_CHANGE,this.onNetStateChange,this),this._chat.on(o.USER_STATUS_UPDATED,this.onUserStatusUpdated,this),null===(t=this._chat)||void 0===t||t.addSignalingListener(s.NEW_INVITATION_RECEIVED,this.onNewInvitationReceived,this),null===(e=this._chat)||void 0===e||e.addSignalingListener(s.INVITEE_ACCEPTED,this.onInviteeAccepted,this),null===(n=this._chat)||void 0===n||n.addSignalingListener(s.INVITEE_REJECTED,this.onInviteeRejected,this),null===(i=this._chat)||void 0===i||i.addSignalingListener(s.INVITATION_CANCELLED,this.onInvitationCancelled,this),null===(r=this._chat)||void 0===r||r.addSignalingListener(s.INVITATION_TIMEOUT,this.onInvitationTimeout,this)},t.prototype.removeTSignalEvents=function(){var t,e,n,i,r,a=l,o=a.EVENT,s=a.TSignaling;this._chat.off(o.SDK_READY,this.onSdkReady,this),this._chat.off(o.SDK_NOT_READY,this.onSdkNotReady,this),this._chat.off(o.KICKED_OUT,this.onKickedOut,this),this._chat.off(o.NET_STATE_CHANGE,this.onNetStateChange,this),this._chat.off(o.USER_STATUS_UPDATED,this.onUserStatusUpdated,this),null===(t=this._chat)||void 0===t||t.removeSignalingListener(s.NEW_INVITATION_RECEIVED,this.onNewInvitationReceived,this),null===(e=this._chat)||void 0===e||e.removeSignalingListener(s.INVITEE_ACCEPTED,this.onInviteeAccepted,this),null===(n=this._chat)||void 0===n||n.removeSignalingListener(s.INVITEE_REJECTED,this.onInviteeRejected,this),null===(i=this._chat)||void 0===i||i.removeSignalingListener(s.INVITATION_CANCELLED,this.onInvitationCancelled,this),null===(r=this._chat)||void 0===r||r.removeSignalingListener(s.INVITATION_TIMEOUT,this.onInvitationTimeout,this)},t.prototype.onSdkReady=function(t){this._logger.info(p+".onSdkReady",{type:"event"}),this._tuiCallEngine._delegate.onSdkReady(t),this._loginResolveList.forEach((function(t){return t.resolve(t.value)})),this._loginResolveList=[]},t.prototype.onSdkNotReady=function(){this._logger.info(p+".onSdkNotReady",{type:"event"}),c.default.warn("onSdkNotReady")},t.prototype.onNewInvitationReceived=function(t){var e,n,i,o;return r(this,void 0,void 0,(function(){var r,s,l,u,f,E,g,I,v,C,T;return a(this,(function(a){switch(a.label){case 0:return r=this._tuiCallEngine.getCallStatus(),this._logger.info(p+".onNewInvitationReceived",{type:"event",text:{data:{params:t,currentCallStatus:r}}}),c.default.info(p+".onNewInvitationReceived - params:",t,"currentCallStatus:"+r),s=t.data,l=s.inviter,u=s.inviteeList,f=s.data,E=s.inviteID,g=s.groupID,this._tuiCallEngine.setInitialInviteData(JSON.parse(f)),I=JSON.parse(f),_.isCallSignaling(null==I?void 0:I.businessID)?(I.room_id||(I.room_id=null===(e=null==I?void 0:I.data)||void 0===e?void 0:e.room_id),v=(null===(n=null==I?void 0:I.data)||void 0===n?void 0:n.initialCallId)||"",this._tuiCallEngine.getUserId()===l?[2]:(C=!!g)||!(null===(i=null==I?void 0:I.data)||void 0===i?void 0:i.consumed)&&!(null==I?void 0:I.consumed)?(T={inviter:l,inviteeList:u,inviteID:E,isGroupCall:C,inviteData:I,groupID:g,initialCallId:v,currentCallStatus:r,inCallUserIDs:(null==I?void 0:I.inCallUserIDs)||[]},(null===(o=null==I?void 0:I.data)||void 0===o?void 0:o.cmd)!==d.CMD_TYPE.HANG_UP?[3,2]:(c.default.info(p+".hangup - params:",l,I,this._tuiCallEngine.getHandledInviteeList(),this._tuiCallEngine.getUnHandledInviteeList(),r,C),r===d.CALL_STATUS.IDLE?[2]:[4,this.handleHangupSignal(T)])):[2]):[2];case 1:return a.sent(),[2];case 2:return g||!this.judgeSwitchCallMode(I)?[3,5]:r===d.CALL_STATUS.IDLE||this._tuiCallEngine.getRoomId()!==I.room_id?[3,4]:[4,this.handleSwitchCallMode(E,I)];case 3:a.sent(),this._tuiCallEngine.addAudioVideoSwitchIdList(E),a.label=4;case 4:return[2];case 5:return r===d.CALL_STATUS.IDLE?[3,7]:[4,this.reject({inviteID:E,callType:I.call_type,isBusy:!0})];case 6:return a.sent(),this._tuiCallEngine.getCallRecordReport().eventUploadNotSave({inviteID:v||E,callRole:h.NAME.INVITEE,eventType:h.NAME.IGNORE_CALL,roomID:I.room_id,mediaType:I.call_type,callType:g?h.NAME.GROUP:h.NAME.SINGLE,groupId:g,strRoomId:I.str_room_id||I.data.str_room_id}),[2];case 7:return this.handleInvitedSignal(T),[2]}}))}))},t.prototype.handleHangupSignal=function(t){return r(this,void 0,void 0,(function(){var e,n,r,o,s,l,u,c,_,f;return a(this,(function(a){switch(a.label){case 0:if(this._logger.info(p+".handleHangupSignal",{text:{data:i(i({},t),{isInviter:this._tuiCallEngine.isInviter(),isGroupCall:this._tuiCallEngine.isGroupCall()})},type:"event"}),e=t.inviter,n=t.inviteData,r=t.currentCallStatus,o=t.inviteeList,s=this._tuiCallEngine.isGroupCall(),l=this._tuiCallEngine.isInviter(),r===d.CALL_STATUS.CALLING){if(c=this._tuiCallEngine.getHandledInviteeList(),-1!==(_=this._tuiCallEngine.getUnHandledInviteeList()).indexOf(e)&&this._tuiCallEngine.deleteUnHandledInviteeList([e]),-1===c.indexOf(e))return[2]}else if(this._tuiCallEngine.deleteHandledInviteeList([e]),-1===(c=this._tuiCallEngine.getHandledInviteeList()).indexOf(e)&&c.length>1)return[2];return u=this._tuiCallEngine.generateCallEndData({totalTime:n.call_end||0}),s?[3,2]:[4,this._tuiCallEngine._resetTUICallEngine()];case 1:return a.sent(),this._tuiCallEngine._delegate.onCallEnd(u),[3,10];case 2:return this._tuiCallEngine.deleteHandledInviteeList([e]),c=this._tuiCallEngine.getHandledInviteeList(),_=this._tuiCallEngine.getUnHandledInviteeList(),l?1!==c.length||0!==_.length?[3,4]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,5];case 3:a.sent(),this._tuiCallEngine._delegate.onCallEnd(u),a.label=4;case 4:return[3,10];case 5:return r!==d.CALL_STATUS.CALLING?[3,8]:(-1!==o.indexOf(this._tuiCallEngine.getUserId())&&this._tuiCallEngine._delegate.onUserLeave(e),0!==c.length||1!==_.length?[3,7]:(f=this._tuiCallEngine.generateEventData(),[4,this._tuiCallEngine._resetTUICallEngine()]));case 6:a.sent(),this._tuiCallEngine._delegate.onCallingCancel(i(i({userID:e},f),{reason:h.NAME.NORMAL})),a.label=7;case 7:return[3,10];case 8:return 1!==c.length||0!==_.length?[3,10]:[4,this._tuiCallEngine._resetTUICallEngine()];case 9:a.sent(),this._tuiCallEngine._delegate.onCallEnd(u),a.label=10;case 10:return[2]}}))}))},t.prototype.handleInvitedSignal=function(t){return r(this,void 0,void 0,(function(){var e,n,r,o,l,u,c,_,f,E,g,I,v,C,T,R,m;return a(this,(function(a){switch(a.label){case 0:this._logger.info(p+".handleInvitedSignal",{text:{data:i(i({},t),{isInviter:this._tuiCallEngine.isInviter(),isGroupCall:this._tuiCallEngine.isGroupCall()})},type:"event"}),e=t.inviter,n=t.inviteeList,r=t.isGroupCall,o=t.groupID,l=t.inviteID,u=t.inviteData,c=t.inCallUserIDs,_=void 0===c?[]:c,f=t.initialCallId,E=void 0===f?"":f,this._tuiCallEngine.changeCallStatus(d.CALL_STATUS.CALLING),this._tuiCallEngine.setInviterID(e),this._tuiCallEngine.setInviteeList(n),this._tuiCallEngine.setRoomId(u.room_id),this._tuiCallEngine.setStrRoomId(u.str_room_id||u.data.str_room_id),this._tuiCallEngine.setCallType(u.call_type),this._tuiCallEngine.addUnHandledInviteeList(s(n,_)),this._tuiCallEngine.addHandledInviteeList([e]),this._tuiCallEngine.addAcceptedUserList(l,[e]),this._tuiCallEngine.setInitialCallId(E),r&&(this._tuiCallEngine.setIsGroupCall(r),this._tuiCallEngine.setGroupId(o)),this._tuiCallEngine.addInviterInviteId(l,s([e],n)),g=_.filter((function(t){return-1===n.indexOf(t)})),this._newInvitationData={sponsor:e,userIDList:s(n,g),isFromGroup:r,inviteID:l,groupID:o,inviteData:{version:u.version,callType:u.call_type,roomID:u.room_id},userData:u.userData,calleeIdList:n},I=this._tuiCallEngine.getCallDataReport().getCallData(),I=i(i({},I),{roomID:u.room_id,inviteID:l,callRole:d.CALL_ROLE.INVITEE,callType:u.call_type,inviteeList:n,callScene:o?h.NAME.GROUP_CALL:h.NAME.SINGLE_CALL}),v=this._tuiCallEngine.generateEventData()||{},this._tuiCallEngine.getCallDataReport().setCallData(I),C={eventType:h.NAME.RECEIVE_CALL,callType:o?h.NAME.GROUP:h.NAME.SINGLE,mediaType:u.call_type,callRole:h.NAME.INVITEE,userID:this._tuiCallEngine.getUserId(),roomID:u.room_id,inviteID:E||l,strRoomId:this._tuiCallEngine.getStrRoomId(),groupId:this._tuiCallEngine.getGroupId()},this._tuiCallEngine.getCallRecordReport().eventUpload(C),this._tuiCallEngine._delegate.onInvited(i(i({},v),this._newInvitationData)),T=(new Date).getTime(),R=T,a.label=1;case 1:return R-T<100?[4,new Promise((function(t){return setTimeout(t,10)}))]:[3,5];case 2:return a.sent(),-1!==this._tuiCallEngine.getInviterInviteIdList().indexOf(l)?[3,4]:(this._logger.warn(p+".onNewInvitationReceived border case",{text:{data:{handleParams:t}},type:"api"}),[4,this._tuiCallEngine._resetTUICallEngine()]);case 3:return a.sent(),[2];case 4:return R=(new Date).getTime(),[3,1];case 5:return[4,this._tuiCallEngine.getSelfIMCallStatus([this._tuiCallEngine.getUserId()])];case 6:return(m=a.sent())!==d.CALL_STATUS.IDLE?(this._logger.error(p+".onNewInvitationReceived",{text:{data:{handleParams:t,customStatus:m}},type:"event"}),[2]):[4,this._tuiCallEngine.setSelfIMCallStatus(d.CALL_STATUS.CALLING)];case 7:return a.sent(),[2]}}))}))},t.prototype.getInviteData=function(){return this._newInvitationData},t.prototype.setInviteData=function(t){this._newInvitationData=t},t.prototype.handleSwitchCallMode=function(t,e){return r(this,void 0,void 0,(function(){var n,i,r,o;return a(this,(function(a){switch(a.label){case 0:return n={inviteID:t,callType:e.call_type,switch_to_audio_call:null},i={cmd:d.CMD_TYPE.SWITCH_TO_VIDEO},e.call_type===d.CALL_TYPE.VIDEO_CALL?(n.switch_to_audio_call=d.CMD_TYPE.SWITCH_TO_AUDIO_CALL,i.cmd=d.CMD_TYPE.SWITCH_TO_AUDIO):delete n.switch_to_audio_call,r=this._tuiCallEngine.getCallStatus(),this.accept(n,i),r!==d.CALL_STATUS.CALLING?[3,1]:(o=e.call_type===d.CALL_TYPE.VIDEO_CALL?d.CALL_TYPE.AUDIO_CALL:d.CALL_TYPE.VIDEO_CALL,this._tuiCallEngine._delegate.onCallTypeChanged(e.call_type,o),this._newInvitationData.inviteData.callType=o,this._tuiCallEngine.setSwitchCallModeStatus(!1),[3,3]);case 1:return r!==d.CALL_STATUS.CONNECTED?[3,3]:(this._tuiCallEngine.setSwitchCallModeStatus(!1),[4,this._tuiCallEngine._trtcClient.switchCallMode(this._tuiCallEngine.getCallType())]);case 2:a.sent(),a.label=3;case 3:return[2]}}))}))},t.prototype.judgeSwitchCallMode=function(t){var e=t.switch_to_audio_call&&t.switch_to_audio_call===d.CMD_TYPE.SWITCH_TO_AUDIO_CALL||t.data&&t.data.cmd===d.CMD_TYPE.SWITCH_TO_AUDIO||t.data&&t.data.cmd===d.CMD_TYPE.SWITCH_TO_VIDEO;return c.default.info(p+".switchCallMode:",t,"isSwitchCallMode-"+e),e},t.prototype.onInviteeAccepted=function(t){return r(this,void 0,void 0,(function(){var e,n,r,o,s;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".onInviteeAccepted",{text:{data:t},type:"event"}),c.default.info(p+".onInviteeAccepted - params:",t),e=JSON.parse(t.data.data),_.isCallSignaling(null==e?void 0:e.businessID)?(n=t.data.invitee,r=t.data.inviteID,-1===this._tuiCallEngine.getTotalInviterInviteIdList().indexOf(r)?[2]:this._tuiCallEngine.isGroupCall()||!this.judgeSwitchCallMode(e)||this._tuiCallEngine.getSwitchCallModeStatus()?[3,2]:[4,this._tuiCallEngine._trtcClient.switchCallMode(this._tuiCallEngine.getCallType())]):[2];case 1:return a.sent(),[2];case 2:return o=this._tuiCallEngine.getCallStatus(),n!==this._tuiCallEngine.getUserId()||o!==d.CALL_STATUS.CALLING?[3,4]:(s=this._tuiCallEngine.generateEventData(),[4,this._tuiCallEngine._resetTUICallEngine()]);case 3:return a.sent(),this._tuiCallEngine._delegate.onCallingCancel(i({userID:n},s)),[2];case 4:return o===d.CALL_STATUS.CALLING&&this._tuiCallEngine.isInviter()?(s=this._tuiCallEngine.generateEventData(),this._tuiCallEngine._delegate.onCallBegin(s),!this._tuiCallEngine._trtcClient.getIsVideoPublish()?[4,this._tuiCallEngine._trtcClient.muteLocalVideo(!1)]:[3,6]):[3,9];case 5:a.sent(),a.label=6;case 6:return!this._tuiCallEngine._trtcClient.getIsAudioPublish()?[4,this._tuiCallEngine._trtcClient.unMuteLocalAudio()]:[3,8];case 7:a.sent(),a.label=8;case 8:a.label=9;case 9:return this._tuiCallEngine.isInviter()&&this._tuiCallEngine.changeCallStatus(d.CALL_STATUS.CONNECTED),this._tuiCallEngine._delegate.onUserAccept(n),this._tuiCallEngine.addHandledInviteeList([n]),this._tuiCallEngine.deleteUnHandledInviteeList([n]),this._tuiCallEngine.addAcceptedUserList(r,[n]),[2]}}))}))},t.prototype.onInviteeRejected=function(t){var e;return r(this,void 0,void 0,(function(){var n,r,o,s,l,u,f,E,g,I,v,C,T,R,m,A,y,L;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".onInviteeRejected",{text:{data:i(i({},t),{currentUserID:this._tuiCallEngine.getUserId(),currentCallStatus:this._tuiCallEngine.getCallStatus(),inviteeList:this._tuiCallEngine.getInviterInviteIdList()})},type:"event"}),c.default.info(p+".onInviteeRejected - params:",t),n=t.data.inviteID,r=JSON.parse(t.data.data),_.isCallSignaling(null==r?void 0:r.businessID)?this._tuiCallEngine.isGroupCall()||this._tuiCallEngine.getSwitchCallModeStatus()||-1===this._tuiCallEngine.getAudioVideoSwitchIdList().indexOf(n)?(o=t.data.invitee,s=t.data.inviter,l=this._tuiCallEngine.getUserId(),(u=this._tuiCallEngine.getCallStatus())===d.CALL_STATUS.IDLE?[2]:-1===this._tuiCallEngine.getInviterInviteIdList().indexOf(n)?(this._tuiCallEngine.isInviter()&&-1!==this._tuiCallEngine.getInviterInviteIdUserList().indexOf(o)||this._tuiCallEngine.deleteUnHandledInviteeList([o]),[2]):(f=this._tuiCallEngine.generateEventData(),E=i({userID:o},f),l!==o||u!==d.CALL_STATUS.CALLING?[3,2]:[4,this._tuiCallEngine._resetTUICallEngine()])):(c.default.info(p+".onInviteeRejected - Audio and video switching is not available"),this._tuiCallEngine.setSwitchCallModeStatus(!0),[2]):[2];case 1:return a.sent(),this._tuiCallEngine._delegate.onCallingCancel(E),[2];case 2:return g=this._tuiCallEngine.isGroupCall(),I=this._tuiCallEngine.isInviter(),this._tuiCallEngine.deleteUnHandledInviteeList([o]),v=this._tuiCallEngine.getUnHandledInviteeList(),C=this._tuiCallEngine.getHandledInviteeList(),u===d.CALL_STATUS.CONNECTED&&-1!==C.indexOf(o)?[2]:"line_busy"===r.line_busy||""===r.line_busy||(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.message)&&"lineBusy"===r.data.message?g?[3,4]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,7];case 3:return a.sent(),I&&this._tuiCallEngine._delegate.onLineBusy(o),this._tuiCallEngine._delegate.onCallingCancel(i(i({},E),{reason:h.NAME.BUSYLINE})),[3,6];case 4:if(s===l)this._tuiCallEngine._delegate.onLineBusy(o);else{for(T=(T=this._tuiCallEngine.getInviterInviteIdList()||[]).filter((function(t){return t!==n})),R=!0,m=function(t){var e=A._tuiCallEngine.getInviterInviteIdUserList(T[t]);if([l,o].every((function(t){return-1===e.indexOf(t)})))return R=!1,"break"},A=this,y=0;y<T.length&&"break"!==m(y);y++);R&&this._tuiCallEngine._delegate.onLineBusy(o)}return 0!==v.length||1!==C.length?[3,6]:[4,this._tuiCallEngine._resetTUICallEngine()];case 5:a.sent(),this._tuiCallEngine._delegate.onCallingCancel(i(i({},E),{reason:h.NAME.BUSYLINE})),a.label=6;case 6:return[3,17];case 7:return g?[3,9]:[4,this._tuiCallEngine._resetTUICallEngine()];case 8:return a.sent(),this._tuiCallEngine._delegate.onReject(o),this._tuiCallEngine._delegate.onCallingCancel(i(i({},E),{reason:h.NAME.REJECT})),[3,17];case 9:return this._tuiCallEngine._delegate.onReject(o),u!==d.CALL_STATUS.CALLING?[3,15]:I?0!==v.length||1!==C.length?[3,11]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,12];case 10:a.sent(),this._tuiCallEngine._delegate.onCallingCancel(i(i({},E),{reason:h.NAME.REJECT})),a.label=11;case 11:return[3,14];case 12:return 1!==v.length||0!==C.length?[3,14]:[4,this._tuiCallEngine._resetTUICallEngine()];case 13:a.sent(),this._tuiCallEngine._delegate.onCallingCancel(i(i({},E),{reason:h.NAME.REJECT})),a.label=14;case 14:return[3,17];case 15:return 0!==v.length||1!==C.length?[3,17]:(L=this._tuiCallEngine.generateCallEndData({userId:o}),[4,this._tuiCallEngine._resetTUICallEngine()]);case 16:a.sent(),this._tuiCallEngine._delegate.onCallEnd(L),a.label=17;case 17:return[2]}}))}))},t.prototype.onInvitationCancelled=function(t){return r(this,void 0,void 0,(function(){var e,n;return a(this,(function(r){switch(r.label){case 0:return this._logger.info(p+".onInvitationCancelled",{text:{data:i(i({},t),{currentUserID:this._tuiCallEngine.getUserId(),currentCallStatus:this._tuiCallEngine.getCallStatus(),inviteeList:this._tuiCallEngine.getInviterInviteIdList()})},type:"event"}),c.default.info(p+".onInvitationCancelled - params:",t,this._tuiCallEngine.getCallStatus()),e=JSON.parse(t.data.data),_.isCallSignaling(null==e?void 0:e.businessID)?this._tuiCallEngine.getCallStatus()===d.CALL_STATUS.IDLE||-1===this._tuiCallEngine.getInviterInviteIdList().indexOf(t.data.inviteID)?[2]:(n=this._tuiCallEngine.generateEventData(),[4,this._tuiCallEngine._resetTUICallEngine()]):[2];case 1:return r.sent(),this._tuiCallEngine._delegate.onCallingCancel(i(i({userID:this._tuiCallEngine.getUserId()},n),{reason:h.NAME.NORMAL})),[2]}}))}))},t.prototype.onInvitationTimeout=function(t){var e,n;return r(this,void 0,void 0,(function(){var r,o,s,l,u,_,f,E,g,I,v,C,T,R,m;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".onInvitationTimeout",{text:{data:i(i({},t),{currentUserID:this._tuiCallEngine.getUserId(),isGroupCall:this._tuiCallEngine.isGroupCall(),currentCallStatus:this._tuiCallEngine.getCallStatus()})},type:"event"}),r=t.data,o=r.inviter,s=r.inviteeList,l=void 0===s?[]:s,u=r.inviteID,_=this._tuiCallEngine.getUserId(),f=this._tuiCallEngine.isGroupCall(),E=this._tuiCallEngine.isInviter(),g=this._tuiCallEngine.getCallStatus(),this._tuiCallEngine.deleteUnHandledInviteeList(l),c.default.info(p+".onInvitationTimeout - params:",t,"currentUserID:"+_+" isInviter:"+E+" isGroupCall:"+f+" currentCallStatus:"+g+" inviteID:"+(null===(e=null==this?void 0:this._newInvitationData)||void 0===e?void 0:e.inviteID)),-1===this._tuiCallEngine.getInviterInviteIdList().indexOf(u)?[2]:g===d.CALL_STATUS.IDLE?[2]:g!==d.CALL_STATUS.CONNECTED||f?(I=this._tuiCallEngine.getHandledInviteeList(),v=this._tuiCallEngine.getUnHandledInviteeList(),C=i(i({},this._tuiCallEngine.generateEventData()),{reason:h.NAME.TIMEOUT}),f?[3,2]:[4,this._tuiCallEngine._resetTUICallEngine()]):[2];case 1:return a.sent(),E?(this._tuiCallEngine._delegate.onCallingCancel(i({userID:l[0]},C)),this._tuiCallEngine._delegate.onNoResp(o,l)):(this._tuiCallEngine._delegate.onCallingCancel(i({userID:l[0]||""},C)),T=this._tuiCallEngine.getCallRecordReport().getCallRecordData().head,this._tuiCallEngine.getCallRecordReport().eventUpload(i(i({},T),{eventType:h.NAME.NOT_ANSWER_CALL,inviteID:this._tuiCallEngine.getInitialCallId()}))),(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.isSelfTimeout)&&this._tuiCallEngine._delegate.onCallMessage(t),[3,12];case 2:return g!==d.CALL_STATUS.CALLING?[3,10]:E?0!==v.length?[3,4]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,5];case 3:a.sent(),this._tuiCallEngine._delegate.onCallingCancel(i({userID:l.join(",")},C)),a.label=4;case 4:return this._tuiCallEngine._delegate.onNoResp(o,l),[3,9];case 5:return-1!==l.indexOf(_)?[3,6]:(this._tuiCallEngine._delegate.onNoResp(o,l),[3,8]);case 6:return[4,this._tuiCallEngine._resetTUICallEngine()];case 7:a.sent(),this._tuiCallEngine._delegate.onCallingCancel(i({userID:_},C)),a.label=8;case 8:R=this._tuiCallEngine.getCallRecordReport().getCallRecordData().head,this._tuiCallEngine.getCallRecordReport().eventUpload(i(i({},R),{eventType:h.NAME.NOT_ANSWER_CALL,inviteID:this._tuiCallEngine.getInitialCallId()})),a.label=9;case 9:return[3,12];case 10:return this._tuiCallEngine._delegate.onNoResp(o,l),1!==I.length||0!==v.length?[3,12]:(m=this._tuiCallEngine.generateCallEndData(),[4,this._tuiCallEngine._resetTUICallEngine()]);case 11:a.sent(),this._tuiCallEngine._delegate.onCallEnd(m),a.label=12;case 12:return[2]}}))}))},t.prototype.onKickedOut=function(){return r(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this._logger.info(p+".onKickedOut",{text:{error:"onKickedOut"},type:"event"}),c.default.info(p+".onKickedOut"),this._tuiCallEngine.setIsLogin(!1),this._tuiCallEngine._trtcClient.removeTRTCEvents(),[4,this._tuiCallEngine._resetTUICallEngine()];case 1:return t.sent(),this._tuiCallEngine._delegate.onKickedOut(),[2]}}))}))},t.prototype.onNetStateChange=function(){c.default.debug(p+".onNetStateChange")},t.prototype.onUserStatusUpdated=function(t){return r(this,void 0,void 0,(function(){var e,n,i,r=this;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".onUserStatusUpdated",{text:{data:t},type:"event"}),(e=(t.data||[]).find((function(t){return t.userID===r._tuiCallEngine.getUserId()})))?(n=h.CUSTOM_STATUS_MAP[e.customStatus],(i=this._tuiCallEngine.getCallStatus())===d.CALL_STATUS.IDLE||n===i?[3,2]:[4,this._tuiCallEngine.setSelfIMCallStatus(i)]):[2];case 1:a.sent(),a.label=2;case 2:return[2]}}))}))},t.prototype.onMessageSentByMe=function(t){this._tuiCallEngine._delegate.onMessageSentByMe(t)},t.prototype.login=function(t){return r(this,void 0,void 0,(function(){var e=this;return a(this,(function(n){return this._logger.info(p+".login.start",{text:{data:t},type:"api"}),[2,new Promise((function(n,i){e._chat.login(t).then((function(t){var i;(null===(i=t.data)||void 0===i?void 0:i.repeatLogin)&&(e._logger.info(p+".login.success",{text:{error:"The TIM login status has been inherited into Call"},type:"api"}),c.default.info(p+".login - success: The TIM login status has been inherited into Call. IM 登录状态已成功被 Call 继承。"),e._chat.isReady()&&e._tuiCallEngine._delegate.onSdkReady({name:"ts_im_ready"}),n()),e._loginResolveList.push({resolve:n,value:t})})).catch((function(t){var r=t||{},a=r.code,o=r.message;2024===a||2025===a?(e._logger.warn(p+".login.fail",{text:{error:a+", "+o},type:"api"}),c.default.warn(p+".login failed: "+a+", "+o+"."),e._loginResolveList.push({resolve:n,value:{code:0,message:"success"}})):(e._logger.error(p+".login.fail",{text:{error:a+", "+o},type:"api"}),i(t))}))}))]}))}))},t.prototype.logout=function(){return r(this,void 0,void 0,(function(){return a(this,(function(t){return this._joined=!1,this._loginResolveList=[],[2,this._chat.logout()]}))}))},t.prototype.invite=function(t){return r(this,void 0,void 0,(function(){var e,n,r,o,s,l,u,c,d,h,_;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".invite.start",{text:{data:t},type:"api"}),e=t.userID,n=t.type,r=t.roomId,o=t.strRoomId,s=t.timeout,l=t.offlinePushInfo,u=t.userIDList,c=t.userData,d=void 0===c?"":c,h=this.handleNewSignaling({version:0,call_type:n,room_id:r,str_room_id:o},{userIDs:u,excludeFromHistoryMessage:!0},d),[4,this._chat.invite({userID:e,data:JSON.stringify(h),timeout:s,offlinePushInfo:this._convertOfflinePushParams(l)})];case 1:return _=a.sent(),this._tuiCallEngine.setInitialInviteData(h),[2,i(i({},_),{roomID:r,strRoomID:o,userID:e})]}}))}))},t.prototype.inviteInGroup=function(t){return r(this,void 0,void 0,(function(){var e,n,r,o,s,l,u,c,d,h,_,f,E;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".inviteInGroup.start",{text:{data:t},type:"api"}),e=t.groupID,n=t.userIDList,r=t.roomId,o=t.strRoomId,s=t.type,l=t.timeout,u=t.offlinePushInfo,c=t.inCallUserIDs,d=t.userData,h=void 0===d?"":d,_=t.initialCallId,f=void 0===_?"":_,[4,this._chat.inviteInGroup({groupID:e,inviteeList:n,data:JSON.stringify(this.handleNewSignaling({version:0,call_type:s,room_id:r,str_room_id:o,inCallUserIDs:c},{initialCallId:f},h)),timeout:l,offlinePushInfo:this._convertOfflinePushParams(u)})];case 1:return E=a.sent(),[2,i(i({},E),{roomID:r,strRoomID:o,groupID:e})]}}))}))},t.prototype.hangup=function(t){return r(this,void 0,void 0,(function(){var e,n,i,r,o,s,l,u,h;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".hangup.start",{text:{data:t},type:"api"}),c.default.info(p+".hangup - params:",t),e=t.userIDList,n=t.callType,i=t.callEnd,o={version:0,call_type:n,call_end:r=void 0===i?0:i},s={cmd:d.CMD_TYPE.HANG_UP},l=JSON.stringify(this.handleNewSignaling(o,s)),u={},h=this._tuiCallEngine.generateCallEndData({callMediaType:n,totalTime:r}),this._tuiCallEngine._delegate.onCallEnd(h),this._tuiCallEngine.isGroupCall()&&this._tuiCallEngine.getGroupId()?[4,this._chat.inviteInGroup({inviteeList:e,groupID:this._tuiCallEngine.getGroupId(),data:l,timeout:0})]:[3,2];case 1:return u=a.sent(),[3,4];case 2:return[4,this._chat.invite({userID:e[0],data:l,timeout:0})];case 3:u=a.sent(),a.label=4;case 4:return this._tuiCallEngine._delegate.onCallMessage(u),this._joined=!1,[2]}}))}))},t.prototype.accept=function(t,e){return r(this,void 0,void 0,(function(){var n,r,s;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".accept.start",{text:{data:t},type:"api"}),n=t.inviteID,r=t.callType,s=o(t,["inviteID","callType"]),[4,this._chat.accept({inviteID:n,data:JSON.stringify(this.handleNewSignaling(i({version:0,call_type:r},s),i(i({},e),{excludeFromHistoryMessage:!0})))})];case 1:return[2,a.sent()]}}))}))},t.prototype.reject=function(t){return r(this,void 0,void 0,(function(){var e,n,i,r,o;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".reject.start",{text:{data:{params:t}},type:"api"}),e=t.inviteID,n=t.callType,i=t.isBusy,[4,this._tuiCallEngine.modifyInvitation(e)];case 1:return a.sent(),r={version:0,call_type:n},i&&(r.line_busy="line_busy"),[4,this._chat.reject({inviteID:e,data:JSON.stringify(this.handleNewSignaling(r,{message:i?"lineBusy":""}))})];case 2:return o=a.sent(),i&&this._tuiCallEngine._delegate.onCallMessage(o),[2,o]}}))}))},t.prototype.cancel=function(t){return r(this,void 0,void 0,(function(){var e,n;return a(this,(function(i){return this._logger.info(p+".cancel.start",{text:{data:t},type:"api"}),e=t.inviteID,n=JSON.stringify(this.handleNewSignaling({version:4,businessID:h.NAME.AV_CALL,call_type:this._tuiCallEngine.getCallType()})),[2,this._chat.cancel({inviteID:e,data:n})]}))}))},t.prototype.resetJoined=function(){this._joined=!1},t.prototype.switchCallMode=function(t){return r(this,void 0,void 0,(function(){var e,n,i,r,o,s,l,u;return a(this,(function(a){switch(a.label){case 0:return e=t.userID,n=t.callType,i=t.roomID,r=t.timeout,o=t.mode,s={version:0,call_type:n,room_id:i,switch_to_audio_call:null},l={cmd:d.CMD_TYPE.SWITCH_TO_VIDEO},o===d.MODE_TYPE.AUDIO?(s.switch_to_audio_call=d.CMD_TYPE.SWITCH_TO_AUDIO_CALL,l.cmd=d.CMD_TYPE.SWITCH_TO_AUDIO):delete s.switch_to_audio_call,[4,this._chat.invite({userID:e,data:JSON.stringify(this.handleNewSignaling(s,l)),timeout:r})];case 1:return(u=a.sent()).inviteID&&this._tuiCallEngine.addAudioVideoSwitchIdList(u.inviteID),[2]}}))}))},t.prototype.handleNewSignaling=function(t,e,n){var r=i(i({userData:n||""},t),{version:4,businessID:h.NAME.AV_CALL,platform:"Web",data:i({cmd:d.CMD_TYPE_LIST[t.call_type],room_id:t.room_id,str_room_id:t.str_room_id,inviter:this._tuiCallEngine.getInviterID(),message:""},e)});return void 0!==this._tuiCallEngine.getExcludeFromHistoryMessage()&&(this._tuiCallEngine.getExcludeFromHistoryMessage()?r.data.excludeFromHistoryMessage=!0:delete r.data.excludeFromHistoryMessage),delete r.str_room_id,r},t.prototype._convertOfflinePushParams=function(t){if(void 0===t&&(t={}),0===Object.keys(t).length)return{};var e=t.title,n=t.description,i=t.androidOPPOChannelID,r=t.extension,a=t.isDisablePush,o=t.iOSPushType,s=void 0===o?d.IOSOfflinePushType.APNs:o,l=t.ignoreIOSBadge,u=t.iOSSound,c=t.androidSound,p=t.androidVIVOClassification;return{title:e||"",description:n||"",extension:r||"",disablePush:a||!1,androidInfo:{sound:c,XiaoMiChannelID:t.androidXiaoMiChannelID,OPPOChannelID:i,FCMChannelID:t.androidFCMChannelID,VIVOClassification:p,HuaWeiCategory:t.androidHuaWeiCategory},apnsInfo:{sound:u,ignoreIOSBadge:l||!1,disableVoipPush:1!==s}}},t}();e.default=f},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),a=n(16),o=n(2),s=n(13),l=n(18),u="TUICallObserver",c=function(){function t(t){this._eventEmitter=t,this._callEngineLogger=r.default(),this._eventStatController=new l.default,s.default.bindController(this._eventStatController)}return t.prototype.onError=function(t,e){this._callEngineLogger.error("onError",{type:"event",text:{error:{code:t,msg:e}}}),o.default.debug(u+".onError code:"+t+" msg:"+e),this._eventEmitter.emit(a.TUICallEvent.ERROR,{code:t,msg:e})},t.prototype.onSdkReady=function(t){this._callEngineLogger.info("TUICallEvent.SDK_READY",{type:"event",text:{data:{params:t}}}),o.default.debug(u+".onSdkReady params:"+t),this._eventEmitter.emit(a.TUICallEvent.SDK_READY,t)},t.prototype.onInvited=function(t){this._callEngineLogger.info("TUICallEvent.INVITED",{type:"event",text:{data:{params:t}}}),o.default.debug(u+".onInvited params:",t);var e=t.sponsor,n=t.userIDList,r=t.isFromGroup,s=t.inviteData,l=t.inviteID,c=t.userData,d=void 0===c?"":c,p=t.calleeIdList,h=t.callID,_=t.roomID,f=t.strRoomID,E=t.callMediaType,g=t.callRole,I={callID:h,calleeIdList:p,groupID:t.groupID,callMediaType:E,roomID:_,strRoomID:f,callRole:g,userData:d},v=i({sponsor:e,userIDList:n,isFromGroup:r,inviteData:s,inviteID:l},I);this._eventEmitter.emit(a.TUICallEvent.INVITED,v),this._eventEmitter.emit(a.TUICallEvent.ON_CALL_RECEIVED,I)},t.prototype.onUserAccept=function(t){this._callEngineLogger.info("TUICallEvent.USER_ACCEPT",{type:"event",text:{data:{userID:t}}}),o.default.debug(u+".onUserAccept userID:"+t),this._eventEmitter.emit(a.TUICallEvent.USER_ACCEPT,{userID:t})},t.prototype.onCallBegin=function(t){this._callEngineLogger.info("TUICallEvent.ON_CALL_BEGIN",{type:"event",text:{data:{params:t}}}),o.default.debug(u+".onCallBegin params:"+JSON.stringify(t)),this._eventEmitter.emit(a.TUICallEvent.ON_CALL_BEGIN,t)},t.prototype.onUserEnter=function(t){this._callEngineLogger.info("TUICallEvent.USER_ENTER",{type:"event",text:{data:{userID:t}}}),o.default.debug(u+".onUserEnter userID:"+t),this._eventEmitter.emit(a.TUICallEvent.USER_ENTER,{userID:t})},t.prototype.onUserLeave=function(t){this._callEngineLogger.info("TUICallEvent.USER_LEAVE",{type:"event",text:{data:{userID:t}}}),o.default.debug(u+".onUserLeave userID:"+t),this._eventEmitter.emit(a.TUICallEvent.USER_LEAVE,{userID:t})},t.prototype.onReject=function(t){this._callEngineLogger.info("TUICallEvent.REJECT",{type:"event",text:{data:{userID:t}}}),o.default.debug(u+".onReject userID:"+t),this._eventEmitter.emit(a.TUICallEvent.REJECT,{userID:t})},t.prototype.onNoResp=function(t,e){this._callEngineLogger.info("TUICallEvent.NO_RESP",{type:"event",text:{data:{sponsor:t,userIDList:e}}}),o.default.debug(u+".onNoResp userIDList:",t,e),this._eventEmitter.emit(a.TUICallEvent.NO_RESP,{sponsor:t,userIDList:e})},t.prototype.onLineBusy=function(t){this._callEngineLogger.info("TUICallEvent.LINE_BUSY",{type:"event",text:{data:{userID:t}}}),o.default.debug(u+".onLineBusy userID:"+t),this._eventEmitter.emit(a.TUICallEvent.LINE_BUSY,{userID:t})},t.prototype.onCallingCancel=function(t,e){void 0===e&&(e=""),this._callEngineLogger.info("TUICallEvent.ON_CALL_CANCELED",{type:"event",text:{data:{params:t}}}),o.default.debug(u+".onCallingCancel ",t),this._eventEmitter.emit(a.TUICallEvent.CALLING_CANCEL,t),this._eventEmitter.emit(a.TUICallEvent.ON_CALL_CANCELED,t)},t.prototype.onKickedOut=function(){this._callEngineLogger.info("TUICallEvent.KICKED_OUT",{type:"event"}),o.default.debug(u+".onKickedOut"),this._eventEmitter.emit(a.TUICallEvent.KICKED_OUT,{})},t.prototype.onCallingTimeout=function(t,e){this._callEngineLogger.info("TUICallEvent.CALLING_TIMEOUT",{type:"event",text:{data:{sponsor:t,userIDList:e}}}),o.default.debug(u+".onCallingTimeout userIDList:",e),this._eventEmitter.emit(a.TUICallEvent.CALLING_TIMEOUT,{sponsor:t,userIDList:e})},t.prototype.onCallEnd=function(t){this._callEngineLogger.info("TUICallEvent.CALLING_END",{type:"event",text:{data:{params:t}}}),o.default.debug(u+".onCallEnd params:"+t),this._eventEmitter.emit(a.TUICallEvent.CALLING_END,i(i({},t),{callEnd:t.totalTime}))},t.prototype.onUserVideoAvailable=function(t){this._callEngineLogger.info("TUICallEvent.USER_VIDEO_AVAILABLE",{type:"event",text:{data:{params:t}}}),o.default.debug(u+".onUserVideoAvailable params:",t);var e=t.userID,n=t.isVideoAvailable;this._eventEmitter.emit(a.TUICallEvent.USER_VIDEO_AVAILABLE,{userID:e,isVideoAvailable:n})},t.prototype.onUserAudioAvailable=function(t){this._callEngineLogger.info("TUICallEvent.USER_AUDIO_AVAILABLE",{type:"event",text:{data:{params:t}}}),o.default.debug(u+".onUserAudioAvailable params:",t);var e=t.userID,n=t.isAudioAvailable;this._eventEmitter.emit(a.TUICallEvent.USER_AUDIO_AVAILABLE,{userID:e,isAudioAvailable:n})},t.prototype.onUserVoiceVolume=function(t){this._eventEmitter.emit(a.TUICallEvent.USER_VOICE_VOLUME,{volumeMap:t})},t.prototype.onGroupCallInviteeListUpdate=function(t){this._callEngineLogger.info("TUICallEvent.GROUP_CALL_INVITEE_LIST_UPDATE",{type:"event",text:{data:{userIDList:t}}}),this._eventEmitter.emit(a.TUICallEvent.GROUP_CALL_INVITEE_LIST_UPDATE,{userIDList:t})},t.prototype.onCallTypeChanged=function(t,e){this._callEngineLogger.info("TUICallEvent.CALL_TYPE_CHANGED",{type:"event",text:{data:{oldCallType:t,newCallType:e}}}),this._eventEmitter.emit(a.TUICallEvent.CALL_TYPE_CHANGED,{oldCallType:t,newCallType:e})},t.prototype.onDeviceUpdated=function(t,e){var n=t.microphone,r=t.speaker,o=t.camera,s=e.microphone,l=e.speaker,u=e.camera;this._callEngineLogger.info("TUICallEvent.DEVICED_UPDATED",{type:"event",text:{data:i(i({},t),e)}}),this._eventEmitter.emit(a.TUICallEvent.DEVICED_UPDATED,{microphoneList:n,cameraList:o,speakerList:r,currentMicrophone:s,currentCamera:u,currentSpeaker:l})},t.prototype.onUserNetworkQualityChanged=function(t){this._eventEmitter.emit(a.TUICallEvent.ON_USER_NETWORK_QUALITY_CHANGED,{networkQualityList:t})},t.prototype.onMessageSentByMe=function(t){this._eventEmitter.emit(a.TUICallEvent.MESSAGE_SENT_BY_ME,t)},t.prototype.onCallMessage=function(t){var e;this._callEngineLogger.info("TUICallEvent.CALL_MESSAGE",{type:"event",text:{data:t}}),this._eventEmitter.emit(a.TUICallEvent.CALL_MESSAGE,null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.message)},t}();e.default=c},function(t,e,n){"use strict";var i=n(3),r=n(21),a=n(41),o=n(27);function s(t){var e=new a(t),n=r(a.prototype.request,e);return i.extend(n,a.prototype,e),i.extend(n,e),n}var l=s(n(17));l.Axios=a,l.create=function(t){return s(o(l.defaults,t))},l.Cancel=n(28),l.CancelToken=n(56),l.isCancel=n(26),l.all=function(t){return Promise.all(t)},l.spread=n(57),l.isAxiosError=n(58),t.exports=l,t.exports.default=l},function(t,e,n){"use strict";var i=n(3),r=n(22),a=n(42),o=n(43),s=n(27),l=n(54),u=l.validators;function c(t){this.defaults=t,this.interceptors={request:new a,response:new a}}c.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&l.assertOptions(e,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var r,a=[];if(this.interceptors.response.forEach((function(t){a.push(t.fulfilled,t.rejected)})),!i){var c=[o,void 0];for(Array.prototype.unshift.apply(c,n),c=c.concat(a),r=Promise.resolve(t);c.length;)r=r.then(c.shift(),c.shift());return r}for(var d=t;n.length;){var p=n.shift(),h=n.shift();try{d=p(d)}catch(t){h(t);break}}try{r=o(d)}catch(t){return Promise.reject(t)}for(;a.length;)r=r.then(a.shift(),a.shift());return r},c.prototype.getUri=function(t){return t=s(this.defaults,t),r(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},i.forEach(["delete","get","head","options"],(function(t){c.prototype[t]=function(e,n){return this.request(s(n||{},{method:t,url:e,data:(n||{}).data}))}})),i.forEach(["post","put","patch"],(function(t){c.prototype[t]=function(e,n,i){return this.request(s(i||{},{method:t,url:e,data:n}))}})),t.exports=c},function(t,e,n){"use strict";var i=n(3);function r(){this.handlers=[]}r.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},r.prototype.forEach=function(t){i.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=r},function(t,e,n){"use strict";var i=n(3),r=n(44),a=n(26),o=n(17);function s(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return s(t),t.headers=t.headers||{},t.data=r.call(t,t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),i.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||o.adapter)(t).then((function(e){return s(t),e.data=r.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return a(e)||(s(t),e&&e.response&&(e.response.data=r.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,n){"use strict";var i=n(3),r=n(17);t.exports=function(t,e,n){var a=this||r;return i.forEach(n,(function(n){t=n.call(a,t,e)})),t}},function(t,e){var n,i,r=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var l,u=[],c=!1,d=-1;function p(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&h())}function h(){if(!c){var t=s(p);c=!0;for(var e=u.length;e;){for(l=u,u=[];++d<e;)l&&l[d].run();d=-1,e=u.length}l=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function _(t,e){this.fun=t,this.array=e}function f(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new _(t,e)),1!==u.length||c||s(h)},_.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,n){"use strict";var i=n(3);t.exports=function(t,e){i.forEach(t,(function(n,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[i])}))}},function(t,e,n){"use strict";var i=n(25);t.exports=function(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(i("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";var i=n(3);t.exports=i.isStandardBrowserEnv()?{write:function(t,e,n,r,a,o){var s=[];s.push(t+"="+encodeURIComponent(e)),i.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),i.isString(r)&&s.push("path="+r),i.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var i=n(50),r=n(51);t.exports=function(t,e){return t&&!i(e)?r(t,e):e}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var i=n(3),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,a,o={};return t?(i.forEach(t.split("\n"),(function(t){if(a=t.indexOf(":"),e=i.trim(t.substr(0,a)).toLowerCase(),n=i.trim(t.substr(a+1)),e){if(o[e]&&r.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([n]):o[e]?o[e]+", "+n:n}})),o):o}},function(t,e,n){"use strict";var i=n(3);t.exports=i.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(t){var i=t;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=r(window.location.href),function(e){var n=i.isString(e)?r(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var i=n(55),r={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){r[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var a={},o=i.version.split(".");function s(t,e){for(var n=e?e.split("."):o,i=t.split("."),r=0;r<3;r++){if(n[r]>i[r])return!0;if(n[r]<i[r])return!1}return!1}r.transitional=function(t,e,n){var r=e&&s(e);function o(t,e){return"[Axios v"+i.version+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,i,s){if(!1===t)throw new Error(o(i," has been removed in "+e));return r&&!a[i]&&(a[i]=!0,console.warn(o(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,s)}},t.exports={isOlderVersion:s,assertOptions:function(t,e,n){if("object"!=typeof t)throw new TypeError("options must be an object");for(var i=Object.keys(t),r=i.length;r-- >0;){var a=i[r],o=e[a];if(o){var s=t[a],l=void 0===s||o(s,a,t);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:r}},function(t){t.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(t,e,n){"use strict";var i=n(28);function r(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new i(t),e(n.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t;return{token:new r((function(e){t=e})),cancel:t}},t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},function(t,e,n){"use strict";n.r(e);var i=n(2);const r="none",a="online",o=function(){let t=window.location.protocol;return["http:","https:"].indexOf(t)<0&&(t="http:"),t};e.default=class{constructor(){this._networkType="",this.maxWaitTime=3e3}start(){this._networkType=a}_onNetworkStatusChange(t){this._networkType=t.networkType,t.isConnected?i.default.info("NetMonitor networkType:"+t.networkType):i.default.warn("NetMonitor no network, please check!")}probe(){return new Promise(t=>{if(window&&window.fetch)fetch(`${o()}//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=${Math.random()}`).then(e=>{e.ok?t([!0,a]):t([!1,r])}).catch(()=>{t([!1,r])});else{const e=new XMLHttpRequest,n=setTimeout(()=>{i.default.warn("NetMonitor fetch timeout. Probably no network, please check!"),e.abort(),this._networkType=r,t([!1,r])},this.maxWaitTime);e.onreadystatechange=function(){4===e.readyState&&(clearTimeout(n),200===e.status||304===e.status?(this._networkType=a,t([!0,a])):(i.default.warn(`NetMonitor fetch status:${e.status}. Probably no network, please check!`),this._networkType=r,t([!1,r])))},e.open("GET",`${o()}//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=${Math.random()}`),e.send()}})}getNetworkType(){return this._networkType}reset(){this._networkType=""}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.apiCallQueue=e.avoidRepeatedCall=e.statusValidate=e.businessValidate=e.paramValidate=e.VALIDATE_PARAMS=void 0;var i=n(61);Object.defineProperty(e,"VALIDATE_PARAMS",{enumerable:!0,get:function(){return i.VALIDATE_PARAMS}});var r=n(62);Object.defineProperty(e,"paramValidate",{enumerable:!0,get:function(){return r.paramValidate}});var a=n(63);Object.defineProperty(e,"businessValidate",{enumerable:!0,get:function(){return a.businessValidate}});var o=n(64);Object.defineProperty(e,"statusValidate",{enumerable:!0,get:function(){return o.statusValidate}});var s=n(65);Object.defineProperty(e,"avoidRepeatedCall",{enumerable:!0,get:function(){return s.avoidRepeatedCall}});var l=n(66);Object.defineProperty(e,"apiCallQueue",{enumerable:!0,get:function(){return l.apiCallQueue}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VALIDATE_PARAMS=void 0;var i=n(12),r=n(0);e.VALIDATE_PARAMS={createInstance:{SDKAppID:{required:!0,rules:[r.NAME.NUMBER],allowEmpty:!1},tim:{required:!1,rules:[r.NAME.OBJECT],allowEmpty:!0}},login:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},userSig:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},call:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},type:{required:!0,rules:[r.NAME.NUMBER],range:[1,2],allowEmpty:!1},roomID:{required:!1,rules:[r.NAME.NUMBER],range:"0~"+r.MAX_NUMBER_ROOM_ID,allowEmpty:!1},strRoomID:{required:!1,rules:[r.NAME.STRING],allowEmpty:!0},timeout:{required:!1,rules:[r.NAME.NUMBER],allowEmpty:!1}},groupCall:{userIDList:{required:!0,rules:[r.NAME.ARRAY],allowEmpty:!1},type:{required:!0,rules:[r.NAME.NUMBER],range:[1,2],allowEmpty:!1},groupID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},roomID:{required:!1,rules:[r.NAME.NUMBER],range:"0~"+r.MAX_NUMBER_ROOM_ID,allowEmpty:!1},strRoomID:{required:!1,rules:[r.NAME.STRING],allowEmpty:!0},timeout:{required:!1,rules:[r.NAME.NUMBER],allowEmpty:!1}},joinInGroupCall:{type:{required:!0,rules:[r.NAME.NUMBER],range:[1,2],allowEmpty:!1},groupID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},roomID:{required:!0,rules:[r.NAME.NUMBER],allowEmpty:!1},strRoomID:{required:!1,rules:[r.NAME.STRING],allowEmpty:!0}},inviteUser:{userIDList:{required:!0,rules:[r.NAME.ARRAY],allowEmpty:!1}},openCamera:[{key:"videoViewDomID",required:!0,rules:[r.NAME.STRING],allowEmpty:!1}],startRemoteView:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},videoViewDomID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},stopRemoteView:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},startLocalView:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},videoViewDomID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},stopLocalView:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},switchCamera:[{key:"cameraPosition",required:!0,rules:[r.NAME.NUMBER],range:[i.TUICallCameraPosition.FRONT,i.TUICallCameraPosition.BACK],allowEmpty:!1}],switchDevice:{deviceType:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},deviceId:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},setVideoQuality:[{key:"profile",required:!0,rules:[r.NAME.STRING,r.NAME.OBJECT],range:Object.keys(i.TUICommonDefine.VideoEncoderParams),allowEmpty:!1}],switchCallMediaType:[{key:"newMediaType",required:!0,rules:[r.NAME.NUMBER],range:[1,2],allowEmpty:!1}],getDeviceList:[{key:"deviceType",required:!0,rules:[r.NAME.STRING],range:["camera","microphones","speaker","microphone"],allowEmpty:!1}],getCurrentDevice:[{key:"deviceType",required:!0,rules:[r.NAME.STRING],range:["camera","speaker","microphone"],allowEmpty:!1}],setSelfInfo:{nickName:{required:!1,rules:[r.NAME.STRING],allowEmpty:!1},avatar:{required:!1,rules:[r.NAME.STRING],allowEmpty:!1}},setVideoRenderParams:{objectFit:{require:!1,rules:[r.NAME.STRING],range:[r.NAME.CONTAIN,r.NAME.COVER,r.NAME.FILL],allowEmpty:!1},muted:{require:!1,rules:[r.NAME.BOOLEAN],allowEmpty:!1},mirror:{require:!1,rules:[r.NAME.BOOLEAN],allowEmpty:!1}},enableMultiDeviceAbility:[{key:"enable",required:!0,rules:[r.NAME.BOOLEAN],allowEmpty:!1}]}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.paramValidate=void 0;var r=n(8),a=n(1),o=n(10),s=n(7),l=n(15);function u(t,e,n){var o=r.default();try{if(a.isArray(t))for(var s=0;s<t.length;s++)c.call(this,i(i({},t[s]),{value:e[s],name:n}));else for(var l in t)c.call(this,i(i({},t[l]),{value:e[0][l],name:n,key:l}))}catch(t){throw o.error("paramValidate.fail",{text:{error:t}}),t}}function c(t){var e=t.required,n=t.rules,i=t.range,r=t.value,u=t.allowEmpty,c=t.name,d=t.key;if(a.isUndefined(r)){if(e){var p=l.getErrorMessage({code:s.default.INVALID_PARAMETER_REQUIRED,params:{key:d,value:r,fnName:c}});throw new o.default({code:s.default.ERROR_PARAM_INVALID,message:p})}}else{var h="";if(!n.some((function(t){return t===a.getType(r)}))){for(var _=0;_<n.length;_++){var f=n[_];h+=(f=f.replace(f[0],f[0].toUpperCase()))+"/"}h=h.substring(0,h.length-1);p=l.getErrorMessage({code:s.default.INVALID_PARAMETER_TYPE,params:{key:d,rule:{type:h},value:r,fnName:c}});throw new o.default({code:s.default.ERROR_PARAM_INVALID,message:p})}if(!1===u){if(a.isArray(r)&&0===r.length){p=l.getErrorMessage({code:s.default.INVALID_PARAMETER_EMPTY,params:{key:d,fnName:c}});throw new o.default({code:s.default.ERROR_PARAM_INVALID,message:p})}if(a.isString(r)&&""===r.trim()){p=l.getErrorMessage({code:s.default.INVALID_PARAMETER_EMPTY,params:{key:d,value:r}});throw new o.default({code:s.default.ERROR_PARAM_INVALID,message:p})}}if(a.isArray(i)&&i&&-1===i.indexOf(r)){p=l.getErrorMessage({code:s.default.INVALID_PARAMETER_RANGE,params:{key:d,rule:{values:i},value:r,fnName:c}});throw new o.default({code:s.default.ERROR_PARAM_INVALID,message:p})}if(a.isString(i)&&-1!==i.indexOf("~")){var E=i.split("~");if(r<+E[0]||r>+E[1]||a.isNumber(r)&&Number.isNaN(r)){p=l.getErrorMessage({code:s.default.INVALID_PARAMETER_RANGE,params:{key:d,rule:{values:i},value:r,fnName:c}});throw new o.default({code:s.default.ERROR_PARAM_INVALID,message:p})}}}}e.paramValidate=function(t){return function(e,n,i){var r=i.value;return i.value=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return u.call(this,t,e,n),r.apply(this,e)},i}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateBusiness=e.businessValidate=void 0;var a=n(8),o=n(10),s=n(7),l=n(11),u=n(6),c=n(1);function d(t){var e=c.isDomesticSDKAppID(t)?""+l.ERROR_CN_MESSAGE.ERROR_PACKAGE_NOT_PURCHASED:""+l.ERROR_MESSAGE.ERROR_PACKAGE_NOT_PURCHASED;return e=e.replace("${purchaseAddress}",c.getPurchaseAddress(t))}function p(t,e,n){if(a.default().error("validateBusiness.fail",{text:{error:t}}),2905===t.code)throw new o.default({code:s.default.ERROR_TIM_VERSION_OUTDATED});var i=s.default.ERROR_PACKAGE_NOT_SUPPORTED,r="";throw e===u.CALL_EXPERMENTEL_API_TYPE.PRO?r=function(t){var e=c.isDomesticSDKAppID(t)?""+l.ERROR_CN_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED:""+l.ERROR_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED;return e=e.replace("${purchaseAddress}",c.getPurchaseAddress(t))}(n)+" <ERROR_PACKAGE_NOT_SUPPORTED: "+s.default.ERROR_PACKAGE_NOT_SUPPORTED+">":(i=s.default.ERROR_PACKAGE_NOT_PURCHASED,r=d(n)+" <ERROR_PACKAGE_NOT_PURCHASED: "+s.default.ERROR_PACKAGE_NOT_PURCHASED+">"),new o.default({code:i,message:r})}function h(t,e,n){return i(this,void 0,void 0,(function(){return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.tim.callExperimentalAPI("isCommercialAbilityEnabled",t)];case 1:if(i.sent().data.enabled)return[2,e.apply(this,n)];try{t===u.CALL_EXPERMENTEL_API_TYPE.BASE&&(this._callDataReport.setCodeAndMessage(s.default.ERROR_PACKAGE_NOT_SUPPORTED,l.ERROR_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED),this._callDataReport.uploadToKibana())}catch(t){console.warn("base ability check failed, userId:"+this.getUserId()+", error: "+t)}throw new o.default({code:s.default.ERROR_PACKAGE_NOT_SUPPORTED});case 2:return p(i.sent(),t,this._sdkAppID),[3,3];case 3:return[2]}}))}))}e.businessValidate=function(t){return function(e,n,a){var o=a.value;return a.value=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return i(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,h.call(this,t,o,e)];case 1:return[2,n.sent()];case 2:throw n.sent();case 3:return[2]}}))}))},a}},e.validateBusiness=function(t,e,n){return i(this,void 0,void 0,(function(){var i,a;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.callExperimentalAPI("isCommercialAbilityEnabled",e)];case 1:if((i=r.sent()).data.enabled)return[2,Promise.resolve(i.data.enabled)];throw a=d(n)+" <ERROR_PACKAGE_NOT_PURCHASED: "+s.default.ERROR_PACKAGE_NOT_PURCHASED+">",new o.default({code:s.default.ERROR_PACKAGE_NOT_PURCHASED,message:a});case 2:return p(r.sent(),e,n),[3,3];case 3:return[2]}}))}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.statusValidate=void 0;var i=n(8),r=n(10),a=n(7),o=n(15);function s(t,e,n){var s,l=i.default();if((null==t?void 0:t.init)&&!this._isLogin){var u=o.getErrorMessage({code:a.default.ERROR_INIT_FAIL,params:{fnName:n},languageList:["en"]});throw l.error("statusValidate.fail",{text:{error:""+u}}),new r.default({code:a.default.ERROR_INIT_FAIL,fnName:n})}if(-1===(null===(s=null==t?void 0:t.callStatus)||void 0===s?void 0:s.indexOf(this._callStatus))){u=o.getErrorMessage({code:a.default.INVALID_PARAMETER_RANGE,params:{key:"callStatus",rule:{values:t.callStatus},value:this._callStatus,fnName:n}});throw l.error("statusValidate.fail",{text:{error:u}}),new r.default({code:a.default.ERROR_REQUEST_REFUSED,message:u})}if((null==t?void 0:t.scene)&&this._isGroupCall){u=o.getErrorMessage({code:a.default.ERROR_SCENE_NOT_SUPPORTED,params:{fnName:n},languageList:["en"]});throw l.error("statusValidate.fail",{text:{error:""+u}}),new r.default({code:a.default.ERROR_SCENE_NOT_SUPPORTED,fnName:n})}}e.statusValidate=function(t){return function(e,n,i){var r=i.value;return i.value=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return s.call(this,t,e,n),r.apply(this,e)},i}}},function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.avoidRepeatedCall=void 0;var a=n(8),o=n(10),s=n(7);e.avoidRepeatedCall=function(){var t=a.default();return function(e,n,a){var l=a.value,u=new Set;return a.value=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return i(this,void 0,void 0,(function(){var i,a;return r(this,(function(r){switch(r.label){case 0:if(u.has(this))throw t.error("avoidRepeatedCall.fail",{text:{error:"previous "+n+"() is ongoing, please avoid repeated calls"}}),new o.default({code:s.default.ERROR_REQUEST_REPEATED,fnName:n});r.label=1;case 1:return r.trys.push([1,3,,4]),u.add(this),[4,l.apply(this,e)];case 2:return i=r.sent(),u.delete(this),[2,i];case 3:throw a=r.sent(),t.error("avoidRepeatedCall.fail",{text:{error:a}}),u.delete(this),a;case 4:return[2]}}))}))},a}}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.apiCallQueue=void 0;var r=new WeakMap;e.apiCallQueue=function(){return function(t,e,n){var a=n.value,o=function(t){var e=t.fn,n=t.args,a=t.context,s=t.resolve,l=t.reject;e.apply(a,n).then(s,l).finally((function(){var t=r.get(a);t.shift(),t[0]&&o(i({},t[0]))}))};return n.value=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new Promise((function(n,i){if(r.has(t)){var s=r.get(t),l=s.length;s.push({fn:a,args:e,context:t,resolve:n,reject:i}),0===l&&o({fn:a,args:e,context:t,resolve:n,reject:i})}else r.set(t,[{fn:a,args:e,context:t,resolve:n,reject:i}]),o({fn:a,args:e,context:t,resolve:n,reject:i})}))},n}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TUICallEngineObserver=e.CallDataReport=void 0;var i=n(6),r=n(16),a=n(13),o=n(29),s=n(18),l=n(0),u=n(68),c=n(1),d=n(30),p=function(){function t(t){this._eventStatController=new s.default,a.default.bindController(this._eventStatController),this.initializeCallData(t),this._ssoLog=new a.default(o.default.QUALITY_REPORT)}return t.prototype.setCallData=function(t){this._callData=t},t.prototype.getCallData=function(){return this._callData},t.prototype.setInviteID=function(t){this._callData.inviteID=t},t.prototype.setTotalTime=function(t){this._callData.totalTime=t},t.prototype.setAbilityBit=function(t){this._callData.abilityBit=!!t},t.prototype.setEnterRoomTime=function(t){this._callData.enterRoomTime=u.convertTimeStampToString(t)},t.prototype.setSendSignalingTime=function(t){this._callData.sendSignalingTime=u.convertTimeStampToString(t)},t.prototype.setCallAcceptTime=function(t){this._callData.callAcceptTime=u.convertTimeStampToString(t)},t.prototype.setExitRoomTime=function(t){this._callData.exitRoomTime=u.convertTimeStampToString(t)},t.prototype.setCallEndTime=function(t){this._callData.callEndTime=t},t.prototype.setCodeAndMessage=function(t,e){this._callData.code=t||0,this._callData.message=e||""},t.prototype.setCallScene=function(t){this._callData.callScene=t||""},t.prototype.getResult=function(){return this._callData.result},t.prototype.setResult=function(t){this._callData.result=t||""},t.prototype.setUserID=function(t){this._callData.userID=t||""},t.prototype.packageCallDataToKibana=function(){var t=d.callTypeMapping(this._callData.callType),e=d.callRoleMapping(this._callData.callRole);return"CallData{version='"+this._callData.version+", platform="+this._callData.platform+", framework="+this._callData.framework+", sdk_app_id="+this._callData.sdkAppId+", user_id="+this._callData.userID+", room_id="+this._callData.roomID+", invite_id="+this._callData.inviteID+", invitee_list="+this._callData.inviteeList+", media_type="+t+", role="+e+", call_scene="+this._callData.callScene+", result="+this._callData.result+", total_time="+this._callData.totalTime+", total_score="+this._callData.totalScore+", ability_bit="+this._callData.abilityBit+", enter_room="+this._callData.enterRoomTime+", send_signaling="+this._callData.sendSignalingTime+", call_accept="+this._callData.callAcceptTime+", exit_room="+this._callData.exitRoomTime+", call_end="+this._callData.callEndTime+", code="+this._callData.code+", message="+this._callData.message+", network="+this._callData.network+", audio="+this._callData.audio+", video="+this._callData.video+"}"},t.prototype.initializeCallData=function(t){var e=t||{},n=e.version,r=void 0===n?"":n,a=e.sdkAppId,o=void 0===a?0:a,s=e.userID,u=void 0===s?"":s,d=c.getHostType();this._callData={version:r,platform:d,framework:l.NAME.WEB,sdkAppId:o,userID:u,roomID:0,inviteID:"",callRole:i.CALL_ROLE.UNKNOWN,callScene:"",callType:i.CALL_TYPE.UNKNOWN,inviteeList:[],result:l.NAME.UNKNOWN,totalTime:0,totalScore:0,code:0,message:"",abilityBit:!1,enterRoomTime:"",sendSignalingTime:"",callAcceptTime:"",exitRoomTime:"",callEndTime:"",network:0,audio:0,video:0}},t.prototype.reset=function(){this.initializeCallData(),this._ssoLog=null},t.prototype.clearCallDataAfterUpload=function(){var t=this.getCallData(),e=t.version,n=t.sdkAppId,i=t.userID;this.initializeCallData({version:e,sdkAppId:n,userID:i})},t.prototype.uploadToKibana=function(){try{this._ssoLog.setText(this.packageCallDataToKibana()).setEnd(),this.clearCallDataAfterUpload()}catch(t){}},t}();e.CallDataReport=p;var h=function(){function t(t,e){this._eventEmitter=t,this._callDataReport=e,this.registerListener()}return t.prototype.registerListener=function(){this._eventEmitter.on(r.TUICallEvent.CALLING_END,this.onCallEnd.bind(this)),this._eventEmitter.on(r.TUICallEvent.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(r.TUICallEvent.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(r.TUICallEvent.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(r.TUICallEvent.REJECT,this.onReject.bind(this))},t.prototype.removeLister=function(){this._eventEmitter.off(r.TUICallEvent.CALLING_END,this.onCallEnd.bind(this)),this._eventEmitter.off(r.TUICallEvent.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.off(r.TUICallEvent.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.off(r.TUICallEvent.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.off(r.TUICallEvent.REJECT,this.onReject.bind(this))},t.prototype.onCallEnd=function(t){var e=t.totalTime,n=void 0===e?0:e;this._callDataReport.setTotalTime(n),this._callDataReport.setResult(l.NAME.NORMAL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()},t.prototype.onCallingCancel=function(){this._callDataReport.getResult()||this._callDataReport.setResult(l.NAME.CANCEL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()},t.prototype.onNoResponse=function(){this._callDataReport.setResult(l.NAME.TIMEOUT)},t.prototype.onLineBusy=function(){this._callDataReport.setResult(l.NAME.BUSYLINE)},t.prototype.onReject=function(){this._callDataReport.setResult(l.NAME.REJECT)},t}();e.TUICallEngineObserver=h},function(t,e,n){"use strict";n.r(e),n.d(e,"setBaseTime",(function(){return o})),n.d(e,"getCurrentTime",(function(){return s})),n.d(e,"getTimestamp",(function(){return l})),n.d(e,"convertTimeStampToString",(function(){return u}));var i=n(2);let r=(new Date).getTime(),a=0;const o=function(t){r=t,a=r-(new Date).getTime();const e=new Date;e.setTime(t),i.default.info("baseTime from server: "+e+" offset: "+a)},s=function(){return(new Date).getTime()+a},l=function(){const t=new Date;return t.setTime(s()),t.toLocaleString()};const u=t=>t<=0?"":function(t){const e=new Date(t);return`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")} ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}`}(t)},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.TUICallEngineRecordObserver=e.CallRecordReport=void 0;var o=n(6),s=n(16),l=n(0),u=n(1),c=n(2),d=n(70),p=n(5),h=n(30),_={serviceCommand:l.NAME.CALLKIT_RECORDS_SVR+".*"},f=function(){function t(t){this._tim=t.tim,this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=l.NAME.WAITING,this.initializeCallData(t)}return t.prototype.getCallRecordData=function(){return this._callRecordData},t.prototype.initializeCallData=function(t){var e=t||{},n=e.version,i=void 0===n?"":n,r=e.userID,a=void 0===r?"":r,s=p.getOsInfo().name,u={version:1,command:l.NAME.EVENT_REPORT,sdk_version:i,seq:0,os_name:l.NAME.WEB,os_version:"0.0",device_name:s,framework:l.NAME.WEB,call_type:"",media_type:"",client_ts:0,role:o.CALL_ROLE.UNKNOWN,user_id:a,room_id:"",call_id:"",group_id:"",room_id_type:1};this._callRecordData={head:u,body:{event_type:"",code:0,message:"",invitee_list:[]}}},t.prototype.reset=function(){this.initializeCallData()},t.prototype._setCallType=function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{call_type:t}))},t.prototype._setMediaType=function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{media_type:h.callTypeMapping(t)}))},t.prototype._setCallRole=function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{role:t}))},t.prototype._setUserID=function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{user_id:t}))},t.prototype._setRoomID=function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{room_id:""+t}))},t.prototype._setInviteID=function(t){void 0===t&&(t=""),t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{call_id:t}))},t.prototype._setGroupId=function(t){u.isUndefined(t)||(this._callRecordData.head=i(i({},this._callRecordData.head),{group_id:t}))},t.prototype._getGroupId=function(){return this._callRecordData.head.group_id},t.prototype._setRoomIdType=function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{room_id_type:t}))},t.prototype._setEventType=function(t){t&&(this._callRecordData.body=i(i({},this._callRecordData.body),{event_type:t}))},t.prototype._setInviteeList=function(t){void 0===t&&(t=[]),this._callRecordData.body=i(i({},this._callRecordData.body),{invitee_list:t})},t.prototype._setSeq=function(){var t=this.getCallRecordData().head.seq;this._callRecordData.head=i(i({},this._callRecordData.head),{seq:t+1})},t.prototype.setBodyStatus=function(t){if(t){var e=l.NAME.WAITING;switch(t){case o.CALL_STATUS.CALLING:e=l.NAME.WAITING;break;case o.CALL_STATUS.CONNECTED:e=l.NAME.CALLING}this._bodyStatus=e}},t.prototype.eventUpload=function(t){var e;return r(this,void 0,void 0,(function(){var n,r,o,s,c,d,p,f,E,g,I,v,C,T,R,m,A,y;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=t.eventType,r=t.callType,o=t.mediaType,s=t.callRole,c=t.userID,d=t.roomID,p=t.inviteID,f=t.groupId,E=t.strRoomId,g=void 0===E?"":E,I=t.inviteeList,v=void 0===I?[]:I,n?(this._callRecordData.head=i(i({},this._callRecordData.head),{command:l.NAME.EVENT_REPORT,client_ts:Math.floor(Date.now()/1e3)}),this._setCallType(r),this._setMediaType(o),this._setCallRole(s),this._setUserID(c),this._setInviteID(p),this._setGroupId(f),d>0?(this._setRoomID(""+d),this._setRoomIdType(1)):0===d&&u.isString(g)&&g.length>0&&(this._setRoomID(g),this._setRoomIdType(2)),this._setEventType(n),this._setInviteeList(v),this._setSeq(),C=this.getCallRecordData(),T=C.head,R=C.body,m={head:i(i({},T),{role:h.callRoleMapping(T.role)}),body:R},A=i(i({},_),{data:JSON.stringify(m)}),[4,null===(e=null==this?void 0:this._tim)||void 0===e?void 0:e.callExperimentalAPI("sendTRTCCustomData",A)]):[2];case 1:return a.sent(),[3,3];case 2:return y=a.sent(),console.warn("eventUpload failed. error: "+JSON.stringify(y)),[3,3];case 3:return[2]}}))}))},t.prototype.eventUploadNotSave=function(t){var e;return r(this,void 0,void 0,(function(){var n,r,o,s,l,u,c,d,p,f,E,g,I,v,C,T;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=t.eventType,r=t.callType,o=t.mediaType,s=t.callRole,l=t.roomID,u=t.groupId,c=t.strRoomId,d=void 0===c?"":c,p=t.inviteID,this._setSeq(),f=this.getCallRecordData(),E=f.head,g=f.body,I=E.room_id_type,l>0&&(I=1),0===l&&d&&(I=2),v={head:i(i({},E),{role:h.callRoleMapping(s),call_id:p,call_type:r,media_type:h.callTypeMapping(o),room_id:1===I?""+l:d,client_ts:Math.floor(Date.now()/1e3),group_id:u||this._getGroupId(),room_id_type:I}),body:i(i({},g),{event_type:n})},C=i(i({},_),{data:JSON.stringify(v)}),[4,null===(e=null==this?void 0:this._tim)||void 0===e?void 0:e.callExperimentalAPI("sendTRTCCustomData",C)];case 1:return a.sent(),[3,3];case 2:return T=a.sent(),console.warn("eventUploadNotSave failed. error: "+JSON.stringify(T)),[3,3];case 3:return[2]}}))}))},t.prototype.heartBeatUpload=function(){var t;return r(this,void 0,void 0,(function(){var e,n,r,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),this._setSeq(),e=this._callRecordData.head,n={head:i(i({},e),{role:h.callRoleMapping(e.role),clientTs:Date.now(),command:l.NAME.HEART_BEAT}),body:{status:this._bodyStatus}},r=i(i({},_),{data:n}),[4,null===(t=null==this?void 0:this._tim)||void 0===t?void 0:t.callExperimentalAPI("sendTRTCCustomData",r)];case 1:return a.sent(),[3,3];case 2:return o=a.sent(),console.warn("heartBeatUpload failed. error: "+JSON.stringify(o)),[3,3];case 3:return[2]}}))}))},t.prototype.startHeartbeat=function(){-1===this._heartbeat&&(c.default.info("start heart beat..."),this.heartBeatUpload(),this._heartbeat=d.default.run(l.NAME.TIMEOUT,this.doHeartbeat.bind(this),{delay:2e3,count:0,backgroundTask:!0}))},t.prototype.stopHeartbeat=function(){-1!==this._heartbeat&&(c.default.info("stop heart beat"),d.default.clearTask(this._heartbeat),this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=l.NAME.WAITING)},t.prototype.doHeartbeat=function(){return r(this,void 0,void 0,(function(){var t;return a(this,(function(e){return this.heartBeatUpload(),t=Date.now(),this._lastHeartBeatTime>0&&t-this._lastHeartBeatTime>1e4&&c.default.warn("heartbeat took "+(t-this._lastHeartBeatTime)),this._lastHeartBeatTime=t,[2]}))}))},t}();e.CallRecordReport=f;var E=function(){function t(t,e){this._eventEmitter=t,this._callRecordDataReport=e,this._isCallAccepted=!1,this.registerListener()}return t.prototype.registerListener=function(){this._eventEmitter.on(s.TUICallEvent.ON_CALL_RECEIVED,this.onCallReceived.bind(this)),this._eventEmitter.on(s.TUICallEvent.USER_ACCEPT,this.onCallAccepted.bind(this)),this._eventEmitter.on(s.TUICallEvent.CALLING_END,this.onCallEnd.bind(this)),this._eventEmitter.on(s.TUICallEvent.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(s.TUICallEvent.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(s.TUICallEvent.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(s.TUICallEvent.REJECT,this.onReject.bind(this))},t.prototype.removeLister=function(){this._eventEmitter.off(s.TUICallEvent.ON_CALL_RECEIVED,this.onCallReceived),this._eventEmitter.off(s.TUICallEvent.USER_ACCEPT,this.onCallAccepted),this._eventEmitter.off(s.TUICallEvent.CALLING_END,this.onCallEnd),this._eventEmitter.off(s.TUICallEvent.CALLING_CANCEL,this.onCallingCancel),this._eventEmitter.off(s.TUICallEvent.NO_RESP,this.onNoResponse),this._eventEmitter.off(s.TUICallEvent.LINE_BUSY,this.onLineBusy),this._eventEmitter.off(s.TUICallEvent.REJECT,this.onReject)},t.prototype.onCallReceived=function(){this._callRecordDataReport.startHeartbeat()},t.prototype.onCallAccepted=function(){var t=this._callRecordDataReport.getCallRecordData().head;if((null==t?void 0:t.role)===l.NAME.INVITER){if(this._isCallAccepted&&t.call_type===l.NAME.GROUP)return;this._isCallAccepted=!0;var e={eventType:l.NAME.CALL_ACCEPTED};this._callRecordDataReport.eventUpload(e),this._callRecordDataReport.setBodyStatus(o.CALL_STATUS.CONNECTED)}},t.prototype.onCallEnd=function(){var t={eventType:l.NAME.CALL_END};this._isCallAccepted=!1,this._callRecordDataReport.eventUpload(t),this._callRecordDataReport.stopHeartbeat()},t.prototype.onCallingCancel=function(t){var e=this._callRecordDataReport.getCallRecordData().head,n=e.role===l.NAME.INVITER?l.NAME.CANCEL_CALL:l.NAME.CALL_CANCELED;this._isCallAccepted=!1;var i=(t||{}).reason;((void 0===i?"":i)===l.NAME.NORMAL||e.role===l.NAME.INVITER&&e.call_type===l.NAME.GROUP)&&this._callRecordDataReport.eventUpload({eventType:n}),this._callRecordDataReport.stopHeartbeat()},t.prototype.onNoResponse=function(){this._uploadInC2C(l.NAME.TIMEOUT)},t.prototype.onLineBusy=function(){this._uploadInC2C(l.NAME.BUSYLINE)},t.prototype.onReject=function(){this._uploadInC2C(l.NAME.REJECT)},t.prototype._uploadInC2C=function(t){var e=this._callRecordDataReport.getCallRecordData().head;if((null==e?void 0:e.call_type)===l.NAME.SINGLE){var n="";switch(t){case l.NAME.TIMEOUT:n=e.role===l.NAME.INVITER?l.NAME.CALL_MISSED:l.NAME.NOT_ANSWER_CALL;break;case l.NAME.REJECT:n=e.role===l.NAME.INVITER&&l.NAME.CALL_REJECTED;break;case l.NAME.BUSYLINE:n=e.role===l.NAME.INVITER?l.NAME.CALL_BUSY:l.NAME.NOT_ANSWER_CALL;break;default:return}this._callRecordDataReport.eventUpload({eventType:n})}},t}();e.TUICallEngineRecordObserver=E},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),a=n(0),o=null===window||void 0===window?void 0:window.cancelAnimationFrame,s=function(){function t(){}return t.generateTaskID=function(){return this.currentTaskID++},t.run=function(t,e,n){void 0===t&&(t=a.NAME.TIMEOUT),n=t===a.NAME.INTERVAL?i({delay:2e3,count:0,backgroundTask:!0},n):t===a.NAME.RAF?i({fps:60,delay:16.6,count:0,backgroundTask:!0},n):i({delay:2e3,count:0,backgroundTask:!0},n),r.isObject(e)&&(n=i(i({},n),e)),r.isFunction(t)&&(e=t,t=a.NAME.TIMEOUT);var o=i({taskID:this.generateTaskID(),loopCount:0,intervalID:null,timeoutID:null,rafID:null,taskName:t,callback:e},n);return this.taskMap.set(o.taskID,o),this[t](o),o.taskID},t.interval=function(t){var e=this;return t.intervalID=setInterval((function(){t.callback(),t.loopCount+=1,e.isBreakLoop(t)}),t.delay)},t.timeout=function(t){var e=this,n=function(){if(t.callback(),t.loopCount+=1,!e.isBreakLoop(t))return t.timeoutID=setTimeout(n,t.delay)};return t.timeoutID=setTimeout(n,t.delay)},t.raf=function(t){var e=this;t.delay=(1e3/t.fps).toFixed(2);var n,i=r.performanceNow(),a=function(){if(document.hidden&&t.backgroundTask){if(n=r.performanceNow()-i,i=r.performanceNow(),t.callback(),t.loopCount+=1,e.isBreakLoop(t))return;return t.timeoutID=setTimeout(a,t.delay-Math.floor(n%t.delay))}if((n=r.performanceNow()-i)>=t.delay&&(i=r.performanceNow()-Math.floor(n%t.delay),t.callback(),t.loopCount+=1),!e.isBreakLoop(t))return t.rafID=requestAnimationFrame(a)};if(t.rafID=requestAnimationFrame(a),t.backgroundTask){var o=function(){if(document.hidden){var e=r.performanceNow()-i;e>=t.delay?a():t.timeoutID=setTimeout(a,t.delay-e)}};document.addEventListener("visibilitychange",o),t.onVisibilitychange=o,document.hidden&&o()}return t.taskID},t.hasTask=function(t){return this.taskMap.has(t)},t.clearTask=function(t){if(!this.taskMap.has(t))return!0;var e=this.taskMap.get(t),n=e.intervalID,i=e.timeoutID,r=e.rafID,a=e.onVisibilitychange;return n&&clearInterval(n),i&&clearTimeout(i),r&&o(r),a&&document.removeEventListener("visibilitychange",a),this.taskMap.delete(t),!0},t.isBreakLoop=function(t){return!this.taskMap.has(t.taskID)||0!==t.count&&t.loopCount>=t.count&&(this.clearTask(t.taskID),!0)},t.taskMap=new Map,t.currentTaskID=1,t}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ES_TABLE=e.ES_URL=e.CLS_TOPIC_ID=e.CLS_ENDPOINT=void 0,e.CLS_ENDPOINT="https://ap-nanjing.cls.tencentcs.com",e.CLS_TOPIC_ID="a1310e66-a3f5-4572-a1c3-7a327a27496d",e.ES_URL="https://webim.tim.qq.com/v4/imopenstat/tweb_trtccalling_report",e.ES_TABLE="timweb-trtccalling"}]).default}));