UNPKG

@tencentcloud/call-uikit-wx-uniapp

Version:

An Open-source Voice & Video Calling UI Component Based on Tencent Cloud Service.

2,521 lines 121 kB
(function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
import { TUICallEvent as u, TUICallEngine as st } from "@tencentcloud/call-engine-wx";
import { TUICore as ee, TUIConstants as R, TUILogin as nt } from "@tencentcloud/tui-core";
import ye from "@tencentcloud/chat";
var s = /* @__PURE__ */ ((A) => (A.CALL = "call", A.CUSTOM = "custom", A))(s || {}), d = /* @__PURE__ */ ((A) => (A[A.UNKNOWN = 0] = "UNKNOWN", A[A.AUDIO = 1] = "AUDIO", A[A.VIDEO = 2] = "VIDEO", A))(d || {}), G = /* @__PURE__ */ ((A) => (A.UNKNOWN = "unknown", A.CALLEE = "callee", A.CALLER = "caller", A))(G || {}), h = /* @__PURE__ */ ((A) => (A.IDLE = "idle", A.CALLING = "calling", A.CONNECTED = "connected", A))(h || {}), ne = /* @__PURE__ */ ((A) => (A.CONTAIN = "contain", A.COVER = "cover", A.FILL = "fill", A))(ne || {}), oe = /* @__PURE__ */ ((A) => (A.RESOLUTION_480P = "480p", A.RESOLUTION_720P = "720p", A.RESOLUTION_1080P = "1080p", A))(oe || {});
const M = {
  IDLE: "idle",
  BE_INVITED: "be-invited",
  DIALING_C2C: "dialing-c2c",
  DIALING_GROUP: "dialing-group",
  CALLING_C2C_AUDIO: "calling-c2c-audio",
  CALLING_C2C_VIDEO: "calling-c2c-video",
  CALLING_GROUP_AUDIO: "calling-group-audio",
  CALLING_GROUP_VIDEO: "calling-group-video"
}, ot = {
  unknown: 0,
  audio: 1,
  video: 2
  /* VIDEO */
};
var w = /* @__PURE__ */ ((A) => (A.EAR = "ear", A.SPEAKER = "speaker", A))(w || {}), b = /* @__PURE__ */ ((A) => (A[A.FRONT = 0] = "FRONT", A[A.BACK = 1] = "BACK", A))(b || {}), Y = /* @__PURE__ */ ((A) => (A.Camera = "camera", A.Microphone = "microphone", A.SwitchCamera = "switchCamera", A.InviteUser = "inviteUser", A))(Y || {}), z = /* @__PURE__ */ ((A) => (A.Open = "open", A.Close = "close", A))(z || {}), Je = /* @__PURE__ */ ((A) => (A.LocalInLargeView = "local", A.RemoteInLargeView = "remote", A))(Je || {}), J = /* @__PURE__ */ ((A) => (A[A.INVITE = 1] = "INVITE", A[A.CANCEL_INVITE = 2] = "CANCEL_INVITE", A[A.ACCEPT_INVITE = 3] = "ACCEPT_INVITE", A[A.REJECT_INVITE = 4] = "REJECT_INVITE", A[A.INVITE_TIMEOUT = 5] = "INVITE_TIMEOUT", A))(J || {});
const Pe = {
  SWITCH_TO_AUDIO_CALL_FAILED: 60001,
  SWITCH_TO_VIDEO_CALL_FAILED: 60002,
  MICROPHONE_UNAVAILABLE: 60003,
  CAMERA_UNAVAILABLE: 60004,
  BAN_DEVICE: 60005,
  NOT_SUPPORTED_WEBRTC: 60006,
  ERROR_BLACKLIST: 20007
}, Qe = {
  SWITCH_TO_AUDIO_CALL_FAILED: "switchToAudioCall-call-failed",
  SWITCH_TO_VIDEO_CALL_FAILED: "switchToVideoCall-call-failed",
  MICROPHONE_UNAVAILABLE: "microphone-unavailable",
  CAMERA_UNAVAILABLE: "camera-unavailable",
  BAN_DEVICE: "ban-device",
  NOT_SUPPORTED_WEBRTC: "not-supported-webrtc",
  ERROR_BLACKLIST: "blacklist-user-tips"
};
var We = /* @__PURE__ */ ((A) => (A[A.NORMAL = 0] = "NORMAL", A[A.RELEASE = 1] = "RELEASE", A[A.WARNING = 2] = "WARNING", A[A.ERROR = 3] = "ERROR", A[A.NONE = 4] = "NONE", A))(We || {});
const ue = {
  CALL_STATUS: "callStatus",
  CALL_ROLE: "callRole",
  CALL_MEDIA_TYPE: "callMediaType",
  LOCAL_USER_INFO: "localUserInfo",
  LOCAL_USER_INFO_EXCLUDE_VOLUMN: "localUserInfoExcludeVolume",
  REMOTE_USER_INFO_LIST: "remoteUserInfoList",
  REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST: "remoteUserInfoExcludeVolumeList",
  CALLER_USER_INFO: "callerUserInfo",
  IS_GROUP: "isGroup",
  CALL_DURATION: "callDuration",
  CALL_TIPS: "callTips",
  TOAST_INFO: "toastInfo",
  IS_MINIMIZED: "isMinimized",
  ENABLE_FLOAT_WINDOW: "enableFloatWindow",
  BIG_SCREEN_USER_ID: "bigScreenUserId",
  LANGUAGE: "language",
  IS_CLICKABLE: "isClickable",
  DISPLAY_MODE: "displayMode",
  VIDEO_RESOLUTION: "videoResolution",
  PUSHER: "pusher",
  PLAYER: "player",
  IS_EAR_PHONE: "isEarPhone",
  IS_MUTE_SPEAKER: "isMuteSpeaker",
  SHOW_PERMISSION_TIP: "SHOW_PERMISSION_TIP",
  NETWORK_STATUS: "NetWorkStatus",
  CALL_ID: "callID",
  GROUP_ID: "groupID",
  ROOM_ID: "roomID",
  ROOM_ID_TYPE: "roomIdType",
  SHOW_SELECT_USER: "showSelectUser",
  IS_SHOW_ENABLE_VIRTUAL_BACKGROUND: "isShowEnableVirtualBackground",
  ENABLE_VIRTUAL_BACKGROUND: "enableVirtualBackground",
  GROUP_CALL_MEMBERS: "groupCallMembers",
  PUSHER_ID: "pusherId",
  IS_FORCE_USE_V2_API: "isForceUseV2API"
}, lt = {
  INNER_ATTR_KIT_INFO: "inner_attr_kit_info"
}, ct = {
  INITIAL_PUSHER: "initialPusher",
  NEW_PUSHER: "newPusher"
}, i = {
  PREFIX: "【CallService】",
  AUDIO: "audio",
  VIDEO: "video",
  LOCAL_VIDEO: "localVideo",
  ERROR: "error",
  TIMEOUT: "timeout",
  RAF: "raf",
  INTERVAL: "interval",
  DEFAULT: "default",
  BOOLEAN: "boolean",
  STRING: "string",
  NUMBER: "number",
  OBJECT: "object",
  ARRAY: "array",
  FUNCTION: "function",
  UNDEFINED: "undefined",
  UNKNOWN: "unknown",
  ALL: "all",
  MYSELF: "myself",
  DEVICE_LIST: "deviceList",
  CAMERA_POSITION: "cameraPosition",
  CUSTOM_UI_CONFIG: "customUIConfig",
  TRANSLATE: "translate",
  ...ct,
  ...ue,
  ...lt
}, It = "https://web.sdk.qcloud.com/component/TUIKit/assets/call.png", Et = "https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg", ve = 2147483647, me = 4;
var Te = /* @__PURE__ */ ((A) => (A[A.TUI_CALL_KIT = 14] = "TUI_CALL_KIT", A[A.TIM_CALL_KIT = 15] = "TIM_CALL_KIT", A))(Te || {}), Re = /* @__PURE__ */ ((A) => (A[A.NUMBER_ROOM_ID = 1] = "NUMBER_ROOM_ID", A[A.STRING_ROOM_ID = 2] = "STRING_ROOM_ID", A))(Re || {});
function ut() {
  wx.hideKeyboard && wx.hideKeyboard({
    complete: () => {
    }
  });
}
function Ct() {
  wx.getSystemInfoSync().platform === "devtools" && wx.showModal({
    icon: "none",
    title: "运行环境提醒",
    content: "微信开发者工具不支持原生推拉流组件(即 <live-pusher> 和 <live-player> 标签),请使用真机调试或者扫码预览。",
    showCancel: !1
  });
}
function ze() {
  ut(), Ct();
}
async function Lt(A, e) {
  try {
    ze();
    const t = {
      microphone: !0,
      camera: A === d.VIDEO
    };
    return await e._tuiCallEngine.deviceCheck(t) ? h.CALLING : h.IDLE;
  } catch (t) {
    return console.debug(t), h.IDLE;
  }
}
function ht(A) {
  (A == null ? void 0 : A.code) === -1002 && wx.showModal({
    icon: "none",
    title: "error",
    content: (A == null ? void 0 : A.message) || "",
    showCancel: !1
  });
}
function gt() {
  wx.showModal({
    icon: "none",
    title: "权限提示",
    content: "当前小程序 appid 不具备 <live-pusher> 和 <live-player> 的使用权限,您将无法正常使用实时通话能力,请使用企业小程序账号申请权限后再进行开发体验",
    showCancel: !1
  });
}
const dt = {
  // 按钮文案
  hangup: "挂断",
  reject: "拒绝",
  accept: "接受",
  camera: "摄像头",
  microphone: "麦克风",
  speaker: "扬声器",
  "open camera": "打开摄像头",
  "close camera": "关闭摄像头",
  "open microphone": "打开麦克风",
  "close microphone": "关闭麦克风",
  "video-to-audio": "转语音通话",
  "virtual-background": "模糊背景",
  // 通话结果
  "other side reject call": "对方已拒绝",
  "reject call": "{{ userList }} 拒绝通话",
  cancel: "取消通话",
  "other side line busy": "对方忙线",
  "in busy": "{{ userList }} 正在忙",
  "call timeout": "呼叫超时",
  "end call": "{{ userList }} 结束通话",
  // 通话提示语
  "caller calling message": "等待对方接受邀请",
  "callee calling video message": "邀请你视频通话",
  "callee calling audio message": "邀请你语音通话",
  "no microphone access": "没有麦克风权限",
  "no camera access": "没有摄像头权限",
  "invite member": "邀请成员",
  "Invited group call": "邀请你加入多人通话",
  "Those involved": "参与通话的有:",
  waiting: "等待接听...",
  me: "(我)",
  // 弹出层文案
  "browser-authorization": "浏览器授权",
  "mac-privacy": "系统偏好设置 -> 安全与隐私 -> 隐私",
  "win-privacy": "设置 -> 隐私和安全性 -> 应用权限",
  "mac-preferences": "打开系统偏好设置",
  "win-preferences": "打开系统设置",
  "Please enter userID": "请输入 userID",
  "View more": "查看更多",
  "people selected": "人已选中",
  "Select all": "全选",
  Cancel: "取消",
  Done: "完成",
  "exist group call": "当前群组中已经存在群组通话",
  // UI3.0 新增
  "camera enabled": "摄像头已开",
  "camera disabled": "摄像头已关",
  "microphone enabled": "麦克风已开",
  "microphone disabled": "麦克风已关",
  "speaker enabled": "扬声器已开",
  "speaker disabled": "扬声器已关",
  "open speaker": "开启扬声器",
  "close speaker": "关闭扬声器",
  "wait to be called": "等待接听",
  answered: "已接通",
  "people in the call": "人参与通话",
  "failed to obtain speakers": "无法获取扬声器",
  "you have a new call": "您有一个新的通话",
  "switch camera": "翻转",
  join: "加入",
  "people on the call": "人正在通话",
  "Supports a maximum of 9 people for simultaneous calls": "最多支持9人同时通话",
  you: "(你)",
  "The network is poor during your current call": "当前通话你的网络不佳",
  "The other user network is poor during the current call": "当前通话对方网络不佳",
  "TUICallKit init is not complete": "TUICallKit 初始化登录未完成,需要在 init 完成后使用此 API",
  // combine chat
  "Video call": "发起视频通话",
  "Voice call": "发起语音通话",
  "Call End": "通话结束",
  "Switch voice call": "切换语音通话",
  "Switch video call": "切换视频通话",
  "Call duration": "通话时长",
  "Call Cancel": "已取消",
  "Other Side Cancel": "对方已取消",
  Decline: "已拒绝",
  "Other Side Decline": "对方已拒绝",
  "No answer": "超时无应答",
  "Other Side No Answer": "对方无应答",
  Answered: "已接听",
  "Other Side Line Busy": "对方忙线中",
  "Line Busy": "忙线无应答",
  // 待废弃文案
  timeout: "{{ userList }} 超时",
  "kick out": "被踢",
  call: "通话",
  "video-call": "视频通话",
  "audio-call": "音频通话",
  search: "搜索",
  "search-result": "搜索结果",
  "Wechat scan right QR code": "微信扫右二维码",
  "Use-phone-and-computer": "用手机与电脑互打体验视频通话",
  "Scan the QR code above": "扫描上方二维码",
  "no-user": "未搜索到用户",
  "member-not-added": "未添加成员",
  "not-login": "未登录",
  "login-status-expire": "登录状态已失效,请刷新网页重试",
  "experience-multi-call": "体验多人通话请下载全功能demo:",
  "not-support-multi-call": "多人通话接口未开放",
  "input-phone-userID": "请输入手机号/用户ID",
  userID: "用户ID",
  "already-enter": "已经进入当前通话",
  "image-resolution": "分辨率",
  "default-image-resolution": "默认分辨率",
  "invited-person": "添加成员",
  "be-rejected": "对方已拒绝,",
  "be-no-response": "对方无应答,",
  "be-line-busy": "对方忙线中,",
  "be-canceled": "对方已取消",
  "voice-call-end": "语音通话结束",
  "video-call-end": "视频通话结束",
  "method-call-failed": "同步操作失败",
  "failed-to-obtain-permission": "权限获取失败",
  "environment-detection-failed": "环境检测失败",
  "switchToAudioCall-call-failed": "切语音调用失败",
  "switchToVideoCall-call-failed": "切视频调用失败",
  "microphone-unavailable": "没有可用的麦克风设备",
  "camera-unavailable": "没有可用的摄像头设备",
  "ban-device": "用户禁止使用设备",
  "not-supported-webrtc": "当前环境不支持 WebRTC",
  "blacklist-user-tips": "发起通话失败,被对方拉入黑名单,禁止发起!",
  "is-already-calling": "TUICallKit 已在通话状态",
  "need-init": "TUICallKit 发起通话前需保证 TUICallKitServer.init() 方法执行成功",
  "can't call yourself": "不能呼叫自己",
  // eslint-disable-line
  "accept-error": "接通失败",
  "accept-device-error": "接通失败,通话设备获取失败",
  "call-error": "发起通话失败"
}, Le = typeof wx < "u" && typeof wx.getSystemInfoSync == "function" && !!wx.getSystemInfoSync().fontSizeSetting, Xe = typeof uni < "u" && typeof uni > "u", Ve = Le || Xe, qe = typeof uni < "u", je = function() {
  return (typeof uni < "u" || typeof window < "u") && !Ve;
}(), _t = function() {
  return Le ? wx : qe ? uni : window;
}(), K = je && window && window.navigator && window.navigator.userAgent || "", ft = /Android/i.test(K), Dt = /(?:Windows Phone)/.test(K), St = /(?:SymbianOS)/.test(K), Ut = /iPad/i.test(K) || /iPhone/i.test(K) || /iPod/i.test(K), Ze = ft || Dt || St || Ut, pe = je && !Ze, Bt = pe && K.includes("Windows NT"), Ot = pe && K.includes("Mac");
let $e = class ae {
  constructor() {
    this.global = _t, this.isPC = !1, this.isH5 = !1, this.isWeChat = !1, this.isApp = !1, this.isUniPlatform = !1, this.isOfficial = !1, this.isWIN = !1, this.isMAC = !1, this.initEnv();
  }
  /**
   * 获取 TUIGlobal 实例
   * @returns {TUIGlobal}
  */
  static getInstance() {
    return ae.instance || (ae.instance = new ae()), ae.instance;
  }
  initEnv() {
    this.isPC = pe, this.isH5 = Ze, this.isWeChat = Le, this.isApp = Xe && !Le, this.isUniPlatform = qe, this.isWIN = Bt, this.isMAC = Ot;
  }
  initOfficial(e) {
    this.isOfficial = e === 1400187352 || e === 1400188366;
  }
};
const fe = function(A) {
  return typeof A === i.UNDEFINED;
}, we = function(A) {
  if (typeof A !== i.OBJECT || A === null)
    return !1;
  const e = Object.getPrototypeOf(A);
  if (e === null)
    return !0;
  let t = e;
  for (; Object.getPrototypeOf(t) !== null; )
    t = Object.getPrototypeOf(t);
  return e === t;
}, et = function(A) {
  return typeof Array.isArray === i.FUNCTION ? Array.isArray(A) : Object.prototype.toString.call(A).match(/^\[object (.*)\]$/)[1].toLowerCase() === i.ARRAY;
}, he = function(A) {
  return typeof A === i.STRING;
}, Rt = function(A) {
  return typeof A === i.BOOLEAN;
}, tt = function(A) {
  return (
    // eslint-disable-next-line
    A !== null && (typeof A === i.NUMBER && !isNaN(A - 0) || typeof A === i.OBJECT && A.constructor === Number)
  );
};
function it(A) {
  const e = Math.floor(A / 3600), t = Math.floor(A % 3600 / 60), a = Math.floor(A % 60);
  let r = e > 9 ? `${e}` : `0${e}`;
  return r += t > 9 ? `:${t}` : `:0${t}`, r += a > 9 ? `:${a}` : `:0${a}`, r;
}
function Nt(A) {
  if (typeof A === i.STRING)
    try {
      return !!JSON.parse(A);
    } catch (e) {
      return console.debug(e), !1;
    }
  return !1;
}
const Ie = function(A) {
  return !A || !Nt(A) ? A : JSON.parse(A);
};
function Ke(A) {
  return (A == null ? void 0 : A.message.indexOf("is ongoing, please avoid repeated calls")) !== -1;
}
function Tt(A) {
  const { message: e } = A;
  return e.indexOf("NotAllowedError: Permission denied") !== -1;
}
function Se() {
  return Date.now();
}
const Ce = function(A) {
  return typeof A === i.FUNCTION;
}, pt = () => {
  if ($e.getInstance().isWeChat)
    return "zh-cn";
  const A = ((navigator == null ? void 0 : navigator.language) || (navigator == null ? void 0 : navigator.userLanguage) || "").substr(0, 2);
  let e = "en";
  switch (A) {
    case "zh":
      e = "zh-cn";
      break;
    case "ja":
      e = "ja_JP";
      break;
    default:
      e = "en";
  }
  return e;
}, wt = function(A) {
  return Object.prototype.toString.call(A).match(/^\[object (.*)\]$/)[1].toLowerCase();
};
function Gt(A, e, t) {
  if (!A.hasOwnProperty(e))
    return A;
  const a = {};
  return Object.keys(A).forEach((r) => {
    r === e ? a[t] = A[r] : a[r] = A[r];
  }), a;
}
function Ft(A, e) {
  return A.replace(/{{\s*(\w+)(\s*,\s*[^}]+)?\s*}}/g, (t, a) => {
    const r = a.trim();
    return e[r] !== void 0 ? String(e[r]) : t;
  });
}
const p = {
  OTHER_SIDE: "other side",
  CANCEL: "cancel",
  OTHER_SIDE_REJECT_CALL: "other side reject call",
  REJECT_CALL: "reject call",
  OTHER_SIDE_LINE_BUSY: "other side line busy",
  IN_BUSY: "in busy",
  CALL_TIMEOUT: "call timeout",
  END_CALL: "end call",
  TIMEOUT: "timeout",
  KICK_OUT: "kick out",
  CALLER_CALLING_MSG: "caller calling message",
  CALLER_GROUP_CALLING_MSG: "wait to be called",
  CALLEE_CALLING_VIDEO_MSG: "callee calling video message",
  CALLEE_CALLING_AUDIO_MSG: "callee calling audio message",
  NO_MICROPHONE_DEVICE_PERMISSION: "no microphone access",
  NO_CAMERA_DEVICE_PERMISSION: "no camera access",
  EXIST_GROUP_CALL: "exist group call",
  LOCAL_NETWORK_IS_POOR: "The network is poor during your current call",
  REMOTE_NETWORK_IS_POOR: "The other user network is poor during the current call"
}, x = {
  "zh-cn": dt
};
function X(A) {
  var a, r;
  const e = l.getData(s.CALL, i.LANGUAGE);
  let t = "";
  if (he(A))
    t = ((a = x == null ? void 0 : x[e]) == null ? void 0 : a[A]) || "";
  else if (we(A)) {
    const { key: n, options: o } = A;
    t = ((r = x == null ? void 0 : x[e]) == null ? void 0 : r[n]) || "", t = Ft(t, o);
  }
  return t;
}
const Mt = "data:audio/mpeg;base64,SUQzAwAAAAAAGFRYWFgAAAAOAAAAVFhYWABpc29taXNvMv/zNGQAAqwAvnihCAADQAF4CUAQAFYAg3Lh8u+XUD5///wx//wQOAhKAgb/////xOoH4g8Hz4Pq8RoAbdTgMsMt9hcb990EP//zNGQQBPDjEgDItAAFWcIoAYoQAN9P/03QQ//umn//91SXL5uXP+pf8WYTvzgJPAQ+p/7f///1//6f///WH///F4BtJhNFkP/zNGQGA/jjNADHiAAEQDJcAYkQAGWrn6vw6ljfPtj/////////9Pv9sL/mL/QezSepgwrimv07//////y3u602OiyhOYb+LP/zNGQIBKTBKADoCACDoCZMAckAAKHKCUIAFsqGZXtSZ/////////Sn/Vy3nVUOJBqSX2UAkQxBddzv//////yq3lcgaTmTQ//zNGQHA9SrJgA8AliD4C5IAApYAKh3FKlMunKHm8H/2//77vkdqB2xfsXaHiDKBGtFKqONF3/////Z9VXClT5ND+syHkjBq//zNGQLBITJIAA8AmQEiDI4AAjSAGa1Vffm3ff/1/0//11tvZpAaIw3dBiIrjJgHQrGVWmdBU1f/////oDqEKrV1OpBUTjQtv/zNGQHAsjDKAAwAl4D0Co8AAmCBHIQNtld6fm0+/VigZzuMnGZlkAMLMJFv/////33UIWeFQkKsaceBsangecHzYXKI//////zNGQUA4QjKAA3CAID8CpEABMCBPfuStx4FQVHYMgKcO6jIJh//////9uIlspQkGQ2YyZscAV83Bv/////ncL6BEiWHyA2K//zNEQbAogfJgAx5hAEwDJcCAsEBtICgF3/////WJaIuuqMCCVGucgkrtwiwBO//////pW4YFRWQhaRRhZZnVwGhf////+ocv/zNEQmApgVJAANjwAFkC5YCApeAolD4kQb+EQJYNKwLWGmc6sqMBwJvf////6tDEOWDgFJk1VywKMGoM2f////+N1JmgJuPv/zNGQuA4AbJAAl5hIDwC48AAIGBEho7wTL5b6kSO7IUAA5uDABYNNjGDBSJEN//////xtQsszVy27IcWBbQkLgzv7YmZYW///zNGQ2AqzFNAgcA1+D8CZIAAhMAP/3/rozCAsBjIqCY/DBWMfQZp1f/////0F6phXSNisgAJjo6icT2vpvM/Vf9v///97eu//zNGRDA4gdJgBhghIDwCZAABGMAFVWERbCdaMYNCKs///2f//QMOBhFBEL+ykPDBIJgp1sjvOMAd/////1OEsNl3MST2Q0Yf/zNGRKA2DJKAAsBWYD8Co8AAmEBLDHj+M/IhcksnAgg6G+qLIYz5etEeeW8HZsorBzgkAa1AWMPfu/////LaYPuAABp7iKXP/zNGRSA3glKgQJ6QACOCZMAAmGAYUAPF9exl35wz/9DIK2KUmQgYlTwgEEWkm3f////6IVoMJPBkKdWoQnDLurGiesVhdx6f/zNGRgAqizNAQsA20D4B5QAAmEAP/+vjlaZ1RwqBVMJYhaM4sYnFlVf/////6qAEghRzo0n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qHdqHHOAADUO7EOKUAAE8RXEAAOEQMo6qwKAeyEBJ///+Vb//ANW//92///8KH9SigwdO3T/8VO/9f/6COA4f//8PfsIGaP/0NARX//1CMt///8uB+YAAa//7FEQJAABpHdkFKOAADSAbuKAIAILIjWoYcoAIYRGtAwRwARUWcSd/h7/6f/wsYeWC/366YgCYLj3T/22c32bxMM/7WRrB/v1ylhwEMScPdPX1ajOS+LG8Tjn/8riDhP/7FGQCgABnCV4GFEAADYEbUMEIAAGwd2gcoQAAM47rg5RwAJveumxH+WvR/+DdnBer034t8WXfvR//GQZmt//0Fif///BP/+hwIa///Nf///wqXf/1IwFkb//wi3/1Pf/7FEQGAABjEVkFKKAADSOrIKOcAAKAUWQYooAAUpGswwRwAF//QA7//6iH/7//E1CP66uDpoqjowL/6/GGwzFQx/T3Vp/9XC73/yvuUKYdmmN6evmjf5L5ZKr/8hlL/f/7FGQCgAB5FF2GBKAADYOrUMEIAAGod2YcVoAANI6rg4pQAEZrqH8GxT/UqjT/+aDlf/6dvj/r/4+rR//UH//+wTMuo///86//9QGR//+wCCxv//+MCD//BP//oAIP///7FGQFAABgEdsNFKAAC2I68KOcAAMggWoYVQAAP46tAwQgAMzq//QwCv//4WM/+a0//YWHBbCL/5Hi/IAIkheLBSvsvr6F98kyv/4Zg7A3/0+pcfN//8bL5ar/+8wV/v/7FGQCgACDFF0GFKAADkQLYMCIAAGod2occoAANg7rw4pQAKbXi7oTBez1IPl9X/4G2b//1b7/r6/a/Gy//6HAX//+gDAv///nHf/xoBf//hF////ILP0V//lQuP//qP/7FGQDj/BVHVmBQC2QC6O6wDQHsgGEd2gUI4AAMA7sAopQAE8l+F//2DK3//y4f+Bj5j/+oX//8FpP///x0n//GAf//8Kf///xIcrp/ZHCA4SBM2nH8U7C55TDl+3X6P/7FGQKAADZI1uGFOAAEoRrMMKUAAGQd24cUQAANQ7sQ44gAHOZwyYabiX/9COkKb/T6rj9/09fUt+LGTgn/8YALf/+g43///kFf/zgX///UK////hxPTX/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Cl9xsv//QB///wDBOsgH11f/Lut0AUMOtP//x9gABgP/7FGQHg7BiHVoAIDuiDKO7KBQCsoFMR3ShAPBQLA7rwFAeyAA//w9f//wv8E4XP9PQKb34R//k//6gO///wIPbwsWVCQAH+vqEz/BaM//J//ooLn//zANEjecHf/1CHf/7FGQOD/BhEduo4DugDAO60CgHsgGAd2YFAazAMo8rQKAdmECUIWv//+cP//ygIPB+LdP//4XGHQKLSAB8sp9///gRz/1f/0BL//6gRf///qIW6d9Kj0GAOV6X4woKy//7FGQTgABrEV4lBEAADKO68KOcAAP0jWwYVQAAYxCsQwpQAXAtahrDftmZs3zB+574qD6cse/9MRcBIeDP8bl0EsFxX9dkG+oozcPjTz5K/v8wMJ//8BHT///QS//oA//7FGQID5BmHVsHHKAADWOq8OOIAAF0d2QGgFZAKQ7r1KAKyFl//6O3///KF8x//UG+///qE2NPghkC//nhE///xf/H//qAn//1Acd///8d//KgUb//5H///8g+jtSyH//7FGQOAABfHdqFFKAADKPLAKOIAAQMjWgYc4AIXJHs1w4gAHFZYQsxfPm9an5UMLFJFwLHfTz+qkfhO5MzGhOKAwIIAB/+eWEJo1J//8fTL//6D/EW4ur/+oa9H/+oCv/7FGQED5BpHdsHHKAADGAba+AIAAFcd2YGgLZAKo6rgKAeyD////OKgAACgCAPywNf5D/5H/+weG//+MQ/8LHf/ygKW//+RlvQFP/fKAv///CIhp///K//rOB7v//4h//7FGQKgABlHVoFHOAADYO60KacAAPgjWoYdQAISRGsgw4gAP//+Fm0fS6nKwoLipAoLfN6ZzRJELiHPPAuT6+iakSfJZnKgP/5YuIHOM/1+iY2D/T/g1+P8JX/+YA////7FGQCj/BlHdwHFOAADIPLAOEcAAF4d2YFAPZAMg7qwNAqyPmhCX///8o//9Rf//4UZ///+KyK//yoTv//oAYJ3xAd//RBYf/+6yOUX8EZ6gg//wL//+ERD/5DR//EAv/7FGQHgABdEdwNFOAADWPLEKKUAANkkWgYJoAAPhAtQwQgAN///UL///+Ii+v/tYFRj/fl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x8M//yv/7FGQNj/BiHdmADRLQDGO6wDQHsgFsd2IGgLZAMQ7rQNAeyIQP//6wg0fhRv/1mQLN///kgf+B5ar/+4S//+gFF//hzs//j4g///CTf//+EfMf83FZYDzhSL86ui0F+f/7FGQTAABcEdsFFKAADOO68KOUAAPkjWwYdQAAVBGsgwpQAQBawuFYDq/7TfrP4+LkRyRyr/8LYRr/0+NLg6Tfr0/NJzlKyxa42v6c8KFwOMLjHrxdn4zEPgqSLBOuzf/7FGQKgAC8FVuGHUAAFsKK8MOcAAF4A3CcAQAoMYBqQ4AAABE+n/8TlxQXC3/NyligMxJw2zb4osIIuKrAH+c4H/83QUFBcgrxKCrlHvg0DT//iIO1TEFNRTMuMTAwVQ==";
class yt {
  constructor() {
    this._bellContext = null, this._isMuteBell = !1, this._calleeBellFilePath = be, this._callRole = G.UNKNOWN, this._callStatus = h.IDLE, this._handleAudioInterruptionBegin = async () => {
      await this.stop();
    }, this._handleAudioInterruptionEnd = async () => {
      this._callStatus !== h.CALLING ? await this.stop() : await this.play();
    }, this._bellContext = wx.createInnerAudioContext(), this._addListenBellContextEvent(), this._bellContext.loop = !0;
  }
  setBellSrc() {
    const e = wx.getFileSystemManager();
    try {
      let t = Mt;
      this._callRole === G.CALLEE && (t = this._calleeBellFilePath || be), e.readFileSync(t, "utf8", 0), this._bellContext.src = t;
    } catch (t) {
      console.warn(`${i.PREFIX}Failed to setBellSrc, ${t}`);
    }
  }
  setBellProperties(e) {
    this._callRole = e.callRole || this._callRole, this._callStatus = e.callStatus || this._callStatus, this._calleeBellFilePath = e.calleeBellFilePath || this._calleeBellFilePath, this._isMuteBell = fe(e.isMuteBell) ? this._isMuteBell : e.isMuteBell;
  }
  async play() {
    try {
      if (this._callStatus !== h.CALLING)
        return;
      this.setBellSrc(), this._callRole === G.CALLEE && !this._isMuteBell && await this._bellContext.play(), this._callRole === G.CALLER && await this._bellContext.play();
    } catch (e) {
      console.warn(`${i.PREFIX}Failed to play audio file, ${e}`);
    }
  }
  async stop() {
    try {
      this._bellContext.stop();
    } catch (e) {
      console.warn(`${i.PREFIX}Failed to stop audio file, ${e}`);
    }
  }
  async setBellMute(e) {
    this._callStatus !== h.CALLING && this._callRole !== G.CALLEE || (e ? await this.stop() : await this.play());
  }
  destroy() {
    try {
      this._isMuteBell = !1, this._calleeBellFilePath = "", this._callRole = G.UNKNOWN, this._callStatus = h.IDLE, this == null || this._removeListenBellContextEvent(), this._bellContext.destroy(), this._bellContext = null;
    } catch (e) {
      console.warn(`${i.PREFIX}Failed to destroy, ${e}`);
    }
  }
  _addListenBellContextEvent() {
    wx.onAudioInterruptionBegin(this._handleAudioInterruptionBegin), wx.onAudioInterruptionEnd(this._handleAudioInterruptionEnd);
  }
  _removeListenBellContextEvent() {
    wx.offAudioInterruptionBegin(this._handleAudioInterruptionBegin), wx.offAudioInterruptionEnd(this._handleAudioInterruptionEnd);
  }
}
function N() {
  return function(A, e, t) {
    const a = t.value, r = /* @__PURE__ */ new Set();
    return t.value = async function(...n) {
      var o, I;
      if (r.has(this)) {
        console.warn(`${i.PREFIX}previous ${e}() is ongoing, please avoid repeated calls`), (I = (o = this == null ? void 0 : this.getTUICallEngineInstance()) == null ? void 0 : o.reportLog) == null || I.call(o, {
          name: "TUICallKit.avoidRepeatedCall.fail",
          data: { name: e },
          error: `previous ${e}() is ongoing`
        });
        return;
      }
      try {
        r.add(this);
        const c = await a.apply(this, n);
        return r.delete(this), c;
      } catch (c) {
        throw r.delete(this), c;
      }
    }, t;
  };
}
const te = i.PREFIX + "API";
function y(A) {
  return function(e, t, a) {
    let r = a.value;
    return a.value = function(...n) {
      return Pt.call(this, A, n, t), r.apply(this, n);
    }, a;
  };
}
function Pt(A, e, t) {
  try {
    if (e[0].SDKAppID || (A = Gt(A, "SDKAppID", "sdkAppID")), et(A))
      for (let a = 0; a < A.length; a++)
        ke.call(this, {
          ...A[a],
          value: e[a],
          name: t
        });
    else
      for (const a in A)
        A.hasOwnProperty(a) && ke.call(this, {
          ...A[a],
          value: e[0][a],
          name: t,
          key: a
        });
  } catch (a) {
    throw console.error(a), a;
  }
}
function ke({ required: A, rules: e, range: t, value: a, allowEmpty: r, name: n, key: o }) {
  if (fe(a)) {
    if (A)
      throw new Error(`${te}<${n}>: ${o} is required.`);
    return;
  }
  const I = e.some((L) => L === wt(a));
  let c = "";
  if (!I) {
    for (let L = 0; L < e.length; L++) {
      let E = e[L];
      E = E.replace(E[0], E[0].toUpperCase()), c += `${E}/`;
    }
    throw c = c.substring(0, c.length - 1), new Error(`${te}<${n}>: ${o} must be ${c}, current ${o} is ${typeof a}.`);
  }
  if (r === !1 && he(a) && a.trim() === "")
    throw new Error(`${te}<${n}>: ${o} is blank.`);
  if (et(t) && t && t.indexOf(a) === -1)
    throw new Error(`${te}<${n}>: ${o} error, only be ${t}, current ${o} is ${a}.`);
  if (he(t) && t.indexOf("~") !== -1) {
    const L = t.split("~");
    if (a < +L[0] || a > +L[1] || tt(a) && Number.isNaN(a))
      throw new Error(`${te}<${n}>: ${o} error, only be ${t}, current ${o} is ${a}.`);
  }
}
const P = {
  init: {
    SDKAppID: {
      required: !0,
      rules: [i.NUMBER],
      allowEmpty: !1
    },
    userID: {
      required: !0,
      rules: [i.STRING],
      allowEmpty: !1
    },
    userSig: {
      required: !0,
      rules: [i.STRING],
      allowEmpty: !1
    },
    tim: {
      required: !1,
      rules: [i.OBJECT]
    }
  },
  call: {
    userID: {
      required: !0,
      rules: [i.STRING],
      allowEmpty: !1
    },
    type: {
      required: !0,
      rules: [i.NUMBER],
      range: [1, 2],
      allowEmpty: !1
    },
    roomID: {
      required: !1,
      rules: [i.NUMBER],
      // 仅支持数字房间号, 后续会支持字符串房间号
      range: `0~${ve}`,
      allowEmpty: !1
    },
    strRoomID: {
      required: !1,
      rules: [i.STRING],
      allowEmpty: !0
    },
    userData: {
      required: !1,
      rules: [i.STRING],
      allowEmpty: !1
    },
    timeout: {
      required: !1,
      rules: [i.NUMBER],
      allowEmpty: !1
    }
  },
  groupCall: {
    userIDList: {
      required: !0,
      rules: [i.ARRAY],
      allowEmpty: !1
    },
    type: {
      required: !0,
      rules: [i.NUMBER],
      range: [1, 2],
      allowEmpty: !1
    },
    groupID: {
      required: !0,
      rules: [i.STRING],
      allowEmpty: !1
    },
    roomID: {
      required: !1,
      rules: [i.NUMBER],
      // 仅支持数字房间号, 后续会支持字符串房间号
      range: `0~${ve}`,
      allowEmpty: !1
    },
    strRoomID: {
      required: !1,
      rules: [i.STRING],
      allowEmpty: !0
    },
    timeout: {
      required: !1,
      rules: [i.NUMBER],
      allowEmpty: !1
    },
    userData: {
      required: !1,
      rules: [i.STRING],
      allowEmpty: !1
    },
    offlinePushInfo: {
      required: !1,
      rules: [i.OBJECT],
      allowEmpty: !1
    }
  },
  joinInGroupCall: {
    type: {
      required: !0,
      rules: [i.NUMBER],
      range: [1, 2],
      allowEmpty: !1
    },
    groupID: {
      required: !0,
      rules: [i.STRING],
      allowEmpty: !1
    },
    roomID: {
      required: !0,
      rules: [i.NUMBER],
      allowEmpty: !1
    },
    strRoomID: {
      required: !1,
      rules: [i.STRING],
      allowEmpty: !0
    }
  },
  inviteUser: {
    userIDList: {
      required: !0,
      rules: [i.ARRAY],
      allowEmpty: !1
    }
  },
  setSelfInfo: {
    nickName: {
      required: !1,
      rules: [i.STRING],
      allowEmpty: !1
    },
    avatar: {
      required: !1,
      rules: [i.STRING],
      allowEmpty: !1
    }
  },
  enableFloatWindow: [
    {
      key: "enable",
      required: !1,
      rules: [i.BOOLEAN],
      allowEmpty: !1
    }
  ],
  enableAIVoice: [
    {
      key: "enable",
      required: !0,
      rules: [i.BOOLEAN],
      allowEmpty: !1
    }
  ],
  enableMuteMode: [
    {
      key: "enable",
      required: !0,
      rules: [i.BOOLEAN],
      allowEmpty: !1
    }
  ],
  setCallingBell: [
    {
      key: "filePath",
      required: !1,
      rules: [i.STRING],
      allowEmpty: !0
    }
  ],
  setLanguage: [
    {
      key: "language",
      required: !0,
      rules: [i.STRING],
      allowEmpty: !1
    }
  ],
  setVideoDisplayMode: [
    {
      key: "displayMode",
      required: !0,
      rules: [i.STRING],
      range: [ne.CONTAIN, ne.COVER, ne.FILL],
      allowEmpty: !1
    }
  ],
  setVideoResolution: [
    {
      key: "resolution",
      required: !0,
      rules: [i.STRING],
      range: [oe.RESOLUTION_1080P, oe.RESOLUTION_480P, oe.RESOLUTION_720P],
      allowEmpty: !1
    }
  ]
};
function q(A) {
  return function(e, t, a) {
    let r = a.value;
    return a.value = function(...n) {
      return Qt.call(this, A, n, t), r.apply(this, n);
    }, a;
  };
}
function Qt(A) {
  if (A != null && A.engineInstance && !this._tuiCallEngine) {
    const e = `${i.PREFIX} ${X("TUICallKit init is not complete")}`;
    throw console.error(e), e;
  }
}
function ge(A) {
  if (typeof A != "object" || A === null)
    return A;
  let e = Array.isArray(A) ? [] : {};
  for (let t in A)
    A.hasOwnProperty(t) && (e[t] = ge(A[t]));
  return e;
}
class vt {
  constructor() {
    this.defaultStore = {
      callStatus: h.IDLE,
      callRole: G.UNKNOWN,
      callMediaType: d.UNKNOWN,
      localUserInfo: { userId: "" },
      localUserInfoExcludeVolume: { userId: "" },
      remoteUserInfoList: [],
      remoteUserInfoExcludeVolumeList: [],
      callerUserInfo: { userId: "" },
      isGroup: !1,
      callDuration: "00:00:00",
      // 通话时长
      callTips: "",
      // 通话提示的信息. 例如: '等待谁接听', 'xxx 拒绝通话', 'xxx 挂断通话'
      toastInfo: { text: "" },
      // 远端用户挂断、拒绝、超时、忙线等的 toast 提示信息
      isMinimized: !1,
      // 用来记录当前是否悬浮窗模式
      enableFloatWindow: !1,
      // 开启/关闭悬浮窗功能,设置为false,通话界面左上角的悬浮窗按钮会隐藏
      bigScreenUserId: "",
      // 当前大屏幕显示的 userID 用户
      language: pt(),
      // en, zh-cn
      isClickable: !1,
      // 是否可点击, 用于按钮增加 loading 效果,不可点击
      deviceList: { cameraList: [], microphoneList: [], currentCamera: {}, currentMicrophone: {} },
      showPermissionTip: !1,
      netWorkQualityList: [],
      // 显示网络状态差的提示
      isMuteSpeaker: !1,
      callID: "",
      // callEngine 3.1 support
      groupID: "",
      roomID: 0,
      roomIdType: 0,
      cameraPosition: b.FRONT,
      // 前置或后置,值为front, back
      groupCallMembers: [],
      // chat 群会话在的通话中的成员
      // TUICallKit 组件上的属性
      displayMode: ne.COVER,
      // 设置预览远端的画面显示模式
      videoResolution: oe.RESOLUTION_720P,
      showSelectUser: !1,
      // 小程序相关属性
      pusher: {},
      player: [],
      isEarPhone: !1,
      // 是否是听筒, 默认: false
      pusherId: i.INITIAL_PUSHER,
      // 重新渲染 live-Pusher 的标识位
      // 是否开启虚拟背景, 目前仅 web 支持
      isShowEnableVirtualBackground: !1,
      // 是否显示虚拟背景图标, 默认: false
      enableVirtualBackground: !1,
      // 是否开启虚拟背景, 默认: false
      // customUIConfig
      customUIConfig: {
        button: {},
        viewBackground: {},
        layoutMode: Je.RemoteInLargeView
      },
      // translate function
      translate: X,
      isForceUseV2API: !1
    }, this.store = ge(this.defaultStore), this.prevStore = ge(this.defaultStore);
  }
  update(e, t) {
    switch (e) {
      case i.CALL_TIPS:
        const a = this.getData(e);
        this.prevStore[e] = a;
      default:
        this.store[e] = t;
    }
  }
  getPrevData(e) {
    return e ? this.prevStore[e] : this.prevStore;
  }
  getData(e) {
    return e ? this.store[e] : this.store;
  }
  // reset call store
  reset(e = []) {
    e.length === 0 && (e = Object.keys(this.store));
    const t = e.reduce((a, r) => ({ ...a, [r]: this.defaultStore[r] }), {});
    this.store = {
      ...this.defaultStore,
      ...this.store,
      ...t
    };
  }
}
let De = class re {
  constructor() {
    this.timerId = -1, this.storeMap = {
      [s.CALL]: new vt()
    }, this.task = {};
  }
  /**
   * 获取 TUIStore 实例
   * @returns {TUIStore}
  */
  static getInstance() {
    return re.instance || (re.instance = new re()), re.instance;
  }
  /**
   * UI 组件注册监听回调
   * @param {StoreName} storeName store 名称
   * @param {IOptions} options 监听信息
   * @param {Object} params 扩展参数
   * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知
  */
  watch(e, t, a) {
    this.task[e] || (this.task[e] = {});
    const r = this.task[e];
    Object.keys(t).forEach((n) => {
      const o = t[n];
      r[n] || (r[n] = /* @__PURE__ */ new Map()), r[n].set(o, 1);
      const { notifyRangeWhenWatch: I } = a || {};
      if (I === i.ALL && this.notify(e, n), I === i.MYSELF) {
        const c = this.getData(e, n);
        o.call(this, c);
      }
    });
  }
  /**
   * UI 取消组件监听回调
   * @param {StoreName} storeName store 名称
   * @param {IOptions} options 监听信息,包含需要取消的回掉等
   */
  unwatch(e, t) {
    if (!this.task[e])
      return;
    const a = this.task[e];
    Object.keys(t).forEach((r) => {
      a[r].delete(t[r]);
    });
  }
  /**
   * 通用 store 数据更新,messageList 的变更需要单独处理
   * @param {StoreName} storeName store 名称
   * @param {string} key 变更的 key
   * @param {unknown} data 变更的数据
  */
  update(e, t, a) {
    var r;
    (he(a) || tt(a) || Rt(a)) && this.storeMap[e].store[t] === a || ((r = this.storeMap[e]) == null || r.update(t, a), this.notify(e, t));
  }
  /**
   * 获取 Store 的上一个状态值
   * @param {StoreName} storeName store 名称
   * @param {string} key 待获取的 key
   * @returns {Any}
  */
  getPrevData(e, t) {
    var a;
    return (a = this.storeMap[e]) == null ? void 0 : a.getPrevData(t);
  }
  /**
   * 获取 Store 数据
   * @param {StoreName} storeName store 名称
   * @param {string} key 待获取的 key
   * @returns {Any}
  */
  getData(e, t) {
    var a;
    return (a = this.storeMap[e]) == null ? void 0 : a.getData(t);
  }
  /**
   * UI 组件注册监听回调
   * @param {StoreName} storeName store 名称
   * @param {string} key 变更的 key
  */
  notify(e, t) {
    if (!this.task[e])
      return;
    const a = this.task[e];
    if (a[t]) {
      const r = a[t], n = this.getData(e, t);
      for (const [o] of r.entries())
        o.call(this, n);
    }
  }
  reset(e, t = [], a = !1) {
    if (e in this.storeMap) {
      const r = this.storeMap[e];
      t.length === 0 && (t = Object.keys(r == null ? void 0 : r.store)), r.reset(t), a && t.forEach((n) => {
        this.notify(e, n);
      });
    }
  }
  // 批量修改多个 key-value
  updateStore(e, t) {
    const a = t || s.CALL;
    Object.keys(e).forEach((r) => {
      this.update(a, r, e[r]);
    });
  }
};
const B = De.getInstance();
function Ne(A, e) {
  const t = {
    userId: A,
    nick: "",
    avatar: "",
    remark: "",
    displayUserInfo: "",
    isAudioAvailable: !1,
    isVideoAvailable: !1,
    isEnter: !1,
    domId: e || A
  };
  return e ? t : { ...t, isEnter: !1 };
}
async function mt(A, e) {
  var a, r, n, o, I;
  let t = Ne(A, i.LOCAL_VIDEO);
  try {
    if (!e)
      return t;
    const c = await e.getMyProfile(), L = B == null ? void 0 : B.getData(s.CALL, i.LOCAL_USER_INFO);
    return (c == null ? void 0 : c.code) === 0 && (t = {
      ...t,
      ...L,
      userId: (a = c == null ? void 0 : c.data) == null ? void 0 : a.userID,
      nick: (r = c == null ? void 0 : c.data) == null ? void 0 : r.nick,
      avatar: (n = c == null ? void 0 : c.data) == null ? void 0 : n.avatar,
      displayUserInfo: ((o = c == null ? void 0 : c.data) == null ? void 0 : o.nick) || ((I = c == null ? void 0 : c.data) == null ? void 0 : I.userID)
    }), t;
  } catch (c) {
    return console.error(`${i.PREFIX}getMyProfile failed, error: ${c}.`), t;
  }
}
async function le(A, e) {
  let t = A.map((a) => Ne(a));
  try {
    if (!e)
      return t;
    const a = await e.getFriendProfile({ userIDList: A });
    if (a.code === 0) {
      const { friendList: r = [], failureUserIDList: n = [] } = a.data;
      let o = n.map((E) => E.userID);
      if (n.length > 0) {
        const E = await e.getUserProfile({ userIDList: n.map((g) => g.userID) });
        (E == null ? void 0 : E.code) === 0 && (o = (E == null ? void 0 : E.data) || []);
      }
      const I = B == null ? void 0 : B.getData(s.CALL, i.REMOTE_USER_INFO_LIST), c = r.map((E) => E.userID), L = o.map((E) => E.userID);
      t = A.map((E) => {
        var j, Z, $, H, Ge, Fe, Me;
        const g = Ne(E), _ = c.indexOf(E), S = L.indexOf(E);
        let U = "", T = "", Q = "", O = "";
        _ !== -1 && (U = ((j = r[_]) == null ? void 0 : j.remark) || "", T = (($ = (Z = r[_]) == null ? void 0 : Z.profile) == null ? void 0 : $.nick) || "", Q = U || T || g.userId || "", O = ((Ge = (H = r[_]) == null ? void 0 : H.profile) == null ? void 0 : Ge.avatar) || ""), S !== -1 && (T = ((Fe = o[S]) == null ? void 0 : Fe.nick) || "", Q = T || g.userId || "", O = ((Me = o[S]) == null ? void 0 : Me.avatar) || "");
        const ce = I.find((At) => At.userId === E) || {};
        return { ...g, ...ce, remark: U, nick: T, displayUserInfo: Q, avatar: O };
      });
    }
    return t;
  } catch (a) {
    return console.error(`${i.PREFIX}getRemoteUserProfile failed, error: ${a}.`), t;
  }
}
function Ee() {
  const A = B.getData(s.CALL, i.CALL_STATUS);
  if (A === h.IDLE)
    return M.IDLE;
  const e = B.getData(s.CALL, i.IS_GROUP);
  if (A === h.CALLING)
    return e ? M.DIALING_GROUP : M.DIALING_C2C;
  const t = B.getData(s.CALL, i.CALL_MEDIA_TYPE);
  return e ? t === d.AUDIO ? M.CALLING_GROUP_AUDIO : M.CALLING_GROUP_VIDEO : t === d.AUDIO ? M.CALLING_C2C_AUDIO : M.CALLING_C2C_VIDEO;
}
async function Vt(A, e, t, a) {
  let r = [];
  try {
    const n = await e.getGroupMemberList({ groupID: A, count: t, offset: a });
    if (n.code === 0)
      return n.data.memberList || r;
  } catch (n) {
    return console.error(`${i.PREFIX}getGroupMember failed, error: ${n}.`), r;
  }
}
async function Kt(A, e) {
  let t = {};
  try {
    return (await e.getGroupProfile({ groupID: A })).data.group || t;
  } catch (a) {
    return console.warn(`${i.PREFIX}getGroupProfile failed, error: ${a}.`), t;
  }
}
function at(A, e) {
  A === 0 && e ? (B.update(s.CALL, i.ROOM_ID, e), B.update(s.CALL, i.ROOM_ID_TYPE, Re.STRING_ROOM_ID)) : (B.update(s.CALL, i.ROOM_ID, A), B.update(s.CALL, i.ROOM_ID_TYPE, Re.NUMBER_ROOM_ID));
}
function F(A) {
  return A || {};
}
function Ue(A) {
  if (A.length === 0)
    return;
  let e = B.getData(s.CALL, i.REMOTE_USER_INFO_LIST);
  A.forEach((t) => {
    e = e.filter((a) => a.userId !== t);
  }), B.update(s.CALL, i.REMOTE_USER_INFO_LIST, e), B.update(s.CALL, i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, e);
}
function Be(A, e, t) {
  let a = "";
  Tt(A) && (e === d.AUDIO && (a = p.NO_MICROPHONE_DEVICE_PERMISSION), e === d.VIDEO && (a = p.NO_CAMERA_DEVICE_PERMISSION), a && B.update(s.CALL, i.TOAST_INFO, { content: a, type: i.ERROR }), console.error(`${i.PREFIX}call failed, error: ${A.message}.`));
}
function m(A, e) {
  let t = B.getData(s.CALL, i.LOCAL_USER_INFO);
  e === i.AUDIO && (t = { ...t, isAudioAvailable: A }), e === i.VIDEO && (t = { ...t, isVideoAvailable: A }), B.update(s.CALL, i.LOCAL_USER_INFO, t), B.update(s.CALL, i.LOCAL_USER_INFO_EXCLUDE_VOLUMN, t);
}
const _e = class _e {
  static generateTaskID() {
    return this.currentTaskID++;
  }
  /**
   *
   * @param {string} taskName 'interval' 'timeout'
   * @param {function} callback
   * @param {object} options include:
   * @param {number} options.delay millisecond
   * @param {number} options.count 定时器回调执行次数,0 无限次 or n次
   * @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器
   */
  static run(e = i.TIMEOUT, t, a) {
    e === i.INTERVAL ? a = { delay: 2e3, count: 0, backgroundTask: !0, ...a } : a = { delay: 2e3, count: 0, backgroundTask: !0, ...a }, we(t) && (a = { ...a, ...t }), Ce(e) && (t = e, e = i.TIMEOUT);
    const r = {
      taskID: this.generateTaskID(),
      loopCount: 0,
      intervalID: null,
      timeoutID: null,
      taskName: e,
      callback: t,
      ...a
    };
    return this.taskMap.set(r.taskID, r), e === i.INTERNAL ? this.interval(r) : this.timeout(r), r.taskID;
  }
  /**
   * 定时循环执行回调函数
   * 可以指定循环的时间间隔
   * 可以指定循环次数
   * @param {object} taskItem
   * @param {function} callback
   * @param {*} delay
   * @param {*} count
   * @returns ID
   */
  static interval(e) {
    const t = () => {
      e.callback(), e.loopCount += 1, this.isBreakLoop(e);
    };
    return e.intervalID = setInterval(t, e.delay);
  }
  /**
   * 延迟执行回调
   * count = 0,循环
   * count = n, 执行n次
   * @param {object} taskItem
   *
   */
  static timeout(e) {
    const t = () => {
      if (e.callback(), e.loopCount += 1, !this.isBreakLoop(e))
        return e.timeoutID = setTimeout(t, e.delay);
    };
    return e.timeoutID = setTimeout(t, e.delay);
  }
  static hasTask(e) {
    return this.taskMap.has(e);
  }
  static clearTask(e) {
    if (!this.taskMap.has(e))
      return !0;
    const { intervalID: t, timeoutID: a, onVisibilitychange: r } = this.taskMap.get(e);
    return t && clearInterval(t), a && clearTimeout(a), r && document.removeEventListener("visibilitychange", r), this.taskMap.delete(e), !0;
  }
  /**
   * 1. 如果已移除出定时队列,退出当前任务
   * 2. 如果当前任务已满足次数限制,则退出当前任务
   * @param {object} taskItem
   * @returns
   */
  static isBreakLoop(e) {
    return this.taskMap.has(e.taskID) ? e.count !== 0 && e.loopCount >= e.count ? (this.clearTask(e.taskID), !0) : !1 : !0;
  }
};
_e.taskMap = /* @__PURE__ */ new Map(), _e.currentTaskID = 1;
let de = _e;
const bt = function(A) {
  if (A === null || typeof A > "u")
    return !0;
  if (typeof A == "boolean")
    return !1;
  if (typeof A == "number")
    return A === 0;
  if (typeof A == "string" || typeof A == "function" || Array.isArray(A))
    return A.length === 0;
  if (A instanceof Error)
    return A.message === "";
  if (we(A)) {
    for (const e in A)
      if (Object.prototype.hasOwnProperty.call(A, e))
        return !1;
    return !0;
  }
  return !1;
}, Oe = "_local_user_id";
class k {
  constructor() {
    this._viewConfig = {
      viewBackground: {
        local: {},
        remote: {}
      }
    }, this._isSetViewBackgroundConfig = { remote: !1, local: !1 }, this._tuiCallEngine = null, this._tuiStore = null;
  }
  static getInstance() {
    return k.instance || (k.instance = new k()), k.instance;
  }
  _updateViewBackground() {
    var a, r, n;
    const e = (a = this._tuiStore) == null ? void 0 : a.getData(s.CALL, i.CUSTOM_UI_CONFIG), { userId: t } = (r = this._tuiStore) == null ? void 0 : r.getData(s.CALL, i.LOCAL_USER_INFO);
    Object.keys(this._viewConfig.viewBackground.remote).includes(t) && delete this._viewConfig.viewBackground.remote[t], (n = this._tuiStore) == null || n.update(
      s.CALL,
      i.CUSTOM_UI_CONFIG,
      {
        ...e,
        viewBackground: {
          ...this._viewConfig.viewBackground.remote,
          ...this._viewConfig.viewBackground.local
        }
      }
    );
  }
  setEngineInstance(e) {
    this._tuiCallEngine = e;
  }
  setTUIStore(e) {
    this._tuiStore = e;
  }
  updateViewBackgroundUserId(e) {
    var t, a;
    if (e === "local") {
      const { userId: r } = (t = this._tuiStore) == null ? void 0 : t.getData(s.CALL, i.LOCAL_USER_INFO);
      if (Object.keys(this._viewConfig.viewBackground.remote).includes(r) && (delete this._viewConfig.viewBackground.remote[r], this._updateViewBackground()), !this._isSetViewBackgroundConfig.local)
        return;
      const n = this._viewConfig.viewBackground.local, o = n[r] || n[Oe];
      n[r] = n[Oe], this._viewConfig.viewBackground.local = { [r]: o }, this._updateViewBackground();
    } else {
      let r = this._viewConfig.viewBackground.remote;
      this._isSetViewBackgroundConfig.remote && Object.keys(r).includes("*") && (((a = this._tuiStore) == null ? void 0 : a.getData(s.CALL, i.REMOTE_USER_INFO_LIST)).map((I) => I.userId).forEach((I) => {
        Object.keys(r).includes(I) || (r[I] = r["*"]);
      }), this._viewConfig.viewBackground.remote = r, this._updateViewBackground());
    }
  }
  hideFeatureButton(e) {
    var a, r, n, o, I;
    (r = (a = this._tuiCallEngine) == null ? void 0 : a.reportLog) == null || r.call(a, {
      name: "TUICallKit.hideFeatureButton.start",
      data: { buttonName: e }
    });
    const t = (n = this._tuiStore) == null ? void 0 : n.getData(s.CALL, i.CUSTOM_UI_CONFIG);
    (I = this._tuiStore) == null || I.update(
      s.CALL,
      i.CUSTOM_UI_CONFIG,
      {
        ...t,
        button: {
          ...t.button,
          [e]: { ...((o = t.button) == null ? void 0 : o[e]) || {}, show: !1 }
        }
      }
    );
  }
  setLocalViewBackgroundImage(e) {
    var a, r, n;
    (r = (a = this._tuiCallEngine) == null ? void 0 : a.reportLog) == null || r.call(a, {
      name: "TUICallKit.setLocalViewBackgroundImage.start",
      data: { url: e }
    }), this._isSetViewBackgroundConfig.local = !0;
    let { userId: t } = (n = this._tuiStore) == null ? void 0 : n.getData(s.CALL, i.LOCAL_USER_INFO);
    bt(t) && (t = Oe), this._viewConfig.viewBackground.local = { [t]: e }, this._updateViewBackground();
  }
  setRemoteViewBackgroundImage(e, t) {
    var a, r;
    (r = (a = this._tuiCallEngine) == null ? void 0 : a.reportLog) == null || r.call(a, {
      name: "TUICallKit.setRemoteViewBackgroundImage.start",
      data: { userId: e, url: t }
    }), this._isSetViewBackgroundConfig.remote = !0, e === "*" && (this._viewConfig.viewBackground.remote = {}), this._viewConfig.viewBackground.remote[e] = t, this._updateViewBackground();
  }
  setLayoutMode(e) {
    var a, r;
    (r = (a = this._tuiCallEngine) == null ? void 0 : a.reportLog) == null || r.call(a, {
      name: "TUICallKit.setLayoutMode.start",
      data: { layoutMode: e }
    });
    const t = this._tuiStore.getData(s.CALL, i.CUSTOM_UI_CONFIG);
    this._tuiStore.update(
      s.CALL,
      i.CUSTOM_UI_CONFIG,
      {
        ...t,
        layoutMode: e
      }
    );
  }
  setCameraDefaultState(e) {
    var a, r;
    (r = (a = this._tuiCallEngine) == null ? void 0 : a.reportLog) == null || r.call(a, {
      name: "TUICallKit.setCameraDefaultState.start",
      data: { isOpen: e }
    });
    const t = ge(this._tuiStore.getData(s.CALL, i.CUSTOM_UI_CONFIG));
    Object.keys(t.button).includes(Y.Camera) || (t.button[Y.Camera] = {}), t.button[Y.Camera].state = e ? z.Open : z.Close, this._tuiStore.update(s.CALL, i.CUSTOM_UI_CONFIG, t);
  }
}
const ie = De.getInstance(), v = {
  audioCall: () => "Voice call",
  videoCall: () => "Video call",
  switchToAudio: () => "Switch audio call",
  switchToVideo: () => "Switch video call",
  hangup: ({ callDuration: A }) => `${X("Call duration")}:${A}`
};
class W {
  constructor(e) {
    var t, a, r;
    this._callService = e.callService, ee.registerEvent(R.TUILogin.EVENT.LOGIN_STATE_CHANGED, R.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS, this), (t = R.TUIChat) != null && t.EVENT && ee.registerEvent((a = R.TUIChat.EVENT) == null ? void 0 : a.CHAT_STATE_CHANGED, (r = R.TUIChat.EVENT_SUB_KEY) == null ? void 0 : r.CHAT_OPENED, this), ee.registerService(R.TUICalling.SERVICE.NAME, this), ee.registerExtension(R.TUIChat.EXTENSION.INPUT_MORE.EXT_ID, this);
  }
  static getInstance(e) {
    return W.instance || (W.instance = new W(e)), W.instance;
  }
  // ================ 【】 ================
  /**
   * message on screen
   * @param {Any} params Parameters for message up-screening
   */
  callTUIService(e) {
    const { message: t } = e || {};
    ee.callService({
      serviceName: R.TUIChat.SERVICE.NAME,
      method: R.TUIChat.SERVICE.METHOD.UPDATE_MESSAGE_LIST,
      params: { message: t }
    });
  }
  /**
   * tuicore getExtension
   * @param {String} extensionID extension id
   * @param {Any} params tuicore pass parameters
   * @returns {Any[]} return extension
   */
  onGetExtension(e, t) {
    var a, r;
    if (e === R.TUIChat.EXTENSION.INPUT_MORE.EXT_ID) {
      if ((r = (a = this._callService.getTUICallEngineInstance()) == null ? void 0 : a.reportLog) == null || r.call(a, { name: "TUICallKit.onGetExtension", data: { extensionID: e, params: t } }), fe(t))
        return [];
      if ([R.TUIChat.TYPE.ROOM, R.TUIChat.TYPE.CUSTOMER_SERVICE].includes(t.chatType))
        return [];
      let n = [];
      const o = {
        weight: 1e3,
        text: "语音通话",
        icon: It,
        data: {
          name: "voiceCall"
        },
        listener: {
          onClicked: async (c) => await this._handleTUICoreOnClick(c, c.type || d.AUDIO)
        }
      }, I = {
        weight: 900,
        text: "视频通话",
        icon: Et,
        data: {
          name: "videoCall"
        },
        listener: {
          onClicked: async (c) => await this._handleTUICoreOnClick(c, c.type || d.VIDEO)
        }
      };
      return t != null && t.chatType ? n = [o, I] : (!(t != null && t.filterVoice) && n.push(o), !(t != null && t.filterVideo) && n.push(I)), n;
    }
  }
  async onCall(e, t) {
    e === R.TUICalling.SERVICE.METHOD.START_CALL && await this._handleTUICoreOnClick(t, t.type);
  }
  /**
   * tuicore notify event manager
   * @param {String} eventName event name
   * @param {String} subKey sub key
   * @param {Any} options tuicore event parameters
   */
  async onNotifyEvent(e, t, a) {
    var r, n, o, I, c, L, E, g;
    try {
      if (e === R.TUILogin.EVENT.LOGIN_STATE_CHANGED)
        if (t === R.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS) {
          const { chat: _, userID: S, userSig: U, SDKAppID: T } = nt.getContext();
          await ((r = this._callService) == null ? void 0 : r.init({ tim: _, userID: S, userSig: U, sdkAppID: T, isFromChat: !0, component: Te.TIM_CALL_KIT })), (n = this._callService) == null || n.setIsFromChat(!0), (o = this._callService) == null || o.setLogLevel(We.NORMAL), this._addListenChatEvent();
        } else
          t === R.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS && (this._removeListenChatEvent(), await ((I = this._callService) == null ? void 0 : I.destroyed()));
      if ((c = R.TUIChat) != null && c.EVENT && e === R.TUIChat.EVENT.CHAT_STATE_CHANGED && t === R.TUIChat.EVENT_SUB_KEY.CHAT_OPENED) {
        if ((L = this._callService) == null || L.setCurrentGroupId((a == null ? void 0 : a.groupID) || ""), ie.getData(s.CALL, i.CALL_STATUS) !== h.IDLE)
          return;
        const _ = (E = this._callService) == null ? void 0 : E.getCurrentGroupId(), S = _ ? await this.getGroupAttributes((g = this._callService) == null ? void 0 : g.getTim(), _) : {};
        await this.updateStoreBasedOnGroupAttributes(S);
      }
    } catch (_) {
      console.error(`${i.PREFIX}TUICore onNotifyEvent failed, error: ${_}.`);
    }
  }
  // Handling the chat+call scenario, data required for the joinInGroupCall API: update store / clear relevant store data
  async updateStoreBasedOnGroupAttributes(e) {
    var t, a, r, n;
    (r = (a = (t = this._callService) == null ? void 0 : t.getTUICallEngineInstance()) == null ? void 0 : a.reportLog) == null || r.call(a, {
      name: "TUICallKit.getJoinGroupCallInfo.success",
      data: { groupAttributes: e }
    });
    try {
      const {
        call_id: o = "",
        // callEngine v3.1 support
        group_id: I = "",
        room_id: c = 0,
        room_id_type: L = 0,
        call_media_type: E = i.UNKNOWN,
        // @ts-ignore
        user_list: g
        // The default value of the user list returned by the background is null
      } = e[i.INNER_ATTR_KIT_INFO] ? JSON.parse(e[i.INNER_ATTR_KIT_INFO]) : {};
      let _ = (g || []).map((U) => U.userid);
      _.length > 0 && (_ = await le(_, (n = this._callService) == null ? void 0 : n.getTim()));
      const S = {
        [i.CALL_ID]: o,
        [i.GROUP_ID]: I,
        [i.GROUP_CALL_MEMBERS]: _,
        [i.ROOM_ID]: c,
        [i.CALL_MEDIA_TYPE]: ot[E],
        [i.ROOM_ID_TYPE]: L
      };
      ie.updateStore(S, s.CALL);
    } catch (o) {
      console.warn(`${i.PREFIX}updateStoreBasedOnGroupAttributes fail, error: ${o}`);
    }
  }
  // Get group attribute
  async getGroupAttributes(e, t) {
    if (!t)
      return {};
    try {
      const { data: a } = await e.getGroupAttributes({
        groupID: t,
        keyList: []
      });
      return (a == null ? void 0 : a.groupAttributes) || {};
    } catch (a) {
      return console.warn(`${i.PREFIX}getGroupAttributes fail: ${a}`), {};
    }
  }
  isLineBusy(e) {
    var r;
    const t = Ie(e.payload.data), a = Ie(t == null ? void 0 : t.data);
    return (a == null ? void 0 : a.line_busy) === "line_busy" || (a == null ? void 0 : a.line_busy) === "" || ((r = a == null ? void 0 : a.data) == null ? void 0 : r.message) === "lineBusy";
  }
  async getCallKitMessage(e, t) {
    var _, S, U, T;
    const a = Ie(e.payload.data);
    if ((a == null ? void 0 : a.businessID) !== 1)
      return {};
    let r = "";
    const n = Ie(a == null ? void 0 : a.data), o = n.call_type, I = a.inviteeList, c = (_ = n == null ? void 0 : n.data) == null ? void 0 : _.inviter, L = ie.getData(s.CALL, i.LOCAL_USER_INFO).userId, E = c === L, g = (S = n == null ? void 0 : n.data) == null ? void 0 : S.cmd;
    switch (a == null ? void 0 : a.actionType) {
      case J.INVITE: {
        r = v[g]({ callDuration: it(n == null ? void 0 : n.call_end) });
        break;
      }
      case J.CANCEL_INVITE:
        r = E ? "Call Cancel" : "Other Side Cancel";
        break;
      case J.ACCEPT_INVITE:
        ["switchToAudio", "switchToVideo"].includes(g) ? r = (U = v == null ? void 0 : v[g]) == null ? void 0 : U.call(v) : r = X("Answered");
        break;
      case J.REJECT_INVITE:
        this.isLineBusy(e) ? r = E ? "Line Busy" : "Other Side Line Busy" : r = E ? "Other Side Decline" : "Decline";
        break;
      case J.INVITE_TIMEOUT:
        ["switchToAudio", "switchToVideo"].includes(g) ? r = (T = v == null ? void 0 : v[g]) == null ? void 0 : T.call(v) : r = E ? "Other Side No Answer" : "No answer";
        break;
    }
    return { messageCardContent: r, callMediaType: o, inviteeList: I };
  }
  // =========================【chat: event listening】=========================
  _addListenChatEvent() {
    var e, t;
    if (!((e = this._callService) != null && e.getTim())) {
      console.warn(`${i.PREFIX}add tim event listener failed, tim is empty.`);
      return;
    }
    (t = this._callService) == null || t.getTim().on(ye.EVENT.GROUP_ATTRIBUTES_UPDATED, this._handleGroupAttributesUpdated, this);
  }
  _removeListenChatEvent() {
    var e, t;
    if (!((e = this._callService) != null && e.getTim())) {
      console.warn(`${i.PREFIX}remove tim event listener failed, tim is empty.`);
      return;
    }
    (t = this._callService) == null || t.getTim().off(ye.EVENT.GROUP_ATTRIBUTES_UPDATED, this._handleGroupAttributesUpdated, this);
  }
  /**
   * chat start audio/video call via click
   * @param {Any} options Parameters passed in when clicking on an audio/video call from chat
   * @param {CallMediaType} type call media type. 0 - audio; 1 - video.
   * 
   * priority: isForceUseV2API > version
   */
  async _handleTUICoreOnClick(e, t) {
    var a;
    try {
      const r = ie.getData(s.CALL, i.IS_FORCE_USE_V2_API), { groupID: n, userIDList: o = [], version: I = "", ...c } = e;
      if (r) {
        await this._useV2API({ ...e, type: t });
        return;
      }
      if (I === "v3") {
        await ((a = this._callService) == null ? void 0 : a.calls({ chatGroupID: n, userIDList: o, type: t, ...c }));
        return;
      }
      await this._useV2API({ ...e, type: t });
    } catch (r) {
      console.debug(r);
    }
  }
  async _useV2API(e) {
    var o, I;
    const { groupID: t, userIDList: a = [], type: r, ...n } = e || {};
    t ? await ((o = this._callService) == null ? void 0 : o.groupCall({ groupID: t, userIDList: a, type: r, ...n })) : a.length === 1 && await ((I = this._callService) == null ? void 0 : I.call({ userID: a[0], type: r, ...n }));
  }
  async _handleGroupAttributesUpdated(e) {
    var n;
    if (ie.getData(s.CALL, i.CALL_STATUS) !== h.IDLE)
      return;
    const t = (e == null ? void 0 : e.data) || {}, { groupID: a = "", groupAttributes: r = {} } = t;
    a === ((n = this._callService) == null ? void 0 : n.getCurrentGroupId()) && await this.updateStoreBasedOnGroupAttributes(r);
  }
}
const kt = 0, Yt = 1, Ye = 2;
function Ht({ retryFunction: A, settings: e, onError: t, onRetrying: a, onRetryFailed: r, context: n }) {
  return function(...o) {
    const I = e.retries || 5;
    let c = 0, L = -1, E = kt;
    const g = async (_, S) => {
      const U = n || this;
      try {
        const T = await A.apply(U, o);
        c = 0, _(T);
      } catch (T) {
        const Q = () => {
          clearTimeout(L), c = 0, E = Ye, S(T);
        }, O = () => {
          E !== Ye && c < I ? (c++, E = Yt, Ce(a) && a.call(U, c, Q), L = setTimeout(
            () => {
              L = -1, g(_, S);
            },
            fe(e.timeout) ? 1e3 : e.timeout
          )) : (Q(), Ce(r) && r.call(U, T));
        };
        Ce(t) ? t.call(U, T, O, S, o) : O();
      }
    };
    return new Promise(g);
  };
}
function xt(A) {
  return function(e, t, a) {
    const { retries: r = 5, timeout: n = 2e3, onError: o, onRetrying: I, onRetryFailed: c } = A, L = Ht({
      retryFunction: a.value,
      settings: { retries: r, timeout: n },
      onError: o,
      onRetrying: I,
      onRetryFailed: c,
      context: null
    });
    return a.value = function(...E) {
      return L.apply(this, E);
    }, a;
  };
}
var Jt = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, zt = (A, e, t, a) => {
  for (var r = a > 1 ? void 0 : a ? Wt(e, t) : e, n = A.length - 1, o; n >= 0; n--)
    (o = A[n]) && (r = (a ? o(e, t, r) : o(r)) || r);
  return a && r && Jt(e, t, r), r;
};
const C = De.getInstance(), Xt = k.getInstance(), rt = class Ae {
  constructor(e) {
    this._callService = e.callService;
  }
  static getInstance(e) {
    return Ae.instance || (Ae.instance = new Ae(e)), Ae.instance;
  }
  addListenTuiCallEngineEvent() {
    var t, a;
    const e = (t = this._callService) == null ? void 0 : t.getTUICallEngineInstance();
    if (!e) {
      console.warn(`${i.PREFIX}add engine event listener failed, engine is empty.`);
      return;
    }
    e.on(u.ERROR, this._handleError, this), e.on(u.ON_CALL_RECEIVED, this._handleNewInvitationReceived, this), (a = u) != null && a.ON_CALL_BEGIN && e.on(u.ON_CALL_BEGIN, this._handleOnCallBegin, this), e.on(u.USER_ENTER, this._handleUserEnter, this), e.on(u.USER_LEAVE, this._handleUserLeave, this), e.on(u.REJECT, this._handleInviteeReject, this), e.on(u.NO_RESP, this._handleNoResponse, this), e.on(u.LINE_BUSY, this._handleLineBusy, this), e.on(u.ON_CALL_NOT_CONNECTED, this._handleCallNotConnected, this), e.on(u.ON_USER_INVITING, this._handleOnUserInviting, this), e.on(u.SDK_READY, this._handleSDKReady, this), e.on(u.KICKED_OUT, this._handleKickedOut, this), e.on(u.MESSAGE_SENT_BY_ME, this._messageSentByMe, this), u.CALL_MESSAGE && e.on(u.CALL_MESSAGE, this._handleCallMessage, this), u.ON_USER_NETWORK_QUALITY_CHANGED && e.on(u.ON_USER_NETWORK_QUALITY_CHANGED, this._handleNetworkQuality, this), e.on(u.USER_VIDEO_AVAILABLE, this._handleUserVideoAvailable, this), e.on(u.USER_AUDIO_AVAILABLE, this._handleUserAudioAvailable, this), e.on(u.CALL_END, this._handleCallingEnd, this), e.on(u.CALL_MODE, this._handleCallTypeChange, this), e.on(u.USER_UPDATE, this._handleUserUpdate, this);
  }
  removeListenTuiCallEngineEvent() {
    var t, a;
    const e = (t = this._callService) == null ? void 0 : t.getTUICallEngineInstance();
    e.off(u.ERROR, this._handleError, this), e.off(u.ON_CALL_RECEIVED, this._handleNewInvitationReceived, this), (a = u) != null && a.ON_CALL_BEGIN && e.off(u.ON_CALL_BEGIN, this._handleOnCallBegin, this), e.off(u.USER_ENTER, this._handleUserEnter, this), e.off(u.USER_LEAVE, this._handleUserLeave, this), e.off(u.REJECT, this._handleInviteeReject, this), e.off(u.NO_RESP, this._handleNoResponse, this), e.off(u.LINE_BUSY, this._handleLineBusy, this), e.off(u.ON_CALL_NOT_CONNECTED, this._handleCallNotConnected, this), e.off(u.ON_USER_INVITING, this._handleOnUserInviting, this), e.off(u.SDK_READY, this._handleSDKReady, this), e.off(u.KICKED_OUT, this._handleKickedOut, this), e.off(u.MESSAGE_SENT_BY_ME, this._messageSentByMe, this), u.ON_USER_NETWORK_QUALITY_CHANGED && e.off(u.ON_USER_NETWORK_QUALITY_CHANGED, this._handleNetworkQuality, this), e.off(u.USER_VIDEO_AVAILABLE, this._handleUserVideoAvailable, this), e.off(u.USER_AUDIO_AVAILABLE, this._handleUserAudioAvailable, this), e.off(u.CALL_END, this._handleCallingEnd, this), e.off(u.CALL_MODE, this._handleCallTypeChange, this), e.off(u.USER_UPDATE, this._handleUserUpdate, this);
  }
  _callerChangeToConnected() {
    var a;
    const e = C.getData(s.CALL, i.CALL_ROLE);
    C.getData(s.CALL, i.CALL_STATUS) === h.CALLING && e === G.CALLER && (C.update(s.CALL, i.CALL_STATUS, h.CONNECTED), (a = this._callService) == null || a.startTimer());
  }
  _unNormalEventsManager(e, t) {
    var n, o;
    console.log(`${i.PREFIX}${t} event data: ${JSON.stringify(e)}.`);
    const a = C.getData(s.CALL, i.IS_GROUP), r = C.getData(s.CALL, i.REMOTE_USER_INFO_LIST);
    switch (t) {
      case u.REJECT:
      case u.LINE_BUSY: {
        const { userID: I } = F(e);
        let c = t === u.REJECT ? p.OTHER_SIDE_REJECT_CALL : p.OTHER_SIDE_LINE_BUSY, L = "";
        a && (L = (r.find((E) => E.userId === I) || {}).displayUserInfo || I, c = t === u.REJECT ? p.REJECT_CALL : p.IN_BUSY), C.update(s.CALL, i.TOAST_INFO, { content: { key: c, options: { userList: L } } }), I && Ue([I]), C.getData(s.CALL, i.REMOTE_USER_INFO_LIST).length === 0 && ((n = this._callService) == null || n._resetCallStore());
        break;
      }
      case u.NO_RESP: {
        const { userIDList: I = [] } = F(e), c = a ? p.TIMEOUT : p.CALL_TIMEOUT, L = I.map((E) => (r.find((_) => _.userId === E) || {}).displayUserInfo || E);
        C.update(s.CALL, i.TOAST_INFO, { content: { key: c, options: { userList: L.join() } } }), I.length > 0 && Ue(I);
        break;
      }
      case u.ON_CALL_NOT_CONNECTED: {
        (o = this._callService) == null || o._resetCallStore();
        break;
      }
    }
  }
  _handleError(e) {
    var o;
    const { code: t, message: a } = e || {}, r = Object.values(Pe).indexOf(t);
    let n = "";
    if (r !== -1) {
      const I = Object.keys(Pe)[r];
      n = X(Qe[I]), n && C.update(s.CALL, i.TOAST_INFO, { content: Qe[I], type: i.ERROR });
    }
    (o = this._callService) == null || o.executeExternalAfterCalling(), console.error(`${i.PREFIX}_handleError, errorCode: ${t}; errorMessage: ${n || a}.`);
  }
  async _handleNewInvitationReceived(e) {
    var ce, j, Z, $;
    console.log(`${i.PREFIX}onCallReceived event data: ${JSON.stringify(e)}.`);
    const { callerId: t = "", callMediaType: a, inviteData: r = {}, calleeIdList: n = [], chatGroupID: o = "", roomID: I, strRoomID: c } = F(e), L = C.getData(s.CALL, i.LOCAL_USER_INFO), E = [t, ...n.filter((H) => H !== L.userId)], g = a || r.callType, _ = g === d.AUDIO ? p.CALLEE_CALLING_AUDIO_MSG : p.CALLEE_CALLING_VIDEO_MSG;
    let S = {
      [i.CALL_ROLE]: G.CALLEE,
      [i.IS_GROUP]: !!o || n.length > 1,
      [i.CALL_STATUS]: h.CALLING,
      [i.CALL_MEDIA_TYPE]: g,
      [i.CALL_TIPS]: _,
      [i.CALLER_USER_INFO]: { userId: t },
      [i.GROUP_ID]: o
    };
    ze();
    const U = { enableCamera: g === d.VIDEO, enableMic: !0 };
    S = { ...S, [i.PUSHER]: U }, this._callService.openCamera(g === d.VIDEO), this._callService.openMicrophone();
    const T = {
      microphone: !0,
      camera: g === d.VIDEO
    };
    this._callService._preDevicePermission = await this._callService._tuiCallEngine.deviceCheck(T), at(I, c), C.updateStore(S, s.CALL), (ce = this._callService) == null || ce.executeExternalBeforeCalling(), (j = this._callService) != null && j.statusChanged && ((Z = this._callService) == null || Z.statusChanged({ oldStatus: M.IDLE, newStatus: M.BE_INVITED }));
    const Q = await le(E, ($ = this._callService) == null ? void 0 : $.getTim()), [O] = Q.filter((H) => H.userId === t);
    Q.length > 0 && C.updateStore({
      [i.REMOTE_USER_INFO_LIST]: Q,
      [i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST]: Q,
      [i.CALLER_USER_INFO]: {
        userId: t,
        nick: (O == null ? void 0 : O.nick) || "",
        avatar: (O == null ? void 0 : O.avatar) || "",
        displayUserInfo: (O == null ? void 0 : O.remark) || (O == null ? void 0 : O.nick) || t
      }
    }, s.CALL);
  }
  async _handleOnCallBegin(e) {
    this._callerChangeToConnected(), C.update(s.CALL, i.CALL_TIPS, { text: "answered", duration: 2e3 }), await this._callService.openMicrophone(), console.log(`${i.PREFIX}accept event data: ${JSON.stringify(e)}.`);
  }
  async _handleUserEnter(e) {
    this._callerChangeToConnected();
    const { userID: t, data: a } = F(e);
    a != null && a.playerList && C.update(s.CALL, i.PLAYER, a.playerList), await this._addUserToRemoteUserInfoList(t);
    let r = C.getData(s.CALL, i.REMOTE_USER_INFO_LIST);
    r = r.map((n) => (n.userId === t && (n.isEnter = !0), n)), r.length > 0 && (C.update(s.CALL, i.REMOTE_USER_INFO_LIST, r), C.update(s.CALL, i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, r), Xt.updateViewBackgroundUserId("remote")), console.log(`${i.PREFIX}userEnter event data: ${JSON.stringify(e)}.`);
  }
  _handleUserLeave(e) {
    console.log(`${i.PREFIX}userLeave event data: ${JSON.stringify(e)}.`);
    const { data: t, userID: a } = F(e);
    if (t != null && t.playerList && C.update(s.CALL, i.PLAYER, t.playerList), C.getData(s.CALL, i.IS_GROUP)) {
      const n = (C.getData(s.CALL, i.REMOTE_USER_INFO_LIST).find((o) => o.userId === a) || {}).displayUserInfo || a;
      C.update(s.CALL, i.TOAST_INFO, { content: { key: p.END_CALL, options: { userList: n } } });
    }
    a && Ue([a]);
  }
  _handleInviteeReject(e) {
    this._unNormalEventsManager(e, u.REJECT);
  }
  _handleNoResponse(e) {
    this._unNormalEventsManager(e, u.NO_RESP);
  }
  _handleLineBusy(e) {
    this._unNormalEventsManager(e, u.LINE_BUSY);
  }
  _handleCallNotConnected(e) {
    var t;
    (t = this._callService) == null || t.executeExternalAfterCalling(), this._unNormalEventsManager(e, u.ON_CALL_NOT_CONNECTED);
  }
  async _handleOnUserInviting(e) {
    const { userID: t } = F(e);
    t && (C.update(s.CALL, i.IS_GROUP, !0), t !== C.getData(s.CALL, i.LOCAL_USER_INFO).userId && await this._addUserToRemoteUserInfoList(t));
  }
  _handleCallingEnd(e) {
    var t, a;
    console.log(`${i.PREFIX}callEnd event data: ${JSON.stringify(e)}.`), (t = this._callService) == null || t.executeExternalAfterCalling(), (a = this._callService) == null || a._resetCallStore();
  }
  // SDK_READY 后才能调用 tim 接口, 否则登录后立刻获取导致调用接口失败. v2.27.4+、v3 接口 login 后会抛出 SDK_READY
  async _handleSDKReady(e) {
    var a;
    let t = C.getData(s.CALL, i.LOCAL_USER_INFO);
    t = await mt(t.userId, (a = this._callService) == null ? void 0 : a.getTim()), C.update(s.CALL, i.LOCAL_USER_INFO, t), C.update(s.CALL, i.LOCAL_USER_INFO_EXCLUDE_VOLUMN, t);
  }
  _handleKickedOut(e) {
    var t, a, r;
    console.log(`${i.PREFIX}kickOut event data: ${JSON.stringify(e)}.`), (t = this._callService) != null && t.kickedOut && ((a = this._callService) == null || a.kickedOut(e)), C.update(s.CALL, i.CALL_TIPS, p.KICK_OUT), (r = this._callService) == null || r._resetCallStore();
  }
  _messageSentByMe(e) {
    var a, r;
    const t = e == null ? void 0 : e.data;
    (a = this._callService) != null && a.onMessageSentByMe && ((r = this._callService) == null || r.onMessageSentByMe(t));
  }
  _handleCallMessage(e) {
    const t = F(e);
    this._callService._chatCombine.callTUIService({ message: t });
  }
  _handleCallTypeChange(e) {
    var r;
    const { newCallType: t, type: a } = F(e);
    C.update(s.CALL, i.CALL_MEDIA_TYPE, t || a), (r = this._callService) == null || r.setSoundMode(w.EAR);
  }
  _handleNetworkQuality(e) {
    const { networkQualityList: t = [] } = F(e);
    C.update(s.CALL, i.NETWORK_STATUS, t);
    const a = C.getData(s.CALL, i.IS_GROUP), r = C.getData(s.CALL, i.LOCAL_USER_INFO), n = C.getData(s.CALL, i.REMOTE_USER_INFO_LIST);
    if (!a) {
      if (t.find((c) => {
        var L;
        return ((L = n[0]) == null ? void 0 : L.userId) === (c == null ? void 0 : c.userId) && (c == null ? void 0 : c.quality) >= me;
      })) {
        C.update(s.CALL, i.CALL_TIPS, p.REMOTE_NETWORK_IS_POOR);
        return;
      }
      if (t.find((c) => (r == null ? void 0 : r.userId) === (c == null ? void 0 : c.userId) && (c == null ? void 0 : c.quality) >= me)) {
        C.update(s.CALL, i.CALL_TIPS, p.LOCAL_NETWORK_IS_POOR);
        return;
      }
    }
  }
  async _startRemoteView(e) {
    var t;
    if (!e) {
      console.warn(`${i.PREFIX}_startRemoteView userID is empty`);
      return;
    }
    try {
      const a = C.getData(s.CALL, i.DISPLAY_MODE);
      await ((t = this._callService) == null ? void 0 : t.getTUICallEngineInstance().startRemoteView({ userID: e, videoViewDomID: `${e}_0`, options: { objectFit: a } }));
    } catch (a) {
      return console.error(`${i.PREFIX}_startRemoteView error: ${a}.`), Promise.reject(a);
    }
  }
  _setRemoteUserInfoAudioVideoAvailable(e, t, a) {
    let r = C.getData(s.CALL, i.REMOTE_USER_INFO_LIST);
    r = r.map((n) => {
      if (n.userId === a) {
        if (t === i.AUDIO)
          return { ...n, isAudioAvailable: e };
        if (t === i.VIDEO)
          return { ...n, isVideoAvailable: e };
      }
      return n;
    }), r.length > 0 && (C.update(s.CALL, i.REMOTE_USER_INFO_LIST, r), C.update(s.CALL, i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, r));
  }
  async _handleUserVideoAvailable(e) {
    const { userID: t, isVideoAvailable: a } = F(e);
    console.log(`${i.PREFIX}_handleUserVideoAvailable event data: ${JSON.stringify(e)}.`);
    try {
      a && await this._startRemoteView(t);
    } catch (r) {
      console.error(`${i.PREFIX}_startRemoteView failed, error: ${r}.`);
    }
    this._setRemoteUserInfoAudioVideoAvailable(a, i.VIDEO, t);
  }
  _handleUserAudioAvailable(e) {
    const { userID: t, isAudioAvailable: a } = F(e);
    console.log(`${i.PREFIX}_handleUserAudioAvailable event data: ${JSON.stringify(e)}.`), this._setRemoteUserInfoAudioVideoAvailable(a, i.AUDIO, t);
  }
  _handleUserVoiceVolume(e) {
    try {
      const { volumeMap: t } = F(e);
      if ((t || []).length === 0)
        return;
      const a = C.getData(s.CALL, i.LOCAL_USER_INFO);
      let r = C.getData(s.CALL, i.REMOTE_USER_INFO_LIST);
      const [n] = t.filter((c) => c.userId === a.userId), o = t.reduce((c, L) => L.userId !== a.userId ? { ...c, [L.userId]: L.audioVolume } : c, {});
      a.volume = n.audioVolume, r = r.map((c) => ({ ...c, volume: o[c.userId] }));
      const I = {
        [i.LOCAL_USER_INFO]: a,
        [i.REMOTE_USER_INFO_LIST]: r
      };
      C.updateStore(I, s.CALL);
    } catch (t) {
      console.debug(t);
    }
  }
  _handleDeviceUpdate(e) {
    const { cameraList: t, microphoneList: a, speakerList: r, currentCamera: n, currentMicrophone: o, currentSpeaker: I } = e;
    C.update(s.CALL, i.DEVICE_LIST, { cameraList: t, microphoneList: a, speakerList: r, currentCamera: n, currentMicrophone: o, currentSpeaker: I });
  }
  // ==========================【 miniProgram 私有事件】==========================
  _handleUserUpdate(e) {
    const t = F(e);
    t != null && t.pusher && C.update(s.CALL, i.PUSHER, t.pusher), t != null && t.playerList && C.update(s.CALL, i.PLAYER, t.playerList);
  }
  async _addUserToRemoteUserInfoList(e) {
    var r;
    let t = C.getData(s.CALL, i.REMOTE_USER_INFO_LIST);
    if (!t.find((n) => (n == null ? void 0 : n.userId) === e)) {
      t.push({ userId: e }), C.update(s.CALL, i.REMOTE_USER_INFO_LIST, t), C.update(s.CALL, i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, t);
      const [n] = await le([e], (r = this._callService) == null ? void 0 : r.getTim());
      t = C.getData(s.CALL, i.REMOTE_USER_INFO_LIST), t.forEach((o) => {
        (o == null ? void 0 : o.userId) === e && (o = Object.assign(o, n));
      }), C.update(s.CALL, i.REMOTE_USER_INFO_LIST, t), C.update(s.CALL, i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, t);
    }
  }
};
zt([
  xt({
    retries: 5,
    timeout: 200,
    onRetrying(A) {
      console.warn(`${i.PREFIX}_startRemoteView, retrying [${A}]`);
    }
  })
], rt.prototype, "_startRemoteView", 1);
let qt = rt;
var jt = Object.defineProperty, Zt = Object.getOwnPropertyDescriptor, D = (A, e, t, a) => {
  for (var r = a > 1 ? void 0 : a ? Zt(e, t) : e, n = A.length - 1, o; n >= 0; n--)
    (o = A[n]) && (r = (a ? o(e, t, r) : o(r)) || r);
  return a && r && jt(e, t, r), r;
};
const He = $e.getInstance(), l = De.getInstance(), V = k.getInstance();
V.setTUIStore(l);
const xe = "4.0.8", f = class se {
  constructor() {
    this._tim = null, this._TUICore = null, this._timerId = -1, this._startTimeStamp = Se(), this._bellContext = null, this._isFromChat = !1, this._currentGroupId = "", this._preDevicePermission = !1, this._offlinePushInfo = null, this._permissionCheckTimer = null, this._chatCombine = null, this._engineEventHandler = null, this._handleCallStatusChange = async (e) => {
      var t, a;
      try {
        const r = {
          callRole: l.getData(s.CALL, i.CALL_ROLE),
          callStatus: l.getData(s.CALL, i.CALL_STATUS)
        };
        if (this._bellContext.setBellProperties(r), e === h.CALLING)
          await ((t = this == null ? void 0 : this._bellContext) == null ? void 0 : t.play());
        else {
          if (e === h.CONNECTED) {
            const n = l.getData(s.CALL, i.IS_GROUP), o = l.getData(s.CALL, i.CALL_MEDIA_TYPE), I = l.getData(s.CALL, i.REMOTE_USER_INFO_LIST), c = n ? M.DIALING_GROUP : M.DIALING_C2C;
            l.update(s.CALL, i.CALL_TIPS, ""), this.statusChanged && this.statusChanged({ oldStatus: c, newStatus: Ee() }), !n && o === d.VIDEO && this.switchScreen(I[0].domId);
          }
          await ((a = this == null ? void 0 : this._bellContext) == null ? void 0 : a.stop());
        }
      } catch (r) {
        console.warn(`${i.PREFIX}handleCallStatusChange, ${r}.`);
      }
    }, console.log(`${i.PREFIX}version: ${xe}`), this._watchTUIStore(), this._engineEventHandler = qt.getInstance({ callService: this }), this._chatCombine = W.getInstance({ callService: this });
  }
  static getInstance() {
    return se.instance || (se.instance = new se()), se.instance;
  }
  async init(e) {
    var t, a;
    try {
      if (this._tuiCallEngine)
        return;
      let { userID: r, tim: n, userSig: o, sdkAppID: I, SDKAppID: c, isFromChat: L, component: E = Te.TUI_CALL_KIT } = e;
      this._TUICore && (I = this._TUICore.SDKAppID, n = this._TUICore.tim), this._tim = n, console.log(`${i.PREFIX}init sdkAppId: ${I || c}, userId: ${r}`), this._tuiCallEngine = st.createInstance({
        tim: n,
        // @ts-ignore
        sdkAppID: I || c,
        // 兼容传入 SDKAppID 的问题
        callkitVersion: xe,
        isFromChat: L || !1,
        component: E
      }), V.setEngineInstance(this._tuiCallEngine), this._addListenTuiCallEngineEvent(), this._bellContext = new yt(), l.update(s.CALL, i.LOCAL_USER_INFO, { userId: r }), l.update(s.CALL, i.LOCAL_USER_INFO_EXCLUDE_VOLUMN, { userId: r }), V.updateViewBackgroundUserId("local"), await this._tuiCallEngine.login({ userID: r, userSig: o, assetsPath: "" });
      const g = l.getData(s.CALL, i.CUSTOM_UI_CONFIG);
      (a = (t = this._tuiCallEngine) == null ? void 0 : t.reportLog) == null || a.call(t, {
        name: "TUICallkit.init",
        data: {
          uiConfig: g
        }
      });
    } catch (r) {
      throw console.error(`${i.PREFIX}init failed, error: ${r}.`), r;
    }
  }
  // component destroy
  async destroyed() {
    var e;
    try {
      const t = l.getData(s.CALL, i.CALL_STATUS);
      if (t !== h.IDLE)
        throw new Error(`please destroyed when status is idle, current status: ${t}`);
      this._tuiCallEngine && (this._removeListenTuiCallEngineEvent(), await this._tuiCallEngine.destroyInstance(), this._tuiCallEngine = null), (e = this._bellContext) == null || e.destroy(), this._bellContext = null;
    } catch (t) {
      throw console.error(`${i.PREFIX}destroyed failed, error: ${t}.`), t;
    }
  }
  async call(e) {
    if (l.getData(s.CALL, i.CALL_STATUS) === h.IDLE)
      try {
        const { type: t, userID: a, offlinePushInfo: r } = e;
        if (l.getData(s.CALL, i.CALL_STATUS) !== h.IDLE)
          return;
        await this._updateCallStoreBeforeCall(t, [{ userId: a }]), this.executeExternalBeforeCalling(), e.offlinePushInfo = { ...this.getDefaultOfflinePushInfo(), ...r };
        const n = await this._tuiCallEngine.call(e);
        await this._updateCallStoreAfterCall([a], n);
      } catch (t) {
        this._handleCallError(t, "call");
      }
  }
  async groupCall(e) {
    if (l.getData(s.CALL, i.CALL_STATUS) === h.IDLE)
      try {
        const { userIDList: t, type: a, groupID: r, offlinePushInfo: n } = e;
        if (l.getData(s.CALL, i.CALL_STATUS) !== h.IDLE)
          return;
        const o = t.map((c) => ({ userId: c }));
        await this._updateCallStoreBeforeCall(a, o, r), this.executeExternalBeforeCalling(), e.offlinePushInfo = { ...this.getDefaultOfflinePushInfo(), ...n };
        const I = await this._tuiCallEngine.groupCall(e);
        await this._updateCallStoreAfterCall(t, I);
      } catch (t) {
        this._handleCallError(t, "groupCall");
      }
  }
  async inviteUser(e) {
    if (l.getData(s.CALL, i.CALL_STATUS) !== h.IDLE)
      try {
        const { userIDList: t } = e;
        let a = await le(t, this.getTim());
        const r = l.getData(s.CALL, i.REMOTE_USER_INFO_LIST);
        if (t.filter((o) => !r.some((I) => I.userId === o)).length === 0)
          return;
        l.update(s.CALL, i.REMOTE_USER_INFO_LIST, [...r, ...a]), l.update(s.CALL, i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, [...r, ...a]), this._tuiCallEngine && await this._tuiCallEngine.inviteUser(e);
      } catch (t) {
        console.error(`${i.PREFIX}inviteUser failed, error: ${t}.`);
      }
  }
  async joinInGroupCall(e) {
    if (l.getData(s.CALL, i.CALL_STATUS) !== h.CONNECTED)
      try {
        const t = {
          [i.CALL_ROLE]: G.CALLEE,
          [i.IS_GROUP]: !0,
          [i.CALL_STATUS]: h.CONNECTED,
          [i.CALL_MEDIA_TYPE]: e.type,
          [i.GROUP_ID]: e.groupID,
          [i.ROOM_ID]: e.roomID
        };
        l.updateStore(t, s.CALL);
        const a = await this._tuiCallEngine.joinInGroupCall(e), r = this._getFeatureButtonDefaultState(Y.Camera) === z.Close;
        e.type === d.VIDEO && !r && await this.openCamera(i.LOCAL_VIDEO), l.update(s.CALL, i.IS_CLICKABLE, !0), this.startTimer(), l.update(s.CALL, i.PUSHER, a), this.setSoundMode(e.type === d.AUDIO ? w.EAR : w.SPEAKER);
        const n = l.getData(s.CALL, i.LOCAL_USER_INFO);
        l.update(s.CALL, i.LOCAL_USER_INFO, { ...n, isEnter: !0 }), l.update(s.CALL, i.LOCAL_USER_INFO_EXCLUDE_VOLUMN, { ...n, isEnter: !0 }), m(!0, i.AUDIO);
      } catch (t) {
        this._handleCallError(t, "joinInGroupCall");
      }
  }
  async calls(e) {
    if (l.getData(s.CALL, i.CALL_STATUS) === h.IDLE)
      try {
        const { userIDList: t, type: a, chatGroupID: r, offlinePushInfo: n } = e;
        if (l.getData(s.CALL, i.CALL_STATUS) !== h.IDLE)
          return;
        const o = t.map((c) => ({ userId: c }));
        await this._updateCallStoreBeforeCall(a, o, r), this.executeExternalBeforeCalling(), e.offlinePushInfo = { ...this.getDefaultOfflinePushInfo(), ...n };
        const I = await this._tuiCallEngine.calls(e);
        await this._updateCallStoreAfterCall(t, I);
      } catch (t) {
        this._handleCallError(t, "calls");
      }
  }
  async join(e) {
    if (l.getData(s.CALL, i.CALL_STATUS) !== h.CONNECTED)
      try {
        const t = await this._tuiCallEngine.join(e);
        l.update(s.CALL, i.IS_CLICKABLE, !0), this.startTimer();
        const a = {
          [i.CALL_ROLE]: G.CALLEE,
          [i.IS_GROUP]: !0,
          [i.CALL_STATUS]: h.CONNECTED,
          [i.CALL_MEDIA_TYPE]: l.getData(s.CALL, i.CALL_MEDIA_TYPE) || d.AUDIO
          // default audio callMediaType
        };
        l.updateStore(a, s.CALL), l.update(s.CALL, i.PUSHER, t), this.setSoundMode(e.type === d.AUDIO ? w.EAR : w.SPEAKER);
        const r = l.getData(s.CALL, i.LOCAL_USER_INFO);
        l.update(s.CALL, i.LOCAL_USER_INFO, { ...r, isEnter: !0 }), l.update(s.CALL, i.LOCAL_USER_INFO_EXCLUDE_VOLUMN, { ...r, isEnter: !0 }), await this.openMicrophone(), m(!0, i.AUDIO);
      } catch (t) {
        this._handleCallError(t, "join");
      }
  }
  // ===============================【其它对外接口】===============================
  getTUICallEngineInstance() {
    return (this == null ? void 0 : this._tuiCallEngine) || null;
  }
  setLogLevel(e) {
    var t;
    (t = this == null ? void 0 : this._tuiCallEngine) == null || t.setLogLevel(e);
  }
  setLanguage(e) {
    console.warn(`${i.PREFIX}The miniProgram does not support setLanguage`);
  }
  enableFloatWindow(e) {
    l.update(s.CALL, i.ENABLE_FLOAT_WINDOW, e);
  }
  async setSelfInfo(e) {
    const { nickName: t, avatar: a } = e;
    try {
      await this._tuiCallEngine.setSelfInfo(t, a);
    } catch (r) {
      console.error(`${i.PREFIX}setSelfInfo failed, error: ${r}.`);
    }
  }
  async enableVirtualBackground(e) {
    l.update(s.CALL, i.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND, e);
  }
  async setCallingBell(e) {
    const t = { calleeBellFilePath: e };
    this._bellContext.setBellProperties(t);
  }
  async enableMuteMode(e) {
    try {
      const t = { isMuteBell: e };
      this._bellContext.setBellProperties(t), await this._bellContext.setBellMute(e);
    } catch (t) {
      console.warn(`${i.PREFIX}enableMuteMode failed, error: ${t}.`);
    }
  }
  hideFeatureButton(e) {
    V.hideFeatureButton(e);
  }
  setLocalViewBackgroundImage(e) {
    V.setLocalViewBackgroundImage(e);
  }
  setRemoteViewBackgroundImage(e, t) {
    V.setRemoteViewBackgroundImage(e, t);
  }
  setLayoutMode(e) {
    V.setLayoutMode(e);
  }
  setCameraDefaultState(e) {
    V.setCameraDefaultState(e);
  }
  // =============================【实验性接口】=============================
  callExperimentalAPI(e) {
    var n, o;
    const t = JSON.parse(e);
    if (t === e)
      return;
    const { api: a, params: r } = t;
    if (!(!a || !r))
      try {
        switch (a) {
          case "forceUseV2API":
            const { enable: I } = r;
            l.update(s.CALL, i.IS_FORCE_USE_V2_API, !!I);
            break;
          default:
            break;
        }
      } catch (I) {
        (o = (n = this._tuiCallEngine) == null ? void 0 : n.reportLog) == null || o.call(n, { name: "TUICallKit.callExperimentalAPI.fail", data: { error: I } });
      }
  }
  async accept() {
    var t, a, r, n, o, I;
    const e = l.getData(s.CALL, i.CALL_STATUS);
    if ((a = (t = this._tuiCallEngine) == null ? void 0 : t.reportLog) == null || a.call(t, {
      name: "TUICallKit.accept.start",
      data: { callStatus: e }
    }), e !== h.CONNECTED)
      try {
        const L = {
          microphone: !0,
          camera: l.getData(s.CALL, i.CALL_MEDIA_TYPE) === d.VIDEO
        }, E = await this._tuiCallEngine.deviceCheck(L);
        E && !this._preDevicePermission && (l.update(s.CALL, i.PUSHER_ID, i.NEW_PUSHER), this._preDevicePermission = E);
        const g = await this._tuiCallEngine.accept();
        if (g) {
          l.update(s.CALL, i.CALL_STATUS, h.CONNECTED), (n = this._chatCombine) == null || n.callTUIService({ message: (r = g == null ? void 0 : g.data) == null ? void 0 : r.message }), l.update(s.CALL, i.IS_CLICKABLE, !0), this.startTimer();
          const _ = l.getData(s.CALL, i.CALL_MEDIA_TYPE), S = this._getFeatureButtonDefaultState(Y.Camera) === z.Close;
          _ === d.VIDEO && !S && await this.openCamera(i.LOCAL_VIDEO), g.pusher && l.update(s.CALL, i.PUSHER, g.pusher), this.setSoundMode(_ === d.AUDIO ? w.EAR : w.SPEAKER);
          const U = l.getData(s.CALL, i.LOCAL_USER_INFO);
          l.update(s.CALL, i.LOCAL_USER_INFO, { ...U, isEnter: !0 }), l.update(s.CALL, i.LOCAL_USER_INFO_EXCLUDE_VOLUMN, { ...U, isEnter: !0 }), m(!0, i.AUDIO);
        }
      } catch (c) {
        if ((I = (o = this._tuiCallEngine) == null ? void 0 : o.reportLog) == null || I.call(o, {
          name: "TUICallKit.accept.fail",
          level: "error",
          error: c
        }), Ke(c))
          return;
        Be(c, d.AUDIO, this._tuiCallEngine), this._resetCallStore();
      }
  }
  async hangup() {
    if (l.getData(s.CALL, i.CALL_STATUS) !== h.IDLE) {
      try {
        const e = await this._tuiCallEngine.hangup();
        e == null || e.forEach((t) => {
          var a, r;
          (t == null ? void 0 : t.code) === 0 && ((r = this._chatCombine) == null || r.callTUIService({ message: (a = t == null ? void 0 : t.data) == null ? void 0 : a.message }));
        });
      } catch (e) {
        console.debug(e);
      }
      this._resetCallStore();
    }
  }
  async reject() {
    var e, t;
    if (l.getData(s.CALL, i.CALL_STATUS) !== h.IDLE) {
      try {
        const a = await this._tuiCallEngine.reject();
        (a == null ? void 0 : a.code) === 0 && ((t = this._chatCombine) == null || t.callTUIService({ message: (e = a == null ? void 0 : a.data) == null ? void 0 : e.message }));
      } catch (a) {
        console.debug(a);
      }
      this._resetCallStore();
    }
  }
  async openCamera(e) {
    try {
      if (He.isH5 || He.isWeChat) {
        const a = l.getData(s.CALL, i.CAMERA_POSITION) === b.FRONT;
        this._tuiCallEngine.openCamera(e, a);
      } else
        await this._tuiCallEngine.openCamera(e);
      m(!0, i.VIDEO);
    } catch (t) {
      Be(t, d.VIDEO, this._tuiCallEngine), console.error(`${i.PREFIX}openCamera error: ${t}.`);
    }
  }
  async closeCamera() {
    try {
      await this._tuiCallEngine.closeCamera(), m(!1, i.VIDEO);
    } catch (e) {
      console.error(`${i.PREFIX}closeCamera error: ${e}.`);
    }
  }
  async openMicrophone() {
    try {
      await this._tuiCallEngine.openMicrophone(), m(!0, i.AUDIO);
    } catch (e) {
      console.error(`${i.PREFIX}openMicrophone failed, error: ${e}.`);
    }
  }
  async closeMicrophone() {
    try {
      await this._tuiCallEngine.closeMicrophone(), m(!1, i.AUDIO);
    } catch (e) {
      console.error(`${i.PREFIX}closeMicrophone failed, error: ${e}.`);
    }
  }
  switchScreen(e) {
    e && l.update(s.CALL, i.BIG_SCREEN_USER_ID, e);
  }
  async switchCallMediaType() {
    var e, t;
    try {
      const a = l.getData(s.CALL, i.CALL_MEDIA_TYPE);
      if (a === d.AUDIO) {
        console.warn(`${i.PREFIX}switchCallMediaType failed, ${a} not support.`);
        return;
      }
      const r = await this._tuiCallEngine.switchCallMediaType(d.AUDIO);
      (r == null ? void 0 : r.code) === 0 && ((t = this._chatCombine) == null || t.callTUIService({ message: (e = r == null ? void 0 : r.data) == null ? void 0 : e.message })), l.update(s.CALL, i.CALL_MEDIA_TYPE, d.AUDIO);
      const o = l.getData(s.CALL, i.IS_GROUP) ? M.CALLING_GROUP_VIDEO : M.CALLING_C2C_VIDEO, I = Ee();
      this.statusChanged && this.statusChanged({ oldStatus: o, newStatus: I }), this.setSoundMode(w.EAR);
    } catch (a) {
      console.error(`${i.PREFIX}switchCallMediaType failed, error: ${a}.`);
    }
  }
  async switchCamera() {
    const t = l.getData(s.CALL, i.CAMERA_POSITION) === b.BACK ? b.FRONT : b.BACK;
    try {
      await this._tuiCallEngine.switchCamera(t), l.update(s.CALL, i.CAMERA_POSITION, t);
    } catch (a) {
      console.error(`${i.PREFIX}_switchCamera failed, error: ${a}.`);
    }
  }
  setSoundMode(e) {
    var t;
    try {
      let a = l.getData(s.CALL, i.IS_EAR_PHONE);
      const r = e || (a ? w.SPEAKER : w.EAR);
      (t = this._tuiCallEngine) == null || t.selectAudioPlaybackDevice(r), e ? a = e === w.EAR : a = !a, l.update(s.CALL, i.IS_EAR_PHONE, a);
    } catch (a) {
      console.error(`${i.PREFIX}setSoundMode failed, error: ${a}.`);
    }
  }
  async setBlurBackground(e) {
    try {
      l.update(s.CALL, i.ENABLE_VIRTUAL_BACKGROUND, e);
    } catch (t) {
      console.error(`${i.PREFIX}_setBlurBackground failed, error: ${t}.`);
    }
  }
  // ==========================【TUICallEngine 事件处理】==========================
  _addListenTuiCallEngineEvent() {
    this._engineEventHandler.addListenTuiCallEngineEvent();
  }
  _removeListenTuiCallEngineEvent() {
    this._engineEventHandler.removeListenTuiCallEngineEvent();
  }
  setCallback(e) {
    const { beforeCalling: t, afterCalling: a, onMinimized: r, onMessageSentByMe: n, kickedOut: o, statusChanged: I } = e;
    t && (this.beforeCalling = t), a && (this.afterCalling = a), r && (this.onMinimized = r), n && (this.onMessageSentByMe = n), o && (this.kickedOut = o), I && (this.statusChanged = I);
  }
  toggleMinimize() {
    const e = l.getData(s.CALL, i.IS_MINIMIZED);
    l.update(s.CALL, i.IS_MINIMIZED, !e), console.log(`${i.PREFIX}toggleMinimize: ${e} -> ${!e}.`), this.onMinimized && this.onMinimized(e, !e);
  }
  executeExternalBeforeCalling() {
    this.beforeCalling && this.beforeCalling();
  }
  executeExternalAfterCalling() {
    this.afterCalling && this.afterCalling();
  }
  // 处理用户异常退出的情况, 小程序 ”右滑“、"左上角退出"; web 页面关闭浏览器或关闭 tab 页面
  async handleExceptionExit(e) {
    var t, a;
    try {
      const r = l.getData(s.CALL, i.CALL_STATUS), n = l.getData(s.CALL, i.CALL_ROLE);
      if ((a = (t = this._tuiCallEngine) == null ? void 0 : t.reportLog) == null || a.call(t, { name: "TUICallkit.handleExceptionExit", data: { callStatus: r, callRole: n } }), r === h.IDLE)
        return;
      r === h.CALLING && (n === G.CALLER ? await (this == null ? void 0 : this.hangup()) : await (this == null ? void 0 : this.reject())), r === h.CONNECTED && await (this == null ? void 0 : this.hangup()), this == null || this._resetCallStore();
    } catch (r) {
      console.error(`${i.PREFIX} handleExceptionExit failed, error: ${r}.`);
    }
    e && (e.returnValue = "");
  }
  // 处理 pusher 内部错误,没有 live-pusher 能力时做出弹窗提示。
  handlePusherError(e) {
    var t;
    ((t = e == null ? void 0 : e.detail) == null ? void 0 : t.errMsg) === "fail:access denied" && gt();
  }
  setVideoDisplayMode(e) {
    l.update(s.CALL, i.DISPLAY_MODE, e);
  }
  async setVideoResolution(e) {
    var t;
    try {
      if (!e)
        return;
      l.update(s.CALL, i.VIDEO_RESOLUTION, e), await ((t = this._tuiCallEngine) == null ? void 0 : t.setVideoQuality(e));
    } catch (a) {
      console.warn(`${i.PREFIX}setVideoResolution failed, error: ${a}.`);
    }
  }
  // 通话时长更新
  startTimer() {
    this._timerId === -1 && (this._startTimeStamp = Se(), this._timerId = de.run(i.TIMEOUT, this._updateCallDuration.bind(this), { delay: 1e3 }));
  }
  // =========================【private methods for service use】=========================
  // 处理 “呼叫” 抛出的异常
  _handleCallError(e, t) {
    if (this._permissionCheckTimer && clearInterval(this._permissionCheckTimer), !Ke(e))
      throw ht(e), Be(e, d.AUDIO, this._tuiCallEngine), console.error(`${i.PREFIX}${t} failed, error: ${e}.`), this._resetCallStore(), e;
  }
  async _updateCallStoreBeforeCall(e, t, a) {
    let r = p.CALLER_CALLING_MSG;
    (a || l.getData(s.CALL, i.IS_MINIMIZED) || t.length > 1) && (r = p.CALLER_GROUP_CALLING_MSG);
    let n = {
      [i.CALL_MEDIA_TYPE]: e,
      [i.CALL_ROLE]: G.CALLER,
      [i.REMOTE_USER_INFO_LIST]: t,
      [i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST]: t,
      [i.IS_GROUP]: !!a || t.length > 1,
      [i.CALL_TIPS]: r,
      [i.GROUP_ID]: a
    };
    const o = { enableCamera: e === d.VIDEO, enableMic: !0 };
    n = { ...n, [i.PUSHER]: o }, l.updateStore(n, s.CALL);
    const I = await Lt(e, this);
    console.log(`${i.PREFIX}mini beforeCall return callStatus: ${I}.`), l.update(s.CALL, i.CALL_STATUS, I);
    const c = await le(t.map((g) => g.userId), this.getTim());
    c.length > 0 && (l.update(s.CALL, i.REMOTE_USER_INFO_LIST, c), l.update(s.CALL, i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, c));
    const L = {
      microphone: !0,
      camera: e === d.VIDEO
    };
    let E = await this._tuiCallEngine.deviceCheck(L);
    E || (this._permissionCheckTimer && clearInterval(this._permissionCheckTimer), this._permissionCheckTimer = setInterval(async () => {
      E = await this._tuiCallEngine.deviceCheck(L), E && this._permissionCheckTimer && (clearInterval(this._permissionCheckTimer), l.update(s.CALL, i.CALL_STATUS, h.CALLING));
    }, 500));
  }
  async _updateCallStoreAfterCall(e, t) {
    var a, r;
    if (t) {
      l.update(s.CALL, i.IS_CLICKABLE, !0), at(t == null ? void 0 : t.roomID, t == null ? void 0 : t.strRoomID);
      const n = l.getData(s.CALL, i.CALL_MEDIA_TYPE);
      (r = this._chatCombine) == null || r.callTUIService({ message: (a = t == null ? void 0 : t.data) == null ? void 0 : a.message }), t.pusher && l.update(s.CALL, i.PUSHER, t.pusher), this.setSoundMode(n === d.AUDIO ? w.EAR : w.SPEAKER), l.update(s.CALL, i.CALL_STATUS, h.CALLING);
      const o = this._getFeatureButtonDefaultState(Y.Camera) === z.Close;
      n === d.VIDEO && !o && await this.openCamera(i.LOCAL_VIDEO);
      const I = l.getData(s.CALL, i.LOCAL_USER_INFO);
      l.update(s.CALL, i.LOCAL_USER_INFO, { ...I, isEnter: !0 }), l.update(s.CALL, i.LOCAL_USER_INFO_EXCLUDE_VOLUMN, { ...I, isEnter: !0 }), m(!0, i.AUDIO);
    } else
      this._permissionCheckTimer && clearInterval(this._permissionCheckTimer), this._permissionCheckTimer = null, this._resetCallStore();
  }
  _getFeatureButtonDefaultState(e) {
    var a;
    const { button: t } = l.getData(s.CALL, i.CUSTOM_UI_CONFIG);
    return (a = t == null ? void 0 : t[e]) == null ? void 0 : a.state;
  }
  _updateCallDuration() {
    const e = Math.round((Se() - this._startTimeStamp) / 1e3), t = it(e);
    l.update(s.CALL, i.CALL_DURATION, t);
  }
  _stopTimer() {
    this._timerId !== -1 && (de.clearTask(this._timerId), this._timerId = -1);
  }
  _resetCallStore() {
    const e = Ee();
    this._stopTimer();
    let t = Object.keys(ue).filter((n) => {
      switch (ue[n]) {
        case i.CALL_STATUS:
        case i.LANGUAGE:
        case i.IS_GROUP:
        case i.DISPLAY_MODE:
        case i.VIDEO_RESOLUTION:
        case i.ENABLE_FLOAT_WINDOW:
        case i.LOCAL_USER_INFO:
        case i.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND:
        case i.IS_FORCE_USE_V2_API:
        case i.LOCAL_USER_INFO_EXCLUDE_VOLUMN:
          return !1;
        default:
          return !0;
      }
    });
    t = t.map((n) => ue[n]), l.reset(s.CALL, t), l.getData(s.CALL, i.CALL_STATUS) !== h.IDLE && l.reset(s.CALL, [i.CALL_STATUS], !0), l.reset(s.CALL, [i.IS_MINIMIZED], !0), l.reset(s.CALL, [i.IS_EAR_PHONE], !0), l.reset(s.CALL, [i.ENABLE_VIRTUAL_BACKGROUND], !0), l.reset(s.CALL, [i.IS_MUTE_SPEAKER], !0), l.update(s.CALL, i.LOCAL_USER_INFO, {
      ...l.getData(s.CALL, i.LOCAL_USER_INFO),
      isVideoAvailable: !1,
      isAudioAvailable: !1
    }), l.update(s.CALL, i.LOCAL_USER_INFO_EXCLUDE_VOLUMN, {
      ...l.getData(s.CALL, i.LOCAL_USER_INFO_EXCLUDE_VOLUMN),
      isVideoAvailable: !1,
      isAudioAvailable: !1
    }), l.update(s.CALL, i.REMOTE_USER_INFO_LIST, []), l.update(s.CALL, i.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, []), l.update(s.CALL, i.CAMERA_POSITION, b.FRONT);
    const r = Ee();
    e !== r && this.statusChanged && this.statusChanged({ oldStatus: e, newStatus: r });
  }
  // =========================【Calling the Chat SDK APi】=========================
  // 获取群成员
  async getGroupMemberList(e, t) {
    const a = l.getData(s.CALL, i.GROUP_ID);
    return await Vt(a, this.getTim(), e, t);
  }
  // 获取群信息
  async getGroupProfile() {
    const e = l.getData(s.CALL, i.GROUP_ID);
    return await Kt(e, this.getTim());
  }
  _watchTUIStore() {
    l == null || l.watch(s.CALL, {
      [i.CALL_STATUS]: this._handleCallStatusChange
    });
  }
  _unwatchTUIStore() {
    l == null || l.unwatch(s.CALL, {
      [i.CALL_STATUS]: this._handleCallStatusChange
    });
  }
  // =========================【融合 chat 】=========================
  bindTUICore(e) {
    this._TUICore = e;
  }
  // =========================【set、get methods】=========================
  getTim() {
    var e, t;
    return this._tim ? this._tim : this._tuiCallEngine ? ((e = this._tuiCallEngine) == null ? void 0 : e.tim) || ((t = this._tuiCallEngine) == null ? void 0 : t.getTim()) : (console.warn(`${i.PREFIX}getTim warning: _tuiCallEngine Instance is not available.`), null);
  }
  setIsFromChat(e) {
    this._isFromChat = e;
  }
  setCurrentGroupId(e) {
    this._currentGroupId = e;
  }
  getCurrentGroupId() {
    return this._currentGroupId;
  }
  setDefaultOfflinePushInfo(e) {
    this._offlinePushInfo = e;
  }
  getDefaultOfflinePushInfo() {
    const e = l.getData(s.CALL, i.LOCAL_USER_INFO);
    return this._offlinePushInfo ? this._offlinePushInfo : {
      title: (e == null ? void 0 : e.displayUserInfo) || "",
      description: X("you have a new call")
    };
  }
  async getCallMessage(e) {
    return await this._chatCombine.getCallKitMessage(e, this.getTim());
  }
};
D([
  N(),
  y(P.init)
], f.prototype, "init", 1);
D([
  N(),
  y(P.call),
  q({ engineInstance: !0 })
], f.prototype, "call", 1);
D([
  N(),
  y(P.groupCall),
  q({ engineInstance: !0 })
], f.prototype, "groupCall", 1);
D([
  N(),
  y(P.inviteUser),
  q({ engineInstance: !0 })
], f.prototype, "inviteUser", 1);
D([
  N(),
  y(P.joinInGroupCall),
  q({ engineInstance: !0 })
], f.prototype, "joinInGroupCall", 1);
D([
  N(),
  q({ engineInstance: !0 })
], f.prototype, "calls", 1);
D([
  N(),
  q({ engineInstance: !0 })
], f.prototype, "join", 1);
D([
  y(P.setLanguage)
], f.prototype, "setLanguage", 1);
D([
  y(P.enableFloatWindow)
], f.prototype, "enableFloatWindow", 1);
D([
  y(P.setSelfInfo)
], f.prototype, "setSelfInfo", 1);
D([
  y(P.setCallingBell)
], f.prototype, "setCallingBell", 1);
D([
  y(P.enableMuteMode)
], f.prototype, "enableMuteMode", 1);
D([
  N()
], f.prototype, "accept", 1);
D([
  N()
], f.prototype, "hangup", 1);
D([
  N()
], f.prototype, "reject", 1);
D([
  N()
], f.prototype, "openCamera", 1);
D([
  N()
], f.prototype, "closeCamera", 1);
D([
  N()
], f.prototype, "openMicrophone", 1);
D([
  N()
], f.prototype, "closeMicrophone", 1);
D([
  N()
], f.prototype, "switchScreen", 1);
D([
  N()
], f.prototype, "switchCallMediaType", 1);
D([
  N()
], f.prototype, "switchCamera", 1);
D([
  N()
], f.prototype, "setSoundMode", 1);
D([
  N()
], f.prototype, "setBlurBackground", 1);
D([
  y(P.setVideoDisplayMode)
], f.prototype, "setVideoDisplayMode", 1);
D([
  y(P.setVideoResolution)
], f.prototype, "setVideoResolution", 1);
let $t = f;
const ai = $t.getInstance(), ri = "4.0.8";
export {
  d as CallMediaType,
  G as CallRole,
  Y as FeatureButton,
  Je as LayoutMode,
  i as NAME,
  M as STATUS,
  s as StoreName,
  ai as TUICallKitServer,
  He as TUIGlobal,
  l as TUIStore,
  ri as Version,
  ne as VideoDisplayMode,
  oe as VideoResolution,
  X as t,
  V as uiDesign
};