hs-admin-ui 2.7.7 → 2.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{401-C698Eglh.js → 401-BuhS8Pk8.js} +1 -1
- package/dist/401-BuhS8Pk8.js.gz +0 -0
- package/dist/{401-BcbohUJZ.mjs → 401-Ccgmpl19.mjs} +1 -1
- package/dist/401-Ccgmpl19.mjs.gz +0 -0
- package/dist/{404-C41gdMo0.js → 404-Bv6jQTn_.js} +1 -1
- package/dist/{404-C41gdMo0.js.gz → 404-Bv6jQTn_.js.gz} +0 -0
- package/dist/{404-Cewog9Z1.mjs → 404-DvVS_NBb.mjs} +1 -1
- package/dist/404-DvVS_NBb.mjs.gz +0 -0
- package/dist/{account-14Py9BoA.mjs → account-CeZd7iBc.mjs} +2 -2
- package/dist/account-CeZd7iBc.mjs.gz +0 -0
- package/dist/{account-Dz0usOdl.js → account-kvltQ7Ll.js} +1 -1
- package/dist/account-kvltQ7Ll.js.gz +0 -0
- package/dist/{aside-Bc7sl2v3.mjs → aside-Ce1IiXP2.mjs} +2 -2
- package/dist/aside-Ce1IiXP2.mjs.gz +0 -0
- package/dist/{aside-sSZH8TDI.js → aside-DU1pUb-Q.js} +1 -1
- package/dist/aside-DU1pUb-Q.js.gz +0 -0
- package/dist/{btnIndex-B4m9fiDr.js → btnIndex-B4IGKMq_.js} +1 -1
- package/dist/btnIndex-B4IGKMq_.js.gz +0 -0
- package/dist/{btnIndex-CZRr1eG5.mjs → btnIndex-DFSmFV6a.mjs} +2 -2
- package/dist/btnIndex-DFSmFV6a.mjs.gz +0 -0
- package/dist/{classic-4RgVPENb.mjs → classic-C2mWJNmo.mjs} +2 -2
- package/dist/classic-C2mWJNmo.mjs.gz +0 -0
- package/dist/{classic-B9s1z4Aq.js → classic-CDspitYm.js} +1 -1
- package/dist/classic-CDspitYm.js.gz +0 -0
- package/dist/{cloneConfigDialog-ClG_hKE2.js → cloneConfigDialog-C7EDCjdi.js} +1 -1
- package/dist/cloneConfigDialog-C7EDCjdi.js.gz +0 -0
- package/dist/{cloneConfigDialog-C8zh37Ri.mjs → cloneConfigDialog-DBoHvlXV.mjs} +1 -1
- package/dist/cloneConfigDialog-DBoHvlXV.mjs.gz +0 -0
- package/dist/{columns-CauGdy9d.js → columns-C5qIKp3w.js} +1 -1
- package/dist/columns-C5qIKp3w.js.gz +0 -0
- package/dist/{columns-CNyd2FLf.mjs → columns-Csiy7zlk.mjs} +2 -2
- package/dist/columns-Csiy7zlk.mjs.gz +0 -0
- package/dist/{columnsAside-DdEI_vYi.mjs → columnsAside-9L2FeB-e.mjs} +1 -1
- package/dist/columnsAside-9L2FeB-e.mjs.gz +0 -0
- package/dist/{columnsAside-CGHNbKPF.js → columnsAside-C90m4I5Y.js} +1 -1
- package/dist/columnsAside-C90m4I5Y.js.gz +0 -0
- package/dist/{contextmenu-DjqJz7gR.mjs → contextmenu-5cWKEjj3.mjs} +1 -1
- package/dist/contextmenu-5cWKEjj3.mjs.gz +0 -0
- package/dist/{contextmenu-BAT8j8Zl.js → contextmenu-CWyPmlei.js} +1 -1
- package/dist/contextmenu-CWyPmlei.js.gz +0 -0
- package/dist/{contextmenu-8DD7r5FT.js → contextmenu-CwCZSxzN.js} +1 -1
- package/dist/contextmenu-CwCZSxzN.js.gz +0 -0
- package/dist/{contextmenu-DEpaIVS3.mjs → contextmenu-DCVRwgry.mjs} +1 -1
- package/dist/contextmenu-DCVRwgry.mjs.gz +0 -0
- package/dist/{contextmenu-DBNLyH0z.js → contextmenu-DCZKfyFQ.js} +1 -1
- package/dist/contextmenu-DCZKfyFQ.js.gz +0 -0
- package/dist/{contextmenu-WtQFlxpf.mjs → contextmenu-DMYmNo8w.mjs} +1 -1
- package/dist/contextmenu-DMYmNo8w.mjs.gz +0 -0
- package/dist/{defaults-CIoGR9se.mjs → defaults-Df1uKQcy.mjs} +2 -2
- package/dist/defaults-Df1uKQcy.mjs.gz +0 -0
- package/dist/{defaults-DBOJOeNe.js → defaults-jHLHeZaC.js} +1 -1
- package/dist/defaults-jHLHeZaC.js.gz +0 -0
- package/dist/{dialog-BlSyBqXK.mjs → dialog-CCvAzA5U.mjs} +1 -1
- package/dist/{dialog-D_VEMEav.js → dialog-CZHt-Ed1.js} +1 -1
- package/dist/{dialog-3vEWc-eh.mjs → dialog-Cp5HiBSa.mjs} +1 -1
- package/dist/{dialog-DFhta2xb.mjs → dialog-D3Pbu1oD.mjs} +1 -1
- package/dist/{dialog-g_Rhh8Ge.js → dialog-DQ34lK_F.js} +1 -1
- package/dist/{dialog-_VEeWI7_.js → dialog-MEtIT3X7.js} +1 -1
- package/dist/{dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-WitKlLFJ.mjs → dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-B27iNocp.mjs} +2 -2
- package/dist/dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-B27iNocp.mjs.gz +0 -0
- package/dist/{dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-DN-6IXfR.js → dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-BGJELu4U.js} +1 -1
- package/dist/dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-BGJELu4U.js.gz +0 -0
- package/dist/{dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-CyTLm4oZ.js → dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-93slyH-4.js} +1 -1
- package/dist/dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-93slyH-4.js.gz +0 -0
- package/dist/{dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-CkQ1F_8z.mjs → dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-BGpFnO8j.mjs} +2 -2
- package/dist/dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-BGpFnO8j.mjs.gz +0 -0
- package/dist/{dictDialog-Ce0DGiN5.mjs → dictDialog-D9VHPaFW.mjs} +1 -1
- package/dist/{dictDialog-BNUUXD3I.js → dictDialog-qW0H9Q2a.js} +1 -1
- package/dist/{dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-CWbaLrsL.mjs → dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-BmdUvhR8.mjs} +2 -2
- package/dist/dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-BmdUvhR8.mjs.gz +0 -0
- package/dist/{dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-Cmm1dOi_.js → dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-CFzX4o-Z.js} +1 -1
- package/dist/dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-CFzX4o-Z.js.gz +0 -0
- package/dist/{dictItemDialog-W-JmUjTs.js → dictItemDialog-DI4HToSm.js} +1 -1
- package/dist/{dictItemDialog--cXE_LiK.mjs → dictItemDialog-dFAKYbxO.mjs} +1 -1
- package/dist/{dictItemDialog.vue_vue_type_script_setup_true_lang-DIwaq-ia.js → dictItemDialog.vue_vue_type_script_setup_true_lang-Ce4JlDi8.js} +1 -1
- package/dist/dictItemDialog.vue_vue_type_script_setup_true_lang-Ce4JlDi8.js.gz +0 -0
- package/dist/{dictItemDialog.vue_vue_type_script_setup_true_lang-CAq295Cd.mjs → dictItemDialog.vue_vue_type_script_setup_true_lang-QrC2HBdq.mjs} +2 -2
- package/dist/dictItemDialog.vue_vue_type_script_setup_true_lang-QrC2HBdq.mjs.gz +0 -0
- package/dist/editDialog-Bi0fTJ4g.mjs +96 -0
- package/dist/editDialog-Bi0fTJ4g.mjs.gz +0 -0
- package/dist/editDialog-R7r0MLKB.js +1 -0
- package/dist/editDialog-R7r0MLKB.js.gz +0 -0
- package/dist/{formConfig-c7f84dXZ.mjs → formConfig-CZLg00mJ.mjs} +4 -4
- package/dist/formConfig-CZLg00mJ.mjs.gz +0 -0
- package/dist/{formConfig-Le-OaBsy.js → formConfig-DC_x9bud.js} +1 -1
- package/dist/formConfig-DC_x9bud.js.gz +0 -0
- package/dist/{header-CtOKcmz8.mjs → header-CJi17xdq.mjs} +2 -2
- package/dist/{header-C8Wfbpsu.js → header-CnY9hiWp.js} +1 -1
- package/dist/{horizontal-ChN20M7N.mjs → horizontal-Bi8ha-5w.mjs} +2 -2
- package/dist/horizontal-Bi8ha-5w.mjs.gz +0 -0
- package/dist/{horizontal-BvJMJArL.js → horizontal-ZYzse6VC.js} +1 -1
- package/dist/horizontal-ZYzse6VC.js.gz +0 -0
- package/dist/{hsAttrBtn-BbXroqPN.js → hsAttrBtn-D0OxMCFO.js} +1 -1
- package/dist/{hsAttrBtn-h-hl8OPh.mjs → hsAttrBtn-SoYMdzOw.mjs} +1 -1
- package/dist/{hsAttrBtn.vue_vue_type_script_setup_true_lang-C3btv2gt.js → hsAttrBtn.vue_vue_type_script_setup_true_lang-BdN3b0Q4.js} +1 -1
- package/dist/hsAttrBtn.vue_vue_type_script_setup_true_lang-BdN3b0Q4.js.gz +0 -0
- package/dist/{hsAttrBtn.vue_vue_type_script_setup_true_lang-7oK6NkAG.mjs → hsAttrBtn.vue_vue_type_script_setup_true_lang-DziuD3eS.mjs} +3 -3
- package/dist/hsAttrBtn.vue_vue_type_script_setup_true_lang-DziuD3eS.mjs.gz +0 -0
- package/dist/{hsAttrForm-B6p-PXmb.js → hsAttrForm-De71vu5w.js} +1 -1
- package/dist/{hsAttrForm-BYh49Lmk.mjs → hsAttrForm-R5IEDO4P.mjs} +1 -1
- package/dist/{hsAttrForm.vue_vue_type_script_setup_true_lang-Cj7CjGKO.js → hsAttrForm.vue_vue_type_script_setup_true_lang-Ci5WVZoD.js} +1 -1
- package/dist/hsAttrForm.vue_vue_type_script_setup_true_lang-Ci5WVZoD.js.gz +0 -0
- package/dist/{hsAttrForm.vue_vue_type_script_setup_true_lang-CsUkni5C.mjs → hsAttrForm.vue_vue_type_script_setup_true_lang-TPoBvbNd.mjs} +2 -2
- package/dist/hsAttrForm.vue_vue_type_script_setup_true_lang-TPoBvbNd.mjs.gz +0 -0
- package/dist/{hsBtnConfigList-DVj_lREC.js → hsBtnConfigList-CGRvw0Ax.js} +1 -1
- package/dist/hsBtnConfigList-CGRvw0Ax.js.gz +0 -0
- package/dist/{hsBtnConfigList-BQwjlNhs.mjs → hsBtnConfigList-FVWJQZzq.mjs} +1 -1
- package/dist/hsBtnConfigList-FVWJQZzq.mjs.gz +0 -0
- package/dist/{hsBtnItemConfig-Ce2mjNeC.js → hsBtnItemConfig-Daq4pZcs.js} +1 -1
- package/dist/{hsBtnItemConfig-B_7RyqmM.mjs → hsBtnItemConfig-_Wwfbsiw.mjs} +1 -1
- package/dist/{hsBtnItemConfig.vue_vue_type_script_setup_true_lang-BLe1tyyA.mjs → hsBtnItemConfig.vue_vue_type_script_setup_true_lang-DhZRE5fJ.mjs} +1 -1
- package/dist/hsBtnItemConfig.vue_vue_type_script_setup_true_lang-DhZRE5fJ.mjs.gz +0 -0
- package/dist/{hsBtnItemConfig.vue_vue_type_script_setup_true_lang-D6dKnjKT.js → hsBtnItemConfig.vue_vue_type_script_setup_true_lang-c3vJo2-D.js} +1 -1
- package/dist/hsBtnItemConfig.vue_vue_type_script_setup_true_lang-c3vJo2-D.js.gz +0 -0
- package/dist/{hsBtnPanel-B9rkk-ul.js → hsBtnPanel-CGi8-eVO.js} +1 -1
- package/dist/{hsBtnPanel-BeW1oSMW.mjs → hsBtnPanel-DOg9-fJ7.mjs} +1 -1
- package/dist/{hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-CTXGar27.mjs → hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-B_Tfu_dd.mjs} +4 -4
- package/dist/hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-B_Tfu_dd.mjs.gz +0 -0
- package/dist/{hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-CrdjUp9t.js → hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-X46L9_ed.js} +1 -1
- package/dist/hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-X46L9_ed.js.gz +0 -0
- package/dist/{hsExpand-GhIYHKIi.js → hsExpand-CtcVyjAH.js} +1 -1
- package/dist/{hsExpand-DMlqS0wS.mjs → hsExpand-CwOTq30G.mjs} +1 -1
- package/dist/{hsExpand.vue_vue_type_script_setup_true_lang-9AwjSkPP.js → hsExpand.vue_vue_type_script_setup_true_lang-B5gPHztS.js} +1 -1
- package/dist/hsExpand.vue_vue_type_script_setup_true_lang-B5gPHztS.js.gz +0 -0
- package/dist/{hsExpand.vue_vue_type_script_setup_true_lang-YkdDL_yf.mjs → hsExpand.vue_vue_type_script_setup_true_lang-BkaUJHd1.mjs} +1 -1
- package/dist/hsExpand.vue_vue_type_script_setup_true_lang-BkaUJHd1.mjs.gz +0 -0
- package/dist/{hsFormConfig-j6r77uoQ.js → hsFormConfig-BvKhF6l2.js} +1 -1
- package/dist/hsFormConfig-BvKhF6l2.js.gz +0 -0
- package/dist/{hsFormConfig-BmLvh1WG.mjs → hsFormConfig-D4LvvmMo.mjs} +1 -1
- package/dist/hsFormConfig-D4LvvmMo.mjs.gz +0 -0
- package/dist/{hsFormConfigList-c3x35vU9.mjs → hsFormConfigList-8426nMPq.mjs} +2 -2
- package/dist/hsFormConfigList-8426nMPq.mjs.gz +0 -0
- package/dist/{hsFormConfigList-D-ay6_G9.js → hsFormConfigList-CJvhXrPu.js} +1 -1
- package/dist/hsFormConfigList-CJvhXrPu.js.gz +0 -0
- package/dist/{hsFormPanel-Dn-GL_Ui.js → hsFormPanel-Cbs5Y6pc.js} +1 -1
- package/dist/{hsFormPanel-DyEwyNeJ.mjs → hsFormPanel-Pds-7aTH.mjs} +1 -1
- package/dist/{hsFormPanel.vue_vue_type_script_setup_true_name_formPanel_lang-CYgQ5MV5.mjs → hsFormPanel.vue_vue_type_script_setup_true_name_formPanel_lang-BBHCxLzF.mjs} +5 -5
- package/dist/hsFormPanel.vue_vue_type_script_setup_true_name_formPanel_lang-BBHCxLzF.mjs.gz +0 -0
- package/dist/{hsFormPanel.vue_vue_type_script_setup_true_name_formPanel_lang-tmfFVlP1.js → hsFormPanel.vue_vue_type_script_setup_true_name_formPanel_lang-D8rF4iw9.js} +1 -1
- package/dist/hsFormPanel.vue_vue_type_script_setup_true_name_formPanel_lang-D8rF4iw9.js.gz +0 -0
- package/dist/{hsFormParse-DFAZwo5K.js → hsFormParse-C7nhIu7k.js} +1 -1
- package/dist/{hsFormParse-C5Go0cU3.mjs → hsFormParse-DjAeN5JT.mjs} +1 -1
- package/dist/{hsFormParse.vue_vue_type_script_setup_true_lang-BX-fjadU.mjs → hsFormParse.vue_vue_type_script_setup_true_lang-C9D6Ccbw.mjs} +1 -1
- package/dist/hsFormParse.vue_vue_type_script_setup_true_lang-C9D6Ccbw.mjs.gz +0 -0
- package/dist/{hsFormParse.vue_vue_type_script_setup_true_lang-BG3lNn6s.js → hsFormParse.vue_vue_type_script_setup_true_lang-pwGQ4v33.js} +1 -1
- package/dist/hsFormParse.vue_vue_type_script_setup_true_lang-pwGQ4v33.js.gz +0 -0
- package/dist/{hsPanelItem-tPKJbLyG.mjs → hsPanelItem-BEafqypz.mjs} +1 -1
- package/dist/{hsPanelItem-B6RQMO4c.js → hsPanelItem-BIPWqO9P.js} +1 -1
- package/dist/{hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-BeEFQur0.js → hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-CkV7HFsy.js} +1 -1
- package/dist/hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-CkV7HFsy.js.gz +0 -0
- package/dist/{hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-CEigpKsU.mjs → hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-DJj0U_Bi.mjs} +1 -1
- package/dist/hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-DJj0U_Bi.mjs.gz +0 -0
- package/dist/{iframes-BkOdTJP9.mjs → iframes-BKiTXfkx.mjs} +1 -1
- package/dist/iframes-BKiTXfkx.mjs.gz +0 -0
- package/dist/{iframes-C7BTODnn.js → iframes-BlhPWh3z.js} +1 -1
- package/dist/iframes-BlhPWh3z.js.gz +0 -0
- package/dist/{index-ozmiCwlp.js → index-0eSusynb.js} +1 -1
- package/dist/{index-jFdcQxzc.js → index-0wVW69-x.js} +1 -1
- package/dist/index-0wVW69-x.js.gz +0 -0
- package/dist/{index-DEXQTBNr.js → index-3KcAnWll.js} +1 -1
- package/dist/index-3KcAnWll.js.gz +0 -0
- package/dist/{index-DluRS5wW.mjs → index-B7U_Fn_U.mjs} +1 -1
- package/dist/{index-CwKj7vdX.js → index-B8hboOXn.js} +1 -1
- package/dist/index-B8hboOXn.js.gz +0 -0
- package/dist/{index-CqQ3HEE_.mjs → index-BCKDDBQN.mjs} +1 -1
- package/dist/{index-F9VML3KY.js → index-BIJBM-dJ.js} +1 -1
- package/dist/index-BIJBM-dJ.js.gz +0 -0
- package/dist/{index-D7QBl3o7.js → index-BPelB04q.js} +1 -1
- package/dist/{index-BdmWJRf4.js → index-BRoYrDJY.js} +1 -1
- package/dist/index-BRoYrDJY.js.gz +0 -0
- package/dist/{index-DQVkMgoE.js → index-BSSb9cqX.js} +1 -1
- package/dist/index-BSSb9cqX.js.gz +0 -0
- package/dist/{index-DPVVvL_T.js → index-BXf3bDBy.js} +1 -1
- package/dist/{index-uCWhq7uK.js → index-B_syxApq.js} +1 -1
- package/dist/{index-DoLr7xAO.mjs → index-BalmDY6-.mjs} +1 -1
- package/dist/{index-DoLr7xAO.mjs.gz → index-BalmDY6-.mjs.gz} +0 -0
- package/dist/{index-Dm_MsMP2.mjs → index-BbKY5GPA.mjs} +1 -1
- package/dist/{index-YXh5T3Xa.js → index-BeJi8yV9.js} +1 -1
- package/dist/index-BeJi8yV9.js.gz +0 -0
- package/dist/{index-CFqnrsOO.js → index-BtQTTRPN.js} +1 -1
- package/dist/{index-Cam1QE0F.js → index-BvciXRE7.js} +1 -1
- package/dist/{index-DtEMm-i2.js → index-BwMvWj_A.js} +1 -1
- package/dist/index-BwMvWj_A.js.gz +0 -0
- package/dist/{index-7I03Ddul.js → index-BwQJTpzP.js} +1 -1
- package/dist/index-BwQJTpzP.js.gz +0 -0
- package/dist/{index-DjtBylBU.js → index-CCu6A9kH.js} +1 -1
- package/dist/{index-DhVQ9je-.mjs → index-CD0oGDuz.mjs} +1 -1
- package/dist/index-CD0oGDuz.mjs.gz +0 -0
- package/dist/{index-CFe_ospS.mjs → index-CKzP7bh5.mjs} +2 -2
- package/dist/index-CKzP7bh5.mjs.gz +0 -0
- package/dist/{index-1qv3Pv4_.mjs → index-CLVmJith.mjs} +1 -1
- package/dist/{index-DK01IzBm.mjs → index-CMD2ifnm.mjs} +2 -2
- package/dist/index-CMD2ifnm.mjs.gz +0 -0
- package/dist/{index-DRCV62Fc.mjs → index-CRRs8pX0.mjs} +4 -4
- package/dist/index-CRRs8pX0.mjs.gz +0 -0
- package/dist/index-CSpTknKL.mjs +4 -0
- package/dist/{index-BWBRuIVF.mjs → index-CXoxpk3p.mjs} +1 -1
- package/dist/index-CXoxpk3p.mjs.gz +0 -0
- package/dist/{index-jfi2QvZP.js → index-CazRV-MN.js} +1 -1
- package/dist/index-CazRV-MN.js.gz +0 -0
- package/dist/{index-nwTBY-Rc.js → index-ChIJZZbJ.js} +1 -1
- package/dist/index-ChIJZZbJ.js.gz +0 -0
- package/dist/{index-D5LLa9ui.mjs → index-CiKSF7mg.mjs} +2 -2
- package/dist/{index-BnCq0qge.mjs → index-Conlg2uI.mjs} +1 -1
- package/dist/index-Conlg2uI.mjs.gz +0 -0
- package/dist/{index-BSugGGQK.mjs → index-Cp8U9kK_.mjs} +1 -1
- package/dist/{index-B9rrlTUn.mjs → index-D-myyrPn.mjs} +3 -3
- package/dist/index-D-myyrPn.mjs.gz +0 -0
- package/dist/{index-EFK7zSC9.js → index-D0T4Sk7-.js} +1 -1
- package/dist/index-D0T4Sk7-.js.gz +0 -0
- package/dist/{index-BYvyRKop.mjs → index-D1RO4SOD.mjs} +4 -4
- package/dist/index-D1RO4SOD.mjs.gz +0 -0
- package/dist/{index-D1t5mFJ2.mjs → index-D27ajl2H.mjs} +1 -1
- package/dist/{index-BSB2o1lj.mjs → index-D3bRt_1k.mjs} +1 -1
- package/dist/index-D3bRt_1k.mjs.gz +0 -0
- package/dist/{index-CssvRIyM.mjs → index-D9b26PMx.mjs} +2 -2
- package/dist/index-D9b26PMx.mjs.gz +0 -0
- package/dist/{index-CVhW6yfq.mjs → index-DB8nou9w.mjs} +2 -2
- package/dist/index-DB8nou9w.mjs.gz +0 -0
- package/dist/{index-BLzK6Qop.js → index-DCcNA6N3.js} +1 -1
- package/dist/index-DCcNA6N3.js.gz +0 -0
- package/dist/{index-D6Ipfuyg.js → index-DG-pmoIQ.js} +1 -1
- package/dist/index-DG-pmoIQ.js.gz +0 -0
- package/dist/{index-4WsAYcV5.mjs → index-DKYLKRgf.mjs} +1 -1
- package/dist/index-DKYLKRgf.mjs.gz +0 -0
- package/dist/{index-F2h7fGV1.mjs → index-DPtbzjd1.mjs} +2 -2
- package/dist/index-DPtbzjd1.mjs.gz +0 -0
- package/dist/{index-CJuLq2tK.js → index-DQDO-5wp.js} +1 -1
- package/dist/index-DQDO-5wp.js.gz +0 -0
- package/dist/{index-Xcfro54s.js → index-D_05Cpql.js} +53 -53
- package/dist/index-D_05Cpql.js.gz +0 -0
- package/dist/{index-GePK2MXu.js → index-DgcCQYMG.js} +1 -1
- package/dist/index-DgcCQYMG.js.gz +0 -0
- package/dist/{index-fI-4dMYJ.mjs → index-DglOcNLG.mjs} +3 -3
- package/dist/index-DglOcNLG.mjs.gz +0 -0
- package/dist/{index-Dr0VMI5g.mjs → index-Di0nvAS2.mjs} +1 -1
- package/dist/{index-DN4KQo1D.mjs → index-DsPjsx39.mjs} +1 -1
- package/dist/{index-mM3FTvkD.js → index-Dsc-t4ql.js} +1 -1
- package/dist/index-Dsc-t4ql.js.gz +0 -0
- package/dist/{index-BewUxCBT.js → index-DtG-eK3N.js} +1 -1
- package/dist/index-DtG-eK3N.js.gz +0 -0
- package/dist/{index-BfSec_ip.js → index-G52CjyLp.js} +1 -1
- package/dist/{index-blLxDXDS.mjs → index-KPHsQmqs.mjs} +3896 -3896
- package/dist/index-KPHsQmqs.mjs.gz +0 -0
- package/dist/{index-DYHQXGkR.js → index-OAHflbu6.js} +1 -1
- package/dist/index-OAHflbu6.js.gz +0 -0
- package/dist/{index-JwJGwbq7.mjs → index-YkkiWfmC.mjs} +2 -2
- package/dist/index-YkkiWfmC.mjs.gz +0 -0
- package/dist/{index-ARUOueUL.mjs → index-_PBL9k65.mjs} +1 -1
- package/dist/{index-gGi_QOh6.js → index-hZQhSCTB.js} +1 -1
- package/dist/index-hZQhSCTB.js.gz +0 -0
- package/dist/{index-D0uR7gMh.js → index-hyCzyNsw.js} +1 -1
- package/dist/{index-BX4NwfsZ.mjs → index-iMCIzFD9.mjs} +1 -1
- package/dist/index-iMCIzFD9.mjs.gz +0 -0
- package/dist/{index-BkDkWMkD.mjs → index-kV7UjQOx.mjs} +1 -1
- package/dist/index-kV7UjQOx.mjs.gz +0 -0
- package/dist/{index-DlG1KFhi.js → index-rsGL8IN_.js} +1 -1
- package/dist/{index-_Rfcd0BF.mjs → index-snl6FrIF.mjs} +1 -1
- package/dist/index-snl6FrIF.mjs.gz +0 -0
- package/dist/{index-D9DDbeRk.mjs → index-tgUv2NHr.mjs} +5 -5
- package/dist/index-tgUv2NHr.mjs.gz +0 -0
- package/dist/{index-DhTmf34w.js → index-yvwO7IRy.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-B45FdpF6.mjs → index.vue_vue_type_script_setup_true_lang-BKQU0GVu.mjs} +1 -1
- package/dist/index.vue_vue_type_script_setup_true_lang-BKQU0GVu.mjs.gz +0 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-Dz7Vlv_P.mjs → index.vue_vue_type_script_setup_true_lang-C8Er0NQW.mjs} +1 -1
- package/dist/index.vue_vue_type_script_setup_true_lang-C8Er0NQW.mjs.gz +0 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-CNtHgxue.mjs → index.vue_vue_type_script_setup_true_lang-CUEB6DSa.mjs} +4 -4
- package/dist/index.vue_vue_type_script_setup_true_lang-CUEB6DSa.mjs.gz +0 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-Bs-Cm9Iv.js → index.vue_vue_type_script_setup_true_lang-D7fKcHhu.js} +1 -1
- package/dist/index.vue_vue_type_script_setup_true_lang-D7fKcHhu.js.gz +0 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-BAv57mIL.js → index.vue_vue_type_script_setup_true_lang-gy3Z_JNt.js} +1 -1
- package/dist/index.vue_vue_type_script_setup_true_lang-gy3Z_JNt.js.gz +0 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-PU1ILPsU.js → index.vue_vue_type_script_setup_true_lang-tU05Wplv.js} +1 -1
- package/dist/index.vue_vue_type_script_setup_true_lang-tU05Wplv.js.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_name_testtablecomponent_lang-DteJvpZq.mjs +103 -0
- package/dist/index.vue_vue_type_script_setup_true_name_testtablecomponent_lang-DteJvpZq.mjs.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_name_testtablecomponent_lang-IHKKDpLG.js +1 -0
- package/dist/index.vue_vue_type_script_setup_true_name_testtablecomponent_lang-IHKKDpLG.js.gz +0 -0
- package/dist/{link-CXn8a_yd.js → link-CAR7ocA3.js} +1 -1
- package/dist/link-CAR7ocA3.js.gz +0 -0
- package/dist/{link-BQZMB96l.mjs → link-CIPAgXF_.mjs} +1 -1
- package/dist/link-CIPAgXF_.mjs.gz +0 -0
- package/dist/{list-OLsjmwhb.mjs → list-92jMP49Z.mjs} +1 -1
- package/dist/list-92jMP49Z.mjs.gz +0 -0
- package/dist/{list-D8MS9wpW.js → list-DguHx5PY.js} +1 -1
- package/dist/list-DguHx5PY.js.gz +0 -0
- package/dist/{main-CH0Hw8lY.mjs → main-BX-N6Cbr.mjs} +2 -2
- package/dist/main-BX-N6Cbr.mjs.gz +0 -0
- package/dist/{main-D_dTACqE.js → main-CruaHuS2.js} +1 -1
- package/dist/main-CruaHuS2.js.gz +0 -0
- package/dist/{mobile-DHt6Vmn9.mjs → mobile-CiQHLCtD.mjs} +1 -1
- package/dist/mobile-CiQHLCtD.mjs.gz +0 -0
- package/dist/{mobile-BS63nbp8.js → mobile-D2TzVRaN.js} +1 -1
- package/dist/mobile-D2TzVRaN.js.gz +0 -0
- package/dist/{parent-dUg9KK5s.mjs → parent-CwFyw94Z.mjs} +2 -2
- package/dist/parent-CwFyw94Z.mjs.gz +0 -0
- package/dist/{parent-tYprw7Fs.js → parent-DjG2SYgK.js} +1 -1
- package/dist/parent-DjG2SYgK.js.gz +0 -0
- package/dist/{roleItem-Dviw252O.js → roleItem-BQu9mxeL.js} +1 -1
- package/dist/roleItem-BQu9mxeL.js.gz +0 -0
- package/dist/{roleItem-D3YQHl9M.mjs → roleItem-C7F867Tq.mjs} +1 -1
- package/dist/roleItem-C7F867Tq.mjs.gz +0 -0
- package/dist/{saveForm-CqkD4auA.js → saveForm-Dbq9ZXId.js} +1 -1
- package/dist/{saveForm-Bq1n5ryl.mjs → saveForm-h8NrmzqK.mjs} +1 -1
- package/dist/{saveForm.vue_vue_type_script_setup_true_lang-D4dPWtEP.mjs → saveForm.vue_vue_type_script_setup_true_lang-CsfB4Gsw.mjs} +2 -2
- package/dist/saveForm.vue_vue_type_script_setup_true_lang-CsfB4Gsw.mjs.gz +0 -0
- package/dist/{saveForm.vue_vue_type_script_setup_true_lang-DEa1_TDW.js → saveForm.vue_vue_type_script_setup_true_lang-DkFQql5D.js} +1 -1
- package/dist/saveForm.vue_vue_type_script_setup_true_lang-DkFQql5D.js.gz +0 -0
- package/dist/{scan-CsdVKahz.mjs → scan-CBPkJdTW.mjs} +1 -1
- package/dist/scan-CBPkJdTW.mjs.gz +0 -0
- package/dist/{scan-BIwWdCbv.js → scan-CspcqdUt.js} +1 -1
- package/dist/scan-CspcqdUt.js.gz +0 -0
- package/dist/{search-DX2QNCIU.mjs → search-BV_77SC8.mjs} +1 -1
- package/dist/search-BV_77SC8.mjs.gz +0 -0
- package/dist/{search-CbLjVBL2.js → search-jsw8RjtQ.js} +1 -1
- package/dist/search-jsw8RjtQ.js.gz +0 -0
- package/dist/{selectConfig-Da1VHdLx.js → selectConfig-BD5Pixnu.js} +1 -1
- package/dist/selectConfig-BD5Pixnu.js.gz +0 -0
- package/dist/{selectConfig-BLKI7HAC.mjs → selectConfig-DdSnfbgi.mjs} +1 -1
- package/dist/selectConfig-DdSnfbgi.mjs.gz +0 -0
- package/dist/style.css +1 -1
- package/dist/style.css.gz +0 -0
- package/dist/{subItem-PvgtpvTm.js → subItem-CyboPYlD.js} +1 -1
- package/dist/subItem-CyboPYlD.js.gz +0 -0
- package/dist/{subItem-BVqcjpJX.mjs → subItem-D1ONIr8o.mjs} +1 -1
- package/dist/subItem-D1ONIr8o.mjs.gz +0 -0
- package/dist/{tagsView-Mr7-931h.js → tagsView-5ZA8BhVl.js} +2 -2
- package/dist/tagsView-5ZA8BhVl.js.gz +0 -0
- package/dist/{tagsView-CD-Fs2Bp.mjs → tagsView-DsIF6KY8.mjs} +2 -2
- package/dist/tagsView-DsIF6KY8.mjs.gz +0 -0
- package/dist/{transverse-ck-Ik5gp.mjs → transverse-DLnvtqqj.mjs} +2 -2
- package/dist/transverse-DLnvtqqj.mjs.gz +0 -0
- package/dist/{transverse-Do-fiJTK.js → transverse-Dtkpuj7n.js} +1 -1
- package/dist/transverse-Dtkpuj7n.js.gz +0 -0
- package/dist/types/components/business/bcBox/bcBox.vue.d.ts +0 -6
- package/dist/types/views/test/table/components/editDialog/editDialog.vue.d.ts +32 -0
- package/dist/types/views/test/table/components/editDialog/index.d.ts +4 -0
- package/dist/{uploadAvatar-8_7WSYju.js → uploadAvatar-BtC-nhG5.js} +1 -1
- package/dist/uploadAvatar-BtC-nhG5.js.gz +0 -0
- package/dist/{uploadAvatar-B2Pn34XF.mjs → uploadAvatar-DBXDUhxq.mjs} +1 -1
- package/dist/uploadAvatar-DBXDUhxq.mjs.gz +0 -0
- package/dist/{user-tN8zqXBo.mjs → user-BUIuez-t.mjs} +3 -3
- package/dist/user-BUIuez-t.mjs.gz +0 -0
- package/dist/{user-DX-gSg6B.js → user-Dphc6VQS.js} +1 -1
- package/dist/user-Dphc6VQS.js.gz +0 -0
- package/dist/{userNews-C9DUGXCz.js → userNews-CSRz5wAg.js} +1 -1
- package/dist/userNews-CSRz5wAg.js.gz +0 -0
- package/dist/{userNews-CkNi6f4g.mjs → userNews-DxJ42KVr.mjs} +1 -1
- package/dist/userNews-DxJ42KVr.mjs.gz +0 -0
- package/dist/{userSelect-45_F6pgo.js → userSelect-DuX5BoCj.js} +1 -1
- package/dist/{userSelect-Cg8gJyyd.mjs → userSelect-nD9iMVMC.mjs} +1 -1
- package/dist/{userSelect.vue_vue_type_script_setup_true_lang-Cc9WG4Ej.js → userSelect.vue_vue_type_script_setup_true_lang-BIqdCCmZ.js} +1 -1
- package/dist/userSelect.vue_vue_type_script_setup_true_lang-BIqdCCmZ.js.gz +0 -0
- package/dist/{userSelect.vue_vue_type_script_setup_true_lang-qvETHldR.mjs → userSelect.vue_vue_type_script_setup_true_lang-s0VSNltN.mjs} +1 -1
- package/dist/userSelect.vue_vue_type_script_setup_true_lang-s0VSNltN.mjs.gz +0 -0
- package/dist/{vertical-kLhshmDe.mjs → vertical-CLStKsq-.mjs} +2 -2
- package/dist/vertical-CLStKsq-.mjs.gz +0 -0
- package/dist/{vertical-C3mwdrrq.js → vertical-qWYnhJcb.js} +1 -1
- package/dist/vertical-qWYnhJcb.js.gz +0 -0
- package/package.json +1 -1
- package/dist/401-BcbohUJZ.mjs.gz +0 -0
- package/dist/401-C698Eglh.js.gz +0 -0
- package/dist/404-Cewog9Z1.mjs.gz +0 -0
- package/dist/account-14Py9BoA.mjs.gz +0 -0
- package/dist/account-Dz0usOdl.js.gz +0 -0
- package/dist/aside-Bc7sl2v3.mjs.gz +0 -0
- package/dist/aside-sSZH8TDI.js.gz +0 -0
- package/dist/btnIndex-B4m9fiDr.js.gz +0 -0
- package/dist/btnIndex-CZRr1eG5.mjs.gz +0 -0
- package/dist/classic-4RgVPENb.mjs.gz +0 -0
- package/dist/classic-B9s1z4Aq.js.gz +0 -0
- package/dist/cloneConfigDialog-C8zh37Ri.mjs.gz +0 -0
- package/dist/cloneConfigDialog-ClG_hKE2.js.gz +0 -0
- package/dist/columns-CNyd2FLf.mjs.gz +0 -0
- package/dist/columns-CauGdy9d.js.gz +0 -0
- package/dist/columnsAside-CGHNbKPF.js.gz +0 -0
- package/dist/columnsAside-DdEI_vYi.mjs.gz +0 -0
- package/dist/contextmenu-8DD7r5FT.js.gz +0 -0
- package/dist/contextmenu-BAT8j8Zl.js.gz +0 -0
- package/dist/contextmenu-DBNLyH0z.js.gz +0 -0
- package/dist/contextmenu-DEpaIVS3.mjs.gz +0 -0
- package/dist/contextmenu-DjqJz7gR.mjs.gz +0 -0
- package/dist/contextmenu-WtQFlxpf.mjs.gz +0 -0
- package/dist/defaults-CIoGR9se.mjs.gz +0 -0
- package/dist/defaults-DBOJOeNe.js.gz +0 -0
- package/dist/dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-DN-6IXfR.js.gz +0 -0
- package/dist/dialog.vue_vue_type_script_setup_true_name_dataAuthDialog_lang-WitKlLFJ.mjs.gz +0 -0
- package/dist/dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-CkQ1F_8z.mjs.gz +0 -0
- package/dist/dialog.vue_vue_type_script_setup_true_name_systemMenuDialog_lang-CyTLm4oZ.js.gz +0 -0
- package/dist/dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-CWbaLrsL.mjs.gz +0 -0
- package/dist/dictDialog.vue_vue_type_script_setup_true_name_dictDialog_lang-Cmm1dOi_.js.gz +0 -0
- package/dist/dictItemDialog.vue_vue_type_script_setup_true_lang-CAq295Cd.mjs.gz +0 -0
- package/dist/dictItemDialog.vue_vue_type_script_setup_true_lang-DIwaq-ia.js.gz +0 -0
- package/dist/formConfig-Le-OaBsy.js.gz +0 -0
- package/dist/formConfig-c7f84dXZ.mjs.gz +0 -0
- package/dist/horizontal-BvJMJArL.js.gz +0 -0
- package/dist/horizontal-ChN20M7N.mjs.gz +0 -0
- package/dist/hsAttrBtn.vue_vue_type_script_setup_true_lang-7oK6NkAG.mjs.gz +0 -0
- package/dist/hsAttrBtn.vue_vue_type_script_setup_true_lang-C3btv2gt.js.gz +0 -0
- package/dist/hsAttrForm.vue_vue_type_script_setup_true_lang-Cj7CjGKO.js.gz +0 -0
- package/dist/hsAttrForm.vue_vue_type_script_setup_true_lang-CsUkni5C.mjs.gz +0 -0
- package/dist/hsBtnConfigList-BQwjlNhs.mjs.gz +0 -0
- package/dist/hsBtnConfigList-DVj_lREC.js.gz +0 -0
- package/dist/hsBtnItemConfig.vue_vue_type_script_setup_true_lang-BLe1tyyA.mjs.gz +0 -0
- package/dist/hsBtnItemConfig.vue_vue_type_script_setup_true_lang-D6dKnjKT.js.gz +0 -0
- package/dist/hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-CTXGar27.mjs.gz +0 -0
- package/dist/hsBtnPanel.vue_vue_type_script_setup_true_name_formPanel_lang-CrdjUp9t.js.gz +0 -0
- package/dist/hsExpand.vue_vue_type_script_setup_true_lang-9AwjSkPP.js.gz +0 -0
- package/dist/hsExpand.vue_vue_type_script_setup_true_lang-YkdDL_yf.mjs.gz +0 -0
- package/dist/hsFormConfig-BmLvh1WG.mjs.gz +0 -0
- package/dist/hsFormConfig-j6r77uoQ.js.gz +0 -0
- package/dist/hsFormConfigList-D-ay6_G9.js.gz +0 -0
- package/dist/hsFormConfigList-c3x35vU9.mjs.gz +0 -0
- package/dist/hsFormPanel.vue_vue_type_script_setup_true_name_formPanel_lang-CYgQ5MV5.mjs.gz +0 -0
- package/dist/hsFormPanel.vue_vue_type_script_setup_true_name_formPanel_lang-tmfFVlP1.js.gz +0 -0
- package/dist/hsFormParse.vue_vue_type_script_setup_true_lang-BG3lNn6s.js.gz +0 -0
- package/dist/hsFormParse.vue_vue_type_script_setup_true_lang-BX-fjadU.mjs.gz +0 -0
- package/dist/hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-BeEFQur0.js.gz +0 -0
- package/dist/hsPanelItem.vue_vue_type_script_setup_true_name_panelItem_lang-CEigpKsU.mjs.gz +0 -0
- package/dist/iframes-BkOdTJP9.mjs.gz +0 -0
- package/dist/iframes-C7BTODnn.js.gz +0 -0
- package/dist/index-4WsAYcV5.mjs.gz +0 -0
- package/dist/index-7I03Ddul.js.gz +0 -0
- package/dist/index-B9rrlTUn.mjs.gz +0 -0
- package/dist/index-BLzK6Qop.js.gz +0 -0
- package/dist/index-BSB2o1lj.mjs.gz +0 -0
- package/dist/index-BWBRuIVF.mjs.gz +0 -0
- package/dist/index-BX4NwfsZ.mjs.gz +0 -0
- package/dist/index-BYvyRKop.mjs.gz +0 -0
- package/dist/index-BdmWJRf4.js.gz +0 -0
- package/dist/index-BewUxCBT.js.gz +0 -0
- package/dist/index-BkDkWMkD.mjs.gz +0 -0
- package/dist/index-BnCq0qge.mjs.gz +0 -0
- package/dist/index-CFe_ospS.mjs.gz +0 -0
- package/dist/index-CJuLq2tK.js.gz +0 -0
- package/dist/index-CVhW6yfq.mjs.gz +0 -0
- package/dist/index-CssvRIyM.mjs.gz +0 -0
- package/dist/index-CtJtsPiA.mjs +0 -4
- package/dist/index-CwKj7vdX.js.gz +0 -0
- package/dist/index-D6Ipfuyg.js.gz +0 -0
- package/dist/index-D9DDbeRk.mjs.gz +0 -0
- package/dist/index-DEXQTBNr.js.gz +0 -0
- package/dist/index-DK01IzBm.mjs.gz +0 -0
- package/dist/index-DQVkMgoE.js.gz +0 -0
- package/dist/index-DRCV62Fc.mjs.gz +0 -0
- package/dist/index-DYHQXGkR.js.gz +0 -0
- package/dist/index-DhVQ9je-.mjs.gz +0 -0
- package/dist/index-DtEMm-i2.js.gz +0 -0
- package/dist/index-EFK7zSC9.js.gz +0 -0
- package/dist/index-F2h7fGV1.mjs.gz +0 -0
- package/dist/index-F9VML3KY.js.gz +0 -0
- package/dist/index-GePK2MXu.js.gz +0 -0
- package/dist/index-JwJGwbq7.mjs.gz +0 -0
- package/dist/index-Xcfro54s.js.gz +0 -0
- package/dist/index-YXh5T3Xa.js.gz +0 -0
- package/dist/index-_Rfcd0BF.mjs.gz +0 -0
- package/dist/index-blLxDXDS.mjs.gz +0 -0
- package/dist/index-fI-4dMYJ.mjs.gz +0 -0
- package/dist/index-gGi_QOh6.js.gz +0 -0
- package/dist/index-jFdcQxzc.js.gz +0 -0
- package/dist/index-jfi2QvZP.js.gz +0 -0
- package/dist/index-mM3FTvkD.js.gz +0 -0
- package/dist/index-nwTBY-Rc.js.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_lang-B45FdpF6.mjs.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_lang-BAv57mIL.js.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_lang-Bs-Cm9Iv.js.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_lang-CNtHgxue.mjs.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_lang-Dz7Vlv_P.mjs.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_lang-PU1ILPsU.js.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_name_testtablecomponent_lang-BdTTnuXn.js +0 -1
- package/dist/index.vue_vue_type_script_setup_true_name_testtablecomponent_lang-BdTTnuXn.js.gz +0 -0
- package/dist/index.vue_vue_type_script_setup_true_name_testtablecomponent_lang-CyTX6NAM.mjs +0 -109
- package/dist/index.vue_vue_type_script_setup_true_name_testtablecomponent_lang-CyTX6NAM.mjs.gz +0 -0
- package/dist/link-BQZMB96l.mjs.gz +0 -0
- package/dist/link-CXn8a_yd.js.gz +0 -0
- package/dist/list-D8MS9wpW.js.gz +0 -0
- package/dist/list-OLsjmwhb.mjs.gz +0 -0
- package/dist/main-CH0Hw8lY.mjs.gz +0 -0
- package/dist/main-D_dTACqE.js.gz +0 -0
- package/dist/mobile-BS63nbp8.js.gz +0 -0
- package/dist/mobile-DHt6Vmn9.mjs.gz +0 -0
- package/dist/parent-dUg9KK5s.mjs.gz +0 -0
- package/dist/parent-tYprw7Fs.js.gz +0 -0
- package/dist/roleItem-D3YQHl9M.mjs.gz +0 -0
- package/dist/roleItem-Dviw252O.js.gz +0 -0
- package/dist/saveForm.vue_vue_type_script_setup_true_lang-D4dPWtEP.mjs.gz +0 -0
- package/dist/saveForm.vue_vue_type_script_setup_true_lang-DEa1_TDW.js.gz +0 -0
- package/dist/scan-BIwWdCbv.js.gz +0 -0
- package/dist/scan-CsdVKahz.mjs.gz +0 -0
- package/dist/search-CbLjVBL2.js.gz +0 -0
- package/dist/search-DX2QNCIU.mjs.gz +0 -0
- package/dist/selectConfig-BLKI7HAC.mjs.gz +0 -0
- package/dist/selectConfig-Da1VHdLx.js.gz +0 -0
- package/dist/subItem-BVqcjpJX.mjs.gz +0 -0
- package/dist/subItem-PvgtpvTm.js.gz +0 -0
- package/dist/tagsView-CD-Fs2Bp.mjs.gz +0 -0
- package/dist/tagsView-Mr7-931h.js.gz +0 -0
- package/dist/transverse-Do-fiJTK.js.gz +0 -0
- package/dist/transverse-ck-Ik5gp.mjs.gz +0 -0
- package/dist/uploadAvatar-8_7WSYju.js.gz +0 -0
- package/dist/uploadAvatar-B2Pn34XF.mjs.gz +0 -0
- package/dist/user-DX-gSg6B.js.gz +0 -0
- package/dist/user-tN8zqXBo.mjs.gz +0 -0
- package/dist/userNews-C9DUGXCz.js.gz +0 -0
- package/dist/userNews-CkNi6f4g.mjs.gz +0 -0
- package/dist/userSelect.vue_vue_type_script_setup_true_lang-Cc9WG4Ej.js.gz +0 -0
- package/dist/userSelect.vue_vue_type_script_setup_true_lang-qvETHldR.mjs.gz +0 -0
- package/dist/vertical-C3mwdrrq.js.gz +0 -0
- package/dist/vertical-kLhshmDe.mjs.gz +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),di=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),di=require("./index-D_05Cpql.js");var P0={exports:{}},bL;function vb(){return bL||(bL=1,function(s,d){(function(A,u){s.exports=u()})(di.commonjsGlobal,function(){function A(e,n){var o,a=Object.keys(e);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(e),n&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),a.push.apply(a,o)),a}function u(e){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{};n%2?A(Object(o),!0).forEach(function(a){S(e,a,o[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):A(Object(o)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(o,a))})}return e}function I(e){return(I=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(e)}function f(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function v(e,n){for(var o=0;o<n.length;o++){var a=n[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function y(e,n,o){return n&&v(e.prototype,n),o&&v(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(e,n,o){return n in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,e}function E(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&x(e,n)}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(e)}function x(e,n){return(x=Object.setPrototypeOf||function(o,a){return o.__proto__=a,o})(e,n)}function P(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function U(e,n,o){return(U=P()?Reflect.construct:function(a,M,h){var m=[null],M=(m.push.apply(m,M),new(Function.bind.apply(a,m)));return h&&x(M,h.prototype),M}).apply(null,arguments)}function Q(e){var n=typeof Map=="function"?new Map:void 0;return function(o){if(o===null||Function.toString.call(o).indexOf("[native code]")===-1)return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(n!==void 0){if(n.has(o))return n.get(o);n.set(o,a)}function a(){return U(o,arguments,N(this).constructor)}return a.prototype=Object.create(o.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),x(a,o)}(e)}function b(e,n){if(e==null)return{};var o,a=function(m,M){if(m==null)return{};for(var L,F={},$=Object.keys(m),ue=0;ue<$.length;ue++)L=$[ue],0<=M.indexOf(L)||(F[L]=m[L]);return F}(e,n);if(Object.getOwnPropertySymbols)for(var l=Object.getOwnPropertySymbols(e),h=0;h<l.length;h++)o=l[h],0<=n.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(a[o]=e[o]);return a}function k(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B(e){var n=P();return function(){var o,a=N(e),a=(o=n?(o=N(this).constructor,Reflect.construct(a,arguments,o)):a.apply(this,arguments),this);if(o&&(typeof o=="object"||typeof o=="function"))return o;if(o!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k(a)}}function K(e,n){return ee(e)||function(o,a){var l=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(l!=null){var h,m,M=[],L=!0,F=!1;try{for(l=l.call(o);!(L=(h=l.next()).done)&&(M.push(h.value),!a||M.length!==a);L=!0);}catch($){F=!0,m=$}finally{try{L||l.return==null||l.return()}finally{if(F)throw m}}return M}}(e,n)||X(e,n)||G()}function V(e){return function(n){if(Array.isArray(n))return Y(n)}(e)||H(e)||X(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ee(e){if(Array.isArray(e))return e}function H(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function X(e,n){if(e){if(typeof e=="string")return Y(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);return(o=o==="Object"&&e.constructor?e.constructor.name:o)==="Map"||o==="Set"?Array.from(e):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Y(e,n):void 0}}function Y(e,n){(n==null||n>e.length)&&(n=e.length);for(var o=0,a=new Array(n);o<n;o++)a[o]=e[o];return a}function G(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J(e,n){var o,a=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=X(e))||n&&e&&typeof e.length=="number")return a&&(e=a),o=0,{s:n=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(M){throw M},f:n};throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,h=!0,m=!1;return{s:function(){a=a.call(e)},n:function(){var M=a.next();return h=M.done,M},e:function(M){m=!0,l=M},f:function(){try{h||a.return==null||a.return()}finally{if(m)throw l}}}}var R={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",ROOM_CUSTOM_DATA_RECEIVED:"onRoomCustomDataReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",MESSAGE_REACTIONS_UPDATED:"onMessageReactionsUpdated",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",MY_FOLLOWERS_LIST_UPDATED:"onMyFollowersListUpdated",MY_FOLLOWING_LIST_UPDATED:"onMyFollowingListUpdated",MUTUAL_FOLLOWERS_LIST_UPDATED:"onMutualFollowersListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",ALL_RECEIVE_MESSAGE_OPT_UPDATED:"onAllReceiveMessageOptUpdated"},C={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_ROOM:"Room",GRP_LIVE:"Live",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INVITE_OPTION:"inviteOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3},W={NEW_INVITATION_RECEIVED:"newInvitationReceived",INVITEE_ACCEPTED:"ts_invitee_accepted",INVITEE_REJECTED:"ts_invitee_rejected",INVITATION_CANCELLED:"ts_invitation_cancelled",INVITATION_TIMEOUT:"ts_invitation_timeout",INVITATION_MODIFIED:"ts_invitation_modified",ACTION_TYPE_UNKNOWN:0,ACTION_TYPE_INVITE:1,ACTION_TYPE_CANCEL_INVITE:2,ACTION_TYPE_ACCEPT_INVITE:3,ACTION_TYPE_REJECT_INVITE:4,ACTION_TYPE_INVITE_TIMEOUT:5},q=(y(z,[{key:"use",value:function(e){if(typeof e!="function")throw"middleware must be a function";return this.cache.push(e),this}},{key:"next",value:function(e){if(this.middlewares&&0<this.middlewares.length)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:"run",value:function(e){return this.middlewares=this.cache.map(function(n){return n}),this.options=e,this.next()}}]),z),Z=(y(te,[{key:"equal",value:function(e){return e!==null&&this.low===e.low&&this.high===e.high}},{key:"toString",value:function(){var e=Number(this.high).toString(16),n=Number(this.low).toString(16);if(n.length<8)for(var o=8-n.length;o;)n="0"+n,o--;return e+n}}]),te),ie={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"},INDONESIA:{DEFAULT:"wss://wssidn-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT:"wss://wsssgp.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",STAT:"https://apisgp.my-imcloud.com",ANYCAST:"wss://162.14.19.159"},KOREA:{DEFAULT:"wss://wsskr.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",STAT:"https://apikr.my-imcloud.com",ANYCAST:"wss://162.14.13.104"},GERMANY:{DEFAULT:"wss://wssger.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",STAT:"https://apiger.my-imcloud.com",ANYCAST:"wss://162.14.3.17"},IND:{DEFAULT:"wss://wssind.my-imcloud.com",BACKUP:"wss://wssind.im.qcloud.com",STAT:"https://apiind.my-imcloud.com",ANYCAST:"wss://162.14.18.188"},JPN:{DEFAULT:"wss://wssjpn.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT:"wss://wssusa.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",STAT:"https://apiusa.my-imcloud.com",ANYCAST:"wss://162.14.10.42"},INDONESIA:{DEFAULT:"wss://wssidn.im.qcloud.com",BACKUP:"wss://wssidn.my-imcloud.com",STAT:"https://apiidn.my-imcloud.com",ANYCAST:"wss://43.129.34.169"}}},oe={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15},ve="1.7.3",_e=537048168,me="CHINA",re={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent:function(){this.CURRENT=ie.PRODUCTION[0<arguments.length&&arguments[0]!==void 0?arguments[0]:me]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GRP:"group_open_http_svc",GRP_AV:"group_open_avchatroom_http_svc",GRP_COMMUNITY:"million_group_open_http_svc",GRP_ATTR:"group_open_attr_http_svc",FD:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GRP_NO_AUTH:"group_open_http_noauth_svc",BIG_GRP_POLLING:"group_open_long_polling_http_svc",BIG_GRP_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MSG:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate",IM_OPEN_SPEECH:"im_open_speech",MSG_SEARCH:"message_search",FOLLOW:"follow",OFFLINE_PUSH_REPORT:"offline_push_report",IM_MSG_LOGIC:"im_msg_db_logic"}},pe={SEARCH_MSG:new Z(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new Z(0,Math.pow(2,1)).toString(),AV_HISTORY_MSG:new Z(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new Z(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new Z(0,Math.pow(2,4)).toString(),AV_MBR_LIST:new Z(0,Math.pow(2,6)).toString(),USER_STATUS:new Z(0,Math.pow(2,7)).toString(),CONV_MARK:new Z(0,Math.pow(2,9)).toString(),CONV_GROUP:new Z(0,Math.pow(2,10)).toString(),AV_BAN_MBR:new Z(0,Math.pow(2,11)).toString(),MSG_EXT:new Z(0,Math.pow(2,13)).toString(),GRP_COUNTER:new Z(0,Math.pow(2,15)).toString(),PLUGIN_TRANSLATE:new Z(Math.pow(2,6)).toString(),PLUGIN_VOICE_TO_TEXT:new Z(Math.pow(2,7)).toString(),PLUGIN_CS:new Z(Math.pow(2,8)).toString(),PLUGIN_PUSH:new Z(Math.pow(2,9)).toString(),PLUGIN_BOT:new Z(Math.pow(2,10)).toString(),MSG_REACTION:new Z(Math.pow(2,16)).toString(),FOLLOW:new Z(Math.pow(2,20)).toString()},ae="group_profile";function te(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:0,n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0;f(this,te),this.high=e,this.low=n}function z(){f(this,z),this.cache=[],this.options=null}re.HOST.setCurrent(me);var Ie=typeof wx<"u"&&typeof wx.getSystemInfoSync=="function"&&!!wx.getSystemInfoSync().fontSizeSetting,Ae=Ie&&typeof wx.createGamePortal=="function",ye=typeof qq<"u"&&typeof qq.getSystemInfoSync=="function"&&!!qq.getSystemInfoSync().fontSizeSetting,Me=typeof tt<"u"&&typeof tt.getSystemInfoSync=="function"&&!!tt.getSystemInfoSync().fontSizeSetting,De=typeof swan<"u"&&typeof swan.getSystemInfoSync=="function"&&!!swan.getSystemInfoSync().fontSizeSetting,Pe=typeof my<"u"&&typeof my.getSystemInfoSync=="function"&&!!my.getSystemInfoSync().fontSizeSetting,Jt=typeof jd<"u"&&typeof jd.getSystemInfoSync=="function",We=typeof uni<"u"&&typeof window>"u"&&typeof uni.requireNativePlugin=="function",Ze=typeof uni<"u",Fe=Ie||ye||Me||De||Pe||We||Jt,lt=(typeof uni<"u"||typeof window<"u")&&!Fe,Ne=ye?qq:Me?tt:De?swan:Pe?my:Ie?wx:We?uni:Jt?jd:{},rt=lt&&window&&window.navigator&&window.navigator.userAgent||"",Jt=/(micromessenger|webbrowser)/i.test(rt),nt=/AppleWebKit\/([\d.]+)/i.exec(rt);nt&&parseFloat(nt.pop()),nt="WEB",Jt?nt="WEB":ye?nt="QQ_MP":Me?nt="TT_MP":De?nt="BAIDU_MP":Pe?nt="ALI_MP":Ie?nt="WX_MP":We&&(nt="UNI_NATIVE_APP");var yt=oe[nt],Jt=/iPad/i.test(rt),nt=/iPhone/i.test(rt)&&!Jt,Wt=/iPod/i.test(rt),vt=nt||Jt||Wt,Lt=(nt=rt.match(/OS (\d+)_/i))&&nt[1]?nt[1]:null,Mt=/Android/i.test(rt),at=function(){var e=rt.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var n=e[1]&&parseFloat(e[1]),o=e[2]&&parseFloat(e[2]);return n&&o?parseFloat(e[1]+"."+e[2]):n||null}(),Jt=/Edge/i.test(rt),Wt=!Jt&&/Chrome/i.test(rt),Ue=((nt=rt.match(/Chrome\/(\d+)/))&&nt[1]&&parseFloat(nt[1]),/MSIE/.test(rt)||-1<rt.indexOf("Trident")&&-1<rt.indexOf("rv:11.0")),$e=nt=!(nt=(nt=/MSIE\s(\d+)\.\d/.exec(rt))&&parseFloat(nt[1]))&&/Trident\/7.0/i.test(rt)&&/rv:11.0/.test(rt)?11:nt,ct=/Safari/i.test(rt)&&!Wt&&!Mt&&!Jt;(nt=rt.match(/TBS\/(\d+)/i))&&nt[1]&&nt[1];for(var xt,Dn=/Windows/i.test(rt),bn=/MAC OS X/i.test(rt),kn=lt&&typeof Worker<"u"&&!Ue,Gn=Mt||vt,Jn=lt&&window.tencent_cloud_im_csig_flutter_for_web_25F_cy!==void 0,bt=function(){if(typeof window>"u"||window.navigator===void 0)return!1;var e=window.navigator.standalone;return!(!vt||e||ct)}(),wn=typeof console<"u"?console:typeof di.commonjsGlobal<"u"&&di.commonjsGlobal.console?di.commonjsGlobal.console:typeof window<"u"&&window.console?window.console:{},fn=function(){},Qe=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Re=Qe.length;Re--;)xt=Qe[Re],console[xt]||(wn[xt]=fn);function se(){var e=new Date;return e.setTime(dt()),e}function de(){He=0}function Se(){return Math.floor(dt()/1e3)}var ke=wn,He=0,dt=function(){return new Date().getTime()+He},Xe=0;function it(){return bo()?"%c Chat %c":"Chat"}function st(){var e=se();return e.toLocaleTimeString("en-US",{hour12:!1})+"."+function(n){var o;switch(n.toString().length){case 1:o="00"+n;break;case 2:o="0"+n;break;default:o=n}return o}(e.getMilliseconds())}var w={arguments2String:function(e){var n="";if(e.length===1)n=e[0];else for(var o=0,a=e.length;o<a;o++)tr(e[o])?xd(e[o])?n+=Xl(e[o]):n+=JSON.stringify(e[o]):n+=e[o],n+=" ";return n},_exec:function(e,n){bo()?ke[e](it(),"background:#0abf5b; padding:1px; border-radius:3px; color: #fff","background:transparent",st(),n):ke[e]("".concat(it()," ").concat(st()," ").concat(n))},d:function(){var e;Xe<=-1&&(e=this.arguments2String(arguments),this._exec("debug",e))},l:function(){var e;Xe<=0&&(e=this.arguments2String(arguments),this._exec("log",e))},log:function(){var e;Xe<=0&&(e=this.arguments2String(arguments),this._exec("log",e))},i:function(){var e;Xe<=1&&(e=this.arguments2String(arguments),this._exec("info",e))},w:function(){var e;Xe<=2&&(e=this.arguments2String(arguments),this._exec("warn",e))},e:function(){var e;Xe<=3&&(e=this.arguments2String(arguments),this._exec("error",e))},setLevel:function(e){e<4&&this._exec("log","set level from "+Xe+" to "+e),Xe=e},getLevel:function(){return Xe}},Rt={JPG:1,JPEG:1,GIF:2,PNG:3,BMP:4,UNKNOWN:255},Wt="Tag_Profile_IM_",gt={NICK:"".concat(Wt,"Nick"),GENDER:"".concat(Wt,"Gender"),BIRTHDAY:"".concat(Wt,"BirthDay"),LOCATION:"".concat(Wt,"Location"),SELFSIGNATURE:"".concat(Wt,"SelfSignature"),ALLOWTYPE:"".concat(Wt,"AllowType"),LANGUAGE:"".concat(Wt,"Language"),AVATAR:"".concat(Wt,"Image"),MESSAGESETTINGS:"".concat(Wt,"MsgSettings"),ADMINFORBIDTYPE:"".concat(Wt,"AdminForbidType"),LEVEL:"".concat(Wt,"Level"),ROLE:"".concat(Wt,"Role")},kt={GROUP:"".concat("Tag_SNS_IM_","Group"),REMARK:"".concat("Tag_SNS_IM_","Remark"),ADDSOURCE:"".concat("Tag_SNS_IM_","AddSource"),ADDWORDING:"".concat("Tag_SNS_IM_","Wording"),ADDTIME:"".concat("Tag_SNS_IM_","AddTime")},Jt="Gender_Type_",An={UNKNOWN:"".concat(Jt,"Unknown"),FEMALE:"".concat(Jt,"Female"),MALE:"".concat(Jt,"Male")},Dt={NONE:"".concat("AdminForbid_Type_","None"),SEND_OUT:"".concat("AdminForbid_Type_","SendOut")},Ft={NEED_CONFIRM:"".concat("AllowType_Type_","NeedConfirm"),ALLOW_ANY:"".concat("AllowType_Type_","AllowAny"),DENY_ANY:"".concat("AllowType_Type_","DenyAny")},rn="JoinedSuccess",Ai="WaitAdminApproval",ni="@TOPIC#_",Xr=Object.prototype.hasOwnProperty;function Je(e){if(e==null)return!0;if(typeof e=="boolean")return!1;if(typeof e=="number")return e===0;if(typeof e=="string"||typeof e=="function"||Array.isArray(e))return e.length===0;if(e instanceof Error)return e.message==="";if(Qt(e)){for(var n in e)if(Xr.call(e,n))return!1;return!0}return!!(ji(e)||Pa(e)||mn(e))&&e.size===0}function ji(e){return Er(e)==="map"}function Pa(e){return Er(e)==="set"}function mn(e){return Er(e)==="file"}function qt(e){return e!==null&&(typeof e=="number"&&!isNaN(+e)||I(e)==="object"&&e.constructor===Number)}function oo(e){return e!==null&&I(e)==="object"}function Qt(e){if(I(e)==="object"&&e!==null){if((e=Object.getPrototypeOf(e))===null)return 1;for(var n=e;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return e===n}}function At(e){return typeof Array.isArray=="function"?Array.isArray(e):Er(e)==="array"}function Hn(e){return typeof e=="function"}function Ql(e){return Er(e)==="filelist"}function Xs(e){return typeof e=="string"&&(e=e[0],!/[^a-zA-Z0-9]/.test(e))}function Ji(e,n,o,a){if(!tr(e)||!tr(n))return 0;for(var l,h=0,m=Object.keys(n),M=0,L=m.length;M<L;M++)if(l=m[M],!(xe(n[l])||o&&o.includes(l)))if(tr(e[l])&&tr(n[l]))h+=Ji(e[l],n[l],o,a);else{if(a&&a.includes(n[l]))continue;e[l]!==n[l]&&(e[l]=n[l],h+=1)}return h}function Tr(e){if(e.length===0)return 0;for(var n=0,o=0,a=typeof document<"u"&&document.characterSet!==void 0?document.characterSet:"UTF-8";e[n]!==void 0;)o+=e[n++].charCodeAt[n]<=255?1:a===!1?3:2;return o}function Mi(e){return e=e||99999999,Math.round(Math.random()*e)}function $o(){for(var e="",n=32;0<n;--n)e+=Yp[Math.floor(Math.random()*z_)];return e}function er(e,n){for(var o in e)if(e[o]===n)return 1}function Oo(e){return e.indexOf("http://")===-1||e.indexOf("https://")===-1?"https://"+e:e.replace(/https|http/,"https")}function Ua(e){if(Object.getOwnPropertyNames(e).length===0)return Object.create(null);var n,o,a=Array.isArray(e)?[]:Object.create(null);for(o in e)e[o]!==null?e[o]!==void 0?(n=I(e[o]),0<=["string","number","function","boolean"].indexOf(n)?a[o]=e[o]:a[o]=Ua(e[o])):a[o]=void 0:a[o]=null;return a}var Io=["url"],wt=function(e){return typeof e=="string"},xe=function(e){return e===void 0},tr=function(e){return At(e)||oo(e)},xd=function(e){return e instanceof Error},Er=function(e){return Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()},Xl=(Date.now||(Date.now=function(){return new Date().getTime()}),function(e){return JSON.stringify(e,["message","code"])}),Yp="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",z_=Yp.length,Js={};function xa(e,n){if(!At(e)||!At(n))return!1;var o=!1;return n.forEach(function(h){var l=h.key,h=h.value,m=e.find(function(M){return M.key===l});m?m.value!==h&&(m.value=h,o=!0):(e.push({key:l,value:h}),o=!0)}),o}function Vd(e){return Je(e)?[]:e.filter(function(n){return n.isModified===!0})}function Gd(e){return Je(e)?[]:e.filter(function(n){return n.isModified===!1})}function pi(e){return e===C.GRP_AVCHATROOM}function Ii(o){var n=o.type,o=o.groupID;return n===C.GRP_COMMUNITY||"".concat(o).startsWith("@TGS#_")&&!"".concat(o).includes(ni)}function Bn(e){return"".concat(e).startsWith("@TGS#_")&&"".concat(e).includes(ni)}function yi(e){return wt(e)&&e.slice(0,3)===C.CONV_C2C}function mi(e){return wt(e)&&e.slice(0,5)===C.CONV_GROUP}function Jr(e){return wt(e)&&e===C.CONV_SYSTEM}function Kp(e,n){var o={};return Object.keys(e).forEach(function(a){o[a]=n(e[a],a)}),o}function Zs(e){return Fe?new Promise(function(n,o){Ne.getImageInfo({src:e,success:function(a){n({width:a.width,height:a.height})},fail:function(){n({width:0,height:0})}})}):Ue&&$e===9?Promise.resolve({width:0,height:0}):new Promise(function(n,o){var a=new Image;a.onload=function(){n({width:this.width,height:this.height}),a=null},a.onerror=function(){n({width:0,height:0}),a=null},a.src=e})}function Qp(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return"".concat(e()+e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e())}function $s(){var e=Mt?"android":vt?"ios":Dn?"windows":bn?"mac":"unknown";if(Fe)try{var n=Ne.getSystemInfoSync().platform;n!==void 0&&(e=n)}catch{}return e}function Fd(e,n){e=e.split("."),n=n.split(".");for(var o=Math.max(e.length,n.length);e.length<o;)e.push("0");for(;n.length<o;)n.push("0");for(var a=0;a<o;a++){var l=parseInt(e[a]),h=parseInt(n[a]);if(h<l)return 1;if(l<h)return-1}return 0}function Bd(o){var n=o.originUrl,n=n===void 0?void 0:n,a=o.originWidth,l=o.originHeight,o=o.min,o=o===void 0?198:o,a=parseInt(a),l=parseInt(l),h={url:void 0,width:0,height:0};return(a<=l?a:l)<=o?(h.url=n,h.width=a,h.height=l):(l<=a?(h.width=Math.ceil(a*o/l),h.height=o):(h.width=o,h.height=Math.ceil(l*o/a)),l=n&&-1<n.indexOf("?")?"".concat(n,"&"):"".concat(n,"?"),h.url="".concat(l,o===198?"imageView2/3/w/198/h/198":"imageView2/3/w/720/h/720")),xe(n)?(h.url,b(h,Io)):h}function Jl(e){var n=e[2];e[2]=e[1],e[1]=n;for(var o=0;o<e.length;o++)e[o].setType(o)}function zd(e){return e=e.servcmd,e.slice(e.indexOf(".")+1)}function Zi(e,n){return Math.round(Number(e)*Math.pow(10,n))/Math.pow(10,n)}function Zl(e,n){return e.includes(n)}function $l(e,n){return e.includes(n)}function Wn(e){return e.split(ni)[0]}var ec=function(e,n,o){if(xe(n))return"";switch(e){case C.MSG_TEXT:return n.text;case C.MSG_IMAGE:return o?"[Image]":"[图片]";case C.MSG_LOCATION:return o?"[Location]":"[位置]";case C.MSG_AUDIO:return o?"[Voice]":"[语音]";case C.MSG_VIDEO:return o?"[Video]":"[视频]";case C.MSG_FILE:return o?"[File]":"[文件]";case C.MSG_CUSTOM:return o?"[Custom Messages]":"[自定义消息]";case C.MSG_GRP_TIP:return o?"[Group Notification]":"[群提示消息]";case C.MSG_GRP_SYS_NOTICE:return o?"[Group System Message]":"[群系统通知]";case C.MSG_FACE:return o?"[Animated Sticker]":"[动画表情]";case C.MSG_MERGER:return o?"[Chat Record]":"[聊天记录]";default:return""}};function Xp(e){return e===C.MSG_TEXT||e===C.MSG_CUSTOM||e===C.MSG_LOCATION||e===C.MSG_FACE}function eu(e){var n=[];if(!wt(e))return n;var o=e.length;if(o===0)return n;for(var a=o-1;0<=a;a--)e[a]==="1"&&n.push(Math.pow(2,o-a-1));return n}function bo(){return!Ue&&!Fe}function Zr(e){return"the length of userIDList cannot exceed ".concat(e)}function ki(e,n){var o;if(e)return o=e,n&&(e.startsWith("http://")?o=e.replace(/^http:\/\/[^/]+/,n):e.startsWith("https://")&&(o=e.replace(/^https:\/\/[^/]+/,n))),o}function Jp(e){var n;if(At(e)&&e.length!==0)return n=0,e.forEach(function(o){n+=o}),n.toFixed(0)}function tc(e){var n;if(At(e)&&e.length!==0)return n=0,e.forEach(function(o){n+=o}),(n/e.length).toFixed(0)}function Zn(e,a,l){var a=!(1<arguments.length&&a!==void 0)||a,l=!(2<arguments.length&&l!==void 0)||l,h=Date.now();return a?l?"".concat(h-e," ms"):"".concat(Math.round((h-e)/1e3)," s"):l?h-e:Math.round((h-e)/1e3)}function Zp(e){return!!(e&&1<e)}function Cr(e,n,o,a){if(n===void 0)return 1;var l,h,m=!0;return n.required&&Je(e)&&(w.e("[".concat(o,'] Missing required params: "').concat(a,'".')),m=!1),Je(e)||(l=Er(e))!==(h=n.type.toLowerCase())&&(l==="asyncfunction"&&h==="function"||(w.e("[".concat(o,'] Invalid params: type check failed for "').concat(a,'". Expected ').concat(n.type,".")),m=!1)),n.validator&&!n.validator(e,o,a)&&(w.e("[".concat(o,'] Invalid params: custom validator check failed for "').concat(a,'".')),m=!1),m}function Mr(e){return!!e&&(!!(yi(e)||mi(e)||Jr(e))||((e=tn("InvalidConversationID",e))&&w.w(e),!1))}function Ke(e){e.desc!==""&&tn("API_REFER")!==""&&w.w("[".concat(e.api,"] | ").concat(e.paramName," | ").concat(e.desc,", ").concat(tn("API_REFER")).concat(e.api))}function $i(){return tn("StringRequiredLog")}function Va(e){return tn("NonEmptyStringRequiredLog",e)}function nc(){return tn("NumberRequiredLog")}function tu(){return tn("UndefinedNotAllowedLog")}function nu(){return tn("FileRequiredLog")}function yo(){return tn("FunctionRequiredLog")}function gi(){return tn("ArrayRequiredLog")}function ko(){return tn("NonEmptyArrayLog")}function iu(){return tn("CallbackMissingLog")}function $p(){return tn("PositiveIntegerRequiredLog")}function Sr(e,n){return tn("StringNotLongerThanLog",e,n)}function ou(e,n){return tn("NumberGreaterOrEqualLog",e,n)}function Ga(e){return tn("KeyValueStringRequiredLog",e)}function To(){return tn("PlainObjectRequiredLog")}function eg(){return tn("NonEmptyContentRequiredLog")}function $r(){return tn("FileNotSelectedLog")}function ru(){return tn("MessageInstanceRequiredLog")}function ic(){return tn("NonAnonymousFunctionLog")}function qd(){return tn("MessageExtensionNotAvailableLog")}function Hd(){return tn("MessageReactionRequiredLog")}function tg(e,n){return tn("MaximumArrayLengthLog",e,n)}function ft(e){return{code:0,data:e||{}}}function St(e){return Promise.resolve(ft(e))}function Ce(e){var n=1<arguments.length&&arguments[1]!==void 0&&arguments[1];if(e instanceof ln)return n&&ea!==null&&ea.emit(R.ERROR,e),Promise.reject(e);if(e instanceof Error)return o=new ln({code:we.UNCAUGHT_ERROR}),n&&ea!==null&&ea.emit(R.ERROR,o),Promise.reject(o);if(xe(e)||xe(e.code))return Promise.reject(new ln({code:we.UNCAUGHT_ERROR}));var o=new ln(e);return n&&ea!==null&&ea.emit(R.ERROR,o),Promise.reject(o)}var ng,Wd,Fa="unSend",eo="success",Yd="fail",wo="notStart",ig="pending",oc="resolved",ja="rejected",nt={type:"String",required:!0},Wt={type:"Array",required:!0},Jt={type:"Object",required:!0},Kn={type:"Boolean",required:!0},Pn={type:"number",required:!0},tn=null,Kd={hookGetAPITips:function(e){tn=e},login:{userID:nt,userSig:nt},addToBlacklist:{userIDList:Wt},removeFromBlacklist:{userIDList:Wt},on:[{name:"eventName",type:"String",validator:function(e,n,o){return typeof e=="string"&&e.length!==0||(Ke({api:n,paramName:o,desc:Va(o)}),!1)}},{name:"handler",type:"Function",validator:function(e,n,o){return typeof e!="function"?(Ke({api:n,paramName:o,desc:yo()}),!1):(e.name===""&&Ke({api:n,paramName:o,desc:ic()}),!0)}}],once:[{name:"eventName",type:"String",validator:function(e,n,o){return typeof e=="string"&&e.length!==0||(Ke({api:n,paramName:o,desc:Va(o)}),!1)}},{name:"handler",type:"Function",validator:function(e,n,o){return typeof e!="function"?(Ke({api:n,paramName:o,desc:yo()}),!1):(e.name===""&&Ke({api:n,paramName:o,desc:ic()}),!0)}}],off:[{name:"eventName",type:"String",validator:function(e,n,o){return typeof e=="string"&&e.length!==0||(Ke({api:n,paramName:o,desc:Va(o)}),!1)}},{name:"handler",type:"Function",validator:function(e,n,o){return typeof e!="function"?(Ke({api:n,paramName:o,desc:yo()}),!1):(e.name===""&&Ke({api:n,paramName:o,desc:ic()}),!0)}}],sendMessage:[u({name:"message"},Jt)],setMessageExtensions:[u(u({name:"message"},Jt),{},{validator:function(e,n,o){return e.status===eo&&e.isSupportExtension===!0||(Ke({api:n,paramName:o,desc:qd()}),!1)}}),u({name:"extensions"},Wt)],getMessageExtensions:[u(u({name:"message"},Jt),{},{validator:function(e,n,o){return e.status===eo&&e.isSupportExtension===!0||(Ke({api:n,paramName:o,desc:qd()}),!1)}})],deleteMessageExtensions:[u(u({name:"message"},Jt),{},{validator:function(e,n,o){return e.status===eo&&e.isSupportExtension===!0||(Ke({api:n,paramName:o,desc:qd()}),!1)}})],addMessageReaction:[u(u({name:"message"},Jt),{},{validator:function(e,n,o){return e.status===eo||(Ke({api:n,paramName:o,desc:Hd()}),!1)}}),u({name:"reactionID"},nt)],removeMessageReaction:[u(u({name:"message"},Jt),{},{validator:function(e,n,o){return e.status===eo||(Ke({api:n,paramName:o,desc:Hd()}),!1)}}),u({name:"reactionID"},nt)],getMessageReactions:{messageList:u({},Wt)},getAllUserListOfMessageReaction:{message:u(u({},Jt),{},{validator:function(e,n,o){return e.status===eo||(Ke({api:n,paramName:o,desc:Hd()}),!1)}}),reactionID:u({},nt),nextSeq:{type:"Number"},count:{type:"Number"}},getMessageList:{conversationID:u(u({},nt),{},{validator:Mr}),nextReqMessageID:{type:"String"},count:{type:"Number",validator:function(e,n,o){return!(!xe(e)&&!/^[1-9][0-9]*$/.test(e)&&(Ke({api:n,paramName:o,desc:$p()}),1))}}},getMessageListHopping:{conversationID:u(u({},nt),{},{validator:Mr}),sequence:{type:"Number"},time:{type:"Number"},direction:{type:"Number",validator:function(e,n,o){return!(!xe(e)&&e!==0&&e!==1&&(Ke({api:n,paramName:o,desc:tn("0Or1RequiredLog")}),1))}},count:{type:"Number",validator:function(e,n,o){return!(!xe(e)&&!/^[1-9][0-9]*$/.test(e)&&(Ke({api:n,paramName:o,desc:$p}),1))}}},setMessageRead:{conversationID:u(u({},nt),{},{validator:Mr})},setAllMessageRead:{scope:{type:"String",required:!1,validator:function(e,n,o){return!e||[C.READ_ALL_C2C_MSG,C.READ_ALL_GROUP_MSG,C.READ_ALL_MSG].indexOf(e)!==-1||(Ke({api:n,paramName:o,desc:tn("ValidScopeRequired")}),!1)}}},getConversationProfile:[u(u({name:"conversationID"},nt),{},{validator:Mr})],clearHistoryMessage:[u(u({name:"conversationID"},nt),{},{validator:Mr})],pinConversation:{conversationID:u(u({},nt),{},{validator:Mr}),isPinned:u({},Kn)},setConversationDraft:{conversationID:u(u({},nt),{},{validator:Mr}),draftText:{type:"String",validator:function(e,n,o){return!!wt(e)||(Ke({api:n,paramName:o,desc:$i()}),!1)}}},setConversationCustomData:{conversationIDList:u({},Wt),customData:{type:"String",validator:function(e,n,o){return wt(e)?!(256<e.length&&(Ke({api:n,paramName:o,desc:Sr(o,256)}),1)):(Ke({api:n,paramName:o,desc:$i()}),!1)}}},markConversation:{conversationIDList:u({},Wt),markType:{type:"number",validator:function(e,n,o){return qt(e)?e<=0?(Ke({api:n,paramName:o,desc:tn("NumberGreaterThanLog",o,0)}),!1):!(e>=Math.pow(2,64)&&(Ke({api:n,paramName:o,desc:tn("NumberLessThanLog",o,"Math.pow(2,64)")}),1)):(Ke({api:n,paramName:o,desc:nc()}),!1)}},enableMark:u({},Kn)},createConversationGroup:{conversationIDList:u({},Wt),groupName:u(u({},nt),{},{validator:function(e,n,o){return!(!e||32<e.length&&(Ke({api:n,paramName:o,desc:Sr(o,32)}),1))}})},deleteConversationGroup:[u({name:"groupName"},nt)],renameConversationGroup:{oldName:u({},nt),newName:u(u({},nt),{},{validator:function(e,n,o){return!(!e||32<e.length&&(Ke({api:n,paramName:o,desc:Sr(o,32)}),1))}})},addConversationsToGroup:{conversationIDList:u({},Wt),groupName:u({},nt)},deleteConversationsFromGroup:{conversationIDList:u({},Wt),groupName:u({},nt)},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:nt,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:Wt},createGroup:{name:nt},joinGroup:{groupID:nt,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[u({name:"groupID"},nt)],handleApplication:{message:Jt,handleAction:nt,handleMessage:{type:"String"}},changeGroupOwner:{groupID:nt,newOwnerID:nt},updateGroupProfile:{groupID:nt,muteAllMembers:{type:"Boolean"}},dismissGroup:[u({name:"groupID"},nt)],searchGroupByID:[u({name:"groupID"},nt)],getGroupOnlineMemberCount:[u({name:"groupID"},nt)],initGroupAttributes:{groupID:nt,groupAttributes:u(u({},Jt),{},{validator:function(e,n,o){var a=!0;return Object.keys(e).forEach(function(l){if(!wt(e[l]))return Ke({api:n,paramName:o,desc:Ga("value")}),a=!1}),a}})},setGroupAttributes:{groupID:nt,groupAttributes:u(u({},Jt),{},{validator:function(e,n,o){var a=!0;return Object.keys(e).forEach(function(l){if(!wt(e[l]))return Ke({api:n,paramName:o,desc:Ga("value")}),a=!1}),a}})},deleteGroupAttributes:{groupID:nt,keyList:{type:"Array",validator:function(e,n,o){return xe(e)||!At(e)?(Ke({api:n,paramName:o,desc:gi()}),!1):!!Je(e)||(a=!0,e.forEach(function(l){if(!wt(l))return Ke({api:n,paramName:o,desc:tn("StringArrayRequiredLog")}),a=!1}),a);var a}}},getGroupAttributes:{groupID:nt,keyList:{type:"Array",validator:function(e,n,o){return xe(e)||!At(e)?(Ke({api:n,paramName:o,desc:gi()}),!1):!!Je(e)||(a=!0,e.forEach(function(l){if(!wt(l))return Ke({api:n,paramName:o,desc:Ga("key")}),a=!1}),a);var a}}},setGroupCounters:{groupID:nt,counters:Jt},increaseGroupCounter:{groupID:nt,key:nt,value:Pn},decreaseGroupCounter:{groupID:nt,key:nt,value:Pn},getGroupCounters:{groupID:nt},getGroupMemberList:{groupID:nt,count:{type:"Number"}},getGroupMemberProfile:{groupID:nt,userIDList:Wt,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:nt,userIDList:Wt},setGroupMemberRole:{groupID:nt,userID:nt,role:nt},setGroupMemberMuteTime:{groupID:nt,userID:nt,muteTime:{type:"Number",validator:function(e){return 0<=e}}},setGroupMemberNameCard:{groupID:nt,userID:{type:"String"},nameCard:{type:"String",validator:function(e,n,o){return wt(e)?(e.length,!0):(Ke({api:n,paramName:o,desc:$i()}),!1)}}},setGroupMemberCustomField:{groupID:nt,userID:{type:"String"},memberCustomField:Wt},deleteGroupMember:{groupID:nt},markGroupMemberList:{groupID:nt,markType:{type:"number",validator:function(e,n,o){return qt(e)?!(e<1e3&&(Ke({api:n,paramName:o,desc:ou(o,1e3)}),1)):(Ke({api:n,paramName:o,desc:nc()}),!1)}},userIDList:u({},Wt),enableMark:u({},Kn)},createTextMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){return Qt(e)?wt(e.text)?e.text.length!==0||(Ke({api:n,paramName:"payload.text",desc:eg()}),!1):(Ke({api:n,paramName:"payload.text",desc:$i()}),!1):(Ke({api:n,paramName:o,desc:To()}),!1)}})},createTextAtMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){return Qt(e)?wt(e.text)?e.text.length===0?(Ke({api:n,paramName:"payload.text",desc:eg()}),!1):!(e.atUserList&&!At(e.atUserList)&&(Ke({api:n,paramName:"payload.atUserList",desc:gi()}),1)):(Ke({api:n,paramName:"payload.text",desc:$i()}),!1):(Ke({api:n,paramName:o,desc:To()}),!1)}})},createCustomMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){return Qt(e)?e.data&&!wt(e.data)?(Ke({api:n,paramName:"payload.data",desc:$i()}),!1):e.description&&!wt(e.description)?(Ke({api:n,paramName:"payload.description",desc:$i()}),!1):!(e.extension&&!wt(e.extension)&&(Ke({api:n,paramName:"payload.extension",desc:$i()}),1)):(Ke({api:n,paramName:"payload",desc:To()}),!1)}})},createImageMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){if(!Qt(e))return Ke({api:n,paramName:o,desc:To()}),!1;if(xe(e.file))return Ke({api:n,paramName:"payload.file",desc:tu()}),!1;if(lt){if(!(e.file instanceof HTMLInputElement||mn(e.file)))return Qt(e.file)&&typeof uni<"u"?e.file.tempFilePaths.length!==0&&e.file.tempFiles.length!==0||(Ke({api:n,paramName:"payload.file",desc:$r()}),!1):(Ke({api:n,paramName:"payload.file",desc:nu()}),!1);if(e.file instanceof HTMLInputElement&&e.file.files.length===0)return Ke({api:n,paramName:"payload.file",desc:$r()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:function(e,n,o){return xe(e)&&Ke({api:n,paramName:o,desc:iu()}),!0}}})},createAudioMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){return!!Qt(e)||(Ke({api:n,paramName:o,desc:To()}),!1)}}),onProgress:{type:"Function",required:!1,validator:function(e,n,o){return xe(e)&&Ke({api:n,paramName:o,desc:iu()}),!0}}},createVideoMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){if(!Qt(e))return Ke({api:n,paramName:o,desc:To()}),!1;if(xe(e.file))return Ke({api:n,paramName:"payload.file",desc:tu()}),!1;if(lt){if(!(e.file instanceof HTMLInputElement||mn(e.file)))return Qt(e.file)&&typeof uni<"u"?!!mn(e.file.tempFile)||(Ke({api:n,paramName:"payload.file",desc:$r()}),!1):(Ke({api:n,paramName:"payload.file",desc:nu()}),!1);if(e.file instanceof HTMLInputElement&&e.file.files.length===0)return Ke({api:n,paramName:"payload.file",desc:$r()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e,n,o){return xe(e)&&Ke({api:n,paramName:o,desc:iu()}),!0}}},createFaceMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){return Qt(e)?qt(e.index)?!!wt(e.data)||(Ke({api:n,paramName:"payload.data",desc:$i()}),!1):(Ke({api:n,paramName:"payload.index",desc:nc()}),!1):(Ke({api:n,paramName:o,desc:To()}),!1)}})},createFileMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){if(!Qt(e))return Ke({api:n,paramName:o,desc:To()}),!1;if(xe(e.file))return Ke({api:n,paramName:"payload.file",desc:tu()}),!1;if(lt){if(!(e.file instanceof HTMLInputElement||mn(e.file)))return Qt(e.file)&&typeof uni<"u"?e.file.tempFilePaths.length!==0&&e.file.tempFiles.length!==0||(Ke({api:n,paramName:"payload.file",desc:$r()}),!1):(Ke({api:n,paramName:"payload.file",desc:nu()}),!1);if(e.file instanceof HTMLInputElement&&e.file.files.length===0)return Ke({api:n,paramName:"payload.file",desc:$r()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e,n,o){return xe(e)&&Ke({api:n,paramName:o,desc:iu()}),!0}}},createLocationMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){return Qt(e)?wt(e.description)?qt(e.longitude)?!!qt(e.latitude)||(Ke({api:n,paramName:"payload.latitude",desc:nc()}),!1):(Ke({api:n,paramName:"payload.longitude",desc:nc()}),!1):(Ke({api:n,paramName:"payload.description",desc:$i()}),!1):(Ke({api:n,paramName:o,desc:To()}),!1)}})},createMergerMessage:{to:nt,conversationType:nt,payload:u(u({},Jt),{},{validator:function(e,n,o){if(Je(e.messageList))return Ke({api:n,paramName:"payload.messageList",desc:ko()}),!1;if(Je(e.compatibleText))return Ke({api:n,paramName:"payload.compatibleText",desc:Va("compatibleText")}),!1;var a=!1;return e.messageList.forEach(function(l){l.status===Yd&&(a=!0)}),!a||(Ke({api:n,paramName:"payload.messageList",desc:tn("MergeFailedMessageLog")}),!1)}})},revokeMessage:[u(u({name:"message"},Jt),{},{validator:function(e,n,o){return Je(e)?(Ke({api:n,paramName:o,desc:ru()}),!1):e.conversationType===C.CONV_SYSTEM?(Ke({api:n,paramName:o,desc:tn("MessageCanBeRevokedDesc")}),!1):e.isRevoked!==!0||(Ke({api:n,paramName:o,desc:tn("MessageRevokedLog")}),!1)}})],deleteMessage:[u(u({name:"messageList"},Wt),{},{validator:function(e,n,o){return!Je(e)||(Ke({api:n,paramName:o,desc:ko()}),!1)}})],translateText:{sourceTextList:Wt,sourceLanguage:nt,targetLanguage:nt},convertVoiceToText:{message:u(u({},Jt),{},{validator:function(e,n,o){return Je(e)?(Ke({api:n,paramName:o,desc:ru()}),!1):e.type===C.MSG_AUDIO&&e.status===eo||(Ke({api:n,paramName:o,desc:tn("AudioMessageRequiredLog")}),!1)}})},modifyMessage:[u(u({name:"message"},Jt),{},{validator:function(e,n,o){return Je(e)?(Ke({api:n,paramName:o,desc:ru()}),!1):e.conversationType===C.CONV_SYSTEM?(Ke({api:n,paramName:o,desc:tn("MessageCanBeModifiedLog")}),!1):e._onlineOnlyFlag!==!0||(Ke({api:n,paramName:o,desc:tn("OnlineMessageNotSupportLog")}),!1)}})],searchCloudMessages:{keywordList:{type:"Array",required:!1,validator:function(e,n,o){return!(e&&(At(e)?e.length===0?(Ke({api:n,paramName:o,desc:ko()}),1):5<e.length&&(Ke({api:n,paramName:o,desc:tg(o,5)}),1):(Ke({api:n,paramName:o,desc:gi()}),1)))}},keywordListMatchType:{type:"String",required:!1,validator:function(e,n,o){return!e||e==="or"||e==="and"||Ke({api:n,paramName:o,desc:"".concat(e," is invalid match type")})}},senderUserIDList:{type:"Array",required:!1,validator:function(e,n,o){return!(e&&(At(e)?(e.length===0&&Ke({api:n,paramName:o,desc:ko()}),5<e.length&&(Ke({api:n,paramName:o,desc:tg(o,5)}),1)):(Ke({api:n,paramName:o,desc:gi()}),1)))}},messageTypeList:{type:"Array",required:!1,validator:function(e,n,o){if(!e)return!0;if(!At(e))return Ke({api:n,paramName:o,desc:gi()}),!1;e.length===0&&Ke({api:n,paramName:o,desc:ko()});var a=[C.MSG_TEXT,C.MSG_IMAGE,C.MSG_AUDIO,C.MSG_FILE,C.MSG_VIDEO,C.MSG_LOCATION,C.MSG_CUSTOM,C.MSG_MERGER];return!(0<e.filter(function(l){return a.indexOf(l)===-1}).length&&(Ke({api:n,paramName:o,desc:tn("ContainsUnsupportedMessageTypeLog",o)}),1))}},conversationID:{type:"String",required:!1,validator:function(e){return!e||Mr(e)}},timePosition:{type:"number",required:!1,validator:function(e,n,o){return!(e&&e<0&&(Ke({api:n,paramName:o,desc:ou(o,0)}),1))}},timePeriod:{type:"number",required:!1,validator:function(e,n,o){return!(e&&e<0&&(Ke({api:n,paramName:o,desc:ou(o,0)}),1))}},cursor:{type:"String",required:!1}},getUserProfile:{userIDList:{type:"Array",validator:function(e,n,o){return At(e)?(e.length===0&&Ke({api:n,paramName:o,desc:ko()}),!0):(Ke({api:n,paramName:o,desc:gi()}),!1)}}},updateMyProfile:{profileCustomField:{type:"Array",validator:function(e,n,o){return!!xe(e)||!!At(e)||(Ke({api:n,paramName:o,desc:gi()}),!1)}}},setSelfStatus:{customStatus:{type:"String",validator:function(e,n,o){return!!wt(e)||(Ke({api:n,paramName:o,desc:$i()}),!1)}}},getUserStatus:{userIDList:{type:"Array",validator:function(e,n,o){return At(e)?e.length!==0||(Ke({api:n,paramName:o,desc:ko()}),!1):(Ke({api:n,paramName:o,desc:gi()}),!1)}}},subscribeUserStatus:{userIDList:{type:"Array",validator:function(e,n,o){return At(e)?e.length!==0||(Ke({api:n,paramName:o,desc:ko()}),!1):(Ke({api:n,paramName:o,desc:gi()}),!1)}}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:function(e,n,o){return!e||!!At(e)||(Ke({api:n,paramName:o,desc:gi()}),!1)}}},addFriend:{to:nt,source:{type:"String",required:!0,validator:function(e,n,o){return!(!e||(e.startsWith("AddSource_Type_")?8<e.replace("AddSource_Type_","").length&&(Ke({api:n,paramName:o,desc:Sr("keyword",8)}),1):(Ke({api:n,paramName:o,desc:tn("SourcePrefixLog")}),1)))}},remark:{type:"String",required:!1,validator:function(e,n,o){return!(wt(e)&&96<e.length&&(Ke({api:n,paramName:o,desc:Sr(o,96)}),1))}}},deleteFriend:{userIDList:Wt},checkFriend:{userIDList:Wt},getFriendProfile:{userIDList:Wt},updateFriend:{userID:nt,remark:{type:"String",required:!1,validator:function(e,n,o){return!(wt(e)&&96<e.length&&(Ke({api:n,paramName:o,desc:Sr(o,96)}),1))}},friendCustomField:{type:"Array",required:!1,validator:function(e,n,o){if(e){if(!At(e))return Ke({api:n,paramName:o,desc:gi()}),!1;var a=!0;return e.forEach(function(l){return wt(l.key)&&l.key.indexOf("Tag_SNS_Custom")!==-1?wt(l.value)?8<l.key.replace("Tag_SNS_Custom_","").length?(Ke({api:n,paramName:o,desc:Sr("keyword",8)}),a=!1):void 0:(Ke({api:n,paramName:o,desc:Ga("value")}),a=!1):(Ke({api:n,paramName:o,desc:tn("FriendCustomFieldPrefixLog")}),a=!1)}),a}return!0}}},acceptFriendApplication:{userID:nt},refuseFriendApplication:{userID:nt},deleteFriendApplication:{userID:nt},createFriendGroup:{name:nt},deleteFriendGroup:{name:nt},addToFriendGroup:{name:nt,userIDList:Wt},removeFromFriendGroup:{name:nt,userIDList:Wt},renameFriendGroup:{oldName:nt,newName:nt},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:function(e,n,o){return At(e)?e.length!==0||(Ke({api:n,paramName:o,desc:ko()}),!1):(Ke({api:n,paramName:o,desc:gi()}),!1)}}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:function(e,n,o){return At(e)?e.length!==0||(Ke({api:n,paramName:o,desc:ko()}),!1):(Ke({api:n,paramName:o,desc:gi()}),!1)}}],createTopicInCommunity:{groupID:nt,topicName:nt},deleteTopicFromCommunity:{groupID:nt,topicIDList:{type:"Array",validator:function(e,n,o){return!e||!!At(e)||(Ke({api:n,paramName:o,desc:gi()}),!1)}}},updateTopicProfile:{groupID:nt,topicID:nt},getTopicList:{groupID:nt,topicIDList:{type:"Array",validator:function(e,n,o){return!e||!!At(e)||(Ke({api:n,paramName:o,desc:gi()}),!1)}}},followUser:[u({name:"userIDList"},Wt)],unfollowUser:[u({name:"userIDList"},Wt)],getMyFollowingList:[u(u({name:"startIndex"},nt),{},{required:!1})],getMyFollowersList:[u(u({name:"startIndex"},nt),{},{required:!1})],getMutualFollowersList:[u(u({name:"startIndex"},nt),{},{required:!1})],getUserFollowInfo:[u(u({name:"userIDList"},Wt),{},{required:!1})],checkFollowType:[u({name:"userIDList"},Wt)],addSignalingListener:[{name:"eventName",type:"String",validator:function(e,n,o){return typeof e=="string"&&e.length!==0||(Ke({api:n,paramName:o,desc:Va(o)}),!1)}},{name:"handler",type:"Function",validator:function(e,n,o){return typeof e!="function"?(Ke({api:n,paramName:o,desc:yo()}),!1):(e.name===""&&Ke({api:n,paramName:o,desc:ic()}),!0)}}],removeSignalingListener:[{name:"eventName",type:"String",validator:function(e,n,o){return typeof e=="string"&&e.length!==0||(Ke({api:n,paramName:o,desc:Va(o)}),!1)}},{name:"handler",type:"Function",validator:function(e,n,o){return typeof e!="function"?(Ke({api:n,paramName:o,desc:yo()}),!1):(e.name===""&&Ke({api:n,paramName:o,desc:ic()}),!0)}}],invite:{userID:nt},inviteSync:[u(u({},Jt),{},{validator:function(e,n,o){return Qt(e)?!!wt(e.userID)||(Ke({api:n,paramName:"options.userID",desc:$i()}),!1):(Ke({api:n,paramName:"options",desc:To()}),!1)}}),{name:"successCb",type:"Function",required:!1,validator:function(e,n,o){return xe(e)&&Ke({api:n,paramName:o,desc:yo()}),!0}},{name:"errorCb",type:"Function",required:!1,validator:function(e,n,o){return xe(e)&&Ke({api:n,paramName:o,desc:yo()}),!0}}],inviteInGroup:{groupID:nt,inviteeList:Wt},inviteInGroupSync:[u(u({},Jt),{},{validator:function(e,n,o){return Qt(e)?wt(e.groupID)?!!At(e.inviteeList)||(Ke({api:n,paramName:"options.inviteeList",desc:gi()}),!1):(Ke({api:n,paramName:"options.groupID",desc:$i()}),!1):(Ke({api:n,paramName:"options",desc:To()}),!1)}}),{name:"successCb",type:"Function",required:!1,validator:function(e,n,o){return xe(e)&&Ke({api:n,paramName:o,desc:yo()}),!0}},{name:"errorCb",type:"Function",required:!1,validator:function(e,n,o){return xe(e)&&Ke({api:n,paramName:o,desc:yo()}),!0}}],accept:{inviteID:nt},reject:{inviteID:nt},getSignalingInfo:[u(u({name:"message"},Jt),{},{validator:function(e,n,o){return!Je(e)||(Ke({api:n,paramName:o,desc:ru()}),!1)}})],modifyInvitation:{inviteID:nt,data:nt}},og={login:1,logout:1,getLoginUser:1,on:1,once:1,off:1,setLogLevel:1,registerPlugin:1,destroy:1,isReady:1,createTextMessage:1,createTextAtMessage:1,createImageMessage:1,createAudioMessage:1,createVideoMessage:1,createCustomMessage:1,createFaceMessage:1,createFileMessage:1,createLocationMessage:1,createMergerMessage:1,downloadMergerMessage:1,createForwardMessage:1,sendMessage:1,resendMessage:1,revokeMessage:1,deleteMessage:1,translateText:1,convertVoiceToText:1,modifyMessage:1,searchCloudMessages:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageReadReceiptList:1,setMessageExtensions:1,getMessageExtensions:1,deleteMessageExtensions:1,addMessageReaction:1,removeMessageReaction:1,getMessageReactions:1,getAllUserListOfMessageReaction:1,getMessageList:1,findMessage:1,getMessageListHopping:1,setMessageRead:1,setAllMessageRead:1,getConversationList:1,getConversationProfile:1,deleteConversation:1,setConversationDraft:1,pinConversation:1,getTotalUnreadMessageCount:1,setConversationCustomData:1,markConversation:1,createConversationGroup:1,getConversationGroupList:1,deleteConversationGroup:1,renameConversationGroup:1,addConversationsToGroup:1,deleteConversationsFromGroup:1,clearHistoryMessage:1,setMessageRemindType:1,setAllReceiveMessageOpt:1,getAllReceiveMessageOpt:1,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,getGroupApplicationList:1,handleGroupApplication:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,followUser:1,unfollowUser:1,getMyFollowingList:1,getMyFollowersList:1,getMutualFollowersList:1,getUserFollowInfo:1,checkFollowType:1,callExperimentalAPI:1,addSignalingListener:1,removeSignalingListener:1,invite:1,inviteSync:1,inviteInGroup:1,inviteInGroupSync:1,cancel:1,accept:1,reject:1,getSignalingInfo:1,modifyInvitation:1},ln=(E(Wa,Q(Error)),Wd=B(Wa),y(Wa)),we={NO_SDKAPPID:2e3,NO_ACCOUNT_TYPE:2001,NO_IDENTIFIER:2002,NO_USERSIG:2003,NO_TINYID:2022,NO_A2KEY:2023,USER_NOT_LOGGED_IN:2024,REPEAT_LOGIN:2025,COS_UNDETECTED:2040,COS_GET_SIG_FAIL:2041,MSG_SEND_FAIL:2100,MSG_SEND_FAIL_NOT_IN_AVCHATROOM:2101,MSG_INSTANCE_REQUIRED:2105,MSG_INVALID_CONV_TYPE:2106,MSG_F_IS_EMPTY:2108,MSG_ONPROGRESS_FUNCTION_ERROR:2109,MSG_REVOKE_FAIL:2110,MSG_DELETE_FAIL:2111,MSG_UNREAD_ALL_FAIL:2112,READ_RECEIPT_MSG_LIST_EMPTY:2114,MSG_SEND_GRP_WITH_TOPIC_FAIL:2115,CANNOT_DELETE_GRP_SYSTEM_NOTICE:2116,TRANSLATE_TEXT_FAIL:2117,VOICE_TO_TEXT_FAIL:2118,UNSUPPORTED_VOICE_FORMAT:2119,MSG_I_SELECT_F_FIRST:2251,MSG_I_TYPES_LIMIT:2252,MSG_I_SIZE_LIMIT:2253,MSG_A_UPLOAD_FAIL:2300,MSG_A_SIZE_LIMIT:2301,MSG_V_UPLOAD_FAIL:2350,MSG_V_SIZE_LIMIT:2351,MSG_V_TYPES_LIMIT:2352,MSG_F_UPLOAD_FAIL:2400,MSG_F_SELECT_F_FIRST:2401,MSG_F_SIZE_LIMIT:2402,MSG_F_URL_IS_EMPTY:2403,MSG_MERGER_TYPE_INVALID:2450,MSG_MERGER_KEY_INVALID:2451,MSG_MERGER_DOWNLOAD_FAIL:2452,MSG_FORWARD_TYPE_INVALID:2453,MSG_FORWARD_INVALID_ELEMENTS:2454,MSG_MODIFY_CONFLICT:2480,MSG_MODIFY_DISABLED_IN_AVCHATROOM:2481,CONV_NOT_FOUND:2500,USER_OR_GRP_NOT_FOUND:2501,CONV_UN_RECORDED_TYPE:2502,INVALID_CONV_ID:2503,ILLEGAL_GRP_TYPE:2600,CANNOT_JOIN_WORK:2601,ILLEGAL_GRP_ID:2602,CANNOT_FIND_GRP:2603,CANNOT_CHANGE_OWNER_IN_AVCHATROOM:2620,CANNOT_CHANGE_OWNER_TO_SELF:2621,CANNOT_DISMISS_WORK:2622,MEMBER_NOT_IN_GRP:2623,JOIN_GRP_FAIL:2660,CANNOT_ADD_MEMBER_IN_AVCHATROOM:2661,CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN:2662,NOT_OWNER:2681,CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM:2682,INVALID_MEMBER_ROLE:2683,CANNOT_SET_SELF_MEMBER_ROLE:2684,CANNOT_MUTE_SELF:2685,BAN_DURATION_INVALID:2686,OPERATION_NOT_SUPPORTED_IN_AVCHATROOM:2687,NOT_MY_FRIEND:2700,ALREADY_MY_FRIEND:2701,FRIEND_GRP_EXISTED:2710,FRIEND_GRP_NOT_EXIST:2711,FRIEND_APPLICATION_NOT_EXIST:2716,UPDATE_PROFILE_INVALID_PARAM:2721,UPDATE_PROFILE_NO_KEY:2722,CANNOT_ADD_SELF_TO_BLACKLIST:2742,NETWORK_ERROR:2800,NETWORK_TIMEOUT:2801,NO_NETWORK:2805,UNCAUGHT_ERROR:2903,INVALID_OPERATION:2905,INVALID_TRTC_CMD:2995,OVER_FREQUENCY_LIMIT:2996,CANNOT_FIND_PROTOCOL:2997,CANNOT_FIND_MODULE:2998,SDK_IS_NOT_READY:2999,LOGGING_IN:3e3,LOGIN_FAILED:3001,KICKED_OUT_MULT_DEVICE:3002,KICKED_OUT_MULT_ACCOUNT:3003,KICKED_OUT_USERSIG_EXPIRED:3004,LOGGED_OUT:3005,KICKED_OUT_REST_API:3006,ILLEGAL_TOPIC_ID:3021,CANNOT_USE_COMMERCIAL_ABILITY:3122,PROFANITY_FOUND:3123,OPTIONS_IS_EMPTY:3153,MSG_A2KEY_EXPIRED:20002,ACCOUNT_A2KEY_EXPIRED:70001,HELLO_ANSWER_KICKED_OUT:1002,OPEN_SERVICE_OVERLOAD_ERROR:60022,SIGNALING_INVALID_INVITE_ID:8010,SIGNALING_NO_PERMISSION:8011,SIGNALING_ALREADY_EXISTS:8012,INVALID_CANCEL_MESSAGE:8020,MSG_SEARCH_CURSOR_INVALID:27002,MSG_SEARCH_CURSOR_EXPIRED:27003},ea=null,Pn=(y(lA,[{key:"isLoggedIn",value:function(){return this._m.get(12).isLoggedIn()}},{key:"isOversea",value:function(){return this._m.get(12).isOversea()}},{key:"isPrivateNetWork",value:function(){return this._m.get(12).isPrivateNetWork()}},{key:"getFileDownloadProxy",value:function(){return this._m.get(12).getFileDownloadProxy()}},{key:"getMyUserID",value:function(){return this._m.get(12).getUserID()}},{key:"getMyTinyID",value:function(){return this._m.get(12).getTinyID()}},{key:"getSDKAppID",value:function(){return this._m.get(12).getSDKAppID()}},{key:"isIntl",value:function(){return this._m.get(12).isIntl()}},{key:"isUsingChatCore",value:function(){return this._m.get(12).isUsingChatCore()}},{key:"isDevMode",value:function(){return this._m.get(12).isDevMode()}},{key:"get",value:function(e){return this._m.get(e)}},{key:"getPlatform",value:function(){return yt}},{key:"getCloudConfig",value:function(e){return this._m.get(23).getCloudConfig(e)}},{key:"emitOuterEvent",value:function(e,n){this._m.getOuterEmitterInstance().emit(e,n)}},{key:"emitInnerEvent",value:function(e,n){this._m.getInnerEmitterInstance().emit(e,n)}},{key:"getInnerEmitterInstance",value:function(){return this._m.getInnerEmitterInstance()}},{key:"generateTjgID",value:function(e){return this._m.get(12).getTinyID()+"-"+e.random}},{key:"req",value:function(e){return this._m.get(20).req(e)}},{key:"canIUse",value:function(e){return this._m.get(27).canIUse(e)}},{key:"getErrorMessage",value:function(e,n,o){return this._m.getErrorMessage(e,n,o)}},{key:"outputWarning",value:function(e,n,o){e=this.getErrorMessage(e,n,o),e&&w.w(e)}},{key:"cannotUseCommercialAbility",value:function(e){var n=we.CANNOT_USE_COMMERCIAL_ABILITY;return Ce({code:n,message:this.getErrorMessage(n,e)})}}]),lA),le={LOGIN:"wslogin",LOGOUT:"wslogout",HELLO:"wshello",KICK_OTHER:"KickOther",SYNC_UNREAD_MSG:"getmsg",SEND_C2C_MSG:"sendmsg",SEND_GRP_MSG:"send_group_msg",GET_USER_PROFILE:"portrait_get_all",UPDATE_MY_PROFILE:"portrait_set",GET_BL:"black_list_get",ADD_TO_BL:"black_list_add",RM_FROM_BL:"black_list_delete",GET_FD_LIST:"friend_get",GET_FD_PROFILE:"friend_get_specified",CHECK_FD:"friend_check",DEL_FD:"friend_delete",ADD_FD:"friend_add",UPDATE_FD:"friend_update",RESPOND_FD_APPLICATION:"friend_response",GET_FD_APPLICATION_LIST:"pendency_get",DEL_FD_APPLICATION:"pendency_delete",REFUSE_FD_APPLICATION:"pendency_refuse",REPORT_FD_APPLICATION:"pendency_report",GET_FD_GRP_LIST:"group_get",CREATE_FD_GRP:"group_add",DEL_FD_GRP:"group_delete",UPDATE_FD_GRP:"group_update",REVOKE_C2C_MSG:"msgwithdraw",SET_C2C_MSG_READ:"msgreaded",SET_C2C_PEER_MUTE_NOTIFICATIONS:"set_c2c_peer_mute_notifications",GET_C2C_PEER_MUTE_NOTIFICATIONS:"get_c2c_peer_mute_notifications",GET_C2C_ROAMING_MSG:"getroammsg",GET_C2C_PEER_READ_TIME:"get_peer_read_time",DEL_C2C_MSG:"delete_c2c_msg_ramble",MODIFY_C2C_MSG:"modify_c2c_msg",MODIFY_C2C_MSG_EXT:"set_key_values",GET_C2C_MSG_EXT:"get_key_values",ADD_C2C_MSG_REACTION:"reaction_add",RM_C2C_MSG_REACTION:"reaction_del",GET_C2C_MSG_REACTIONS:"reaction_multi_stat",GET_C2C_MSG_REACTION_USER_LIST:"reaction_iterate",PAGING_GET_CONV_LIST:"page_get",DEL_CONV:"batch_delete",CLEAR_HISTORY_MSG:"clear_msg",PIN_CONV:"top",DEL_GROUP_AT_TIPS:"deletemsg",SET_CONV_CUSTOM_DATA:"set_conv_custom_data",MARK_CONV:"mark_contact",CREATE_CONV_GRP:"create_contact_group",DEL_CONV_GRP:"del_contact_group",RENAME_CONV_GRP:"update_contact_group",ADD_CONV_TO_GRP:"add_conv_to_group",DEL_CONV_FROM_GRP:"del_conv_from_group",GET_CONV_GRP_LIST:"get_contact_group",GET_GRP_LIST:"get_joined_group_list",GET_GRP_PROFILE:"get_group_self_member_info",CREATE_GRP:"create_group",DISMISS_GRP:"destroy_group",UPDATE_GRP_PROFILE:"modify_group_base_info",APPLY_JOIN_GRP:"apply_join_group",APPLY_JOIN_GRP_NOAUTH:"apply_join_group_noauth",QUIT_GRP:"quit_group",SEARCH_GRP:"get_group_public_info",CHANGE_GRP_OWNER:"change_group_owner",HANDLE_GRP_APPLICATION:"handle_apply_join_group",HANDLE_INVITE_JOIN_GRP:"handle_invite_join_permission_group",HANDLE_GRP_INVITATION:"handle_invite_join_group",REVOKE_GRP_MSG:"group_msg_recall",SET_GRP_MSG_READ:"msg_read_report",SET_ALL_MSG_READ:"read_all_unread_msg",GET_GRP_ROAMING_MSG:"group_msg_get",GET_READ_RECEIPT:"get_group_msg_receipt",SEND_READ_RECEIPT:"group_msg_receipt",SEND_C2C_READ_RECEIPT:"c2c_msg_read_receipt",GET_READ_RECEIPT_DETAIL:"get_group_msg_receipt_detail",GET_GRP_PENDENCY:"get_pendency",DEL_GRP_SYSTEM_NOTICE:"deletemsg",AV_POLLING:"get_msg",AV_NOAUTH_POLLING:"get_msg_noauth",GET_ONLINE_MBR_NUM:"get_online_member_num",DEL_GRP_MSG:"delete_group_ramble_msg_by_seq",MODIFY_GRP_MSG:"modify_group_msg",SET_GRP_ATTR:"set_group_attr",MODIFY_GRP_ATTR:"modify_group_attr",DEL_GRP_ATTR:"delete_group_attr",CLEAR_GRP_ATTR:"clear_group_attr",GET_GRP_ATTR:"get_group_attr",MODIFY_GRP_MSG_EXT:"group_set_key_values",GET_GRP_MSG_EXT:"group_get_key_values",GET_GRP_NOTIFY:"batch_get_group_notify",UPDATE_GRP_COUNTER:"update_group_counter",GET_GRP_COUNTER:"get_group_counter",ADD_GRP_MSG_REACTION:"group_reaction_add",RM_GRP_MSG_REACTION:"group_reaction_del",GET_GRP_MSG_REACTIONS:"group_reaction_multi_stat",GET_GRP_MSG_REACTION_USER_LIST:"group_reaction_iterate",GET_GRP_MBR_LIST:"get_group_member_info",GET_AV_MBR_LIST:"get_members",GET_GRP_MBR_PROFILE:"get_specified_group_member_info",ADD_GRP_MBR:"add_group_member",DEL_GRP_MBR:"delete_group_member",BAN_AV_MBR:"ban_group_member",MODIFY_GRP_MBR_INFO:"modify_group_member_info",MARK_AV_MBR_INFO:"modify_user_info",COS_SIGN:"cos",COS_PRE_SIG:"pre_sig",SIMPLE_COS_PRE_SIG:"simple_sig",GET_IMAGE_INFO:"get_imageinfo",GET_IP:"get_final_ip",VIDEO_COVER:"video_cover",SSO_STAT:"tim_web_report_v2",PING:"alive",MSG_PUSH:"msg_push",MSG_CLOUD_SEARCH:"query",MULTI_MSG_PUSH:"multi_msg_push_ws",MSG_PUSH_ACK:"ws_msg_push_ack",STATUS_FORCE_OFFLINE:"stat_forceoffline",UPLOAD_MERGER_MSG:"save_relay_json_msg",DOWNLOAD_MERGER_MSG:"get_relay_json_msg",FETCH_CLOUD_CTRL_CONFIG:"fetch_config",PUSHED_CLOUD_CTRL_CONFIG:"push_configv2",FETCH_COMMERCIAL_CONFIG:"fetch_imsdk_purchase_bitsv2",PUSHED_COMMERCIAL_CONFIG:"push_imsdk_purchase_bitsv2",OVERLOAD_NOTIFY:"notify2",CREATE_TOPIC:"create_topic",DEL_TOPIC:"destroy_topic",UPDATE_TOPIC_PROFILE:"modify_topic",GET_TOPIC_LIST:"get_topic",SET_SELF_STATUS:"ws_set_custom_status",GET_USER_STATUS:"ws_get_user_status",SUB_USER_STATUS:"ws_status_subscribe",UNSUB_USER_STATUS:"ws_status_unsubscribe",STAT_BACKGROUND:"ws_stat_background",STAT_FOREGROUND:"ws_stat_foreground",SET_TOKEN:"ws_stat_settoken",PUSH_REPORT:"uniapp_sdk_report",GET_PROFANITY_LIST:"get_local_words",TRANSLATE_TEXT:"ws_batch_trans_text",VOICE_TO_TEXT:"ws_sentence_recognition",FOLLOW:"follow_add",UNFOLLOW:"follow_delete",GET_FOLLOW:"follow_get",GET_FOLLOW_INFO:"follow_get_info",CHECK_FOLLOW_TYPE:"follow_check",SET_ALL_RECEIVE_MSG_OPT:"ws_set_do_not_disturb",GET_ALL_RECEIVE_MSG_OPT:"ws_get_do_not_disturb"},rc="networkRTT",ac="messageE2EDelay",nr="sendMessageC2C",Po="sendMessageGroup",ir="sendMessageGroupAV",Dr="sendMessageRichMedia",fi="cosUpload",Ba="messageReceivedGroup",za="messageReceivedGroupAVPush",sc="messageReceivedGroupAVPull",qa=(S(Kn={},rc,2),S(Kn,ac,3),S(Kn,nr,4),S(Kn,Po,5),S(Kn,ir,6),S(Kn,Dr,7),S(Kn,Ba,8),S(Kn,za,9),S(Kn,sc,10),S(Kn,fi,11),Kn),q_={info:4,warning:5,error:6},rg={wifi:1,"2g":2,"3g":3,"4g":4,"5g":5,unknown:6,none:7,online:8},Uo={login:4,plugin_search:16,plugin_translate:16,plugin_voice_to_text:16,plugin_cs:16,plugin_push:16,plugin_bot:16,plugin_emoji_reaction:16},Be=(y(or,[{key:"updateTimeStamp",value:function(){this.timestamp=dt()}},{key:"start",value:function(e){return this._startts=e,this}},{key:"end",value:function(){var e,n=this,o=0<arguments.length&&arguments[0]!==void 0&&arguments[0];this._sentFlag||(this._netMonitorModule&&(e=this._netMonitorModule.getNetworkType(),this.setNetworkType(e)),e=dt(),this.costTime===0&&(this.costTime=e-this._startts),this.setMoreMessage("startts:".concat(this._startts," endts:").concat(e)),o?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout(function(){n._sentFlag=!0,n._eventStatModule&&n._eventStatModule.pushIn(n)},0))}},{key:"setError",value:function(e){if(!(e instanceof Error))return w.w("".concat(this._n,".setError value not instanceof Error, please check!")),this;if(this._sentFlag)return this;var n=!0;return(n=this._netMonitorModule?this._netMonitorModule.isOnline():n)?(e.code&&this.setCode(e.code),e.message&&this.setMoreMessage(e.message)):this.setCode(we.NO_NETWORK),this.setLevel("error"),this}},{key:"setCode",value:function(e){return xe(e)||this._sentFlag||(e==="ECONNABORTED"&&(this.code=103),qt(e)?this.code=e:w.w("".concat(this._n,".setCode value not a number, please check!"),e,I(e))),this}},{key:"setMessage",value:function(e){return xe(e)||this._sentFlag||(qt(e)&&(this.message=e.toString()),wt(e)&&(this.message=e)),this}},{key:"setCostTime",value:function(e){return this.costTime=e,this}},{key:"setLevel",value:function(e){return xe(e)||this._sentFlag||(this.level=q_[e]),this}},{key:"setMoreMessage",value:function(e){return Je(this.moreMessage)?this.moreMessage="".concat(e):this.moreMessage+=" ".concat(e),this}},{key:"setNetworkType",value:function(e){return xe(e)?w.w("".concat(this._n,".setNetworkType value is undefined, please check!")):(e=rg[e.toLowerCase()],xe(e)||(this.networkType=e)),this}},{key:"getStartTs",value:function(){return this._startts}},{key:"setUIPlatform",value:function(e){return this.uiPlatform=e,this}},{key:"setExtension",value:function(e){return this.extension=e,this}},{key:"setEventType",value:function(e){return this.eventType=e,this}}],[{key:"bindEventStatModule",value:function(e){or.prototype._eventStatModule=e}},{key:"bindNetMonitorModule",value:function(e){or.prototype._netMonitorModule=e}}]),or),au=(y(hc,[{key:"setText",value:function(e){this.content.text=e}},{key:"sendable",value:function(){return this.content.text.length!==0}}]),hc),Qd=(y(cA,[{key:"_initImageInfoModel",value:function(){var e=this;this._ImageInfoModel=function(n){this.instanceID=Mi(9999999),this.sizeType=n.type||0,this.type=0,this.size=n.size||0,this.width=n.width||0,this.height=n.height||0,this.imageUrl=n.imageUrl||n.url||"",this.url=ki(n.url||e._imageMemoryURL,e._fileDownloadProxy)},this._ImageInfoModel.prototype={setSizeType:function(n){this.sizeType=n},setType:function(n){this.type=n},setImageUrl:function(n){n&&(this.imageUrl=n)},getImageUrl:function(){return this.imageUrl}}}},{key:"initImageInfoArray",value:function(e){for(var n,o=0,a=null;o<=2;)n=xe(e)||xe(e[o])?{type:0,size:0,width:0,height:0,url:""}:e[o],(a=new this._ImageInfoModel(n)).setSizeType(o+1),a.setType(o),this.addImageInfo(a),o++;this.updateAccessSideImageInfoArray()}},{key:"updateImageInfoArray",value:function(e){for(var n,o=this.content.imageInfoArray.length,a=0;a<o;a++)n=this.content.imageInfoArray[a],e[a].size&&(n.size=e[a].size),e[a].url&&n.setImageUrl(e[a].url),e[a].width&&(n.width=e[a].width),e[a].height&&(n.height=e[a].height)}},{key:"_autoFixUrl",value:function(){for(var e=this.content.imageInfoArray.length,n="",o="",a=["http","https"],l=null,h=0;h<e;h++)this.content.imageInfoArray[h].url&&(l=this.content.imageInfoArray[h]).imageUrl!==""&&(o=l.imageUrl.slice(0,l.imageUrl.indexOf("://")+1),n=l.imageUrl.slice(l.imageUrl.indexOf("://")+1),a.indexOf(o)<0&&(o="https:"),this.content.imageInfoArray[h].setImageUrl([o,n].join("")))}},{key:"updatePercent",value:function(e){this._percent=e,1<this._percent&&(this._percent=1)}},{key:"updateImageFormat",value:function(e){this.content.imageFormat=Rt[e.toUpperCase()]||Rt.UNKNOWN}},{key:"createImageDataASURLInWeb",value:function(e){e!==void 0&&0<e.files.length&&(this._imageMemoryURL=window.URL.createObjectURL(e.files[0]))}},{key:"createImageDataASURLInWXMiniApp",value:function(e){e&&e.url&&(this._imageMemoryURL=e.url)}},{key:"replaceImageInfo",value:function(e,n){this.content.imageInfoArray[n]instanceof this._ImageInfoModel||(this.content.imageInfoArray[n]=e)}},{key:"addImageInfo",value:function(e){3<=this.content.imageInfoArray.length||this.content.imageInfoArray.push(e)}},{key:"updateAccessSideImageInfoArray",value:function(){var e=this.content.imageInfoArray,o=e[0],n=o.width,n=n===void 0?0:n,o=o.height,o=o===void 0?0:o;n!==0&&o!==0&&(Jl(e),Object.assign(e[2],Bd({originWidth:n,originHeight:o,min:720})))}},{key:"sendable",value:function(){return this.content.imageInfoArray.length!==0&&this.content.imageInfoArray[0].imageUrl!==""&&this.content.imageInfoArray[0].size!==0}}]),cA),Xd=(y(cu,[{key:"sendable",value:function(){return this.content!==null}}]),cu),cc=(y(sA,[{key:"updatePercent",value:function(e){this._percent=e,1<this._percent&&(this._percent=1)}},{key:"updateAudioUrl",value:function(e){this.content.remoteAudioUrl=e}},{key:"sendable",value:function(){return this.content.remoteAudioUrl!==""}}]),sA),Jd={from:!0,groupID:!0,groupName:!0,to:!0},ag=(y(Ac,[{key:"_initContent",value:function(e){var n=this;Object.keys(e).forEach(function(o){switch(o){case"remarkInfo":break;case"groupProfile":n.content.groupProfile={},n._initGroupProfile(e[o]);break;case"operatorInfo":break;case"memberInfoList":case"msgMemberInfo":n._updateMemberList(e[o]);break;case"memberExtraInfo":case"onlineMemberInfo":break;case"memberNum":n.content[o]=e[o],n.content.memberCount=e[o];break;case"newGroupProfile":n.content.newGroupProfile={},n._initNewGroupProfile(e[o]);break;default:n.content[o]=e[o]}}),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{key:"_initGroupProfile",value:function(e){for(var n=Object.keys(e),o=0;o<n.length;o++){var a=n[o];Jd[a]&&(this.content.groupProfile[a]=e[a])}}},{key:"_updateMemberList",value:function(e){Je(this.content.memberList)?this.content.memberList=e:this.content.memberList.forEach(function(n){e.forEach(function(o){n.userID===o.userID&&Object.assign(n,o)})})}},{key:"_initNewGroupProfile",value:function(e){for(var n=Object.keys(e),o=0;o<n.length;o++){var a=n[o];this.content.newGroupProfile[a]=a!=="muteAllMembers"?e[a]:e[a]===1}}}]),Ac),H_={from:!0,groupID:!0,groupName:!0,to:!0,groupType:!0},Zd=(y(aA,[{key:"_initContent",value:function(e){var n=this;Object.keys(e).forEach(function(o){switch(o){case"memberInfoList":break;case"remarkInfo":n.content.handleMessage=e[o];break;case"groupProfile":n.content.groupProfile={},n._initGroupProfile(e[o]);break;default:n.content[o]=e[o]}})}},{key:"_initGroupProfile",value:function(e){for(var n=Object.keys(e),o=0;o<n.length;o++){var a=n[o];H_[a]&&(a==="groupName"?this.content.groupProfile.name=e[a]:this.content.groupProfile[a]=e[a])}}}]),aA),lc=(y(Ha,[{key:"_getFileInfo",value:function(o){if(!xe(o.fileName)&&!xe(o.fileSize))return{size:o.fileSize,name:o.fileName};var n,o=o.file.files[0];return We&&(o.path&&o.path.indexOf(".")!==-1&&(n=o.path.slice(o.path.lastIndexOf(".")+1).toLowerCase(),o.type=n,o.name||(o.name="".concat(Mi(999999),".").concat(n))),o.name||(o.type="",o.name=o.path.slice(o.path.lastIndexOf("/")+1).toLowerCase()),o.suffix&&(o.type=o.suffix),o.url||(o.url=o.path)),{size:o.size,name:o.name}}},{key:"updatePercent",value:function(e){this._percent=e,1<this._percent&&(this._percent=1)}},{key:"updateFileUrl",value:function(e){this.content.fileUrl=e}},{key:"sendable",value:function(){return this.content.fileUrl!==""&&this.content.fileName!==""&&this.content.fileSize!==0}}]),Ha),$d=(y(su,[{key:"setData",value:function(e){return this.content.data=e,this}},{key:"setDescription",value:function(e){return this.content.description=e,this}},{key:"setExtension",value:function(e){return this.content.extension=e,this}},{key:"sendable",value:function(){return this.content.data.length!==0||this.content.description.length!==0||this.content.extension.length!==0}}]),su),ro=(y(rA,[{key:"updatePercent",value:function(e){this._percent=e,1<this._percent&&(this._percent=1)}},{key:"updateVideoUrl",value:function(e){e&&(this.content.remoteVideoUrl=e)}},{key:"updateSnapshotInfo",value:function(a){var n=a.snapshotUrl,o=a.snapshotWidth,a=a.snapshotHeight;Je(n)||(this.content.thumbUrl=this.content.snapshotUrl=n),Je(o)||(this.content.thumbWidth=this.content.snapshotWidth=Number(o)),Je(a)||(this.content.thumbHeight=this.content.snapshotHeight=Number(a))}},{key:"sendable",value:function(){return this.content.remoteVideoUrl!==""}}]),rA),Nr=(y(oA,[{key:"sendable",value:function(){return!0}}]),oA),Si=(y(iA,[{key:"_patchRichMediaPayload",value:function(e,n){e===C.MSG_IMAGE?n.imageInfoArray.forEach(function(o){!o.imageUrl&&o.url&&(o.imageUrl=o.url,o.sizeType=o.type,o.type===1?o.type=0:o.type===3&&(o.type=1))}):e===C.MSG_VIDEO?!n.remoteVideoUrl&&n.videoUrl&&(n.remoteVideoUrl=n.videoUrl):e===C.MSG_AUDIO?!n.remoteAudioUrl&&n.url&&(n.remoteAudioUrl=n.url):e===C.MSG_FILE&&!n.fileUrl&&n.url&&(n.fileUrl=n.url,n.url=void 0)}},{key:"_updateRichMediaDownloadUrl",value:function(e,n,o){o&&(e===C.MSG_IMAGE?n.imageInfoArray.forEach(function(a){a.url=ki(a.url,o)}):e===C.MSG_VIDEO?(n.videoUrl=ki(n.videoUrl,o),n.snapshotUrl=ki(n.thumbUrl,o),n.snapshotHeight=n.thumbHeight,n.snapshotWidth=n.thumbWidth):e===C.MSG_AUDIO?n.url=ki(n.url,o):e===C.MSG_FILE&&(n.fileUrl=ki(n.fileUrl,o)))}}]),iA),Rr=(y(nA,[{key:"sendable",value:function(){return!Je(this.content.messageList)||!Je(this.content.downloadKey)}}]),nA),uc={1:C.MSG_PRIORITY_HIGH,2:C.MSG_PRIORITY_NORMAL,3:C.MSG_PRIORITY_LOW,4:C.MSG_PRIORITY_LOWEST},Yn=(y(tA,[{key:"elements",get:function(){return this._elements}},{key:"getElements",value:function(){return this._elements}},{key:"extractGroupInfo",value:function(e){e!==null&&(wt(e.nick)&&(this.nick=e.nick),wt(e.avatar)&&(this.avatar=e.avatar),e=e.messageFromAccountExtraInformation,Qt(e)&&wt(e.nameCard)&&(this.nameCard=e.nameCard))}},{key:"handleGroupAtInfo",value:function(e){var n=this;e.payload&&e.payload.atUserList&&e.payload.atUserList.forEach(function(o){o!==C.MSG_AT_ALL?(n._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:o}),n.atUserList.push(o)):(n._groupAtInfoList.push({groupAtAllFlag:1}),n.atUserList.push(C.MSG_AT_ALL))}),At(e.groupAtInfo)&&e.groupAtInfo.forEach(function(o){o.groupAtAllFlag===0?n.atUserList.push(o.groupAtUserID):o.groupAtAllFlag===1&&n.atUserList.push(C.MSG_AT_ALL)})}},{key:"getGroupAtInfoList",value:function(){return this._groupAtInfoList}},{key:"_initProxy",value:function(){this._elements[0]&&(this.payload=this._elements[0].content,this.type=this._elements[0].type)}},{key:"reInitialize",value:function(e){e&&(this.status=this.from?eo:Fa,this.from||(this.from=e)),this._initFlow(e),this._initSequence(e),this._concatConversationID(e),this.generateMessageID()}},{key:"isSendable",value:function(){return this._elements.length!==0&&(this._relayFlag===!0||typeof this._elements[0].sendable=="function"&&this._elements[0].sendable())}},{key:"_initTo",value:function(e){this.conversationType===C.CONV_GROUP&&(this.to=e.groupID)}},{key:"_initSequence",value:function(e){var n,o,a;this.clientSequence===0&&e&&(this.clientSequence=!!(e=e)&&(Js[e]===void 0&&(a=new Date,n="3".concat(a.getHours()).slice(-2),o="0".concat(a.getMinutes()).slice(-2),a="0".concat(a.getSeconds()).slice(-2),Js[e]=parseInt([n,o,a,"0001"].join("")),a=o=n=null,w.l("autoIncrementIndex start index:".concat(Js[e]))),Js[e]++)),this.sequence===0&&this.conversationType===C.CONV_C2C&&(this.sequence=this.clientSequence)}},{key:"generateMessageID",value:function(){this.from===C.CONV_SYSTEM&&(this.senderTinyID="144115198244471703"),this.ID="".concat(this.senderTinyID,"-").concat(this.clientTime,"-").concat(this.random)}},{key:"_initFlow",value:function(e){e!==""&&(e===this.from?(this.flow="out",this.isRead=!0):this.flow="in")}},{key:"_concatConversationID",value:function(e){var n=this.to,o=this.conversationType;o!==C.CONV_SYSTEM?(e=o===C.CONV_C2C?e===this.from?n:this.from:this.to,this.conversationID=e?"".concat(o).concat(e):null):this.conversationID=C.CONV_SYSTEM}},{key:"isElement",value:function(e){return e instanceof au||e instanceof Qd||e instanceof Xd||e instanceof cc||e instanceof lc||e instanceof ro||e instanceof ag||e instanceof Zd||e instanceof $d||e instanceof Nr||e instanceof Rr}},{key:"setElement",value:function(e,n){var o=this;if(this.isElement(e))return this._elements=[e],void this._initProxy();function a(h){if(h.type&&h.content)switch(h.type){case C.MSG_TEXT:o.setTextElement(h.content);break;case C.MSG_IMAGE:o.setImageElement(h.content,n);break;case C.MSG_AUDIO:o.setAudioElement(h.content,n);break;case C.MSG_FILE:o.setFileElement(h.content,n);break;case C.MSG_VIDEO:o.setVideoElement(h.content,n);break;case C.MSG_CUSTOM:o.setCustomElement(h.content);break;case C.MSG_LOCATION:o.setLocationElement(h.content);break;case C.MSG_GRP_TIP:o.setGroupTipElement(h.content);break;case C.MSG_GRP_SYS_NOTICE:o.setGroupSystemNoticeElement(h.content);break;case C.MSG_FACE:o.setFaceElement(h.content);break;case C.MSG_MERGER:o.setMergerElement(h.content,n)}}if(At(e))for(var l=0;l<e.length;l++)a(e[l]);else a(e);this._initProxy()}},{key:"clearElement",value:function(){this._elements.length=0}},{key:"setTextElement",value:function(e){e=typeof e=="string"?e:e.text,e=new au({text:e}),this._elements.push(e)}},{key:"setImageElement",value:function(e,n){e=new Qd(e,n),this._elements.push(e)}},{key:"setAudioElement",value:function(e,n){e=new cc(e,n),this._elements.push(e)}},{key:"setFileElement",value:function(e,n){e=new lc(e,n),this._elements.push(e)}},{key:"setVideoElement",value:function(e,n){e=new ro(e,n),this._elements.push(e)}},{key:"setLocationElement",value:function(e){e=new Nr(e),this._elements.push(e)}},{key:"setCustomElement",value:function(e){e=new $d(e),this._elements.push(e)}},{key:"setGroupTipElement",value:function(e){var n,o={},a=e.operationType;Je(e.memberInfoList)?e.operatorInfo&&(o=e.operatorInfo):a!==C.GRP_TIP_MBR_JOIN&&a!==C.GRP_TIP_MBR_KICKED_OUT&&a!==C.GRP_TIP_MBR_SET_ADMIN&&a!==C.GRP_TIP_MBR_CANCELED_ADMIN||(o=e.memberInfoList[0]),Je(e.memberExtraInfo)||(n=e.memberExtraInfo.reason,e.msgMemberInfo.forEach(function(l){l.reason=n})),a=o.nick,o=o.avatar,wt(a)&&(this.nick=a),wt(o)&&(this.avatar=o),a=new ag(e),this._elements.push(a)}},{key:"setGroupSystemNoticeElement",value:function(e){e=new Zd(e),this._elements.push(e)}},{key:"setFaceElement",value:function(e){e=new Xd(e),this._elements.push(e)}},{key:"setMergerElement",value:function(e,n){e=new Rr(e,n),this._elements.push(e)}},{key:"setIsRead",value:function(e){this.isRead=e}},{key:"setRelayFlag",value:function(e){this._relayFlag=e}},{key:"_computePriority",value:function(e){return xe(e)?C.MSG_PRIORITY_NORMAL:wt(e)&&Object.values(uc).indexOf(e)!==-1?e:qt(e)&&(e=""+e,Object.keys(uc).indexOf(e)!==-1)?uc[e]:C.MSG_PRIORITY_NORMAL}},{key:"setNickAndAvatar",value:function(o){var n=o.nick,o=o.avatar;wt(n)&&(this.nick=n),wt(o)&&(this.avatar=o)}},{key:"setNameCard",value:function(e){wt(e)&&(this.nameCard=e)}},{key:"initC2CReadReceiptInfo",value:function(e){this.conversationType===C.CONV_C2C&&this.needReadReceipt===!0&&(this.readReceiptInfo.isPeerRead=e===1)}}]),tA),sg=(E(dc,Pn),ng=B(dc),y(dc,[{key:"onNewC2CMessage",value:function(o){var h=o.dataList,n=o.isInstantMessage,a=o.C2CRemainingUnreadList,l=o.C2CPairUnreadList,o=o.isSyncingEnded,h=(w.d("".concat(this._n,".onNewC2CMessage count:").concat(h.length," isInstantMessage:").concat(n)),this._newC2CMessageStoredAndSummary({dataList:h,C2CRemainingUnreadList:a,C2CPairUnreadList:l,isInstantMessage:n})),a=h.conversationOptionsList,l=h.messageList,h=h.isUnreadC2CMessage,m=Vd(l),m=(0<m.length&&this.emitOuterEvent(R.MESSAGE_MODIFIED,m),this.get(11).onNewMessage({conversationOptionsList:a,isInstantMessage:n,isUnreadC2CMessage:h,isSyncingEnded:o}),Gd(l));n&&0<m.length&&this.emitOuterEvent(R.MESSAGE_RECEIVED,m),l.length=0}},{key:"_newC2CMessageStoredAndSummary",value:function(e){for(var n=e.dataList,o=e.C2CRemainingUnreadList,a=e.C2CPairUnreadList,l=e.isInstantMessage,h=null,m=[],M=[],L={},F=this.get(26),$=!1,ue=this.get(11),fe=this.get(4),he=this.getFileDownloadProxy(),be=0,ze=n.length;be<ze;be++)if(this._isC2CNotice(n[be]))this._noticeFromUnreadDBList.push(n[be].eventArray[0].c2CNotifyMsgArray[0]);else{var Ye=n[be],Tt=(Ye.currentUser=this.getMyUserID(),Ye.conversationType=C.CONV_C2C,Ye.isSystemMessage=!!Ye.isSystemMessage,(xe(Ye.nick)||xe(Ye.avatar))&&($=!0,w.d("".concat(this._n,"._newC2CMessageStoredAndSummary nick or avatar missing!"))),(h=new Yn(Ye)).setElement(Ye.elements,he),h.setNickAndAvatar({nick:Ye.nick,avatar:Ye.avatar}),h.conversationID);if(l){if(this._messageFromUnreadDBMap.get(h.ID)===1)continue;var Ct,Bt,In=!1,ii=(h.from!==this.getMyUserID()?(Bt=ue.getLatestMessageSentByPeer(Tt))&&(Ct=Bt.nick,Bt=Bt.avatar,$?h.setNickAndAvatar({nick:Ct,avatar:Bt}):Ct===h.nick&&Bt===h.avatar||(In=!0)):(Ct=ue.getLatestMessageSentByMe(Tt))&&(Bt=Ct.nick,ii=Ct.avatar,Bt===h.nick&&ii===h.avatar||(ue.modifyMessageSentByMe({conversationID:Tt,latestNick:h.nick,latestAvatar:h.avatar}),fe.mockOnNickAvatarModified(h.nick,h.avatar))),n[be].isModified===1);if(ue.isMessageSentByCurrentInstance(h)?h.isModified=ii:ii=!1,Ye.msgLifeTime===0)h._onlineOnlyFlag=!0,ue.isMessageSentByCurrentInstance(h)||M.push(h);else{if(!ue.pushIntoMessageList(M,h,ii))continue;In&&(ue.modifyMessageSentByPeer({conversationID:Tt,latestNick:h.nick,latestAvatar:h.avatar}),ue.updateUserProfileSpecifiedKey({conversationID:Tt,nick:h.nick,avatar:h.avatar}))}l&&0<h.clientTime&&F.addMessageDelay(h.clientTime)}else this._messageFromUnreadDBMap.set(h.ID,1);if(Ye.msgLifeTime!==0){if(h._onlineOnlyFlag===!1){if(In=ue.getLastMessageTime(Tt),qt(In)&&h.time<In)continue;xe(L[Tt])?(Ye=0,h.flow==="in"&&(h._isExcludedFromUnreadCount||(Ye=1)),L[Tt]=m.push({conversationID:Tt,unreadCount:Ye,type:h.conversationType,subType:h.conversationSubType,lastMessage:h._isExcludedFromLastMessage?"":h})-1):(Ye=L[Tt],m[Ye].type=h.conversationType,m[Ye].subType=h.conversationSubType,m[Ye].lastMessage=h._isExcludedFromLastMessage?"":h,h.flow==="in"&&(h._isExcludedFromUnreadCount||m[Ye].unreadCount++))}}else h._onlineOnlyFlag=!0}this._handleRevokedNoticeFromUnreadDB();var oi=!1;if(At(a))for(var ri=0,ss=a.length;ri<ss;ri++)(function(so){var Ou;0<a[so].unreadCount&&(oi=!0,(Ou=m.find(function(rh){return rh.conversationID==="C2C".concat(a[so].from)}))?Ou.unreadCount=a[so].unreadCount:m.push({conversationID:"C2C".concat(a[so].from),unreadCount:a[so].unreadCount,type:C.CONV_C2C}))})(ri);if(At(o))for(var ua=0,cr=o.length;ua<cr;ua++)(function(so){m.find(function(Ou){return Ou.conversationID==="C2C".concat(o[so].from)})||m.push({conversationID:"C2C".concat(o[so].from),type:C.CONV_C2C,lastMsgTime:o[so].lastMsgTime})})(ua);return{conversationOptionsList:m,messageList:M,isUnreadC2CMessage:oi}}},{key:"_isC2CNotice",value:function(e){return e=e.eventArray,!(!At(e)||e[0].event!==10)}},{key:"_handleRevokedNoticeFromUnreadDB",value:function(){var e,n=this._noticeFromUnreadDBList.length;n!==0&&(w.l("".concat(this._n,"._handleRevokedNoticeFromUnreadDB count:").concat(n)),e=[],this._noticeFromUnreadDBList.forEach(function(o){o.hasOwnProperty("c2cMessageRevokedNotify")&&e.push(o)}),this.onC2CMessageRevoked({dataList:e}),this._noticeFromUnreadDBList.length=0,e.length=0)}},{key:"onC2CMessageRevoked",value:function(e){var n,o=this,a=this.get(11),l=[];e.dataList.forEach(function(h){h.c2cMessageRevokedNotify&&(h=h.c2cMessageRevokedNotify.revokedInfos,xe(h)||h.forEach(function(m){var M=o.getMyUserID()===m.from?"".concat(C.CONV_C2C).concat(m.to):"".concat(C.CONV_C2C).concat(m.from);n=a.revoke(M,m.sequence,m.random);var L,F=m.revokerInfo&&m.revokerInfo.revoker,$=m.revokerInfo&&m.revokerInfo.reason||"";n?L=n:(L={conversationID:M,sequence:m.sequence},m.tinyID&&m.clientTime&&m.random&&(L.ID="".concat(m.tinyID,"-").concat(m.clientTime,"-").concat(m.random)),m.time&&(L.time=m.time)),L&&(L.revoker=F,L.revokeReason=$,L.revokerInfo={userID:F,nick:"",avatar:""},l.push(L))}))}),l.length!==0&&(a.onMessageRevoked(l),w.l("".concat(this._n,".onC2CMessageRevoked count:").concat(l.length)),a.updateRevokerInfo(l).then(function(h){o.emitOuterEvent(R.MESSAGE_REVOKED,h)}))}},{key:"onC2CMessageReadReceipt",value:function(e){var n=this;e.dataList.forEach(function(o){var a;Je(o.c2cMessageReadReceipt)||(a=o.c2cMessageReadReceipt.to,o.c2cMessageReadReceipt.uinPairReadArray.forEach(function(h){var h=h.peerReadTime,m=(w.d("".concat(n._n,"._onC2CMessageReadReceipt to:").concat(a," peerReadTime:").concat(h)),"".concat(C.CONV_C2C).concat(a)),M=n.get(11);M.recordPeerReadTime(m,h),M.updateMessageIsPeerReadProperty(m,h)}))})}},{key:"onC2CMessageReadNotice",value:function(e){var n=this;e.dataList.forEach(function(o){var a;Je(o.c2cMessageReadNotice)||(a=n.get(11),o.c2cMessageReadNotice.uinPairReadArray.forEach(function(h){var m=h.from,h=h.peerReadTime,m=(w.d("".concat(n._n,".onC2CMessageReadNotice from:").concat(m," lastReadTime:").concat(h)),"".concat(C.CONV_C2C).concat(m));a.updateIsReadAfterReadReport({conversationID:m,lastMessageTime:h}),a.updateUnreadCount(m)}))})}},{key:"onC2CMessageModified",value:function(e){w.d("".concat(this._n,".onC2CMessageModified options:"),JSON.stringify(e));var n=this.get(11);e.dataList.forEach(function(o){n.onMessageModified(u(u({},o),{},{conversationType:C.CONV_C2C}))})}},{key:"onReadReceiptList",value:function(o){w.d("".concat(this._n,".onReadReceiptList options:"),JSON.stringify(o));var o=o.dataList,n=o.userID,o=o.readReceiptList;this.get(11).updateReadReceiptInfo({userID:n,readReceiptList:o})}},{key:"sendMessage",value:function(e,n){return e=this._createC2CMessagePack(e,n),this.req(e)}},{key:"_createC2CMessagePack",value:function(e,n){var o,a,l=null,h=(n&&(n.offlinePushInfo&&(l=n.offlinePushInfo),n.onlineUserOnly===!0&&(l?l.disablePush=!0:l={disablePush:!0})),""),m=(wt(e.cloudCustomData)&&0<e.cloudCustomData.length&&(h=e.cloudCustomData),[]),M=(Qt(n)&&Qt(n.messageControlInfo)&&(M=(a=n.messageControlInfo).excludedFromUnreadCount,o=a.excludedFromLastMessage,a=a.excludedFromContentModeration,M===!0&&m.push("NoUnread"),o===!0&&m.push("NoLastMsg"),a===!0&&m.push("NoMsgCheck")),this.isOnlineMessage(e,n)?0:void 0);return{proto:le.SEND_C2C_MSG,tjgID:this.generateTjgID(e),data:{fromAccount:this.getMyUserID(),toAccount:e.to,msgBody:e.getElements(),cloudCustomData:h,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:M,nick:e.nick,avatar:e.avatar,offlinePushInfo:l?{pushFlag:l.disablePush===!0?1:0,title:l.title||"",desc:l.description||"",ext:l.extension||"",apnsInfo:{badgeMode:l.ignoreIOSBadge===!0?1:0,isVoipPush:this._isVoipPush(l)},androidInfo:{OPPOChannelID:l.androidOPPOChannelID||""}}:void 0,messageControlInfo:M!==0?m:void 0,clientTime:e.clientTime,needReadReceipt:e.needReadReceipt===!0?1:0,isSupportExtension:e.isSupportExtension===!0?1:0,isRelayMessage:e._relayFlag===!0?1:0,cmConfigID:e._cmConfigID}}}},{key:"_isVoipPush",value:function(e){var n=void 0;return n=xe(e.disableVoipPush)?n:e.disableVoipPush===!1?1:0}},{key:"isOnlineMessage",value:function(e,n){return!(!n||n.onlineUserOnly!==!0)}},{key:"revokeMessage",value:function(e){return this.req({proto:le.REVOKE_C2C_MSG,data:{msgInfo:{fromAccount:e.from,toAccount:e.to,msgSeq:e.sequence,msgRandom:e.random,msgTimeStamp:e.time}}})}},{key:"deleteMessage",value:function(o){var n=o.to,o=o.keyList;return w.l("".concat(this._n,".deleteMessage toAccount:").concat(n," count:").concat(o.length)),this.req({proto:le.DEL_C2C_MSG,data:{fromAccount:this.getMyUserID(),to:n,keyList:o}})}},{key:"modifyRemoteMessage",value:function(F){var n=F.from,o=F.to,a=F.version,a=a===void 0?0:a,l=F.sequence,h=F.random,m=F.time,M=F.payload,L=F.type,F=F.cloudCustomData,$=void 0;return Xp(L)&&($=[]).push({type:L,content:M}),this.req({proto:le.MODIFY_C2C_MSG,data:{from:n,to:o,version:a,sequence:l,random:h,time:m,elements:$,cloudCustomData:F}})}},{key:"setMessageRead",value:function(h){var n=this,o=h.conversationID,a=h.lastMessageTime,l="".concat(this._n,".").concat("setMessageRead"),h="conversationID:".concat(o," lastMessageTime:").concat(a),m=(w.l("".concat(l," ").concat(h)),qt(a)||this.outputWarning("DoNotModifyLastTime"),new Be("setMessageRead"));return m.setMessage(h),this.req({proto:le.SET_C2C_MSG_READ,data:{C2CMsgReaded:{cookie:"",C2CMsgReadedItem:[{toAccount:o.replace("C2C",""),lastMessageTime:a,receipt:1}]}}}).then(function(){m.end(),w.l("".concat(l," ok"));var M=n.get(11);return M.updateIsReadAfterReadReport({conversationID:o,lastMessageTime:a}),M.updateUnreadCount(o),ft()}).catch(function(M){return m.setError(M).end(),w.l("".concat(l," failed. error:"),M),Ce(M)})}},{key:"getRoamingMessage",value:function(M){var n=this,o="".concat(this._n,".getRoamingMessage"),a=M.peerAccount,l=M.conversationID,h=M.count,m=M.lastMessageTime,M=M.messageKey,L="peerAccount:".concat(a," count:").concat(h||15," lastMessageTime:").concat(m||0," messageKey:").concat(M),F=(w.l("".concat(o," ").concat(L)),new Be("getC2CRoamingMessages"));return this.req({proto:le.GET_C2C_ROAMING_MSG,data:{peerAccount:a,count:h||15,lastMessageTime:m||0,messageKey:M}}).then(function(ze){var ze=ze.data,he=ze.complete,be=ze.messageList,ue=ze.messageKey,ze=ze.lastMessageTime,fe=(xe(be)?w.l("".concat(o," ok. complete:").concat(he," but messageList is undefined!")):w.l("".concat(o," ok. complete:").concat(he," count:").concat(be.length)),F.setMessage("".concat(L," complete:").concat(he," length:").concat(be.length)).end(),n.get(11)),he=(he===1&&fe.setCompleted(l),fe.onRoamingMessage(be,l)),be=(fe.modifyMessageList(l),fe.updateIsRead(l),fe.updateRoamingMessageKeyAndTime(l,ue,ze),fe.getPeerReadTime(l)),ze=(w.l("".concat(o," update isPeerRead property. conversationID:").concat(l," peerReadTime:").concat(be)),be?fe.updateMessageIsPeerReadProperty(l,be):(ue=l.replace(C.CONV_C2C,""),n.getRemotePeerReadTime([ue]).then(function(){fe.updateMessageIsPeerReadProperty(l,fe.getPeerReadTime(l))})),"");return 0<he.length?ze=he[0].ID:(be=fe.getLocalOldestMessage(l))&&(ze=be.ID),w.l("".concat(o," nextReqID:").concat(ze," stored message count:").concat(he.length)),{nextReqID:ze,storedMessageList:he}}).catch(function($){return F.setMessage(L).setError($).end(),w.w("".concat(o," failed. error:"),$),Ce($)})}},{key:"getRoamingMessagesHopping",value:function(e){var n=this,o="".concat(this._n,".getRoamingMessagesHopping"),a=e.peerAccount,l=e.time,l=l===void 0?0:l,h=e.count,m=e.direction,M="".concat(C.CONV_C2C).concat(a),L="peerAccount:".concat(a," count:").concat(h," time:").concat(l," direction:").concat(m),F=(w.l("".concat(o," ").concat(L)),new Be("getC2CRoamingMessagesHopping"));return this.req({proto:le.GET_C2C_ROAMING_MSG,data:{peerAccount:a,count:h+1,lastMessageTime:l,direction:m}}).then(function(ue){var ue=ue.data,he=ue.complete,fe=ue.messageList,fe=fe===void 0?[]:fe,ue=ue.lastMessageTime,fe=(w.l("".concat(o," ok. complete:").concat(he," count:").concat(fe.length)),F.setMessage("".concat(L," complete:").concat(he," length:").concat(fe.length)).end(),he!==1&&(m===1?fe.pop():fe.shift()),n.get(11).onRoamingMessage(fe,M,!1)),he=(n._modifyMessageList(M,fe),n._computeResult({complete:he,lastMessageTime:ue,resultList:fe}));return ft(he)}).catch(function($){return F.setMessage(L).setError($).end(),w.w("".concat(o," failed. error:"),$),Ce($)})}},{key:"_computeResult",value:function(a){var n=a.complete,n=n===void 0?0:n,o=a.lastMessageTime,a=a.resultList,a={messageList:V(a===void 0?[]:a),isCompleted:!1,nextMessageTime:""};return n===1?a.isCompleted=!0:a.nextMessageTime=o,a}},{key:"_modifyMessageList",value:function(e,n){if(e=this.get(11).getLocalConversation(e),e)for(var o=e.userProfile.nick,a=e.userProfile.avatar,e=this.get(4).getNickAndAvatarByUserID(this.getMyUserID()),l=e.nick,h=e.avatar,m=n.length-1;0<=m;m--){var M=n[m];M.flow==="in"&&(M.nick!==o&&M.setNickAndAvatar({nick:o}),M.avatar!==a&&M.setNickAndAvatar({avatar:a})),M.flow==="out"&&(M.nick!==l&&M.setNickAndAvatar({nick:l}),M.avatar!==h&&M.setNickAndAvatar({avatar:h}))}}},{key:"getRemotePeerReadTime",value:function(e){var n=this,o="".concat(this._n,".getRemotePeerReadTime");if(Je(e))return w.w("".concat(o," userIDList is empty!")),Promise.resolve();var a=new Be("getPeerReadTime");return w.l("".concat(o," userIDList:").concat(e)),this.req({proto:le.GET_C2C_PEER_READ_TIME,data:{userIDList:e}}).then(function(l){var h=l.data.peerReadTimeList;w.l("".concat(o," ok. peerReadTimeList:").concat(h));for(var m="",M=n.get(11),L=0;L<e.length;L++)m+="".concat(e[L],"-").concat(h[L]," "),0<h[L]&&M.recordPeerReadTime("C2C".concat(e[L]),h[L]);a.setMessage(m).end()}).catch(function(l){a.setError(l).end(),w.w("".concat(o," failed. error:"),l)})}},{key:"sendReadReceipt",value:function(l){var n=l[0].conversationID.replace(C.CONV_C2C,""),o=new Be("sendC2CReadReceipt"),a=(o.setMessage("peerAccount:".concat(n)),this.getMyUserID()),l=l.filter(function(m){return m.from!==a&&m.needReadReceipt===!0}).map(function(m){return{fromAccount:m.from,toAccount:m.to,sequence:m.sequence,random:m.random,time:m.time,clientTime:m.clientTime}});if(l.length===0)return Ce({code:we.READ_RECEIPT_MSG_LIST_EMPTY});var h="".concat(this._n,".sendReadReceipt");return w.l("".concat(h,". peerAccount:").concat(n," messageInfoList length:").concat(l.length)),this.req({proto:le.SEND_C2C_READ_RECEIPT,data:{peerAccount:n,messageInfoList:l}}).then(function(m){return o.end(),w.l("".concat(h," ok")),ft()}).catch(function(m){return o.setError(m).end(),w.w("".concat(h," failed. error:"),m),Ce(m)})}},{key:"getReadReceiptList",value:function(a){var n="".concat(this._n,".getReadReceiptList"),o=this.getMyUserID(),a=a.filter(function(l){return l.from===o&&l.needReadReceipt===!0});return w.l("".concat(n," userID:").concat(o," messageList length:").concat(a.length)),St({messageList:a})}},{key:"getMessageExtensions",value:function(e,n){return w.l("".concat(this._n,".getMessageExtensions startSequence:").concat(n)),this.req({proto:le.GET_C2C_MSG_EXT,data:{from:e.from,to:e.to,messageKey:this.getMessageKey(e),startSequence:n}})}},{key:"modifyMessageExtensions",value:function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;return w.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(o)),this.req({proto:le.MODIFY_C2C_MSG_EXT,data:{from:e.from,to:e.to,messageKey:this.getMessageKey(e),extensionList:n,operateType:o}})}},{key:"getMessageKey",value:function(a){var n=a.clientSequence,o=a.random,a=a.time;return"".concat(n,"_").concat(o,"_").concat(a)}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._messageFromUnreadDBMap.clear(),this._noticeFromUnreadDBList.length=0}}]),dc),W_=(y(eA,[{key:"getLocalOldestMessageByConversationID",value:function(e){return!e||!this.list.has(e)?null:(e=this.list.get(e).values(),e?e.next().value:null)}},{key:"pushIn",value:function(e){var n=1<arguments.length&&arguments[1]!==void 0&&arguments[1],o=e.conversationID,a=!0,l=(this.list.has(o)||this.list.set(o,new Map),this._getUniqueIDOfMessage(e));if(this.list.get(o).has(l)){var h=this.list.get(o).get(l);if(!n||h.isModified===!0)return!1}return this.list.get(o).set(l,e),this._setLatestMessageSentByPeer(o,e),this._setLatestMessageSentByMe(o,e),a}},{key:"unshift",value:function(e,n){var o;if(At(e)?0<e.length&&(o=e[0].conversationID,this._unshiftMultipleMessages(e,n)):(o=e.conversationID,this._unshiftSingleMessage(e,n)),o){var a=Array.from(this.list.get(o).values()),e=a.length;if(e!==0){for(var l=e-1;0<=l;l--)if(a[l].flow==="out"){this._setLatestMessageSentByMe(o,a[l]);break}if(o.startsWith(C.CONV_C2C)){for(var h=e-1;0<=h;h--)if(a[h].flow==="in"){this._setLatestMessageSentByPeer(o,a[h]);break}}}}}},{key:"_unshiftSingleMessage",value:function(e,n){var o=e.conversationID,a=this._getUniqueIDOfMessage(e);if(!this.list.has(o))return this.list.set(o,new Map),this.list.get(o).set(a,e),void n.push(e);var l=this.list.get(o),h=Array.from(l);l.has(a)||(h.unshift([a,e]),this.list.set(o,new Map(h)),n.push(e))}},{key:"_unshiftMultipleMessages",value:function(e,n){for(var o=e.length,a=[],l=e[0].conversationID,h=this.list.get(l),m=this.list.has(l)?Array.from(h):[],M=0;M<o;M++){var L=this._getUniqueIDOfMessage(e[M]);h&&h.has(L)||(a.push([L,e[M]]),n.push(e[M]))}this.list.set(l,new Map(a.concat(m)))}},{key:"remove",value:function(o){var n=o.conversationID,o=this._getUniqueIDOfMessage(o);this.list.has(n)&&this.list.get(n).delete(o)}},{key:"revoke",value:function(e,n,o){if(w.d("revoke message",e,n,o),this.list.has(e)){var a,l=J(this.list.get(e));try{for(l.s();!(a=l.n()).done;){var h=K(a.value,2)[1];if(h.sequence===n&&(xe(o)||h.random===o))return h.isRevoked||(h.isRevoked=!0),h}}catch(m){l.e(m)}finally{l.f()}}return null}},{key:"removeByConversationID",value:function(e){var n=this.list.has(e);w.l("".concat(this._n,".removeByConversationID conversationID:").concat(e," has:").concat(n)),n&&(this.list.delete(e),this._latestMessageSentByPeerMap.delete(e),this._latestMessageSentByMeMap.delete(e))}},{key:"findMessage",value:function(e){var n,o=null,a=J(this.list);try{for(a.s();!(n=a.n()).done;)for(var l=V(K(n.value,2)[1].values()),h=l.length,m=0;m<h;m++)if(l[m].ID===e){o=l[m];break}}catch(M){a.e(M)}finally{a.f()}return o}},{key:"updateMessageIsPeerReadProperty",value:function(e,n){var o=[];if(this.list.has(e)){var a,l=J(this.list.get(e));try{for(l.s();!(a=l.n()).done;){var h=K(a.value,2)[1];h.time<=n&&!h.isPeerRead&&h.flow==="out"&&(h.isPeerRead=!0,o.push(h))}}catch(m){l.e(m)}finally{l.f()}w.l("".concat(this._n,".updateMessageIsPeerReadProperty conversationID:").concat(e," peerReadTime:").concat(n," count:").concat(o.length))}return o}},{key:"updateMessageIsModifiedProperty",value:function(e){var n=e.conversationID;this.list.has(n)&&(e=this._getUniqueIDOfMessage(e),(n=this.list.get(n).get(e))&&(n.isModified=!0))}},{key:"hasLocalMessageList",value:function(e){return this.list.has(e)}},{key:"getLocalMessageList",value:function(e){return this.hasLocalMessageList(e)?V(this.list.get(e).values()):[]}},{key:"getLocalMaxSequence",value:function(e){return this.hasLocalMessageList(e)?(e=V(this.list.get(e).values()).map(function(n){return n.sequence}),Math.max.apply(Math,V(e))):0}},{key:"getLocalMaxTime",value:function(e){return this.hasLocalMessageList(e)?(e=V(this.list.get(e).values()).map(function(n){return n.time}),Math.max.apply(Math,V(e))):0}},{key:"hasLocalMessage",value:function(e,n){for(var o=!1,a=this.getLocalMessageList(e),l=a.length,h=0;h<l;h++)a[h].ID===n&&(o=!0);return o}},{key:"getLocalMessage",value:function(e,n){for(var o=null,a=this.getLocalMessageList(e),l=a.length,h=0;h<l;h++)if(a[h].ID===n){o=a[h];break}return o}},{key:"getLocalLastMessage",value:function(e){return e=this.getLocalMessageList(e),e[e.length-1]}},{key:"getLocalOldestMessage",value:function(e){return this.getLocalMessageList(e)[0]}},{key:"_setLatestMessageSentByPeer",value:function(e,n){e.startsWith(C.CONV_C2C)&&n.flow==="in"&&this._latestMessageSentByPeerMap.set(e,n)}},{key:"_setLatestMessageSentByMe",value:function(e,n){n.flow==="out"&&this._latestMessageSentByMeMap.set(e,n)}},{key:"getLatestMessageSentByPeer",value:function(e){return this._latestMessageSentByPeerMap.get(e)}},{key:"getLatestMessageSentByMe",value:function(e){return this._latestMessageSentByMeMap.get(e)}},{key:"modifyMessageSentByPeer",value:function(l){var n=l.conversationID,o=l.latestNick,a=l.latestAvatar,l=this.list.get(n);if(!Je(l)){var h=Array.from(l.values()),l=h.length;if(l!==0){for(var m=null,M=0,L=!1,F=l-1;0<=F;F--)h[F].flow==="in"&&((m=h[F]).nick!==o&&(m.setNickAndAvatar({nick:o}),L=!0),m.avatar!==a&&(m.setNickAndAvatar({avatar:a}),L=!0),L&&(M+=1));w.l("".concat(this._n,".modifyMessageSentByPeer conversationID:").concat(n," count:").concat(M))}}}},{key:"modifyMessageSentByMe",value:function(l){var n=l.conversationID,o=l.latestNick,a=l.latestAvatar,l=this.list.get(n);if(!Je(l)){var h=Array.from(l.values()),l=h.length;if(l!==0){for(var m=null,M=0,L=!1,F=l-1;0<=F;F--)h[F].flow==="out"&&((m=h[F]).nick!==o&&(m.setNickAndAvatar({nick:o}),L=!0),m.avatar!==a&&(m.setNickAndAvatar({avatar:a}),L=!0),L&&(M+=1));w.l("".concat(this._n,".modifyMessageSentByMe conversationID:").concat(n," count:").concat(M))}}}},{key:"getTopicConversationIDList",value:function(e){return V(this.list.keys()).filter(function(n){return n.startsWith("".concat(C.CONV_GROUP).concat(e))})}},{key:"traversal",value:function(){if(this.list.size!==0&&w.getLevel()===-1){console.group("conversationID-messageCount");var e,n=J(this.list);try{for(n.s();!(e=n.n()).done;){var o=K(e.value,2),a=o[0],l=o[1];console.log("".concat(a,"-").concat(l.size))}}catch(h){n.e(h)}finally{n.f()}console.groupEnd()}}},{key:"onMessageModified",value:function(e,n){if(!this.list.has(e))return{isUpdated:!1,message:null};var o,a="".concat(this._n,".onMessageModified"),l=this._getUniqueIDOfMessage(n),h=this.list.get(e).has(l);return w.l("".concat(a," conversationID:").concat(e," uniqueID:").concat(l," has:").concat(h)),h?(h=this.list.get(e).get(l),e=n.messageVersion,l=n.elements,o=n.cloudCustomData,n=n.checkResult,w.l("".concat(a," localVersion:").concat(h.version," remoteVersion:").concat(e)),h.version<e?(h.version=e,h._elements=JSON.parse(JSON.stringify(l)),h.payload=JSON.parse(JSON.stringify(l[0].content)),h.type=l[0].type,h.cloudCustomData=o,h.isModified=!0,h.hasRiskContent=Zp(n),{isUpdated:!0,message:h}):{isUpdated:!1,message:h}):{isUpdated:!1,message:null}}},{key:"_getUniqueIDOfMessage",value:function(h){var n=h.from,o=h.to,a=h.random,l=h.sequence,h=h.time;return"".concat(n,"-").concat(o,"-").concat(a,"-").concat(l,"-").concat(h)}},{key:"reset",value:function(){this.list.clear(),this._latestMessageSentByPeerMap.clear(),this._latestMessageSentByMeMap.clear()}}]),eA),Rn={A2KEY_AND_TINYID_UPDATED:"_inner".concat(1),CLOUD_CONFIG_UPDATED:"_inner".concat(2),PROFILE_UPDATED:"_inner".concat(3),CONV_SYNC_COMPLETED:"_inner".concat(4),C2C_UNREAD_HANDLE_COMPLETED:"_inner".concat(5)};function eA(){f(this,eA),this.list=new Map,this._n="MessageListHandler",this._latestMessageSentByPeerMap=new Map,this._latestMessageSentByMeMap=new Map}function dc(e){return f(this,dc),(e=ng.call(this,e))._n="C2CModule",e._messageFromUnreadDBMap=new Map,e._noticeFromUnreadDBList=[],e}function tA(e){f(this,tA),this.ID="",this.conversationID=e.conversationID||null,this.conversationType=e.conversationType||C.CONV_C2C,this.conversationSubType=e.conversationSubType,this.time=e.time||Math.ceil(Date.now()/1e3),this.sequence=e.sequence||0,this.clientSequence=e.clientSequence||e.sequence||0,this.random=e.random||e.random===0?e.random:Mi(),this.priority=this._computePriority(e.priority),this.nick=e.nick||"",this.avatar=e.avatar||"",this.isPeerRead=!1,this.nameCard="",this.hasRiskContent=Zp(e.checkResult),this._elements=[],this.isPlaceMessage=e.isPlaceMessage||0,this.isRevoked=e.isPlaceMessage===2||e.msgFlagBits===8,this.from=e.from||null,this.to=e.to||null,this.flow="",this.isSystemMessage=e.isSystemMessage||!1,this.protocol=e.protocol||"JSON",this.isResend=!1,this.isRead=!1,this.status=e.status||eo,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=e.cloudCustomData||"",this.isDeleted=!1,this.isModified=!1,this._isExcludedFromUnreadCount=!(!e.messageControlInfo||e.messageControlInfo.excludedFromUnreadCount!==1),this._isExcludedFromLastMessage=!(!e.messageControlInfo||e.messageControlInfo.excludedFromLastMessage!==1),this.clientTime=e.clientTime||Se()||0,this.senderTinyID=e.senderTinyID||e.tinyID||"",this.readReceiptInfo=e.readReceiptInfo||{readCount:void 0,unreadCount:void 0,isPeerRead:void 0},this.needReadReceipt=e.needReadReceipt===!0||e.needReadReceipt===1,this.version=e.messageVersion||0,this.isBroadcastMessage=e.isBroadcastMessage||!1,this._receiverList=e.receiverList||void 0,this.isSupportExtension=e.isSupportExtension===!0||e.isSupportExtension===1,this._cmConfigID=e.customModerationConfigurationID,this.revoker=e.revokerInfo&&e.revokerInfo.revoker||"",this.revokerInfo=e.revokerInfo||{userID:"",nick:"",avatar:""},this.revokeReason=e.revokeReason||"",this.reInitialize(e.currentUser),this.extractGroupInfo(e.groupProfile||null),this.handleGroupAtInfo(e),this.initC2CReadReceiptInfo(e.readReceiptSentByPeer)}function nA(e,n){var o,a,l,h,m,M,L;f(this,nA),this.type=C.MSG_MERGER,this.content={downloadKey:"",pbDownloadKey:"",messageList:[],title:"",abstractList:[],compatibleText:"",version:0,layersOverLimit:!1},e.downloadKey?(a=e.downloadKey,l=e.pbDownloadKey,h=e.title,m=e.abstractList,M=e.compatibleText,o=e.version,this.content.downloadKey=a,this.content.pbDownloadKey=l,this.content.title=h,this.content.abstractList=m,this.content.compatibleText=M,this.content.version=o||0):Je(e.messageList)?e.layersOverLimit===1&&(this.content.layersOverLimit=!0):(a=e.messageList,l=e.title,h=e.abstractList,m=e.compatibleText,M=e.version,L=[],a.forEach(function(F){Je(F)||(F=new Si(F,n),L.push(F))}),this.content.messageList=L,this.content.title=l,this.content.abstractList=h,this.content.compatibleText=m,this.content.version=M||0)}function iA(e,n){var o,a;f(this,iA),this.from=e.from,this.messageSender=e.from,this.time=e.time,this.messageSequence=e.sequence,this.clientSequence=e.clientSequence||e.sequence,this.messageRandom=e.random,this.cloudCustomData=e.cloudCustomData||"",this.clientTime=e.clientTime||void 0,e.ID?(this.ID=e.ID||"",this.nick=e.nick||"",this.avatar=e.avatar||"",e.messageBody?this.messageBody=JSON.parse(JSON.stringify(e.messageBody)):this.messageBody=[{type:e.type,payload:e.payload}],e.conversationType?e.conversationType.startsWith(C.CONV_C2C)?this.receiverUserID=e.to:e.conversationType.startsWith(C.CONV_GROUP)&&(this.receiverGroupID=e.to):e.receiverGroupID?this.receiverGroupID=e.receiverGroupID:e.receiverUserID&&(this.receiverUserID=e.receiverUserID),this.messageReceiver=e.to||e.messageReceiver):(this.nick=e.nick||"",this.avatar=e.avatar||"",this.messageBody=[],o=e.elements[0].type,a=e.elements[0].content,this._patchRichMediaPayload(o,a),this._updateRichMediaDownloadUrl(o,a,n),o===C.MSG_MERGER?this.messageBody.push({type:o,payload:new Rr(a).content}):this.messageBody.push({type:o,payload:a}),e.groupID&&(this.receiverGroupID=e.groupID,this.messageReceiver=e.groupID),e.to&&(this.receiverUserID=e.to,this.messageReceiver=e.to),this.ID="".concat(e.tinyID,"-").concat(e.clientTime,"-").concat(e.random))}function oA(a){f(this,oA),this.type=C.MSG_LOCATION;var n=a.description,o=a.longitude,a=a.latitude;this.content={description:n,longitude:o,latitude:a}}function rA(e,n){f(this,rA),this.type=C.MSG_VIDEO,this._percent=0,this.content={remoteVideoUrl:e.remoteVideoUrl||e.videoUrl||"",videoFormat:e.videoFormat,videoSecond:parseInt(e.videoSecond,10),videoSize:e.videoSize,videoUrl:ki(e.videoUrl,n),videoDownloadFlag:2,videoUUID:e.videoUUID,thumbUUID:e.thumbUUID,thumbFormat:e.thumbFormat,thumbWidth:e.thumbWidth,snapshotWidth:e.thumbWidth,thumbHeight:e.thumbHeight,snapshotHeight:e.thumbHeight,thumbSize:e.thumbSize,snapshotSize:e.thumbSize,thumbDownloadFlag:2,thumbUrl:ki(e.thumbUrl,n),snapshotUrl:ki(e.thumbUrl,n)}}function su(e){f(this,su),this.type=C.MSG_CUSTOM,this.content={data:e.data||"",description:e.description||"",extension:e.extension||""}}function Ha(e,n){f(this,Ha),this.type=C.MSG_FILE,this._percent=0;var o=this._getFileInfo(e);this.content={downloadFlag:2,fileUrl:ki(e.url||e.fileUrl,n)||"",uuid:e.uuid,fileName:o.name||"",fileSize:o.size||0}}function aA(e){f(this,aA),this.type=C.MSG_GRP_SYS_NOTICE,this.content={},this._initContent(e)}function Ac(e){f(this,Ac),this.type=C.MSG_GRP_TIP,this.content={},this._initContent(e)}function sA(e,n){f(this,sA),this.type=C.MSG_AUDIO,this._percent=0,this.content={downloadFlag:2,second:e.second,size:e.size,url:ki(e.url,n),remoteAudioUrl:e.url||"",uuid:e.uuid}}function cu(e){f(this,cu),this.type=C.MSG_FACE,this.content=e||null}function cA(e,n){f(this,cA),this._imageMemoryURL="",this._fileDownloadProxy=n,Fe?this.createImageDataASURLInWXMiniApp(e.file):this.createImageDataASURLInWeb(e.file),this._initImageInfoModel(),this.type=C.MSG_IMAGE,this._percent=0,this.content={imageFormat:e.imageFormat||Rt.UNKNOWN,uuid:e.uuid,imageInfoArray:[]},this.initImageInfoArray(e.imageInfoArray),this._autoFixUrl()}function hc(e){f(this,hc),this.type=C.MSG_TEXT,this.content={text:e.text||""}}function or(e){f(this,or),this._n="SSOLogData",this.eventType=Uo[e]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message="",this.moreMessage="",this.extension=e,this.costTime=0,this.duplicate=!1,this.level=4,this.uiPlatform=void 0,this._sentFlag=!1,this._startts=dt()}function lA(e){f(this,lA),this._m=e,this._n=""}function Wa(l){f(this,Wa),n=Wd.call(this);var n,o=l.code,a=l.message,l=l.data;return n.code=o,a?n.message=a:n._getErrorMessage&&(n.message=n._getErrorMessage(n.code)),n.data=l||{},n}function uA(e){this.mixin(e)}uA.mixin=function(e){e=e.prototype||e,e._isReady=!1,e.ready=function(n){if(n)return this._isReady?void(1<arguments.length&&arguments[1]!==void 0&&arguments[1]?n.call(this):setTimeout(n,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(n))},e.triggerReady=function(){var n=this;this._isReady=!0,setTimeout(function(){var o=n._readyQueue;n._readyQueue=[],o&&0<o.length&&o.forEach(function(a){a.call(this)},n)},1)},e.resetReady=function(){this._isReady=!1,this._readyQueue=[]},e.isReady=function(){return this._isReady}};function lu(e,n,o){return xe(e)?{lastTime:0,lastSequence:0,fromAccount:"",messageForShow:"",payload:null,type:"",isRevoked:!1,cloudCustomData:"",onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:!1,revoker:null}:o&&e.ID||e instanceof Yn?{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",messageForShow:ec(e.type,e.payload,n),payload:e.payload||null,type:e.type||null,isRevoked:e.isRevoked||!1,cloudCustomData:e.cloudCustomData||"",onlineOnlyFlag:e._onlineOnlyFlag||!1,nick:e.nick||"",nameCard:e.nameCard||"",version:e.version||0,isPeerRead:e.isPeerRead||!1,revoker:e.revoker||null}:u(u({},e),{},{messageForShow:ec(e.type,e.payload,n)})}function uu(e,n){return Je(e)?{lastTime:0,lastSequence:0,fromAccount:"",payload:null,type:"",messageForShow:"",nick:"",avatar:"",version:0,cloudCustomData:"",isRevoked:!1,revoker:null}:{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",payload:e.payload||null,type:e.type||"",messageForShow:ec(e.type,e.payload,n),nick:e.nick||"",avatar:e.avatar||"",version:e.version||0,cloudCustomData:e.cloudCustomData||"",isRevoked:e.isRevoked||!1,revoker:e.revoker||null}}function du(e){var n=String(e).replace(/[=]+$/,""),o="";if(n.length%4==1)return"";for(var a,l,h=0,m=0;l=n.charAt(m++);~l&&(a=h%4?64*a+l:l,h++%4)&&(o+=String.fromCharCode(255&a>>(-2*h&6))))l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(l);try{return decodeURIComponent(escape(o))}catch{return""}}var cg,pc,Au,lg,ug,Y_=["jpg","jpeg","gif","png","bmp","image","webp"],K_=["mp4","quicktime","mov"],Ya=(y(DA,[{key:"validate",value:function(e){var n,o=!0,a="";if(Je(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var l=e.profileCustomField.length,h=null,m=0;m<l;m++){if(h=e.profileCustomField[m],!wt(h.key)||h.key.indexOf("Tag_Profile_Custom")===-1)return{valid:!1,tips:"The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom"};if(!wt(h.value))return{valid:!1,tips:"The type of values of the custom profile key-value pairs (which is profileCustomField) must be String"}}for(n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(n==="profileCustomField")continue;if(Je(e[n])&&!wt(e[n])&&!qt(e[n])){a="key:"+n+", invalid value:"+e[n],o=!1;continue}switch(n){case"nick":wt(e[n])||(o=!(a="nick must be a string")),500<Tr(e[n])&&(a="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(Tr(e[n])," bytes"),o=!1);break;case"gender":er(An,e.gender)||(a="key:gender, invalid value:"+e.gender,o=!1);break;case"birthday":qt(e.birthday)||(o=!(a="birthday must be a number"));break;case"location":wt(e.location)||(o=!(a="location must be a string"));break;case"selfSignature":wt(e.selfSignature)||(o=!(a="selfSignature must be a string"));break;case"allowType":er(Ft,e.allowType)||(a="key:allowType, invalid value:"+e.allowType,o=!1);break;case"language":qt(e.language)||(o=!(a="language must be a number"));break;case"avatar":wt(e.avatar)||(o=!(a="avatar must be a string"));break;case"messageSettings":e.messageSettings!==0&&e.messageSettings!==1&&(o=!(a="messageSettings must be 0 or 1"));break;case"adminForbidType":er(Dt,e.adminForbidType)||(a="key:adminForbidType, invalid value:"+e.adminForbidType,o=!1);break;case"level":qt(e.level)||(o=!(a="level must be a number"));break;case"role":qt(e.role)||(o=!(a="role must be a number"));break;default:a="unknown key:"+n+" "+e[n],o=!1}}return{valid:o,tips:a}}}]),DA),hu=y(function e(n){f(this,e),this.value=n,this.next=null}),dA=(y(Ka,[{key:"set",value:function(e){var n,o=new hu(e);this.map.size<this.MAX_LENGTH?this.pTail===null?(this.pTail=o,this.pNodeToDel=o):(this.pTail.next=o,this.pTail=o):(n=this.pNodeToDel,this.pNodeToDel=this.pNodeToDel.next,this.map.delete(n.value),n.next=null,n=null,this.pTail.next=o,this.pTail=o),this.map.set(e,1)}},{key:"has",value:function(e){return this.map.has(e)}},{key:"delete",value:function(e){this.has(e)&&this.map.delete(e)}},{key:"tail",value:function(){return this.pTail}},{key:"size",value:function(){return this.map.size}},{key:"data",value:function(){return Array.from(this.map.keys())}},{key:"reset",value:function(){for(var e;this.pNodeToDel!==null;)e=this.pNodeToDel,this.pNodeToDel=this.pNodeToDel.next,e.next=null,e=null;this.pTail=null,this.map.clear()}}]),Ka),Q_=["groupID","name","avatar","type","introduction","notification","ownerID","selfInfo","createTime","infoSequence","lastInfoTime","lastMessage","nextMessageSeq","memberNum","maxMemberNum","memberList","joinOption","groupCustomField","muteAllMembers","isSupportTopic","inviteOption","_lastRevokedTime"],rr=(y(SA,[{key:"memberNum",get:function(){return this.memberCount},set:function(e){}},{key:"maxMemberNum",get:function(){return this.maxMemberCount},set:function(e){}},{key:"_initGroup",value:function(e){for(var n in e)Q_.indexOf(n)<0||(n!=="selfInfo"?(n==="memberNum"&&(this.memberCount=e[n]),n==="maxMemberNum"&&(this.maxMemberCount=e[n]),n!=="isSupportTopic"?this[n]=e[n]:this.isSupportTopic=e[n]===1):this.updateSelfInfo(e[n]))}},{key:"updateGroup",value:function(o){var n=this,o=(o.appid=void 0,o.grossTopicNextMsgSeq=void 0,o.selfInfo&&(o.selfInfo.grossTopicReadSeq=void 0),JSON.parse(JSON.stringify(o)));o.lastMsgTime&&(this.lastMessage.lastTime=o.lastMsgTime),xe(o.muteAllMembers)||(o.muteAllMembers==="On"?o.muteAllMembers=!0:o.muteAllMembers=!1),o.groupCustomField&&xa(this.groupCustomField,o.groupCustomField),xe(o.memberNum)||(this.memberCount=o.memberNum),xe(o.maxMemberNum)||(this.maxMemberCount=o.maxMemberNum),xe(o.isSupportTopic)||(this.isSupportTopic=qt(o.isSupportTopic)?o.isSupportTopic===1:o.isSupportTopic),Ji(this,o,["members","errorCode","lastMsgTime","groupCustomField","memberNum","maxMemberNum","isSupportTopic"]),At(o.members)&&0<o.members.length&&o.members.forEach(function(a){a.userID===n.selfInfo.userID&&Ji(n.selfInfo,a,["sequence"])})}},{key:"updateSelfInfo",value:function(e){e={nameCard:e.nameCard,joinTime:e.joinTime,role:e.role,messageRemindType:e.messageRemindType,readedSequence:e.readedSequence,excludedUnreadSequenceList:e.excludedUnreadSequenceList},Ji(this.selfInfo,u({},e),[],["",null,void 0,0,NaN])}},{key:"setSelfNameCard",value:function(e){this.selfInfo.nameCard=e}}]),SA),pu=(y(yc,[{key:"toAccount",get:function(){return this.conversationID.startsWith(C.CONV_C2C)?this.conversationID.replace(C.CONV_C2C,""):this.conversationID.startsWith(C.CONV_GROUP)?this.conversationID.replace(C.CONV_GROUP,""):""}},{key:"_initProfile",value:function(e){var n=this;Object.keys(e).forEach(function(o){switch(o){case"userProfile":n.userProfile=e.userProfile;break;case"groupProfile":n.groupProfile=e.groupProfile}}),xe(this.userProfile)&&this.type===C.CONV_C2C?this.userProfile=new Ya({userID:e.conversationID.replace("C2C","")}):xe(this.groupProfile)&&this.type===C.CONV_GROUP&&(this.groupProfile=new rr({groupID:e.conversationID.replace("GROUP","")}))}},{key:"updateUnreadCount",value:function(a){var n=a.nextUnreadCount,o=a.isFromGetConversations,a=a.isUnreadC2CMessage;xe(n)||(pi(this.subType)?this.unreadCount=0:o&&this.type===C.CONV_GROUP||o&&this.type===C.CONV_TOPIC||a&&this.type===C.CONV_C2C?this.unreadCount=n:this.unreadCount=this.unreadCount+n)}},{key:"updateLastMessage",value:function(e){this.lastMessage=lu(e)}},{key:"updateGroupAtInfoList",value:function(e){var n;this._isNeedMergeGroupAtInfo(e)||((n=(ee(n=e.groupAtType)||H(n)||X(n)||G()).slice(0)).indexOf(C.CONV_AT_ME)!==-1&&n.indexOf(C.CONV_AT_ALL)!==-1&&(n=[C.CONV_AT_ALL_AT_ME]),n={from:e.from,groupID:e.groupID,topicID:e.topicID,messageSequence:e.sequence,atTypeArray:n,__random:e.__random,__sequence:e.__sequence},this.groupAtInfoList.push(n))}},{key:"_isNeedMergeGroupAtInfo",value:function(e){var n=e.groupID,o=e.sequence;if(!Ii({groupID:n}))return!1;var a=!1;return this.groupAtInfoList.forEach(function(l){l.messageSequence===o&&(-1<l.atTypeArray.indexOf(C.CONV_AT_ME)&&-1<e.groupAtType.indexOf(C.CONV_AT_ALL)&&(l.atTypeArray=[C.CONV_AT_ALL_AT_ME]),-1<l.atTypeArray.indexOf(C.CONV_AT_ALL)&&-1<e.groupAtType.indexOf(C.CONV_AT_ME)&&(l.atTypeArray=[C.CONV_AT_ALL_AT_ME],l.__random=e.__random,l.__sequence=e.__sequence),a=!0)}),a}},{key:"clearGroupAtInfoList",value:function(){this.groupAtInfoList.length=0}},{key:"reduceUnreadCount",value:function(){return 1<=this.unreadCount&&(--this.unreadCount,!0)}},{key:"isLastMessageRevoked",value:function(o){var n=o.sequence,o=o.time;return this.type===C.CONV_C2C&&n===this.lastMessage.lastSequence&&o===this.lastMessage.lastTime||this.type===C.CONV_GROUP&&n===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}},{key:"setDraftText",value:function(e){this.draftText=e}}]),yc),dg=(S(Wt={},C.MSG_REMIND_ACPT_AND_NOTE,0),S(Wt,C.MSG_REMIND_DISCARD,1),S(Wt,C.MSG_REMIND_ACPT_NOT_NOTE,2),Wt),X_=(y(gu,[{key:"onAllReceiveMessageOptNotify",value:function(e){e=this._handleResult(e),this._convM.emitOuterEvent(R.ALL_RECEIVE_MESSAGE_OPT_UPDATED,e)}},{key:"getC2CMessageRemindType",value:function(e){var n=this,o="".concat(this._n,".getC2CMessageRemindType");return this._convM.req({proto:le.GET_C2C_PEER_MUTE_NOTIFICATIONS,data:{toAccount:this._convM.getMyUserID(),userIDList:e}}).then(function(a){w.l("".concat(o," ok. userIDList:").concat(e)),a=a.data.muteFlagList,n._convM.onC2CMessageRemindTypeFetched(a)}).catch(function(a){w.e("".concat(o," failed. error:"),a)})}},{key:"set",value:function(e){return e.groupID?this._setGroupMessageRemindType(e):At(e.userIDList)?this._setC2CMessageRemindType(e):void 0}},{key:"_setGroupMessageRemindType",value:function(e){var n=this,o="".concat(this._n,"._setGroupMessageRemindType"),a=e.groupID,l=e.messageRemindType,h="groupID:".concat(a," messageRemindType:").concat(l),m=new Be("setMessageRemindType"),M=(m.setMessage(h),this._get(7));return M?M.modifyGroupMemberInfo({groupID:a,messageRemindType:l,userID:this._convM.getMyUserID()}).then(function(){m.end(),w.l("".concat(o," ok. ").concat(h));var L=n.onGroupMessageRemindTypeUpdated(e);return n._convM.emitTotalUnreadMessageCountUpdate(),ft(L)}).catch(function(L){return m.setError(L).end(),w.e("".concat(o," failed. error:"),L),Ce(L)}):Ce({code:we.CANNOT_FIND_MODULE})}},{key:"onGroupMessageRemindTypeUpdated",value:function(l){var n,o,a=l.groupID,l=l.messageRemindType,h=(w.l("".concat(this._n,".onGroupMessageRemindTypeUpdated groupID:").concat(a," messageRemindType:").concat(l)),this._get(7).getLocalGroupProfile(a));return h&&(h.selfInfo.messageRemindType=l),Bn(a)?(n=Wn(o=a),(o=this._get(10).getLocalTopic(n,o))&&(o.updateSelfInfo({messageRemindType:l}),this._convM.emitOuterEvent(R.TOPIC_UPDATED,{groupID:n,topic:o})),{topic:o}):(this._convM.patchMessageRemindType({ID:a,isC2CConversation:!1,messageRemindType:l})&&this._emitConversationUpdate(),{group:h})}},{key:"_setC2CMessageRemindType",value:function(m){var n=this,o="".concat(this._n,"._setC2CMessageRemindType"),a=m.userIDList,l=m.messageRemindType,h=a.slice(0,30),m=dg[l]||0,M="userIDList:".concat(h," messageRemindType:").concat(l),L=new Be("setMessageRemindType");return L.setMessage(M),this._convM.req({proto:le.SET_C2C_PEER_MUTE_NOTIFICATIONS,data:{userIDList:h,muteFlag:m}}).then(function(fe){L.end();var fe=fe.data.errorList,$=[],ue=[],fe=(At(fe)&&fe.forEach(function(be){$.push(be.userID),ue.push({userID:be.userID,code:be.errorCode})}),h.filter(function(be){return $.indexOf(be)===-1})),he=(w.l("".concat(o," ok. ").concat(M," successUserIDList:").concat(fe," failureUserIDList:").concat(JSON.stringify(ue))),0);return fe.forEach(function(be){n._convM.patchMessageRemindType({ID:be,isC2CConversation:!0,messageRemindType:l})&&(he+=1)}),1<=he&&n._emitConversationUpdate(),h.length=$.length=0,n._convM.emitTotalUnreadMessageCountUpdate(),St({successUserIDList:fe.map(function(be){return{userID:be}}),failureUserIDList:ue})}).catch(function(F){return L.setError(F).end(),w.e("".concat(o," failed. error:"),F),Ce(F)})}},{key:"_get",value:function(e){return this._convM.get(e)}},{key:"_emitConversationUpdate",value:function(){this._convM.emitConversationUpdate(!0,!1)}},{key:"setAllReceiveMessageOpt",value:function(m){var n="".concat(this._n,".").concat("setAllReceiveMessageOpt"),o=m.messageRemindType,o=o===void 0?C.MSG_REMIND_ACPT_NOT_NOTE:o,a=m.isRepeated,a=a===void 0||a,h=this._calcStartAndEndTime(m),l=h.startTime,l=l===void 0?0:l,h=h.endTime,h=h===void 0?0:h,m=JSON.stringify(m),M=new Be("setAllReceiveMessageOpt");return M.setMessage(m),w.l("".concat(n," options:").concat(m)),this._convM.req({proto:le.SET_ALL_RECEIVE_MSG_OPT,data:{messageRemindType:dg[o],startTime:l,endTime:h,isRepeated:a?1:0}}).then(function(L){return M.end(),w.l("".concat(n," ok.")),ft(L)}).catch(function(L){return M.setError(L).end(),w.e("".concat(n," failed. error:"),L),Ce(L)})}},{key:"_calcStartAndEndTime",value:function(h){var n=h.startHour,n=n===void 0?0:n,o=h.startMinute,o=o===void 0?0:o,a=h.startSecond,a=a===void 0?0:a,l=h.duration,l=l===void 0?0:l,h=h.isRepeated,h=h===void 0||h,M=new Date,L=M.getFullYear(),m=M.getMonth(),M=M.getDate(),L=Math.round(new Date(L,m,M,n,o,a).getTime()/1e3);return{startTime:L,endTime:h&&86400<=l?L+86400:L+l}}},{key:"getAllReceiveMessageOpt",value:function(){var e=this,n="".concat(this._n,".").concat("getAllReceiveMessageOpt"),o=new Be("getAllReceiveMessageOpt");return this._convM.req({proto:le.GET_ALL_RECEIVE_MSG_OPT,data:{toAccount:this._convM.getMyUserID()}}).then(function(a){return a=a.data,o.setMessage(JSON.stringify(a)).end(),w.l("".concat(n," ok. data:").concat(JSON.stringify(a))),a=e._handleResult(a),ft(a)}).catch(function(a){return o.setError(a).end(),w.e("".concat(n," failed. error:"),a),Ce(a)})}},{key:"_handleResult",value:function(l){var n=l.messageRemindType,o=l.startTime,a=l.endTime,l=l.isRepeated,h=C.MSG_REMIND_ACPT_AND_NOTE;return n===1&&(h=C.MSG_REMIND_DISCARD),{messageRemindType:h=n===2?C.MSG_REMIND_ACPT_NOT_NOTE:h,startTime:o,endTime:a,isRepeated:l===1}}},{key:"reset",value:function(){w.l("".concat(this._n,".reset"))}}]),gu),J_=(y(MA,[{key:"setConvCustomData",value:function(e){var n=this,o="".concat(this._n,".").concat("setConvCustomData"),a=e.conversationIDList,l=e.customData,h=(w.l("".concat(o," options:"),e),new Be("setConvCustomData")),m=(h.setMessage(JSON.stringify(e)),{fromAccount:this._getMyUserID(),itemList:[]}),M=[],L=[];return a.forEach(function(F){if(!n._hasLocalConversation(F))return n._onConversationNotFound(L,F),!0;if(!yi(F)&&!mi(F))return n._onConversationIDInvalid(L,F),!0;var $={operationType:2,contactItem:void 0,customMark:l};yi(F)?$.contactItem={type:1,toAccount:F.replace(C.CONV_C2C,"")}:mi(F)&&($.contactItem={type:2,groupID:F.replace(C.CONV_GROUP,"")}),m.itemList.push($)}),L.length===a.length?St({successConversationIDList:M,failureConversationIDList:L}):this._convM.req({proto:le.SET_CONV_CUSTOM_DATA,data:m}).then(function(he){h.end(),w.l("".concat(o," ok"));var $,ue,fe,he=he.data.resultItem;return At(he)&&(fe=!1,he.forEach(function(be){$=n._concatConversationID(be.contactItem),be.resultCode===0?(M.push($),(ue=n._getLocalConversation($))&&ue.customData!==l&&(ue.customData=l,fe=!0)):L.push({conversationID:$,code:be.resultCode,message:be.resultInfo})}),fe===!0&&n._emitConversationUpdate()),ft({successConversationIDList:M,failureConversationIDList:L})}).catch(function(F){return h.setError(F).end(),w.e("".concat(o," failed. error:"),F),Ce(F)})}},{key:"markConversation",value:function(F){var n=this;if(!this._convM.canIUse(pe.CONV_MARK))return this._convM.cannotUseCommercialAbility("markConversation");var o="".concat(this._n,".").concat("markConversation"),a=F.conversationIDList,l=F.markType,h=F.enableMark,m=(w.l("".concat(o," options:"),F),new Be("markConversation")),M=(m.setMessage(JSON.stringify(F)),void 0),L=void 0,F=this._getFlagBit(l),$=(h===!0?L=[F]:M=[F],{fromAccount:this._getMyUserID(),itemList:[]}),ue=[],fe=[];return a.forEach(function(he){if(!n._hasLocalConversation(he))return n._onConversationNotFound(fe,he),!0;if(!yi(he)&&!mi(he))return n._onConversationIDInvalid(fe,he),!0;var be={operationType:1,contactItem:void 0,clearMark:M,setMark:L};yi(he)?be.contactItem={type:1,toAccount:he.replace(C.CONV_C2C,"")}:mi(he)&&(be.contactItem={type:2,groupID:he.replace(C.CONV_GROUP,"")}),$.itemList.push(be)}),fe.length===a.length?St({successConversationIDList:ue,failureConversationIDList:fe}):this._convM.req({proto:le.MARK_CONV,data:$}).then(function(Tt){m.end(),w.l("".concat(o," ok"));var be,ze,Ye,Tt=Tt.data.resultItem;return At(Tt)&&(Ye=!1,Tt.forEach(function(Ct){var Bt;be=n._concatConversationID(Ct.contactItem),Ct.resultCode===0?(ue.push(be),(ze=n._getLocalConversation(be))&&(Bt=ze.markList.indexOf(l),h===!0?Bt===-1&&(ze.markList.push(l),Ye=!0):Bt!==-1&&(ze.markList.splice(Bt,1),Ye=!0))):fe.push({conversationID:be,code:Ct.resultCode,message:Ct.resultInfo})}),Ye===!0&&n._emitConversationUpdate()),ft({successConversationIDList:ue,failureConversationIDList:fe})}).catch(function(he){return m.setError(he).end(),w.e("".concat(o," failed. error:"),he),Ce(he)})}},{key:"getLocalConvGroupList",value:function(){var e=this;return w.l("".concat(this._n,".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===ja?this.getRemoteConvGroupList().then(function(){return ft(V(e._convGroupMap.values()))}):St(V(this._convGroupMap.values()))}},{key:"getRemoteConvGroupList",value:function(){var e=this,n="".concat(this._n,".getRemoteConvGroupList");return this._pagingStatus=ig,this._convM.req({proto:le.GET_CONV_GRP_LIST,data:{fromAccount:this._getMyUserID(),startIndex:this._startIndex,startTime:Se()}}).then(function(M){var a,M=M.data,l=M.completeFlag,h=M.contactItem,m=M.nextStartIndex,m=m===void 0?0:m,M=M.groupItem;if(e._startIndex=m,w.l("".concat(n," completeFlag:").concat(l," nextStartIndex:").concat(m)),At(M)&&M.forEach(function($){var F=$.convGroupID,$=$.groupName;e._convGroupMap.set(F,$)}),At(h)&&h.forEach(function(L){var F,$=L.standardMark,ue=L.customData,fe=L.convGroupIDList;a=e._concatConversationID(L),(a=e._getLocalConversation(a))&&(a.markList=eu($),a.customData=ue||"",At(fe))&&(F=[],fe.forEach(function(he){e._convGroupMap.has(he)&&F.push(e._convGroupMap.get(he))}),a.conversationGroupList=[].concat(F),F.length=0)}),l===0)return e.getRemoteConvGroupList();l===1&&(e._pagingStatus=oc,e._emitConversationUpdate(),e._emitConvGroupListUpdate())}).catch(function(o){e._pagingStatus=ja,w.w("".concat(n," failed. error:"),o)})}},{key:"createConvGroup",value:function(e){var n=this,h="createConversationGroup";if(!this._convM.canIUse(pe.CONV_GROUP))return this._convM.cannotUseCommercialAbility(h);var o="".concat(this._n,".").concat(h),a=(w.l("".concat(o," options:"),e),new Be(h)),l=(a.setMessage(JSON.stringify(e)),e.groupName),h=e.conversationIDList,m={fromAccount:this._getMyUserID(),itemList:[{groupName:l,contactItem:[]}]},M=[],L=[];return h.forEach(function(F){return n._hasLocalConversation(F)?yi(F)||mi(F)?void(yi(F)?m.itemList[0].contactItem.push({type:1,toAccount:F.replace(C.CONV_C2C,"")}):mi(F)&&m.itemList[0].contactItem.push({type:2,groupID:F.replace(C.CONV_GROUP,"")})):(n._onConversationIDInvalid(L,F),!0):(n._onConversationNotFound(L,F),!0)}),L.length===h.length?St({successConversationIDList:M,failureConversationIDList:L}):this._convM.req({proto:le.CREATE_CONV_GRP,data:m}).then(function(be){a.end(),w.l("".concat(o," ok"));var $,ue,fe,be=be.data.groupResultItem[0],he=be.groupItem,be=be.resultItem;return Qt(he)&&(n._convGroupMap.set(he.convGroupID,he.groupName),n._emitConvGroupListUpdate()),At(be)&&(fe=!1,be.forEach(function(ze){$=n._concatConversationID(ze.contactItem),ze.resultCode===0?(M.push($),(ue=n._getLocalConversation($))&&ue.conversationGroupList.indexOf(l)===-1&&(ue.conversationGroupList.push(l),fe=!0)):L.push({conversationID:$,code:ze.resultCode,message:ze.resultInfo})}),fe===!0&&(n._emitConversationUpdate(),n._emitConvGroupListUpdate())),ft({successConversationIDList:M,failureConversationIDList:L})}).catch(function(F){return a.setError(F).end(),w.e("".concat(o," failed. error:"),F),Ce(F)})}},{key:"deleteConvGroup",value:function(e){var n=this,o="deleteConversationGroup";if(!this._convM.canIUse(pe.CONV_GROUP))return this._convM.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),l=(w.l("".concat(a," groupName:").concat(e)),new Be(o));return l.setMessage(e),this._convM.req({proto:le.DEL_CONV_GRP,data:{fromAccount:this._getMyUserID(),groupName:[e]}}).then(function(M){l.end(),w.l("".concat(a," ok"));var m,M=M.data.groupItem;At(M)&&(m=!1,M.forEach(function(L){n._convGroupMap.has(L.convGroupID)&&(n._convGroupMap.delete(L.convGroupID),m=!0)}),m===!0&&n._emitConvGroupListUpdate()),n._eraseFromConversationGroupList([e])}).catch(function(h){return l.setError(h).end(),w.e("".concat(a," failed. error:"),h),Ce(h)})}},{key:"renameConvGroup",value:function(e){var n=this,o="renameConversationGroup";if(!this._convM.canIUse(pe.CONV_GROUP))return this._convM.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),l=(w.l("".concat(a," options:"),e),new Be(o)),h=(l.setMessage(JSON.stringify(e)),e.oldName),m=e.newName;return this._convM.req({proto:le.RENAME_CONV_GRP,data:{fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:1,oldName:h,newName:m}}}).then(function($){l.end(),w.l("".concat(a," ok")),$=$.data.updateGroupResult.convGroupID,n._convGroupMap.set($,m),n._emitConvGroupListUpdate();var L,F,$=n._convM.getLocalConversationList(),ue=!1;$.forEach(function(fe){L=fe.conversationGroupList,(F=L.indexOf(h))!==-1&&(L.splice(F,1,m),ue=!0)}),ue===!0&&n._emitConversationUpdate()}).catch(function(M){return l.setError(M).end(),w.e("".concat(a," failed. error:"),M),Ce(M)})}},{key:"addConvsToGroup",value:function(e){var n=this,l="addConversationsToGroup";if(!this._convM.canIUse(pe.CONV_GROUP))return this._convM.cannotUseCommercialAbility(l);var o="".concat(this._n,".").concat(l),a=(w.l("".concat(o," options:"),e),new Be(l)),l=(a.setMessage(JSON.stringify(e)),e.conversationIDList),h=e.groupName,m={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:h,updateItem:[]}},M=[],L=[];return l.forEach(function(F){return n._hasLocalConversation(F)?yi(F)||mi(F)?void(yi(F)?m.updateGroup.updateItem.push({operationType:1,contactItem:{type:1,toAccount:F.replace(C.CONV_C2C,"")}}):mi(F)&&m.updateGroup.updateItem.push({operationType:1,contactItem:{type:2,groupID:F.replace(C.CONV_GROUP,"")}})):(n._onConversationIDInvalid(L,F),!0):(n._onConversationNotFound(L,F),!0)}),L.length===l.length?St({successConversationIDList:M,failureConversationIDList:L}):this._convM.req({proto:le.ADD_CONV_TO_GRP,data:m}).then(function(he){a.end(),w.l("".concat(o," ok"));var $,ue,fe,he=he.data.updateGroupResult.contactResultItem;return At(he)&&(fe=!1,he.forEach(function(be){$=n._concatConversationID(be.contactItem),be.resultCode===0?(ue=n._getLocalConversation($))&&ue.conversationGroupList.indexOf(h)===-1&&(ue.conversationGroupList.push(h),M.push($),fe=!0):L.push({conversationID:$,code:be.resultCode,message:be.resultInfo})}),fe===!0&&(n._emitConversationUpdate(),n._emitConvInGroupUpdate(h))),ft({successConversationIDList:M,failureConversationIDList:L})}).catch(function(F){return a.setError(F).end(),w.e("".concat(o," failed. error:"),F),Ce(F)})}},{key:"deleteConvsFromGroup",value:function(e){var n=this,l="deleteConversationsFromGroup";if(!this._convM.canIUse(pe.CONV_GROUP))return this._convM.cannotUseCommercialAbility(l);var o="".concat(this._n,".").concat(l),a=(w.l("".concat(o," options:"),e),new Be(l)),l=(a.setMessage(JSON.stringify(e)),e.conversationIDList),h=e.groupName,m={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:h,updateItem:[]}},M=[],L=[];return l.forEach(function(F){return n._hasLocalConversation(F)?yi(F)||mi(F)?void(yi(F)?m.updateGroup.updateItem.push({operationType:2,contactItem:{type:1,toAccount:F.replace(C.CONV_C2C,"")}}):mi(F)&&m.updateGroup.updateItem.push({operationType:2,contactItem:{type:2,groupID:F.replace(C.CONV_GROUP,"")}})):(n._onConversationIDInvalid(L,F),!0):(n._onConversationNotFound(L,F),!0)}),L.length===l.length?St({successConversationIDList:M,failureConversationIDList:L}):this._convM.req({proto:le.DEL_CONV_FROM_GRP,data:m}).then(function(he){a.end(),w.l("".concat(o," ok"));var $,ue,fe,he=he.data.updateGroupResult.contactResultItem;return At(he)&&(fe=!1,he.forEach(function(be){var ze;$=n._concatConversationID(be.contactItem),be.resultCode===0?!(ue=n._getLocalConversation($))||(ze=ue.conversationGroupList.indexOf(h))!==-1&&(ue.conversationGroupList.splice(ze,1),M.push($),fe=!0):L.push({conversationID:$,code:be.resultCode,message:be.resultInfo})}),fe===!0&&(n._emitConversationUpdate(),n._emitConvInGroupUpdate(h))),ft({successConversationIDList:M,failureConversationIDList:L})}).catch(function(F){return a.setError(F).end(),w.e("".concat(o," failed. error:"),F),Ce(F)})}},{key:"onConvMarkUpdated",value:function(e){var n,o,a=this;Je(e)||(w.d("".concat(this._n,".onConvMarkUpdated markItemList:"),e),o=!1,e.forEach(function(L){var h=L.recentContactItem,m=L.optType,M=L.standardMark,L=L.customMark;n=a._concatConversationID(h),(n=a._getLocalConversation(n))&&(m===1?o=a._diffStandardMark(n,M):m===2?o=a._diffCustomMark(n,L):m===3&&(o=a._diffStandardMark(n,M)||a._diffCustomMark(n,L)))}),o===!0&&this._emitConversationUpdate())}},{key:"_diffStandardMark",value:function(e,o){var o=eu(o),a=!1;return function(l,h){if(l===h)return!0;if(!l||!h||l.length!==h.length)return!1;for(var m=0,M=l.length;m<M;m++)if(l[m]!==h[m])return!1;return!0}(e.markList,o)!==!0&&(e.markList=o,a=!0),a}},{key:"_diffCustomMark",value:function(e,n){var o=!1;return e.customData!==n&&n!==void 0&&(e.customData=n,o=!0),o}},{key:"onConvGroupCreated",value:function(e){var n=this,o=(w.d("".concat(this._n,".onConvGroupCreated resultList:"),e),!1),a=!1;At(e)&&(e.forEach(function(l){var L=l.msgGroupItem,h=L.groupID,m=L.groupName;n._convGroupMap.get(h)!==m&&(n._convGroupMap.set(h,m),a=!0);var M,L=l.msgRecentContactItem;At(L)&&L.forEach(function(F){M=n._concatConversationID(F),(M=n._getLocalConversation(M))&&M.conversationGroupList.indexOf(m)===-1&&(M.conversationGroupList.push(m),o=!0)})}),o===!0&&this._emitConversationUpdate(),a===!0&&this._emitConvGroupListUpdate())}},{key:"onConvGroupDeleted",value:function(e){var n,o=this,a=(w.d("".concat(this._n,".onConvGroupDeleted groupItemList:"),e),[]);At(e)&&(n=!1,e.forEach(function(m){var h=m.groupID,m=m.groupName;o._convGroupMap.has(h)&&(o._convGroupMap.delete(h),n=!0,a.push(m))}),n===!0&&this._emitConvGroupListUpdate()),this._eraseFromConversationGroupList(a)}},{key:"_eraseFromConversationGroupList",value:function(e){Je(e)||(this._convM.getLocalConversationList().forEach(function(n){n.conversationGroupList=n.conversationGroupList.filter(function(o){return!e.includes(o)})}),this._emitConversationUpdate())}},{key:"onConvGroupNameUpdated",value:function(e){w.d("".concat(this._n,".onConvGroupNameUpdated options:"),e);var n,o,a,l=e.groupID,h=e.groupName,m=e.oldGroupName;this._convGroupMap.get(l)!==h&&(this._convGroupMap.set(l,h),this._emitConvGroupListUpdate(),e=this._convM.getLocalConversationList(),a=!1,e.forEach(function(M){n=M.conversationGroupList,(o=n.indexOf(m))!==-1&&(n.splice(o,1,h),a=!0)}),a===!0&&this._emitConversationUpdate())}},{key:"onConvInGroupUpdated",value:function(m){var n,o,a,l=this,h=(w.d("".concat(this._n,".onConvInGroupUpdated options:"),m),m.oldGroupName),m=m.recentContactUpdateGroupItem;At(m)&&(a=!1,m.forEach(function(F){var L=F.contactOptType,F=F.recentContactItem;n=l._concatConversationID(F),(n=l._getLocalConversation(n))&&(o=n.conversationGroupList.indexOf(h),L===1?o===-1&&(n.conversationGroupList.push(h),a=!0):L===2&&o!==-1&&(n.conversationGroupList.splice(o,1),a=!0))}),a===!0&&(this._emitConversationUpdate(),this._emitConvInGroupUpdate(h)))}},{key:"onConvAddedToOrDeletedFromGroup",value:function(l){var n,o,a=this,h=(w.d("".concat(this._n,".onConvAddedToOrDeletedFromGroup options:"),l),l.msgRecentContactItem),l=l.msgRecentContactUpdateContactItem,h=this._concatConversationID(h),m=this._getLocalConversation(h);m&&At(l)&&(o=!1,l.forEach(function(F){var L=F.groupOptType,F=F.recentContactGroupItem.groupName;n=m.conversationGroupList.indexOf(F),L===1?n===-1&&(m.conversationGroupList.push(F),o=!0):L===2&&n!==-1&&(m.conversationGroupList.splice(n,1),o=!0),o===!0&&a._emitConvInGroupUpdate(F)}),o===!0&&this._emitConversationUpdate())}},{key:"onConvGroupListSynced",value:function(e){var n=this;At(e)&&e.length!==0&&(w.l("".concat(this._n,".onConvGroupListSynced groupItemList:"),e),e.forEach(function(o){n._convGroupMap.set(o.convGroupID,o.groupName)}))}},{key:"getConvGroupListByID",value:function(e){var n,o=this;if(!Je(e))return n=[],e.forEach(function(a){o._convGroupMap.has(a)&&n.push(o._convGroupMap.get(a))}),n}},{key:"_onConversationNotFound",value:function(e,n){e.push({conversationID:n,code:we.CONV_NOT_FOUND,message:this._convM.getErrorMessage(we.CONV_NOT_FOUND)})}},{key:"_onConversationIDInvalid",value:function(e,n){e.push({conversationID:n,code:we.INVALID_CONV_ID,message:this._convM.getErrorMessage(we.INVALID_CONV_ID)})}},{key:"_getFlagBit",value:function(e){for(var n=e.toString(2),o=n.length,a=o-1;0<=a;a--)if(n[a]==="1")return o-a-1}},{key:"_concatConversationID",value:function(h){var n,o=h.type,a=h.to,l=h.groupID,h=h.userID;return o===1?xe(h)?xe(a)||(n="".concat(C.CONV_C2C).concat(a)):n="".concat(C.CONV_C2C).concat(h):o===2&&(n="".concat(C.CONV_GROUP).concat(l)),n}},{key:"_getMyUserID",value:function(){return this._convM.getMyUserID()}},{key:"_insertConversationGroup",value:function(o,n){var o=this._getLocalConversation(o);!o||(o=o.conversationGroupList).indexOf(n)===-1&&o.push(n)}},{key:"_getLocalConversation",value:function(e){return this._convM.getLocalConversation(e)}},{key:"_hasLocalConversation",value:function(e){return this._convM.hasLocalConversation(e)}},{key:"_emitConversationUpdate",value:function(){this._convM.emitConversationUpdate(!0,!1)}},{key:"_emitConvGroupListUpdate",value:function(){this._convM.emitOuterEvent(R.CONVERSATION_GROUP_LIST_UPDATED,V(this._convGroupMap.values()))}},{key:"_emitConvInGroupUpdate",value:function(e){var n={groupName:e,conversationList:[]},o=this._convM.getLocalConversationList();n.conversationList=o.filter(function(a){return a.conversationGroupList.includes(e)}),this._convM.emitOuterEvent(R.CONVERSATION_IN_GROUP_UPDATED,n)}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._convGroupMap.clear(),this._startIndex=0,this._pagingStatus=wo}}]),MA),Z_=(E(Ic,Pn),ug=B(Ic),y(Ic,[{key:"_initListeners",value:function(){var e=this.getInnerEmitterInstance();e.on(Rn.A2KEY_AND_TINYID_UPDATED,this._init,this),e.on(Rn.PROFILE_UPDATED,this._onProfileUpdated,this)}},{key:"onCheckTimer",value:function(e){e%60==0&&this._messageListHandler.traversal()}},{key:"_init",value:function(){var e=this,n=(w.l("".concat(this._n,"._init")),this.get(13).getItem("conversationMap")),o=this.isIntl(),a=this.isUsingChatCore();if(n){for(var l=n.length,h=0;h<l;h++){var m=n[h];if(m){if(this._isNonExistentAccount(m.conversationID))continue;if(m.groupProfile){var M=m.groupProfile.type;if(pi(M))continue}}this._conversationMap.set(m.conversationID,new pu(n[h],o,a))}this.emitConversationUpdate(!0,!1)}this.ready(function(){0<e._tmpGroupList.length&&(e.updateConversationGroupProfile(e._tmpGroupList),e._tmpGroupList.length=0)}),this.syncConversationList()}},{key:"_isNonExistentAccount",value:function(e){var n;return(n=e.startsWith(C.CONV_C2C)?e.replace(C.CONV_C2C,""):n)==="@TLS#ERROR"||n==="@TLS#NOT_FOUND"}},{key:"onMessageSent",value:function(e){this._onSendOrReceiveMessage({conversationOptionsList:e.conversationOptionsList,isInstantMessage:!0})}},{key:"onNewMessage",value:function(e){this._onSendOrReceiveMessage(e)}},{key:"_onSendOrReceiveMessage",value:function(e){var n=this,o=e.conversationOptionsList,a=e.isInstantMessage,a=a===void 0||a,l=e.isUnreadC2CMessage,l=l!==void 0&&l,h=e.updateUnreadCount,h=h===void 0||h,m=e.isSyncingEnded,m=m!==void 0&&m;this._isReady?o.length!==0?(a===!0&&this._checkNewConversation(o),this._updateLocalConversationList({conversationOptionsList:o,isInstantMessage:a,isUnreadC2CMessage:l,isFromGetConversations:!1,updateUnreadCount:h}),a||(this._convIDFromUnreadDBMap=new Map([].concat(V(this._convIDFromUnreadDBMap),V(o.map(function(M){return[M.conversationID,1]})))),this._diffAndDeleteConversation(),m&&this.emitInnerEvent(Rn.C2C_UNREAD_HANDLE_COMPLETED)),0<o.filter(function(M){return!n._isConvNeedShow(M.conversationID)}).length||this.emitConversationUpdate()):m&&this.emitInnerEvent(Rn.C2C_UNREAD_HANDLE_COMPLETED):this.ready(function(){n._onSendOrReceiveMessage(e)})}},{key:"updateConversationGroupProfile",value:function(e){var n,o=this;At(e)&&e.length===0||(this._conversationMap.size!==0?(n=!1,e.forEach(function(a){var l="GROUP".concat(a.groupID);o._conversationMap.has(l)&&(n=!0,(l=o._conversationMap.get(l)).groupProfile=JSON.parse(JSON.stringify(a)),l.lastMessage.lastSequence<a.nextMessageSeq&&(l.lastMessage.lastSequence=a.nextMessageSeq-1),l.subType||(l.subType=a.type))}),n&&this.emitConversationUpdate(!0,!1)):this._tmpGroupList=e)}},{key:"_updateConversationUserProfile",value:function(e){var n=this;e.data.forEach(function(o){var a="C2C".concat(o.userID);n._conversationMap.has(a)&&(n._conversationMap.get(a).userProfile=o)}),this.emitConversationUpdate(!0,!1)}},{key:"onMessageRevoked",value:function(e){var n,o,a,l=this;e.length!==0&&(n=null,o=!1,a=[],e.forEach(function(h){(n=l._conversationMap.get(h.conversationID))&&(n.reduceUnreadCount()&&(o=n.type!==C.CONV_TOPIC),n.type===C.CONV_TOPIC?a.push(h):n.isLastMessageRevoked({sequence:h.sequence,time:h.time})&&(n.setLastMessageRevoked(!0),n.setLastMessageRevoker(h.revoker),o=!0))}),this.get(10).onMessageRevoked(a),o&&this.emitConversationUpdate(!0,!1))}},{key:"updateRevokerInfo",value:function(e){for(var n=new Set,o=0;o<e.length;o++){var a=e[o].revoker;n.add(a)}var l=V(n),h=this.get(4);return new Promise(function(m){h.getUserProfile({userIDList:l}).then(function(M){if(M=M.data,!At(M)||M.length===0)return m(e);var L,F={},$=J(M);try{for($.s();!(L=$.n()).done;){var ue=L.value,fe=ue.userID,he=ue.nick,be=ue.avatar;F[fe]={nick:he,avatar:be}}}catch(ze){$.e(ze)}finally{$.f()}e.forEach(function(ze){var Ye=ze.revoker;F[Ye]&&(ze.revokerInfo.nick=F[Ye].nick||"",ze.revokerInfo.avatar=F[Ye].avatar||"")}),m(e)}).catch(function(){m(e)})})}},{key:"isLastMessageRevoked",value:function(e){var n=!1,o=e.conversationID,a=e.sequence,l=e.time,h=this._conversationMap.get(o);return h&&(n=h.type===C.CONV_TOPIC?this.get(10).isLastMessageRevoked({topicID:o.replace(C.CONV_GROUP,""),sequence:a}):h.isLastMessageRevoked({sequence:a,time:l})),w.l("".concat(this._n,".isLastMessageRevoked options:").concat(JSON.stringify(e)," ret:").concat(n)),n}},{key:"onMessageDeleted",value:function(e){var n=this;if(e.length!==0){var o=null;e.forEach(function(L){(o=n._messageListHandler.getLocalMessage(L.conversationID,L.ID))&&(o.isDeleted=!0),L!==o&&(L.isDeleted=!0)});for(var e=e[0].conversationID,a=this._messageListHandler.getLocalMessageList(e),l={},h=a.length-1;0<=h;h--)if(!a[h].isDeleted){l=a[h];break}var m,M=this._conversationMap.get(e);M&&(m=!1,M.lastMessage.lastSequence===l.sequence&&M.lastMessage.lastTime===l.time||(Je(l)&&(l=void 0),M.updateLastMessage(l),M.type!==C.CONV_TOPIC&&(m=!0),w.l("".concat(this._n,".onMessageDeleted. update conversationID:").concat(e," with lastMessage:"),M.lastMessage)),e.startsWith(C.CONV_C2C)&&this.updateUnreadCount(e),m&&this.emitConversationUpdate(!0,!1))}}},{key:"onMessageModified",value:function(e){var n="".concat(this._n,".onMessageModified"),$=e.conversationType,o=e.from,a=e.to,l=e.time,h=e.sequence,m=e.elements,M=e.cloudCustomData,L=e.messageVersion,ue=this.getMyUserID(),F="".concat($).concat(a),ue=(a===ue&&$===C.CONV_C2C&&(F="".concat($).concat(o)),this._messageListHandler.onMessageModified(F,e)),$=ue.isUpdated,ue=ue.message,fe=($===!0&&this.emitOuterEvent(R.MESSAGE_MODIFIED,[ue]),this._isTopicConversation(F));return ue===null?w.l("".concat(n," message is null! options:").concat(JSON.stringify(e),"}")):w.l("".concat(n," isUpdated:").concat($," isTopicMessage:").concat(fe," from:").concat(o," to:").concat(a," sequence:").concat(ue.sequence," time:").concat(ue.time)),fe?this.get(10).onMessageModified(e):!($=this._conversationMap.get(F))||(o=$.lastMessage)&&o.lastTime===l&&o.lastSequence===h&&o.version!==L&&(w.l("".concat(n," conversationID:").concat(F," lastMessage updated")),o.type=m[0].type,o.payload=m[0].content,o.messageForShow=ec(o.type,o.payload,this.isIntl()),o.cloudCustomData=M,o.version=L,this.emitConversationUpdate(!0,!1)),ue}},{key:"onNewGroupAtTips",value:function(o){var n=this,o=o.dataList,a=null;o.forEach(function(l){l.groupAtTips?a=l.groupAtTips:l.elements?a=u(u({},l.elements),{},{sync:!0}):l.groupAtType&&(a=u(u({},l),{},{sync:!0})),a.__random=l.random,a.__sequence=l.clientSequence,n._tmpGroupAtTipsList.push(a)}),w.d("".concat(this._n,".onNewGroupAtTips isReady:").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{key:"_handleGroupAtTipsList",value:function(){var e,n=this;this._tmpGroupAtTipsList.length!==0&&(e=!1,this._tmpGroupAtTipsList.forEach(function(o){var a,l=o.groupID,h=o.from,m=o.topicID,m=m===void 0?void 0:m,M=o.sync,M=M!==void 0&&M;h!==n.getMyUserID()&&(xe(m)?(h=n._conversationMap.get("".concat(C.CONV_GROUP).concat(l)))&&(h.updateGroupAtInfoList(o),e=!0):((l=n._conversationMap.get("".concat(C.CONV_GROUP).concat(m)))&&(l.updateGroupAtInfoList(o),h=n.get(10),a=l.groupAtInfoList,h.onConversationProxy({topicID:m,groupAtInfoList:a})),Je(l)&&M&&(n.updateTopicConversation([{conversationID:"".concat(C.CONV_GROUP).concat(m),type:C.CONV_TOPIC}]),n._conversationMap.get("".concat(C.CONV_GROUP).concat(m)).updateGroupAtInfoList(o))))}),e&&this.emitConversationUpdate(!0,!1),this._tmpGroupAtTipsList.length=0)}},{key:"_checkNewConversation",value:function(e){var n=this,o=[],a=[];e.forEach(function(l){n._conversationMap.has(l.conversationID)||(l.type===C.CONV_C2C?o.push(l.conversationID.replace(C.CONV_C2C,"")):l.type===C.CONV_GROUP&&a.push(l.conversationID.replace(C.CONV_GROUP,"")))}),0<o.length&&(this._onNewC2CConversation(o),o=null),0<a.length&&(this._onNewGroupConversation(a),a=null)}},{key:"_onNewC2CConversation",value:function(e){this.get(6).getRemotePeerReadTime(e),this._messageRemindHandler.getC2CMessageRemindType(e)}},{key:"_onNewGroupConversation",value:function(e){var n=this.get(7);n&&n.getMessageRemindType(e)}},{key:"_setStorageConversationList",value:function(){var e=0<arguments.length&&arguments[0]!==void 0&&arguments[0],n=this.getLocalConversationList().filter(function(o){return o.type===C.CONV_C2C||o.type===C.CONV_GROUP&&o.lastMessage.type!==C.MSG_GRP_TIP}).slice(0,20).map(function(o){return{conversationID:o.conversationID,type:o.type,subType:o.subType,lastMessage:o.lastMessage,groupProfile:o.groupProfile,userProfile:o.userProfile}});this.get(13).setItem("conversationMap",n,e)}},{key:"emitConversationUpdate",value:function(){var e=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],n=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1],o=this.getLocalConversationList();!n||(n=this.get(7))&&n.updateGroupLastMessage(o),e&&(this.emitOuterEvent(R.CONVERSATION_LIST_UPDATED),this.emitTotalUnreadMessageCountUpdate())}},{key:"getLocalConversationList",value:function(){var e=this;return V(this._conversationMap.values()).filter(function(n){return e._isConvNeedShow(n.conversationID)})}},{key:"getLocalConversation",value:function(e){return this._conversationMap.get(e)}},{key:"hasLocalConversation",value:function(e){return this._conversationMap.has(e)}},{key:"getLocalOldestMessage",value:function(e){return this._messageListHandler.getLocalOldestMessage(e)}},{key:"syncConversationList",value:function(){var e=this,n=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],o="syncConversationList",a=new Be(o);return this._pagingStatus===wo&&this._conversationMap.clear(),this._pagingGetConversationList(n).then(function(l){var h=tc(e._pagingGetCostList),m=Jp(e._pagingGetCostList),m=(e._pagingGetCostList.length=0,e._pagingStatus=oc,e._diffAndDeleteConversation(),e.emitConversationUpdate(!0,!1),e._setStorageConversationList(),e._handleC2CPeerReadTime(),e.emitInnerEvent(Rn.CONV_SYNC_COMPLETED),"count:".concat(e._conversationMap.size," sum:").concat(m," avg:").concat(h));return w.l("".concat(e._n,".").concat(o,". ").concat(m)),a.setMessage(m).end(),l}).catch(function(l){return e._pagingStatus=ja,a.setMessage(e._pagingTimeStamp).setError(l).end(),Ce(l)})}},{key:"_diffAndDeleteConversation",value:function(){var e,n=this;this._isSyncCompleted()&&(e=[],this._conversationMap.forEach(function(o,a){!n._pagingConvIDMap.has(a)&&n._convIDFromUnreadDBMap.has(a)&&(n._conversationMap.delete(a),e.push(a))}),w.l("".concat(this._n,"._diffAndDeleteConversation list:").concat(e)),e=null)}},{key:"_pagingGetConversationList",value:function(){var e=this,n=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],o="".concat(this._n,"._pagingGetConversationList"),a=(w.l("".concat(o," incrementalPullFlag:").concat(n," timeStamp:").concat(this._pagingTimeStamp," startIndex:").concat(this._pagingStartIndex)+" pinnedTimeStamp:".concat(this._pagingPinnedTimeStamp," pinnedStartIndex:").concat(this._pagingPinnedStartIndex)),Date.now());return this._pagingStatus=ig,this.req({proto:le.PAGING_GET_CONV_LIST,data:{fromAccount:this.getMyUserID(),timeStamp:n?this._pagingTimeStamp:0,startIndex:n?this._pagingStartIndex:0,pinnedTimeStamp:n?this._pagingPinnedTimeStamp:0,pinnedStartIndex:n?this._pagingPinnedStartIndex:0,orderType:1}}).then(function(ue){var ue=ue.data,h=ue.completeFlag,m=ue.conversations,m=m===void 0?[]:m,M=ue.timeStamp,L=ue.startIndex,F=ue.pinnedTimeStamp,$=ue.pinnedStartIndex,ue=ue.groupItem;if(e._pagingGetCostList.push(Zn(a,!1)),w.l("".concat(o," ok. completeFlag:").concat(h," count:").concat(m.length," cost:").concat(Zn(a))),e._convGroupHandler.onConvGroupListSynced(ue),0<m.length&&(ue=e._getConversationOptions(m),e._pagingConvIDMap=new Map([].concat(V(e._pagingConvIDMap),V(ue.map(function(fe){return[fe.conversationID,1]})))),e._updateLocalConversationList({conversationOptionsList:ue,isFromGetConversations:!0,updateUnreadCount:!0}),e.isLoggedIn()&&e.emitConversationUpdate()),!e._isReady){if(!e.isLoggedIn())return St();e.triggerReady()}return e._pagingTimeStamp=M,e._pagingStartIndex=L,e._pagingPinnedTimeStamp=F,e._pagingPinnedStartIndex=$,h!==1?e._pagingGetConversationList():(e._handleGroupAtTipsList(),e._convGroupHandler.getRemoteConvGroupList(),St())}).catch(function(l){throw e.isLoggedIn()&&(e._isReady||(w.w("".concat(o," failed. error:"),l),e.triggerReady())),l})}},{key:"_updateLocalConversationList",value:function(a){var n=a.isFromGetConversations,o=Date.now(),a=this._getTmpConversationListMapping(a);this._conversationMap=new Map(this._sortConversationList([].concat(V(a.toBeUpdatedConversationList),V(this._conversationMap)))),n||this._updateUserOrGroupProfile(a.newConversationList),w.l("".concat(this._n,"._updateLocalConversationList cost:").concat(Zn(o)))}},{key:"_getTmpConversationListMapping",value:function(e){for(var n=e.conversationOptionsList,o=e.isFromGetConversations,a=e.isInstantMessage,l=e.isUnreadC2CMessage,h=l!==void 0&&l,m=e.updateUnreadCount,M=[],L=[],F=this.get(7),$=this.get(8),ue=this.isIntl(),fe=this.isUsingChatCore(),he=0,be=n.length;he<be;he++){var ze,Ye,Tt,Ct,Bt=new pu(n[he],ue,fe),In=Bt.conversationID;this._isNonExistentAccount(In)||(this._conversationMap.has(In)?(ze=this._conversationMap.get(In),!(Ye=["unreadCount","allowType","adminForbidType","payload"])===a&&Ye.push("lastMessage"),typeof a=="boolean"&&Ye.push("isPinned"),Ct=n[he].lastMessage,(Tt=!xe(Ct))||n[he].type===C.CONV_TOPIC||this._onLastMessageNotExist(n[he]),xe(a)&&Tt&&ze.lastMessage.payload===null&&(ze.lastMessage.payload=Ct.payload),Je(ze.lastMessage.revoker)||(ze.lastMessage.revoker=null),Ji(ze,Bt,Ye,[null,void 0,"",0,NaN]),m===!0&&ze.updateUnreadCount({nextUnreadCount:Bt.unreadCount,isFromGetConversations:o,isUnreadC2CMessage:h}),a&&Tt&&(Ct.payload&&(ze.lastMessage.payload=Ct.payload),ze.type===C.CONV_GROUP&&(ze.lastMessage.nameCard=Ct.nameCard,ze.lastMessage.nick=Ct.nick)),Tt&&ze.lastMessage.cloudCustomData!==Ct.cloudCustomData&&(ze.lastMessage.cloudCustomData=Ct.cloudCustomData||""),this._conversationMap.delete(In),M.push([In,ze])):(Bt.type===C.CONV_GROUP&&F?(Ye=Bt.groupProfile.groupID,(Tt=F.getLocalGroupProfile(Ye))&&(Bt.groupProfile=Tt,m===!0&&Bt.updateUnreadCount({nextUnreadCount:0}))):Bt.type===C.CONV_C2C&&(Ct=In.replace(C.CONV_C2C,""),$&&$.isMyFriend(Ct)&&(Bt.remark=$.getFriendRemark(Ct))),L.push(Bt),M.push([In,Bt])))}for(var ii,oi,ri,ss=this.get(10),ua=M.length,cr=0;cr<ua;cr++)M[cr][1].type===C.CONV_TOPIC&&(ii=(ri=M[cr][1]).conversationID,oi=ri.unreadCount,ri=ri.groupAtInfoList,ss.onConversationProxy({topicID:ii.replace(C.CONV_GROUP,""),unreadCount:oi,groupAtInfoList:Je(ri)?void 0:ri}));return{toBeUpdatedConversationList:M,newConversationList:L}}},{key:"_onLastMessageNotExist",value:function(e){new Be("lastMessageNotExist").setMessage(JSON.stringify(e)).end()}},{key:"_sortConversationList",value:function(e){var n=[],o=[],a=[],l=[];return e.forEach(function(h){(h[1].isPinned===!0?Je(h[1].lastMessage.lastTime)?o:n:Je(h[1].lastMessage.lastTime)?l:a).push(h)}),n.sort(function(h,m){return m[1].lastMessage.lastTime-h[1].lastMessage.lastTime}).concat(o).concat(a.sort(function(h,m){return m[1].lastMessage.lastTime-h[1].lastMessage.lastTime})).concat(l)}},{key:"_sortConversationListAndEmitEvent",value:function(){this._conversationMap=new Map(this._sortConversationList(V(this._conversationMap))),this.emitConversationUpdate(!0,!1)}},{key:"_updateUserOrGroupProfile",value:function(e){var n,o,a,l,h=this;e.length!==0&&(n=[],o=[],a=this.get(4),l=this.get(7),e.forEach(function(m){var M;m.type===C.CONV_C2C?n.push(m.toAccount):m.type===C.CONV_GROUP&&(M=m.toAccount,l.hasLocalGroup(M)?m.groupProfile=l.getLocalGroupProfile(M):o.push(M))}),w.l("".concat(this._n,"._updateUserOrGroupProfile c2cUserIDList:").concat(n," groupIDList:").concat(o)),0<n.length&&a.getUserProfile({userIDList:n}).then(function(m){m=m.data,At(m)?m.forEach(function(M){h._doUpdateUserProfile("C2C".concat(M.userID),M)}):h._doUpdateUserProfile("C2C".concat(m.userID),m)}),0<o.length&&l.getGroupProfileAdvance({groupIDList:o,responseFilter:{groupBaseInfoFilter:["Type","Name","FaceUrl"]}}).then(function(m){m.data.successGroupList.forEach(function(M){var L="GROUP".concat(M.groupID);h._conversationMap.has(L)&&(L=h._conversationMap.get(L),Ji(L.groupProfile,M,[],[null,void 0,"",0,NaN]),!L.subType&&M.type&&(L.subType=M.type))})}))}},{key:"_doUpdateUserProfile",value:function(e,n){this.hasLocalConversation(e)&&(this.getLocalConversation(e).userProfile=n)}},{key:"_getConversationOptions",value:function(l){var n=this,o=[],l=l.filter(function(M){var m=M.type,M=M.userID;return m===1&&!n._isNonExistentAccount(M)||m===2}),a=this.getMyUserID(),l=l.map(function(h){var m;return xe(h.lastMsg)&&(h.lastMsg={elements:[]}),h.type===1?(m={userID:h.userID,nick:h.peerNick,avatar:h.peerAvatar},o.push(m),{conversationID:"C2C".concat(h.userID),type:"C2C",lastMessage:{lastTime:h.time,lastSequence:h.sequence,fromAccount:h.lastC2CMsgFromAccount,type:h.lastMsg.elements[0]?h.lastMsg.elements[0].type:null,payload:h.lastMsg.elements[0]?n._amendLayersOverLimitProperty(h.lastMsg.elements[0].content):null,cloudCustomData:h.lastMsg.cloudCustomData||"",isRevoked:h.lastMessageFlag===8,onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:h.lastC2CMsgFromAccount===a&&h.time<=h.c2cPeerReadTime,revoker:h.lastMsg.revokerInfo?h.lastMsg.revokerInfo.revoker:null},userProfile:new Ya(m),peerReadTime:h.c2cPeerReadTime,isPinned:h.isPinned===1,customData:h.customMark||"",markList:eu(h.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(h.contactGroupId),remark:h.friendRemark||"",messageRemindType:n._transMessageRemindType(h.messageRemindType)}):{conversationID:"GROUP".concat(h.groupID),type:"GROUP",lastMessage:u(u({lastTime:h.time,lastSequence:h.sequence,fromAccount:h.msgGroupFromAccount},n._patchTypeAndPayload(h)),{},{cloudCustomData:h.lastMsg.cloudCustomData||"",isRevoked:h.lastMessageFlag===2,onlineOnlyFlag:!1,nick:h.senderNick||"",nameCard:h.senderNameCard||"",revoker:h.lastMsg.revokerInfo?h.lastMsg.revokerInfo.revoker:null}),groupProfile:new rr({groupID:h.groupID,name:h.groupNick,avatar:h.groupImage,type:h.groupType,nextMessageSeq:h.nextMessageSeq}),unreadCount:n._computeGroupUnreadCount(h),peerReadTime:0,isPinned:h.isPinned===1,version:0,customData:h.customMark||"",markList:eu(h.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(h.contactGroupId),messageRemindType:n._transMessageRemindType(h.messageRemindType)}});return 0<o.length&&this.get(4).onConversationsProfileUpdated(o),l}},{key:"_transMessageRemindType",value:function(e){var n="";return e===0?n=C.MSG_REMIND_ACPT_AND_NOTE:e===1?n=C.MSG_REMIND_DISCARD:e===2&&(n=C.MSG_REMIND_ACPT_NOT_NOTE),n}},{key:"_computeGroupUnreadCount",value:function(n){var o=n.unreadCount,n=n.noUnreadCount,o=(o===void 0?0:o)-(n===void 0?0:n);return 0<o?o:0}},{key:"_patchTypeAndPayload",value:function(a){var a=a.lastMsg,n=a.event,o=a.elements,o=o===void 0?[]:o,a=a.groupTips,a=a===void 0?{}:a;return xe(n===void 0?void 0:n)||Je(a)?{type:o[0]?o[0].type:null,payload:o[0]?this._amendLayersOverLimitProperty(o[0].content):null}:((n=new Yn(a)).setElement({type:C.MSG_GRP_TIP,content:u(u({},a.elements),{},{groupProfile:a.groupProfile})}),o=JSON.parse(JSON.stringify(n.payload)),n=null,{type:C.MSG_GRP_TIP,payload:o})}},{key:"_amendLayersOverLimitProperty",value:function(e){var n=e.layersOverLimit;return n===0?e.layersOverLimit=!1:n===1&&(e.layersOverLimit=!0),e}},{key:"getLocalMessageList",value:function(e){return this._messageListHandler.getLocalMessageList(e)}},{key:"deleteLocalMessage",value:function(e){e instanceof Yn&&this._messageListHandler.remove(e)}},{key:"onConversationDeleted",value:function(e){At(e)&&(e=e.map(function(l){var o=l.type,a=l.userID,l=l.groupID;return o===1?"".concat(C.CONV_C2C).concat(a):o===2?"".concat(C.CONV_GROUP).concat(l):void 0}),w.l("".concat(this._n,".onConversationDeleted conversationIDList:").concat(e)),this.deleteLocalConversationList(e))}},{key:"onConversationPinned",value:function(e){var n,o=this;At(e)&&(n=!1,e.forEach(function(M){var l,h=M.type,m=M.userID,M=M.groupID;h===1?l=o.getLocalConversation("".concat(C.CONV_C2C).concat(m)):h===2&&(l=o.getLocalConversation("".concat(C.CONV_GROUP).concat(M))),l&&(w.l("".concat(o._n,".onConversationPinned conversationID:").concat(l.conversationID," isPinned:").concat(l.isPinned)),l.isPinned||(l.isPinned=!0,n=!0))}),n&&this._sortConversationListAndEmitEvent())}},{key:"onConversationUnpinned",value:function(e){var n,o=this;At(e)&&(n=!1,e.forEach(function(M){var l,h=M.type,m=M.userID,M=M.groupID;h===1?l=o.getLocalConversation("".concat(C.CONV_C2C).concat(m)):h===2&&(l=o.getLocalConversation("".concat(C.CONV_GROUP).concat(M))),l&&(w.l("".concat(o._n,".onConversationUnpinned conversationID:").concat(l.conversationID," isPinned:").concat(l.isPinned)),l.isPinned&&(l.isPinned=!1,n=!0))}),n&&this._sortConversationListAndEmitEvent())}},{key:"getMessageList",value:function(l){var n=this,o=l.conversationID,a=l.nextReqMessageID,l=l.count,h="".concat(this._n,".getMessageList"),L=this.getLocalConversation(o),m="";if(L&&L.groupProfile&&(m=L.groupProfile.type),pi(m))return w.l("".concat(h," not available in avchatroom. conversationID:").concat(o)),St({messageList:[],nextReqMessageID:"",isCompleted:!0});(xe(l)||15<l)&&(l=15),!a&&this._isNotInCommunity(o)&&(this._messageListHandler.removeByConversationID(o),this._completedMap.delete(o),this._roamingMessageSequenceMap.delete(o));var M=this._computeRemainingCount({conversationID:o,nextReqMessageID:a}),L=this._completedMap.has(o);return w.l("".concat(h," conversationID:").concat(o," nextReqMessageID:").concat(a)+" remainingCount:".concat(M," count:").concat(l," isCompleted:").concat(L)),this._needGetHistory({conversationID:o,remainingCount:M,count:l})?this.getHistoryMessages({conversationID:o,nextReqMessageID:a,count:20}).then(function(be){var he=be.nextReqID,be=be.storedMessageList,$=n._completedMap.has(o),ue=be,fe={nextReqMessageID:$?"":he,messageList:ue=0<M?n._messageListHandler.getLocalMessageList(o).slice(0,be.length+M):ue,isCompleted:$},he=fe.messageList.filter(function(ze){return ze.isRevoked})||[],be=ue.map(function(ze){return ze.sequence});return w.l("".concat(h," ret.nextReqMessageID:").concat(fe.nextReqMessageID," ret.isCompleted:").concat(fe.isCompleted," ret.length:").concat(ue.length," sequenceList:").concat(be)),At(he)&&he.length!==0?n.updateRevokerInfo(he).then(function(ze){return ze.forEach(function(Ye){var Tt=Ye.revokerInfo;fe.messageList=fe.messageList.map(function(Ct){return Ct.ID===Ye.ID&&Tt&&(Ct.revokeReason=Tt.reason||"",Ct.revokerInfo={userID:Tt.revoker||Ct.revoker,nick:Tt.nick,avatar:Tt.avatar}),Ct})}),ft(fe)}):ft(fe)}):(this.modifyMessageList(o),m=this._getMessageListFromMemory({conversationID:o,nextReqMessageID:a,count:l}),St(m))}},{key:"_getMessageListFromMemory",value:function(a){var n=a.conversationID,o=a.nextReqMessageID,a=a.count,l="".concat(this._n,"._getMessageListFromMemory"),h=this._messageListHandler.getLocalMessageList(n),m=h.length,M=0,L={isCompleted:!1,nextReqMessageID:"",messageList:[]};return o?(M=h.findIndex(function(F){return F.ID===o}))>a?(L.messageList=h.slice(M-a,M),L.nextReqMessageID=h[M-a].ID):(L.messageList=h.slice(0,M),L.isCompleted=!0):a<m?(L.messageList=h.slice(M=m-a,m),L.nextReqMessageID=h[M].ID):(L.messageList=h.slice(0,m),L.isCompleted=!0),w.l("".concat(l," conversationID:").concat(n)+" ret.nextReqMessageID:".concat(L.nextReqMessageID," ret.isCompleted:").concat(L.isCompleted," ret.length:").concat(L.messageList.length)),L}},{key:"getMessageListHopping",value:function(M){var n,o,a=M.conversationID,l=M.sequence,h=M.time,m=M.count,M=M.direction,M=M===void 0?0:M;return(xe(m)||15<m)&&(m=15),a.startsWith(C.CONV_C2C)?(n=this.get(6),o=a.replace(C.CONV_C2C,""),n.getRoamingMessagesHopping({peerAccount:o,time:h,count:m,direction:M})):a.startsWith(C.CONV_GROUP)?(n=this.get(7),o=a.replace(C.CONV_GROUP,""),n.getRoamingMessagesHopping({groupID:o,sequence:l,count:m,direction:M})):void 0}},{key:"_computeRemainingCount",value:function(a){var n=a.conversationID,o=a.nextReqMessageID,a=this._messageListHandler.getLocalMessageList(n),l=a.length;return o?(l=0,yi(n)?l=a.findIndex(function(h){return h.ID===o}):mi(n)&&(l=o.indexOf("-")!==-1?a.findIndex(function(h){return h.ID===o}):a.findIndex(function(h){return h.sequence===o})),l=l===-1?0:l):l}},{key:"_getMessageListSize",value:function(e){return this._messageListHandler.getLocalMessageList(e).length}},{key:"_needGetHistory",value:function(a){var n=a.conversationID,o=a.remainingCount,a=a.count,l=this.getLocalConversation(n),h="";if(l&&l.groupProfile&&(h=l.groupProfile.type),Jr(n)||pi(h))return!1;if(l=!1,h="".concat(this._n,"._needGetHistory conversationID:").concat(n),mi(n)){var m=this._isPagingGetGroupListCompleted(),M=this._getLocalGroupCount(),L=this._hasLocalGroup(n),F=this._isTopicConversation(n);if(w.l("".concat(h," isGroupListCompleted:").concat(m," localGroupCount:").concat(M)+" isGroupInList:".concat(L," isTopic:").concat(F)),m&&M<=500&&!L&&!F)return l}return l=o<=a&&!this._completedMap.has(n),w.l("".concat(h," ret:").concat(l)),l}},{key:"_isTopicConversation",value:function(e){return e=e.replace(C.CONV_GROUP,""),Bn(e)}},{key:"getHistoryMessages",value:function(a){var n=a.conversationID,a=a.count;if(n===C.CONV_SYSTEM)return St();var o=15,a=(20<a&&(o=20),null);if(yi(n))return l=this._roamingMessageKeyAndTimeMap.has(n),(a=this.get(6))?a.getRoamingMessage({conversationID:n,peerAccount:n.replace(C.CONV_C2C,""),count:o,lastMessageTime:l?this._roamingMessageKeyAndTimeMap.get(n).lastMessageTime:0,messageKey:l?this._roamingMessageKeyAndTimeMap.get(n).messageKey:""}):Ce({code:we.CANNOT_FIND_MODULE});if(mi(n)){if(!(a=this.get(7)))return Ce({code:we.CANNOT_FIND_MODULE});var l=n.replace(C.CONV_GROUP,""),m=null,h=0,m=((m=this._conversationMap.has(n)&&!Bn(l)?this._conversationMap.get(n).lastMessage:m)&&(h=m.lastSequence),this._roamingMessageSequenceMap.get(n));return a.getRoamingMessage({conversationID:n,groupID:l,count:o,sequence:m||h})}return St()}},{key:"patchConversationLastMessage",value:function(e){var n,o,a=this.getLocalConversation(e);a&&(n=(o=a.lastMessage).messageForShow,o=o.payload,!Je(n)&&!Je(o)||(n=this._messageListHandler.getLocalMessageList(e)).length!==0&&(o=n[n.length-1],w.l("".concat(this._n,".patchConversationLastMessage conversationID:").concat(e," payload:"),o.payload),a.updateLastMessage(o)))}},{key:"onRoamingMessage",value:function(){for(var e,n,o=0<arguments.length&&arguments[0]!==void 0?arguments[0]:[],a=1<arguments.length?arguments[1]:void 0,l=!(2<arguments.length&&arguments[2]!==void 0)||arguments[2],h=a.startsWith(C.CONV_C2C)?C.CONV_C2C:C.CONV_GROUP,m=null,M=[],L=[],he=0,be=o.length,F=h===C.CONV_GROUP,$=this.getFileDownloadProxy(),ue=function(){F?--he:++he},fe=function(){return F?be<=he:he<be},he=F?o.length-1:0,be=F?0:o.length;fe();ue())F&&o[he].sequence===1&&l&&this.setCompleted(a),o[he].isPlaceMessage!==1&&((m=new Yn(o[he])).to=o[he].to,h!==C.CONV_GROUP||xe(o[he].topicID)||(m.to=o[he].topicID),m.isSystemMessage=!!o[he].isSystemMessage,m.conversationType=h,e=o[he].event===4?{type:C.MSG_GRP_TIP,content:u(u({},o[he].elements),{},{groupProfile:o[he].groupProfile})}:o[he].elements,F||m.setNickAndAvatar({nick:o[he].nick,avatar:o[he].avatar}),Je(e)?((n=new Be("emptyMessageBody")).setMessage("from:".concat(m.from," to:").concat(m.to," sequence:").concat(m.sequence," event:").concat(o[he].event)),n.setLevel("warning").end()):(m.setElement(e,$),m.reInitialize(this.getMyUserID()),M.push(m)));return ue=fe=null,l?(this._messageListHandler.unshift(M,L),M=null,L):(L=null,M)}},{key:"findMessage",value:function(e){return this._messageListHandler.findMessage(e)}},{key:"_isNotInCommunity",value:function(e){var n=!1;return e.startsWith(C.CONV_GROUP)&&this._isTopicConversation(e)&&(e=Wn(e.replace(C.CONV_GROUP,"")),this.get(7).hasLocalGroup(e)||(n=!0)),n}},{key:"deleteTopicRoamingMessageInfo",value:function(e){var n=this;Ii({groupID:e})&&this._messageListHandler.getTopicConversationIDList(e).forEach(function(o){n._completedMap.delete(o),n._roamingMessageSequenceMap.delete(o)})}},{key:"deleteGroupRoamingMessageInfo",value:function(e){e="".concat(C.CONV_GROUP).concat(e),this._completedMap.delete(e),this._roamingMessageSequenceMap.delete(e)}},{key:"setMessageRead",value:function(a){var n=a.conversationID,o=this.getLocalConversation(n),a="".concat(this._n,".setMessageRead");if(w.l("".concat(a," conversationID:").concat(n," unreadCount:").concat(o?o.unreadCount:0)),!o||(o.type!==C.CONV_GROUP&&o.type!==C.CONV_TOPIC||Je(o.groupAtInfoList)||this.deleteGroupAtTips(n),o.unreadCount===0))return St();if(o.type===C.CONV_GROUP&&!this._hasLocalGroup(n))return o.unreadCount!==0&&(o.unreadCount=0,this.emitConversationUpdate(!0,!1)),St();var l=this._messageListHandler.getLocalLastMessage(n),h=o.lastMessage.lastTime,m=this._messageListHandler.getLocalMaxTime(n),m=(h<m&&(w.l("".concat(a," update lastMessageTime from ").concat(h," to ").concat(m)),h=m),this._messageListHandler.getLocalMaxSequence(n)),M=o.lastMessage.lastSequence,L=(M<m&&(w.l("".concat(a," update lastMessageSeq from ").concat(M," to ").concat(m)),M=m),o.type===C.CONV_TOPIC&&xe(l)&&(a=this.get(10),l=Wn(m=n.replace(C.CONV_GROUP,"")),(a=a.getLocalTopic(l,m))&&(M=a.nextMessageSeq-1)),null);switch(o.type){case C.CONV_C2C:return(L=this.get(6))?L.setMessageRead({conversationID:n,lastMessageTime:h}):Ce({code:we.CANNOT_FIND_MODULE});case C.CONV_GROUP:case C.CONV_TOPIC:return(L=this.get(7))?L.setMessageRead({conversationID:n,lastMessageSeq:M}):Ce({code:we.CANNOT_FIND_MODULE});case C.CONV_SYSTEM:return o.unreadCount=0,this.emitConversationUpdate(!0,!1),St();default:return St()}}},{key:"setAllMessageRead",value:function(){var e=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},o="setAllMessageRead",a="".concat(this._n,".").concat(o),l=(n.scope||(n.scope=C.READ_ALL_MSG),w.l("".concat(a," options:"),n),this._createSetAllMessageReadPack(n));if(l.readAllC2CMessage===0&&l.groupMessageReadInfoList.length===0)return St();var h=new Be(o);return this.req({proto:le.SET_ALL_MSG_READ,data:l}).then(function(m){return m=m.data,m=e._handleAllMessageRead(m),h.setMessage("scope:".concat(n.scope," failureGroups:").concat(JSON.stringify(m))).end(),St()}).catch(function(m){return h.setError(m).end(),w.w("".concat(a," failed. error:"),m),Ce({code:m&&m.code?m.code:we.MSG_UNREAD_ALL_FAIL,message:m&&m.message?m.message:void 0})})}},{key:"setConversationCustomData",value:function(e){return this._convGroupHandler.setConvCustomData(e)}},{key:"markConversation",value:function(e){return this._convGroupHandler.markConversation(e)}},{key:"getConversationGroupList",value:function(){return this._convGroupHandler.getLocalConvGroupList()}},{key:"createConversationGroup",value:function(e){return this._convGroupHandler.createConvGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._convGroupHandler.deleteConvGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._convGroupHandler.renameConvGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._convGroupHandler.addConvsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._convGroupHandler.deleteConvsFromGroup(e)}},{key:"onConversationMarkUpdated",value:function(e){this._convGroupHandler.onConvMarkUpdated(e)}},{key:"onConversationGroupCreated",value:function(e){this._convGroupHandler.onConvGroupCreated(e)}},{key:"onConversationGroupDeleted",value:function(e){this._convGroupHandler.onConvGroupDeleted(e)}},{key:"onConversationGroupNameUpdated",value:function(e){this._convGroupHandler.onConvGroupNameUpdated(e)}},{key:"onConversationInGroupUpdated",value:function(e){this._convGroupHandler.onConvInGroupUpdated(e)}},{key:"onConversationAddedToOrDeletedFromGroup",value:function(e){this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e)}},{key:"_getConversationLastMessageSequence",value:function(o){var n=this._messageListHandler.getLocalLastMessage(o.conversationID),o=o.lastMessage.lastSequence;return o=n&&o<n.sequence?n.sequence:o}},{key:"_getConversationLastMessageTime",value:function(o){var n=this._messageListHandler.getLocalLastMessage(o.conversationID),o=o.lastMessage.lastTime;return o=n&&o<n.time?n.time:o}},{key:"_createSetAllMessageReadPack",value:function(e){var n,o={readAllC2CMessage:0,groupMessageReadInfoList:[]},a=e.scope,l=J(this._conversationMap);try{for(l.s();!(n=l.n()).done;){var h,m=K(n.value,2)[1];if(0<m.unreadCount)if(m.type===C.CONV_C2C&&o.readAllC2CMessage===0){if(a===C.READ_ALL_MSG)o.readAllC2CMessage=1;else if(a===C.READ_ALL_C2C_MSG){o.readAllC2CMessage=1;break}}else m.type!==C.CONV_GROUP||a!==C.READ_ALL_GROUP_MSG&&a!==C.READ_ALL_MSG||(h=this._getConversationLastMessageSequence(m),o.groupMessageReadInfoList.push({groupID:m.groupProfile.groupID,messageSequence:h}))}}catch(M){l.e(M)}finally{l.f()}return o}},{key:"onPushedAllMessageRead",value:function(e){this._handleAllMessageRead(e)}},{key:"_handleAllMessageRead",value:function(n){var o=n.groupMessageReadInfoList,n=n.readAllC2CMessage,o=this._parseGroupReadInfo(o);return 1<=this._updateAllConversationUnreadCount({readAllC2CMessage:n})&&this.emitConversationUpdate(!0,!1),o}},{key:"_parseGroupReadInfo",value:function(e){var n=[];if(e&&e.length)for(var o=0,a=e.length;o<a;o++){var M=e[o],l=M.groupID,h=M.sequence,m=M.retCode,M=M.lastMessageSeq;xe(m)?this._remoteGroupReadSequenceMap.set(l,M):(this._remoteGroupReadSequenceMap.set(l,h),m!==0&&n.push("".concat(l,"-").concat(h,"-").concat(m)))}return n}},{key:"_updateAllConversationUnreadCount",value:function(e){var n,o=e.readAllC2CMessage,a=0,l=J(this._conversationMap);try{for(l.s();!(n=l.n()).done;){var h,m,M,L,F=K(n.value,2),$=F[0],ue=F[1];1<=ue.unreadCount&&(o===1&&ue.type===C.CONV_C2C?(h=this._getConversationLastMessageTime(ue),this.updateIsReadAfterReadReport({conversationID:$,lastMessageTime:h})):ue.type===C.CONV_GROUP&&(m=$.replace(C.CONV_GROUP,""),this._remoteGroupReadSequenceMap.has(m)&&(M=this._remoteGroupReadSequenceMap.get(m),L=this._getConversationLastMessageSequence(ue),this.updateIsReadAfterReadReport({conversationID:$,remoteReadSequence:M}),M<=L&&this._remoteGroupReadSequenceMap.delete(m))),this.updateUnreadCount($,!1)&&(a+=1))}}catch(fe){l.e(fe)}finally{l.f()}return a}},{key:"isRemoteRead",value:function(a){var n,o=a.conversationID,a=a.sequence,l=o.replace(C.CONV_GROUP,""),h=!1;return this._remoteGroupReadSequenceMap.has(l)&&(a<=(n=this._remoteGroupReadSequenceMap.get(l))&&(h=!0,w.l("".concat(this._n,".isRemoteRead conversationID:").concat(o," messageSequence:").concat(a," remoteReadSequence:").concat(n))),n+10<=a&&this._remoteGroupReadSequenceMap.delete(l)),h}},{key:"updateIsReadAfterReadReport",value:function(e){var n=e.conversationID,o=e.lastMessageSeq,a=e.lastMessageTime,l=this._messageListHandler.getLocalMessageList(n);if(l.length!==0){for(var h,m=l.length-1;0<=m;m--)if(h=l[m],!(a&&h.time>a||o&&h.sequence>o)){if(h.flow==="in"&&h.isRead)break;h.setIsRead(!0)}}}},{key:"updateUnreadCount",value:function(e){var n,o=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1],a=!1,l=this.getLocalConversation(e),h=this._messageListHandler.getLocalMessageList(e);if(l)return(n=l.unreadCount)!==(h=h.filter(function(m){return!m.isRead&&!m._onlineOnlyFlag&&!m.isDeleted}).length)&&(l.unreadCount=h,a=!0,w.l("".concat(this._n,".updateUnreadCount from ").concat(n," to ").concat(h,", conversationID:").concat(e)),o===!0&&this.emitConversationUpdate(!0,!1)),a&&l.type===C.CONV_TOPIC&&(n=l.unreadCount,h=this.get(10),o=e.replace(C.CONV_GROUP,""),h.onConversationProxy({topicID:o,unreadCount:n})),a}},{key:"clearGroupAtInfoList",value:function(e){var n,o=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1],a=this.getLocalConversation(e);a&&0<a.groupAtInfoList.length&&(a.clearGroupAtInfoList(),w.l("".concat(this._n,".clearGroupAtInfoList conversationID:").concat(e)),a.type===C.CONV_TOPIC&&(a=a.groupAtInfoList,n=this.get(10),e=e.replace(C.CONV_GROUP,""),n.onConversationProxy({topicID:e,groupAtInfoList:a})),o===!0&&this.emitConversationUpdate(!0,!1))}},{key:"updateReadReceiptInfo",value:function(e){var n,o,a,l=this,M=e.userID,h=M===void 0?void 0:M,M=e.groupID,m=M===void 0?void 0:M,M=e.readReceiptList;Je(M)||(n=[],xe(h)?xe(m)||(o="".concat(C.CONV_GROUP).concat(m),M.forEach(function($){var ue=$.tinyID,fe=$.clientTime,he=$.random,F=$.readCount,$=$.unreadCount,ue="".concat(ue,"-").concat(fe,"-").concat(he),fe=l._messageListHandler.getLocalMessage(o,ue),he={groupID:m,messageID:ue,readCount:0,unreadCount:0};fe&&(qt(F)&&(fe.readReceiptInfo.readCount=F,he.readCount=F),qt($)&&(fe.readReceiptInfo.unreadCount=$,he.unreadCount=$),n.push(he))})):(a="".concat(C.CONV_C2C).concat(h),M.forEach(function(F){var $=F.tinyID,ue=F.clientTime,F=F.random,$="".concat($,"-").concat(ue,"-").concat(F),ue=l._messageListHandler.getLocalMessage(a,$);ue&&(ue.readReceiptInfo.isPeerRead=!0,n.push({userID:h,messageID:$,isPeerRead:!0}))})),0<n.length&&this.emitOuterEvent(R.MESSAGE_READ_RECEIPT_RECEIVED,n))}},{key:"updateIsRead",value:function(e){var n=this.getLocalConversation(e),o=this.getLocalMessageList(e);if(n&&o.length!==0&&!Jr(n.type)){for(var a=[],l=0,h=o.length;l<h;l++)o[l].flow!=="in"?o[l].flow!=="out"||o[l].isRead||o[l].setIsRead(!0):a.push(o[l]);var m=0;m=n.type===C.CONV_C2C?(e=a.slice(-n.unreadCount).filter(function(L){return L.isRevoked}).length,a.length-n.unreadCount-e):a.length-n.unreadCount;for(var M=0;M<m&&!a[M].isRead;M++)a[M].setIsRead(!0)}}},{key:"deleteGroupAtTips",value:function(e){var n=this,o="".concat(this._n,".deleteGroupAtTips"),l=(w.l("".concat(o)),this._conversationMap.get(e));if(!l)return Promise.resolve();var a=l.groupAtInfoList;if(a.length===0)return Promise.resolve();var l=void 0,h=(e.startsWith(C.CONV_GROUP)&&(l=e.replace(C.CONV_GROUP,"")),V(a));if((Ii({groupID:l})||Bn(l))&&(h=a.filter(function(M){return!M.atTypeArray.includes(C.CONV_AT_ALL)})).length===0)return this.clearGroupAtInfoList(e,!1),Promise.resolve();var m=this.getMyUserID();return this.req({proto:le.DEL_GROUP_AT_TIPS,data:{messageListToDelete:h.map(function(M){return{from:M.from,to:m,messageSeq:M.__sequence,messageRandom:M.__random,groupID:xe(M.topicID)?M.groupID:M.topicID}})}}).then(function(){return w.l("".concat(o," ok. count:").concat(a.length)),n.clearGroupAtInfoList(e,!1),Promise.resolve()}).catch(function(M){return w.e("".concat(o," failed. error:"),M),Ce(M)})}},{key:"appendToMessageList",value:function(e){return this._messageListHandler.pushIn(e)}},{key:"setMessageRandom",value:function(e){this.singlyLinkedList.set(e.random)}},{key:"deleteMessageRandom",value:function(e){this.singlyLinkedList.delete(e.random)}},{key:"pushIntoMessageList",value:function(e,n,o){return!(!this._messageListHandler.pushIn(n,o)||this._isMessageFromCurrentInstance(n)&&!o||(e.push(n),0))}},{key:"_isMessageFromCurrentInstance",value:function(e){return this.singlyLinkedList.has(e.random)}},{key:"revoke",value:function(e,n,o){return this._messageListHandler.revoke(e,n,o)}},{key:"getPeerReadTime",value:function(e){return this._peerReadTimeMap.get(e)}},{key:"recordPeerReadTime",value:function(e,n){(!this._peerReadTimeMap.has(e)||this._peerReadTimeMap.get(e)<n)&&this._peerReadTimeMap.set(e,n)}},{key:"updateMessageIsPeerReadProperty",value:function(e,n){var o;e.startsWith(C.CONV_C2C)&&0<n&&(0<(o=this._messageListHandler.updateMessageIsPeerReadProperty(e,n)).length&&this.emitOuterEvent(R.MESSAGE_READ_BY_PEER,o),this._conversationMap.has(e)&&(Je(o=this._conversationMap.get(e).lastMessage)||o.fromAccount===this.getMyUserID()&&o.lastTime<=n&&!o.isPeerRead&&(o.isPeerRead=!0,this.emitConversationUpdate(!0,!1))))}},{key:"updateMessageIsModifiedProperty",value:function(e){this._messageListHandler.updateMessageIsModifiedProperty(e)}},{key:"setCompleted",value:function(e){w.l("".concat(this._n,".setCompleted. conversationID:").concat(e)),this._completedMap.set(e,!0)}},{key:"updateRoamingMessageKeyAndTime",value:function(e,n,o){this._roamingMessageKeyAndTimeMap.set(e,{messageKey:n,lastMessageTime:o})}},{key:"updateRoamingMessageSequence",value:function(e,n){this._roamingMessageSequenceMap.set(e,n)}},{key:"getConversationList",value:function(e){var n,o=this,a="".concat(this._n,".").concat("getConversationList"),l="pagingStatus:".concat(this._pagingStatus,", local conversation count:").concat(this._conversationMap.size,", options:").concat(JSON.stringify(e));return w.l("".concat(a,". ").concat(l)),this._pagingStatus===ja?((n=new Be("getConversationList")).setMessage(l),this.syncConversationList().then(function(){n.end();var h=o._getConversationList(e);return ft({conversationList:h,isSyncCompleted:o._isSyncCompleted()})}).catch(function(h){return n.setError(h).end(),w.e("".concat(a," failed. error:"),h),Ce(h)})):(l=this._getConversationList(e),w.l("".concat(a,". returned conversation count:").concat(l.length)),St({conversationList:l,isSyncCompleted:this._isSyncCompleted()}))}},{key:"_getConversationList",value:function(e){var n,o,a,l,h,m=this;return xe(e)?this.getLocalConversationList():At(e)?e.length===0?[]:this.getLocalConversationList().filter(function(M){return e.includes(M.conversationID)}):Qt(e)?(n=e.type,o=e.markType,a=e.groupName,l=e.hasUnreadCount,h=e.hasGroupAtInfo,this.getLocalConversationList().filter(function(M){return m._filterType(M,n)&&m._filterMarkType(M,o)&&m._filterGroupName(M,a)&&m._filterUnreadCount(M,l)&&m._filterGroupAtInfo(M,h)})):[]}},{key:"_filterType",value:function(e,n){return n!==C.CONV_C2C&&n!==C.CONV_GROUP||e.type===n}},{key:"_filterGroupName",value:function(e,n){return!wt(n)||(n===""?e.conversationGroupList.length===0:e.conversationGroupList.includes(n))}},{key:"_filterMarkType",value:function(e,n){return!qt(n)||(n===0?e.markList.length===0:e.markList.includes(n))}},{key:"_filterUnreadCount",value:function(e,n){var o=!0;return n===!0?o=1<=e.unreadCount:n===!1&&(o=e.unreadCount===0),o}},{key:"_filterGroupAtInfo",value:function(e,n){var o=!0;return n===!0?o=1<=e.groupAtInfoList.length:n===!1&&(o=e.groupAtInfoList.length===0),o}},{key:"_handleC2CPeerReadTime",value:function(){var e,n=J(this._conversationMap);try{for(n.s();!(e=n.n()).done;){var o=K(e.value,2),a=o[0],l=o[1];l.type===C.CONV_C2C&&(w.d("".concat(this._n,"._handleC2CPeerReadTime conversationID:").concat(a," peerReadTime:").concat(l.peerReadTime)),this.recordPeerReadTime(a,l.peerReadTime))}}catch(h){n.e(h)}finally{n.f()}}},{key:"_isPagingGetGroupListCompleted",value:function(){var e=this.get(7);return!e||e.isPagingGetCompleted()}},{key:"_getLocalGroupCount",value:function(){var e=this.get(7);return e?e.getLocalGroupList().length:0}},{key:"_hasLocalGroup",value:function(e){var n=this.get(7);return!!n&&n.hasLocalGroup(e.replace(C.CONV_GROUP,""))}},{key:"getConversationProfile",value:function(e){var n,o=this;if((n=this._conversationMap.has(e)?this._conversationMap.get(e):new pu({conversationID:e,type:e.slice(0,3)===C.CONV_C2C?C.CONV_C2C:C.CONV_GROUP},this.isIntl(),this.isUsingChatCore()))._isInfoCompleted||n.type===C.CONV_SYSTEM)return St({conversation:n});if(mi(e)&&!this._hasLocalGroup(e))return St({conversation:n});var a="".concat(this._n,".").concat("getConversationProfile"),l=new Be("getConversationProfile");return w.l("".concat(a,". conversationID:").concat(e," remark:").concat(n.remark," lastMessage:"),n.lastMessage),this._updateUserOrGroupProfileCompletely(n).then(function(h){l.setMessage("conversationID:".concat(e," unreadCount:").concat(h.data.conversation.unreadCount)).end();var m,M=o.get(8);return M&&n.type===C.CONV_C2C&&(m=e.replace(C.CONV_C2C,""),M.isMyFriend(m)&&(M=M.getFriendRemark(m),n.remark!==M&&(n.remark=M,w.l("".concat(a,". conversationID:").concat(e," patch remark:").concat(n.remark))))),w.l("".concat(a," ok. conversationID:").concat(e)),h}).catch(function(h){return l.setError(h).setMessage("conversationID:".concat(e)).end(),w.e("".concat(a," failed. error:"),h),Ce(h)})}},{key:"_updateUserOrGroupProfileCompletely",value:function(e){var n=this;return e.type===C.CONV_C2C?this.get(4).getUserProfile({userIDList:[e.toAccount]}).then(function(o){return o=o.data,o.length===0?Ce(new ln({code:we.USER_OR_GRP_NOT_FOUND})):(e.userProfile=o[0],e._isInfoCompleted=!0,n._unshiftConversation(e),St({conversation:e}))}):this.get(7).getGroupProfile({groupID:e.toAccount}).then(function(o){return e.groupProfile=o.data.group,e._isInfoCompleted=!0,n._unshiftConversation(e),St({conversation:e})})}},{key:"_unshiftConversation",value:function(e){e instanceof pu&&!this._conversationMap.has(e.conversationID)&&(this._conversationMap=new Map([[e.conversationID,e]].concat(V(this._conversationMap))),this._setStorageConversationList(),this.emitConversationUpdate(!0,!1))}},{key:"_onProfileUpdated",value:function(e){var n=this;e.data.forEach(function(o){var a=o.userID;a===n.getMyUserID()?n._onMyProfileModified({latestNick:o.nick,latestAvatar:o.avatar}):(a=n._conversationMap.get("".concat(C.CONV_C2C).concat(a)))&&(a.userProfile=o)})}},{key:"_isSyncCompleted",value:function(){return this._pagingStatus===oc}},{key:"_errorLog",value:function(e,n,o,a){var l=new Error("Params validate failed."),h="".concat(this.getErrorMessage("API_REFER")).concat(e);throw w.w("[".concat(e,"] | ").concat(n," | ").concat(this.getErrorMessage(o,a),", ").concat(h)),w.e("[".concat(e,"] Invalid ").concat(n,": type check failed for ").concat(n,".")),l}},{key:"_isValidConversationID",value:function(e){return yi(e)||mi(e)||Jr(e)}},{key:"deleteConversation",value:function(e){var n=this,o="deleteConversation";return wt(e)||oo(e)||this._errorLog(o,"options","StringOrObjectRequiredLog"),wt(e)?(this._isValidConversationID(e)||this._errorLog(o,"options","InvalidConversationID",e),w.l("".concat(this._n,".").concat(o," conversationID:").concat(e)),this.deleteConversationList({conversationIDList:[e],flag:1})):(At(e.conversationIDList)||this._errorLog(o,"conversationIDList","ArrayRequiredLog"),e.conversationIDList.length===0&&this._errorLog(o,"conversationIDList","NonEmptyArrayLog"),e.conversationIDList.forEach(function(a){n._isValidConversationID(a)||n._errorLog(o,"conversationIDList","InvalidConversationID",a)}),"clearHistoryMessage"in e&&typeof e.clearHistoryMessage!="boolean"&&this._errorLog(o,"clearHistoryMessage","BooleanRequiredLog"),100<e.conversationIDList.length&&(e.conversationIDList=e.conversationIDList.slice(0,100)),this.deleteConversationList(e))}},{key:"deleteConversationList",value:function(a){var n=a.conversationIDList,n=n===void 0?[]:n,o=a.clearHistoryMessage,o=o===void 0||o,a=a.flag,l=a===void 0?0:a,h="".concat(this._n,".").concat("deleteConversationList"),m=(w.l("".concat(h," conversationIDList.length:").concat(n.length," clearHistoryMessage:").concat(o)),new Be("deleteConversationList"));return m.setMessage("conversationIDList:".concat(n)),Promise.all([this.rmLocalOnlyConversationList(n),this.rmLocalAndRemoteConversationList(n,o)]).then(function(M){return m.end(),M=[].concat(V(M[0]),V(M[1])),M.length===0?Ce(new ln({code:we.CONV_NOT_FOUND})):(w.l("".concat(h," ok")),St(l===1?{conversationID:M[0]}:{conversationIDList:M}))}).catch(function(M){return m.setError(M).end(),w.e("".concat(h," failed. error:"),M),Ce(M)})}},{key:"rmLocalOnlyConversationList",value:function(e){var n=this;return e.filter(function(o){if(!n._conversationMap.has(o))return!1;var a=n.getLocalConversation(o).type;return a!==C.CONV_GROUP||n._hasLocalGroup(o)?a===C.CONV_SYSTEM&&(n.get(7).deleteGroupSystemNotice({messageList:n._messageListHandler.getLocalMessageList(o)}),n.deleteLocalConversation(o),!0):(n.deleteLocalConversation(o),!0)})}},{key:"rmLocalAndRemoteConversationList",value:function(e,n){var o=this,a={fromAccount:this.getMyUserID(),conversationList:[],clearHistoryMessage:n?1:0};return e.forEach(function(l){var h;o._conversationMap.has(l)&&((h=o.getLocalConversation(l).type)===C.CONV_C2C?a.conversationList.push({toAccount:l.replace(h,""),type:1}):h===C.CONV_GROUP&&o._hasLocalGroup(l)&&a.conversationList.push({toGroupID:l.replace(h,""),type:2}))}),a.conversationList.length===0?[]:this.req({proto:le.DEL_CONV,data:a}).then(function(l){var h=[];return 0<l.data.resultList.length&&l.data.resultList.map(function(m){m.code===0&&(m=m.type===1?"".concat(C.CONV_C2C).concat(m.to):"".concat(C.CONV_GROUP).concat(m.groupID),h.push(m))}),o.deleteLocalConversationList(h),h})}},{key:"setConversationDraft",value:function(o){var n=o.conversationID,o=o.draftText,a="".concat(this._n,".").concat("setConversationDraft");return w.l("".concat(a," conversationID:").concat(n," draftText:").concat(o)),this._conversationMap.has(n)?(a=this._conversationMap.get(n),a.setDraftText(o),St({code:0,conversation:a})):Ce({code:we.CONV_NOT_FOUND})}},{key:"clearHistoryMessage",value:function(e){var n=this,o={fromAccount:this.getMyUserID(),toAccount:void 0,type:void 0,toGroupID:void 0};if(!this._conversationMap.has(e))return Ce({code:we.CONV_NOT_FOUND});var a=this._conversationMap.get(e).type;if(a===C.CONV_C2C)o.type=1,o.toAccount=e.replace(C.CONV_C2C,"");else{if(a!==C.CONV_GROUP)return a===C.CONV_SYSTEM?(this.get(7).deleteGroupSystemNotice({messageList:this._messageListHandler.getLocalMessageList(e)}),St({conversationID:e})):Ce({code:we.CONV_UN_RECORDED_TYPE});o.type=2,o.toGroupID=e.replace(C.CONV_GROUP,"")}var l="".concat(this._n,".").concat("clearHistoryMessage"),h=new Be("clearHistoryMessage");return h.setMessage("conversationID:".concat(e)),w.l("".concat(l,". conversationID:").concat(e)),this.setMessageRead({conversationID:e}).then(function(){return n.req({proto:le.CLEAR_HISTORY_MSG,data:o})}).then(function(){h.end(),w.l("".concat(l," ok")),n._messageListHandler.removeByConversationID(e),n.setCompleted(e);var m=n.getLocalConversation(e);return m&&(m.updateLastMessage(),n._sortConversationListAndEmitEvent()),St({conversationID:e})}).catch(function(m){return h.setError(m).end(),w.e("".concat(l," failed. error:"),m),Ce(m)})}},{key:"pinConversation",value:function(M){var n=this,o=M.conversationID,a=M.isPinned;if(!this._conversationMap.has(o))return Ce({code:we.CONV_NOT_FOUND});var l=this.getLocalConversation(o);if(l.isPinned===a)return St({conversationID:o});var h="".concat(this._n,".").concat("pinConversation"),m=new Be("pinConversation"),M=(m.setMessage("conversationID:".concat(o," isPinned:").concat(a)),w.l("".concat(h,". conversationID:").concat(o," isPinned:").concat(a)),null);return yi(o)?M={type:1,toAccount:o.replace(C.CONV_C2C,"")}:mi(o)&&(M={type:2,groupID:o.replace(C.CONV_GROUP,"")}),this.req({proto:le.PIN_CONV,data:{fromAccount:this.getMyUserID(),operationType:a===!0?1:2,itemList:[M]}}).then(function(){return m.end(),w.l("".concat(h," ok")),l.isPinned!==a&&(l.isPinned=a,n._sortConversationListAndEmitEvent()),ft({conversationID:o})}).catch(function(L){return m.setError(L).end(),w.e("".concat(h," failed. error:"),L),Ce(L)})}},{key:"setMessageRemindType",value:function(e){return this._messageRemindHandler.set(e)}},{key:"patchMessageRemindType",value:function(e){var n=e.ID,l=e.isC2CConversation,o=e.messageRemindType,a=!1,l=this.getLocalConversation("".concat(l?C.CONV_C2C:C.CONV_GROUP).concat(n));return l&&l.messageRemindType!==o&&(l.messageRemindType=o,a=!0),w.d("".concat(this._n,".patchMessageRemindType options:"),e,"ret:".concat(a)),a}},{key:"onC2CMessageRemindTypeFetched",value:function(e){var n,o=this;At(e)&&0<e.length&&(n=0,e.forEach(function(h){var l=h.userID,h=h.muteFlag,h=o._transMessageRemindType(h);o.patchMessageRemindType({ID:l,isC2CConversation:!0,messageRemindType:h})===!0&&(n+=1)}),w.l("".concat(this._n,".onC2CMessageRemindTypeFetched updateCount:").concat(n)),1<=n&&this.emitConversationUpdate(!0,!1))}},{key:"onC2CMessageRemindTypeSynced",value:function(e){var n=this,o="".concat(this._n,".onC2CMessageRemindTypeSynced");w.d(o,e),e.dataList.forEach(function(a){var l;Je(a.muteNotificationsSync)||(l=(a=a.muteNotificationsSync).to,a=a.muteFlag,a=n._transMessageRemindType(a),n.patchMessageRemindType({ID:l,isC2CConversation:!(l=0),messageRemindType:a})&&(l+=1),w.l("".concat(o," updateCount:").concat(l)),1<=l&&n.emitConversationUpdate(!0,!1))})}},{key:"onGroupMessageRemindTypeUpdated",value:function(e){w.d("".concat(this._n,".onGroupMessageRemindTypeUpdated options:"),e),this._messageRemindHandler.onGroupMessageRemindTypeUpdated(e)}},{key:"deleteLocalConversation",value:function(e){var n=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1],o=this._conversationMap.has(e);w.d("".concat(this._n,".deleteLocalConversation conversationID:").concat(e," has:").concat(o)),o&&(this._conversationMap.delete(e),this._roamingMessageKeyAndTimeMap.has(e)&&this._roamingMessageKeyAndTimeMap.delete(e),this._roamingMessageSequenceMap.has(e)&&this._roamingMessageSequenceMap.delete(e),this._setStorageConversationList(),this._messageListHandler.removeByConversationID(e),this._completedMap.delete(e),n)&&(o=!this._isTopicConversation(e),this.emitConversationUpdate(o,!1))}},{key:"deleteLocalConversationList",value:function(e){var n=this,o=!1;e.forEach(function(a){n._conversationMap.has(a)&&(n.deleteLocalConversation(a,!1),o=!0)}),w.l("".concat(this._n,".deleteLocalConversationList conversationIDList.length:").concat(e.length," isConvIDExisted:").concat(o)),o&&this.emitConversationUpdate(!0,!1)}},{key:"isMessageSentByCurrentInstance",value:function(e){return!(!this._messageListHandler.hasLocalMessage(e.conversationID,e.ID)&&!this.singlyLinkedList.has(e.random))}},{key:"modifyMessageList",value:function(e){var n,o;e.startsWith(C.CONV_C2C)&&this._conversationMap.has(e)&&(o=this._conversationMap.get(e),n=Date.now(),this._messageListHandler.modifyMessageSentByPeer({conversationID:e,latestNick:o.userProfile.nick,latestAvatar:o.userProfile.avatar}),o=this.get(4).getNickAndAvatarByUserID(this.getMyUserID()),this._messageListHandler.modifyMessageSentByMe({conversationID:e,latestNick:o.nick,latestAvatar:o.avatar}),w.l("".concat(this._n,".modifyMessageList conversationID:").concat(e," cost:").concat(Zn(n))))}},{key:"updateUserProfileSpecifiedKey",value:function(a){w.l("".concat(this._n,".updateUserProfileSpecifiedKey options:"),a);var n=a.conversationID,o=a.nick,a=a.avatar;this._conversationMap.has(n)&&(n=this._conversationMap.get(n).userProfile,wt(o)&&n.nick!==o&&(n.nick=o),wt(a)&&n.avatar!==a&&(n.avatar=a),this.emitConversationUpdate(!0,!1))}},{key:"_onMyProfileModified",value:function(e){var n=this,o=this.getLocalConversationList(),a=Date.now();o.forEach(function(l){n.modifyMessageSentByMe(u({conversationID:l.conversationID},e))}),w.l("".concat(this._n,"._onMyProfileModified. modify all messages sent by me, cost:").concat(Zn(a)))}},{key:"modifyMessageSentByMe",value:function(e){this._messageListHandler.modifyMessageSentByMe(e)}},{key:"getLatestMessageSentByMe",value:function(e){return this._messageListHandler.getLatestMessageSentByMe(e)}},{key:"modifyMessageSentByPeer",value:function(e){this._messageListHandler.modifyMessageSentByPeer(e)}},{key:"getLatestMessageSentByPeer",value:function(e){return this._messageListHandler.getLatestMessageSentByPeer(e)}},{key:"pushIntoNoticeResult",value:function(e,n){return!(!this._messageListHandler.pushIn(n)||this.singlyLinkedList.has(n.random)||(e.push(n),0))}},{key:"getLocalLastMessage",value:function(e){return this._messageListHandler.getLocalLastMessage(e)}},{key:"checkAndPatchRemark",value:function(){var e,n,o=this.get(8);this._conversationMap.size===0||!o||(e=V(this._conversationMap.values()).filter(function(a){return a.type===C.CONV_C2C})).length!==0&&(n=0,e.forEach(function(a){var l=a.conversationID.replace(C.CONV_C2C,"");o.isMyFriend(l)&&(l=o.getFriendRemark(l),a.remark!==l&&(a.remark=l,n+=1))}),w.l("".concat(this._n,".checkAndPatchRemark. c2c conversation count:").concat(e.length,", patched count:").concat(n)))}},{key:"updateTopicConversation",value:function(e){this._updateLocalConversationList({conversationOptionsList:e,isFromGetConversations:!0,updateUnreadCount:!0})}},{key:"sendReadReceipt",value:function(e){var n=e[0],o=null;return n.conversationType===C.CONV_C2C?o=this._m.get(6):n.conversationType===C.CONV_GROUP&&(o=this._m.get(7)),o?o.sendReadReceipt(e):Ce({code:we.CANNOT_FIND_MODULE})}},{key:"getReadReceiptList",value:function(e){var n=e[0],o=null;return n.conversationType===C.CONV_C2C?o=this._m.get(6):n.conversationType===C.CONV_GROUP&&(o=this._m.get(7)),o?o.getReadReceiptList(e):Ce({code:we.CANNOT_FIND_MODULE})}},{key:"getLastMessageTime",value:function(e){return e=this.getLocalConversation(e),e?e.lastMessage.lastTime:0}},{key:"getTotalUnreadMessageCount",value:function(){var e=this.getLocalConversationList(),n=0;return e.forEach(function(o){o.type!==C.CONV_SYSTEM&&(o.messageRemindType!==""&&o.messageRemindType!==C.MSG_REMIND_ACPT_AND_NOTE||(n+=o.unreadCount))}),n}},{key:"emitTotalUnreadMessageCountUpdate",value:function(){var e=this.getTotalUnreadMessageCount();this._convTotalUnreadCount!==e&&(w.l("".concat(this._n,".emitTotalUnreadMessageCountUpdate from ").concat(this._convTotalUnreadCount," to ").concat(e)),this._convTotalUnreadCount=e,this.emitOuterEvent(R.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED))}},{key:"_isConvNeedShow",value:function(a){if(a=this.getLocalConversation(a),xe(a))return!0;var n=a.type===C.CONV_TOPIC,o=a.type===C.CONV_GROUP&&a.groupProfile.type===C.GRP_ROOM,a=a.type===C.CONV_GROUP&&a.groupProfile.type===C.GRP_LIVE;return!(n||o||a)}},{key:"setAllReceiveMessageOpt",value:function(e){return this._messageRemindHandler.setAllReceiveMessageOpt(e)}},{key:"getAllReceiveMessageOpt",value:function(){return this._messageRemindHandler.getAllReceiveMessageOpt()}},{key:"onAllReceiveMessageOptNotify",value:function(e){this._messageRemindHandler.onAllReceiveMessageOptNotify(e)}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._setStorageConversationList(!0),this._pagingStatus=wo,this._messageListHandler.reset(),this._messageRemindHandler.reset(),this._roamingMessageKeyAndTimeMap.clear(),this._roamingMessageSequenceMap.clear(),this.singlyLinkedList.reset(),this._peerReadTimeMap.clear(),this._completedMap.clear(),this._conversationMap.clear(),this._pagingTimeStamp=0,this._pagingStartIndex=0,this._pagingPinnedTimeStamp=0,this._pagingPinnedStartIndex=0,this._remoteGroupReadSequenceMap.clear(),this._convTotalUnreadCount=0,this._pagingGetCostList.length=0,this._pagingConvIDMap.clear(),this._convIDFromUnreadDBMap.clear(),this._pagingGetCostList.length=0,this.resetReady()}}]),Ic),$_=(y(CA,[{key:"onCheckTimer",value:function(e){e%1==0&&0<this._cachedGroupTipsMap.size&&this._checkCachedGroupTips()}},{key:"_checkCachedGroupTips",value:function(){var e=this;this._cachedGroupTipsMap.forEach(function(n,o){var a=e._checkCountMap.get(o),l=e._grpM.hasLocalGroup(o);w.l("".concat(e._n,"._checkCachedGroupTips groupID:").concat(o," hasLocalGroup:").concat(l," checkCount:").concat(a)),l?(e._notifyCachedGroupTips(o),e._checkCountMap.delete(o),e._grpM.deleteUnjoinedAVChatRoom(o)):a>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupTips(o),e._checkCountMap.delete(o)):e._checkCountMap.set(o,++a)})}},{key:"onNewGroupTips",value:function(a){w.d("".concat(this._n,".onReceiveGroupTips count:").concat(a.dataList.length));var a=this.newGroupTipsStoredAndSummary(a),n=a.eventDataList,o=a.result,a=a.AVChatRoomMessageList;0<a.length&&this._grpM.onAVChatRoomMessage(a),0<n.length&&(this._grpM.updateNextMessageSeq(n),this._grpM.get(11).onNewMessage({conversationOptionsList:n,isInstantMessage:!0})),0<o.length&&(this._grpM.emitOuterEvent(R.MESSAGE_RECEIVED,o),this.handleMessageList(o))}},{key:"newGroupTipsStoredAndSummary",value:function(e){for(var n=e.event,o=e.dataList,a=null,l=[],h=[],m={},M=[],L=0,F=o.length;L<F;L++){var $=Ua(o[L]);if(!(n===6&&(this._grpM.isGroupAttributesUpdatedNotice($)||this._grpM.isGroupCountersNotice($)))){var be=$.groupProfile,ue=be.groupID,fe=be.communityType,fe=fe===void 0?0:fe,he=be.topicID,he=he===void 0?void 0:he,be=be.invisible,ze=void 0,Ye=this._grpM.isMessageFromTopic(fe,he),Tt=(Ye&&(ze=C.CONV_TOPIC,$.to=he),this._grpM.hasLocalGroup(ue));if(Tt||!this._grpM.isUnjoinedAVChatRoom(ue))if(Tt||Ye)if(this._grpM.isMessageFromOrToAVChatroom(ue))$.event=n,M.push($);else if($.currentUser=this._grpM.getMyUserID(),$.conversationType=C.CONV_GROUP,(a=new Yn($)).setElement({type:C.MSG_GRP_TIP,content:u(u({},$.elements),{},{groupProfile:$.groupProfile})}),a.isSystemMessage=!1,be!==1){var Tt=this._grpM.get(11),Ye=a,be=Ye.conversationID,Ye=Ye.sequence;if(n===6)a._onlineOnlyFlag=!0,h.push(a);else if(!Tt.pushIntoNoticeResult(h,a))continue;this._grpM.isMessageFromCommunityOfTopic(fe,he)||n===6&&Tt.getLocalConversation(be)||(n!==6&&this._qualityStat(a),fe=Tt.isRemoteRead({conversationID:be,sequence:Ye}),xe(m[be])?(he=0,a.flow==="in"&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||fe||(he=1)),m[be]=l.push({conversationID:be,unreadCount:he,type:xe(ze)?a.conversationType:ze,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?"":a})-1):(l[Tt=m[be]].type=a.conversationType,l[Tt].subType=a.conversationSubType,l[Tt].lastMessage=a._isExcludedFromLastMessage?"":a,a.flow==="in"&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||fe||l[Tt].unreadCount++)))}else this._qualityStat(a);else this._cacheGroupTipsAndProbe({groupID:ue,event:n,item:$})}}return{eventDataList:l,result:h,AVChatRoomMessageList:M}}},{key:"_qualityStat",value:function(e){this._grpM.get(26).addMessageSequence({key:Ba,message:e})}},{key:"handleMessageList",value:function(e){var n=this;e.forEach(function(o){switch(o.payload.operationType){case 1:n._onNewMemberComeIn(o);break;case 2:n._onMemberQuit(o);break;case 3:n._onMemberKickedOut(o);break;case 4:n._onMemberSetAdmin(o);break;case 5:n._onMemberCancelledAdmin(o);break;case 6:n._onGroupProfileModified(o);break;case 7:n._onMemberInfoModified(o);break;case 8:n._onTopicProfileUpdated(o);break;default:w.w("".concat(n._n,".handleMessageList unknown operationType:").concat(o.payload.operationType))}})}},{key:"_onNewMemberComeIn",value:function(o){var o=o.payload,n=o.memberNum,o=o.groupProfile.groupID,o=this._grpM.getLocalGroupProfile(o);o&&qt(n)&&o.memberCount!==n&&(o.memberCount=n,this._updateConversationGroupProfile(o))}},{key:"_onMemberQuit",value:function(e){var o=e.payload,n=o.memberNum,o=o.groupProfile.groupID,a=this._grpM.getLocalGroupProfile(o);a&&qt(n)&&a.memberCount!==n&&(a.memberCount=n,this._updateConversationGroupProfile(a)),this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(o,e.payload.userIDList)}},{key:"_onMemberKickedOut",value:function(e){var o=e.payload,n=o.memberNum,o=o.groupProfile.groupID,a=this._grpM.getLocalGroupProfile(o);a&&qt(n)&&a.memberCount!==n&&(a.memberCount=n,this._updateConversationGroupProfile(a)),this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(o,e.payload.userIDList)}},{key:"_updateConversationGroupProfile",value:function(e){this._grpM.get(11).updateConversationGroupProfile([e])}},{key:"_onMemberSetAdmin",value:function(o){var n=o.payload.groupProfile.groupID,o=o.payload.userIDList,a=this._grpM.getGroupMemberHandler();o.forEach(function(l){l=a.getLocalGroupMemberInfo(n,l),l&&l.updateRole(C.GRP_MBR_ROLE_ADMIN)})}},{key:"_onMemberCancelledAdmin",value:function(o){var n=o.payload.groupProfile.groupID,o=o.payload.userIDList,a=this._grpM.getGroupMemberHandler();o.forEach(function(l){l=a.getLocalGroupMemberInfo(n,l),l&&l.updateRole(C.GRP_MBR_ROLE_MEMBER)})}},{key:"_onGroupProfileModified",value:function(l){var n=this,l=l.payload,o=l.newGroupProfile,l=l.groupProfile.groupID,a=this._grpM.getLocalGroupProfile(l),l=(Object.keys(o).forEach(function(h){switch(h){case"ownerID":n._ownerChanged(a,o);break;case"groupName":a.name=o[h];break;default:a[h]=o[h]}}),!a.isSupportTopic);this._grpM.emitGroupListUpdate(!0,l)}},{key:"_ownerChanged",value:function(o,n){var o=o.groupID,a=this._grpM.getLocalGroupProfile(o),l=this._grpM.getMyUserID();l===n.ownerID&&(a.updateGroup({selfInfo:{role:C.GRP_MBR_ROLE_OWNER}}),a=(n=this._grpM.getGroupMemberHandler()).getLocalGroupMemberInfo(o,l),l=this._grpM.getLocalGroupProfile(o).ownerID,n=n.getLocalGroupMemberInfo(o,l),a&&a.updateRole(C.GRP_MBR_ROLE_OWNER),n&&n.updateRole(C.GRP_MBR_ROLE_MEMBER))}},{key:"_onMemberInfoModified",value:function(e){var n=e.to,a=e.payload,o=a.groupProfile,a=a.memberList,l=o.groupID,h=(Bn(n)&&this._updateTopicMuteTime(e),this._grpM.getGroupMemberHandler());a.forEach(function(m){var M=h.getLocalGroupMemberInfo(l,m.userID);M&&qt(m.muteTime)&&M.updateMuteUntil(m.muteTime)})}},{key:"_updateTopicMuteTime",value:function(a){var n=a.to,a=a.payload,l=a.groupProfile,a=a.memberList,o=a===void 0?[]:a,a=this._grpM.get(10),l=l.groupID,h=a.getLocalTopic(l,n);if(h){for(var m=!1,M=0;M<o.length;M++){var L=o[M];if(L.userID===this._grpM.getMyUserID()&&0<=L.muteTime){h.updateSelfInfo({muteTime:L.muteTime}),m=!0;break}}m&&this._grpM.emitOuterEvent(R.TOPIC_UPDATED,{groupID:l,topic:h})}}},{key:"_onTopicProfileUpdated",value:function(e){var o=e.payload,n=o.groupProfile.groupID,o=o.newTopicInfo;this._grpM.get(10).onTopicProfileUpdated(u({groupID:n,topicID:e.to},o))}},{key:"_cacheGroupTips",value:function(e,n){this._cachedGroupTipsMap.has(e)||this._cachedGroupTipsMap.set(e,[]),this._cachedGroupTipsMap.get(e).push(n)}},{key:"_deleteCachedGroupTips",value:function(e){this._cachedGroupTipsMap.has(e)&&this._cachedGroupTipsMap.delete(e)}},{key:"_notifyCachedGroupTips",value:function(e){var n=this,o=this._cachedGroupTipsMap.get(e)||[];o.forEach(function(a){n.onNewGroupTips(a)}),this._deleteCachedGroupTips(e),w.l("".concat(this._n,"._notifyCachedGroupTips groupID:").concat(e," count:").concat(o.length))}},{key:"_cacheGroupTipsAndProbe",value:function(l){var n=this,o=l.groupID,a=l.event,l=l.item;this._cacheGroupTips(o,{event:a,dataList:[l]}),this._grpM.getGroupSimplifiedInfo(o).then(function(h){h.type===C.GRP_AVCHATROOM?n._grpM.hasLocalGroup(o)?n._notifyCachedGroupTips(o):n._grpM.setUnjoinedAVChatRoom(o):(n._grpM.updateGroupMap([h]),n._notifyCachedGroupTips(o))}),this._checkCountMap.has(o)||this._checkCountMap.set(o,0),w.l("".concat(this._n,"._cacheGroupTipsAndProbe groupID:").concat(o))}},{key:"reset",value:function(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear()}}]),CA),ev=(y(EA,[{key:"onCheckTimer",value:function(e){e%1==0&&0<this._cachedGroupMessageMap.size&&this._checkCachedGroupMessage()}},{key:"_checkCachedGroupMessage",value:function(){var e=this;this._cachedGroupMessageMap.forEach(function(n,o){var a=e._checkCountMap.get(o),l=e._grpM.hasLocalGroup(o);w.l("".concat(e._n,"._checkCachedGroupMessage groupID:").concat(o," hasLocalGroup:").concat(l," checkCount:").concat(a)),l?(e._notifyCachedGroupMessage(o),e._checkCountMap.delete(o),e._grpM.deleteUnjoinedAVChatRoom(o)):a>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupMessage(o),e._checkCountMap.delete(o)):e._checkCountMap.set(o,++a)})}},{key:"handleUpdateGroupLastMessage",value:function(e){var n="".concat(this._n,".handleUpdateGroupLastMessage");if(this._grpM.getGroupMap().size!==0){for(var o,a,l,h,m=!1,M=0,L=e.length;M<L;M++)(o=e[M]).type===C.CONV_GROUP&&o.lastMessage.lastSequence!==0&&o.lastMessage.payload!==null&&(a=o.conversationID.split(/^GROUP/)[1],(a=this._grpM.getLocalGroupProfile(a))&&(l=a.lastMessage,h=o.lastMessage,JSON.stringify(l)!==JSON.stringify(h)&&(a.lastMessage=u({},o.lastMessage),m=!0)));w.l("".concat(n," conversation count:").concat(e.length,", local group count:").concat(this._grpM.getLocalGroupList().length," isGroupListUpdated:").concat(m)),m&&(this._grpM.sortLocalGroupList(),this._grpM.emitGroupListUpdate(!0,!1))}else this.tempConversationList=e}},{key:"onNewGroupMessage",value:function(e){w.d("".concat(this._n,".onNewGroupMessage count:").concat(e.dataList.length));var a=this._newGroupMessageStoredAndSummary(e),n=a.conversationOptionsList,o=a.messageList,a=a.AVChatRoomMessageList,a=(0<a.length&&this._grpM.onAVChatRoomMessage(a),Vd(o)),a=(0<a.length&&this._grpM.emitOuterEvent(R.MESSAGE_MODIFIED,a),0<n.length&&(this._grpM.updateNextMessageSeq(n),this._grpM.get(11).onNewMessage({conversationOptionsList:n,isInstantMessage:e.isInstantMessage||!0,updateUnreadCount:e.updateUnreadCount||!0})),Gd(o));0<a.length&&this._grpM.emitOuterEvent(R.MESSAGE_RECEIVED,a),o.length=0}},{key:"_newGroupMessageStoredAndSummary",value:function(e){var n=e.dataList,o=e.event,a=e.isInstantMessage,l=null,h=[],m=[],M=[],L={},F=this._grpM.getFileDownloadProxy(),$=n.length;1<$&&n.sort(function(ri,ss){return ri.sequence-ss.sequence});for(var ue=this._grpM.get(11),fe=this._grpM.get(4),he=0;he<$;he++){var be,ze=Ua(n[he]),Bt=ze.groupProfile,Ye=Bt.groupID,Tt=Bt.communityType,Tt=Tt===void 0?0:Tt,Ct=Bt.topicID,Ct=Ct===void 0?void 0:Ct,Bt=Bt.invisible,In=void 0,ii=this._grpM.isMessageFromTopic(Tt,Ct),oi=(ii&&(In=C.CONV_TOPIC,ze.to=Ct),this._grpM.hasLocalGroup(Ye));!oi&&this._grpM.isUnjoinedAVChatRoom(Ye)||(oi||ii?this._grpM.isMessageFromOrToAVChatroom(Ye)?(ze.event=o,M.push(ze)):(ze.currentUser=this._grpM.getMyUserID(),ze.conversationType=C.CONV_GROUP,ze.isSystemMessage=!!ze.isSystemMessage,(l=new Yn(ze)).setElement(ze.elements,F),Bt!==1?(oi=n[he].isModified===1,ue.isMessageSentByCurrentInstance(l)?l.isModified=oi:oi=!1,ze.onlineOnlyFlag===1?(l._onlineOnlyFlag=!0,ue.isMessageSentByCurrentInstance(l)||m.push(l)):this._grpM.isMessageFromCommunityOfTopic(Tt,Ct)?m.push(l):(l.from!==this._grpM.getMyUserID()||(ii=ue.getLatestMessageSentByMe(l.conversationID))&&(Bt=ii.nick,Tt=ii.avatar,Bt===l.nick&&Tt===l.avatar||(ue.modifyMessageSentByMe({conversationID:be,latestNick:l.nick,latestAvatar:l.avatar}),fe.mockOnNickAvatarModified(l.nick,l.avatar))),ue.pushIntoMessageList(m,l,oi)&&(this._qualityStat(a,l),be=(Ct=l).conversationID,ii=Ct.sequence,Bt=ue.isRemoteRead({conversationID:be,sequence:ii}),xe(L[be])?(Tt=0,l.flow==="in"&&(l._isExcludedFromUnreadCount||Bt||(Tt=1)),L[be]=h.push({conversationID:be,unreadCount:Tt,type:xe(In)?l.conversationType:In,subType:l.conversationSubType,lastMessage:l._isExcludedFromLastMessage?"":l})-1):(h[oi=L[be]].type=xe(In)?l.conversationType:In,h[oi].subType=l.conversationSubType,h[oi].lastMessage=l._isExcludedFromLastMessage?"":l,l.flow==="in"&&(l._isExcludedFromUnreadCount||Bt||h[oi].unreadCount++))))):this._qualityStat(a,l)):this._cacheGroupMessageAndProbe({groupID:Ye,event:o,item:ze}))}return{conversationOptionsList:h,messageList:m,AVChatRoomMessageList:M}}},{key:"_qualityStat",value:function(e,n){var o=this._grpM.get(26);o.addMessageSequence({key:Ba,message:n}),e&&0<n.clientTime&&o.addMessageDelay(n.clientTime)}},{key:"onGroupMessageRevoked",value:function(e){var n=this,o=this._grpM.get(11),a=[],l=[];e.dataList.forEach(function(h){var m=h.elements.revokedInfos,M=h.revokerInfo,L=h.groupProfile,F=!1;L&&(F=Ii({groupID:L.groupID})||!Je(L.topicID)),xe(m)||m.forEach(function($){var ue,fe=Je($.topicID)?"GROUP".concat($.groupID):"GROUP".concat($.topicID),he=o.getLocalConversation(fe),be=$.revokerInfo&&$.revokerInfo.revoker||M&&M.revoker,ze=M&&M.reason||"";he&&pi(he.type)?ue={conversationID:fe,sequence:$.sequence,ID:"".concat($.tinyID,"-").concat($.clientTime,"-").concat($.random)}:(he=o.revoke(fe,$.sequence,$.random))?ue=he:(ue={conversationID:fe,sequence:$.sequence},$.tinyID&&$.clientTime&&$.random&&(ue.ID="".concat($.tinyID,"-").concat($.clientTime,"-").concat($.random)),$.time&&(ue.time=$.time)),ue&&(ue.revoker=be,ue.revokeReason=ze,ue.revokerInfo={userID:be,nick:"",avatar:""},F?(ue.revokerInfo.nick=L.nick,ue.revokerInfo.avatar=L.avatar,a.push(ue)):l.push(ue))})}),l.length===0&&a.length===0||(o.onMessageRevoked([].concat(a,l)),0<a.length&&this._grpM.emitOuterEvent(R.MESSAGE_REVOKED,a),0<l.length&&o.updateRevokerInfo(l).then(function(h){n._grpM.emitOuterEvent(R.MESSAGE_REVOKED,h)}))}},{key:"_groupListTreeShaking",value:function(e){for(var n=new Map(V(this._grpM.getGroupMap())),o=0,a=e.length;o<a;o++)n.delete(e[o].groupID);this._grpM.hasJoinedAVChatRoom()&&this._grpM.getJoinedAVChatRoom().forEach(function(M){n.delete(M)}),this._grpM.getGroupMap().forEach(function(M,L){M.isSupportTopic&&n.delete(L)});for(var l=V(n.keys()),h=0,m=l.length;h<m;h++)this._grpM.deleteGroup(l[h])}},{key:"syncGroupList",value:function(){var e=this,l=0<arguments.length&&arguments[0]!==void 0&&arguments[0],n=(this._pagingStatus===wo&&this._grpM.clearGroupMap(),["Type","Name","FaceUrl","NextMsgSeq","LastMsgTime","AtInfoList","LastRecallTime"]),o=this.PAGING_GRP_COUNT_LIMIT,a=[];if(l===!0)return this._pagingGetGroupListWithTopic({limit:o,offset:0,groupBaseInfoFilter:n,groupList:a});var l="syncGroupList",h="".concat(this._n,".").concat(l),m=new Be(l);return this._pagingGetGroupList({limit:o,offset:0,groupBaseInfoFilter:n,groupList:a}).then(function(){var M=tc(e._pagingGetCostList),L=Jp(e._pagingGetCostList),F=(e._pagingGetCostList.length=0,e._pagingStatus=oc,e._groupListTreeShaking(a),e._grpM.updateGroupMap(a),e._grpM.getLocalGroupList().length),F="count:".concat(F," sum:").concat(L," avg:").concat(M);return w.l("".concat(h," ok. ").concat(F)),m.setMessage(F).end(),e.tempConversationList&&(e.handleUpdateGroupLastMessage(e.tempConversationList),e.tempConversationList=null),e._grpM.emitGroupListUpdate(!0,!0),ft({groupList:e._grpM.getLocalGroupList()})}).catch(function(M){return e._pagingStatus=ja,m.setError(M).end(),w.e("".concat(h," failed. error:"),M),Ce(M)})}},{key:"getGroupList",value:function(){var e=this,n="".concat(this._n,".").concat("getGroupList");if(w.l("".concat(n," pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===ja||this._pagingStatus===wo)return this.syncGroupList().then(function(){var a=e._grpM.getLocalGroupList();return ft({groupList:a,isSyncCompleted:e.isPagingGetCompleted()})}).catch(function(a){return w.e("".concat(n," failed. error:"),a),Ce(a)});var o=this._grpM.getLocalGroupList();return w.l("".concat(n,". returned group count:").concat(o.length)),St({groupList:o,isSyncCompleted:this.isPagingGetCompleted()})}},{key:"isPagingGetCompleted",value:function(){return this._pagingStatus===oc}},{key:"_pagingGetGroupList",value:function(e){var n=this,o="".concat(this._n,".").concat("_pagingGetGroupList"),a=e.isCommunityRelay,l=a!==void 0&&a,h=e.limit,m=e.offset,M=e.groupBaseInfoFilter,L=e.groupList,F=Date.now();return this._grpM.req({proto:le.GET_GRP_LIST,data:{type:l?C.GRP_COMMUNITY:void 0,memberAccount:this._grpM.getMyUserID(),limit:h,offset:m,responseFilter:{groupBaseInfoFilter:M,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]}}}).then(function(he){var he=he.data,ue=he.groups,ue=ue===void 0?[]:ue,he=he.totalCount,ue=(L.push.apply(L,V(ue)),n._handleGroupAtInfoWithoutTopic(l,ue),m+h),fe=!(ue<he),he="offset:".concat(m," limit:").concat(h," totalCount:").concat(he," isCompleted:").concat(fe," ")+"currentCount:".concat(L.length," isCommunityRelay:").concat(l);return n._pagingGetCostList.push(Zn(F,!1)),w.l("".concat(o," ok. ").concat(he," cost:").concat(Zn(F))),l||fe?!l&&fe?(w.l("".concat(o," start to get community list")),m=0,n._pagingGetGroupList({limit:h,offset:m,groupBaseInfoFilter:M,groupList:L,isCommunityRelay:!0})):l&&!fe?(m=ue,n._pagingGetGroupList({limit:h,offset:m,groupBaseInfoFilter:M,groupList:L,isCommunityRelay:!0})):ft({groupList:L}):(m=ue,n._pagingGetGroupList({limit:h,offset:m,groupBaseInfoFilter:M,groupList:L}))}).catch(function($){return $.code===10018?(w.w("".concat(n.logPrefix," response size exceeds the limit, request count:").concat(h)),h=50,n._pagingGetGroupList({limit:h,offset:m,groupBaseInfoFilter:M,groupList:L,isCommunityRelay:l})):l?($.code===11e3&&w.l("".concat(o," ok. community unavailable")),St({groupList:L})):Ce($)})}},{key:"_pagingGetGroupListWithTopic",value:function(e){var n=this,o="".concat(this._n,"._pagingGetGroupListWithTopic"),a=e.limit,l=e.offset,h=e.groupBaseInfoFilter,m=e.groupList,M=Date.now();return this._grpM.req({proto:le.GET_GRP_LIST,data:{type:C.GRP_COMMUNITY,memberAccount:this._grpM.getMyUserID(),limit:a,offset:l,responseFilter:{groupBaseInfoFilter:h,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]},isSupportTopic:1}}).then(function(F){var F=F.data,$=F.groups,F=F.totalCount,$=(m.push.apply(m,V($===void 0?[]:$)),l+a),ue=!($<F);return w.l("".concat(o," ok. offset:").concat(l," limit:").concat(a," totalCount:").concat(F," isCompleted:").concat(ue," currentCount:").concat(m.length," cost:").concat(Zn(M))),ue?(n._grpM.updateGroupMap(m),n._grpM.emitGroupListUpdate(!0,!1),F=n._grpM.getLocalGroupList().filter(function(fe){return fe.isSupportTopic===!0}),ft({groupList:F})):(l=$,n._pagingGetGroupListWithTopic({limit:a,offset:l,groupBaseInfoFilter:h,groupList:m}))}).catch(function(L){return L.code===10018?(w.w("".concat(n.logPrefix," response size exceeds the limit, request count:").concat(a)),a=50,n._pagingGetGroupListWithTopic({limit:a,offset:l,groupBaseInfoFilter:h,groupList:m})):Ce(L)})}},{key:"_cacheGroupMessage",value:function(e,n){this._cachedGroupMessageMap.has(e)||this._cachedGroupMessageMap.set(e,[]),this._cachedGroupMessageMap.get(e).push(n)}},{key:"_deleteCachedGroupMessage",value:function(e){this._cachedGroupMessageMap.has(e)&&this._cachedGroupMessageMap.delete(e)}},{key:"_notifyCachedGroupMessage",value:function(e){var n=this,o=this._cachedGroupMessageMap.get(e)||[];o.forEach(function(a){n.onNewGroupMessage(a)}),this._deleteCachedGroupMessage(e),w.l("".concat(this._n,"._notifyCachedGroupMessage groupID:").concat(e," count:").concat(o.length))}},{key:"_cacheGroupMessageAndProbe",value:function(l){var n=this,o=l.groupID,a=l.event,l=l.item;this._cacheGroupMessage(o,{event:a,dataList:[l]}),this._grpM.getGroupSimplifiedInfo(o).then(function(h){h.type===C.GRP_AVCHATROOM?n._grpM.hasLocalGroup(o)?n._notifyCachedGroupMessage(o):n._grpM.setUnjoinedAVChatRoom(o):(n._grpM.updateGroupMap([h]),n._notifyCachedGroupMessage(o))}),this._checkCountMap.has(o)||this._checkCountMap.set(o,0),w.l("".concat(this._n,"._cacheGroupMessageAndProbe groupID:").concat(o))}},{key:"_handleGroupAtInfoWithoutTopic",value:function(e,n){var o=this;e&&n.length!==0&&n.forEach(function(h){var l=h.groupID,h=h.groupAtInfoList,m=[];xe(h)||(h.forEach(function(M){m.push(u(u({},M),{},{groupID:l}))}),o._grpM.get(11).onNewGroupAtTips({dataList:m}))})}},{key:"setPagingGroupCount",value:function(e){xe(e)||(this.PAGING_GRP_COUNT_LIMIT=parseInt(e,10))}},{key:"reset",value:function(){this.PAGING_GRP_COUNT_LIMIT=200,this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._pagingStatus=wo,this._pagingGetCostList=[]}}]),EA),ao=(y(TA,[{key:"_onCloudConfigUpdated",value:function(){var e=this._grpM.getCloudConfig("grp_attr_cache_time");xe(e)||(this.CACHE_EXPIRE_TIME=Number(e))}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesMap.forEach(function(e){e.localMainSequence=0})}},{key:"isGroupAttributesUpdatedNotice",value:function(o){var n=o.to,o=o.elements.newGroupProfile,a=!xe(o)&&!Je(o.groupAttributeOption);return a&&this._onGroupAttributesUpdated({groupID:n,groupAttributeOption:o.groupAttributeOption}),a}},{key:"_onGroupAttributesUpdated",value:function(m){var n=this,o=m.groupID,m=m.groupAttributeOption,a=m.mainSequence,l=m.isWithChangedAttributeInfo,h=m.groupAttributeList,h=h===void 0?[]:h,m=m.operationType;if(w.l("".concat(this._n,".onGroupAttributesUpdated. ")+"groupID:".concat(o," isWithChangedAttributeInfo:").concat(l," operationType:").concat(m)),!xe(m)){this._groupAttributesCopy=this._getCachedAttributes({groupID:o});var M=a-this._getLocalGroupAttributes(o).localMainSequence;if(M!=0){if(l===1&&M==1)return this._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:a,groupAttributeList:h,operationType:m}),void this._emitGroupAttributesUpdated(o);this._hasLocalGroupAttributes(o)&&(l=this._getLocalGroupAttributes(o).avChatRoomKey,this._getGroupAttributes({groupID:o,avChatRoomKey:l}).then(function(){n._emitGroupAttributesUpdated(o)}))}}}},{key:"initGroupAttributesCache",value:function(o){var n=o.groupID,o=o.avChatRoomKey,o=o===void 0?void 0:o;this._groupAttributesMap.set(n,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:o}),w.l("".concat(this._n,".initGroupAttributesCache groupID:").concat(n," avChatRoomKey:").concat(o))}},{key:"initGroupAttributes",value:function(h){var n=this,o=h.groupID,a=h.groupAttributes,h=this._getLocalGroupAttributes(o),l=h.remoteMainSequence,h=h.avChatRoomKey,m=new Be("initGroupAttributes");return m.setMessage("groupID:".concat(o," avChatRoomKey:").concat(h," mainSequence:").concat(l)),this._grpM.req({proto:le.SET_GRP_ATTR,data:{groupID:o,avChatRoomKey:h,mainSequence:l,groupAttributeList:this._transformGroupAttributes(a)}}).then(function(F){w.l("".concat(n._n,".").concat("initGroupAttributes"," ok. groupID:").concat(o));var F=F.data,L=F.mainSequence,F=V(F.groupAttributeList);return F.forEach(function($){$.value=a[$.key]}),n._groupAttributesCopy=n._getCachedAttributes({groupID:o}),n._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:L,groupAttributeList:F,operationType:1}),n._emitGroupAttributesUpdated(o),m.end(),ft({groupAttributes:a})}).catch(function(M){return m.setError(M).end(),Ce(M)})}},{key:"setGroupAttributes",value:function(L){var n=this,o="".concat(this._n,".").concat("setGroupAttributes"),a=L.groupID,l=L.groupAttributes,L=this._getLocalGroupAttributes(a),h=L.remoteMainSequence,m=L.avChatRoomKey,M=L.attributes,L=this._transformGroupAttributes(l),F=(L.forEach(function($){var ue=$.key;$.sequence=0,M.has(ue)&&($.sequence=M.get(ue).sequence)}),new Be("setGroupAttributes"));return F.setMessage("groupID:".concat(a," groupAttributes:").concat(JSON.stringify(l))),w.l("".concat(o,". groupID:").concat(a," mainSequence:").concat(h)),this._grpM.req({proto:le.MODIFY_GRP_ATTR,data:{groupID:a,avChatRoomKey:m,mainSequence:h,groupAttributeList:L}}).then(function(fe){w.l("".concat(o," ok."));var fe=fe.data,ue=fe.mainSequence,fe=V(fe.groupAttributeList);return fe.forEach(function(he){he.value=l[he.key]}),n._groupAttributesCopy=n._getCachedAttributes({groupID:a}),n._refreshCachedGroupAttributes({groupID:a,remoteMainSequence:ue,groupAttributeList:fe,operationType:2}),n._emitGroupAttributesUpdated(a),F.end(),ft({groupAttributes:l})}).catch(function($){return F.setError($).end(),Ce($)})}},{key:"deleteGroupAttributes",value:function(a){var n=this,o=a.groupID,a=a.keyList,a=a===void 0?[]:a,M=this._getLocalGroupAttributes(o),l=M.remoteMainSequence,F=M.avChatRoomKey,h=M.attributes,m=V(h.keys()),M=le.CLEAR_GRP_ATTR,L=3,F={groupID:o,avChatRoomKey:F,mainSequence:l},$=[],ue=(0<a.length&&(m=[],M=le.DEL_GRP_ATTR,L=4,a.forEach(function(fe){var he=0;h.has(fe)&&(he=h.get(fe).sequence,m.push(fe)),$.push({key:fe,sequence:he})}),F.groupAttributeList=$),new Be("deleteGroupAttributes"));return ue.setMessage("groupID:".concat(o," mainSequence:").concat(l," keyList:").concat(a," proto:").concat(M)),this._grpM.req({proto:M,data:F}).then(function(fe){return w.l("".concat(n._n,".").concat("deleteGroupAttributes"," ok. groupID:").concat(o)),fe=fe.data.mainSequence,n._groupAttributesCopy=n._getCachedAttributes({groupID:o}),n._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:fe,groupAttributeList:$,operationType:L}),n._emitGroupAttributesUpdated(o),ue.end(),ft({keyList:m})}).catch(function(fe){return ue.setError(fe).end(),Ce(fe)})}},{key:"getGroupAttributes",value:function(e){var n=this,o="".concat(this._n,".").concat("getGroupAttributes"),a=e.groupID,M=this._getLocalGroupAttributes(a),l=M.avChatRoomKey,h=M.lastUpdateTime,m=M.localMainSequence,M=M.remoteMainSequence,L=new Be("getGroupAttributes");return L.setMessage("groupID:".concat(a," localMainSequence:").concat(m," remoteMainSequence:").concat(M," keyList:").concat(e.keyList)),Date.now()-h>=this.CACHE_EXPIRE_TIME||m<M?this._getGroupAttributes({groupID:a,avChatRoomKey:l}).then(function(F){return L.setMoreMessage("get attributes from remote. count:".concat(F.length)).end(),w.l("".concat(o," from remote. groupID:").concat(a)),F=n._getCachedAttributes(e),ft({groupAttributes:F})}).catch(function(F){return L.setError(F).end(),Ce(F)}):(L.setMoreMessage("get attributes from cache").end(),w.l("".concat(o," from cache. groupID:").concat(a)),h=this._getCachedAttributes(e),St({groupAttributes:h}))}},{key:"_getGroupAttributes",value:function(e){var n=this,o=0;return xe(e.avChatRoomKey)||(o=1),this._grpM.req({proto:le.GET_GRP_ATTR,data:u(u({},e),{},{groupType:o})}).then(function(h){w.l("".concat(n._n,"._getGroupAttributes ok. groupID:").concat(e.groupID));var h=h.data,l=h.mainSequence,h=h.groupAttributeList,m=V(h);return xe(l)||n._refreshCachedGroupAttributes({groupID:e.groupID,remoteMainSequence:l,groupAttributeList:m,operationType:5}),h}).catch(function(a){return Ce(a)})}},{key:"_refreshCachedGroupAttributes",value:function(l){var n=l.groupID,o=l.remoteMainSequence,a=l.groupAttributeList,l=l.operationType;if(this._hasLocalGroupAttributes(n)){var h=this._getLocalGroupAttributes(n),m=h.localMainSequence;if(l===5||o-m==1)h.remoteMainSequence=o,h.localMainSequence=o,h.lastUpdateTime=Date.now(),this._updateCachedAttributes({groupAttributes:h,groupAttributeList:a,operationType:l});else{if(m===o)return;h.remoteMainSequence=o}this._groupAttributesMap.set(n,h),a="operationType:".concat(l," localMainSequence:").concat(m," remoteMainSequence:").concat(o),w.l("".concat(this._n,"._refreshCachedGroupAttributes. ").concat(a))}}},{key:"_getCachedAttributes",value:function(o){var n=o.groupID,o=o.keyList,o=o===void 0?[]:o,a={};if(this._hasLocalGroupAttributes(n)){var l=this._getLocalGroupAttributes(n).attributes;if(0<o.length)o.forEach(function(L){l.has(L)&&(a[L]=l.get(L).value)});else{var h,m=J(l.keys());try{for(m.s();!(h=m.n()).done;){var M=h.value;a[M]=l.get(M).value}}catch(L){m.e(L)}finally{m.f()}}}return a}},{key:"_updateCachedAttributes",value:function(a){var n=a.groupAttributes,o=a.groupAttributeList,a=a.operationType;a!==3?a!==4?(a===1&&n.attributes.clear(),o.forEach(function(M){var h=M.key,m=M.value,M=M.sequence;n.attributes.set(h,{value:m,sequence:M})})):o.forEach(function(l){n.attributes.delete(l.key)}):n.attributes.clear()}},{key:"_hasLocalGroupAttributes",value:function(e){return this._groupAttributesMap.has(e)}},{key:"_getLocalGroupAttributes",value:function(e){return this._hasLocalGroupAttributes(e)||this.initGroupAttributesCache({groupID:e}),this._groupAttributesMap.get(e)}},{key:"_transformGroupAttributes",value:function(e){var n=[];return Object.keys(e).forEach(function(o){n.push({key:o,value:e[o]})}),n}},{key:"_emitGroupAttributesUpdated",value:function(e){var n=this._getCachedAttributes({groupID:e}),a=this._computeAttrChangedInfo(n),o=a.updatedKeyList,a=a.deletedKeyList;w.l("".concat(this._n,"._emitGroupAttributesUpdated update:").concat(o.length,", delete:").concat(a.length)),o.length===0&&a.length===0||this._grpM.emitOuterEvent(R.GROUP_ATTRIBUTES_UPDATED,{groupID:e,groupAttributes:n,updatedKeyList:o,deletedKeyList:a})}},{key:"_computeAttrChangedInfo",value:function(e){var n=this,o=[],a=[];return Object.keys(e).forEach(function(l){e[l]!==n._groupAttributesCopy[l]&&o.push(l)}),Object.keys(this._groupAttributesCopy).forEach(function(l){xe(e[l])&&a.push(l)}),this._groupAttributesCopy={},{updatedKeyList:o,deletedKeyList:a}}},{key:"deleteLocalGroupAttributes",value:function(e){this._hasLocalGroupAttributes(e)&&this._groupAttributesMap.delete(e)}},{key:"reset",value:function(){this._groupAttributesMap.clear(),this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4}}]),TA),gc=(y(zn,[{key:"_onCloudConfigUpdated",value:function(){var e=this._grpM.getCloudConfig("grp_counter_expire_time");xe(e)||(this.EXPIRE_TIME=Number(e))}},{key:"isGroupCountersNotice",value:function(o){var n=o.to,o=o.elements.groupCounterInfo,a=!1;return Je(o)||(this._onGroupCountersUpdated({groupID:n,groupCounterInfo:o}),a=!0),a}},{key:"_onGroupCountersUpdated",value:function(e){var n=this,o=e.groupID;e.groupCounterInfo.forEach(function(m){var l=m.type,h=m.groupCounterSeq,m=m.counterList,m=m===void 0?[]:m;l!==0&&l!==2||(n._updateLocalGroupCounters({groupID:o,groupCounterSeq:h,counterList:m}),m.forEach(function(M){n._grpM.emitOuterEvent(R.GROUP_COUNTER_UPDATED,{groupID:o,key:M.key,value:M.value})})),l===1&&n._deleteLocalGroupCounters({groupID:o,groupCounterSeq:h,counterList:m})}),w.l("".concat(this._n,"._onGroupCountersUpdated groupID:").concat(o))}},{key:"initGroupCountersCache",value:function(o){var n=o.groupID,o=o.avChatRoomKey;this._groupCountersMap.set(n,{lastUpdateTime:0,groupCounterSeq:0,counters:new Map,avChatRoomKey:o}),w.l("".concat(this._n,".initGroupCountersCache groupID:").concat(n," avChatRoomKey:").concat(o))}},{key:"setGroupCounters",value:function(a){if(!this._grpM.canIUse(pe.GRP_COUNTER))return this._grpM.cannotUseCommercialAbility("setGroupCounters");var n="".concat(this._n,".").concat("setGroupCounters"),o=a.groupID,a=a.counters,a=this._convertObjectToList(a),l=this._getLocalGroupCounters(o).avChatRoomKey,h="groupID:".concat(o," count:").concat(a.length),m=new Be("setGroupCounters");return m.setMessage("".concat(h)),w.l("".concat(n,". ").concat(h)),this._updateGroupCounters({groupID:o,counterList:a,avChatRoomKey:l,mode:"Set"}).then(function(M){return m.end(),w.l("".concat(n," ok.")),ft({counters:M})}).catch(function(M){return m.setError(M).end(),w.e("".concat(n," failed. error:"),M),Ce(M)})}},{key:"increaseGroupCounter",value:function(h){var n="increaseGroupCounter";if(!this._grpM.canIUse(pe.GRP_COUNTER))return this._grpM.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n),a=h.groupID,l=h.key,h=h.value,m=this._getLocalGroupCounters(a).avChatRoomKey,M="groupID:".concat(a," key:").concat(l," value:").concat(h),L=new Be(n);return L.setMessage("".concat(M)),w.l("".concat(o,". ").concat(M)),this._updateGroupCounters({groupID:a,counterList:[{key:l,value:h}],avChatRoomKey:m,mode:"Increase"}).then(function(F){return L.end(),w.l("".concat(o," ok.")),ft({counters:F})}).catch(function(F){return L.setError(F).end(),w.e("".concat(o," failed. error:"),F),Ce(F)})}},{key:"decreaseGroupCounter",value:function(h){var n="decreaseGroupCounter";if(!this._grpM.canIUse(pe.GRP_COUNTER))return this._grpM.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n),a=h.groupID,l=h.key,h=h.value,m=this._getLocalGroupCounters(a).avChatRoomKey,M="groupID:".concat(a," key:").concat(l," value:").concat(h),L=new Be(n);return L.setMessage("".concat(M)),w.l("".concat(o,". ").concat(M)),this._updateGroupCounters({groupID:a,counterList:[{key:l,value:h}],avChatRoomKey:m,mode:"Decrease"}).then(function(F){return L.end(),w.l("".concat(o," ok.")),ft({counters:F})}).catch(function(F){return L.setError(F).end(),w.e("".concat(o," failed. error:"),F),Ce(F)})}},{key:"getGroupCounters",value:function(m){var n=this;if(!this._grpM.canIUse(pe.GRP_COUNTER))return this._grpM.cannotUseCommercialAbility("getGroupCounters");var o="".concat(this._n,".").concat("getGroupCounters"),a=m.groupID,m=m.keyList,l=m===void 0?[]:m,m=this._getLocalGroupCounters(a),h=m.avChatRoomKey,m=m.lastUpdateTime,M=new Be("getGroupCounters");return M.setMessage("groupID:".concat(a)),Date.now()-m>=this.EXPIRE_TIME?this._getRemoteGroupCounters({groupID:a,avChatRoomKey:h}).then(function(L){return M.setMoreMessage("from remote. count:".concat(L.length)).end(),w.l("".concat(o," from remote. groupID:").concat(a)),L=n._getLocalCounters(a,l),ft({counters:L})}).catch(function(L){return M.setError(L).end(),Ce(L)}):(M.setMoreMessage("from cache").end(),w.l("".concat(o," from cache. groupID:").concat(a)),m=this._getLocalCounters(a,l),St({counters:m}))}},{key:"_getRemoteGroupCounters",value:function(e){var n=this;return this._grpM.req({proto:le.GET_GRP_COUNTER,data:u({},e)}).then(function(l){var l=l.data,a=l.counterList,a=a===void 0?[]:a,l=l.groupCounterSeq;return n._updateLocalGroupCounters({groupID:e.groupID,counterList:a,groupCounterSeq:l}),w.l("".concat(n._n,"._getRemoteGroupCounters ok. groupID:").concat(e.groupID)),a}).catch(function(o){return Ce(o)})}},{key:"_convertObjectToList",value:function(e){var n=[];return Object.keys(e).forEach(function(o){n.push({key:o,value:e[o]})}),n}},{key:"_updateGroupCounters",value:function(e){var n="".concat(this._n,"._updateGroupCounters"),o=e.groupID,a=e.avChatRoomKey,l=e.mode;return w.l("".concat(n,". groupID:").concat(o," avChatRoomKey:").concat(a," mode:").concat(l)),this._grpM.req({proto:le.UPDATE_GRP_COUNTER,data:u({},e)}).then(function(m){w.l("".concat(n," ok."));var m=m.data.counterList,M={};return(m===void 0?[]:m).forEach(function($){var F=$.key,$=$.value;M[F]=$}),M}).catch(function(h){return Ce(h)})}},{key:"_hasLocalGroupCounters",value:function(e){return this._groupCountersMap.has(e)}},{key:"_getLocalGroupCounters",value:function(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}},{key:"_updateLocalGroupCounters",value:function(m){var n,o,a,l=m.groupID,h=m.counterList,h=h===void 0?[]:h,m=m.groupCounterSeq;this._hasLocalGroupCounters(l)&&(a=this._getLocalGroupCounters(l),n=a.counters,o=a.avChatRoomKey,a=a.groupCounterSeq,0<m&&m<a||(h.forEach(function(F){var L=F.key,F=F.value;n.set(L,F)}),this._groupCountersMap.set(l,{lastUpdateTime:Date.now(),groupCounterSeq:m,counters:n,avChatRoomKey:o})))}},{key:"_deleteLocalGroupCounters",value:function(h){var n,o,a=h.groupID,l=h.counterList,l=l===void 0?[]:l,h=h.groupCounterSeq;this._hasLocalGroupCounters(a)&&(o=this._getLocalGroupCounters(a),n=o.counters,o=o.avChatRoomKey,l.forEach(function(m){n.delete(m.key)}),this._groupCountersMap.set(a,{lastUpdateTime:Date.now(),groupCounterSeq:h,counters:n,avChatRoomKey:o}))}},{key:"_getLocalCounters",value:function(e,n){var o={};if(!this._hasLocalGroupCounters(e))return o;var a=this._getLocalGroupCounters(e).counters;if(0<n.length)n.forEach(function(M){a.has(M)&&(o[M]=a.get(M))});else{var l,h=J(a.keys());try{for(h.s();!(l=h.n()).done;){var m=l.value;o[m]=a.get(m)}}catch(M){h.e(M)}finally{h.f()}}return o}},{key:"reset",value:function(){this._groupCountersMap.clear(),this.EXPIRE_TIME=3e4}}]),zn),tv=(y(yA,[{key:"start",value:function(){var e=this._grpM.isLoggedIn();e||(this._proto=le.AV_NOAUTH_POLLING),w.l("".concat(this._n,".start pollingInterval:").concat(this._manager.getPollingInterval()," isLoggedIn:").concat(e)),this._isRunning=!0,this._request()}},{key:"isRunning",value:function(){return this._isRunning}},{key:"_request",value:function(){var e=this,n=this._onInit(this._groupID);this._grpM.req({proto:this._proto,data:n}).then(function(o){e._onSuccess(e._groupID,o),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.getPollingInterval()))}).catch(function(o){e._onFail(e._groupID,o),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.MAX_POLLING_INTERVAL))})}},{key:"stop",value:function(){w.l("".concat(this._n,".stop")),0<this._timeoutID&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}},{key:"getPollingTimerID",value:function(){return this._timeoutID}}]),yA),Ag={3:!0,4:!0,5:!0,6:!0,17:!0,20:!0,21:!0,100:!0},AA=(y(IA,[{key:"hasJoinedAVChatRoom",value:function(){var e=[];return 0<(e=0<this._joinedGroupMap.size?V(this._joinedGroupMap.values()).filter(function(n){return n.type===C.GRP_AVCHATROOM}):e).length}},{key:"getJoinedLiveList",value:function(){var e=[];return e=0<this._joinedGroupMap.size?V(this._joinedGroupMap.values()).filter(function(n){return n.type===C.GRP_LIVE}):e}},{key:"checkJoinedAVChatRoomByID",value:function(e){return this._joinedGroupMap.has(e)}},{key:"getJoinedAVChatRoom",value:function(){return 0<this._joinedGroupMap.size?V(this._joinedGroupMap.keys()):[]}},{key:"_updatedata",value:function(e){var n=this._pollingRequestInfoMap.get(e);return e===V(this._pollingInstanceMap.keys())[0]?u(u({},n),{},{startBroadcastSeq:this._startBroadcastSeq,simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG}):u(u({},n),{},{simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG})}},{key:"_handleSuccess",value:function(e,n){var o,L=n.data,a=L.key,l=L.nextSeq,h=L.rspMsgList,m=L.errorCode,M=L.nextBroadcastSeq,L=L.broadcastMessageList;m!==0?(m=this._pollingRequestInfoMap.get(e),o=new Be("longPollingAVError"),m=m?"".concat(m.key,"-").concat(m.startSeq):"requestInfo is undefined",o.setMessage("".concat(e,"-").concat(m,"-").concat(n.errorInfo)).setCode(n.errorCode).end(!0)):this.checkJoinedAVChatRoomByID(e)&&(wt(a)&&qt(l)&&this._pollingRequestInfoMap.set(e,{key:a,startSeq:l}),qt(M)&&M>this._startBroadcastSeq&&(this._startBroadcastSeq=M),At(h)&&0<h.length?(h.forEach(function(F){F.to=F.groupID}),this.onMessage(h,e)):(this._pollingNoMessageCount+=1,this._pollingNoMessageCount===this.DEFAULT_POLLING_NO_MESSAGE_COUNT&&(this._pollingInterval=this.DEFAULT_POLLING_INTERVAL+this.DEFAULT_POLLING_INTERVAL_PLUS)),this._onBroadcastMessage(L))}},{key:"_handleFailure",value:function(e,n){}},{key:"onMessage",value:function(e,n){if(At(e)&&e.length!==0){var o="".concat(this._n,".onMessage"),a=(n&&(o+=" groupID:".concat(n)),this._pollingNoMessageCount!==0&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL),null),l=[],h=this._get(11),m=this._get(26),M=e.length,L=(1<M&&e.sort(function(be,ze){return be.sequence-ze.sequence}),this._get(12).isUnlimitedAVChatRoom()),F=!1;w.getLevel()<=0&&(n=e.map(function(be){return be.sequence}),w.l("".concat(o," count:").concat(n.length," sequenceList:").concat(n)),n.length=0);for(var $=0;$<M;$++){var ue=this.restoreMessageFromSimplified(e[$]);if(Ag[ue.event]){if(ue.event===6&&(this._grpM.isGroupAttributesUpdatedNotice(ue)||this._grpM.isGroupCountersNotice(ue)))continue;if(ue.event!==20)if(ue.event!==21)if(ue.event!==100){var a=this.packMessage(ue,ue.event),fe=ue.isModified===1,F=ue.isHistoryMessage===1;if(!L){if(this.sequencesLinkedList.has(a.sequence))continue;this.sequencesLinkedList.set(a.sequence)}var he=this.messageIDLinkedList.has(a.ID);he?w.w("".concat(o," ID:").concat(a.ID," has:").concat(he)):(this.messageIDLinkedList.set(a.ID),he=!1,!F&&this._isMessageSentByCurrentInstance(a)?fe&&(he=!0,a.isModified=fe,h.updateMessageIsModifiedProperty(a)):he=!0,he&&(a.conversationType===C.CONV_SYSTEM&&a.payload.operationType===5&&this._onGroupDismissed(a.payload.groupProfile.groupID),F||a.conversationType===C.CONV_SYSTEM||(fe=a.conversationID.replace(C.CONV_GROUP,""),this._pollingInstanceMap.has(fe)?this._grpM.isLoggedIn()&&m.addMessageSequence({key:sc,message:a}):(a.type!==C.MSG_GRP_TIP&&0<a.clientTime&&m.addMessageDelay(a.clientTime),m.addMessageSequence({key:za,message:a}))),l.push(a)))}else this.onRoomCustomData(ue);else this._get(34).onMessageReactionNotify({event:21,dataList:ue.elements.messageReactionNotifyList});else this.handleMessageRevokedNotice(ue)}else w.w("".concat(o,". unknown event:").concat(ue.event))}l.length!==0&&(0<(n=Vd(l)).length&&this._grpM.emitOuterEvent(R.MESSAGE_MODIFIED,n),F||0<(n=this.packConversationOption(l)).length&&h.onNewMessage({conversationOptionsList:n,isInstantMessage:!0}),this._checkMessageStacked(l),0<(n=Gd(l)).length&&this._grpM.emitOuterEvent(R.MESSAGE_RECEIVED,n),l.length=0)}}},{key:"handleMessageRevokedNotice",value:function(e){var n=this,o=e.groupID,a=e.elements.revokeMsgList,l=e.revokerInfo,h=[];a.forEach(function(F){var $=F.tinyID,M=F.clientTime,L=F.random,F=F.sequence,$={conversationID:"".concat(C.CONV_GROUP).concat(o),ID:"".concat($,"-").concat(M,"-").concat(L),revoker:l.revoker,revokeReason:l.reason||"",revokerInfo:{userID:l.revoker,nick:"",avatar:""},sequence:F};h.push($)}),h.length!==0&&this._get(11).updateRevokerInfo(h).then(function(m){n._grpM.emitOuterEvent(R.MESSAGE_REVOKED,m)})}},{key:"isBroadcastOrNormal",value:function(e){return e===3||e===17}},{key:"isGroupTip",value:function(e){return e===4||e===6}},{key:"isGroupSystemNotice",value:function(e){return e===5}},{key:"restoreGroupTipElements",value:function(){var e=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},l=e.operatorInfo,l=l===void 0?{}:l,h=e.operatorID,n=e.userIDList,n=n===void 0?[]:n,o=e.operationType,o=(qt(e.groupJoinType)||o!==1&&o!==2||(e.groupJoinType=o===2?0:1),l.userID),a=l.avatar,l=l.nick,h=(e.operatorInfo={userID:o===void 0?h:o,avatar:a===void 0?"":a,nick:l===void 0?"":l},n.map(function(m){return{userID:m}}));return e.memberInfoList=e.memberInfoList||h,e}},{key:"restoreMessageFromSimplified",value:function(e){var n,o,a,l=e.event;return this.isBroadcastOrNormal(l)&&(e.cloudCustomData=e.cloudCustomData||"",e.elements=e.elements.map(function(h){var m;return h.type===C.MSG_CUSTOM&&(m=h.content,h.content=u({data:"",description:"",extension:""},m===void 0?{}:m)),h})),(this.isGroupTip(l)||this.isGroupSystemNotice(l))&&(e.from=e.from||"@TIM#SYSTEM"),this.isGroupTip(l)&&(e.elements=this.restoreGroupTipElements(e.elements),o=(a=(a=e.elements)===void 0?{}:a).operationType,n=a.operatorInfo,o===1&&(o=[{userID:(n===void 0?{}:n).userID}],a.memberInfoList=a.memberInfoList||o)),this.isGroupSystemNotice(l)&&(a=(n=e.elements).memberInfoList,o=n.operatorInfo,e.elements.memberInfoList=u({userID:e.elements.operatorID,avatar:"",nick:""},a=a||(o===void 0?{}:o)),e.elements=u({authentication:"",remarkInfo:"",messageKey:1e3*e.time},e.elements),l=Object.keys(e.elements).filter(function(h){return h!=="operatorInfo"}).reduce(function(h,m){return u(u({},h),{},S({},m,e.elements[m]))},{}),e.elements=l),e}},{key:"_onGroupDismissed",value:function(e){w.l("".concat(this._n,"._onGroupDismissed groupID:").concat(e)),this._grpM.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:"_checkMessageStacked",value:function(o){var n="MessageStacked",o=o.length;100<=o&&(this._grpM.outputWarning(n,o),this._reportMessageStackedCount<5&&(new Be(n).setMessage("count:".concat(o," groupID:").concat(V(this._joinedGroupMap.keys()))).setLevel("warning").end(),this._reportMessageStackedCount+=1))}},{key:"_isMessageSentByCurrentInstance",value:function(e){return!!this._get(11).isMessageSentByCurrentInstance(e)}},{key:"packMessage",value:function(a,n){a.currentUser=this._grpM.getMyUserID(),a.conversationType=n===5?C.CONV_SYSTEM:C.CONV_GROUP,a.isSystemMessage=!!a.isSystemMessage;var o=new Yn(a),a=this.packElements(a,n);return o.setElement(a,this._grpM.getFileDownloadProxy()),o}},{key:"packElements",value:function(e,n){return n===4||n===6?(this._updateMemberCountByGroupTips(e),{type:C.MSG_GRP_TIP,content:u(u({},e.elements),{},{groupProfile:e.groupProfile})}):n===5?{type:C.MSG_GRP_SYS_NOTICE,content:u(u({},e.elements),{},{groupProfile:u(u({},e.groupProfile),{},{groupID:e.groupID})})}:e.elements}},{key:"packConversationOption",value:function(e){for(var n=new Map,o=0;o<e.length;o++){var a,l=e[o],h=l.conversationID;n.has(h)?((a=n.get(h)).lastMessage=l).flow==="in"&&a.unreadCount++:n.set(h,{conversationID:l.conversationID,unreadCount:l.flow==="out"?0:1,type:l.conversationType,subType:l.conversationSubType,lastMessage:l})}return V(n.values())}},{key:"_updateMemberCountByGroupTips",value:function(h){var n,o,a,l=h.groupProfile.groupID,h=h.elements.onlineMemberInfo,h=h===void 0?void 0:h;Je(h)||(n=(n=h.onlineMemberNum)===void 0?0:n,h=(h=h.expireTime)===void 0?this.DEFAULT_EXPIRE_TIME:h,o=this._onlineMemberCountMap.get(l)||{},a=Date.now(),Je(o)?Object.assign(o,{lastReqTime:0,lastSyncTime:0,latestUpdateTime:a,memberCount:n,expireTime:h}):(o.latestUpdateTime=a,o.memberCount=n),this._onlineMemberCountMap.set(l,o))}},{key:"_onBroadcastMessage",value:function(e){if(!Je(e)){for(var n=[],o=e.length,a=null,l=0;l<o;l++){var h=this.restoreMessageFromSimplified(e[l]);Ag[h.event]?((a=this.packMessage(h,h.event)).isBroadcastMessage=!0,this._broadcastMessageIDMap.has(a.ID)||(n.push(a),this._broadcastMessageIDMap.set(a.ID,1))):w.w("".concat(this._n,"._onBroadcastMessage unknown event:").concat(h.event))}0<n.length&&this._grpM.emitOuterEvent(R.MESSAGE_RECEIVED,n)}}},{key:"start",value:function(e){var n;this._pollingInstanceMap.has(e)?(n=this._pollingInstanceMap.get(e)).isRunning()||n.start():((n=new tv({manager:this,groupID:e,onInit:this._updatedata.bind(this),onSuccess:this._handleSuccess.bind(this),onFail:this._handleFailure.bind(this)})).start(),this._pollingInstanceMap.set(e,n),w.l("".concat(this._n,".start groupID:").concat(e)))}},{key:"handleJoinResult",value:function(e){var n=this;return this._preCheck(e.group).then(function(){var o=e.longPollingKey,a=e.group,l=a.groupID;return n._joinedGroupMap.set(l,a),n._grpM.updateGroupMap([a]),n._grpM.deleteUnjoinedAVChatRoom(l),n._grpM.emitGroupListUpdate(!0,!1),xe(o)?St({status:rn,group:a}):Promise.resolve()})}},{key:"startRunLoop",value:function(e){var n=this;return this.handleJoinResult(e).then(function(){var o=e.longPollingKey,a=e.group,l=e.startSeq,h=a.groupID;return n._pollingRequestInfoMap.set(h,{key:o,startSeq:l===void 0?0:l}),n.start(h),n._grpM.isLoggedIn()?St({status:rn,group:a}):St({status:rn})})}},{key:"_preCheck",value:function(o){if(this._get(12).isUnlimitedAVChatRoom()||!this.hasJoinedAVChatRoom()||o.type===C.GRP_LIVE)return Promise.resolve();var o=K(this._joinedGroupMap.entries().next().value,2),n=o[0],o=o[1];if(this._grpM.isLoggedIn()){if(o.selfInfo.role!==C.GRP_MBR_ROLE_OWNER&&o.ownerID!==this._grpM.getMyUserID())return this._grpM.quitGroup(n);this._grpM.deleteLocalGroupAndConversation(n)}else this._grpM.deleteLocalGroupAndConversation(n);return this.reset(n),Promise.resolve()}},{key:"joinWithoutAuth",value:function(e){var n=this,o=e.groupID,a="".concat(this._n,".").concat("joinWithoutAuth"),l=new Be("joinWithoutAuth");return this._grpM.req({proto:le.APPLY_JOIN_GRP_NOAUTH,data:e}).then(function(h){if(h=h.data.longPollingKey,l.setMessage("groupID:".concat(o," longPollingKey:").concat(h)).end(!0),xe(h))return Ce({code:we.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN});w.l("".concat(a," ok. groupID:").concat(o)),n._get(11).setCompleted("".concat(C.CONV_GROUP).concat(o));var m=new rr({groupID:o});return n.startRunLoop({group:m,longPollingKey:h}),ft({status:rn})}).catch(function(h){return w.e("".concat(a," failed. groupID:").concat(o," error:"),h),l.setError(h).setMessage("groupID:".concat(o)).end(!0),Ce(h)}).finally(function(){n._grpM.get(14).reportAtOnce()})}},{key:"getGroupOnlineMemberCount",value:function(e){var n=this._onlineMemberCountMap.get(e)||{},o=Date.now();return Je(n)||o-n.lastSyncTime>1e3*n.expireTime&&1e4<o-n.latestUpdateTime&&3e3<o-n.lastReqTime?(n.lastReqTime=o,this._onlineMemberCountMap.set(e,n),this._getGroupOnlineMemberCount(e).then(function(a){return ft({memberCount:a.memberCount})}).catch(function(a){return Ce(a)})):St({memberCount:n.memberCount})}},{key:"_getGroupOnlineMemberCount",value:function(e){var n=this,o="".concat(this._n,".").concat("_getGroupOnlineMemberCount"),a=new Be("_getGroupOnlineMemberCount");return this._grpM.requestOnlineCount(e).then(function(M){var h=n._onlineMemberCountMap.get(e)||{},M=M.data,m=M.memberCount,m=m===void 0?0:m,M=M.expireTime,M=M===void 0?n.DEFAULT_EXPIRE_TIME:M,L=(w.l("".concat(o," ok. groupID:").concat(e," memberCount:").concat(m," expireTime:").concat(M)),Date.now());return Je(h)&&(h.lastReqTime=L),n._onlineMemberCountMap.set(e,Object.assign(h,{lastSyncTime:L,latestUpdateTime:L,memberCount:m,expireTime:M})),{memberCount:m}}).catch(function(l){return w.w("".concat(o," failed. error:"),l),a.setCode(l.code).setMessage("groupID:".concat(e," error:").concat(JSON.stringify(l))).end(),Promise.reject(l)})}},{key:"_get",value:function(e){return this._grpM.get(e)}},{key:"setPollingInterval",value:function(e){xe(e)||(qt(e)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=e:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(e,10))}},{key:"setPollingIntervalPlus",value:function(e){xe(e)||(qt(e)?this.DEFAULT_POLLING_INTERVAL_PLUS=e:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(e,10))}},{key:"setPollingNoMessageCount",value:function(e){xe(e)||(qt(e)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=e:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(e,10))}},{key:"setPollingSimplifiedMessage",value:function(e){xe(e)||e!=="0"&&e!=="1"||(this.DEFAULT_POLLING_SIMPLIFIED_MSG=parseInt(e,10))}},{key:"getPollingInterval",value:function(){return this._pollingInterval}},{key:"onAVChatRoomMemberBanned",value:function(e){e=e.payload.groupProfile.groupID,w.l("".concat(this._n,".onAVChatRoomMemberBanned groupID:").concat(e)),this._grpM.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:"restartPolling",value:function(){w.l("".concat(this._n,".restartPolling count:").concat(this._pollingInstanceMap.size));var e,n=J(this._pollingInstanceMap.values());try{for(n.s();!(e=n.n()).done;){var o=e.value;o.stop(),o.start()}}catch(a){n.e(a)}finally{n.f()}}},{key:"getPollingTimerID",value:function(e){if(!this._pollingInstanceMap.has(e))return-1;var n=this._pollingInstanceMap.get(e).getPollingTimerID();return w.l("".concat(this._n,".getPollingTimerID groupID:").concat(e," timerID:").concat(n)),n}},{key:"hasPollingInstance",value:function(e){return this._pollingInstanceMap.has(e)}},{key:"onRoomCustomData",value:function(l){var n=l.groupID,o=l.sequence,a=l.time,l=l.elements,l=l&&l.content;this._get(30).onRoomCustomDataReceived(l),w.l("".concat(this._n,".onRoomCustomData groupID:").concat(n," sequence:").concat(o," time:").concat(a," data:").concat(l))}},{key:"reset",value:function(e){if(e){w.l("".concat(this._n,".reset groupID:").concat(e));var n=this._pollingInstanceMap.get(e);n&&n.stop(),this._pollingInstanceMap.delete(e),this._joinedGroupMap.delete(e),this._pollingRequestInfoMap.delete(e),this._onlineMemberCountMap.delete(e)}else{w.l("".concat(this._n,".reset all"));var o,a=J(this._pollingInstanceMap.values());try{for(a.s();!(o=a.n()).done;)o.value.stop()}catch(l){a.e(l)}finally{a.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this.sequencesLinkedList.reset(),this.messageIDLinkedList.reset(),this._reportMessageStackedCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=300,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0}}]),IA),ta=(y(vA,[{key:"updateMember",value:function(e){xe(e.onlineStatus)||(this.isOnline=e.onlineStatus==="Online");var n=[null,void 0,"",0,NaN];e.memberCustomField&&xa(this.memberCustomField,e.memberCustomField),Ji(this,e,["memberCustomField","marks","onlineStatus"],n)}},{key:"updateRole",value:function(e){["Owner","Admin","Member"].indexOf(e)<0||(this.role=e)}},{key:"updateMuteUntil",value:function(e){xe(e)||(this.muteUntil=Math.floor((Date.now()+1e3*e)/1e3))}},{key:"updateNameCard",value:function(e){xe(e)||(this.nameCard=e)}},{key:"updateMemberCustomField",value:function(e){e&&xa(this.memberCustomField,e)}}]),vA),hg=(y(_A,[{key:"_onProfileUpdated",value:function(e){for(var n=this,o=e.data,a=0;a<o.length;a++)(function(l){var h=o[l];n.groupMemberListMap.forEach(function(m){m.has(h.userID)&&m.get(h.userID).updateMember({nick:h.nick,avatar:h.avatar})})})(a)}},{key:"deleteGroupMemberList",value:function(e){this.groupMemberListMap.delete(e)}},{key:"getGroupMemberList",value:function(M){var n,o=this,a=M.groupID,l=M.role,l=l===void 0?void 0:l,ue=M.offset,h=ue===void 0?0:ue,ue=M.count,m=ue===void 0?15:ue,ue=M.filter,M=ue===void 0?void 0:ue,L="".concat(this._n,".").concat("getGroupMemberList"),ue=this._grpM.hasLocalGroup(a);if(w.l("".concat(L," groupID:").concat(a," role:").concat(l," offset:").concat(h," count:").concat(m," hasLocalGroup:").concat(ue)),!ue)return St({memberList:[],offset:0});if(this._grpM.getLocalGroupProfile(a).type===C.GRP_AVCHATROOM){if(this._grpM.canIUse(pe.AV_MBR_LIST))return this._getAVChatRoomMemberList({groupID:a,offset:h,filter:M});this._grpM.outputWarning("LiveOnlineMember")}l!==C.GRP_MBR_ROLE_ADMIN&&l!==C.GRP_MBR_ROLE_OWNER&&l!==C.GRP_MBR_ROLE_MEMBER||(n=l);var F=new Be("getGroupMemberList"),$=0,ue={groupID:a,limit:100<m?100:m,memberRoleFilter:n?[n]:void 0,memberInfoFilter:this.DEFAULT_MEMBER_INFO_FILTER},fe=(Ii({groupID:a})?ue.next="".concat(h):(ue.offset=h,$=h+m),[]);return this._grpM.req({proto:le.GET_GRP_MBR_LIST,data:ue}).then(function(Ye){var Ye=Ye.data,be=Ye.members,ze=Ye.memberNum,Ye=Ye.next,Ye=Ye===void 0?void 0:Ye;return xe(Ye)||($=Je(Ye)?0:Ye),At(be)&&be.length!==0?(o._grpM.hasLocalGroup(a)&&(o._grpM.getLocalGroupProfile(a).memberNum=ze),fe=o._updateLocalGroupMemberMap(a,be),o._grpM.get(4).getUserProfile({userIDList:be.map(function(Tt){return Tt.userID}),tagList:[gt.NICK,gt.AVATAR]})):($=0,Promise.resolve([]))}).then(function(he){return he=he.data,!At(he)||he.length===0?St({memberList:[],offset:$}):(he=he.map(function(be){return{userID:be.userID,nick:be.nick,avatar:be.avatar}}),o._updateLocalGroupMemberMap(a,he),fe.length<m&&($=0),F.setMessage("groupID:".concat(a," offset:").concat(h," count:").concat(m)).end(),w.l("".concat(L," ok.")),ft({memberList:fe,offset:$}))}).catch(function(he){return F.setError(he).end(),w.e("".concat(L," failed. error:"),he),Ce(he)})}},{key:"_getAVChatRoomMemberList",value:function(l){var n=this,o=l.groupID,a=l.offset,l=l.filter,h="".concat(this._n,".").concat("_getAVChatRoomMemberList"),m=new Be("_getAVChatRoomMemberList");return m.setMessage("groupID:".concat(o," offset:").concat(a," filter:").concat(l)),this._grpM.req({proto:le.GET_AV_MBR_LIST,data:{groupID:o,offset:a,filter:l}}).then(function(L){var L=L.data,F=L.memberList,F=F===void 0?[]:F,L=L.offset,L=L===void 0?0:L,F=(m.end(),w.l("".concat(h," ok. member count:").concat(F.length,", next request timestamp:").concat(L)),F.map(function($){return u(u({},$),{},{onlineStatus:"Online"})})),F=n._updateLocalGroupMemberMap(o,F);return ft({memberList:F,offset:L})}).catch(function(M){return m.setError(M).end(),w.e("".concat(h," failed. error:"),M),Ce(M)})}},{key:"getGroupMemberProfile",value:function(e){var n=this,o="getGroupMemberProfile",m="".concat(this._n,".").concat(o),a="groupID:".concat(e.groupID),l=(5<e.userIDList.length?a+=" userIDList.length:".concat(e.userIDList.length):a+=" userIDList:".concat(e.userIDList),w.l("".concat(m," ").concat(a)),50<e.userIDList.length&&(e.userIDList=e.userIDList.slice(0,50)),e.groupID),h=e.userIDList,m=this._grpM.getLocalGroupProfile(l);if(m&&pi(m.type))return Ce({code:m=we.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM,message:this._grpM.getErrorMessage(m,o)});var M=new Be(o);return M.setMessage(a),this._getGroupMemberProfileAdvance(u(u({},e),{},{userIDList:h})).then(function(L){return L=L.data.members,At(L)&&L.length!==0?(n._updateLocalGroupMemberMap(l,L),n._grpM.get(4).getUserProfile({userIDList:L.map(function(F){return F.userID}),tagList:[gt.NICK,gt.AVATAR]})):St([])}).then(function(L){return L=L.data.map(function(F){return{userID:F.userID,nick:F.nick,avatar:F.avatar}}),n._updateLocalGroupMemberMap(l,L),L=h.filter(function(F){return n.hasLocalGroupMember(l,F)}).map(function(F){return n.getLocalGroupMemberInfo(l,F)}),M.end(),ft({memberList:L})})}},{key:"addGroupMember",value:function(e){var n=this,o="".concat(this._n,".").concat("addGroupMember"),a=e.groupID,l=this._grpM.getLocalGroupProfile(a),h=l.type,m=new Be("addGroupMember");return m.setMessage("groupID:".concat(a," groupType:").concat(h)),pi(h)?(h=new ln({code:we.CANNOT_ADD_MEMBER_IN_AVCHATROOM}),m.setError(h).end(),Ce(h)):(e.userIDList=e.userIDList.map(function(M){return{userID:M}}),w.l("".concat(o," groupID:").concat(a)),this._grpM.req({proto:le.ADD_GRP_MBR,data:e}).then(function(ue){var ue=ue.data.members,L=(w.l("".concat(o," ok")),ue.filter(function(he){return he.result===1}).map(function(he){return he.userID})),F=ue.filter(function(he){return he.result===0}).map(function(he){return he.userID}),$=ue.filter(function(he){return he.result===2}).map(function(he){return he.userID}),ue=ue.filter(function(he){return he.result===4}).map(function(he){return he.userID}),fe="groupID:".concat(e.groupID,", ")+"successUserIDList:".concat(L,", ")+"failureUserIDList:".concat(F,", ")+"existedUserIDList:".concat($,", ")+"overLimitUserIDList:".concat(ue);return m.setMoreMessage(fe).end(),L.length===0?ft({successUserIDList:L,failureUserIDList:F,existedUserIDList:$,overLimitUserIDList:ue}):(n._updateConversationGroupProfile(l),ft({successUserIDList:L,failureUserIDList:F,existedUserIDList:$,overLimitUserIDList:ue,group:l}))}).catch(function(M){return m.setError(M).end(),w.e("".concat(o," failed. error:"),M),Ce(M)}))}},{key:"deleteGroupMember",value:function(e){var n=this,o="".concat(this._n,".").concat("deleteGroupMember"),a=e.groupID,l=e.userIDList,h=this._grpM.getLocalGroupProfile(a);if(xe(h))return Ce({code:we.CANNOT_FIND_GRP});if(pi(h.type))return this._grpM.canIUse(pe.AV_BAN_MBR)?this._banAVChatRoomMember(e):this._grpM.cannotUseCommercialAbility("deleteGroupMember");var m="groupID:".concat(a," ").concat(5<l.length?"userIDList.length:".concat(l.length):"userIDList:".concat(l)),M=(w.l("".concat(o," groupID:").concat(a," userIDList:"),l),new Be("deleteGroupMember"));return M.setMessage(m),this._grpM.req({proto:le.DEL_GRP_MBR,data:e}).then(function(){return M.end(),w.l("".concat(o," ok")),n._updateConversationGroupProfile(h),n.deleteLocalGroupMembers(a,l),ft({group:h,userIDList:l})}).catch(function(L){return M.setError(L).end(),w.e("".concat(o," failed. error:"),L),Ce(L)})}},{key:"_updateConversationGroupProfile",value:function(e){this._grpM.get(11).updateConversationGroupProfile([e])}},{key:"_banAVChatRoomMember",value:function(e){var n=this,o="".concat(this._n,".").concat("_banAVChatRoomMember"),a=e.groupID,l=e.userIDList,h="groupID:".concat(a," ").concat(5<l.length?"userIDList.length:".concat(l.length):"userIDList:".concat(l)),m=new Be("_banAVChatRoomMember"),M=(m.setMessage(h),w.l("".concat(o," groupID:").concat(a," userIDList:"),l),this._grpM.getLocalGroupProfile(a));return xe(e.duration)||e.duration===0?Ce({code:we.BAN_DURATION_INVALID}):this._grpM.req({proto:le.BAN_AV_MBR,data:e}).then(function(){return m.end(),w.l("".concat(o," ok")),n.deleteLocalGroupMembers(a,l),ft({group:M,userIDList:l})}).catch(function(L){return m.setError(L).end(),w.e("".concat(o," failed. error:"),L),Ce(L)})}},{key:"setGroupMemberMuteTime",value:function(l){var n=this,o=l.groupID,a=l.userID,l=l.muteTime,h="".concat(this._n,".").concat("setGroupMemberMuteTime");if(a===this._grpM.getMyUserID())return Ce({code:we.CANNOT_MUTE_SELF});var m="groupID:".concat(o," userID:").concat(a," muteTime:").concat(l),M=(w.l("".concat(h," ").concat(m)),new Be("setGroupMemberMuteTime"));return M.setMessage(m),this.modifyGroupMemberInfo({groupID:o,userID:a,muteTime:l}).then(function(L){M.end(),w.l("".concat(h," ok"));var F=n._grpM.getLocalGroupProfile(o);return ft({group:F,member:L})}).catch(function(L){return M.setError(L).end(),w.e("".concat(h," failed. error:"),L),Ce(L)})}},{key:"setGroupMemberRole",value:function(l){var n="".concat(this._n,".").concat("setGroupMemberRole"),o=l.groupID,a=l.userID,l=l.role,h="groupID:".concat(o," userID:").concat(a," role:").concat(l),m=this._grpM.getLocalGroupProfile(o);if(!m||m.type===C.GRP_WORK||m.type===C.GRP_AVCHATROOM)return Ce({code:we.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM});if(m&&m.selfInfo.role!==C.GRP_MBR_ROLE_OWNER)return Ce({code:we.NOT_OWNER});var M=[C.GRP_MBR_ROLE_ADMIN,C.GRP_MBR_ROLE_MEMBER];if(Ii({groupID:o})&&M.push(C.GRP_MBR_ROLE_CUSTOM),M.indexOf(l)<0)return Ce({code:we.INVALID_MEMBER_ROLE});if(a===this._grpM.getMyUserID())return Ce({code:we.CANNOT_SET_SELF_MEMBER_ROLE});var L=new Be("setGroupMemberRole");return L.setMessage(h),w.l("".concat(n," ").concat(h)),this.modifyGroupMemberInfo({groupID:o,userID:a,role:l}).then(function(F){return L.end(),w.l("".concat(n," ok")),ft({group:m,member:F})}).catch(function(F){return L.setError(F).end(),w.e("".concat(n," failed. error:"),F),Ce(F)})}},{key:"_filterProfanity",value:function(e,n){var a=this._grpM.get(29);if(!a)return!0;var a=a.filterText(n[e],"group_member_profile"),o=a.isAllowedToSend,a=a.modifiedText;return o===!0&&(n[e]=a,!0)}},{key:"setGroupMemberNameCard",value:function(L){var n=this,o="setGroupMemberNameCard",a="".concat(this._n,".").concat(o);if(L.nameCard&&this._filterProfanity("nameCard",L)===!1)return Ce({code:we.PROFANITY_FOUND});var l=L.groupID,M=L.userID,h=M===void 0?this._grpM.getMyUserID():M,m=L.nameCard,M="groupID:".concat(l," userID:").concat(h," nameCard:").concat(m),L=(w.l("".concat(a," ").concat(M)),this._grpM.getLocalGroupProfile(l));if(L&&pi(L.type))return Ce({code:L=we.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM,message:this._grpM.getErrorMessage(L,o)});var F=new Be(o);return F.setMessage(M),this.modifyGroupMemberInfo({groupID:l,userID:h,nameCard:m}).then(function($){w.l("".concat(a," ok")),F.end();var ue=n._grpM.getLocalGroupProfile(l);return h===n._grpM.getMyUserID()&&ue&&ue.setSelfNameCard(m),ft({group:ue,member:$})}).catch(function($){return F.setError($).end(),w.e("".concat(a," failed. error:"),$),Ce($)})}},{key:"setGroupMemberCustomField",value:function(m){var n=this,o="setGroupMemberCustomField",a="".concat(this._n,".").concat(o),l=m.groupID,h=m.userID,h=h===void 0?this._grpM.getMyUserID():h,m=m.memberCustomField,M="groupID:".concat(l," userID:").concat(h," memberCustomField:").concat(JSON.stringify(m)),L=(w.l("".concat(a," ").concat(M)),this._grpM.getLocalGroupProfile(l));if(L&&pi(L.type))return Ce({code:L=we.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM,message:this._grpM.getErrorMessage(L,o)});var F=new Be(o);return F.setMessage(M),this.modifyGroupMemberInfo({groupID:l,userID:h,memberCustomField:m}).then(function($){F.end(),w.l("".concat(a," ok"));var ue=n._grpM.getLocalGroupProfile(l);return ft({group:ue,member:$})}).catch(function($){return F.setError($).end(),w.e("".concat(a," failed. error:"),$),Ce($)})}},{key:"modifyGroupMemberInfo",value:function(e){var n=this,o=e.groupID,a=e.userID,l=void 0;return Bn(o)&&(o=Wn(l=o)),this._grpM.req({proto:le.MODIFY_GRP_MBR_INFO,data:u(u({},e),{},{groupID:o,topicID:l})}).then(function(){if(n.hasLocalGroupMember(o,a))return h=n.getLocalGroupMemberInfo(o,a),xe(e.muteTime)||h.updateMuteUntil(e.muteTime),xe(e.role)||h.updateRole(e.role),xe(e.nameCard)||h.updateNameCard(e.nameCard),xe(e.memberCustomField)||h.updateMemberCustomField(e.memberCustomField),h;var h=n._grpM.getLocalGroupProfile(o);return h&&!pi(h.type)?n.getGroupMemberProfile({groupID:o,userIDList:[a]}).then(function(m){return K(m.data.memberList,1)[0]}):void 0})}},{key:"markGroupMemberList",value:function(h){var n="".concat(this._n,".").concat("markGroupMemberList"),o=h.groupID,a=h.markType,L=h.enableMark,h=h.userIDList,l=h===void 0?[]:h,h="groupID:".concat(o," markType:").concat(a," enableMark:").concat(L," userIDList count:").concat(l.length),m=(w.l("".concat(n," ").concat(h)),2),M=[],L=(L===!0&&(m=1),V(l)),F=(500<l.length&&(L=l.slice(0,500),w.w("".concat(n," ").concat(Zr(500)))),L.forEach(function($){M.push({userID:$,markType:[a]})}),L=null,new Be("markGroupMemberList"));return F.setMessage(h),this._grpM.req({proto:le.MARK_AV_MBR_INFO,data:{groupID:o,operationType:m,memberList:M}}).then(function(he){var he=he.data.memberList,he=he===void 0?[]:he,ue=[],fe=[],he=(he.length===l.length?ue.push.apply(ue,V(l)):(he.forEach(function(be){ue.push(be.userID)}),l.forEach(function(be){ue.includes(be)||fe.push(be)})),"success count:".concat(ue.length," fail count:").concat(fe.length));return F.setMessage(he).end(),w.l("".concat(n," ok. ").concat(he)),ft({successUserIDList:ue,failureUserIDList:fe})}).catch(function($){return F.setError($).end(),w.e("".concat(n," failed. error:"),$),Ce($)})}},{key:"_getGroupMemberProfileAdvance",value:function(e){return this._grpM.req({proto:le.GET_GRP_MBR_PROFILE,data:u(u({},e),{},{memberInfoFilter:e.memberInfoFilter||this.DEFAULT_MEMBER_INFO_FILTER})})}},{key:"_updateLocalGroupMemberMap",value:function(e,n){var o=this;return At(n)&&n.length!==0?n.map(function(a){return o.hasLocalGroupMember(e,a.userID)?o.getLocalGroupMemberInfo(e,a.userID).updateMember(a):o.setLocalGroupMember(e,new ta(a)),o.getLocalGroupMemberInfo(e,a.userID)}):[]}},{key:"deleteLocalGroupMembers",value:function(e,n){var o=this.groupMemberListMap.get(e);o&&n.forEach(function(a){o.delete(a)})}},{key:"getLocalGroupMemberInfo",value:function(e,n){return this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).get(n):null}},{key:"setLocalGroupMember",value:function(e,n){this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).set(n.userID,n):(n=new Map().set(n.userID,n),this.groupMemberListMap.set(e,n))}},{key:"getLocalGroupMemberList",value:function(e){return this.groupMemberListMap.get(e)}},{key:"hasLocalGroupMember",value:function(e,n){return this.groupMemberListMap.has(e)&&this.groupMemberListMap.get(e).has(n)}},{key:"hasLocalGroupMemberMap",value:function(e){return this.groupMemberListMap.has(e)}},{key:"reset",value:function(){this.groupMemberListMap.clear()}}]),_A),pg=(y(mA,[{key:"onNewGroupSystemNotice",value:function(o){var l=o.dataList,n=o.isSyncingEnded,o=o.isInstantMessage,l=(w.d("".concat(this._n,".onReceiveSystemNotice count:").concat(l.length)),this.newSystemNoticeStoredAndSummary({notifiesList:l,isInstantMessage:o})),a=l.eventDataList,l=l.result;0<a.length&&(this._grpM.get(11).onNewMessage({conversationOptionsList:a,isInstantMessage:o}),this._onReceivedGroupSystemNotice({result:l,isInstantMessage:o})),o?0<l.length&&this._grpM.emitOuterEvent(R.MESSAGE_RECEIVED,l):n===!0&&this._clearGroupSystemNotice()}},{key:"newSystemNoticeStoredAndSummary",value:function(e){for(var n=e.notifiesList,o=e.isInstantMessage,a=null,l=n.length,M=0,h=[],m={conversationID:C.CONV_SYSTEM,unreadCount:0,type:C.CONV_SYSTEM,subType:null,lastMessage:null},M=0;M<l;M++){var L=n[M],$=L.groupProfile,F=$.communityType,$=$.topicID,$=$===void 0?void 0:$,fe=L.elements,ue=fe.topicIDList,ue=ue===void 0?void 0:ue,fe=fe.operationType;if(!((F===void 0?0:F)!==2||Je($)&&Je(ue))){if([17,18,20].includes(fe)){this._handleTopicSystemNotice(L);continue}Je($)||(L.to=$)}L.elements.operationType!==15&&(L.currentUser=this._grpM.getMyUserID(),L.conversationType=C.CONV_SYSTEM,L.conversationID=C.CONV_SYSTEM,(a=new Yn(L)).setElement({type:C.MSG_GRP_SYS_NOTICE,content:u(u({},L.elements),{},{groupProfile:u({},L.groupProfile)})}),a.isSystemMessage=!0,(a.sequence===1&&a.random===1||a.sequence===2&&a.random===2)&&(a.sequence=Mi(),a.random=Mi(),a.generateMessageID(),w.l("".concat(this._n,".newSystemNoticeStoredAndSummary sequence and random maybe duplicated, regenerate. ID:").concat(a.ID))),this._grpM.get(11).pushIntoNoticeResult(h,a)&&(o?m.unreadCount++:a.setIsRead(!0),m.subType=a.conversationSubType))}return m.lastMessage=h[h.length-1],{eventDataList:0<h.length?[m]:[],result:h}}},{key:"_clearGroupSystemNotice",value:function(){var e=this;this._getPendencyList().then(function(o){o.forEach(function(l){e.pendencyMap.set("".concat(l.from,"_").concat(l.groupID,"_").concat(l.to),l)});var o=e._grpM.get(11).getLocalMessageList(C.CONV_SYSTEM),a=[];o.forEach(function(l){var M=l.payload,h=M.operatorID,m=M.operationType,M=M.groupProfile;m===1&&(m="".concat(h,"_").concat(M.groupID,"_").concat(M.to),(h=e.pendencyMap.get(m))&&qt(h.handled)&&h.handled!==0&&a.push(l))}),e.deleteGroupSystemNotice({messageList:a})})}},{key:"deleteGroupSystemNotice",value:function(e){var n=this,o="".concat(this._n,".deleteGroupSystemNotice");return At(e.messageList)&&e.messageList.length!==0?(w.l("".concat(o," ")+e.messageList.map(function(a){return a.ID})),this._grpM.req({proto:le.DEL_GRP_SYSTEM_NOTICE,data:{messageListToDelete:e.messageList.map(function(a){return{from:C.CONV_SYSTEM,messageSeq:a.clientSequence,messageRandom:a.random}})}}).then(function(){w.l("".concat(o," ok"));var a=n._grpM.get(11);return e.messageList.forEach(function(l){a.deleteLocalMessage(l)}),ft()}).catch(function(a){return w.e("".concat(o," error:"),a),Ce(a)})):St()}},{key:"_getPendencyList",value:function(){var e=this,a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},n=a.type,o=a.startTime,a=a.limit;return this._grpM.req({proto:le.GET_GRP_PENDENCY,data:{type:n===void 0?void 0:n,startTime:o===void 0?0:o,limit:a===void 0?20:a,handleAccount:this._grpM.getMyUserID()}}).then(function(l){var h=l.data.pendencyList;return l.data.nextStartTime!==0?e._getPendencyList({startTime:l.data.nextStartTime}).then(function(m){return[].concat(V(h),V(m))}):h})}},{key:"getGroupApplicationList",value:function(){var e=this;return this._getPendencyList().then(function(n){return e._getPendencyList({type:C.GRP_COMMUNITY}).then(function(o){return n.push.apply(n,V(o)),e._handlePendencyResult(n)}).catch(function(o){return e._handlePendencyResult(n)})})}},{key:"_handlePendencyResult",value:function(e){var n=this,o=[];return e.forEach(function(a){n.pendencyMap.set("".concat(a.from,"_").concat(a.groupID,"_").concat(a.to),a),a.handled===0&&o.push({applicant:a.from,applicantNick:a.fromUserNickName,groupName:a.groupName,groupID:a.groupID,authentication:a.authentication,messageKey:a.time,applicationType:a.applicationType,userID:a.userID,note:a.note})}),St({applicationList:o})}},{key:"_onReceivedGroupSystemNotice",value:function(e){var n=this,o=e.result;e.isInstantMessage&&o.forEach(function(a){switch(a.payload.operationType){case 1:break;case 2:n._onApplyJoinGroup(a);break;case 3:break;case 4:n._onMemberKicked(a);break;case 5:n._onGroupDismissed(a);break;case 6:break;case 7:n._onInviteGroup(a);break;case 8:n._onQuitGroup(a);break;case 9:n._onSetManager(a);break;case 10:n._onDeleteManager(a);break;case 11:case 12:case 15:break;case 20:n._onMessageRemindTypeSynced(a);break;case 21:n._grpM.onAVChatRoomMemberBanned(a)}})}},{key:"_onApplyJoinGroup",value:function(a){var n=this,a=a.payload.groupProfile,o=a.groupID,a=a.groupType,l=this._grpM.hasLocalGroup(o);w.l("".concat(this._n,"._onApplyJoinGroup groupID:").concat(o," groupType:").concat(a," hasGroup:").concat(l)),l||pi(a)||this._grpM.getGroupProfile({groupID:o}).then(function(m){var m=m.data.group;m&&(n._grpM.updateGroupMap([m]),m=!m.isSupportTopic,n._grpM.emitGroupListUpdate(!0,m))})}},{key:"_onMemberKicked",value:function(e){e=e.payload.groupProfile.groupID,this._grpM.hasLocalGroup(e)&&this._grpM.deleteLocalGroupAndConversation(e)}},{key:"_onGroupDismissed",value:function(n){var n=n.payload.groupProfile.groupID,o=(this._grpM.hasLocalGroup(n)&&this._grpM.deleteLocalGroupAndConversation(n),this._grpM._AVChatRoomHandler);o&&o.checkJoinedAVChatRoomByID(n)&&o.reset(n)}},{key:"_onInviteGroup",value:function(o){var n=this,o=o.payload.groupProfile.groupID;this._grpM.hasLocalGroup(o)||this._grpM.getGroupProfile({groupID:o}).then(function(a){a=a.data.group,a&&(n._grpM.updateGroupMap([a]),n._grpM.emitGroupListUpdate())})}},{key:"_onQuitGroup",value:function(o){var o=o.payload.groupProfile,n=o.groupID,o=o.groupType,a=this._grpM.hasLocalGroup(n);w.l("".concat(this._n,"._onQuitGroup groupID:").concat(n," groupType:").concat(o," hasGroup:").concat(a)),a&&this._grpM.deleteLocalGroupAndConversation(n)}},{key:"_onSetManager",value:function(o){var o=o.payload.groupProfile,n=o.to,o=o.groupID,o=this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(o,n);o&&o.updateRole(C.GRP_MBR_ROLE_ADMIN)}},{key:"_onDeleteManager",value:function(o){var o=o.payload.groupProfile,n=o.to,o=o.groupID,o=this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(o,n);o&&o.updateRole(C.GRP_MBR_ROLE_MEMBER)}},{key:"_onMessageRemindTypeSynced",value:function(o){var n=o.payload.groupProfile.groupID,o=o.payload.messageRemindType;this._grpM.get(11).onGroupMessageRemindTypeUpdated({groupID:n,messageRemindType:o})}},{key:"_handleTopicSystemNotice",value:function(h){var o=h.groupProfile,n=o.groupID,o=o.topicID,h=h.elements,a=h.operationType,l=h.topicIDList,h=h.messageRemindType,m=this._grpM.get(10);a===17?m.onTopicCreated({groupID:n,topicID:o}):a===18?m.onTopicDeleted({groupID:n,topicIDList:l}):a===20&&m.onTopicMessageRemindTypeUpdated({groupID:n,topicID:o,messageRemindType:h})}},{key:"reset",value:function(){this.pendencyMap.clear()}}]),mA),nv=["relayFlag"],iv=(E(vc,Pn),lg=B(vc),y(vc,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("polling_interval"),n=this.getCloudConfig("polling_interval_plus"),o=this.getCloudConfig("polling_no_msg_count"),a=this.getCloudConfig("polling_simplified_msg"),l=this.getCloudConfig("paging_grp_count");w.l("".concat(this._n,"._onCloudConfigUpdated pollingInterval:").concat(e)+" pollingIntervalPlus:".concat(n," pollingNoMessageCount:").concat(o)+" pollingSimplifiedMessage:".concat(a," pagingGroupCount:").concat(l)),this._AVChatRoomHandler.setPollingInterval(e),this._AVChatRoomHandler.setPollingIntervalPlus(n),this._AVChatRoomHandler.setPollingNoMessageCount(o),this._AVChatRoomHandler.setPollingSimplifiedMessage(a),this._commonGroupHandler.setPagingGroupCount(l)}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(e),this._groupTipsHandler.onCheckTimer(e))}},{key:"guardForAVChatRoom",value:function(e){var n,o=this;return e.conversationType===C.CONV_GROUP?(n=Bn(e.to)?Wn(e.to):e.to,this.hasLocalGroup(n)?St():this.getGroupProfile({groupID:n}).then(function(l){var l=l.data.group.type;return w.l("".concat(o._n,".guardForAVChatRoom. groupID:").concat(n," type:").concat(l)),l===C.GRP_AVCHATROOM?Ce(new ln({code:l=we.MSG_SEND_FAIL_NOT_IN_AVCHATROOM,message:o.getErrorMessage(l,e.from,n),data:{message:e}})):St()})):St()}},{key:"checkJoinedAVChatRoomByID",value:function(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"onNewGroupMessage",value:function(e){this._commonGroupHandler.onNewGroupMessage(e)}},{key:"updateNextMessageSeq",value:function(e){var n,o=this;At(e)&&(n=this.get(10),e.forEach(function(a){var l=a.conversationID.replace(C.CONV_GROUP,"");Bn(l)&&n.updateLastMessage(l,a.lastMessage),o.groupMap.has(l)&&(o.groupMap.get(l).nextMessageSeq=a.lastMessage.sequence+1)}))}},{key:"onNewGroupTips",value:function(e){this._groupTipsHandler.onNewGroupTips(e)}},{key:"onGroupMessageRevoked",value:function(e){this._commonGroupHandler.onGroupMessageRevoked(e)}},{key:"onNewGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler.onNewGroupSystemNotice(e)}},{key:"onGroupMessageReadNotice",value:function(e){var n=this;e.dataList.forEach(function(l){var a,l=l.elements.groupMessageReadNotice;xe(l)||(a=n.get(11),l.forEach(function(M){var L=M.groupID,m=M.topicID,m=m===void 0?void 0:m,M=M.lastMessageSeq,L=(w.d("".concat(n._n,".onGroupMessageReadNotice groupID:").concat(L," lastMessageSeq:").concat(M)),"".concat(C.CONV_GROUP).concat(L)),F=!0;Je(m)||(L="".concat(C.CONV_GROUP).concat(m),F=!1),a.updateIsReadAfterReadReport({conversationID:L,lastMessageSeq:M}),a.updateUnreadCount(L,F),a.clearGroupAtInfoList(L,F)}))})}},{key:"onReadReceiptList",value:function(e){var n=this;w.d("".concat(this._n,".onReadReceiptList options:"),JSON.stringify(e)),e.dataList.forEach(function(h){var a=h.groupProfile,h=h.elements,a=a.groupID,l=n.get(11),h=h.readReceiptList;l.updateReadReceiptInfo({groupID:a,readReceiptList:h})})}},{key:"onGroupMessageModified",value:function(e){w.d("".concat(this._n,".onGroupMessageModified options:"),JSON.stringify(e));var n=this.get(11);e.dataList.forEach(function(o){n.onMessageModified(u(u({},o),{},{conversationType:C.CONV_GROUP,to:o.topicID||o.groupID}))})}},{key:"deleteGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler.deleteGroupSystemNotice(e)}},{key:"initGroupMap",value:function(e){this.groupMap.set(e.groupID,new rr(e))}},{key:"clearGroupMap",value:function(){this.groupMap.clear()}},{key:"deleteGroup",value:function(e){this.groupMap.delete(e)}},{key:"updateGroupMap",value:function(e){var n,o=this,a=this.get(11);e.forEach(function(L){n=L.groupID,o.groupMap.has(n)?o.groupMap.get(n).updateGroup(L):(o.groupMap.set(n,new rr(L)),a.deleteGroupRoamingMessageInfo(n))});var l,h=this.getMyUserID(),m=J(this.groupMap);try{for(m.s();!(l=m.n()).done;){var M=K(l.value,2)[1];M.selfInfo.userID=h,M.selfInfo.role==="Owner"&&(M.ownerID=h)}}catch(L){m.e(L)}finally{m.f()}}},{key:"getGroupMap",value:function(){return this.groupMap}},{key:"getLocalGroupList",value:function(){return V(this.groupMap.values()).filter(function(e){return e.type!==C.GRP_ROOM&&e.type!==C.GRP_LIVE})}},{key:"getLocalGroupProfile",value:function(e){return this.groupMap.get(e)}},{key:"sortLocalGroupList",value:function(){var e=V(this.groupMap).filter(function(n){return n=K(n,2),n[0],!Je(n[1].lastMessage)});e.sort(function(n,o){return o[1].lastMessage.lastTime-n[1].lastMessage.lastTime}),this.groupMap=new Map(V(e))}},{key:"updateGroupLastMessage",value:function(e){this._commonGroupHandler.handleUpdateGroupLastMessage(e)}},{key:"emitGroupListUpdate",value:function(){var e=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],n=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1],o=this.getLocalGroupList();e&&this.emitOuterEvent(R.GROUP_LIST_UPDATED),n&&(e=JSON.parse(JSON.stringify(o)),this.get(11).updateConversationGroupProfile(e))}},{key:"getMyNameCardByGroupID",value:function(e){return e=this.getLocalGroupProfile(e),e?e.selfInfo.nameCard:""}},{key:"isPagingGetCompleted",value:function(){return this._commonGroupHandler.isPagingGetCompleted()}},{key:"getMessageRemindType",value:function(e){var n=this;!At(e)||e.length===0||(e=e.filter(function(o){return!pi(n.getLocalGroupProfile(o).type)})).length!==0&&(w.l("".concat(this._n,".getMessageRemindType groupIDList:").concat(e)),this.getGroupProfileAdvance({groupIDList:e,responseFilter:{memberInfoFilter:["MsgFlag"]}}).then(function(a){var a=a.data.successGroupList,l=n.get(11);a.forEach(function(h){l.onGroupMessageRemindTypeUpdated({groupID:h.groupID,messageRemindType:At(h.members)?h.members[0].messageRemindType:""})})}))}},{key:"getGroupList",value:function(){return this._commonGroupHandler.getGroupList()}},{key:"syncCommunityWithTopic",value:function(){return this._commonGroupHandler.syncGroupList(!0)}},{key:"getGroupProfile",value:function(e){var n=this,o="".concat(this._n,".").concat("getGroupProfile"),a=new Be("getGroupProfile"),l=e.groupID,h=e.groupCustomFieldFilter;return w.l("".concat(o," groupID:").concat(l)),this.getGroupProfileAdvance({groupIDList:[l],responseFilter:{groupBaseInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember","InviteJoinOption"],groupCustomFieldFilter:h,memberInfoFilter:["Role","JoinTime","MsgSeq","MsgFlag","NameCard"]}}).then(function(L){var L=L.data,M=L.successGroupList,L=L.failureGroupList;return w.l("".concat(o," ok")),0<L.length?Ce(L[0]):((L=pi(M[0].type)&&!n.hasLocalGroup(l)?new rr(M[0]):(n.updateGroupMap(M),n.getLocalGroupProfile(l))).isSupportTopic||n.get(11).updateConversationGroupProfile([L]),a.setMessage("groupID:".concat(l," type:").concat(L.type," muteAllMembers:").concat(L.muteAllMembers," ownerID:").concat(L.ownerID)).end(),ft({group:L}))}).catch(function(m){return a.setError(m).setMessage("groupID:".concat(e.groupID)).end(),w.e("".concat(o," failed. error:"),m),Ce(m)})}},{key:"getGroupProfileAdvance",value:function(e){var n,o="".concat(this._n,".getGroupProfileAdvance"),h=e.groupIDList,a=(At(h)&&50<h.length&&(this.outputWarning("GetGroupProfileLimit"),h.length=50),[]),l=[],h=(h.forEach(function(m){(Ii({groupID:m})?l:a).push(m)}),[]);return 0<a.length&&(n=this._getGroupProfileAdvance(u(u({},e),{},{groupIDList:a})),h.push(n)),0<l.length&&(n=this._getGroupProfileAdvance(u(u({},e),{},{groupIDList:l,relayFlag:0<a.length})),h.push(n)),Promise.all(h).then(function(m){var M=[],L=[];return m.forEach(function(F){M.push.apply(M,V(F.successGroupList)),L.push.apply(L,V(F.failureGroupList))}),ft({successGroupList:M,failureGroupList:L})}).catch(function(m){return w.e("".concat(o," failed. error:"),m),Ce(m)})}},{key:"_getGroupProfileAdvance",value:function(e){var n=this,o=e.relayFlag,a=o!==void 0&&o,l=b(e,nv);return this.req({proto:le.GET_GRP_PROFILE,data:l}).then(function(h){return w.l("".concat(n._n,"._getGroupProfileAdvance ok. options:"),l),h=h.data.groups,{successGroupList:h.filter(function(m){return xe(m.errorCode)||m.errorCode===0}),failureGroupList:h.filter(function(m){return m.errorCode&&m.errorCode!==0}).map(function(m){return new ln({code:m.errorCode,message:m.errorInfo,data:{groupID:m.groupID}})})}}).catch(function(h){return a&&Ii({groupID:e.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Ce(h)})}},{key:"createGroup",value:function(e){var n=this,o=[C.GRP_PUBLIC,C.GRP_WORK,C.GRP_MEETING,C.GRP_AVCHATROOM,C.GRP_COMMUNITY],a="".concat(this._n,".").concat("createGroup"),l=e.type,h=e.groupID;if(e.name&&this._filterProfanity("name",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(e.introduction&&this._filterProfanity("introduction",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(e.notification&&this._filterProfanity("notification",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(!o.includes(l))return Ce({code:we.ILLEGAL_GRP_TYPE});if(!Ii({type:l})){if(!Je(h)&&Ii({groupID:h}))return Ce({code:we.ILLEGAL_GRP_ID});e.isSupportTopic=void 0}if(pi(l)&&!xe(e.memberList)&&0<e.memberList.length&&(e.memberList=void 0),this._canIUseJoinOption(l)||xe(e.joinOption)||(e.joinOption=void 0),Ii({type:l})){if(!Je(h)&&!Ii({groupID:h}))return Ce({code:we.ILLEGAL_GRP_ID});e.isSupportTopic=e.isSupportTopic===!0?1:0}var m=new Be("createGroup"),M=(w.l("".concat(a," options:"),e),null),L=[];return this.req({proto:le.CREATE_GRP,data:u(u({},e),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then(function(fe){var fe=fe.data,$=fe.groupID,fe=fe.overLimitUserIDList,ue=fe===void 0?[]:fe,fe=(M=$,L=ue,"groupType:".concat(e.type," groupID:").concat($," overLimitUserIDList:").concat(ue));if(m.setMessage(fe).end(),w.l("".concat(a," ok. ").concat(fe)),e.type===C.GRP_AVCHATROOM)return n.getGroupProfile({groupID:$});if(e.type===C.GRP_COMMUNITY&&e.isSupportTopic===1)return n.getGroupProfile({groupID:$});Je(e.memberList)||Je(ue)||(e.memberList=e.memberList.filter(function(Ye){return ue.indexOf(Ye.userID)===-1})),n.updateGroupMap([u(u({},e),{},{groupID:$})]);var fe=n.get(2),ze="",he=0,be=(e.type===C.GRP_COMMUNITY?(ze=n.isIntl()?"Create Community":"创建社群",he=1):ze=n.isIntl()?"Create Group":"创建群组",n.get(4).getMyNick()),ze=fe.createCustomMessage({to:$,conversationType:C.CONV_GROUP,payload:{data:JSON.stringify({businessID:"group_create",content:ze,cmd:he,opUser:be||n.getMyUserID(),version:4})}});return fe.sendMessageInstance(ze),n.emitGroupListUpdate(),n.getGroupProfile({groupID:$})}).then(function($){var $=$.data.group,fe=$.selfInfo,ue=fe.nameCard,fe=fe.joinTime;return $.updateSelfInfo({nameCard:ue,joinTime:fe,messageRemindType:C.MSG_REMIND_ACPT_AND_NOTE,role:C.GRP_MBR_ROLE_OWNER}),ft({group:$,overLimitUserIDList:L})}).catch(function(F){var $;return m.setMessage("groupType:".concat(e.type)).setError(F).end(),F.code===10010||F.code===10007?(n._silentlyGetGroupProfile(F.code,M),n.updateGroupMap([u(u({},e),{},{groupID:M})]),($=n.getLocalGroupProfile(M)).selfInfo.role=C.GRP_MBR_ROLE_OWNER,ft({group:$,overLimitUserIDList:L})):(w.e("".concat(a," failed. error:"),F),Ce(F))})}},{key:"dismissGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("dismissGroup"),a="groupID:".concat(e);if(this.hasLocalGroup(e)&&this.getLocalGroupProfile(e).type===C.GRP_WORK)return Ce(new ln({code:we.CANNOT_DISMISS_WORK}));var l=new Be("dismissGroup");return l.setMessage(a),w.l("".concat(o," ").concat(a)),this.req({proto:le.DISMISS_GRP,data:{groupID:e}}).then(function(){return l.end(),w.l("".concat(o," ok")),n.deleteLocalGroupAndConversation(e),n.checkJoinedAVChatRoomByID(e)&&n._AVChatRoomHandler.reset(e),n._groupAttributesHandler.deleteLocalGroupAttributes(e),ft({groupID:e})}).catch(function(h){return l.setError(h).end(),w.e("".concat(o," failed. error:"),h),Ce(h)})}},{key:"updateGroupProfile",value:function(e){var n,o=this,a="".concat(this._n,".").concat("updateGroupProfile");if(this.hasLocalGroup(e.groupID)&&(n=this.getLocalGroupProfile(e.groupID).type,this._canIUseJoinOption(n)||xe(e.joinOption)||(w.w("".concat(a," joinOption is unavailable for Work/Meeting/AVChatRoom")),e.joinOption=void 0)),xe(e.muteAllMembers)||(e.muteAllMembers?e.muteAllMembers="On":e.muteAllMembers="Off"),e.name&&this._filterProfanity("name",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(e.introduction&&this._filterProfanity("introduction",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(e.notification&&this._filterProfanity("notification",e)===!1)return Ce({code:we.PROFANITY_FOUND});var l=new Be("updateGroupProfile");return l.setMessage(JSON.stringify(e)),w.l("".concat(a," groupID:").concat(e.groupID)),this.req({proto:le.UPDATE_GRP_PROFILE,data:e}).then(function(){return l.end(),w.l("".concat(a," ok")),o.hasLocalGroup(e.groupID)&&o.groupMap.get(e.groupID).updateGroup(e),ft({group:o.groupMap.get(e.groupID)})}).catch(function(h){return l.setError(h).end(),w.l("".concat(a," failed. error:"),h),Ce(h)})}},{key:"_filterProfanity",value:function(e,n){var a=this.get(29);if(!a)return!0;var a=a.filterText(n[e],ae),o=a.isAllowedToSend,a=a.modifiedText;return o===!0&&(n[e]=a,!0)}},{key:"joinGroup",value:function(e){var n=this,o=e.groupID,a=e.type,l="".concat(this._n,".joinGroup");if(a===C.GRP_WORK)return Ce({code:we.CANNOT_JOIN_WORK});if(this.deleteUnjoinedAVChatRoom(o),this.hasLocalGroup(o)){if(!this.isLoggedIn())return St({status:C.JOIN_STATUS_ALREADY_IN_GROUP});var h=new Be("applyJoinGroup");return this.getGroupProfile({groupID:o}).then(function(){return h.setMessage("groupID:".concat(o," joinedStatus:").concat(C.JOIN_STATUS_ALREADY_IN_GROUP)).end(),St({status:C.JOIN_STATUS_ALREADY_IN_GROUP})}).catch(function(m){return h.setMessage("groupID:".concat(o," unjoined")).end(),w.w("".concat(l," ").concat(o," was unjoined, now join!")),n.groupMap.delete(o),n.applyJoinGroup(e)})}return w.l("".concat(l," groupID:").concat(o)),this.isLoggedIn()?this.applyJoinGroup(e):this._AVChatRoomHandler.joinWithoutAuth(e)}},{key:"applyJoinGroup",value:function(h){var n=this,o="".concat(this._n,".").concat("applyJoinGroup"),a=h.groupID;if(!Je(h.applyMessage)&&this._filterProfanity("applyMessage",h)===!1)return Ce({code:we.PROFANITY_FOUND});var l=new Be("applyJoinGroup"),h=u({},h),m=this.canIUse(pe.AV_HISTORY_MSG);return m&&(h.historyMessageFlag=1),this.get(11).deleteTopicRoamingMessageInfo(a),this.req({proto:le.APPLY_JOIN_GRP,data:h}).then(function(be){var be=be.data,L=be.joinedStatus,F=be.longPollingKey,$=be.startSeq,ue=be.avChatRoomFlag,fe=be.avChatRoomKey,he=be.messageList,be="groupID:".concat(a," joinedStatus:").concat(L," longPollingKey:").concat(F," startSeq:").concat($)+" avChatRoomFlag:".concat(ue," canGetAVChatRoomHistoryMessage:").concat(m,",")+" history message count:".concat(Je(he)?0:he.length);switch(l.setMessage(be).end(),w.l("".concat(o," ok. ").concat(be)),L){case Ai:return ft({status:Ai});case rn:return n.getGroupProfile({groupID:a}).then(function(Ye){return Ye=Ye.data.group,n._handleJoinResult({group:Ye,avChatRoomFlag:ue,longPollingKey:F,startSeq:$,avChatRoomKey:fe,messageList:he})}).catch(function(Ye){var Tt;return Ye.code===10010||Ye.code===10007?(n._silentlyGetGroupProfile(Ye.code,a),Tt=new rr({groupID:a}),n.updateGroupMap([Tt]),n._handleJoinResult({group:Tt,avChatRoomFlag:ue,longPollingKey:F,startSeq:$,avChatRoomKey:fe,messageList:he})):(w.e("".concat(o," failed. error:"),Ye),Ce(Ye))});default:var ze=new ln({code:we.JOIN_GRP_FAIL});return w.e("".concat(o," failed. error:"),ze),Ce(ze)}}).catch(function(M){return l.setMessage("groupID:".concat(a)).setError(M).end(),w.e("".concat(o," failed. error:"),M),Ce(M)})}},{key:"_handleJoinResult",value:function(e){var n=this,o=e.group,a=e.avChatRoomFlag,l=e.longPollingKey,h=e.startSeq,m=e.avChatRoomKey,M=e.messageList,L=o.groupID;return a===1?(this.get(11).setCompleted("".concat(C.CONV_GROUP).concat(L)),this._groupAttributesHandler.initGroupAttributesCache({groupID:L,avChatRoomKey:m}),this._groupCountersHandler.initGroupCountersCache({groupID:L,avChatRoomKey:m}),(e=xe(l)?this._AVChatRoomHandler.handleJoinResult({group:o}):this._AVChatRoomHandler.startRunLoop({group:o,longPollingKey:l,startSeq:h})).then(function(){n._onAVChatRoomHistoryMessage(M,L)}),e):(this.emitGroupListUpdate(!0,!1),ft({status:rn,group:o}))}},{key:"quitGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("quitGroup"),a="groupID:".concat(e),l=(w.l("".concat(o," ").concat(a)),this.checkJoinedAVChatRoomByID(e));if(!l&&!this.hasLocalGroup(e))return Ce({code:we.MEMBER_NOT_IN_GRP});if(l&&!this.isLoggedIn())return w.l("".concat(o," anonymously ok. ").concat(a)),this.deleteLocalGroupAndConversation(e),this._AVChatRoomHandler.reset(e),St({groupID:e});var h=new Be("quitGroup");return h.setMessage(a),this.req({proto:le.QUIT_GRP,data:{groupID:e}}).then(function(){return h.end(),w.l("".concat(o," ok")),n.deleteLocalGroupAndConversation(e),l&&n._AVChatRoomHandler.reset(e),n._groupAttributesHandler.deleteLocalGroupAttributes(e),ft({groupID:e})}).catch(function(m){return h.setError(m).end(),w.e("".concat(o," failed. error:"),m),Ce(m)})}},{key:"searchGroupByID",value:function(e){var n="".concat(this._n,".").concat("searchGroupByID"),o={groupIDList:[e]},a=new Be("searchGroupByID");return a.setMessage("groupID:".concat(e)),w.l("".concat(n," groupID:").concat(e)),this.req({proto:le.SEARCH_GRP,data:o}).then(function(l){if(l=l.data.groupProfile,l[0].errorCode!==0)throw new ln({code:l[0].errorCode,message:l[0].errorInfo});return a.end(),w.l("".concat(n," ok")),ft({group:new rr(l[0])})}).catch(function(l){return a.setError(l).end(),w.w("".concat(n," failed. error:"),l),Ce(l)})}},{key:"changeGroupOwner",value:function(e){var n=this,o="".concat(this._n,".").concat("changeGroupOwner");if(this.hasLocalGroup(e.groupID)&&this.getLocalGroupProfile(e.groupID).type===C.GRP_AVCHATROOM)return Ce({code:we.CANNOT_CHANGE_OWNER_IN_AVCHATROOM});if(e.newOwnerID===this.getMyUserID())return Ce({code:we.CANNOT_CHANGE_OWNER_TO_SELF});var a=new Be("changeGroupOwner");return a.setMessage("groupID:".concat(e.groupID," newOwnerID:").concat(e.newOwnerID)),w.l("".concat(o," groupID:").concat(e.groupID)),this.req({proto:le.CHANGE_GRP_OWNER,data:e}).then(function(){a.end(),w.l("".concat(o," ok"));var l,h=e.groupID,m=e.newOwnerID,M=(n.groupMap.get(h).ownerID=m,n._groupMemberHandler.getLocalGroupMemberList(h));return M instanceof Map&&(l=M.get(n.getMyUserID()),xe(l)||(l.updateRole("Member"),n.groupMap.get(h).selfInfo.role="Member"),l=M.get(m),xe(l)||l.updateRole("Owner")),n.emitGroupListUpdate(!0,!1),ft({group:n.groupMap.get(h)})}).catch(function(l){return a.setError(l).end(),w.e("".concat(o," failed. error:"),l),Ce(l)})}},{key:"getGroupApplicationList",value:function(){return this._groupSystemNoticeHandler.getGroupApplicationList()}},{key:"handleGroupApplication",value:function(e){var n,o,a,l,h,m=this,M="".concat(this._n,".").concat("handleGroupApplication"),L=e.handleAction,F=e.handleMessage,$=e.message,ue=e.application,fe=($?(n=$.payload.operatorID,o=$.payload.groupProfile.groupID,a=$.payload.authentication,l=$.payload.messageKey):ue&&(n=ue.applicant,o=ue.groupID,a=ue.authentication,l=ue.messageKey),le.HANDLE_GRP_APPLICATION),he=(ue&&ue.applicationType===2&&(fe=le.HANDLE_INVITE_JOIN_GRP,h=ue.userID),new Be("handleGroupApplication"));return he.setMessage("groupID:".concat(o)),w.l("".concat(M," groupID:").concat(o)),this.req({proto:fe,data:{handleAction:L,handleMessage:F,applicant:n,invitee:h,groupID:o,authentication:a,messageKey:l}}).then(function(){return he.end(),w.l("".concat(M," ok")),$&&m._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),ft({group:m.getLocalGroupProfile(o)})}).catch(function(be){return he.setError(be).end(),w.e("".concat(M," failed. error"),be),Ce(be)})}},{key:"handleGroupInvitation",value:function(e){var n=this,o="".concat(this._n,".").concat("handleGroupInvitation"),m=e.message.payload,a=m.groupProfile.groupID,l=m.authentication,h=m.messageKey,m=m.operatorID,M=e.handleAction,L=new Be("handleGroupInvitation");return L.setMessage("groupID:".concat(a," inviter:").concat(m," handleAction:").concat(M)),w.l("".concat(o," groupID:").concat(a," inviter:").concat(m," handleAction:").concat(M)),this.req({proto:le.HANDLE_GRP_INVITATION,data:u(u({},e),{},{inviter:m,groupID:a,authentication:l,messageKey:h})}).then(function(){return L.end(),w.l("".concat(o," ok")),n._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),ft({group:n.getLocalGroupProfile(a)})}).catch(function(F){return L.setError(F).end(),w.e("".concat(o," failed. error"),F),Ce(F)})}},{key:"getGroupOnlineMemberCount",value:function(e){var n=this,o="".concat(this._n,".getGroupOnlineMemberCount"),a=this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e),l=this.hasLocalGroup(e);if(w.l("".concat(o," groupID:").concat(e," isAVChatRoom:").concat(a," has:").concat(l)),a)return this._AVChatRoomHandler.getGroupOnlineMemberCount(e);if(!l)return St({memberCount:0});if(a=Date.now(),this._onlineMemberCountMap.has(e)){if(l=this._onlineMemberCountMap.get(e),a-l.lastReqTime<=6e4)return St({memberCount:l.memberCount});l.lastReqTime=a}return this.requestOnlineCount(e).then(function(h){return h=h.data.memberCount,h=h===void 0?0:h,n._onlineMemberCountMap.set(e,{lastReqTime:Date.now(),memberCount:h}),w.l("".concat(o," ok. groupID:").concat(e," memberCount:").concat(h)),St({memberCount:h})}).catch(function(h){return w.w("".concat(o," failed. error:"),h),Promise.reject(h)})}},{key:"requestOnlineCount",value:function(e){return this.req({proto:le.GET_ONLINE_MBR_NUM,data:{groupID:e}})}},{key:"hasLocalGroup",value:function(e){return this.groupMap.has(e)}},{key:"deleteLocalGroupAndConversation",value:function(e){var n=this.checkJoinedAVChatRoomByID(e);w.l("".concat(this._n,".deleteLocalGroupAndConversation isJoinedAVChatRoom:").concat(n)),n&&this.get(11).deleteLocalConversation("".concat(C.CONV_GROUP).concat(e)),!Ii({groupID:e})||(n=this.getLocalGroupProfile(e))&&n.isSupportTopic===!0&&this.get(10).deleteTopicListInCommunity(e),this._deleteLocalGroup(e),this._onlineMemberCountMap.delete(e),this.emitGroupListUpdate(!0,!1)}},{key:"_deleteLocalGroup",value:function(e){this.groupMap.delete(e),this._groupMemberHandler.deleteGroupMemberList(e)}},{key:"sendMessage",value:function(e,n){return At(e._receiverList)&&0<e._receiverList.length&&!this.canIUse(pe.MSG_TO_SPECIFIED_GRP_MBR)?this.cannotUseCommercialAbility("group direct messages"):(e=this.createGroupMessagePack(e,n),this.req(e))}},{key:"createGroupMessagePack",value:function(e,L){var o=null,a=(L&&L.offlinePushInfo&&(o=L.offlinePushInfo),""),l=(wt(e.cloudCustomData)&&0<e.cloudCustomData.length&&(a=e.cloudCustomData),[]),h=(Qt(L)&&Qt(L.messageControlInfo)&&(h=(M=L.messageControlInfo).excludedFromUnreadCount,m=M.excludedFromLastMessage,M=M.excludedFromContentModeration,h===!0&&l.push("NoUnread"),m===!0&&l.push("NoLastMsg"),M===!0&&l.push("NoMsgCheck")),void 0),m=(At(e._receiverList)&&0<e._receiverList.length&&(h=e._receiverList,50<e._receiverList.length&&(h=e._receiverList.slice(0,50),this.outputWarning("ReceiverListLimit"))),this.isOnlineMessage(e,L)?1:0),M=e.getGroupAtInfoList(),L={fromAccount:this.getMyUserID(),groupID:e.to,msgBody:e.getElements(),cloudCustomData:a,random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:e.type!==C.MSG_TEXT||Je(M)?void 0:M,onlineOnlyFlag:m,clientTime:e.clientTime,offlinePushInfo:o?{pushFlag:o.disablePush===!0?1:0,title:o.title||"",desc:o.description||"",ext:o.extension||"",apnsInfo:{badgeMode:o.ignoreIOSBadge===!0?1:0,isVoipPush:this._isVoipPush(o)},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||""}}:void 0,messageControlInfo:m==0?l:void 0,needReadReceipt:e.needReadReceipt!==!0||this.isMessageFromOrToAVChatroom(e.to)?0:1,receiverList:h,isSupportExtension:e.isSupportExtension===!0?1:0,isRelayMessage:e._relayFlag===!0?1:0,cmConfigID:e._cmConfigID};return Bn(e.to)&&(L.groupID=Wn(e.to),L.topicID=e.to),{proto:le.SEND_GRP_MSG,tjgID:this.generateTjgID(e),data:L}}},{key:"_isVoipPush",value:function(e){var n=void 0;return n=xe(e.disableVoipPush)?n:e.disableVoipPush===!1?1:0}},{key:"revokeMessage",value:function(e){var n={groupID:e.to,msgSeqList:[{msgSeq:e.sequence}]};return Bn(e.to)&&(n.groupID=Wn(e.to),n.topicID=e.to),this.req({proto:le.REVOKE_GRP_MSG,data:n})}},{key:"deleteMessage",value:function(o){var n=o.to,o=o.keyList,o=(w.l("".concat(this._n,".deleteMessage groupID:").concat(n," count:").concat(o.length)),{groupID:n,deleter:this.getMyUserID(),keyList:o});return Bn(n)&&(o.groupID=Wn(n),o.topicID=n),this.req({proto:le.DEL_GRP_MSG,data:o})}},{key:"modifyRemoteMessage",value:function(h){var L=h.to,n=h.sequence,o=h.payload,a=h.type,l=h.version,l=l===void 0?0:l,h=h.cloudCustomData,m=L,M=void 0,L=(Bn(L)&&(m=Wn(L),M=L),void 0);return Xp(a)&&(L=[]).push({type:a,content:o}),this.req({proto:le.MODIFY_GRP_MSG,data:{groupID:m,topicID:M,sequence:n,version:l,elements:L,cloudCustomData:h}})}},{key:"getRoamingMessage",value:function(h){var n=this,o="".concat(this._n,".getRoamingMessage"),a=h.conversationID,l=h.groupID,h=h.sequence,m=new Be("getGroupRoamingMessages"),M=0,L=void 0;return Bn(l)&&(l=Wn(L=l)),this._computeLastSequence({groupID:l,topicID:L,sequence:h}).then(function(F){return M=F,w.l("".concat(o," groupID:").concat(l," startSequence:").concat(M)),n.req({proto:le.GET_GRP_ROAMING_MSG,data:{groupID:l,count:21,sequence:M,topicID:L}})}).then(function(he){var fe=he.data,$=fe.messageList,ue=fe.complete,fe=fe.invisibleSequenceList,fe=fe===void 0?[]:fe,he=he.data.nextSequence,he=he===void 0?0:he,be=(xe($)?w.l("".concat(o," ok. complete:").concat(ue," nextSequence:").concat(he," but messageList is undefined!")):w.l("".concat(o," ok. complete:").concat(ue," nextSequence:").concat(he," count:").concat($.length)),m.setMessage("groupID:".concat(l," topicID:").concat(L," startSequence:").concat(M," complete:").concat(ue," nextSequence:").concat(he)).end(),n.get(11)),ze=[];return Je($)?1<=he&&be.updateRoamingMessageSequence(a,he):(be.updateRoamingMessageSequence(a,he),ze=be.onRoamingMessage($,a),be.updateIsRead(a),be.patchConversationLastMessage(a)),(ue===2||he<1)&&(be.setCompleted(a),he=""),w.l("".concat(o," nextReqID:").concat(he,", stored message count:").concat(ze.length,", invisible sequence count:").concat(fe.length)),{nextReqID:he+"",storedMessageList:ze}}).catch(function(F){return m.setError(F).setMessage("groupID:".concat(l," topicID:").concat(L," startSequence:").concat(M)).end(),w.w("".concat(o," failed. error:"),F),Ce(F)})}},{key:"_getGroupIDOfMessage",value:function(e){return e.conversationID.replace(C.CONV_GROUP,"")}},{key:"getReadReceiptList",value:function(e){var n="".concat(this._n,".").concat("getReadReceiptList"),o=this._getGroupIDOfMessage(e[0]),a=this.getMyUserID(),l=e.filter(function(m){return m.from===a&&m.needReadReceipt===!0}).map(function(m){return{sequence:m.sequence}});if(w.l("".concat(n," groupID:").concat(o," sequenceList:").concat(JSON.stringify(l))),l.length===0)return St({messageList:e});var h=new Be("getReadReceiptList");return h.setMessage("groupID:".concat(o)),this.req({proto:le.GET_READ_RECEIPT,data:{groupID:o,sequenceList:l}}).then(function(m){return h.end(),w.l("".concat(n," ok")),m=m.data.readReceiptList,At(m)&&m.forEach(function(M){e.forEach(function(L){M.code===0&&M.sequence===L.sequence&&(L.readReceiptInfo.readCount=M.readCount,L.readReceiptInfo.unreadCount=M.unreadCount)})}),ft({messageList:e})}).catch(function(m){return h.setError(m).end(),w.w("".concat(n," failed. error:"),m),Ce(m)})}},{key:"sendReadReceipt",value:function(h){var n="".concat(this._n,".").concat("sendReadReceipt"),o=this._getGroupIDOfMessage(h[0]),a=new Be("sendReadReceipt"),l=(a.setMessage("groupID:".concat(o)),this.getMyUserID()),h=h.filter(function(m){return m.from!==l&&m.needReadReceipt===!0}).map(function(m){return{sequence:m.sequence}});return h.length===0?Ce({code:we.READ_RECEIPT_MSG_LIST_EMPTY}):(w.l("".concat(n,". sequenceList:").concat(JSON.stringify(h))),this.req({proto:le.SEND_READ_RECEIPT,data:{groupID:o,sequenceList:h}}).then(function(m){return a.end(),w.l("".concat(n," ok")),ft()}).catch(function(m){return a.setError(m).end(),w.w("".concat(n," failed. error:"),m),Ce(m)}))}},{key:"getReadReceiptDetail",value:function($){var n=this,l=$.message,L=$.filter,F=$.cursor,$=$.count,o=this._getGroupIDOfMessage(l),a=l.ID,l=l.sequence,h="".concat(this._n,".").concat("getReadReceiptDetail"),m=this._receiptDetailCompleteMap.get(a)||!1,M=L!==0&&L!==1?0:L,L=wt(F)?F:"",F=!qt($)||$<=0||100<=$?100:$,$="groupID:".concat(o," sequence:").concat(l," cursor:").concat(L," filter:").concat(M," completeFlag:").concat(m),ue=(w.l("".concat(h," ").concat($)),{cursor:"",isCompleted:!1,messageID:a,unreadUserIDList:[],readUserIDList:[]}),fe=new Be("getReadReceiptDetail");return fe.setMessage($),this.req({proto:le.GET_READ_RECEIPT_DETAIL,data:{groupID:o,sequence:l,flag:M,cursor:L,count:F}}).then(function(Tt){fe.end();var Tt=Tt.data,be=Tt.cursor,ze=Tt.isCompleted,Ye=Tt.unreadUserIDList,Tt=Tt.readUserIDList;return ue.cursor=be,ze===1&&(ue.isCompleted=!0,n._receiptDetailCompleteMap.set(a,!0)),M===0?ue.readUserIDList=Tt.map(function(Ct){return Ct.userID}):M===1&&(ue.unreadUserIDList=Ye.map(function(Ct){return Ct.userID})),w.l("".concat(h," ok")),ft(ue)}).catch(function(he){return fe.setError(he).end(),w.w("".concat(h," failed. error:"),he),Ce(he)})}},{key:"getRoamingMessagesHopping",value:function(e){var n=this,o="".concat(this._n,".getRoamingMessagesHopping"),a=e.groupID,l=e.count,h=e.sequence,m=e.direction,M=h;if(xe(h)){if(m===1)return St({messageList:[],isCompleted:!0,nextMessageSeq:""});this.hasLocalGroup(a)&&(M=1<(L=this.getLocalGroupProfile(a).nextMessageSeq)?L-1:0),Bn(a)&&(M=0)}else m===1&&(M=h+l-1);var L=void 0,F=(Bn(a)&&(a=Wn(L=a)),"".concat(L?"topicID:".concat(L):"groupID:".concat(a)," sequence:").concat(h," direction:").concat(m)),$=(w.l("".concat(o," ").concat(F)),new Be("getGroupRoamingMessagesHopping"));return this.req({proto:le.GET_GRP_ROAMING_MSG,data:{groupID:a,topicID:L,count:l,sequence:M}}).then(function(he){var he=he.data,fe=he.messageList,he=he.complete,be="complete:".concat(he," count:").concat(fe?fe.length:0);return w.l("".concat(o," ok. ").concat(be)),$.setMessage("".concat(F," ").concat(be)).end(),he===2||Je(fe)?(be=n._computeResult(),ft(be)):(he="".concat(C.CONV_GROUP).concat(e.groupID),be=n.get(11).onRoamingMessage(fe,he,!1),he=n._computeResult({direction:m,sequence:h,remoteMessageList:fe,processedMessageList:be}),ft(he))}).catch(function(ue){return $.setError(ue).setMessage("groupID:".concat(a," sequence:").concat(h," count:").concat(l)).end(),w.w("".concat(o," failed. error:"),ue),Ce(ue)})}},{key:"_computeResult",value:function(h){var n={messageList:[],isCompleted:!1,nextMessageSeq:""};if(xe(h))return n.isCompleted=!0,n;var o=h.direction,a=h.sequence,l=h.remoteMessageList,l=l===void 0?[]:l,h=h.processedMessageList,h=h===void 0?[]:h,m=l.length;return o===1?(n.nextMessageSeq=l[0].sequence+1,h.forEach(function(M){M.sequence>=a&&n.messageList.push(M)}),n.messageList.length===0&&l[0].sequence<a&&(n.isCompleted=!0,n.nextMessageSeq="")):(n.nextMessageSeq=l[m-1].sequence-1,n.messageList=V(h),n.nextMessageSeq===0&&(n.isCompleted=!0,n.nextMessageSeq="")),n}},{key:"setMessageRead",value:function(h){var n=this,o=h.conversationID,a=h.lastMessageSeq,l="".concat(this._n,".").concat("setMessageRead"),h="conversationID:".concat(o," lastMessageSeq:").concat(a),m=(w.l("".concat(l," ").concat(h)),qt(a)||this.outputWarning("DoNotModifyLastSeq"),new Be("setMessageRead")),M=(m.setMessage(h),o.replace(C.CONV_GROUP,"")),L=void 0;return Bn(M)&&(M=Wn(L=M)),this.req({proto:le.SET_GRP_MSG_READ,data:{groupID:M,topicID:L,messageReadSeq:a}}).then(function(){m.end(),w.l("".concat(l," ok"));var F,$=n.get(11),ue=($.updateIsReadAfterReadReport({conversationID:o,lastMessageSeq:a}),!0);return xe(L)||(ue=!1,(F=n.get(10).getLocalTopic(M,L))&&F.updateSelfInfo({readedSequence:a})),$.updateUnreadCount(o,ue),ft()}).catch(function(F){return m.setError(F).end(),w.l("".concat(l," failed. error:"),F),Ce(F)})}},{key:"_computeLastSequence",value:function(a){var n=a.groupID,o=a.topicID,o=o===void 0?void 0:o,a=a.sequence;return 0<a?Promise.resolve(a):xe(o)?this.getGroupLastSequence(n):Promise.resolve(0)}},{key:"getGroupLastSequence",value:function(e){var n="".concat(this._n,".").concat("getGroupLastSequence"),o=new Be("getGroupLastSequence"),a=0,l="",h="groupID:".concat(e);if(this.hasLocalGroup(e)){var m=this.getLocalGroupProfile(e),M=m.lastMessage;if(0<M.lastSequence&&M.onlineOnlyFlag===!1)return a=M.lastSequence,l="".concat(h,", ").concat(a," from group.lastMessage.lastSequence"),w.l("".concat(n," ").concat(l)),o.setMessage(l).end(),Promise.resolve(a);if(1<m.nextMessageSeq)return a=m.nextMessageSeq-1,l="".concat(h,", ").concat(a," from group.nextMessageSeq"),w.l("".concat(n," ").concat(l)),o.setMessage(l).end(),Promise.resolve(a)}return M=this.get(11).getLocalConversation("GROUP".concat(e)),M&&M.lastMessage.lastSequence&&M.lastMessage.onlineOnlyFlag===!1?(a=M.lastMessage.lastSequence,l="".concat(h,", ").concat(a," from conversation.lastMessage.lastSequence"),w.l("".concat(n," ").concat(l)),o.setMessage(l).end(),Promise.resolve(a)):this.getGroupProfileAdvance({groupIDList:[e],responseFilter:{groupBaseInfoFilter:["NextMsgSeq"]}}).then(function(L){return L=L.data.successGroupList,Je(L)?w.w("".concat(n," ").concat(h,", empty successGroupList")):(a=L[0].nextMessageSeq-1,l="".concat(h,", ").concat(a," from remote"),w.l("".concat(n," ").concat(l))),o.setMessage(l).end(),a}).catch(function(L){return o.setError(L).setMessage(h).end(),w.w("".concat(n," failed. error:"),L),Ce(L)})}},{key:"isMessageFromOrToAVChatroom",value:function(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"hasJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler.hasJoinedAVChatRoom()}},{key:"getJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler.getJoinedAVChatRoom()}},{key:"isOnlineMessage",value:function(e,n){return!(!this._canIUseOnlineOnlyFlag(e)||!n||n.onlineUserOnly!==!0)}},{key:"_canIUseOnlineOnlyFlag",value:function(e){var n=this.getJoinedAVChatRoom();return!n||!n.includes(e.to)||e.conversationType!==C.CONV_GROUP}},{key:"_onAVChatRoomHistoryMessage",value:function(e,n){var o;Je(e)||(w.l("".concat(this._n,"._onAVChatRoomHistoryMessage groupID:").concat(n," count:").concat(e.length)),o=[],e.forEach(function(a){o.push(u(u({},a),{},{isHistoryMessage:1}))}),this.onAVChatRoomMessage(o,n))}},{key:"onAVChatRoomMessage",value:function(e){this._AVChatRoomHandler.onMessage(e,1<arguments.length&&arguments[1]!==void 0?arguments[1]:"")}},{key:"onAVChatRoomMemberBanned",value:function(e){this._AVChatRoomHandler.onAVChatRoomMemberBanned(e)}},{key:"getGroupSimplifiedInfo",value:function(e){var n=new Be("getGroupSimplifiedInfo");return this.getGroupProfileAdvance({groupIDList:[e],responseFilter:{groupBaseInfoFilter:["Type","Name"]}}).then(function(o){return o=o.data.successGroupList,n.setMessage("groupID:".concat(e," type:").concat(o[0].type)).end(),o[0]}).catch(function(o){n.setError(o).setMessage("groupID:".concat(e)).end()})}},{key:"setUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.set(e,1)}},{key:"deleteUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.has(e)&&this._unjoinedAVChatRoomList.delete(e)}},{key:"isUnjoinedAVChatRoom",value:function(e){return this._unjoinedAVChatRoomList.has(e)}},{key:"isGroupAttributesUpdatedNotice",value:function(e){return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e)}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{key:"initGroupAttributes",value:function(e){return this._groupAttributesHandler.initGroupAttributes(e)}},{key:"setGroupAttributes",value:function(e){return this._groupAttributesHandler.setGroupAttributes(e)}},{key:"deleteGroupAttributes",value:function(e){return this._groupAttributesHandler.deleteGroupAttributes(e)}},{key:"getGroupAttributes",value:function(e){return this._groupAttributesHandler.getGroupAttributes(e)}},{key:"isMessageFromTopic",value:function(e,n){return e===2&&!Je(n)}},{key:"isMessageFromCommunityOfTopic",value:function(e,n){return e===2&&Je(n)}},{key:"getMessageExtensions",value:function(e,n){return w.l("".concat(this._n,".getMessageExtensions startSequence:").concat(n)),this.req({proto:le.GET_GRP_MSG_EXT,data:{groupID:e.to,messageSequence:e.sequence,startSequence:n}})}},{key:"modifyMessageExtensions",value:function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;return w.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(o)),this.req({proto:le.MODIFY_GRP_MSG_EXT,data:{groupID:e.to,messageSequence:e.sequence,extensionList:n,operateType:o}})}},{key:"_genNotifyReqList",value:function(e){for(var n=[],o=0,a=e.length;o<a;o++){var l=e[o],M=this.getLocalGroupProfile(l).type,h=this._getGroupLastRevokedTime(l),m=1e3*dt(),M={notifyType:1,limit:20,type:Ii({type:M,groupID:l})?C.GRP_COMMUNITY:void 0,groupID:l,beginTime:h,endTime:m};n.push(M)}return n}},{key:"getGroupNotify",value:function(e){var n=this,o="".concat(this._n,".getGroupNotify"),a=e.filter(function(h){var M=n.getLocalGroupProfile(h),m=M.type,M=M.isSupportTopic;return n.hasLocalGroup(h)&&!pi(m)&&!M}),l="filteredGroupIDList.length:".concat(a.length);a.length<=10&&(l="filteredGroupIDList:".concat(JSON.stringify(a))),w.l("".concat(o," ").concat(l)),a.length!==0&&this.req({proto:le.GET_GRP_NOTIFY,data:{notifyReqList:this._genNotifyReqList(e)}}).then(function(L){var m,L=L.data.notifyRspList,M=[],L=(At(L)&&(m={dataList:[]},L.forEach(function(F){var $=F.nextRevokedTime,ue=F.groupID;m.dataList.push({elements:{revokedInfos:n._genRevokedInfos(F)}}),$!==0?(n._setGroupLastRevokedTime(ue,$),M.push(ue)):n._setGroupLastRevokedTime(ue,1e3*dt())}),n.onGroupMessageRevoked(m)),0<M.length&&n.getGroupNotify(M),"nextGroupIDList.length:".concat(M.length));M.length<=10&&(L="nextGroupIDList:".concat(JSON.stringify(M))),w.l("".concat(o," ").concat(L))}).catch(function(h){w.e("".concat(o," failed. error:"),h)})}},{key:"_genRevokedInfos",value:function(e){var n=e.notifyList,o=e.groupID,a=[];return At(n)&&n.forEach(function(l){a.push({groupID:o,sequence:l.sequence,random:l.random,revokerInfo:u({},l.revokerInfo)})}),a}},{key:"_getGroupLastRevokedTime",value:function(e){return this.hasLocalGroup(e)?this.getLocalGroupProfile(e)._lastRevokedTime:0}},{key:"_setGroupLastRevokedTime",value:function(e,n){this.hasLocalGroup(e)&&(this.getLocalGroupProfile(e)._lastRevokedTime=n)}},{key:"isGroupCountersNotice",value:function(e){return this._groupCountersHandler.isGroupCountersNotice(e)}},{key:"setGroupCounters",value:function(e){return this._groupCountersHandler.setGroupCounters(e)}},{key:"increaseGroupCounter",value:function(e){return this._groupCountersHandler.increaseGroupCounter(e)}},{key:"decreaseGroupCounter",value:function(e){return this._groupCountersHandler.decreaseGroupCounter(e)}},{key:"getGroupCounters",value:function(e){return this._groupCountersHandler.getGroupCounters(e)}},{key:"getGroupMemberHandler",value:function(){return this._groupMemberHandler}},{key:"getGroupMemberList",value:function(e){return this._groupMemberHandler.getGroupMemberList(e)}},{key:"getGroupMemberProfile",value:function(e){return this._groupMemberHandler.getGroupMemberProfile(e)}},{key:"addGroupMember",value:function(e){return this._groupMemberHandler.addGroupMember(e)}},{key:"deleteGroupMember",value:function(e){return this._groupMemberHandler.deleteGroupMember(e)}},{key:"setGroupMemberMuteTime",value:function(e){return this._groupMemberHandler.setGroupMemberMuteTime(e)}},{key:"setGroupMemberRole",value:function(e){return this._groupMemberHandler.setGroupMemberRole(e)}},{key:"setGroupMemberNameCard",value:function(e){return this._groupMemberHandler.setGroupMemberNameCard(e)}},{key:"setGroupMemberCustomField",value:function(e){return this._groupMemberHandler.setGroupMemberCustomField(e)}},{key:"markGroupMemberList",value:function(e){return this._groupMemberHandler.markGroupMemberList(e)}},{key:"modifyGroupMemberInfo",value:function(e){return this._groupMemberHandler.modifyGroupMemberInfo(e)}},{key:"restartPolling",value:function(){this._AVChatRoomHandler.restartPolling()}},{key:"getPollingTimerID",value:function(e){if(!e)return-1;var n=this.getLocalGroupProfile(e);return n&&pi(n.type)?this._AVChatRoomHandler.getPollingTimerID(e):-1}},{key:"_canIUseJoinOption",value:function(e){return e===C.GRP_PUBLIC||Ii({type:e})}},{key:"_silentlyGetGroupProfile",value:function(e,n){var o=setTimeout(this.getGroupProfile.bind(this,{groupID:n}),3e3);this._timeoutIDs.push(o),w.l("".concat(this._n,"._silentlyGetGroupProfile errorCode:").concat(e," groupID:").concat(n," timeoutIDs:").concat(this._timeoutIDs))}},{key:"_clearTimeoutIDs",value:function(){this._timeoutIDs.forEach(function(e){clearTimeout(e)}),this._timeoutIDs=[]}},{key:"startMessageLongPolling",value:function(a){var n=a.groupID,o=a.longPollingKey,a=a.longPollingSequence,a=a===void 0?1:a,h=this.get(12).isUnlimitedAVChatRoom(),l=(this._AVChatRoomHandler.hasPollingInstance(n)&&this.stopMessageLongPolling({groupID:n}),this._AVChatRoomHandler.getJoinedLiveList()),h=(!h&&0<l.length&&this.stopMessageLongPolling({groupID:l[0]}),new rr({groupID:n,type:C.GRP_LIVE}));return w.l("".concat(this._n,".startMessageLongPolling groupID:").concat(n," longPollingKey:").concat(o," longPollingSequence:").concat(a)),this._AVChatRoomHandler.startRunLoop({group:h,longPollingKey:o,startSeq:a})}},{key:"stopMessageLongPolling",value:function(n){var n=n.groupID,o=this.get(11);return this._AVChatRoomHandler.reset(n),this._deleteLocalGroup(n),o.deleteLocalConversation("".concat(C.CONV_GROUP).concat(n)),w.l("".concat(this._n,".stopMessageLongPolling ok, groupID:").concat(n)),St({groupID:n})}},{key:"reset",value:function(){this.groupMap.clear(),this._unjoinedAVChatRoomList.clear(),this._receiptDetailCompleteMap.clear(),this._onlineMemberCountMap.clear(),this._commonGroupHandler.reset(),this._groupSystemNoticeHandler.reset(),this._groupTipsHandler.reset(),this._groupAttributesHandler.reset(),this._groupCountersHandler.reset(),this._AVChatRoomHandler.reset(),this._groupMemberHandler.reset(),this._clearTimeoutIDs()}}]),vc),ov=["topicID","topicName","avatar","introduction","notification","unreadCount","muteAllMembers","customData","groupAtInfoList","nextMessageSeq","selfInfo"],rv=(y(_c,[{key:"_initTopic",value:function(e){for(var n in e)ov.indexOf(n)<0||(n==="selfInfo"?this.updateSelfInfo(e[n]):this[n]=n==="muteAllMembers"?e[n]===1:e[n])}},{key:"updateUnreadCount",value:function(){this.unreadCount=0<arguments.length&&arguments[0]!==void 0?arguments[0]:0}},{key:"updateNextMessageSeq",value:function(e){this.nextMessageSeq=e}},{key:"updateLastMessage",value:function(e){this.lastMessage=uu(e)}},{key:"updateGroupAtInfoList",value:function(e){this.groupAtInfoList=JSON.parse(JSON.stringify(e))}},{key:"updateTopic",value:function(e){xe(e.selfInfo)||this.updateSelfInfo(e.selfInfo),xe(e.muteAllMembers)||(this.muteAllMembers=e.muteAllMembers===1),Ji(this,e,["groupID","lastMessageTime","selfInfo","muteAllMembers","lastMsg"])}},{key:"updateSelfInfo",value:function(e){return Ji(this.selfInfo,e,[],[""])!==0}},{key:"reduceUnreadCount",value:function(){return 1<=this.unreadCount&&(--this.unreadCount,!0)}},{key:"isLastMessageRevoked",value:function(e){return e.sequence===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}}]),_c),av=(E(ia,Pn),Au=B(ia),y(ia,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("topic_cache_time"),n=this.getCloudConfig("topic_last_active_time");xe(e)||(this.TOPIC_CACHE_TIME=Number(e)),xe(n)||(this.TOPIC_LAST_ACTIVE_TIME=Number(n))}},{key:"onTopicCreated",value:function(e){var n=e.groupID;this.resetGetTopicTime(n),this.emitOuterEvent(R.TOPIC_CREATED,e)}},{key:"onTopicDeleted",value:function(e){var n=this,o=e.groupID,a=e.topicIDList;(a===void 0?[]:a).forEach(function(l){n._deleteLocalTopic(o,l)}),this.emitOuterEvent(R.TOPIC_DELETED,e)}},{key:"onTopicMessageRemindTypeUpdated",value:function(l){var n,o=l.groupID,a=l.topicID,l=l.messageRemindType,h=this.getLocalTopic(o,a);h&&((n=h.updateSelfInfo({messageRemindType:l}))&&this.emitOuterEvent(R.TOPIC_UPDATED,{groupID:o,topic:h}),w.d("".concat(this._n,".onTopicMessageRemindTypeUpdated topicID:").concat(a)+" messageRemindType:".concat(l," isTopicUpdated:").concat(n)))}},{key:"onTopicProfileUpdated",value:function(e){var n=e.groupID,o=e.topicID,o=this.getLocalTopic(n,o);o&&(o.updateTopic(e),this.emitOuterEvent(R.TOPIC_UPDATED,{groupID:n,topic:o}))}},{key:"onConversationProxy",value:function(o){var l=o.topicID,n=o.unreadCount,o=o.groupAtInfoList,a=Wn(l),l=this.getLocalTopic(a,l),h=!1;l&&(xe(n)||l.unreadCount===n||(l.updateUnreadCount(n),h=!0),xe(o)||(l.updateGroupAtInfoList(o),h=!0)),h&&this.emitOuterEvent(R.TOPIC_UPDATED,{groupID:a,topic:l})}},{key:"onMessageSent",value:function(o){var n=o.groupID,a=o.topicID,o=o.lastMessage,a=this.getLocalTopic(n,a);a&&(a.nextMessageSeq+=1,a.updateLastMessage(o),this.emitOuterEvent(R.TOPIC_UPDATED,{groupID:n,topic:a}))}},{key:"onMessageModified",value:function(e){var n,o=e.to,a=e.time,l=e.sequence,h=e.elements,m=e.cloudCustomData,M=e.messageVersion,L=Wn(o),F=this.getLocalTopic(L,o);F&&(n=F.lastMessage,w.d("".concat(this._n,".onMessageModified topicID:").concat(o," lastMessage:"),JSON.stringify(n),"options:",JSON.stringify(e)),n&&(n.payload===null||n.lastTime===a&&n.lastSequence===l&&n.version!==M)&&(n.type=h[0].type,n.payload=h[0].content,n.messageForShow=ec(n.type,n.payload,this.isIntl()),n.cloudCustomData=m,n.version=M,n.lastSequence=l,n.lastTime=a,this.emitOuterEvent(R.TOPIC_UPDATED,{groupID:L,topic:F})))}},{key:"onMessageRevoked",value:function(e){var n,o,a,l=this;e.length!==0&&(o=n=null,a=!1,e.forEach(function(h){var m=h.to;o=Wn(m),(n=l.getLocalTopic(o,m))&&(n.reduceUnreadCount()&&(a=!0),n.isLastMessageRevoked(h)&&(n.setLastMessageRevoked(!0),n.setLastMessageRevoker(h.revoker),a=!0))}),a&&this.emitOuterEvent(R.TOPIC_UPDATED,{groupID:o,topic:n}))}},{key:"isLastMessageRevoked",value:function(n){var a=n.topicID,n=n.sequence,o=Wn(a),o=this.getLocalTopic(o,a),a=!1;return a=o?o.isLastMessageRevoked({sequence:n}):a}},{key:"getJoinedCommunityList",value:function(){return this.get(7).syncCommunityWithTopic()}},{key:"createTopicInCommunity",value:function(e){var n=this,o="".concat(this._n,".").concat("createTopicInCommunity"),a=e.topicID;if(!xe(a)&&!Bn(a))return Ce({code:we.ILLEGAL_TOPIC_ID});if(e.topicName&&this._filterProfanity("topicName",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(e.introduction&&this._filterProfanity("introduction",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(e.notification&&this._filterProfanity("notification",e)===!1)return Ce({code:we.PROFANITY_FOUND});var l=new Be("createTopicInCommunity");return this.req({proto:le.CREATE_TOPIC,data:u({},e)}).then(function(h){return h=h.data.topicID,l.setMessage("topicID:".concat(h)).end(),w.l("".concat(o," ok. topicID:").concat(h)),n._updateTopicMap([u(u({},e),{},{topicID:h})]),ft({topicID:h})}).catch(function(h){return l.setError(h).end(),w.e("".concat(o," failed. error:"),h),Ce(h)})}},{key:"deleteTopicFromCommunity",value:function(l){var n=this,o="".concat(this._n,".").concat("deleteTopicFromCommunity"),a=l.groupID,l=l.topicIDList,l=l===void 0?[]:l,h=new Be("deleteTopicFromCommunity");return h.setMessage("groupID:".concat(a," topicIDList:").concat(l)),this.req({proto:le.DELETE_TOPIC,data:{groupID:a,topicIDList:l}}).then(function(F){var F=F.data.resultList,M=[],L=[],F=((F===void 0?[]:F).forEach(function(he){var ue=he.topicID,fe=he.errorCode,he=he.errorInfo;fe===0?M.push({topicID:ue}):L.push({topicID:ue,code:fe,message:he})}),"success count:".concat(M.length,", fail count:").concat(L.length));return h.setMoreMessage(F).end(),w.l("".concat(o," ok. ").concat(F)),M.forEach(function($){n._deleteLocalTopic(a,$.topicID)}),ft({successTopicList:M,failureTopicList:L})}).catch(function(m){return h.setError(m).end(),w.e("".concat(o," failed. error:"),m),Ce(m)})}},{key:"updateTopicProfile",value:function(e){var n=this,o="".concat(this._n,".").concat("updateTopicProfile");if(w.l("".concat(o," options:"),e),e.topicName&&this._filterProfanity("topicName",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(e.introduction&&this._filterProfanity("introduction",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(e.notification&&this._filterProfanity("notification",e)===!1)return Ce({code:we.PROFANITY_FOUND});var a=new Be("updateTopicProfile");return a.setMessage("groupID:".concat(e.groupID," topicID:").concat(e.topicID)),xe(e.muteAllMembers)||(e.muteAllMembers=e.muteAllMembers===!0?"On":"Off"),this.req({proto:le.UPDATE_TOPIC_PROFILE,data:u({},e)}).then(function(){return a.end(),w.l("".concat(o," ok")),n._updateTopicMap([e]),ft({topic:n.getLocalTopic(e.groupID,e.topicID)})}).catch(function(l){return a.setError(l).end(),w.e("".concat(o," failed. error:"),l),Ce(l)})}},{key:"getTopicList",value:function(l){var n=this,o="".concat(this._n,".").concat("getTopicList"),a=l.groupID,l=l.topicIDList,l=l===void 0?[]:l,h=l.length===0,m=new Be("getTopicList");if(m.setMessage("groupID:".concat(a)),this._getTopicTimeMap.has(a)){var L=this._getTopicTimeMap.get(a),M=L.isGetAll,L=L.time;if((M||!M&&!h)&&Date.now()-L<1e3*this.TOPIC_CACHE_TIME&&(M=this._getLocalTopicList(a,l),h||M.length===l.length))return m.setMoreMessage("from cache, topic count:".concat(M.length)).end(),w.l("".concat(o," groupID:").concat(a," from cache, topic count:").concat(M.length)),St({successTopicList:M,failureTopicList:[]})}return this.req({proto:le.GET_TOPIC_LIST,data:{groupID:a,topicIDList:l}}).then(function(he){var he=he.data.topicInfoList,$=[],ue=[],fe=[],he=((he===void 0?[]:he).forEach(function(Ct){var ze=Ct.topic,Ye=Ct.selfInfo,Tt=Ct.errorCode,Ct=Ct.errorInfo,Bt=ze.topicID;Tt===0?($.push(u(u({},ze),{},{selfInfo:Ye})),ue.push(Bt)):fe.push({topicID:Bt,code:Tt,message:Ct})}),n._updateTopicMap($),n._handleTopicAtInfo($),"success count:".concat(ue.length,", fail count:").concat(fe.length)),he=(m.setMoreMessage(he).end(),w.l("".concat(o," groupID:").concat(a," from remote, ").concat(he)),[]);return Je(ue)||(n._getTopicTimeMap.set(a,{time:Date.now(),isGetAll:h}),he=n._getLocalTopicList(a,ue)),ft({successTopicList:he,failureTopicList:fe})}).catch(function(F){return m.setError(F).end(),w.e("".concat(o," failed. error:"),F),Ce(F)})}},{key:"hasLocalTopic",value:function(e,n){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(n)}},{key:"getLocalTopic",value:function(e,n){var o=null;return o=this._topicMap.has(e)?this._topicMap.get(e).get(n):o}},{key:"_getLocalTopicList",value:function(o){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[],o=this._topicMap.get(o),a=[];return o&&(a=V(o.values())),n.length===0?a:a.filter(function(l){return n.includes(l.topicID)})}},{key:"_deleteLocalTopic",value:function(e,n){this._topicMap.has(e)&&this._topicMap.get(e).has(n)&&(this._topicMap.get(e).delete(n),w.l("".concat(this._n,"._deleteLocalTopic groupID:").concat(e," topicID:").concat(n)))}},{key:"_updateTopicMap",value:function(e){var n=this,o=[];e.forEach(function(M){var l=M.groupID,h=M.topicID,m=null,M=(n._topicMap.has(l)||n._topicMap.set(l,new Map),n._topicMap.get(l).has(h)?(m=n._topicMap.get(l).get(h)).updateTopic(M):(n._getTopicLastMessage(M),m=new rv(M,n.isIntl()),n._topicMap.get(l).set(h,m)),n._computeUnreadCount(m));m.updateUnreadCount(M),o.push({conversationID:"".concat(C.CONV_GROUP).concat(h),type:C.CONV_TOPIC,unreadCount:M})}),0<o.length&&this.get(11).updateTopicConversation(o)}},{key:"resetGetTopicTime",value:function(e){var n=this;xe(e)?V(this._getTopicTimeMap.keys()).forEach(function(o){n._getTopicTimeMap.set(o,0)}):this._getTopicTimeMap.set(e,0)}},{key:"getTopicListOnReconnected",value:function(){var e=this,n=V(this._topicMap.keys()),o=[],a=this.get(11);n.forEach(function(l){var h=[],m=e._getLocalTopicList(l);a.deleteTopicRoamingMessageInfo(l),m.forEach(function(M){var L=M.lastMessage.lastTime,L=L===void 0?0:L;Date.now()-1e3*L<1e3*e.TOPIC_LAST_ACTIVE_TIME&&h.push(M.topicID)}),0<h.length&&o.push({groupID:l,topicIDList:h})}),w.l("".concat(this._n,".getTopicListOnReconnected. active community count:").concat(o.length)),this._relayGetTopicList(o)}},{key:"_relayGetTopicList",value:function(e){var n,o,a,l=this;e.length!==0&&(o=5<(n=e.shift()).topicIDList.length?"topicIDList.length:".concat(n.topicIDList.length):"topicIDList:".concat(n.topicIDList),(a=new Be("relayGetTopicList")).setMessage(o),w.l("".concat(this._n,"._relayGetTopicList. ").concat(o)),this.getTopicList(n).then(function(){a.end(),l._relayGetTopicList(e)}).catch(function(h){a.setError(h).end(),l._relayGetTopicList(e)}))}},{key:"_handleTopicAtInfo",value:function(e){var n=this;e.length!==0&&e.forEach(function(h){var a=h.groupID,l=h.topicID,h=h.groupAtInfoList,m=[];xe(h)||(h.forEach(function(M){m.push(u(u({},M),{},{groupID:a,topicID:l}))}),n.get(11).onNewGroupAtTips({dataList:m}))})}},{key:"_getTopicLastMessage",value:function(e){var n;xe(e.lastMsg)||(n={time:e.lastMsg.time,sequence:e.lastMsg.sequence,from:e.lastMsg.from,payload:e.lastMsg.elements[0]?e.lastMsg.elements[0].content:null,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:"",nick:e.lastMsg.nick,avatar:e.lastMsg.avatar,version:e.lastMsg.messageVersion,cloudCustomData:e.lastMsg.cloudCustomData,isRevoked:e.lastMsg.isPlaceMessage===2,revoker:Je(e.lastMsg.revokerInfo)?null:e.lastMsg.revokerInfo.revoker},e.lastMessage=n)}},{key:"deleteTopicListInCommunity",value:function(e){var n=this,o=this._getLocalTopicList(e),a=this.get(11);o.forEach(function(l){l=l.topicID,n._deleteLocalTopic(e,l),n._getTopicTimeMap.delete(e),a.deleteLocalConversation("".concat(C.CONV_GROUP).concat(l))})}},{key:"_computeUnreadCount",value:function(e){var n,l=e.selfInfo,o=l.excludedUnreadSequenceList,a=l.readedSequence,l=e.nextMessageSeq-e.selfInfo.readedSequence-1;return At(o)&&(n=0,o.forEach(function(h){a<=h&&h<=e.nextMessageSeq-1&&(n+=1)}),1<=n&&(l-=n)),l<0?0:l}},{key:"_filterProfanity",value:function(e,n){var a=this.get(29);if(!a)return!0;var a=a.filterText(n[e],ae),o=a.isAllowedToSend,a=a.modifiedText;return o===!0&&(n[e]=a,!0)}},{key:"updateLastMessage",value:function(l,n){var o,a=Wn(l),l=this.getLocalTopic(a,l);l&&(o=n.sequence+1,l.updateNextMessageSeq(o),l.updateLastMessage(n),this.emitOuterEvent(R.TOPIC_UPDATED,{groupID:a,topic:l}))}},{key:"getMessageExtensions",value:function(e,n){w.l("".concat(this._n,".getMessageExtensions startSequence:").concat(n));var o=Wn(e.to);return this.req({proto:le.GET_GRP_MSG_EXT,data:{groupID:o,topicID:e.to,messageSequence:e.sequence,startSequence:n}})}},{key:"modifyMessageExtensions",value:function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,a=(w.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(o)),Wn(e.to));return this.req({proto:le.MODIFY_GRP_MSG_EXT,data:{groupID:a,topicID:e.to,messageSequence:e.sequence,extensionList:n,operateType:o}})}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._topicMap.clear(),this._getTopicTimeMap.clear(),this.TOPIC_CACHE_TIME=300,this.TOPIC_LAST_ACTIVE_TIME=3600}}]),ia),sv=(y(fA,[{key:"setExpirationTime",value:function(e){this.expirationTime=e}},{key:"getUserProfile",value:function(e){var n=this,o="".concat(this._n,".").concat("getUserProfile"),a=e.userIDList;e.fromAccount=this._userM.getMyAccount(),100<a.length&&(w.w("".concat(o," ").concat(Zr(100))),a.length=100);for(var l,h=[],m=[],M=0,L=a.length;M<L;M++)l=a[M],this._userM.isMyFriend(l)&&this._contains(l)?m.push(this._getProfileFromMap(l)):h.push(l);if(h.length===0)return St(m);e.toAccount=h;var F=e.bFromGetMyProfile||!1,$=[],ue=(e.toAccount.forEach(function(fe){$.push({toAccount:fe,standardSequence:0,customSequence:0})}),e.userItem=$,new Be("getUserProfile"));return ue.setMessage(5<a.length?"userIDList.length:".concat(a.length):"userIDList:".concat(a)),this._userM.req({proto:le.GET_USER_PROFILE,data:e}).then(function(fe){return ue.end(),w.i("".concat(o," ok")),fe=n._handleResponse(fe).concat(m),ft(F?fe[0]:fe)}).catch(function(fe){return ue.setError(fe).end(),w.e("".concat(o," failed. error:"),fe),Ce(fe)})}},{key:"getMyProfile",value:function(){var e,n=this._userM.getMyAccount(),o="".concat(this._n,".getMyProfile");return w.l("".concat(o," myAccount:").concat(n)),this._fill(),this._contains(n)?(e=this._getProfileFromMap(n),w.d("".concat(o," from cache, myProfile:").concat(JSON.stringify(e))),St(e)):this.getUserProfile({fromAccount:n,userIDList:[n],bFromGetMyProfile:!0})}},{key:"_handleResponse",value:function(e){var n=e.data.userProfileItem;if(!At(n))return[];for(var o=[],e=Date.now(),a=0,l=n.length;a<l;a++){var m=n[a],h=m.to,m=m.profileItem;h!=="@TLS#NOT_FOUND"&&h!==""&&(h=this._update(h,this._getLatestProfileFromResponse(h,m)).latestProfile,o.push(h))}return w.l("".concat(this._n,"._handleResponse cost:").concat(Zn(e))),o}},{key:"_getLatestProfileFromResponse",value:function(e,n){var o={userID:e,profileCustomField:[]};if(!Je(n))for(var a=0,l=n.length;a<l;a++)if(-1<n[a].tag.indexOf("Tag_Profile_Custom"))o.profileCustomField.push({key:n[a].tag,value:n[a].value});else switch(n[a].tag){case gt.NICK:o.nick=n[a].value;break;case gt.GENDER:o.gender=n[a].value;break;case gt.BIRTHDAY:o.birthday=n[a].value;break;case gt.LOCATION:o.location=n[a].value;break;case gt.SELFSIGNATURE:o.selfSignature=n[a].value;break;case gt.ALLOWTYPE:o.allowType=n[a].value;break;case gt.LANGUAGE:o.language=n[a].value;break;case gt.AVATAR:o.avatar=n[a].value;break;case gt.MESSAGESETTINGS:o.messageSettings=n[a].value;break;case gt.ADMINFORBIDTYPE:o.adminForbidType=n[a].value;break;case gt.LEVEL:o.level=n[a].value;break;case gt.ROLE:o.role=n[a].value;break;default:w.w("".concat(this._n,"._getLatestProfileFromResponse unknown tag:"),n[a].tag,n[a].value)}return o}},{key:"updateMyProfile",value:function(e){var n=this,o="".concat(this._n,".").concat("updateMyProfile");if(e.nick&&this._userM.filterProfanity("nick",e)===!1)return Ce({code:we.PROFANITY_FOUND});if(e.selfSignature&&this._userM.filterProfanity("selfSignature",e)===!1)return Ce({code:we.PROFANITY_FOUND});var a=new Be("updateMyProfile"),l=(a.setMessage(JSON.stringify(e)),new Ya().validate(e));if(!l.valid)return a.setCode(we.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("info:".concat(l.tips)).end(),w.e("".concat(o," info:").concat(l.tips)),Ce({code:we.UPDATE_PROFILE_INVALID_PARAM});var h,m=[];for(h in e)Object.prototype.hasOwnProperty.call(e,h)&&(h==="profileCustomField"?e.profileCustomField.forEach(function(L){m.push({tag:L.key,value:L.value})}):m.push({tag:gt[h.toUpperCase()],value:e[h]}));if(m.length===0)return l=new ln({code:we.UPDATE_PROFILE_NO_KEY}),a.setError(l).end(),w.e("".concat(o," failed. error:"),l),Ce(l);var M=this._userM.getMyAccount();return this._userM.req({proto:le.UPDATE_MY_PROFILE,data:{fromAccount:M,profileItem:m}}).then(function(L){a.end(),w.i("".concat(o," ok"));var $=n._update(M,e),F=$.isProfileUpdated,$=$.latestProfile;return F===!0&&n._userM.emitOuterEvent(R.PROFILE_UPDATED,[$]),St($)}).catch(function(L){return a.setError(L).end(),w.e("".concat(o," failed. error:"),L),Ce(L)})}},{key:"onProfileModified",value:function(e){var n=e.dataList;if(!Je(n)){var o=n.length;w.d("".concat(this._n,".onProfileModified count:").concat(o," dataList:"),e.dataList);for(var a=[],l=0;l<o;l++){var m=n[l].userID,m=this._update(m,this._getLatestProfileFromResponse(m,n[l].profileList)),h=m.isProfileUpdated,m=m.latestProfile;h===!0&&a.push(m)}0<a.length&&(this._userM.emitInnerEvent(Rn.PROFILE_UPDATED,a),this._userM.emitOuterEvent(R.PROFILE_UPDATED,a))}}},{key:"_fill",value:function(){if(this.accountProfileMap.size===0){for(var e=this._getCachedProfiles(),n=Date.now(),o=0,a=e.length;o<a;o++)n-e[o].lastUpdatedTime<this.expirationTime&&this.accountProfileMap.set(e[o].userID,e[o]);w.l("".concat(this._n,"._fill from cache, size:").concat(this.accountProfileMap.size))}}},{key:"_update",value:function(e,n){var o,a=!1,l=Date.now();return this._contains(e)?(o=this._getProfileFromMap(e),n.profileCustomField&&xa(o.profileCustomField,n.profileCustomField)===!0&&(o.lastUpdatedTime=l,a=!0),0<Ji(o,n,["profileCustomField"])&&(o.lastUpdatedTime=l,a=!0)):(o=new Ya(n),!this._userM.isMyFriend(e)&&e!==this._userM.getMyAccount()||(o.lastUpdatedTime=l,a=!0,this.accountProfileMap.set(e,o))),this._flush(e===this._userM.getMyAccount()),a===!0&&w.l("".concat(this._n,"._update account:").concat(e," isProfileUpdated:").concat(a)),{isProfileUpdated:a,latestProfile:o}}},{key:"_flush",value:function(e){var n=V(this.accountProfileMap.values()),o=this._userM.getStorageModule();w.d("".concat(this._n,"._flush length:").concat(n.length," flushAtOnce:").concat(e)),o.setItem(this.TAG,n,e)}},{key:"_contains",value:function(e){return this.accountProfileMap.has(e)}},{key:"_getProfileFromMap",value:function(e){return this.accountProfileMap.get(e)}},{key:"_getCachedProfiles",value:function(){var e=this._userM.getStorageModule().getItem(this.TAG);return Je(e)?[]:e}},{key:"onConversationsProfileUpdated",value:function(e){for(var n,o,a,l=[],h=0,m=e.length;h<m;h++)o=(n=e[h]).userID,this._userM.isMyFriend(o)&&(this._contains(o)?(a=this._getProfileFromMap(o),0<Ji(a,n)&&l.push(o)):l.push(n.userID));l.length!==0&&(w.i("".concat(this._n,".onConversationsProfileUpdated toAccountList:").concat(l)),this.getUserProfile({userIDList:l}))}},{key:"getNickAndAvatarByUserID",value:function(e){return this._contains(e)?{nick:(e=this._getProfileFromMap(e)).nick,avatar:e.avatar}:{nick:"",avatar:""}}},{key:"getUserNickAndAvatar",value:function(l){var n=this,o=V(new Set(l)),a=(w.l("".concat(this._n,".getUserNickAndAvatar userIDList.length:").concat(l.length," uniqueUserIDList.length:").concat(o.length)),[]);if(l.length===0)return Promise.resolve(a);var l=this._createUserIDListGroup(o),h=[];return l.forEach(function(m){h.push(n.getUserProfile({userIDList:m}))}),Promise.all(h).then(function(m){return m.forEach(function(M){M=M.data.map(function(L){return{userID:L.userID,nick:L.nick,avatar:L.avatar}}),a.push.apply(a,V(M))}),a})}},{key:"_createUserIDListGroup",value:function(e){for(var n=[],o=0;o<e.length;)n.push(e.slice(o,o+=100));return n}},{key:"reset",value:function(){this._flush(!0),this.accountProfileMap.clear()}}]),fA),hA=y(function e(n){f(this,e)}),cv=(y(gA,[{key:"getLocalBlacklist",value:function(){return V(this._blacklistMap.keys())}},{key:"getBlacklist",value:function(){var e=this,n="".concat(this._n,".getBlacklist"),o={fromAccount:this._userM.getMyAccount(),maxLimited:this.maxLimited,startIndex:0,lastSequence:this.currentSequence},a=new Be("getBlacklist");return this._userM.req({proto:le.GET_BL,data:o}).then(function(m){var m=m.data,h=m.blackListItem,m=m.currentSequence,M=Je(h)?0:h.length;a.setMessage("count:".concat(M)).end(),w.i("".concat(n," ok")),e.currentSequence=m,e._handleResponse(h,!0),e._userM.emitOuterEvent(R.BLACKLIST_UPDATED,V(e._blacklistMap.keys()))}).catch(function(l){return a.setError(l).end(),w.e("".concat(n," failed. error:"),l),Ce(l)})}},{key:"addBlacklist",value:function(e){var n,o,a=this,l=new Be("addToBlacklist"),h="".concat(this._n,".addBlacklist"),m=this._userM.getMyAccount();return e.userIDList.length===1&&e.userIDList[0]===m?(o=this._userM.getErrorMessage(n=we.CANNOT_ADD_SELF_TO_BLACKLIST),l.setCode(n).setMessage(o).end(),o=new ln({code:n}),w.e("".concat(h," failed. error:"),o),Ce(o)):(e.userIDList.includes(m)&&(e.userIDList=e.userIDList.filter(function(M){return M!==m})),e.fromAccount=this._userM.getMyAccount(),e.toAccount=e.userIDList,this._userM.req({proto:le.ADD_TO_BL,data:e}).then(function(M){return l.setMessage(5<e.userIDList.length?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),w.i("".concat(h," ok")),a._handleResponse(M.resultItem,!0),ft(V(a._blacklistMap.keys()))}).catch(function(M){return l.setError(M).end(),w.e("".concat(h," failed. error:"),M),Ce(M)}))}},{key:"_handleResponse",value:function(e,n){if(!Je(e))for(var o,a,l,h=0,m=e.length;h<m;h++)a=e[h].to,l=e[h].resultCode,!xe(l)&&l!==0||(n?((o=this._blacklistMap.has(a)?this._blacklistMap.get(a):new hA).userID=a,Je(e[h].addBlackTimeStamp)||(o.timeStamp=e[h].addBlackTimeStamp),this._blacklistMap.set(a,o)):this._blacklistMap.has(a)&&(o=this._blacklistMap.get(a),this._blacklistMap.delete(a)));w.l("".concat(this._n,"._handleResponse total:").concat(this._blacklistMap.size," bAdd:").concat(n))}},{key:"deleteBlacklist",value:function(e){var n=this,o="".concat(this._n,".deleteBlacklist"),a=new Be("removeFromBlacklist");return e.fromAccount=this._userM.getMyAccount(),e.toAccount=e.userIDList,this._userM.req({proto:le.RM_FROM_BL,data:e}).then(function(l){return a.setMessage(5<e.userIDList.length?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),w.i("".concat(o," ok")),n._handleResponse(l.data.resultItem,!1),ft(V(n._blacklistMap.keys()))}).catch(function(l){return a.setError(l).end(),w.e("".concat(o," failed. error:"),l),Ce(l)})}},{key:"onAccountDeleted",value:function(e){for(var n=0,o=e.length;n<o;n++){var a=e[n];this._blacklistMap.has(a)&&this._blacklistMap.delete(a)}var l=e.length;0<l&&(w.l("".concat(this._n,".onAccountDeleted count:").concat(l," ").concat(l<30?"userIDList:".concat(e):"")),this._userM.emitOuterEvent(R.BLACKLIST_UPDATED,V(this._blacklistMap.keys())))}},{key:"onAccountAdded",value:function(e){for(var n,o=[],a=0,l=e.length;a<l;a++)n=e[a],this._blacklistMap.has(n)||(this._blacklistMap.set(n,new hA({userID:n})),o.push(n));0<o.length&&(w.l("".concat(this._n,".onAccountAdded count:").concat(o.length," userIDList:"),o),this._userM.emitOuterEvent(R.BLACKLIST_UPDATED,V(this._blacklistMap.keys())))}},{key:"reset",value:function(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),gA),lv=(y(pA,[{key:"_onCloudConfigUpdated",value:function(){var e=this._userM.getCloudConfig("status_query_count"),n=this._userM.getCloudConfig("status_sub_count"),o=this._userM.getCloudConfig("status_unsub_count");w.l("".concat(this._n,"._onCloudConfigUpdated statusQueryCount:").concat(e," statusSubscribeCount:").concat(n)+" statusUnsubscribeCount:".concat(o)),xe(e)||(this.MAX_QUERY_USER_COUNT=parseInt(e,10)),xe(e)||(this.MAX_SUBSCRIBE_USER_COUNT=parseInt(n,10)),xe(e)||(this.MAX_UNSUBSCRIBE_USER_COUNT=parseInt(o,10))}},{key:"onUserStatusUpdated",value:function(a){var a=a.dataList,n=this._userM.getMyUserID(),o=this._userM.get(12),a=a.map(function(M){var h=M.to,m=M.statusType,M=M.customStatus,M=du(M);return h===n&&o.setCustomStatus(M),{userID:h,statusType:m,customStatus:M}});w.l("".concat(this._n,".onUserStatusUpdated list:").concat(JSON.stringify(a))),this._userM.emitOuterEvent(R.USER_STATUS_UPDATED,a)}},{key:"setSelfStatus",value:function(e){var n=this,o="".concat(this._n,".setSelfStatus");if(this._userM.filterProfanity("customStatus",e)===!1)return Ce({code:we.PROFANITY_FOUND});var a=new Be("setSelfStatus"),l=e.customStatus;return this._userM.req({proto:le.SET_SELF_STATUS,data:{customStatus:l}}).then(function(h){return a.setMessage("customStatus:".concat(l)).end(),w.l("".concat(o," ok. customStatus:").concat(l)),n._userM.get(12).setCustomStatus(l),ft({userID:n._userM.getMyUserID(),statusType:1,customStatus:l})}).catch(function(h){return a.setError(h).end(),w.e("".concat(o," failed. error:"),h),Ce(h)})}},{key:"getUserStatus",value:function(a){var n="".concat(this._n,".").concat("getUserStatus"),a=a.userIDList,o=a===void 0?[]:a,a=this._userM.getMyUserID(),l=V(o),h=void 0,m=l.indexOf(a);if(-1<m&&(l.splice(m,1),h={userID:a,statusType:1,customStatus:this._userM.get(12).getCustomStatus()}),l.length===0)return St({successUserList:[h],failureUserList:[]});if(!this._userM.canIUse(pe.USER_STATUS))return this._userM.cannotUseCommercialAbility("getUserStatus");l.length>this.MAX_QUERY_USER_COUNT&&(w.w("".concat(n," ").concat(Zr(this.MAX_QUERY_USER_COUNT))),l=o.slice(0,this.MAX_QUERY_USER_COUNT));var M=new Be("getUserStatus");return this._userM.req({proto:le.GET_USER_STATUS,data:{userIDList:l}}).then(function($){var $=$.data,F=$.successUserList,F=F===void 0?[]:F,$=$.failureUserList,$=$===void 0?[]:$,F=F.map(function(ze){var he=ze.userID,be=ze.statusType,ze=ze.customStatus;return{userID:he,statusType:be,customStatus:du(ze)}}),$=$.map(function(Ye){var he=Ye.userID,be=Ye.invalidUserID,ze=Ye.errorCode,Ye=Ye.errorInfo;return{userID:Je(be)?he:be,code:ze,message:Ye}}),ue=(xe(h)||F.unshift(h),"userID count:".concat(o.length,", success count:").concat(F.length,", fail count:").concat($.length));return M.setMessage("".concat(ue)).end(),w.l("".concat(n," ok. ").concat(ue,".")),ft({successUserList:F,failureUserList:$})}).catch(function(L){return M.setMessage("userID count:".concat(o.length)).setError(L).end(),w.e("".concat(n," failed. error:"),L),Ce(L)})}},{key:"subscribeUserStatus",value:function(a){var n="subscribeUserStatus";if(!this._userM.canIUse(pe.USER_STATUS))return this._userM.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n),a=a.userIDList,a=a===void 0?[]:a,l=V(a),h=(l.length>this.MAX_SUBSCRIBE_USER_COUNT&&(w.w("".concat(o," ").concat(Zr(this.MAX_SUBSCRIBE_USER_COUNT))),l=a.slice(0,this.MAX_SUBSCRIBE_USER_COUNT)),new Be(n)),m="userID count:".concat(a.length);return w.l("".concat(o," ").concat(m)),this._userM.req({proto:le.SUB_USER_STATUS,data:{userIDList:l}}).then(function(M){return M=M.data.failureUserList,M=(M===void 0?[]:M).map(function(fe){var F=fe.userID,$=fe.invalidUserID,ue=fe.errorCode,fe=fe.errorInfo;return{userID:Je($)?F:$,code:ue,message:fe}}),h.setMessage("".concat(m," fail count:").concat(M.length)).end(),w.l("".concat(o," ok. fail count:").concat(M.length,".")),ft({failureUserList:M})}).catch(function(M){return h.setMessage(m).setError(M).end(),w.e("".concat(o," failed. error:"),M),Ce(M)})}},{key:"unsubscribeUserStatus",value:function(o){var m="unsubscribeUserStatus";if(!this._userM.canIUse(pe.USER_STATUS))return this._userM.cannotUseCommercialAbility(m);var n="".concat(this._n,".").concat(m),o=(o||{}).userIDList,o=o===void 0?[]:o,a=V(o),l=(o.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(w.w("".concat(n," ").concat(Zr(this.MAX_UNSUBSCRIBE_USER_COUNT))),a=o.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT)),new Be(m)),h="userID count:".concat(o.length),m=(w.l("".concat(n," ").concat(h)),{userIDList:a});return a.length===0&&(m.userIDList=void 0,m.unsubscribeAll=1),this._userM.req({proto:le.UNSUB_USER_STATUS,data:m}).then(function(M){return M=M.data.failureUserList,M=(M===void 0?[]:M).map(function(fe){var F=fe.userID,$=fe.invalidUserID,ue=fe.errorCode,fe=fe.errorInfo;return{userID:Je($)?F:$,code:ue,message:fe}}),l.setMessage("".concat(h," fail count:").concat(M.length)).end(),w.l("".concat(n," ok. fail count:").concat(M.length,".")),ft({failureUserList:M})}).catch(function(M){return l.setMessage("".concat(h)).setError(M).end(),w.e("".concat(n," failed. error:"),M),Ce(M)})}},{key:"reset",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),pA),uv=(E(mc,Pn),pc=B(mc),y(mc,[{key:"onContextUpdated",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:"mockOnNickAvatarModified",value:function(e,n){w.l("".concat(this._n,"._mockOnNickAvatarModified nick:").concat(e," avatar:").concat(n)),this.onProfileModified({dataList:[{pushType:1,userID:this.getMyUserID(),profileList:[{tag:gt.NICK,value:e},{tag:gt.AVATAR,value:n}]}]})}},{key:"onProfileModified",value:function(e){this._profileHandler.onProfileModified(e)}},{key:"onRelationChainModified",value:function(a){var n,o,a=a.dataList;Je(a)||(n=[],a.forEach(function(l){l.blackListDelAccount&&n.push.apply(n,V(l.blackListDelAccount))}),0<n.length&&this._blacklistHandler.onAccountDeleted(n),o=[],a.forEach(function(l){l.blackListAddAccount&&o.push.apply(o,V(l.blackListAddAccount))}),0<o.length&&this._blacklistHandler.onAccountAdded(o))}},{key:"onConversationsProfileUpdated",value:function(e){this._profileHandler.onConversationsProfileUpdated(e)}},{key:"getMyAccount",value:function(){return this.getMyUserID()}},{key:"getMyNick",value:function(){return this._profileHandler.getNickAndAvatarByUserID(this.getMyUserID()).nick}},{key:"getMyProfile",value:function(){return this._profileHandler.getMyProfile()}},{key:"getStorageModule",value:function(){return this.get(13)}},{key:"filterProfanity",value:function(e,n){var a=this.get(29);if(!a)return!0;var a=a.filterText(n[e],"user_profile"),o=a.isAllowedToSend,a=a.modifiedText;return o===!0&&(n[e]=a,!0)}},{key:"isMyFriend",value:function(e){var n=this.get(8);return!!n&&n.isMyFriend(e)}},{key:"getUserProfile",value:function(e){return this._profileHandler.getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._profileHandler.updateMyProfile(e)}},{key:"getNickAndAvatarByUserID",value:function(e){return this._profileHandler.getNickAndAvatarByUserID(e)}},{key:"getUserNickAndAvatar",value:function(e){return this._profileHandler.getUserNickAndAvatar(e)}},{key:"getLocalBlacklist",value:function(){var e=this._blacklistHandler.getLocalBlacklist();return St(e)}},{key:"addBlacklist",value:function(e){return this._blacklistHandler.addBlacklist(e)}},{key:"deleteBlacklist",value:function(e){return this._blacklistHandler.deleteBlacklist(e)}},{key:"onUserStatusUpdated",value:function(e){this._userStatusHandler.onUserStatusUpdated(e)}},{key:"setSelfStatus",value:function(e){return this._userStatusHandler.setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._userStatusHandler.getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._userStatusHandler.subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._userStatusHandler.unsubscribeUserStatus(e)}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._profileHandler.reset(),this._blacklistHandler.reset(),this._userStatusHandler.reset()}}]),mc),gg=(y(na,[{key:"isLoggedIn",value:function(){return this._isLoggedIn}},{key:"isOversea",value:function(){return this._oversea}},{key:"isPrivateNetWork",value:function(){return this._proxyServer}},{key:"isDevMode",value:function(){return this._isDevMode}},{key:"isTestEnv",value:function(){return this._isTestEnv}},{key:"isSingaporeSite",value:function(){return 2e7<=this._SDKAppID&&this._SDKAppID<3e7||172e7<=this._SDKAppID&&this._SDKAppID<173e7}},{key:"isKoreaSite",value:function(){return 3e7<=this._SDKAppID&&this._SDKAppID<4e7||173e7<=this._SDKAppID&&this._SDKAppID<174e7}},{key:"isGermanySite",value:function(){return 4e7<=this._SDKAppID&&this._SDKAppID<5e7||174e7<=this._SDKAppID&&this._SDKAppID<175e7}},{key:"isIndiaSite",value:function(){return 5e7<=this._SDKAppID&&this._SDKAppID<6e7||175e7<=this._SDKAppID&&this._SDKAppID<176e7}},{key:"isJapanSite",value:function(){return 6e7<=this._SDKAppID&&this._SDKAppID<7e7||176e7<=this._SDKAppID&&this._SDKAppID<177e7}},{key:"isUSASite",value:function(){return 7e7<=this._SDKAppID&&this._SDKAppID<8e7||177e7<=this._SDKAppID&&this._SDKAppID<178e7}},{key:"isIndonesiaSite",value:function(){return 8e7<=this._SDKAppID&&this._SDKAppID<9e7||178e7<=this._SDKAppID&&this._SDKAppID<179e7}},{key:"isIntl",value:function(){return(e=this._SDKAppID)===0||2e7<=e&&e<9e7||172e7<=e&&e<179e7;var e}},{key:"isUnlimitedAVChatRoom",value:function(){return this._unlimitedAVChatRoom}},{key:"isUsingChatCore",value:function(){return this._isUsingChatCore}},{key:"setUsingChatCore",value:function(e){this._isUsingChatCore=e}},{key:"getUIPlatform",value:function(){return this._uiPlatform}},{key:"setUIPlatform",value:function(e){this._uiPlatform=e}},{key:"setUserID",value:function(e){this._userID=e}},{key:"getUserID",value:function(){return this._userID}},{key:"setUserSig",value:function(e){this._userSig=e}},{key:"getUserSig",value:function(){return this._userSig}},{key:"getSDKAppID",value:function(){return this._SDKAppID}},{key:"setTinyID",value:function(e){this._tinyID=e,this._isLoggedIn=!0}},{key:"getTinyID",value:function(){return this._tinyID}},{key:"setCustomStatus",value:function(e){this._customStatus=e}},{key:"getCustomStatus",value:function(){return this._customStatus}},{key:"getScene",value:function(){return Jn?window.tencent_cloud_im_csig_flutter_for_web_25F_cy:this._isTUIKit()?"tuikit":this._scene}},{key:"getInstanceID",value:function(){return this._instanceID}},{key:"getStatusInstanceID",value:function(){return this._statusInstanceID}},{key:"setStatusInstanceID",value:function(e){this._statusInstanceID=e}},{key:"getVersion",value:function(){return this._version}},{key:"getA2Key",value:function(){return this._a2Key}},{key:"setA2Key",value:function(e){this._a2Key=e}},{key:"getContentType",value:function(){return this._contentType}},{key:"getProxyServer",value:function(){return this._proxyServer}},{key:"getFileUploadProxy",value:function(){return this._fileUploadProxy}},{key:"getFileDownloadProxy",value:function(){return this._fileDownloadProxy}},{key:"setApplicationID",value:function(e){this._applicationID=e}},{key:"getApplicationID",value:function(){return this._applicationID}},{key:"_isTUIKit",value:function(){var e=!1,n=!1,o=!1,a=!1,M=[];Fe&&(M=Object.keys(Ne));for(var l=0,h=(M=lt?Object.keys(Ze?uni:window):M).length;l<h;l++)if(M[l].toLowerCase().includes("uikit")){e=!0;break}var m,M=null,L=(Fe&&!Hn(Ne.createGamePortal)&&Hn(getApp)&&!xe(getApp())&&(m=getApp().globalData,Qt(m)&&m.isTUIKit===!0&&(n=!0)),this._m.get(13).getStorageSync("TIM_".concat(this._SDKAppID,"_isTUIKit"))===!0&&(o=!0),null);if(Ie&&!Me&&typeof uni>"u"&&__wxConfig&&(L=__wxConfig.pages),ye&&typeof uni>"u"&&__qqConfig&&(L=__qqConfig.pages),At(L)&&0<L.length){for(var F=0,$=L.length;F<$;F++)if(L[F].toLowerCase().includes("tui")){a=!0;break}L=null}return e||n||o||a}},{key:"reset",value:function(){this._isLoggedIn=!1,this._userSig="",this._a2Key="",this._tinyID="",this._customStatus="",this._statusInstanceID=0}}]),na),dv={"k-vue2-pc":1,"k-vue2-h5":2,"k-vue2-h5-uni":3,"k-vue2-app-uni":4,"k-vue2-mp-uni":5,"k-vue2-pc-uni":6,"k-vue3-pc":7,"k-vue3-h5":8,"k-vue3-h5-uni":9,"k-vue3-app-uni":10,"k-vue3-mp-uni":11,"k-vue3-pc-uni":12},Av=(E(fc,Pn),cg=B(fc),y(fc,[{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&e%this._helloInterval==0&&this._hello()}},{key:"getPushModule",value:function(){var e=void 0,n=this.get(36),o=this.get(28);return n.canIUseTIMPush()?e=n:o.canIUseOfflinePush()&&(e=o),e}},{key:"login",value:function(a){if(this.isLoggedIn())return n=this.getMyUserID(),(n=this.getErrorMessage("RepeatLogin",n))&&w.w(n),St({actionStatus:"OK",errorCode:0,errorInfo:n,repeatLogin:!0});if(Date.now()-this._lastLoginTs<=15e3)return this.outputWarning("LoggingIn",a.userID),Ce({code:we.REPEAT_LOGIN});w.l("".concat(this._n,".login userID:").concat(a.userID));var n=this._checkLoginInfo(a);if(n.code!==0)return Ce(n);var n=this.get(12),o=a.userID,a=a.userSig;return n.setUserID(o),n.setUserSig(a),this.get(20).updateProtocolConfig(),this._login()}},{key:"_login",value:function(){var e=this,n=this.get(12),o=n.getScene(),a=0,l=o,h=(o&&o.startsWith("k-")&&(l=dv[o],o="tuikit"),new Be("login")),M=(h.setMessage("".concat(l)).setMoreMessage("identifier:".concat(this.getMyUserID())),o==="tuikit"),m=0,M=(Ze?m=M?l===3||l===4||l===5||l===6?31:l===9||l===10||l===11||l===12?32:4:3:Fe?m=Ae?36:o==="tuikit"?12:11:lt&&(m=Jn?o==="flutter_web_uikit"?21:20:this._isReactUIKit()?Gn?25:24:M?l===1||l===2?29:l===7||l===8?30:Gn?17:14:Gn?16:13),h.setUIPlatform(m),n.setUIPlatform(m),this.getPushModule()),L=(M&&(this._isWebUniapp=M.getUniAppPlatform(),l=this._getStatusInstanceID(),n.setStatusInstanceID(l),this.get(20).updateProtocolConfig(),a=M.getDeviceBrand()),"".concat(this._n,"._login"));return this._lastLoginTs=Date.now(),this.req({proto:le.LOGIN,data:{deviceBrand:a,isWebUniapp:this._isWebUniapp}}).then(function(F){e._lastLoginTs=0;var In=Date.now(),$=null,Tt=F.data,ue=Tt.a2Key,fe=Tt.tinyID,he=Tt.helloInterval,be=Tt.instanceID,ze=Tt.timeStamp,Ye=Tt.customStatus,Ye=Ye===void 0?"":Ye,Tt=Tt.purchaseBits,Ct=1e3*ze,Bt=In-h.getStartTs(),Bt=Ct+parseInt(Bt/2)-In,In=h.getStartTs()+Bt;if(h.start(In),In=Ct,He=Bt,(Ct=new Date).setTime(In),w.i("baseTime from server:".concat(Ct," offset:").concat(He)),!fe)throw $=new ln({code:we.NO_TINYID}),h.setError($).end(),$;if(!ue)throw $=new ln({code:we.NO_A2KEY}),h.setError($).end(),$;return In=du(Ye),Ct="scene:".concat(o," helloInterval:").concat(he," instanceID:").concat(be," timeStamp:").concat(ze," offset:").concat(Bt," customStatus:").concat(In," "),w.l("".concat(L," ok. ").concat(Ct)),$="",Ye="",Ie&&Hn(Ne.getAccountInfoSync)&&(ze=Ne.getAccountInfoSync().miniProgram)&&($=ze.appId,Ye=ze.envVersion),h.setMoreMessage("".concat(Ct," href:").concat(lt?window.location.href:""," mpAppId:").concat($," envVersion:").concat(Ye)).end(),n.setA2Key(ue),n.setTinyID(fe),n.setStatusInstanceID(be),n.setCustomStatus(In),Tt&&e.get(27).onPushedConfig({errorCode:0,expiredTime:0,purchaseBits:Tt}),e.get(20).updateProtocolConfig(),e.emitInnerEvent(Rn.A2KEY_AND_TINYID_UPDATED),e._helloInterval=he,e.triggerReady(),Bt=e.getPushModule(),Bt&&(uni.setStorageSync("timUniAppInstanceID",be),Bt.init()),e._fetchCloudControlConfig(),e.get(29).init(),F}).catch(function(F){return h.setError(F).end(!0),e._m.setNotReadyReason(we.LOGIN_FAILED),w.e("".concat(L," failed. error:"),F),e._lastLoginTs=0,e._m.onLoginFailed(),Ce(F)})}},{key:"logout",value:function(){var e=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:0;if(!this.isLoggedIn())return Ce({code:we.USER_NOT_LOGGED_IN});new Be("logout").setMessage("identifier:".concat(this.getMyUserID())).end(!0);var o="".concat(this._n,".logout");return w.i("".concat(o," type:").concat(n)),n===0&&this._m.setNotReadyReason(we.LOGGED_OUT),this.req({proto:le.LOGOUT,data:{type:n}}).then(function(){return e.resetReady(),St({})}).catch(function(a){return w.e("".concat(o," error:"),a),e.resetReady(),St({})})}},{key:"getLoginUser",value:function(){return this.isLoggedIn()?this.getMyUserID():""}},{key:"_fetchCloudControlConfig",value:function(){this.get(23).fetchConfig()}},{key:"_getStatusInstanceID",value:function(){return uni.getStorageSync("timUniAppInstanceID")||0}},{key:"_hello",value:function(){var e=this;this._lastWsHelloTs=Date.now(),this.req({proto:le.HELLO,data:{isWebUniapp:this._isWebUniapp}}).catch(function(n){w.w("".concat(e._n,"._hello error:"),n)})}},{key:"getLastWsHelloTs",value:function(){return this._lastWsHelloTs}},{key:"_checkLoginInfo",value:function(e){var n=0;return Je(this.get(12).getSDKAppID())?n=we.NO_SDKAPPID:Je(e.userID)?n=we.NO_IDENTIFIER:Je(e.userSig)&&(n=we.NO_USERSIG),{code:n}}},{key:"_isReactUIKit",value:function(){return lt&&window.tencent_cloud_im_csig_react_uikit_23F_xa!==void 0}},{key:"onMultipleAccountKickedOut",value:function(e){var n=this;new Be("kickedOut").setMessage("type:".concat(C.KICKED_OUT_MULT_ACCOUNT," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),w.w("".concat(this._n,".onMultipleAccountKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then(function(){n.emitOuterEvent(R.KICKED_OUT,{type:C.KICKED_OUT_MULT_ACCOUNT}),n._m.setNotReadyReason(we.KICKED_OUT_MULT_ACCOUNT),n._m.reset()})}},{key:"onMultipleDeviceKickedOut",value:function(e){var n=this;new Be("kickedOut").setMessage("type:".concat(C.KICKED_OUT_MULT_DEVICE," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),w.w("".concat(this._n,".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then(function(){n.emitOuterEvent(R.KICKED_OUT,{type:C.KICKED_OUT_MULT_DEVICE}),n._m.setNotReadyReason(we.KICKED_OUT_MULT_DEVICE),n._m.reset()})}},{key:"onUserSigExpired",value:function(){new Be("kickedOut").setMessage(C.KICKED_OUT_USERSIG_EXPIRED).end(!0),w.w("".concat(this._n,".onUserSigExpired userID:").concat(this.getMyUserID())),this.get(12).getStatusInstanceID()!==0&&(this.emitOuterEvent(R.KICKED_OUT,{type:C.KICKED_OUT_USERSIG_EXPIRED}),this._m.setNotReadyReason(we.KICKED_OUT_USERSIG_EXPIRED),this._m.reset())}},{key:"onRestApiKickedOut",value:function(e){new Be("kickedOut").setMessage("type:".concat(C.KICKED_OUT_REST_API," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),w.w("".concat(this._n,".onRestApiKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.get(12).getStatusInstanceID()!==0&&(this.emitOuterEvent(R.KICKED_OUT,{type:C.KICKED_OUT_REST_API}),this._m.setNotReadyReason(we.KICKED_OUT_REST_API),this._m.reset(),this.get(21).onRestApiKickedOut())}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0,this._lastWsHelloTs=0,this._isWebUniapp=0}}]),fc);function fc(e){return f(this,fc),(e=cg.call(this,e))._n="SignModule",e._helloInterval=120,e._lastLoginTs=0,e._lastWsHelloTs=0,e._isWebUniapp=0,uA.mixin(k(e)),e}function na(e,n){f(this,na),this._m=e,this._isLoggedIn=!1,this._SDKAppID=n.SDKAppID,this._userID=n.userID||"",this._userSig=n.userSig||"",this._version="3.3.1",this._a2Key="",this._tinyID="",this._customStatus="",this._contentType="json",this._unlimitedAVChatRoom=n.unlimitedAVChatRoom,this._scene=n.scene||"",this._oversea=n.oversea,this._instanceID=n.instanceID,this._statusInstanceID=0,this._isDevMode=n.devMode,this._isTestEnv=n.testEnv,this._proxyServer=n.proxyServer,this._fileUploadProxy=n.fileUploadProxy,this._fileDownloadProxy=n.fileDownloadProxy,this._applicationID=0,this._isUsingChatCore=!1,this._uiPlatform=0}function mc(e){return f(this,mc),(e=pc.call(this,e))._n="UserModule",e._profileHandler=new sv(k(e)),e._blacklistHandler=new cv(k(e)),e._userStatusHandler=new lv(k(e)),e.getInnerEmitterInstance().on(Rn.A2KEY_AND_TINYID_UPDATED,e.onContextUpdated,k(e)),e}function pA(e){f(this,pA),this._userM=e,this._n="UserStatusHandler",this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100,this._userM.getInnerEmitterInstance().on(Rn.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}function gA(e){f(this,gA),this._userM=e,this._n="BlacklistHandler",this._blacklistMap=new Map,this.startIndex=0,this.maxLimited=100,this.currentSequence=0}function fA(e){f(this,fA),this._userM=e,this._n="ProfileHandler",this.TAG="profile",this.accountProfileMap=new Map,this.expirationTime=864e5}function ia(e){return f(this,ia),(e=Au.call(this,e))._n="TopicModule",e._topicMap=new Map,e._getTopicTimeMap=new Map,e.TOPIC_CACHE_TIME=300,e.TOPIC_LAST_ACTIVE_TIME=3600,e.getInnerEmitterInstance().on(Rn.CLOUD_CONFIG_UPDATED,e._onCloudConfigUpdated,k(e)),e}function _c(e,n){f(this,_c),this.topicID="",this.topicName="",this.avatar="",this.introduction="",this.notification="",this.unreadCount=0,this.muteAllMembers=!1,this.customData="",this.groupAtInfoList=[],this.nextMessageSeq=0,this.lastMessage=uu(e.lastMessage,n),this.selfInfo={muteTime:0,readedSequence:0,messageRemindType:"",excludedUnreadSequenceList:void 0},this._initTopic(e)}function vc(e){return f(this,vc),(e=lg.call(this,e))._n="GroupModule",e._commonGroupHandler=new ev(k(e)),e._groupAttributesHandler=new ao(k(e)),e._groupCountersHandler=new gc(k(e)),e._AVChatRoomHandler=new AA(k(e)),e._groupTipsHandler=new $_(k(e)),e._groupSystemNoticeHandler=new pg(k(e)),e._groupMemberHandler=new hg(k(e)),e.groupMap=new Map,e._unjoinedAVChatRoomList=new Map,e._receiptDetailCompleteMap=new Map,e._onlineMemberCountMap=new Map,e._timeoutIDs=[],e.getInnerEmitterInstance().on(Rn.CLOUD_CONFIG_UPDATED,e._onCloudConfigUpdated,k(e)),e}function mA(e){f(this,mA),this._grpM=e,this._n="GroupSystemNoticeHandler",this.pendencyMap=new Map}function _A(e){f(this,_A),this._grpM=e,this._n="GroupMemberHandler",this.groupMemberListMap=new Map,this.DEFAULT_MEMBER_INFO_FILTER=["Role","JoinTime","NameCard","ShutUpUntil","OnlineStatus"],this._grpM.getInnerEmitterInstance().on(Rn.PROFILE_UPDATED,this._onProfileUpdated,this)}function vA(e){f(this,vA),this.userID="",this.avatar="",this.nick="",this.role="",this.joinTime="",this.lastSendMsgTime="",this.nameCard="",this.muteUntil=0,this.memberCustomField=[],this.isOnline=!1,this.updateMember(e)}function IA(e){f(this,IA),this._grpM=e,this._n="AVChatRoomHandler",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this.sequencesLinkedList=new dA(200),this.messageIDLinkedList=new dA(100),this._reportMessageStackedCount=0,this._onlineMemberCountMap=new Map,this.DEFAULT_EXPIRE_TIME=60,this.DEFAULT_POLLING_INTERVAL=300,this.MAX_POLLING_INTERVAL=2e3,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0,this._startBroadcastSeq=1,this._broadcastMessageIDMap=new Map,this.DEFAULT_POLLING_SIMPLIFIED_MSG=0}function yA(h){f(this,yA);var n=h.manager,o=h.groupID,a=h.onInit,l=h.onSuccess,h=h.onFail;this._n="Polling",this._manager=n,this._grpM=n._grpM,this._onInit=a,this._onSuccess=l,this._onFail=h,this._groupID=o,this._timeoutID=-1,this._isRunning=!1,this._proto=le.AV_POLLING}function zn(e){f(this,zn),this._grpM=e,this._n="GroupCountersHandler",this._groupCountersMap=new Map,this.EXPIRE_TIME=3e4,this._grpM.getInnerEmitterInstance().on(Rn.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}function TA(e){f(this,TA),this._grpM=e,this._n="GroupAttributesHandler",this._groupAttributesMap=new Map,this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4,this._grpM.getInnerEmitterInstance().on(Rn.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}function EA(e){f(this,EA),this._grpM=e,this._n="CommonGroupHandler",this.tempConversationList=null,this._cachedGroupMessageMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this.PAGING_GRP_COUNT_LIMIT=200,this._pagingStatus=wo,this._pagingGetCostList=[],e.getInnerEmitterInstance().on(Rn.A2KEY_AND_TINYID_UPDATED,this.syncGroupList,this)}function CA(e){f(this,CA),this._grpM=e,this._n="GroupTipsHandler",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4}function Ic(e){return f(this,Ic),(e=ug.call(this,e))._n="ConversationModule",uA.mixin(k(e)),e._messageListHandler=new W_,e._messageRemindHandler=new X_(k(e)),e._convGroupHandler=new J_(k(e)),e.singlyLinkedList=new dA(100),e._pagingStatus=wo,e._pagingTimeStamp=0,e._pagingStartIndex=0,e._pagingPinnedTimeStamp=0,e._pagingPinnedStartIndex=0,e._pagingConvIDMap=new Map,e._convIDFromUnreadDBMap=new Map,e._conversationMap=new Map,e._tmpGroupList=[],e._tmpGroupAtTipsList=[],e._peerReadTimeMap=new Map,e._completedMap=new Map,e._roamingMessageKeyAndTimeMap=new Map,e._roamingMessageSequenceMap=new Map,e._remoteGroupReadSequenceMap=new Map,e._convTotalUnreadCount=0,e._pagingGetCostList=[],e._initListeners(),e}function MA(e){f(this,MA),this._convM=e,this._n="ConvGroupHandler",this._convGroupMap=new Map,this._startIndex=0,this._pagingStatus=wo}function gu(e){f(this,gu),this._convM=e,this._n="MessageRemindHandler"}function yc(e,n){var o=2<arguments.length&&arguments[2]!==void 0&&arguments[2];f(this,yc),this.conversationID=e.conversationID||"",this.unreadCount=e.unreadCount||0,this.type=e.type||"",this.lastMessage=lu(e.lastMessage,n,o),e.lastMsgTime&&(this.lastMessage.lastTime=e.lastMsgTime),this._isInfoCompleted=!1,this.peerReadTime=e.peerReadTime||0,this.groupAtInfoList=[],this.remark="",this.isPinned=e.isPinned||!1,this.messageRemindType=e.messageRemindType,this.markList=e.markList||[],this.customData=e.customData||"",this.conversationGroupList=e.conversationGroupList||[],this.draftText=e.draftText||"",this._initProfile(e),this.subType=this.groupProfile?this.groupProfile.type:""}function SA(e){f(this,SA),this.groupID="",this.name="",this.avatar="",this.type="",this.introduction="",this.notification="",this.ownerID="",this.createTime="",this.infoSequence="",this.lastInfoTime="",this.selfInfo={messageRemindType:"",joinTime:"",nameCard:"",role:"",userID:"",memberCustomField:void 0,readedSequence:0,excludedUnreadSequenceList:void 0},this.lastMessage={lastTime:"",lastSequence:"",fromAccount:"",messageForShow:""},this.nextMessageSeq="",this.memberNum="",this.memberCount="",this.maxMemberNum="",this.maxMemberCount="",this.joinOption="",this.inviteOption="",this.groupCustomField=[],this.muteAllMembers=!1,this.isSupportTopic=!1,this._lastRevokedTime=0,this._initGroup(e)}function Ka(e){f(this,Ka),this.MAX_LENGTH=e,this.pTail=null,this.pNodeToDel=null,this.map=new Map}function DA(e){var n=this;f(this,DA),Je(e)||(this.userID=e.userID||"",this.nick=e.nick||"",this.gender=e.gender||"",this.birthday=e.birthday||0,this.location=e.location||"",this.selfSignature=e.selfSignature||"",this.allowType=e.allowType||C.ALLOW_TYPE_ALLOW_ANY,this.language=e.language||0,this.avatar=e.avatar||"",this.messageSettings=e.messageSettings||0,this.adminForbidType=e.adminForbidType||C.FORBID_TYPE_NONE,this.level=e.level||0,this.role=e.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],Je(e.profileCustomField)||e.profileCustomField.forEach(function(o){n.profileCustomField.push({key:o.key,value:o.value})}))}function fu(){return null}function fg(e){var n=e.get(12);return{SDKType:10,SDKAppID:n.getSDKAppID(),SDKVersion:n.getVersion(),tinyID:Number(n.getTinyID()),userID:n.getUserID(),platform:e.getPlatform(),instanceID:n.getInstanceID(),traceID:dt()}}y(bA,[{key:"_errorTolerantHandle",value:function(){Fe||!xe(window)&&this._canIUseCookies()||(this.getItem=fu,this.setItem=fu,this.removeItem=fu,this.clear=fu)}},{key:"onCheckTimer",value:function(e){e%20==0&&this._storageQueue.size!==0&&this._doFlush()}},{key:"_doFlush",value:function(){try{var e,n=J(this._storageQueue);try{for(n.s();!(e=n.n()).done;){var o=K(e.value,2),a=o[0],l=o[1];this._setStorageSync(this._getKey(a),l)}}catch(h){n.e(h)}finally{n.f()}this._storageQueue.clear()}catch(h){w.w("".concat(this._n,"._doFlush error:"),h)}}},{key:"_getPrefix",value:function(){var e=this._m.get(12);return"TIM_".concat(e.getSDKAppID(),"_").concat(e.getUserID(),"_")}},{key:"_getKey",value:function(e){return"".concat(this._getPrefix()).concat(e)}},{key:"getItem",value:function(e){var n=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];try{var o=n?this._getKey(e):e;return this.getStorageSync(o)}catch(a){return w.w("".concat(this._n,".getItem error:"),a),{}}}},{key:"setItem",value:function(e,n){var o;2<arguments.length&&arguments[2]!==void 0&&arguments[2]?(o=!(3<arguments.length&&arguments[3]!==void 0)||arguments[3]?this._getKey(e):e,this._setStorageSync(o,n)):this._storageQueue.set(e,n)}},{key:"clear",value:function(){try{Fe?Ne.clearStorageSync():this._canIUseCookies()&&localStorage.clear()}catch(e){w.w("".concat(this._n,".clear error:"),e)}}},{key:"removeItem",value:function(e){var n=!(1<arguments.length&&arguments[1]!==void 0)||arguments[1];try{var o=n?this._getKey(e):e;this._removeStorageSync(o)}catch(a){w.w("".concat(this._n,".removeItem error:"),a)}}},{key:"getSize",value:function(e){var n=this,o=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"b";try{var a={size:0,limitSize:5242880,unit:o};if(Object.defineProperty(a,"leftSize",{enumerable:!0,get:function(){return a.limitSize-a.size}}),Fe&&(a.limitSize=1024*Ne.getStorageInfoSync().limitSize),e)a.size=JSON.stringify(this.getItem(e)).length+this._getKey(e).length;else if(Fe)Ne.getStorageInfoSync().keys.forEach(function(h){a.size+=JSON.stringify(n.getStorageSync(h)).length+n._getKey(h).length});else if(this._canIUseCookies())for(var l in localStorage)localStorage.hasOwnProperty(l)&&(a.size+=localStorage.getItem(l).length+l.length);return this._convertUnit(a)}catch(h){w.w("".concat(this._n," error:"),h)}}},{key:"_convertUnit",value:function(e){var n,o={},a=e.unit;for(n in o.unit=a,e)typeof e[n]=="number"&&(a.toLowerCase()==="kb"?o[n]=Math.round(e[n]/1024):a.toLowerCase()==="mb"?o[n]=Math.round(e[n]/1024/1024):o[n]=e[n]);return o}},{key:"_setStorageSync",value:function(e,n){Fe?Pe?my.setStorageSync({key:e,data:n}):Ne.setStorageSync(e,n):this._canIUseCookies()&&localStorage.setItem(e,JSON.stringify(n))}},{key:"getStorageSync",value:function(e){return Fe?Pe?my.getStorageSync({key:e}).data:Ne.getStorageSync(e):this._canIUseCookies()?JSON.parse(localStorage.getItem(e)):{}}},{key:"_removeStorageSync",value:function(e){Fe?Pe?my.removeStorageSync({key:e}):Ne.removeStorageSync(e):this._canIUseCookies()&&localStorage.removeItem(e)}},{key:"_canIUseCookies",value:function(){return navigator&&navigator.cookieEnabled&&localStorage}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._doFlush()}}]);var NA,hv=bA,RA=(y(Lr,[{key:"pushIn",value:function(e){w.d("".concat(this._n,".pushIn"),this._report.length,e),this._report.push(e)}},{key:"backfill",value:function(e){var n;At(e)&&e.length!==0&&(w.d("".concat(this._n,".backfill"),this._report.length,e.length),(n=this._report).unshift.apply(n,V(e)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return this._report.length===0}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getLogsInMemory",value:function(){var e=this._report.slice();return this._reset(),e}}]),Lr),mg=(E(Qa,Pn),NA=B(Qa),y(Qa,[{key:"reportAtOnce",value:function(){this._report()}},{key:"_onLoginSuccess",value:function(){var e=this,n=this.get(13),o=n.getItem(this.TAG,!1);!Je(o)&&Hn(o.forEach)&&(w.l("".concat(this._n,"._onLoginSuccess. logs count:").concat(o.length)),o.forEach(function(a){e._reportBody.pushIn(a)}),n.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("evt_rpt_threshold"),n=this.getCloudConfig("evt_rpt_waiting"),o=this.getCloudConfig("evt_rpt_level"),a=this.getCloudConfig("evt_rpt_sdkappid_bl"),l=this.getCloudConfig("evt_rpt_tinyid_wl");xe(e)||(this.MIN_THRESHOLD=Number(e)),xe(n)||(this.WAITING_TIME=Number(n)),xe(o)||(this.REPORT_LEVEL=o.split(",").map(function(h){return Number(h)})),xe(a)||(this.REPORT_SDKAPPID_BLACKLIST=a.split(",").map(function(h){return Number(h)})),xe(l)||(this.REPORT_TINYID_WHITELIST=l.split(","))}},{key:"pushIn",value:function(e){e instanceof Be&&(e.updateTimeStamp(),this._reportBody.pushIn(e),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD&&this._report())}},{key:"onCheckTimer",value:function(){Date.now()<this._lastReportTime+this.WAITING_TIME||this._reportBody.isEmpty()||this._report()}},{key:"_filterLogs",value:function(e){var n=this,a=this.get(12),o=a.getSDKAppID(),a=a.getTinyID();return Zl(this.REPORT_SDKAPPID_BLACKLIST,o)&&!$l(this.REPORT_TINYID_WHITELIST,a)?[]:e.filter(function(l){return n.REPORT_LEVEL.includes(l.level)})}},{key:"_report",value:function(){var e,n,o=this;this._reportBody.isEmpty()||(e=this._reportBody.getLogsInMemory(),(n=this._filterLogs(e)).length!==0?(n={header:fg(this),event:n},this.req({proto:le.SSO_STAT,data:u({},n)}).then(function(){o._lastReportTime=Date.now()}).catch(function(a){w.w("".concat(o._n,"._report failed. error:"),a),o._lastReportTime=Date.now(),o._reportBody.backfill(e),o._reportBody.getLogsNumInMemory()>o.MAX_THRESHOLD&&o._flushAtOnce()})):this._lastReportTime=Date.now())}},{key:"_flushAtOnce",value:function(){var e=this.get(13),n=e.getItem(this.TAG,!1),o=this._reportBody.getLogsInMemory(),a="".concat(this._n,"._flushAtOnce");Je(n)?(w.l("".concat(a," count:").concat(o.length)),e.setItem(this.TAG,o,!0,!1)):((o=o.concat(n)).length>this.MAX_THRESHOLD&&(o=o.slice(0,this.MAX_THRESHOLD)),w.l("".concat(a," count:").concat(o.length)),e.setItem(this.TAG,o,!0,!1))}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),Qa),LA="none",Tc="online",pv=(y(OA,[{key:"start",value:function(){var e=this,n="".concat(this._n,".start");Fe?(Ne.getNetworkType({success:function(o){e._networkType=o.networkType||o.subtype||"",o.networkType===LA?w.w("".concat(n," no network, please check!")):w.i("".concat(n," networkType:").concat(o.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),Ne.onNetworkStatusChange(this._mpNetworkStatusCallback)):(this._networkType=Tc,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window&&(window.addEventListener("online",this._webOnlineCallback),window.addEventListener("offline",this._webOfflineCallback)))}},{key:"_onWebOnline",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:Tc})}},{key:"_onWebOffline",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:LA})}},{key:"_onNetworkStatusChange",value:function(o){var n=o.isConnected,o=o.networkType,a="".concat(this._n,"._onNetworkStatusChange"),l=!1,h="previous:".concat(this._networkType," current:").concat(o);n?(w.i("".concat(a," ").concat(h)),this._networkType!==o&&(l=!0,this._networkType=o,this._m.get(21).reConnect(!0))):this._networkType!==o&&(l=!0,this._networkType=o,w.w("".concat(a," no network, please check!")),this._m.get(21).offline()),l&&new Be("networkChange").setMessage("isConnected:".concat(n," ").concat(h)).end()}},{key:"isOnline",value:function(){return this._networkType!==LA}},{key:"getNetworkType",value:function(){return this._networkType}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),Fe?this._mpNetworkStatusCallback!==null&&(Ne.offNetworkStatusChange&&(We||Me?Ne.offNetworkStatusChange(this._mpNetworkStatusCallback):Ne.offNetworkStatusChange()),this._mpNetworkStatusCallback=null):window&&(this._webOnlineCallback!==null&&(window.removeEventListener("online",this._webOnlineCallback),this._webOnlineCallback=null),this._onWebOffline!==null&&(window.removeEventListener("offline",this._webOfflineCallback),this._webOfflineCallback=null))}}]),OA);function OA(e){f(this,OA),this._m=e,this._networkType=Tc,this._n="NetMonitorModule",this.MAX_WAIT_TIME=3e3,this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null}function Qa(e){f(this,Qa),(e=NA.call(this,e))._n="EventStatModule",e.TAG="im-ssolog-event",e._reportBody=new RA,e.MIN_THRESHOLD=20,e.MAX_THRESHOLD=100,e.WAITING_TIME=6e4,e.REPORT_LEVEL=[4,5,6],e.REPORT_SDKAPPID_BLACKLIST=[],e.REPORT_TINYID_WHITELIST=[],e._lastReportTime=Date.now();var n=e.getInnerEmitterInstance();return n.on(Rn.A2KEY_AND_TINYID_UPDATED,e._onLoginSuccess,k(e)),n.on(Rn.CLOUD_CONFIG_UPDATED,e._onCloudConfigUpdated,k(e)),e}function Lr(e){f(this,Lr),this._n="SSOLogBody",this._report=[]}function bA(e){f(this,bA),this._m=e,this._n="StorageModule",this._storageQueue=new Map,this._errorTolerantHandle()}nt=Jt={exports:{}},vg=Object.prototype.hasOwnProperty,Di="~",Object.create&&(Cc.prototype=Object.create(null),new Cc().__proto__||(Di=!1)),wi.prototype.eventNames=function(){var e,n,o=[];if(this._eventsCount===0)return o;for(n in e=this._events)vg.call(e,n)&&o.push(Di?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},wi.prototype.listeners=function(n){var n=Di?Di+n:n,o=this._events[n];if(!o)return[];if(o.fn)return[o.fn];for(var a=0,l=o.length,h=new Array(l);a<l;a++)h[a]=o[a].fn;return h},wi.prototype.listenerCount=function(e){return e=Di?Di+e:e,e=this._events[e],e?e.fn?1:e.length:0},wi.prototype.emit=function(e,n,o,a,l,h){var m=Di?Di+e:e;if(!this._events[m])return!1;var M,L=this._events[m],F=arguments.length;if(L.fn){switch(L.once&&this.removeListener(e,L.fn,void 0,!0),F){case 1:return L.fn.call(L.context),!0;case 2:return L.fn.call(L.context,n),!0;case 3:return L.fn.call(L.context,n,o),!0;case 4:return L.fn.call(L.context,n,o,a),!0;case 5:return L.fn.call(L.context,n,o,a,l),!0;case 6:return L.fn.call(L.context,n,o,a,l,h),!0}for(fe=1,M=new Array(F-1);fe<F;fe++)M[fe-1]=arguments[fe];L.fn.apply(L.context,M)}else for(var $,ue=L.length,fe=0;fe<ue;fe++)switch(L[fe].once&&this.removeListener(e,L[fe].fn,void 0,!0),F){case 1:L[fe].fn.call(L[fe].context);break;case 2:L[fe].fn.call(L[fe].context,n);break;case 3:L[fe].fn.call(L[fe].context,n,o);break;case 4:L[fe].fn.call(L[fe].context,n,o,a);break;default:if(!M)for($=1,M=new Array(F-1);$<F;$++)M[$-1]=arguments[$];L[fe].fn.apply(L[fe].context,M)}return!0},wi.prototype.on=function(e,n,o){return oa(this,e,n,o,!1)},wi.prototype.once=function(e,n,o){return oa(this,e,n,o,!0)},wi.prototype.removeListener=function(e,n,o,a){if(e=Di?Di+e:e,!this._events[e])return this;if(!n)return mu(this,e),this;var l=this._events[e];if(l.fn)l.fn!==n||a&&!l.once||o&&l.context!==o||mu(this,e);else{for(var h=0,m=[],M=l.length;h<M;h++)(l[h].fn!==n||a&&!l[h].once||o&&l[h].context!==o)&&m.push(l[h]);m.length?this._events[e]=m.length===1?m[0]:m:mu(this,e)}return this},wi.prototype.removeAllListeners=function(e){return e?(e=Di?Di+e:e,this._events[e]&&mu(this,e)):(this._events=new Cc,this._eventsCount=0),this},wi.prototype.off=wi.prototype.removeListener,wi.prototype.addListener=wi.prototype.on,wi.prefixed=Di,nt.exports=wi.EventEmitter=wi;var _g,vg,Di,kA=Jt.exports,gv=["requestSnapshotUrl"],Ig=(E(Ec,Pn),_g=B(Ec),y(Ec,[{key:"_init",value:function(){var e=this.get(18);this.TIMUploadPlugin=e.getPlugin("tim-upload-plugin"),this.TIMUploadPlugin?this._initUploaderMethod():(this.COSSDK=e.getPlugin(e=Fe?"cos-wx-sdk":"cos-js-sdk"),this.COSSDK?(this._getAuthorizationKey(),this.outputWarning("CosReplacement",e)):this.outputWarning("PluginUndetected"))}},{key:"_onCloudConfigUpdated",value:function(){var e="".concat(this._n,"._onCloudConfigUpdated"),n=this.getCloudConfig("upload_size_limit"),o=this.getCloudConfig("simple_cos");if(w.l("".concat(e," uploadSizeLimit:").concat(n," simpleCos:").concat(o)),!xe(n))try{var a=JSON.parse(n);this.UPLOAD_SIZE_LIMIT={A:a.a?1048576*parseInt(a.a):this.UPLOAD_SIZE_LIMIT.A,F:a.f?1048576*parseInt(a.f):this.UPLOAD_SIZE_LIMIT.F,I:a.i?1048576*parseInt(a.i):this.UPLOAD_SIZE_LIMIT.I,V:a.v?1048576*parseInt(a.v):this.UPLOAD_SIZE_LIMIT.V}}catch{}xe(o)||(this.isSimpleCos=o==="1")}},{key:"_getAuthorizationKey",value:function(){var e=this,n="".concat(this._n,".").concat("_getAuthorizationKey"),o=new Be("_getAuthorizationKey"),a=Math.ceil(Date.now()/1e3);this.req({proto:le.COS_SIGN,data:{duration:this.expiredTimeLimit}}).then(function(h){var h=h.data,m=(w.l("".concat(n," ok. data:"),h),h.expiredTime-a);o.setMessage("requestId:".concat(h.requestId," requestTime:").concat(a," expiredTime:").concat(h.expiredTime," diff:").concat(m,"s")).end(),!Fe&&h.region&&(e.region=h.region),e.appid=h.appid,e.bucketName=h.bucketName,e.ciUrl=h.ciUrl,e.directory=h.directory,e.downloadUrl=h.downloadUrl,e.uploadUrl=h.uploadUrl,e.cosOptions={secretId:h.secretId,secretKey:h.secretKey,sessionToken:h.sessionToken,expiredTime:h.expiredTime},w.l("".concat(n," ok. region:").concat(e.region," bucketName:").concat(e.bucketName)),e._initUploaderMethod()}).catch(function(l){o.setError(l).end(),w.w("".concat(n," failed. error:"),l)})}},{key:"_getCosPreSigUrl",value:function(e){var n=this,o="".concat(this._n,".").concat("_getCosPreSigUrl"),a=Math.ceil(Date.now()/1e3),l=new Be("_getCosPreSigUrl"),h={uploadMethod:e.uploadMethod,platform:this.getPlatform(),SDKAppID:this.getSDKAppID(),userID:e.userID,conversationType:e.conversationType,uploadConfig:[{fileID:1,fileType:e.fileType,fileName:e.fileName}]},m=le.SIMPLE_COS_PRE_SIG;return this.isSimpleCos||(h={fileType:e.fileType,fileName:e.fileName,uploadMethod:e.uploadMethod,duration:e.duration},m=le.COS_PRE_SIG),this.req({proto:m,data:h}).then(function($){n.tryCount=0;var L,F,$=$.data||{},ue=(w.l("".concat(o," ok. isSimpleCos:").concat(n.isSimpleCos," data:"),$),"");return ue=n.isSimpleCos?(L=(F=$.preSig[0]).uploadUrl,F=F.fileKey,"uploadIP:".concat($.uploadIP," uploadUrl:").concat(L," fileKey:").concat(F," cost:").concat(Zn(a))):"requestId:".concat($.requestId," expiredTime:").concat($.expiredTime," diff:").concat($.expiredTime-a,"s"),l.setMessage(ue).end(),$}).catch(function(M){return M.code===-1&&(M.code=we.COS_GET_SIG_FAIL),l.setError(M).end(),w.w("".concat(o," failed. error:"),M),n.tryCount<1?(n.tryCount++,n._getCosPreSigUrl(e)):(n.tryCount=0,Ce({code:we.COS_GET_SIG_FAIL}))})}},{key:"_initUploaderMethod",value:function(){var e=this;if(this.TIMUploadPlugin)return this.timUploadPlugin=new this.TIMUploadPlugin,void(this._cosUploadMethod=function(n,o){e.timUploadPlugin.uploadFile(n,o)});this.appid&&(this.cos=Fe?new this.COSSDK({ForcePathStyle:!0,getAuthorization:this._getAuthorization.bind(this)}):new this.COSSDK({getAuthorization:this._getAuthorization.bind(this)}),this._cosUploadMethod=Fe?function(n,o){e.cos.postObject(n,o)}:function(n,o){e.cos.uploadFiles(n,o)})}},{key:"onCheckTimer",value:function(e){this.COSSDK&&(this.TIMUploadPlugin||this.isLoggedIn()&&e%60==0&&Math.ceil(Date.now()/1e3)>=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{key:"_getAuthorization",value:function(e,n){n({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:"upload",value:function(e){if(e._relayFlag===!0)return Promise.resolve();var n=this.get(26);switch(e.type){case C.MSG_IMAGE:return n.addTotalCount(fi),this._uploadImage(e);case C.MSG_FILE:return n.addTotalCount(fi),this._uploadFile(e);case C.MSG_AUDIO:return n.addTotalCount(fi),this._uploadAudio(e);case C.MSG_VIDEO:return n.addTotalCount(fi),this._uploadVideo(e);default:return Promise.resolve()}}},{key:"_uploadImage",value:function(e){var n=this,o=this.get(2),a=e.getElements()[0],l=o.getMessageOption(e.clientSequence);return this.doUploadImage({file:l.payload.file,to:l.to,message:e,onProgress:function(h){if(a.updatePercent(h),Hn(l.onProgress))try{l.onProgress(h)}catch{return Ce({code:we.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(Ct){var m=Ct.location,M=Ct.fileType,L=Ct.fileSize,F=Ct.width,$=Ct.height,ue=Ct.smallImageUrl,fe=Ct.smallImageWidth,he=Ct.smallImageHeight,be=Ct.largeImageUrl,ze=Ct.largeImageWidth,Ye=Ct.largeImageHeight,Tt=Ct.imageInfoArray,Ct=n.isPrivateNetWork()?m:Oo(m);a.updateImageFormat(M);var Bt,In,ii={size:L,url:Ct,width:F,height:$};if(Tt&&0<Tt.length)for(var oi=0;oi<Tt.length;oi++){var ri=Tt[oi];ri.type===1?Bt=ri:ri.type===2?In=ri:ii=u(u({},ii),ri)}else In=ue&&be?(Bt={url:ue,width:fe,height:he},{url:be,width:ze,height:Ye}):(Bt=Bd({originUrl:Ct,originWidth:F,originHeight:$,min:198}),Bd({originUrl:Ct,originWidth:F,originHeight:$,min:720}));return a.updateImageInfoArray([u({},ii),u({},In),u({},Bt)]),e})}},{key:"_uploadFile",value:function(e){var n=this,o=this.get(2),a=e.getElements()[0],l=o.getMessageOption(e.clientSequence);return this.doUploadFile({file:l.payload.file,to:l.to,message:e,onProgress:function(h){if(a.updatePercent(h),Hn(l.onProgress))try{l.onProgress(h)}catch{return Ce({code:we.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(h){return h=h.location,h=n.isPrivateNetWork()?h:Oo(h),a.updateFileUrl(h),e})}},{key:"_uploadAudio",value:function(e){var n=this,o=this.get(2),a=e.getElements()[0],l=o.getMessageOption(e.clientSequence);return this.doUploadAudio({file:l.payload.file,to:l.to,message:e,onProgress:function(h){if(a.updatePercent(h),Hn(l.onProgress))try{l.onProgress(h)}catch{return Ce({code:we.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(h){return h=h.location,h=n.isPrivateNetWork()?h:Oo(h),a.updateAudioUrl(h),e})}},{key:"_uploadVideo",value:function(e){var n=this,o=this.get(2),a=e.getElements()[0],l=o.getMessageOption(e.clientSequence);return this.doUploadVideo({file:l.payload.file,to:l.to,message:e,onProgress:function(h){if(a.updatePercent(h),Hn(l.onProgress))try{l.onProgress(h)}catch{return Ce({code:we.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then(function(m){var M=m.location,m=m.snapshotInfo,M=n.isPrivateNetWork()?M:Oo(M);return a.updateVideoUrl(M),Je(m)||a.updateSnapshotInfo(m),e})}},{key:"_checkSizeError",value:function(e){var n="";return e==="A"?n="audio":e==="I"?n="image":e==="V"?n="video":e==="F"&&(n="file"),Ce({code:we["MSG_".concat(e,"_SIZE_LIMIT")],message:this.getErrorMessage("UploadSizeLimit",n,"".concat(this.UPLOAD_SIZE_LIMIT[e]/1048576,"MB"))})}},{key:"doUploadImage",value:function(e){var n=this;if(!e.file||this._isEmptyFileList(e.file.files))return Ce({code:we.MSG_I_SELECT_F_FIRST});var o=this._checkImageType(e.file);if(o!==!0||(o=this._checkImageSize(e.file),o!==!0))return o;var a=null;return this._setUploadFileType(1),this.uploadByCOS(e).then(function(l){if(a=l,n.isPrivateNetWork())return h=n.getFileDownloadProxy(),Zs(ki(l.location,h));if(At(a.imageInfoArray)){var h=a.imageInfoArray.find(function(m){return m.type===3});if(h)return h}return Zs("https://".concat(l.location))}).then(function(l){return a.width=l.width,a.height=l.height,Promise.resolve(a)})}},{key:"_checkImageType",value:function(e){var n="",n=Fe?e.url.slice(e.url.lastIndexOf(".")+1):e.files[0].name.slice(e.files[0].name.lastIndexOf(".")+1);return 0<=Y_.indexOf(n.toLowerCase())||Ce({code:we.MSG_I_TYPES_LIMIT})}},{key:"_checkImageSize",value:function(e){return(e=(Fe?e:e.files[0]).size)===0?Ce({code:we.MSG_F_IS_EMPTY}):e<this.UPLOAD_SIZE_LIMIT.I||this._checkSizeError("I")}},{key:"doUploadFile",value:function(e){return!e.file||this._isEmptyFileList(e.file.files)?Ce({code:we.MSG_F_SELECT_F_FIRST}):e.file.files[0].size>this.UPLOAD_SIZE_LIMIT.F?this._checkSizeError("F"):e.file.files[0].size===0?Ce({code:we.MSG_F_IS_EMPTY}):(this._setUploadFileType(255),this.uploadByCOS(e))}},{key:"doUploadVideo",value:function(e){return e.file.videoFile.size>this.UPLOAD_SIZE_LIMIT.V?this._checkSizeError("V"):e.file.videoFile.size===0?Ce({code:we.MSG_F_IS_EMPTY}):K_.indexOf(e.file.videoFile.type)===-1?Ce({code:we.MSG_V_TYPES_LIMIT}):(this._setUploadFileType(2),Fe?this.handleVideoUpload(u(u({},e),{},{file:e.file.videoFile})):lt?this.handleVideoUpload(e):void 0)}},{key:"handleVideoUpload",value:function(e){var n=this;return new Promise(function(o,a){n.uploadByCOS(e).then(function(l){o(l)}).catch(function(){n.uploadByCOS(e).then(function(l){o(l)}).catch(function(){a(new ln({code:we.MSG_V_UPLOAD_FAIL}))})})})}},{key:"doUploadAudio",value:function(e){return e.file?e.file.size>this.UPLOAD_SIZE_LIMIT.A?this._checkSizeError("A"):e.file.size===0?Ce({code:we.MSG_F_IS_EMPTY}):(this._setUploadFileType(3),this.uploadByCOS(e)):Ce({code:we.MSG_A_UPLOAD_FAIL})}},{key:"uploadByCOS",value:function(e){var n=this;if(!Hn(this._cosUploadMethod))return this.outputWarning("PluginUndetected"),Ce({code:we.COS_UNDETECTED});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(e);var o=new Be("upload"),a="".concat(this._n,".uploadByCOS"),l=Date.now(),h=this._getFile(e);return new Promise(function(m,M){var L=Fe?n._createCosOptionsWXMiniApp(e):n._createCosOptionsWeb(e),F=n;n._cosUploadMethod(L,function($,ue){var fe=Object.create(null);if(ue){if($||At(ue.files)&&ue.files[0].error)return he=new ln({code:we.MSG_F_UPLOAD_FAIL}),o.setError(he).end(),w.l("".concat(a," failed. error:"),ue.files[0].error),ue.files[0].error.statusCode===403&&(w.w("".concat(a," failed. cos AccessKeyId was invalid, regain auth key!")),n._getAuthorizationKey()),void M(he);fe.fileName=h.name,fe.fileSize=h.size,fe.fileType=h.type.slice(h.type.indexOf("/")+1).toLowerCase(),fe.location=(Fe?ue:ue.files[0].data).Location;var he=Date.now()-l,ue=F._formatFileSize(h.size),be=F._formatSpeed(1e3*h.size/he),ue="size:".concat(ue," time:").concat(he,"ms speed:").concat(be),be=(w.l("".concat(a," success. name:").concat(h.name," ").concat(ue)),m(fe),n.get(26));return be.addCost(fi,he),be.addFileSize(fi,h.size),void o.setMessage(ue).end()}fe=new ln({code:we.MSG_F_UPLOAD_FAIL}),o.setError(fe).end(),w.w("".concat(a," failed. error:"),$),$.statusCode===403&&(w.w("".concat(a," failed. cos AccessKeyId was invalid, regain auth key!")),n._getAuthorizationKey()),M(fe)})})}},{key:"_uploadWithPreSigUrl",value:function(e){var n=this,o="".concat(this._n,"._uploadWithPreSigUrl"),a=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then(function(l){return new Promise(function(h,m){var M=new Be("upload"),L=l.requestSnapshotUrl,F=L===void 0?void 0:L,$=b(l,gv),ue=Date.now();n._cosUploadMethod($,function(fe,he){var be,ze,Ye;return fe||he.statusCode===403?(M.setError(new ln(fe)).end(),ze={HttpStatusCode:9999,CostTime:Zn(ue,!1),error:fe,url:l.url},he.data&&he.data.uploadIP&&(ze.uploadIP=he.data.uploadIP),n._uploadSSOLog(ze),w.l("".concat(o," failed, error:"),fe),void m(new ln({code:we.MSG_F_UPLOAD_FAIL}))):(be=Object.create(null),ze=he.data.location||"",n.isPrivateNetWork()||ze.indexOf("https://")!==0&&ze.indexOf("http://")!==0||(ze=ze.split("//")[1]),be.fileName=a.name,be.fileSize=a.size,be.fileType=a.type.slice(a.type.indexOf("/")+1).toLowerCase(),be.location=ze,fe=Zn(ue,!1),ze=n._formatFileSize(a.size),Ye=n._formatSpeed(1e3*a.size/fe),ze="size:".concat(ze," time:").concat(fe,"ms speed:").concat(Ye," res:").concat(JSON.stringify(he.data)),w.l("".concat(o," ok. name:").concat(a.name," ").concat(ze)),M.setMessage(ze).end(),Ye={HttpStatusCode:he.statusCode,FileSize:a.size,CostTime:fe,url:l.url},he.data&&he.data.uploadIP&&(Ye.uploadIP=he.data.uploadIP),n._uploadSSOLog(Ye),(ze=n.get(26)).addCost(fi,fe),ze.addFileSize(fi,a.size),Ye=[],$.thumbUrl&&$.largeUrl&&Ye.push.apply(Ye,[n._getSmallImageInfoByUrl($.thumbUrl,be),n._getLargeImageInfoByUrl($.largeUrl,be)]),n.uploadFileType===1&&n.isSimpleCos&&!n.isPrivateNetWork()&&(Ye.push(n._getImageInfoArray($.downloadUrl,be)),he.data.uploadIP&&Ye.push(n._getDownloadIP($.downloadUrl.split("//")[1].split("/")[0],be))),F&&Ye.push(n._getSnapshotInfoByUrl(F,be)),0<Ye.length?Promise.all(Ye).then(function(){h(be)}):void h(be))})})})}},{key:"_getDownloadIP",value:function(e,n){var o="".concat(this._n,"._getDownloadIP"),a=Date.now();return this.req({proto:le.GET_IP,data:{domainName:e}}).then(function(l){var h;l.data&&l.data.ip&&(w.l("".concat(o," ok. downloadIP:").concat(l.data.ip," cost:").concat(Zn(a))),(h=n.location.split("/"))[0]=l.data.ip,n.location=h.join("/"))}).catch(function(l){})}},{key:"_getImageInfoArray",value:function(e,n){var o=this,a="".concat(this._n,"._getImageInfoArray"),l=Date.now();return this.req({proto:le.GET_IMAGE_INFO,data:{imageUrl:e}}).then(function(h){return h=h.data||{},w.l("".concat(a," ok. data: ").concat(JSON.stringify(h)," cost:").concat(Zn(l))),n.imageInfoArray=h.imageInfoArray,h}).catch(function(h){n.imageInfoArray=void 0,o._uploadSSOLog({HttpStatusCode:1e4,CostTime:Zn(l,!1),url:e})})}},{key:"_uploadSSOLog",value:function(e){var n,o;this.isSimpleCos&&((n=new Be).setEventType(18),e.error&&n.setError(new ln(e.error)),o="HttpStatusCode:".concat(e.HttpStatusCode,"|CosRequestId:").concat(e.CosRequestId||"","|")+"FileAlreadyExist:".concat(e.FileAlreadyExist||0,"|FileSize:").concat(e.FileSize||0,"|CostTime:").concat(e.CostTime),e.uploadIP&&(o+="|FinalIP:".concat(e.uploadIP)),n.setMessage("OK").setMoreMessage(e.url).setExtension(o).end())}},{key:"_getRawOrUploadProxyUrl",value:function(e){var n=this.get(12).getFileUploadProxy(),o=e;return o=n?e.replace(/^https:\/\/[^/]+/,n):o}},{key:"_getFile",value:function(e){return At(e.file.files)||Ql(e.file.files)?e.file.files[0]:e.file}},{key:"_formatFileSize",value:function(e){return e<1024?e+"B":e<1048576?Math.floor(e/1024)+"KB":Math.floor(e/1048576)+"MB"}},{key:"_formatSpeed",value:function(e){return e<=1048576?Zi(e/1024,1)+"KB/s":Zi(e/1048576,1)+"MB/s"}},{key:"_createCosOptionsWeb",value:function(e){var n=this._getFile(e),o=n.name,o=o.slice(o.lastIndexOf(".")),o=this._genFileName("".concat(Mi(999999)).concat(o));return{files:[{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(o),Body:n}],SliceSize:1048576,onProgress:function(a){if(typeof e.onProgress=="function")try{e.onProgress(a.percent)}catch(l){w.w("onProgress callback error:",l)}},onFileFinish:function(a,l,h){}}}},{key:"_createCosOptionsWXMiniApp",value:function(e){var o=this._getFile(e),n=this._genFileName(o.name),o=o.url;return{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(n),FilePath:o,onProgress:function(a){if(w.l(JSON.stringify(a)),typeof e.onProgress=="function")try{e.onProgress(a.percent)}catch(l){w.w("onProgress callback error:",l)}}}}},{key:"_createCosOptionsPreSigUrl",value:function(e){var n,o=this,a="",l="",m=0,h=this._getFile(e),m=Fe?(a=e.message.type===C.MSG_FILE?(n=(n=h.name).slice(n.lastIndexOf(".")),this._genFileName("".concat(Mi(999999)).concat(n))):this._genFileName(h.name),l=h.url,1):(n=(n=h.name).slice(n.lastIndexOf(".")),a=this._genFileName("".concat(Mi(999999)).concat(n)),l=h,0);return this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:a,uploadMethod:m,duration:this.duration,userID:e.message.from,conversationType:yi(e.message.conversationID)?1:2}).then(function(be){var he=o.isSimpleCos?be.preSig[0]:be,L=he.uploadUrl,F=he.downloadUrl,$=he.requestSnapshotUrl,$=$===void 0?void 0:$,ue=he.thumbUrl,fe=he.largeUrl,he=he.fileKey,be=be.uploadIP,be=be===void 0?"":be;return{url:o._getRawOrUploadProxyUrl(L),fileType:o.uploadFileType,fileName:a,resources:l,downloadUrl:F,requestSnapshotUrl:$,thumbUrl:ue,largeUrl:fe,fileKey:he,uploadIP:!o.isPrivateNetWork()&&be,onProgress:function(ze){if(typeof e.onProgress=="function")try{e.onProgress(ze.percent)}catch(Ye){w.w("onProgress callback error:",Ye),w.e(Ye)}}}})}},{key:"_genFileName",value:function(e){return"".concat(Qp(),"-").concat(e)}},{key:"_setUploadFileType",value:function(e){this.uploadFileType=e}},{key:"_getSnapshotInfoByUrl",value:function(e,n){var o=this,a="_getSnapshotInfoByUrl",l=new Be(a);return this.req({proto:le.VIDEO_COVER,data:{platform:this.getPlatform(),coverName:this._genFileName(Mi(99999)),requestSnapshotUrl:e}}).then(function(L){var m=(L.data||{}).snapshotUrl;if(w.l("".concat(o._n,".").concat(a," ok. snapshotUrl:").concat(m)),l.setMessage("snapshotUrl:".concat(m)).end(),Je(m))return{};var M,L=m;return o.isPrivateNetWork()&&(M=o.getFileDownloadProxy(),L=ki(m,M)),Zs(L).then(function(F){n.snapshotInfo={snapshotUrl:m,snapshotWidth:F.width,snapshotHeight:F.height}})}).catch(function(h){return w.w("".concat(o._n,".").concat(a," failed. error:"),h),l.setCode(h.errorCode).setMessage(h.errorInfo).end(),{}})}},{key:"_getSmallImageInfoByUrl",value:function(e,n){var o,a=e;return this.isPrivateNetWork()&&(o=this.getFileDownloadProxy(),a=ki(e,o)),Zs(a).then(function(l){n.smallImageUrl=e,n.smallImageWidth=l.width,n.smallImageHeight=l.height})}},{key:"_getLargeImageInfoByUrl",value:function(e,n){var o,a=e;return this.isPrivateNetWork()&&(o=this.getFileDownloadProxy(),a=ki(e,o)),Zs(a).then(function(l){n.largeImageUrl=e,n.largeImageWidth=l.width,n.largeImageHeight=l.height})}},{key:"_isEmptyFileList",value:function(e){return!(!Ql(e)||e.length!==0)}},{key:"reset",value:function(){w.l("".concat(this._n,".reset"))}}]),Ec),fv=["downloadKey","pbDownloadKey","messageList"],mv=(y(wA,[{key:"uploadMergerMessage",value:function(a,n){var o="".concat(this._n,".").concat("uploadMergerMessage"),a=(w.d("".concat(o," message:"),a,"messageBytes:".concat(n)),a.payload.messageList),l=a.length,h=new Be("uploadMergerMessage");return this._msgM.req({proto:le.UPLOAD_MERGER_MSG,data:{messageList:a}}).then(function(M){w.d("".concat(o," ok. response:"),M.data);var M=M.data,L=M.pbDownloadKey,M=M.downloadKey,L={pbDownloadKey:L,downloadKey:M,messageNumber:l};return h.setMessage("".concat(l,"-").concat(n,"-").concat(M)).end(),L}).catch(function(m){throw w.w("".concat(o," failed. error:"),m),h.setError(m).end(),m})}},{key:"downloadMergerMessage",value:function(e){var n="".concat(this._n,".").concat("downloadMergerMessage"),o=(w.d("".concat(n," message:"),e),e.payload.downloadKey),a=this._msgM.getFileDownloadProxy(),l=new Be("downloadMergerMessage");return l.setMessage("downloadKey:".concat(o)),this._msgM.req({proto:le.DOWNLOAD_MERGER_MSG,data:{downloadKey:o}}).then(function(h){var m,M;return w.d("".concat(n," ok. response:"),h.data),Hn(e.clearElement)?((m=e.payload).downloadKey,m.pbDownloadKey,m.messageList,m=b(m,fv),e.clearElement(),e.setElement({type:e.type,content:u({messageList:h.data.messageList},m)},a)):(M=[],h.data.messageList.forEach(function(L){Je(L)||(L=new Si(L,a),M.push(L))}),e.payload.messageList=M,e.payload.downloadKey="",e.payload.pbDownloadKey=""),l.end(),e}).catch(function(h){throw w.w("".concat(n," failed. key:").concat(o," error:"),h),l.setError(h).end(),h})}},{key:"createMergerMessagePack",value:function(e,n,o){return e.conversationType===C.CONV_C2C?this._createC2CMergerMessagePack(e,n,o):this._createGroupMergerMessagePack(e,n,o)}},{key:"_createC2CMergerMessagePack",value:function(e,n,L){var a=null,l=(n&&(n.offlinePushInfo&&(a=n.offlinePushInfo),n.onlineUserOnly===!0&&(a?a.disablePush=!0:a={disablePush:!0})),[]),h=(Qt(n)&&Qt(n.messageControlInfo)&&(h=(M=n.messageControlInfo).excludedFromUnreadCount,m=M.excludedFromLastMessage,M=M.excludedFromContentModeration,h===!0&&l.push("NoUnread"),m===!0&&l.push("NoLastMsg"),M===!0&&l.push("NoMsgCheck")),""),m=(wt(e.cloudCustomData)&&0<e.cloudCustomData.length&&(h=e.cloudCustomData),L.pbDownloadKey),M=L.downloadKey,L=L.messageNumber,ue=e.payload,F=ue.title,$=ue.abstractList,ue=ue.compatibleText,fe=this._msgM.get(6),fe=fe&&fe.isOnlineMessage(e,n)?0:void 0;return{proto:le.SEND_C2C_MSG,tjgID:this._msgM.generateTjgID(e),data:{fromAccount:this._msgM.getMyUserID(),toAccount:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:m,downloadKey:M,title:F,abstractList:$,compatibleText:ue,messageNumber:L}}],cloudCustomData:h,clientTime:e.clientTime,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:fe,offlinePushInfo:a?{pushFlag:a.disablePush===!0?1:0,title:a.title||"",desc:a.description||"",ext:a.extension||"",apnsInfo:{badgeMode:a.ignoreIOSBadge===!0?1:0},androidInfo:{OPPOChannelID:a.androidOPPOChannelID||""}}:void 0,messageControlInfo:fe!==0?l:void 0,isSupportExtension:e.isSupportExtension===!0?1:0,isRelayMessage:e._relayFlag===!0?1:0}}}},{key:"_createGroupMergerMessagePack",value:function(e,he,L){var a=null,l=(he&&he.offlinePushInfo&&(a=he.offlinePushInfo),[]),h=(Qt(he)&&Qt(he.messageControlInfo)&&(h=(M=he.messageControlInfo).excludedFromUnreadCount,m=M.excludedFromLastMessage,M=M.excludedFromContentModeration,h===!0&&l.push("NoUnread"),m===!0&&l.push("NoLastMsg"),M===!0&&l.push("NoMsgCheck")),""),m=(wt(e.cloudCustomData)&&0<e.cloudCustomData.length&&(h=e.cloudCustomData),L.pbDownloadKey),M=L.downloadKey,L=L.messageNumber,ue=e.payload,F=ue.title,$=ue.abstractList,ue=ue.compatibleText,fe=this._msgM.get(7),he=fe&&fe.isOnlineMessage(e,he)?1:0;return{proto:le.SEND_GRP_MSG,tjgID:this._msgM.generateTjgID(e),data:{fromAccount:this._msgM.getMyUserID(),groupID:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:m,downloadKey:M,title:F,abstractList:$,compatibleText:ue,messageNumber:L}}],random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:void 0,cloudCustomData:h,onlineOnlyFlag:he,offlinePushInfo:a?{pushFlag:a.disablePush===!0?1:0,title:a.title||"",desc:a.description||"",ext:a.extension||"",apnsInfo:{badgeMode:a.ignoreIOSBadge===!0?1:0},androidInfo:{OPPOChannelID:a.androidOPPOChannelID||""}}:void 0,clientTime:e.clientTime,needReadReceipt:e.needReadReceipt!==!0||fe.isMessageFromOrToAVChatroom(e.to)?0:1,messageControlInfo:he==0?l:void 0,isSupportExtension:e.isSupportExtension===!0?1:0,isRelayMessage:e._relayFlag===!0?1:0}}}}]),wA),_v={ERR_SVR_COMM_SENSITIVE_TEXT:80001,ERR_SVR_COMM_BODY_SIZE_LIMIT:80002,OPEN_SERVICE_OVERLOAD_ERROR:60022,ERR_SVR_MSG_PKG_PARSE_FAILED:20001,ERR_SVR_MSG_INTERNAL_AUTH_FAILED:20002,ERR_SVR_MSG_INVALID_ID:20003,ERR_SVR_MSG_PUSH_DENY:20006,ERR_SVR_MSG_IN_PEER_BLACKLIST:20007,ERR_SVR_MSG_BOTH_NOT_FRIEND:20009,ERR_SVR_MSG_NOT_PEER_FRIEND:20010,ERR_SVR_MSG_NOT_SELF_FRIEND:20011,ERR_SVR_MSG_SHUTUP_DENY:20012,ERR_SVR_GROUP_INVALID_PARAMETERS:10004,ERR_SVR_GROUP_PERMISSION_DENY:10007,ERR_SVR_GROUP_NOT_FOUND:10010,ERR_SVR_GROUP_INVALID_GROUPID:10015,ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY:10016,ERR_SVR_GROUP_SHUTUP_DENY:10017,MSG_SEND_FAIL:2100,OVER_FREQUENCY_LIMIT:2996},vv=[we.MSG_ONPROGRESS_FUNCTION_ERROR,we.MSG_I_SELECT_F_FIRST,we.MSG_I_TYPES_LIMIT,we.MSG_F_IS_EMPTY,we.MSG_I_SIZE_LIMIT,we.MSG_F_SELECT_F_FIRST,we.MSG_F_SIZE_LIMIT,we.MSG_V_SIZE_LIMIT,we.MSG_V_TYPES_LIMIT,we.MSG_A_UPLOAD_FAIL,we.MSG_A_SIZE_LIMIT,we.COS_UNDETECTED];function wA(e){f(this,wA),this._n="MergerMessageHandler",this._msgM=e}function Ec(e){f(this,Ec),(e=_g.call(this,e))._n="UploadModule",e.TIMUploadPlugin=null,e.timUploadPlugin=null,e.COSSDK=null,e._cosUploadMethod=null,e.expiredTimeLimit=600,e.appid=0,e.bucketName="",e.ciUrl="",e.directory="",e.downloadUrl="",e.uploadUrl="",e.region="ap-shanghai",e.cos=null,e.cosOptions={secretId:"",secretKey:"",sessionToken:"",expiredTime:0},e.uploadFileType="",e.duration=900,e.tryCount=0,e.UPLOAD_SIZE_LIMIT={A:20971520,F:104857600,I:20971520,V:104857600},e.isSimpleCos=!1;var n=e.getInnerEmitterInstance();return n.on(Rn.A2KEY_AND_TINYID_UPDATED,e._init,k(e)),n.on(Rn.CLOUD_CONFIG_UPDATED,e._onCloudConfigUpdated,k(e)),e}function Cc(){}function Iv(e,n,o){this.fn=e,this.context=n,this.once=o||!1}function oa(e,n,o,a,l){if(typeof o!="function")throw new TypeError("The listener must be a function");return o=new Iv(o,a||e,l),a=Di?Di+n:n,e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}function mu(e,n){--e._eventsCount==0?e._events=new Cc:delete e._events[n]}function wi(){this._events=new Cc,this._eventsCount=0}function yg(e){var n=!1;return Object.values(_v).includes(e)&&(n=!0),n=120001<=e&&e<=13e4||10100<=e&&e<=10200?!0:n}var Tg,PA,UA,Eg,Cg,_u,yv=["conversationID","timePosition","timePeriod"],Tv=(E(ra,Pn),_u=B(ra),y(ra,[{key:"createTextMessage",value:function(o){var a=this.getMyUserID(),n=(o.currentUser=a,o.senderTinyID=this.getMyTinyID(),new Yn(o)),o=wt(o.payload)?o.payload:o.payload.text,o=new au({text:o}),a=this._getNickAndAvatarByUserID(a);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createImageMessage",value:function(e){var n=this.getMyUserID(),o=(e.currentUser=n,e.senderTinyID=this.getMyTinyID(),new Yn(e));if(Fe){var l=e.payload.file;if(mn(l))return void this.outputWarning("FileUnsupportedInMP","createImageMessage");var a=l.tempFiles[0].path||l.tempFiles[0].tempFilePath,l={url:a,name:a.slice(a.lastIndexOf("/")+1),size:l.tempFiles&&l.tempFiles[0].size||1,type:a.slice(a.lastIndexOf(".")+1).toLowerCase()};e.payload.file=l}else lt&&(mn(e.payload.file)?(a=e.payload.file,e.payload.file={files:[a]}):Qt(e.payload.file)&&typeof uni<"u"&&(l=e.payload.file.tempFiles[0],e.payload.file={files:[l]}));return a=new Qd({imageFormat:Rt.UNKNOWN,uuid:this._generateUUID(e.payload.file),file:e.payload.file}),l=this._getNickAndAvatarByUserID(n),o.setElement(a),o.setNickAndAvatar(l),o.setNameCard(this._getNameCardByGroupID(o)),this._messageOptionsMap.set(o.clientSequence,e),o}},{key:"createAudioMessage",value:function(e){var o=e.payload.file,a=(Fe&&(a={url:o.tempFilePath,name:o.tempFilePath.slice(o.tempFilePath.lastIndexOf("/")+1),size:o.fileSize,second:parseInt(o.duration)/1e3,type:o.tempFilePath.slice(o.tempFilePath.lastIndexOf(".")+1).toLowerCase()},e.payload.file=a),this.getMyUserID()),n=(e.currentUser=a,e.senderTinyID=this.getMyTinyID(),new Yn(e)),o=new cc({second:Math.floor(o.duration/1e3),size:o.fileSize||o.size,url:o.tempFilePath,uuid:this._generateUUID(e.payload.file)}),a=this._getNickAndAvatarByUserID(a);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:"createVideoMessage",value:function(e){var n=this.getMyUserID(),o=(e.currentUser=n,e.senderTinyID=this.getMyTinyID(),e.payload.file.thumbUrl="",e.payload.file.thumbSize=0,{});if(Fe){if(Pe)return void this.outputWarning("VideoUnsupportedInAlipay");if(mn(e.payload.file))return void this.outputWarning("FileUnsupportedInMP","createVideoMessage");var a=e.payload.file;At(a.tempFiles)&&(a=a.tempFiles[0]),o.url=a.tempFilePath,o.name=a.tempFilePath.slice(a.tempFilePath.lastIndexOf("/")+1),o.size=a.size||1,o.second=a.duration||0,o.type=a.tempFilePath.slice(a.tempFilePath.lastIndexOf(".")+1).toLowerCase()}else lt&&(mn(e.payload.file)?(a=e.payload.file,e.payload.file.files=[a]):Qt(e.payload.file)&&typeof uni<"u"&&(a=e.payload.file.tempFile,e.payload.file.files=[a]),a=e.payload.file,o.url=window.URL.createObjectURL(a.files[0]),o.name=a.files[0].name,o.size=a.files[0].size||1,o.second=a.files[0].duration||0,o.type=a.files[0].type.split("/")[1]);return e.payload.file.videoFile=o,a=new Yn(e),o=new ro({videoFormat:o.type,videoSecond:Zi(o.second,0),videoSize:o.size,remoteVideoUrl:"",videoUrl:o.url,videoUUID:this._generateUUID(e.payload.file.videoFile),thumbUUID:this._generateUUID(e.payload.file.videoFile),thumbWidth:e.payload.file.width||200,thumbHeight:e.payload.file.height||200,thumbUrl:e.payload.file.thumbUrl,thumbSize:e.payload.file.thumbSize,thumbFormat:e.payload.file.thumbUrl.slice(e.payload.file.thumbUrl.lastIndexOf(".")+1).toLowerCase()}),n=this._getNickAndAvatarByUserID(n),a.setElement(o),a.setNickAndAvatar(n),a.setNameCard(this._getNameCardByGroupID(a)),this._messageOptionsMap.set(a.clientSequence,e),a}},{key:"createCustomMessage",value:function(o){var a=this.getMyUserID(),n=(o.currentUser=a,o.senderTinyID=this.getMyTinyID(),new Yn(o)),o=new $d({data:o.payload.data,description:o.payload.description,extension:o.payload.extension}),a=this._getNickAndAvatarByUserID(a);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createFaceMessage",value:function(o){var a=this.getMyUserID(),n=(o.currentUser=a,o.senderTinyID=this.getMyTinyID(),new Yn(o)),o=new Xd(o.payload),a=this._getNickAndAvatarByUserID(a);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createMergerMessage",value:function(a){var n=this.getMyUserID(),n=(a.currentUser=n,a.senderTinyID=this.getMyTinyID(),this._getNickAndAvatarByUserID(n)),o=new Yn(a),a=new Rr(a.payload);return o.setElement(a),o.setNickAndAvatar(n),o.setNameCard(this._getNameCardByGroupID(o)),o.setRelayFlag(!0),o}},{key:"createForwardMessage",value:function(e){var n=e.to,o=e.conversationType,a=e.priority,l=e.payload,h=e.needReadReceipt,m=e.receiverList;if(!At(l._elements))return Ce({code:we.MSG_FORWARD_INVALID_ELEMENTS});var M=this.getMyUserID(),L=this._getNickAndAvatarByUserID(M);return l.type===C.MSG_GRP_TIP?Ce({code:we.MSG_FORWARD_TYPE_INVALID}):(o={to:n,conversationType:o,conversationID:"".concat(o).concat(n),priority:a,isPlaceMessage:0,status:Fa,currentUser:M,senderTinyID:this.getMyTinyID(),cloudCustomData:e.cloudCustomData||l.cloudCustomData||"",needReadReceipt:h,receiverList:m,isSupportExtension:e.isSupportExtension||!1},n=new Yn(o),n.setElement(l._elements[0]),n.setNickAndAvatar(L),n.setNameCard(this._getNameCardByGroupID(l)),n.setRelayFlag(!0),n)}},{key:"downloadMergerMessage",value:function(e){return this._mergerMessageHandler.downloadMergerMessage(e)}},{key:"createFileMessage",value:function(e){if(Fe){if(!Ie&&!ye&&!We)return;var o=Ne.getSystemInfoSync().SDKVersion;if(Ie&&Fd(o,"2.5.0")<0)return void this.outputWarning("WXChooseMessageFile");if(ye&&Fd(o,"1.18.0")<0)return void this.outputWarning("QQChooseMessageFile")}lt||We?mn(e.payload.file)?(o=e.payload.file,e.payload.file={files:[o]}):Qt(e.payload.file)&&typeof uni<"u"&&(n=(o=e.payload.file).tempFiles,o=o.files,a=null,At(n)?a=n[0]:At(o)&&(a=o[0]),e.payload.file={files:[a]}):(Ie||ye)&&(o=u(u({},(n=e.payload.file.tempFiles)[0]),{},{url:n[0].path}),e.payload.file={files:[o]});var a=this.getMyUserID(),n=(e.currentUser=a,e.senderTinyID=this.getMyTinyID(),new Yn(e)),o=new lc({uuid:this._generateUUID(e.payload.file),file:e.payload.file}),a=this._getNickAndAvatarByUserID(a);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:"createLocationMessage",value:function(o){var a=this.getMyUserID(),n=(o.currentUser=a,o.senderTinyID=this.getMyTinyID(),new Yn(o)),o=new Nr(o.payload),a=this._getNickAndAvatarByUserID(a);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"_onCannotFindModule",value:function(){return Ce({code:we.CANNOT_FIND_MODULE})}},{key:"sendMessageInstance",value:function(e,n){var o=this;if(this.get(29).filterMessage(e,n)===!1)return e.hasRiskContent=!0,this._onSendMessageFailed(e,new ln({code:we.PROFANITY_FOUND}));var a=null;if(e.conversationType===C.CONV_C2C)a=this.get(6);else{if(e.conversationType!==C.CONV_GROUP)return Ce({code:we.MSG_INVALID_CONV_TYPE});a=this.get(7)}if(!a)return Ce({code:we.CANNOT_FIND_MODULE});var l,h="".concat(this._n,".sendMessageInstance"),m=this.get(11),M=a.isOnlineMessage(e,n);return this.get(17).upload(e).then(function(){return o._getSendMessageSpecifiedKey(e)===Dr&&o.get(26).addSuccessCount(fi),o._guardForGroup(e).then(function(){if(!e.isSendable())return Ce({code:we.MSG_F_URL_IS_EMPTY});o._addSendMessageTotalCount(e),l=Date.now();var L=function(F){var $="utf-8";lt&&document&&($=document.charset.toLowerCase());var ue,fe=0,he=F.length;if($==="utf-8"||$==="utf8")for(var be=0;be<he;be++)(ue=F.codePointAt(be))<=127?fe+=1:ue<=2047?fe+=2:ue<=65535?fe+=3:(fe+=4,be++);else if($==="utf-16"||$==="utf16")for(var ze=0;ze<he;ze++)(ue=F.codePointAt(ze))<=65535?fe+=2:(fe+=4,ze++);else fe=F.replace(/[^\x00-\xff]/g,"aa").length;return fe}(JSON.stringify(e));return e.type===C.MSG_MERGER&&11264<L?o._mergerMessageHandler.uploadMergerMessage(e,L).then(function(F){return F=o._mergerMessageHandler.createMergerMessagePack(e,n,F),o.req(F)}):(m.setMessageRandom(e),a.sendMessage(e,n))}).then(function(fe){var F,fe=fe.data,$=fe.time,ue=fe.sequence,he=fe.readReceiptCode,fe=fe.messageDropReason,he=(qt(he)&&he!==0&&(new Be("sendMessageWithReceipt").setMessage("from:".concat(e.from," to:").concat(e.to," sequence:").concat(ue," readReceiptCode:").concat(he)).end(),w.w("".concat(h," readReceiptCode:").concat(he," message:").concat(o.getErrorMessage(he)))),fe&&(he=new Be("messageDropReason"),fe="from:".concat(e.from," to:").concat(e.to," sequence:").concat(ue," messageDropReason:").concat(fe),he.setMessage(fe).end(),w.w("".concat(h," ").concat(fe))),o._addSendMessageSuccessCount(e,l),o._messageOptionsMap.delete(e.clientSequence),e.isResend===!0&&(F=m.findMessage(e.ID))&&(w.l("".concat(h," resend ok. ID:").concat(F.ID)),m.deleteLocalMessage(F)),e.status=eo,e.time=$,!1);return e.conversationType===C.CONV_GROUP?e.sequence=ue:e.conversationType!==C.CONV_C2C||(fe=m.getLatestMessageSentByMe(e.conversationID))&&(F=fe.nick,$=fe.avatar,F===e.nick&&$===e.avatar||(he=!0)),he&&m.modifyMessageSentByMe({conversationID:e.conversationID,latestNick:e.nick,latestAvatar:e.avatar}),M===!0?e._onlineOnlyFlag=!0:(m.appendToMessageList(e),ue=e,Qt(n)&&Qt(n.messageControlInfo)&&(n.messageControlInfo.excludedFromLastMessage===!0&&(e._isExcludedFromLastMessage=!0,ue=""),n.messageControlInfo.excludedFromUnreadCount===!0&&(e._isExcludedFromUnreadCount=!0)),fe=e.conversationType,Bn(e.to)&&(fe=C.CONV_TOPIC,o.get(10).onMessageSent({groupID:Wn(e.to),topicID:e.to,lastMessage:ue})),m.onMessageSent({conversationOptionsList:[{conversationID:e.conversationID,unreadCount:0,type:fe,subType:e.conversationSubType,lastMessage:ue}]})),e._relayFlag||e.type!=="TIMImageElem"||Jl(e.payload.imageInfoArray),ft({message:e})})}).catch(function(L){return o._onSendMessageFailed(e,L,M)})}},{key:"_guardForGroup",value:function(e){if(e.conversationType!==C.CONV_GROUP)return Promise.resolve();var n=this.get(7);if(!n)return this._onCannotFindModule();if(Ii({groupID:e.to})){var o=n.getLocalGroupProfile(e.to);if(o&&o.isSupportTopic)return Ce({code:we.MSG_SEND_GRP_WITH_TOPIC_FAIL})}return n.guardForAVChatRoom(e)}},{key:"_onSendMessageFailed",value:function(e,n){var l=2<arguments.length&&arguments[2]!==void 0&&arguments[2],o="".concat(this._n,"._onSendMessageFailed"),a=(e.status=Yd,n.code!==80001&&n.code!==80004||(e.hasRiskContent=!0),this.get(11)),h=(a.deleteMessageRandom(e),10100<=n.code&&n.code<=10200||120001<=n.code&&n.code<=13e4),l=(l||h||a.appendToMessageList(e)===!0&&w.l("".concat(o," message stored, ID:").concat(e.ID)),this._addSendMessageFailCountOnUser(e,n),new Be("sendMessage")),h="tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to);return lt&&("connection"in navigator&&(a=navigator.connection,h+=" downlink:".concat(a.downlink," effectiveType:").concat(a.effectiveType," rtt:").concat(a.rtt)),"memory"in window.performance&&(a=window.performance.memory,h+=" usedJSHeapSize:".concat(a.usedJSHeapSize," totalJSHeapSize:").concat(a.totalJSHeapSize," jsHeapSizeLimit:").concat(a.jsHeapSizeLimit))),l.setMessage(h).setError(n).end(),w.e("".concat(o," error:"),n),Ce(new ln({code:n&&n.code?n.code:we.MSG_SEND_FAIL,message:n&&n.message?n.message:void 0,data:{message:e}}))}},{key:"_getSendMessageSpecifiedKey",value:function(e){if([C.MSG_IMAGE,C.MSG_AUDIO,C.MSG_VIDEO,C.MSG_FILE].includes(e.type))return Dr;if(e.conversationType===C.CONV_C2C)return nr;if(e.conversationType===C.CONV_GROUP){var n=this.get(7);if(n&&(n=n.getLocalGroupProfile(e.to),n))return e=n.type,pi(e)?ir:Po}}},{key:"_addSendMessageTotalCount",value:function(e){e=this._getSendMessageSpecifiedKey(e),e&&this.get(26).addTotalCount(e)}},{key:"_addSendMessageSuccessCount",value:function(a,n){var o,a=this._getSendMessageSpecifiedKey(a);a&&((o=this.get(26)).addSuccessCount(a),o.addCost(a,Zn(n,!1)))}},{key:"_addSendMessageFailCountOnUser",value:function(h,a){var o,a=a.code,a=a===void 0?-1:a,l=this.get(26),h=this._getSendMessageSpecifiedKey(h);h===Dr&&(o=!1,o=vv.includes(a)?!0:o)?l.addFailedCountOfUserSide(fi):yg(a)&&h&&l.addFailedCountOfUserSide(h)}},{key:"resendMessage",value:function(e,n){return e.isResend=!0,e.status=Fa,this.sendMessageInstance(e,n)}},{key:"revokeMessage",value:function(e){var n=this,o=null;if(e.conversationType===C.CONV_C2C?o=this.get(6):e.conversationType===C.CONV_GROUP&&(o=this.get(7)),!o)return this._onCannotFindModule();var a=new Be("revokeMessage"),l=(a.setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to)),"".concat(this._n,".").concat("revokeMessage"));return o.revokeMessage(e).then(function(m){var m=m.data.recallRetList;return Je(m)||m[0].retCode===0?(w.i("".concat(l," ok. ID:").concat(e.ID)),e.isRevoked=!0,a.end(),n.get(11).onMessageRevoked([e]),ft({message:e})):(m=new ln({code:m[0].retCode,data:{message:e}}),a.setCode(m.code).setMoreMessage(m.message).end(),Ce(m))}).catch(function(h){a.setError(h).end();var m=new ln({code:h&&h.code?h.code:we.MSG_REVOKE_FAIL,message:h&&h.message?h.message:void 0,data:{message:e}});return w.w("".concat(l," failed. error:"),h),Ce(m)})}},{key:"deleteMessage",value:function(e){var n=this,o=null,a=e[0],l=a.conversationID,h="",m=[],M=[];if(a.conversationType===C.CONV_C2C)o=this.get(6),h=l.replace(C.CONV_C2C,""),e.forEach(function($){$&&$.status===eo&&$.conversationID===l&&($._onlineOnlyFlag||m.push("".concat($.sequence,"_").concat($.random,"_").concat($.time)),M.push($))});else if(a.conversationType===C.CONV_GROUP)o=this.get(7),h=l.replace(C.CONV_GROUP,""),e.forEach(function($){$&&$.status===eo&&$.conversationID===l&&($._onlineOnlyFlag||m.push("".concat($.sequence)),M.push($))});else if(a.conversationType===C.CONV_SYSTEM)return Ce({code:we.CANNOT_DELETE_GRP_SYSTEM_NOTICE});if(!o)return this._onCannotFindModule();if(m.length===0)return this._onMessageDeleted(M);30<m.length&&(m=m.slice(0,30),M=M.slice(0,30));var L=new Be("deleteMessage"),F=(L.setMessage("to:".concat(h," count:").concat(m.length)),"".concat(this._n,".").concat("deleteMessage"));return o.deleteMessage({to:h,keyList:m}).then(function($){return L.end(),w.i("".concat(F," ok")),n._onMessageDeleted(M)}).catch(function($){return L.setError($).end(),w.w("".concat(F," failed. error:"),$),$=new ln({code:$&&$.code?$.code:we.MSG_DELETE_FAIL,message:$&&$.message?$.message:void 0}),Ce($)})}},{key:"_onMessageDeleted",value:function(e){return this.get(11).onMessageDeleted(e),St({messageList:e})}},{key:"translateText",value:function(l){var n="".concat(this._n,".").concat("translateText"),o=l.sourceTextList,a=l.sourceLanguage,l=l.targetLanguage,h=new Be("translateText");return h.setMessage("sourceLanguage:".concat(a," targetLanguage:").concat(l)),this.req({proto:le.TRANSLATE_TEXT,data:{sourceTextList:o,source:a||"auto",target:l,from:this.getMyTinyID(),SDKAppID:this.getSDKAppID()}}).then(function(F){var F=F.data,M=F.error,L=F.requestID,F=F.translatedTextList;if(M.code===0)return h.end(),w.i("".concat(n," ok. requestID:").concat(L)),ft({translatedTextList:F});throw u(u({},M),{},{requestID:L})}).catch(function(m){return h.setCode(m.code).setMoreMessage(m.requestID).end(),w.w("".concat(n," failed. error:"),m),Ce({code:we.TRANSLATE_TEXT_FAIL})})}},{key:"convertVoiceToText",value:function(l){var o=l.message,l=l.language,n=o.payload.url,o=(o.from===this.getMyUserID()&&o.flow==="out"&&(n=o.payload.remoteAudioUrl),/\.(wav|pcm|ogg-opus|speex|silk|mp3|m4a|aac|amr)/);if(!o.test(n))return Ce({code:we.UNSUPPORTED_VOICE_FORMAT});var o=o.exec(n)[1]||"mp3",a="16k_zh-PY",l=(l?l==="zh (cmn-Hans-CN)"?a="16k_zh":l==="en-US"?a="16k_en":l==="yue-Hant-HK"?a="16k_yue":l==="ja-JP"&&(a="16k_ja"):a="16k_zh-PY","serviceType:".concat(a," url:").concat(n)),h="".concat(this._n,".").concat("convertVoiceToText"),m=(w.i("".concat(h," ").concat(l)),new Be("convertVoiceToText"));return m.setMessage(l),this.req({proto:le.VOICE_TO_TEXT,data:{url:n,language:a,SDKAppID:this.getSDKAppID(),format:o}}).then(function($){var $=$.data,L=$.error,F=$.requestID,$=$.result;if(L.code===0)return m.end(),w.i("".concat(h," ok. requestID:").concat(F)),ft({result:$});throw u(u({},L),{},{requestID:F})}).catch(function(M){return m.setCode(M.code).setMoreMessage(M.requestID||"").end(),w.w("".concat(h," failed. error:"),M),Ce({code:we.VOICE_TO_TEXT_FAIL})})}},{key:"modifyRemoteMessage",value:function(e){var n=this,o=null,a=e.conversationType,l=e.to,h=this.get(7);if(!h)return this._onCannotFindModule();if(h.isMessageFromOrToAVChatroom(l))return Ce({code:we.MSG_MODIFY_DISABLED_IN_AVCHATROOM,data:{message:e}});if(this.get(29).filterMessage(e)===!1)return e.hasRiskContent=!0,Ce({code:we.PROFANITY_FOUND,data:{message:e}});a===C.CONV_C2C?o=this.get(6):a===C.CONV_GROUP&&(o=this.get(7));var m=new Be("modifyMessage"),M=(m.setMessage("to:".concat(l)),"".concat(this._n,".modifyRemoteMessage"));return o.modifyRemoteMessage(e).then(function(L){return m.end(),w.i("".concat(M," ok")),L=n._onModifyRemoteMessageResp(e,L.data),ft({message:L})}).catch(function(L){var F;return m.setCode(L.code).setMoreMessage(L.message).end(),w.w("".concat(M," failed. error:"),L),L.code===20027?(F=n._onModifyRemoteMessageResp(e,L.data),Ce({code:we.MSG_MODIFY_CONFLICT,data:{message:F}})):Ce({code:L.code,message:L.message,data:{message:e}})})}},{key:"_generateSearchdata",value:function(l){var n=l.conversationID,o=l.timePosition,a=l.timePeriod,l=b(l,yv);return xe(n)||(yi(n)&&(l.account=n.replace(C.CONV_C2C,"")),mi(n)&&(l.groupID=n.replace(C.CONV_GROUP,""))),qt(a)&&0<a&&(qt(o)&&0<o?l.startTime=o-a:l.startTime=Se()-a),l.startTime&&l.startTime<0&&(l.startTime=void 0),qt(o)&&0<o&&(l.endTime=o),l}},{key:"searchCloudMessages",value:function(e){var n=this,o="searchCloudMessages",a="".concat(this._n,".").concat(o);if(!e)return Ce({code:we.OPTIONS_IS_EMPTY,message:this.getErrorMessage(we.OPTIONS_IS_EMPTY,o)});var l=e.keywordList,h=e.keywordListMatchType,m=e.conversationID,M=e.cursor,L=At(e.senderUserIDList)&&0<e.senderUserIDList.length,F=At(e.messageTypeList)&&0<e.messageTypeList.length;if(!l&&!L&&!F)throw w.e("[".concat(o,'] Missing required params: "keywordList".')),new Error("Params validate failed.");var $=Date.now(),ue=new Be(o),fe="keywordList:".concat(l," keywordListMatchType:").concat(h," ")+"conversationID:".concat(m," cursor:").concat(M);return w.l("".concat(a," ").concat(fe)),this.req({proto:le.MSG_CLOUD_SEARCH,data:this._generateSearchdata(e)}).then(function(ze){var Ye=ze.data,be=Ye.code,Ye=Ye.message;if(be!==0)return Ye=n.getErrorMessage(be===60020?"SearchCloudMessagesUnavailable":be)||Ye,be=new ln({code:be,message:Ye}),ue.setMessage(fe).setError(be).end(),Ce(be);var Ye=ze.data,be=Ye.cursor,ze=Ye.totalCount,Ye=Ye.searchResult,Tt="totalCount:".concat(ze," cost:").concat(Zn($)),Tt=(w.l("".concat(a," ok. cursor:").concat(be," ").concat(Tt)),ue.setMessage("".concat(fe," ").concat(Tt)).end(),n._handleSearchResults(Ye,!e.conversationID));return ft({searchResultList:Tt,cursor:be,totalCount:ze})}).catch(function(he){return ue.setMessage(fe).setError(he).end(),Ce(he)})}},{key:"_handleSearchResults",value:function(e,n){var o=this.get(11);return At(e)&&e.length!==0?e.map(function(m){var l=m.groupID,M=m.userID,h=m.messageCount,m=m.messageList,M=l?"".concat(C.CONV_GROUP).concat(l):"".concat(C.CONV_C2C).concat(M),L={conversationID:M,messageCount:h,messageList:[]};return n&&1<h||m&&0<m.length&&(h=o.onRoamingMessage(m,M,!1),l&&h.reverse(),L.messageList=h),L}):[]}},{key:"_onModifyRemoteMessageResp",value:function(M,$){w.d("".concat(this._n,"._onModifyRemoteMessageResp options:"),$);var o=M.conversationType,a=M.from,l=M.to,h=M.random,m=M.sequence,M=M.time,L=$.elements,F=$.messageVersion,$=$.cloudCustomData,$=$===void 0?"":$;return this.get(11).onMessageModified({conversationType:o,from:a,to:l,time:M,random:h,sequence:m,elements:L,cloudCustomData:$,messageVersion:F})}},{key:"_generateUUID",value:function(o){var n=this.get(12),n="".concat(n.getSDKAppID(),"-").concat(n.getUserID(),"-").concat($o()),o=o.name||o.value||o.url||o.tempFilePath,o=o&&o.slice(o.lastIndexOf(".")+1);return n=o?"".concat(n,".").concat(o):n}},{key:"getMessageOption",value:function(e){return this._messageOptionsMap.get(e)}},{key:"_getNickAndAvatarByUserID",value:function(e){return this.get(4).getNickAndAvatarByUserID(e)}},{key:"_getNameCardByGroupID",value:function(e){if(e.conversationType===C.CONV_GROUP){var n=this.get(7);if(n)return n.getMyNameCardByGroupID(e.to)}return""}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._messageOptionsMap.clear()}}]),ra),Ev=(E(Dc,Pn),Cg=B(Dc),y(Dc,[{key:"onMessageExtensionNotify",value:function(h){var n=this,h=h.dataList,M=h.messageInfo,o=h.operateType,a=h.operateResultList,l=h.tinyID,h=h.globalSequence,m=M.clientTime,M=M.random,L="".concat(l,"-").concat(m,"-").concat(M),F=[],$=[],ue=(w.l("".concat(this._n,".onMessageExtensionNotify messageID:").concat(L," operateType:").concat(o," globalSequence:").concat(h)),this._updateGlobalSequence(L,h),!1),fe=!1;a.forEach(function(he){var be=he.extensions,be=be===void 0?[]:be,ze=he.clearSequence;o===1?(ue=!0,be.forEach(function(Ye){F.push({key:Ye.key,value:Ye.value})}),n._updateLocalExtension(L,be)):o===2?(fe=!0,be.forEach(function(Ye){$.push(Ye.key)}),n._updateLocalExtension(L,be)):o===3&&(fe=!0,n._hasLocalExtension(L)&&n._getLocalExtension(L).forEach(function(Ye,Tt){Ye.seq<=ze&&!Je(Ye.value)&&$.push(Tt)}),n._clearLocalExtension(L,ze))}),ue&&this.emitOuterEvent(R.MESSAGE_EXTENSIONS_UPDATED,{messageID:L,extensions:F}),fe&&this.emitOuterEvent(R.MESSAGE_EXTENSIONS_DELETED,{messageID:L,keyList:$})}},{key:"setMessageExtensions",value:function(e,F){var o="setMessageExtensions";if(!this.canIUse(pe.MSG_EXT))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),l=e.ID,h=e.conversationID,m=e.sequence,M=e.time,L=V(F),F=(20<F.length&&(L=F.slice(0,20),w.w("".concat(a,". the length of extensions cannot exceed 20."))),"conversationID:".concat(h," messageID:").concat(l," sequence:").concat(m," time:").concat(M," count:").concat(L.length)),$=new Be(o);return $.setMessage(F),w.l("".concat(a," ").concat(F)),this._modifyMessageExtensions(e,L).then(function(he){var fe=he.resultList,be=he.successCount,he=he.failureCount,be="success count:".concat(be," fail count:").concat(he);return $.setMoreMessage(be).end(),w.l("".concat(a," ok. ").concat(be)),ft({extensions:fe})}).catch(function(ue){return $.setError(ue).end(),w.e("".concat(a," failed. error:"),ue),Ce(ue)})}},{key:"getMessageExtensions",value:function(e){var n=this,o="getMessageExtensions";if(!this.canIUse(pe.MSG_EXT))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),l=e.ID,M=e.conversationID,h=e.sequence,m=e.time,M="conversationID:".concat(M," messageID:").concat(l," sequence:").concat(h," time:").concat(m),L=new Be(o),F=(L.setMessage(M),w.l("".concat(a," ").concat(M)),void 0);return this.getMessageExtensionsMap.has(l)&&(F=this._getGlobalSequence(l)),this._getMessageExtensions(e,F).then(function($){return L.end(),w.l("".concat(a," ok. total count:").concat($.length)),xe(F)&&0<$.length&&n.getMessageExtensionsMap.set(l,1),ft({extensions:$})}).catch(function($){return L.setError($).end(),w.e("".concat(a," failed. error:"),$),Ce($)})}},{key:"deleteMessageExtensions",value:function(e,m){var o="deleteMessageExtensions";if(!this.canIUse(pe.MSG_EXT))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),l=[],h=3,m=(Je(m)||(h=2,m.forEach(function(ue){l.push({key:ue,value:"",seq:0})})),e.ID),F=e.conversationID,M=e.sequence,L=e.time,F="conversationID:".concat(F," messageID:").concat(m," sequence:").concat(M," time:").concat(L," operateType:").concat(h),$=new Be(o);return $.setMessage(F),w.l("".concat(a," ").concat(F)),this._modifyMessageExtensions(e,l,h).then(function(be){var fe=be.resultList,he=be.successCount,be=be.failureCount,ze="";return h===2&&(ze="success count:".concat(he," fail count:").concat(be)),$.setMoreMessage("".concat(ze)).end(),w.l("".concat(a," ok. ").concat(ze)),ft({extensions:fe})}).catch(function(ue){return $.setError(ue).end(),w.e("".concat(a," failed. error:"),ue),Ce(ue)})}},{key:"_modifyMessageExtensions",value:function(e,n){var o=this,a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,l=Bn(e.to)?C.CONV_TOPIC:e.conversationType,h=void 0,m=(a!==3&&(h=this._getRequestExtensions(e,n)),null);switch(l){case C.CONV_C2C:m=this.get(6);break;case C.CONV_GROUP:m=this.get(7);break;case C.CONV_TOPIC:m=this.get(10);break;default:return Ce({code:we.CANNOT_FIND_MODULE})}return m.modifyMessageExtensions(e,h,a).then(function(F){var F=F.data,L=F.extensions,F=F.seq,$=[],ue=0,fe=0,he=[];return(L=Je(L)?[]:L).forEach(function(Ct){var ze=Ct.errorCode,Ct=Ct.extension,Ye=Ct.key,Tt=Ct.value,Ct=Ct.seq;$.push({code:ze,key:Ye,value:Tt}),ze===0?ue++:fe++,he.push({key:Ye,value:Tt,seq:Ct})}),o._updateGlobalSequence(e.ID,F),0<he.length&&(o._updateLocalExtension(e.ID,he),he=null),{resultList:$,successCount:ue,failureCount:fe}}).catch(function(M){return Ce(M)})}},{key:"_getRequestExtensions",value:function(e,n){var o,a=[];return this._hasLocalExtension(e.ID)?(o=this._getLocalExtension(e.ID),n.forEach(function(m){var h=m.key,m=m.value,M=0;o.has(h)&&(M=o.get(h).seq),a.push({key:h,value:m,seq:M})})):n.forEach(function(m){var h=m.key,m=m.value;a.push({key:h,value:m,seq:0})}),a}},{key:"_getMessageExtensions",value:function(e,n){var o=this,a="".concat(this._n,"._getMessageExtensions"),l=e.ID,h=e.to,m=null;switch(Bn(h)?C.CONV_TOPIC:e.conversationType){case C.CONV_C2C:m=this.get(6);break;case C.CONV_GROUP:m=this.get(7);break;case C.CONV_TOPIC:m=this.get(10);break;default:return Ce({code:we.CANNOT_FIND_MODULE})}return m.getMessageExtensions(e,n).then(function($){var $=$.data,ue=$.extensions,L=$.completeFlag,F=$.globalSequence,$=$.clearSequence,ue=Je(ue)?[]:ue;return w.l("".concat(a," ok. completeFlag:").concat(L," globalSequence:").concat(F," clearSequence:").concat($," count:").concat(ue.length)),o._updateLocalExtension(l,ue),o._clearLocalExtension(l,$),o._updateGlobalSequence(l,F),L!==1?($=ue.slice(-1)[0].seq+1,o._getMessageExtensions(e,$)):o._getLocalExtensions(l)}).catch(function(M){return Ce(M)})}},{key:"_hasLocalExtension",value:function(e){return this.messageExtensionMap.has(e)}},{key:"_getLocalExtension",value:function(e){return this.messageExtensionMap.get(e)}},{key:"_updateLocalExtension",value:function(e,n){this._hasLocalExtension(e)||this.messageExtensionMap.set(e,new Map);var o=this._getLocalExtension(e);n.forEach(function(m){var l=m.key,h=m.value,m=m.seq;o.set(l,{value:h===void 0?"":h,seq:m})})}},{key:"_clearLocalExtension",value:function(e,n){var o;n<=0||!this._hasLocalExtension(e)||(o=this._getLocalExtension(e)).forEach(function(a,l){a.seq<=n&&o.delete(l)})}},{key:"_getLocalExtensions",value:function(e){var n=[];return this._hasLocalExtension(e)&&this._getLocalExtension(e).forEach(function(o,a){o=o.value,Je(o)||n.push({key:a,value:o})}),n}},{key:"_getGlobalSequence",value:function(e){return this.globalSeqMap.get(e)}},{key:"_updateGlobalSequence",value:function(e,n){this.globalSeqMap.set(e,n)}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this.messageExtensionMap.clear(),this.globalSeqMap.clear(),this.getMessageExtensionsMap.clear()}}]),Dc),Mg=(E(Za,Pn),Eg=B(Za),y(Za,[{key:"onMessageReactionNotifyList",value:function(o){var n=this,o=(o||{}).dataList;(o===void 0?[]:o).forEach(function(l){var m=l.C2CMessageInfo,M=l.groupMessageInfo,M=M===void 0?{}:M,l=l.reactionList,l=l===void 0?[]:l,m=u(u({},m===void 0?{}:m),M),M=m.tinyID,h=m.clientTime,m=m.random,M="".concat(M,"-").concat(h,"-").concat(m),L=[];l.forEach(function(F){xe(F.userIDList)&&(F.userIDList=[],F.count=0),L.push.apply(L,V(F.userIDList))}),w.l("".concat(n._n,".onMessageReactionNotifyList messageID:").concat(M," reactionList:").concat(l.length)),n._handleReactionSummary([{messageID:M,reactionList:l}],L).then(function(F){n.emitOuterEvent(R.MESSAGE_REACTIONS_UPDATED,u({},F[0]))})})}},{key:"onMessageReactionNotify",value:function(o){var o=o.dataList||{},a=o.C2CMessageInfo,l=o.groupMessageInfo,l=l===void 0?{}:l,n=o.reactionID,o=o.operateType,a=u(u({},a===void 0?{}:a),l),l=a.tinyID,h=a.clientTime,a=a.random,l="".concat(l,"-").concat(h,"-").concat(a),h=(w.l("".concat(this._n,".onMessageReactionNotify messageID:").concat(l," reactionID:").concat(n," operateType:").concat(o)),o===1?this._addReactedByMyselfMap(l,n):this._removeReactedByMyselfMap(l,n),"".concat(l,"-").concat(n));this._reactionInfoMap.has(h)&&((a=this._reactionInfoMap.get(h)).reactedByMyself=o===1,this.emitOuterEvent(R.MESSAGE_REACTIONS_UPDATED,{messageID:l,reactionList:[a]}))}},{key:"addMessageReaction",value:function(e,n){var o=this,a="addMessageReaction";if(!this.canIUse(pe.MSG_REACTION))return this.cannotUseCommercialAbility(a);var l="".concat(this._n,".").concat(a),M=e.ID,h=e.conversationID,h="conversationID:".concat(h," messageID:").concat(M," reactionID:").concat(n),m=new Be(a),M=(m.setMessage(h),w.l("".concat(l," ").concat(h)),this._createReactionOperationPack(e,n,1));return this._addReactedByMyselfMap(e.ID,n),this.req(M).then(function(){return m.end(),w.l("".concat(l," ok.")),ft()}).catch(function(L){return o._removeReactedByMyselfMap(e.ID,n),m.setError(L).end(),w.e("".concat(l," failed. error:"),L),Ce(L)})}},{key:"removeMessageReaction",value:function(e,n){var o="removeMessageReaction";if(!this.canIUse(pe.MSG_REACTION))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),m=e.ID,l=e.conversationID,l="conversationID:".concat(l," messageID:").concat(m," reactionID:").concat(n),h=new Be(o),m=(h.setMessage(l),w.l("".concat(a," ").concat(l)),this._createReactionOperationPack(e,n,2));return this._removeReactedByMyselfMap(e.ID,n),this.req(m).then(function(){return h.end(),w.l("".concat(a," ok.")),ft()}).catch(function(M){return h.setError(M).end(),w.e("".concat(a," failed. error:"),M),Ce(M)})}},{key:"getMessageReactions",value:function(e){var n=this,o="getMessageReactions";if(!this.canIUse(pe.MSG_REACTION))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),l=e.messageList,L=e.maxUserCountPerReaction,h=l[0].conversationID,h="conversationID:".concat(h," maxUserCountPerReaction:").concat(L," messageList:").concat(l.length),m=new Be(o),M=(m.setMessage(h),w.l("".concat(a," ").concat(h)),new Map),L=this._createReactionSummaryPack(u(u({},e),{},{messageIDMap:M}));return this.req(L).then(function($){var $=$.data.resultList,ue=[],fe=[];return($===void 0?[]:$).forEach(function(ze){var be=ze.messageKey,be=be===void 0?void 0:be,Ye=ze.messageSequence,Ye=Ye===void 0?void 0:Ye,ze=ze.reactionList,ze=ze===void 0?[]:ze,Ye=xe(be)?M.get(Ye):M.get(be);ue.push({messageID:Ye,reactionList:ze}),ze.forEach(function(Tt){fe.push.apply(fe,V(Tt.userIDList))})}),n._handleReactionSummary(ue,fe)}).then(function(F){return m.end(),w.l("".concat(a," ok.")),M.clear(),ft({resultList:F})}).catch(function(F){return m.setError(F).end(),w.e("".concat(a," failed. error:"),F),Ce(F)})}},{key:"getAllUserListOfMessageReaction",value:function(e){var n=this,o="getAllUserListOfMessageReaction";if(!this.canIUse(pe.MSG_REACTION))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),M=e.message,l=e.reactionID,h=e.nextSeq,m=e.count,$=M.ID,M=M.conversationID,M="conversationID:".concat(M," messageID:").concat($," reactionID:").concat(l," nextSeq:").concat(h," count:").concat(m),L=new Be(o),F=(L.setMessage(M),w.l("".concat(a," ").concat(M)),{userList:[],nextSeq:0,isCompleted:!1}),$=this._createReactionUserListPack(e);return this.req($).then(function(he){var he=he.data,fe=he.userIDList,fe=fe===void 0?[]:fe,he=he.nextSeq,he=he===void 0?0:he;return F.nextSeq=he,F.isCompleted=he===0,n.get(4).getUserNickAndAvatar(fe)}).then(function(ue){return F.userList=ue,L.end(),w.l("".concat(a," ok.")),ft(F)}).catch(function(ue){return L.setError(ue).end(),w.e("".concat(a," failed. error:"),ue),Ce(ue)})}},{key:"_createReactionOperationPack",value:function(e,m,o){var a,l,h=void 0,m={reactionID:m,userIDList:[this.getMyUserID()]};return e.conversationType===C.CONV_C2C&&(a=this.get(6),h=o===1?le.ADD_C2C_MSG_REACTION:le.RM_C2C_MSG_REACTION,m.from=e.from,m.to=e.to,m.messageKey=a.getMessageKey(e)),e.conversationType===C.CONV_GROUP&&(a=void 0,l=e.to,Bn(e.to)&&(l=Wn(a=e.to)),h=o===1?le.ADD_GRP_MSG_REACTION:le.RM_GRP_MSG_REACTION,m.groupID=l,m.topicID=a,m.messageSequence=e.sequence),{proto:h,data:m}}},{key:"_createReactionSummaryPack",value:function(M){var n,o,a,l=M.messageList,h=M.maxUserCountPerReaction,h=h===void 0?10:h,m=M.messageIDMap,M=l[0],L=void 0,F=void 0;return M.conversationType===C.CONV_C2C&&(n=this.get(6),o=l.map(function($){var ue=n.getMessageKey($);return m.set(ue,$.ID),ue}),L=le.GET_C2C_MSG_REACTIONS,F={from:M.from,to:M.to,messageKeyList:o,count:h}),M.conversationType===C.CONV_GROUP&&(o=void 0,a=M.to,Bn(M.to)&&(a=Wn(o=M.to)),M=l.map(function($){return m.set($.sequence,$.ID),$.sequence}),L=le.GET_GRP_MSG_REACTIONS,F={groupID:a,topicID:o,messageSequenceList:M,count:h}),{proto:L,data:F}}},{key:"_createReactionUserListPack",value:function(a){var n=a.message,h=a.reactionID,o=a.nextSeq,a=a.count,a=a===void 0?100:a,l=void 0,h={reactionID:h,nextSeq:o===void 0?0:o,count:100<a?100:a};return n.conversationType===C.CONV_C2C&&(o=this.get(6),l=le.GET_C2C_MSG_REACTION_USER_LIST,h.from=n.from,h.to=n.to,h.messageKey=o.getMessageKey(n)),n.conversationType===C.CONV_GROUP&&(a=void 0,o=n.to,Bn(n.to)&&(o=Wn(a=n.to)),l=le.GET_GRP_MSG_REACTION_USER_LIST,h.groupID=o,h.topicID=a,h.messageSequence=n.sequence),{proto:l,data:h}}},{key:"_handleReactionSummary",value:function(e,n){var o=this;return this.get(4).getUserNickAndAvatar(n).then(function(a){var l=[];return e.forEach(function(h){var m=[];h.reactionList.forEach(function($){var L=$.reactionID,F=$.count,fe=$.userIDList,$=$.reactedByMyself,$=$===void 0?void 0:$,ue=[],fe=(fe.forEach(function(he){a.forEach(function(be){he===be.userID&&ue.push(be)})}),{reactionID:L,totalUserCount:F,partialUserList:ue,reactedByMyself:o._computeReactedByMyself({reactedByMyself:$,messageID:h.messageID,reactionID:L})});m.push(fe),xe($)&&!o._reactedByMyselfMap.has(h.messageID)&&(F="".concat(h.messageID,"-").concat(L),o._reactionInfoMap.set(F,fe))}),l.push({messageID:h.messageID,reactionList:m})}),l})}},{key:"_addReactedByMyselfMap",value:function(e,n){this._reactedByMyselfMap.has(e)||this._reactedByMyselfMap.set(e,[]),e=this._reactedByMyselfMap.get(e),e.indexOf(n)===-1&&e.push(n)}},{key:"_removeReactedByMyselfMap",value:function(e,n){!this._reactedByMyselfMap.has(e)||-1<(n=(e=this._reactedByMyselfMap.get(e)).indexOf(n))&&e.splice(n,1)}},{key:"_computeReactedByMyself",value:function(a){var n=a.reactedByMyself,o=a.messageID,a=a.reactionID;return xe(n)?!!this._reactedByMyselfMap.has(o)&&this._reactedByMyselfMap.get(o).includes(a):n===1}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._reactedByMyselfMap.clear(),this._reactionInfoMap.clear()}}]),Za),vu=(E(Ja,Pn),UA=B(Ja),y(Ja,[{key:"sendMessage",value:function(e){var n=this,o=this._constructMessageInstance(e);if(o===null)return Ce({code:we.MSG_SEND_FAIL});this._addSendMessageTotalCount(o);var a=Date.now();return this.get(11).setMessageRandom(o),this._sendComboMessage(o,e).then(function(m){var m=m.data,M=m.time,h=m.sequence,m=m.readReceiptCode,m=(qt(m)&&m!==0&&(new Be("sendMessageWithReceipt").setMessage("from:".concat(o.from," to:").concat(o.to," sequence:").concat(h," readReceiptCode:").concat(m)).end(),w.w("".concat(n._n,".sendMessage readReceiptCode:").concat(m," message:").concat(n.getErrorMessage(m)))),n._addSendMessageSuccessCount(o,a),n.get(11)),M=(o.status=eo,o.time=M,o.conversationType===C.CONV_GROUP&&(o.sequence=h),m.appendToMessageList(o),o);return o._isExcludedFromLastMessage===!0&&(M=""),m.onMessageSent({conversationOptionsList:[{conversationID:o.conversationID,unreadCount:0,type:o.conversationType,subType:o.conversationSubType,lastMessage:M}]}),ft({message:o})}).catch(function(l){return n._onSendMessageFailed(o,l)})}},{key:"_sendComboMessage",value:function(e,n){var o=this._m.get(20),a="";return e.conversationType===C.CONV_C2C&&(a="".concat(re.NAME.OPEN_IM,".").concat(le.SEND_C2C_MSG)),e.conversationType===C.CONV_GROUP&&(a="".concat(re.NAME.GROUP,".").concat(le.SEND_GRP_MSG)),o.sendComboMessage({servcmd:a,data:n})}},{key:"_constructMessageInstance",value:function(e){var n="".concat(this._n,"._constructMessageInstance"),o=null;try{var a,l=this.getMyUserID(),h={};h.senderTinyID=this.getMyTinyID(),h.currentUser=l,h.from=e.From_Account||l,e.GroupId?(h.conversationID="".concat(C.CONV_GROUP).concat(e.GroupId),h.conversationType=C.CONV_GROUP,h.to=e.GroupId):e.To_Account&&(h.conversationID="".concat(C.CONV_C2C).concat(e.To_Account),h.conversationType=C.CONV_C2C,h.to=e.To_Account),h.time=e.MsgTimeStamp||0,h.random=e.Random||e.MsgRandom||0,h.priority=e.MsgPriority,wt(e.CloudCustomData)&&0<e.CloudCustomData.length&&(h.cloudCustomData=e.CloudCustomData),At(e.SendMsgControl)&&(h.messageControlInfo={},e.SendMsgControl.includes("NoUnread")&&(h.messageControlInfo.excludedFromUnreadCount=1),e.SendMsgControl.includes("NoLastMsg")&&(h.messageControlInfo.excludedFromLastMessage=1)),h.conversationType===C.CONV_GROUP&&At(e.To_Account)&&0<e.To_Account.length&&(a=e.To_Account,50<e.To_Account.length&&(a=e.To_Account.slice(0,50),w.w("".concat(n," To_Account must be less than or equal to 50."))),h.receiverList=V(a),e.To_Account=V(a)),e.IsNeedReadReceipt!==1&&e.NeedReadReceipt!==1||(h.needReadReceipt=!0),e.SupportMessageExtension===1&&(h.isSupportExtension=!0),(o=new Yn(h)).status=Fa,e.MsgClientTime=o.clientTime,o.conversationType===C.CONV_C2C&&(e.MsgSeq=o.sequence);for(var m,M=e.MsgBody.length,L=0;L<M;L++)(m=e.MsgBody[L]).MsgType==="TIMTextElem"?o.setTextElement(m.MsgContent.Text):m.MsgType==="TIMCustomElem"?o.setCustomElement({data:m.MsgContent.Data||"",description:m.MsgContent.Desc||"",extension:m.MsgContent.Ext||""}):m.MsgType==="TIMFaceElem"&&o.setFaceElement({index:m.MsgContent.Index,data:m.MsgContent.Data});var F=o.getElements();o.payload=F[0].content,o.type=F[0].type}catch($){o=null,w.e("".concat(n," failed. error:"),$)}return o}},{key:"_onSendMessageFailed",value:function(e,n){return e.status=Yd,this.get(11).deleteMessageRandom(e),this._addSendMessageFailCountOnUser(e,n),new Be("sendMessage").setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to)).setError(n).end(),w.e("".concat(this._n,"._onSendMessageFailed error:"),n),Ce(new ln({code:n&&n.code?n.code:we.MSG_SEND_FAIL,message:n&&n.message?n.message:void 0,data:{message:e}}))}},{key:"_getSendMessageSpecifiedKey",value:function(e){if(e.conversationType===C.CONV_C2C)return nr;if(e.conversationType===C.CONV_GROUP){var e=this.get(7).getLocalGroupProfile(e.to);if(e)return e=e.type,pi(e)?ir:Po}}},{key:"_addSendMessageTotalCount",value:function(e){e=this._getSendMessageSpecifiedKey(e),e&&this.get(26).addTotalCount(e)}},{key:"_addSendMessageSuccessCount",value:function(a,n){var o,a=this._getSendMessageSpecifiedKey(a);a&&((o=this.get(26)).addSuccessCount(a),o.addCost(a,Zn(n,!1)))}},{key:"_addSendMessageFailCountOnUser",value:function(l,o){var o=o.code,o=o===void 0?-1:o,a=this.get(26),l=this._getSendMessageSpecifiedKey(l);yg(o)&&l&&a.addFailedCountOfUserSide(l)}}]),Ja),Mc=(E(Sc,Pn),PA=B(Sc),y(Sc,[{key:"registerPlugin",value:function(e){var n=this;Object.keys(e).forEach(function(o){n.plugins[o]=e[o]}),new Be("registerPlugin").setMessage("".concat(Object.keys(e))).end()}},{key:"getPlugin",value:function(e){return this.plugins[e]}},{key:"reset",value:function(){}}]),Sc),Sg=(E(Xa,Pn),Tg=B(Xa),y(Xa,[{key:"_onLoginSuccess",value:function(e){this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:0})}},{key:"_startSync",value:function(l){var n=this,o=l.cookie,a=l.syncFlag,l=l.isOnlineSync,h="".concat(this._n,"._startSync");w.l("".concat(h," cookie:").concat(o," syncFlag:").concat(a," isOnlineSync:").concat(l)),this.req({proto:le.SYNC_UNREAD_MSG,data:{cookie:o,syncFlag:a,isOnlineSync:l}}).then(function(m){var L=m.data,M=L.cookie,L=L.syncFlag;Je(n._cookie=M)||(L===0||L===1?(n._dispatchUnreadMessage(u(u({},m.data),{},{isSyncingEnded:!1})),n._startSync({cookie:M,syncFlag:L,isOnlineSync:0})):L===2&&n._dispatchUnreadMessage(u(u({},m.data),{},{isSyncingEnded:!0})))}).catch(function(m){w.e("".concat(h," failed. error:"),m)})}},{key:"_dispatchUnreadMessage",value:function(e){e.eventArray&&this.get(20).onMessage({head:{},body:{eventArray:e.eventArray,isInstantMessage:this._onlineSyncFlag,isSyncingEnded:e.isSyncingEnded}}),this.get(6).onNewC2CMessage({dataList:e.messageList,isInstantMessage:!!e.isSyncingEnded&&this._onlineSyncFlag,C2CRemainingUnreadList:e.C2CRemainingUnreadList,C2CPairUnreadList:e.C2CPairUnreadList,isSyncingEnded:e.isSyncingEnded})}},{key:"startOnlineSync",value:function(){w.l("".concat(this._n,".startOnlineSync")),this._onlineSyncFlag=!0,this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:1})}},{key:"startSyncOnReconnected",value:function(){w.l("".concat(this._n,".startSyncOnReconnected.")),this._onlineSyncFlag=!0,this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:0})}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._onlineSyncFlag=!1,this._cookie=""}}]),Xa),Or={request:{toAccount:"To_Account",fromAccount:"From_Account",to:"To_Account",from:"From_Account",groupID:"GroupId",groupAtUserID:"GroupAt_Account",extension:"Ext",data:"Data",description:"Desc",elements:"MsgBody",sizeType:"Type",downloadFlag:"Download_Flag",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",videoUrl:"",imageUrl:"URL",fileUrl:"Url",uuid:"UUID",priority:"MsgPriority",receiverUserID:"To_Account",receiverGroupID:"GroupId",messageSender:"SenderId",messageReceiver:"ReceiverId",nick:"From_AccountNick",avatar:"From_AccountHeadurl",messageNumber:"MsgNum",pbDownloadKey:"PbMsgKey",downloadKey:"JsonMsgKey",applicationType:"PendencyType",userIDList:"To_Account",groupNameList:"GroupName",userID:"To_Account",groupAttributeList:"GroupAttr",mainSequence:"AttrMainSeq",avChatRoomKey:"BytesKey",attributeControl:"AttrControl",sequence:"seq",messageControlInfo:"SendMsgControl",updateSequence:"UpdateSeq",clientTime:"MsgClientTime",sequenceList:"MsgSeqList",topicID:"TopicId",customData:"CustomString",isSupportTopic:"SupportTopic",isWebUniapp:"is_web_uniapp",isSupportExtension:"SupportMessageExtension",messageSequence:"MsgSeq",messageKey:"MsgKey",startSequence:"startSeq",simplifiedMessage:"DownsizeFlag",isRelayMessage:"IsRelayMsg",reactionID:"Reaction",messageSequenceList:"MsgSeqList",messageKeyList:"MsgKeyList",cmConfigID:"CustomModerationConfigID"},response:{MsgPriority:"priority",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",Download_Flag:"downloadFlag",GroupId:"groupID",Member_Account:"userID",MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",MsgSeq:"sequence",MsgRandom:"random",MsgTime:"time",MsgTimeStamp:"time",MsgContent:"content",MsgBody:"elements",From_AccountNick:"nick",From_AccountHeadurl:"avatar",GroupWithdrawInfoArray:"revokedInfos",GroupReadInfoArray:"groupMessageReadNotice",LastReadMsgSeq:"lastMessageSeq",WithdrawC2cMsgNotify:"c2cMessageRevokedNotify",C2cWithdrawInfoArray:"revokedInfos",C2cReadedReceipt:"c2cMessageReadReceipt",ReadC2cMsgNotify:"c2cMessageReadNotice",LastReadTime:"peerReadTime",MsgRand:"random",MsgType:"type",MsgShow:"messageShow",NextMsgSeq:"nextMessageSeq",FaceUrl:"avatar",ProfileDataMod:"profileModify",Profile_Account:"userID",ValueBytes:"value",ValueNum:"value",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgFrom_AccountExtraInfo:"messageFromAccountExtraInformation",Operator_Account:"operatorID",OpType:"operationType",ReportType:"operationType",UserId:"userID",User_Account:"userID",List_Account:"userIDList",MsgOperatorMemberExtraInfo:"operatorInfo",MsgMemberExtraInfo:"memberInfoList",ImageUrl:"avatar",NickName:"nick",MsgGroupNewInfo:"newGroupProfile",MsgAppDefinedData:"groupCustomField",Owner_Account:"ownerID",GroupFaceUrl:"avatar",GroupIntroduction:"introduction",GroupNotification:"notification",GroupApplyJoinOption:"joinOption",MsgKey:"messageKey",GroupInfo:"groupProfile",ShutupTime:"muteTime",Desc:"description",Ext:"extension",GroupAt_Account:"groupAtUserID",MsgNum:"messageNumber",PbMsgKey:"pbDownloadKey",JsonMsgKey:"downloadKey",MsgModifiedFlag:"isModified",PendencyItem:"applicationItem",PendencyType:"applicationType",AddTime:"time",AddSource:"source",AddWording:"wording",ProfileImImage:"avatar",PendencyAdd:"friendApplicationAdded",FrienPencydDel_Account:"friendApplicationDeletedUserIDList",Peer_Account:"userID",GroupAttr:"groupAttributeList",GroupAttrAry:"groupAttributeList",AttrMainSeq:"mainSequence",seq:"sequence",GroupAttrOption:"groupAttributeOption",BytesChangedKeys:"changedKeyList",GroupAttrInfo:"groupAttributeList",GroupAttrSeq:"mainSequence",PushChangedAttrValFlag:"isWithChangedAttributeInfo",SubKeySeq:"sequence",Val:"value",MsgGroupFromCardName:"senderNameCard",MsgGroupFromNickName:"senderNick",C2cNick:"peerNick",C2cImage:"peerAvatar",SendMsgControl:"messageControlInfo",NoLastMsg:"excludedFromLastMessage",NoUnread:"excludedFromUnreadCount",UpdateSeq:"updateSequence",MuteNotifications:"muteFlag",MsgClientTime:"clientTime",TinyId:"tinyID",GroupMsgReceiptList:"readReceiptList",ReadNum:"readCount",UnreadNum:"unreadCount",TopicId:"topicID",MillionGroupFlag:"communityType",SupportTopic:"isSupportTopic",MsgTopicNewInfo:"newTopicInfo",ShutupAll:"muteAllMembers",CustomString:"customData",TopicFaceUrl:"avatar",TopicIntroduction:"introduction",TopicNotification:"notification",TopicIdArray:"topicIDList",MsgVersion:"messageVersion",C2cMsgModNotifys:"c2cMessageModified",GroupMsgModNotifys:"groupMessageModified",ApplyJoinOption:"joinOption",MsgFlag:"messageRemindType",AtInfoList:"groupAtInfoList",AtFlagList:"groupAtType",AtMsgSeq:"sequence",BanDuration:"duration",BanDescription:"reason",NotVisible:"invisible",BytesTag:"tag",BytesValue:"value",RptBytesValue:"value",LatestSeq:"globalSequence",ClearSeq:"clearSequence",SupportMessageExtension:"isSupportExtension",ExtensionList:"extensions",GroupCounter:"counterList",Revoker_Account:"revoker",MsgExtensionNotify:"messageExtensionNotify",ExtensionC2cMsgInfo:"messageInfo",ExtensionGroupMsgInfo:"messageInfo",MsgOptType:"operateType",SetKVInfo:"operateResultList",DeleteKVInfo:"operateResultList",ClearKVInfo:"operateResultList",MsgKeyValue:"extensions",ClearMsgSeq:"clearSequence",MsgLastSeq:"globalSequence",InviteJoinOption:"inviteOption",MemberList_Account:"inviteeList",MsgMemberExtraInfoList:"inviteeInfoList",E:"event",GInf:"groupProfile",MCT:"clientTime",MR:"random",MP:"priority",MTS:"time",GId:"groupID",MS:"sequence",CCD:"cloudCustomData",F_Account:"from",F_Hd:"avatar",F_NN:"nick",GN:"groupName",GT:"groupType",IsSys:"isSystemMessage",OpInf:"operatorInfo",Img:"avatar",NN:"nick",OnlineInf:"onlineMemberInfo",ET:"expireTime",Num:"onlineMemberNum",Opt:"operationType",O_Account:"operatorID",RT:"operationType",UDF:"userDefinedField",L_Account:"userIDList",IsPlaceMsg:"isPlaceMessage",MsgCheckResult:"checkResult",Results:"resultList",Reaction:"reactionID",Reaction_Account:"userIDList",MsgReactionNotifyList:"messageReactionNotifyList",MsgReactionNotify:"messageReactionNotify",MsgReactionSummary:"reactionList",C2CMsgInfo:"C2CMessageInfo",GroupMsgInfo:"groupMessageInfo",int32_err_code:"errorCode",str_err_msg:"errorMsg",MsgDropReason:"messageDropReason",ReactedByMe:"reactedByMyself",Level:"messageRemindType"},ignoreKeyWord:["C2C","ID","USP"]};function Xa(e){return f(this,Xa),(e=Tg.call(this,e))._n="SyncUnreadMessageModule",e._cookie="",e._onlineSyncFlag=!1,e.getInnerEmitterInstance().on(Rn.A2KEY_AND_TINYID_UPDATED,e._onLoginSuccess,k(e)),e}function Sc(e){return f(this,Sc),(e=PA.call(this,e))._n="PluginModule",e.plugins={},e}function Ja(e){return f(this,Ja),(e=UA.call(this,e))._n="ComboMessageModule",e}function Za(e){return f(this,Za),(e=Eg.call(this,e))._n="MessageReactionModule",e._reactedByMyselfMap=new Map,e._reactionInfoMap=new Map,e}function Dc(e){return f(this,Dc),(e=Cg.call(this,e))._n="MessageExtensionModule",e.messageExtensionMap=new Map,e.globalSeqMap=new Map,e.getMessageExtensionsMap=new Map,e}function ra(e){return f(this,ra),(e=_u.call(this,e))._n="MessageModule",e._messageOptionsMap=new Map,e._mergerMessageHandler=new mv(k(e)),e}function Iu(e,n){if(typeof e!="string"&&!Array.isArray(e))throw new TypeError("Expected the input to be `string | string[]`");return n=Object.assign({pascalCase:!1},n),(e=Array.isArray(e)?e.map(function(o){return o.trim()}).filter(function(o){return o.length}).join("-"):e.trim()).length===0?"":e.length===1?n.pascalCase?e.toUpperCase():e.toLowerCase():(e=e=(e=e!==e.toLowerCase()?Dg(e):e).replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,function(o,a){return a.toUpperCase()}).replace(/\d+(\w|$)/g,function(o){return o.toUpperCase()}),n.pascalCase?e.charAt(0).toUpperCase()+e.slice(1):e)}var Dg=function(e){for(var n=!1,o=!1,a=!1,l=0;l<e.length;l++){var h=e[l];n&&/[a-zA-Z]/.test(h)&&h.toUpperCase()===h?(e=e.slice(0,l)+"-"+e.slice(l),a=o,o=!(n=!1),l++):o&&a&&/[a-zA-Z]/.test(h)&&h.toLowerCase()===h?(e=e.slice(0,l-1)+"-"+e.slice(l-1),a=o,n=!(o=!1)):(n=h.toLowerCase()===h&&h.toUpperCase()!==h,a=o,o=h.toUpperCase()===h&&h.toLowerCase()!==h)}return e};function Cv(e,n){var o=0;return function a(l,h){return 100<++o?(o--,l):At(l)?(m=l.map(function($){return oo($)?a($,h):$}),o--,m):oo(l)?(M=l,L=function($,ue){if(!Xs(ue))return!1;if(ue!==Iu(ue))for(var fe=0;fe<Or.ignoreKeyWord.length&&!ue.includes(Or.ignoreKeyWord[fe]);fe++);var he;return xe(h[ue])?(he=ue)==="OPPOChannelID"?he:he[0].toUpperCase()+Iu(he).slice(1):h[ue]},F=Object.create(null),Object.keys(M).forEach(function($){var ue=L(M[$],$);ue&&(F[ue]=M[$])}),m=Kp(m=F,function($,ue){return At($)||oo($)?a($,h):$}),o--,m):void 0;var m,M,L,F}(e,n)}for(var Ng,yu=String.fromCharCode,Mv=function(e){var n=0|e.charCodeAt(0);if(55296<=n)if(n<56320)if(e=0|e.charCodeAt(1),56320<=e&&e<=57343){if(65535<(n=(n<<10)+e-56613888|0))return yu(240|n>>>18,128|n>>>12&63,128|n>>>6&63,128|63&n)}else n=65533;else n<=57343&&(n=65533);return n<=2047?yu(192|n>>>6,128|63&n):yu(224|n>>>12,128|n>>>6&63,128|63&n)},Tu=function(e){for(var n=e===void 0?"":(""+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,Mv),o=0|n.length,a=new Uint8Array(o),l=0;l<o;l=l+1|0)a[l]=0|n.charCodeAt(l);return a},Sv=(y(FA,[{key:"getID",value:function(){return this._id}},{key:"_onOpen",value:function(){this._handler.onOpen({id:this._id})}},{key:"_onClose",value:function(e){this._handler.onClose({id:this._id,e})}},{key:"_onMessage",value:function(e){this._handler.onMessage({data:this._canIUseBinaryFrame?function(n){for(var o=new Uint8Array(n),a="",l=0,h=o.length;l<h;){var m=o[l],M=0,L=0;if(m<=127?(M=0,L=255&m):m<=223?(M=1,L=31&m):m<=239?(M=2,L=15&m):m<=244&&(M=3,L=7&m),0<h-l-M)for(var F=0;F<M;)L=L<<6|63&(m=o[l+F+1]),F+=1;else L=65533,M=h-l;a+=String.fromCodePoint(L),l+=M+1}return a}(e.data):e.data})}},{key:"_onError",value:function(e){this._handler.onError({id:this._id,e})}},{key:"setIsWorkerEnabled",value:function(e){this._isWorkerEnabled=!0}},{key:"close",value:function(e){if(this._workerSocket&&(this._workerSocket.postMessage({cmd:"stop",code:e}),this._workerSocket.terminate(),this._workerSocket=null),Pe)return Ne.offSocketClose(),Ne.offSocketMessage(),Ne.offSocketOpen(),Ne.offSocketError(),void Ne.closeSocket();this._socket&&(Fe?(this._socket.onClose(function(){}),this._socket.onOpen(function(){}),this._socket.onMessage(function(){}),this._socket.onError(function(){})):lt&&(this._socket.onopen=null,this._socket.onmessage=null,this._socket.onclose=null,this._socket.onerror=null),De?this._socket.close({code:e}):this._socket.close(e),this._socket=null)}},{key:"send",value:function(e){this._workerSocket?this._workerSocket.postMessage({cmd:"sendMessage",data:this._canIUseBinaryFrame?Tu(e.data).buffer:e.data}):Pe?Ne.sendSocketMessage({data:e.data,fail:function(){e.fail&&e.requestID&&e.fail(e.requestID)}}):this._socket&&(Fe?this._socket.send({data:this._canIUseBinaryFrame?Tu(e.data).buffer:e.data,fail:function(){e.fail&&e.requestID&&e.fail(e.requestID)}}):lt&&this._socket.send(this._canIUseBinaryFrame?Tu(e.data).buffer:e.data))}}]),FA),Dv=["keyMap"],Nv=["keyMap"],$a="connected",xA="connecting",br="disconnected",Rg=(y(ar,[{key:"_setWebsocketHost",value:function(){var e=this._chM.get(12);this._currentSite=me,this._chM.isOversea()&&(this._currentSite="OVERSEA"),e.isSingaporeSite()?this._currentSite="SINGAPORE":e.isKoreaSite()?this._currentSite="KOREA":e.isGermanySite()?this._currentSite="GERMANY":e.isIndiaSite()?this._currentSite="IND":e.isJapanSite()?this._currentSite="JPN":e.isUSASite()?this._currentSite="USA":e.isIndonesiaSite()&&(this._currentSite="INDONESIA"),re.HOST.setCurrent(this._currentSite)}},{key:"_initConnection",value:function(){xe(re.HOST.CURRENT.BACKUP)||this._url===""?this._url=re.HOST.CURRENT.DEFAULT:this._url===re.HOST.CURRENT.DEFAULT?this._url=re.HOST.CURRENT.BACKUP:this._url===re.HOST.CURRENT.BACKUP?this._url=this._canIUseAnyCast()?re.HOST.CURRENT.ANYCAST:re.HOST.CURRENT.DEFAULT:this._url===re.HOST.CURRENT.ANYCAST&&(re.HOST.CURRENT.ANYCAST="",this._url=re.HOST.CURRENT.DEFAULT);var e=this._chM.get(12),n=e.getProxyServer();Je(n)||(this._url=n),e.isTestEnv()&&(this._url=ie.TEST[this._currentSite].DEFAULT),this._connect(),this._nextPingTs=0}},{key:"_canIUseAnyCast",value:function(){return lt&&re.HOST.CURRENT.ANYCAST}},{key:"onCheckTimer",value:function(e){e%1==0&&(this._checkPromiseMap(),this._checkNativeAppWS())}},{key:"_checkPromiseMap",value:function(){var e=this;this._promiseMap.size!==0&&this._promiseMap.forEach(function(l,o){var a=l.reject,l=l.timestamp,h=15e3;o.indexOf(le.LOGIN)!==-1&&(h=9e4),Date.now()-l>=h&&(w.l("".concat(e._n,"._checkPromiseMap request timeout, delete requestID:").concat(o)),e._promiseMap.delete(o),a(new ln({code:we.NETWORK_TIMEOUT})),e._chM.onRequestTimeout(o))})}},{key:"_checkNativeAppWS",value:function(){We&&!this.isConnected()&&this._reConnect()}},{key:"onOpen",value:function(e){var n;this._readyState!==br&&(this._onOpenTs=Date.now(),e=e.id,this._socketID=e,n=Zn(this._startTs,!1),w.l("".concat(this._n,"._onOpen cost:").concat(n," ms. socketID:").concat(e)),new Be("wsOnOpen").setMessage(n).setCostTime(n).setMoreMessage("socketID:".concat(e)).end(),this._readyState=$a,this._reConnectCount=0,this._resend(),this._reConnectFlag===!0&&(this._chM.onReconnected(),this._reConnectFlag=!1),this._chM.onOpen())}},{key:"onClose",value:function(a){var n=new Be("wsOnClose"),o=a.id,a=a.e,l="sourceSocketID:".concat(o," currentSocketID:").concat(this._socketID," code:").concat(a.code," reason:").concat(a.reason),h=0;this._onOpenTs!==0&&(h=Date.now()-this._onOpenTs),n.setMessage(h).setCostTime(h).setMoreMessage(l).setCode(a.code).end(!0),w.l("".concat(this._n,"._onClose ").concat(l," onlineTime:").concat(h)),o===this._socketID&&(this._readyState=br,h<1e3?this._chM.onReconnectFailed():this._chM.onClose())}},{key:"onError",value:function(o){var n=o.id,o=o.e,a="sourceSocketID:".concat(n," currentSocketID:").concat(this._socketID);new Be("wsOnError").setMessage(o.errMsg||Xl(o)).setMoreMessage(a).setLevel("error").end(!0),w.w("".concat(this._n,"._onError"),o,a),n===this._socketID&&(this._readyState=br,this._chM.onError())}},{key:"onMessage",value:function(e){var n;try{n=JSON.parse(e.data)}catch{new Be("jsonParseError").setMessage(e.data).end()}if(n&&n.head){var o,a,l,e=this._getRequestIDFromHead(n.head),h=n.body;if(this._chM.get(30).isTRTCCommand(e)||(l=zd(n.head),h=function M(L,F){return At(L)?L.map(function(he){return oo(he)?M(he,F):he}):oo(L)?($=L,ue=function(he,be){return xe(F[be])?Iu(be):F[be]},fe={},Object.keys($).forEach(function(he){fe[ue($[he],he)]=$[he]}),Kp(fe,function(he){return At(he)||oo(he)?M(he,F):he})):void 0;var $,ue,fe}(n.body,this._getResponseKeyMap(l))),w.d("".concat(this._n,".onMessage ret:").concat(JSON.stringify(h)," requestID:").concat(e," has:").concat(this._promiseMap.has(e))),this._setNextPingTs(),this._promiseMap.has(e))return o=(l=this._promiseMap.get(e)).resolve,a=l.reject,l=l.timestamp,this._promiseMap.delete(e),this._calcRTT(l),void(h.errorCode&&h.errorCode!==0?(this._chM.onErrorCodeNotZero(h),a(new ln({code:h.errorCode,message:h.errorInfo||"",data:e.includes(le.MODIFY_C2C_MSG)||e.includes(le.MODIFY_GRP_MSG)?{elements:h.elements,messageVersion:h.messageVersion,cloudCustomData:h.cloudCustomData}:void 0}))):o(ft(h)));this._chM.onMessage({head:n.head,body:h})}}},{key:"_calcRTT",value:function(e){e=Date.now()-e,this._chM.get(26).addRTT(e)}},{key:"_connect",value:function(){this._startTs=Date.now(),this._onOpenTs=0,this._socket=new Sv(this),this._socketID=this._socket.getID(),this._readyState=xA,w.l("".concat(this._n,"._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled()," socketID:").concat(this._socketID," url:").concat(this.getURL())),new Be("wsConnect").setMessage("socketID:".concat(this._socketID," url:").concat(this.getURL())).end()}},{key:"getURL",value:function(){this._chM.isDevMode()&&(this._canIUseBinaryFrame=!1);var e=$s(),n=((Pe||Ie&&e==="windows"||We)&&(this._canIUseBinaryFrame=!1),-1),a=(e==="ios"?n=Lt||-1:e==="android"&&(n=at||-1),this._chM.get(12)),o=this._chM.getPlatform(),l=a.getSDKAppID(),a=a.getInstanceID(),l="sdkappid=".concat(l,"&instanceid=").concat(a,"&random=").concat(this._getRandom(),"&platform=").concat(o,"&host=").concat(e,"&version=").concat(n,"&sdkversion=").concat("3.3.1");return Ae&&(l+="&isminigame=1"),(this._canIUseBinaryFrame?"".concat(this._url,"/binfo?"):"".concat(this._url,"/info?")).concat(l)}},{key:"_closeConnection",value:function(e){w.l("".concat(this._n,"._closeConnection socketID:").concat(this._socketID)),this._socket&&(this._socket.close(e),this._socketID=-1,this._socket=null,this._readyState=br)}},{key:"_resend",value:function(){var e=this;if(w.l("".concat(this._n,"._resend reConnectFlag:").concat(this._reConnectFlag),"promiseMap.size:".concat(this._promiseMap.size," simpleRequestMap.size:").concat(this._simpleRequestMap.size)),0<this._promiseMap.size&&this._promiseMap.forEach(function($,M){var L=$.uplinkData,F=$.resolve,$=$.reject;M.indexOf(le.AV_POLLING)!==-1?e._promiseMap.delete(M):(e._promiseMap.set(M,{resolve:F,reject:$,timestamp:Date.now(),uplinkData:L}),e._execute(M,L))}),0<this._simpleRequestMap.size){var n,o=J(this._simpleRequestMap);try{for(o.s();!(n=o.n()).done;){var a=K(n.value,2),l=a[0],h=a[1];this._execute(l,h)}}catch(m){o.e(m)}finally{o.f()}this._simpleRequestMap.clear()}}},{key:"send",value:function(e){var n=this,o=(e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap,b(e,Dv)),a=this._getRequestIDFromHead(e.head),l=JSON.stringify(o);return new Promise(function(h,m){n._promiseMap.set(a,{resolve:h,reject:m,timestamp:Date.now(),uplinkData:l}),w.d("".concat(n._n,".send uplinkData:").concat(JSON.stringify(o)," requestID:").concat(a," readyState:").concat(n._readyState)),n._readyState!==$a?n._reConnect():(n._execute(a,l),n._chM.get(26).addRequestCount())})}},{key:"simplySend",value:function(n){n.head.seq=this._getSequence(),n.head.reqtime=Math.floor(Date.now()/1e3),n.keyMap;var o=b(n,Nv),n=this._getRequestIDFromHead(n.head),o=JSON.stringify(o);this._readyState!==$a?(this._simpleRequestMap.size<this.MAX_SIZE?this._simpleRequestMap.set(n,o):w.l("".concat(this._n,".simplySend. simpleRequestMap is full, drop request!")),this._reConnect()):this._execute(n,o)}},{key:"_execute",value:function(e,n){this._socket.send({data:n,fail:Fe?this._onSendFail.bind(this):void 0,requestID:e})}},{key:"_onSendFail",value:function(e){w.l("".concat(this._n,"._onSendFail requestID:").concat(e)),this._chM.onSendFail()}},{key:"_getSequence",value:function(){var e;if(this._startSequence<2415919103)return e=this._startSequence,this._startSequence+=1,this._startSequence===2415919103&&(this._startSequence=Mi()),e}},{key:"_getRequestIDFromHead",value:function(e){return e.servcmd+e.seq}},{key:"_getResponseKeyMap",value:function(e){return e=this._chM.getKeyMap(e),u(u({},Or.response),e.response)}},{key:"_reConnect",value:function(){this._readyState!==$a&&this._readyState!==xA&&this.forcedReconnect()}},{key:"forcedReconnect",value:function(){var e="".concat(this._n,".forcedReconnect");w.l("".concat(e," count:").concat(this._reConnectCount," readyState:").concat(this._readyState)),this._reConnectFlag=!0,this._resetRandom(),this._reConnectCount<this.MAX_RECONNECT_COUNT?(this._reConnectCount+=1,this._closeConnection(4001),this._initConnection()):(this._reConnectCount=0,this._chM.get(15).isOnline()?(w.w("".concat(e," disconnected from wsserver but network is ok, continue...")),this._closeConnection(4001),this._initConnection()):this._chM.onReconnectFailed())}},{key:"getReconnectFlag",value:function(){return this._reConnectFlag}},{key:"_setNextPingTs",value:function(){this._nextPingTs=Date.now()+1e4}},{key:"getNextPingTs",value:function(){return this._nextPingTs}},{key:"isConnected",value:function(){return this._readyState===$a}},{key:"canIUseBinaryFrame",value:function(){return this._canIUseBinaryFrame}},{key:"setIsWorkerEnabled",value:function(e){w.l("".concat(this._n,".setIsWorkerEnabled flag:").concat(e)),this._isWorkerEnabled=e}},{key:"getIsWorkerEnabled",value:function(){return this._isWorkerEnabled&&kn}},{key:"_getRandom",value:function(){return this._random===0&&(this._random=Math.random()),this._random}},{key:"_resetRandom",value:function(){this._random=0}},{key:"close",value:function(){w.l("".concat(this._n,".close")),this._closeConnection(4e3),this._promiseMap.clear(),this._startSequence=Mi(),this._readyState=br,this._simpleRequestMap.clear(),this._reConnectFlag=!1,this._reConnectCount=0,this._onOpenTs=0,this._url="",this._random=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0}}]),ar),Eu=function(e,n,o){return new Promise(function(a,l){var h,m,M="application/x-www-form-urlencoded;charset=UTF-8";Fe?Ne.request({url:n,data:o,method:e,timeout:3e3,header:{"content-type":M},success:function(L){L&&L.data&&L.data.NetCheckInfo&&w.l("".concat("getconninfo ok in"," miniapp. ret:"),L.data),a()},fail:function(){l(new ln({code:we.NETWORK_ERROR}))}}):(h=new XMLHttpRequest,m=setTimeout(function(){h.abort(),l(new ln({code:we.NETWORK_TIMEOUT}))},3e3),h.onreadystatechange=function(){h.readyState===4&&(clearTimeout(m),h.status===200||h.status===304?(h.responseText&&-1<h.responseText.indexOf("NetCheckInfo")&&w.l("".concat("getconninfo ok in"," web. ret:"),JSON.parse(h.responseText)),a()):l(new ln({code:we.NETWORK_ERROR})))},h.open(e,n,!0),h.setRequestHeader("Content-type",M),o?h.send(o):h.send())})},Lg=(E(Lc,Pn),Ng=B(Lc),y(Lc,[{key:"onCheckTimer",value:function(e){this._socketHandler&&(this.isLoggedIn()?(0<this._timerForNotLoggedIn&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(e)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:"onErrorCodeNotZero",value:function(e){this.get(20).onErrorCodeNotZero(e)}},{key:"onMessage",value:function(e){this.get(20).onMessage(e)}},{key:"send",value:function(e){return this._socketHandler?this._previousState!==C.NET_STATE_CONNECTED&&e.head.servcmd.includes(le.SSO_STAT)?(this.reConnect(),this.isPrivateNetWork()?Promise.resolve():this._sendLogViaHTTP(e)):this._socketHandler.send(e):Promise.reject()}},{key:"_sendLogViaHTTP",value:function(o){var n=re.HOST.CURRENT.STAT,n="".concat(n,"/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(o.head.sdkappid,"&reqtime=").concat(Date.now()),o=JSON.stringify(o.body);return Eu("POST",n,o)}},{key:"simplySend",value:function(e){return this._socketHandler?this._socketHandler.simplySend(e):Promise.reject()}},{key:"onOpen",value:function(){this._ping()}},{key:"onClose",value:function(){this._socketHandler&&this._socketHandler.getReconnectFlag()&&this._emitNetStateChangeEvent(C.NET_STATE_DISCONNECTED),this.reConnect()}},{key:"onError",value:function(){Fe&&!We&&this.outputWarning("DomainNameInMP"),this._emitNetStateChangeEvent(C.NET_STATE_DISCONNECTED)}},{key:"getKeyMap",value:function(e){return this.get(20).getKeyMap(e)}},{key:"_onAppHide",value:function(){this._isAppShowing=!1}},{key:"_onAppShow",value:function(){this._isAppShowing=!0}},{key:"onRequestTimeout",value:function(e){15e3<=Date.now()-this._disconnectedTS&&this.diagnose()}},{key:"onSendFail",value:function(){this._emitNetStateChangeEvent(C.NET_STATE_DISCONNECTED)}},{key:"onReconnected",value:function(){w.l("".concat(this._n,".onReconnected cost:").concat(Zn(this._disconnectedTS,!0,!0))),this._m.restartTimer(),this.get(20).onReconnected(Zn(this._disconnectedTS,!1,!1)),this._disconnectedTS=0,this._emitNetStateChangeEvent(C.NET_STATE_CONNECTED)}},{key:"onReconnectFailed",value:function(){w.l("".concat(this._n,".onReconnectFailed")),this._emitNetStateChangeEvent(C.NET_STATE_DISCONNECTED)}},{key:"setIsWorkerEnabled",value:function(e){this._socketHandler&&this._socketHandler.setIsWorkerEnabled(!1)}},{key:"offline",value:function(){this._emitNetStateChangeEvent(C.NET_STATE_DISCONNECTED)}},{key:"reConnect",value:function(){var e=0<arguments.length&&arguments[0]!==void 0&&arguments[0],n=!1,o=(this._socketHandler&&(n=this._socketHandler.getReconnectFlag()),"forcedFlag:".concat(e," fatalErrorFlag:").concat(this._fatalErrorFlag," previousState:").concat(this._previousState," reconnectFlag:").concat(n));if(w.l("".concat(this._n,".reConnect ").concat(o)),!this._fatalErrorFlag&&this._socketHandler){if(e===!0)this._socketHandler.forcedReconnect();else{if(this._previousState===C.NET_STATE_CONNECTING&&n)return;this._socketHandler.forcedReconnect()}this._emitNetStateChangeEvent(C.NET_STATE_CONNECTING)}}},{key:"_emitNetStateChangeEvent",value:function(e){this._previousState!==e&&(w.l("".concat(this._n,"._emitNetStateChangeEvent from ").concat(this._previousState," to ").concat(e)),e===C.NET_STATE_DISCONNECTED&&this._disconnectedTS===0&&(this._disconnectedTS=Date.now(),this.diagnose()),this._previousState=e,this.emitOuterEvent(R.NET_STATE_CHANGE,{state:e}))}},{key:"_ping",value:function(){var e,n=this;this._probing!==!0&&(this._probing=!0,e=this.get(20).getProtocolData({proto:le.PING}),this.send(e).then(function(){n._probing=!1}).catch(function(o){if(w.w("".concat(n._n,"._ping failed. error:"),o),n._probing=!1,o&&o.code===60002)return new Be("error").setMessage("code:".concat(o.code," message:").concat(o.message)).end(),n._fatalErrorFlag=!0,void n._emitNetStateChangeEvent(C.NET_STATE_DISCONNECTED);n.get(15).isOnline()?n.reConnect():n._emitNetStateChangeEvent(C.NET_STATE_DISCONNECTED)}))}},{key:"_checkNextPing",value:function(){this._socketHandler&&this._socketHandler.isConnected()&&Date.now()>=this._socketHandler.getNextPingTs()&&this._ping()}},{key:"dealloc",value:function(){this._socketHandler&&(this._socketHandler.close(),this._socketHandler=null),-1<this._timerForNotLoggedIn&&clearInterval(this._timerForNotLoggedIn)}},{key:"onRestApiKickedOut",value:function(){this._socketHandler&&(this._socketHandler.close(),this.reConnect(!0))}},{key:"diagnose",value:function(){this.isPrivateNetWork()||(this._diagnoseBySSO(),this._diagnoseByCDN())}},{key:"_diagnoseBySSO",value:function(){var e=this,n=this._socketHandler.getURL(),o=n.split("/")[2];o.startsWith("ws")&&(n=n.slice(n.indexOf("info?")+5),o="https://".concat(o,"/v3/netcheck/getconninfo?").concat(n,"&reqtime=").concat(Date.now()),Eu("GET",o).catch(function(a){w.w("".concat(e._n,"._diagnoseBySSO failed. error:"),a)}))}},{key:"_diagnoseByCDN",value:function(){var e=this,n=this._socketHandler.getURL(),n=n.slice(n.indexOf("info?")+5),n="https://boce-cdn.my-imcloud.com/v3/netcheck/getconninfo?".concat(n,"&reqtime=").concat(Date.now());Eu("GET",n).catch(function(o){w.w("".concat(e._n,"._diagnoseByCDN failed. error:"),o)})}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._previousState=C.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3),this._disconnectedTS=0}}]),Lc),Og=["a2","tinyid"],Rv=["a2","tinyid"],Nc=(y(Du,[{key:"_fillConfigMap",value:function(){this._configMap.clear();var e=this._sessionM.genCommonHead(),n=this._sessionM.genCosSpecifiedHead(),o=this._sessionM.genSSOReportHead();this._configMap.set(le.LOGIN,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.LOGIN)}),body:{state:"Online",isWebUniapp:0,deviceBrand:0},keyMap:{request:{deviceBrand:"InstType"},response:{InstId:"instanceID",HelloInterval:"helloInterval"}}}),this._configMap.set(le.LOGOUT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.LOGOUT)}),body:{type:0},keyMap:{request:{type:"wslogout_type"}}}),this._configMap.set(le.HELLO,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.HELLO)}),body:{isWebUniapp:0},keyMap:{response:{NewInstInfo:"newInstanceInfo"}}}),this._configMap.set(le.KICK_OTHER,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.STAT_SERVICE,".").concat(le.KICK_OTHER)}),body:{}}),this._configMap.set(le.COS_SIGN,{head:u(u({},n),{},{servcmd:"".concat(re.NAME.IM_COS_SIGN,".").concat(le.COS_SIGN)}),body:{cmd:"open_im_cos_svc",subCmd:"get_cos_token",duration:300,version:2},keyMap:{request:{userSig:"usersig",subCmd:"sub_cmd",cmd:"cmd",duration:"duration",version:"version"},response:{expired_time:"expiredTime",bucket_name:"bucketName",session_token:"sessionToken",tmp_secret_id:"secretId",tmp_secret_key:"secretKey"}}}),this._configMap.set(le.COS_PRE_SIG,{head:u(u({},n),{},{servcmd:"".concat(re.NAME.CUSTOM_UPLOAD,".").concat(le.COS_PRE_SIG)}),body:{fileType:void 0,fileName:void 0,uploadMethod:0,duration:900},keyMap:{request:{userSig:"usersig",fileType:"file_type",fileName:"file_name",uploadMethod:"upload_method"},response:{expired_time:"expiredTime",request_id:"requestId",head_url:"headUrl",upload_url:"uploadUrl",download_url:"downloadUrl",ci_url:"ciUrl",snapshot_url:"requestSnapshotUrl"}}}),this._configMap.set(le.SIMPLE_COS_PRE_SIG,{head:u(u({},n),{},{servcmd:"".concat(re.NAME.CUSTOM_UPLOAD,".").concat(le.SIMPLE_COS_PRE_SIG)}),body:{uploadMethod:0,platform:2,SDKAppID:0,userID:"",conversationType:1,uploadConfig:[{fileID:1,fileType:1,fileName:""}]},keyMap:{request:{platform:"uint32_platform",SDKAppID:"uint32_sdkappid",userID:"str_user_id",uploadMethod:"uint32_upload_method",conversationType:"uint32_scene",uploadConfig:"rpt_upload_object",fileID:"uint32_file_id",fileType:"uint32_file_type",fileName:"str_file_name"},response:{str_final_ip:"uploadIP",rpt_pre_sig:"preSig",uint32_file_id:"fileID",uint32_exist_flag:"existFlag",str_download_url:"downloadUrl",str_upload_url:"uploadUrl",str_snapshot_url:"requestSnapshotUrl",str_file_key:"fileKey"}}}),this._configMap.set(le.GET_IMAGE_INFO,{head:u(u({},n),{},{servcmd:"".concat(re.NAME.CUSTOM_UPLOAD,".").concat(le.GET_IMAGE_INFO)}),body:{imageUrl:""},keyMap:{request:{imageUrl:"str_image_url"},response:{rpt_msg_image_info:"imageInfoArray",uint32_image_type:"type",str_url:"url",uint32_width:"width",uint32_height:"height",str_image_format:"imageFormat"}}}),this._configMap.set(le.GET_IP,{head:u(u({},n),{},{servcmd:"".concat(re.NAME.CUSTOM_UPLOAD,".").concat(le.GET_IP)}),body:{domainName:""},keyMap:{request:{domainName:"str_domain"},response:{str_final_ip:"ip"}}}),this._configMap.set(le.VIDEO_COVER,{head:u(u({},n),{},{servcmd:"".concat(re.NAME.CUSTOM_UPLOAD,".").concat(le.VIDEO_COVER)}),body:{version:1,platform:void 0,coverName:void 0,requestSnapshotUrl:void 0},keyMap:{request:{version:"version",platform:"platform",coverName:"cover_name",requestSnapshotUrl:"snapshot_url"},response:{error_code:"errorCode",error_msg:"errorInfo",download_url:"snapshotUrl"}}}),this._configMap.set(le.FETCH_COMMERCIAL_CONFIG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_CONFIG_MANAGER,".").concat(le.FETCH_COMMERCIAL_CONFIG)}),body:{SDKAppID:0},keyMap:{request:{SDKAppID:"uint32_sdkappid"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}),this._configMap.set(le.PUSHED_COMMERCIAL_CONFIG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_CONFIG_MANAGER,".").concat(le.PUSHED_COMMERCIAL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}),this._configMap.set(le.FETCH_CLOUD_CTRL_CONFIG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_CONFIG_MANAGER,".").concat(le.FETCH_CLOUD_CTRL_CONFIG)}),body:{SDKAppID:0,version:0},keyMap:{request:{SDKAppID:"uint32_sdkappid",version:"uint64_version"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}),this._configMap.set(le.PUSHED_CLOUD_CTRL_CONFIG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_CONFIG_MANAGER,".").concat(le.PUSHED_CLOUD_CTRL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}),this._configMap.set(le.OVERLOAD_NOTIFY,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OVERLOAD_PUSH,".").concat(le.OVERLOAD_NOTIFY)}),body:{},keyMap:{response:{OverLoadServCmd:"overloadCommand",DelaySecs:"waitingTime"}}}),this._configMap.set(le.SYNC_UNREAD_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.SYNC_UNREAD_MSG)}),body:{cookie:"",syncFlag:0,needAbstract:1,isOnlineSync:0,needSignaling:1},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",from:"From_Account",to:"To_Account",time:"MsgTimeStamp",sequence:"MsgSeq",random:"MsgRandom",elements:"MsgBody"},response:{MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",ClientSeq:"clientSequence",MsgSeq:"sequence",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgRandom:"random",MsgTimeStamp:"time",MsgContent:"content",ToGroupId:"to",MsgKey:"messageKey",GroupTips:"groupTips",MsgBody:"elements",MsgType:"type",C2CRemainingUnreadCount:"C2CRemainingUnreadList",C2CPairUnreadCount:"C2CPairUnreadList"}}}),this._configMap.set(le.GET_PROFANITY_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_MSG_AUDIT_MGR,".").concat(le.GET_PROFANITY_LIST)}),body:{version:0,deviceID:"",startIndex:void 0},keyMap:{request:{version:"uint64_version",deviceID:"str_device_id",startIndex:"uint64_start_index"},response:{msg_cmd_error_code:"errorInfo",str_err_msg:"errorMessage",uint32_code:"errorCode",msg_scene_ctl_config:"filterConfig",uint64_c2c_custom_msg_flag:"c2c_custom_message",uint64_c2c_text_msg_flag:"c2c_text_message",uint64_group_custom_msg_flag:"group_custom_message",uint64_group_text_msg_flag:"group_text_message",uint64_group_info_flag:"group_profile",uint64_group_member_info_flag:"group_member_profile",uint64_relation_chain_flag:"sns",uint64_user_info_flag:"user_profile",rpt_msg_dirty_word:"lexicon",str_dirty_word:"profanity",str_replaced_content:"replacement",uint64_filter_type:"filterType",uint64_id:"id",uint64_word_type:"profanityType",uint64_complete_flag:"completeFlag",uint64_next_start_index:"nextStartIndex",uint64_version:"version",uint64_expired_time:"expiredTime"}}}),this._configMap.set(le.SEND_C2C_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.SEND_C2C_MSG)}),body:{fromAccount:"",toAccount:"",msgSeq:0,msgRandom:0,msgBody:[],cloudCustomData:void 0,nick:"",avatar:"",msgLifeTime:void 0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,isSupportExtension:0,isRelayMessage:0,cmConfigID:void 0},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",count:"MaxCnt",lastMessageTime:"LastMsgTime",messageKey:"MsgKey",peerAccount:"Peer_Account",data:"Data",description:"Desc",extension:"Ext",type:"MsgType",content:"MsgContent",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",nick:"From_AccountNick",avatar:"From_AccountHeadurl",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"IsNeedReadReceipt"}}}),this._configMap.set(le.SEND_GRP_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.SEND_GRP_MSG)}),body:{fromAccount:"",groupID:"",random:0,clientSequence:0,priority:"",msgBody:[],cloudCustomData:void 0,onlineOnlyFlag:0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},groupAtInfo:[],messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,topicID:void 0,receiverList:void 0,isSupportExtension:0,isRelayMessage:0,cmConfigID:void 0},keyMap:{request:{to:"GroupId",extension:"Ext",data:"Data",description:"Desc",random:"Random",sequence:"ReqMsgSeq",count:"ReqMsgNumber",type:"MsgType",priority:"MsgPriority",content:"MsgContent",elements:"MsgBody",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",clientSequence:"ClientSeq",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"NeedReadReceipt",receiverList:"To_Account"},response:{MsgTime:"time",MsgSeq:"sequence"}}}),this._configMap.set(le.REVOKE_C2C_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.REVOKE_C2C_MSG)}),body:{msgInfo:{fromAccount:"",toAccount:"",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{request:{msgInfo:"MsgInfo",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom"}}}),this._configMap.set(le.REVOKE_GRP_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.REVOKE_GRP_MSG)}),body:{groupID:"",msgSeqList:void 0,topicID:""},keyMap:{request:{msgSeqList:"MsgSeqList",msgSeq:"MsgSeq"}}}),this._configMap.set(le.GET_C2C_ROAMING_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.GET_C2C_ROAMING_MSG)}),body:{peerAccount:"",count:15,lastMessageTime:0,messageKey:"",withRecalledMessage:1,direction:0},keyMap:{request:{messageKey:"MsgKey",peerAccount:"Peer_Account",count:"MaxCnt",lastMessageTime:"LastMsgTime",withRecalledMessage:"WithRecalledMsg",direction:"GetDirection"},response:{LastMsgTime:"lastMessageTime",IsNeedReadReceipt:"needReadReceipt",IsPeerRead:"readReceiptSentByPeer"}}}),this._configMap.set(le.MODIFY_C2C_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.MODIFY_C2C_MSG)}),body:{from:"",to:"",sequence:0,random:0,time:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}),this._configMap.set(le.GET_GRP_ROAMING_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_GRP_ROAMING_MSG)}),body:{withRecalledMsg:1,groupID:"",count:15,sequence:"",topicID:void 0},keyMap:{request:{sequence:"ReqMsgSeq",count:"ReqMsgNumber",withRecalledMessage:"WithRecalledMsg"},response:{Random:"random",MsgTime:"time",MsgSeq:"sequence",ReqMsgSeq:"sequence",RspMsgList:"messageList",IsSystemMsg:"isSystemMessage",ToGroupId:"to",EnumFrom_AccountType:"fromAccountType",EnumTo_AccountType:"toAccountType",GroupCode:"groupCode",MsgPriority:"priority",MsgBody:"elements",MsgType:"type",MsgContent:"content",IsFinished:"complete",Download_Flag:"downloadFlag",ClientSeq:"clientSequence",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",ToTopicId:"topicID",InvisibleMsgSeq:"invisibleSequenceList",NextReqMsgSeq:"nextSequence"}}}),this._configMap.set(le.SET_C2C_MSG_READ,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.SET_C2C_MSG_READ)}),body:{C2CMsgReaded:void 0},keyMap:{request:{lastMessageTime:"LastedMsgTime"}}}),this._configMap.set(le.SET_C2C_PEER_MUTE_NOTIFICATIONS,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.SET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{userIDList:void 0,muteFlag:0},keyMap:{request:{userIDList:"Peer_Account",muteFlag:"Mute_Notifications"}}}),this._configMap.set(le.GET_C2C_PEER_MUTE_NOTIFICATIONS,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.GET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{toAccount:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Peer_Account"},response:{MuteNotificationsList:"muteFlagList"}}}),this._configMap.set(le.SET_GRP_MSG_READ,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.SET_GRP_MSG_READ)}),body:{groupID:void 0,messageReadSeq:void 0,topicID:void 0},keyMap:{request:{messageReadSeq:"MsgReadedSeq"}}}),this._configMap.set(le.SET_ALL_MSG_READ,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.SET_ALL_MSG_READ)}),body:{readAllC2CMessage:0,groupMessageReadInfoList:[]},keyMap:{request:{readAllC2CMessage:"C2CReadAllMsg",groupMessageReadInfoList:"GroupReadInfo",messageSequence:"MsgSeq"},response:{C2CReadAllMsg:"readAllC2CMessage",GroupReadInfoArray:"groupMessageReadInfoList"}}}),this._configMap.set(le.DEL_C2C_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.DEL_C2C_MSG)}),body:{fromAccount:"",to:"",keyList:void 0},keyMap:{request:{keyList:"MsgKeyList"}}}),this._configMap.set(le.DEL_GRP_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.DEL_GRP_MSG)}),body:{groupID:"",deleter:"",keyList:void 0,topicID:void 0},keyMap:{request:{deleter:"Deleter_Account",keyList:"Seqs"}}}),this._configMap.set(le.TRANSLATE_TEXT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_TRANSLATE,".").concat(le.TRANSLATE_TEXT)}),body:{sourceTextList:void 0,SDKAppID:0,from:0,source:"",target:""},keyMap:{request:{sourceTextList:"SourceText",SDKAppID:"SdkAppId",from:"FromAccount"},response:{TargetText:"translatedTextList",RequestId:"requestID",CmdErrorCode:"error",ErrorCode:"code",ErrorInfo:"message"}}}),this._configMap.set(le.VOICE_TO_TEXT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_SPEECH,".").concat(le.VOICE_TO_TEXT)}),body:{url:"",SDKAppID:0,format:"",sourceType:0,language:""},keyMap:{request:{url:"BytesUrl",SDKAppID:"Uint32Sdkappid",format:"BytesVoiceFormat",sourceType:"Uint64SourceType",language:"BytesEngServiceType"},response:{BytesRequestid:"requestID",BytesResult:"result",CmdErrorCode:"error",ErrorCode:"code",ErrorInfo:"message"}}}),this._configMap.set(le.MODIFY_GRP_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.MODIFY_GRP_MSG)}),body:{groupID:"",topicID:void 0,sequence:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}),this._configMap.set(le.GET_READ_RECEIPT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequence:"MsgSeq"}}}),this._configMap.set(le.SEND_C2C_READ_RECEIPT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.SEND_C2C_READ_RECEIPT)}),body:{peerAccount:"",messageInfoList:void 0},keyMap:{request:{peerAccount:"Peer_Account",messageInfoList:"C2CMsgInfo",fromAccount:"From_Account",toAccount:"To_Account",sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",clientTime:"MsgClientTime"}}}),this._configMap.set(le.SEND_READ_RECEIPT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.SEND_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequenceList:"MsgSeqList",sequence:"MsgSeq"}}}),this._configMap.set(le.GET_READ_RECEIPT_DETAIL,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_READ_RECEIPT_DETAIL)}),body:{groupID:"",sequence:void 0,flag:0,cursor:0,count:0},keyMap:{request:{sequence:"MsgSeq",count:"Num"},response:{ReadList:"readUserIDList",Read_Account:"userID",UnreadList:"unreadUserIDList",Unread_Account:"userID",IsFinish:"isCompleted"}}}),this._configMap.set(le.MODIFY_C2C_MSG_EXT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.MODIFY_C2C_MSG_EXT)}),body:{from:void 0,to:void 0,messageKey:void 0,operateType:void 0,extensionList:void 0}}),this._configMap.set(le.GET_C2C_MSG_EXT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.GET_C2C_MSG_EXT)}),body:{from:void 0,to:void 0,messageKey:void 0,startSequence:void 0}}),this._configMap.set(le.MODIFY_GRP_MSG_EXT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.MODIFY_GRP_MSG_EXT)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,operateType:void 0,extensionList:void 0}}),this._configMap.set(le.GET_GRP_MSG_EXT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.GET_GRP_MSG_EXT)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,startSequence:void 0}}),this._configMap.set(le.MSG_CLOUD_SEARCH,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.MSG_SEARCH,".").concat(le.MSG_CLOUD_SEARCH)}),body:{keywordList:void 0,keywordListMatchType:"or",account:void 0,groupID:void 0,count:100,cursor:void 0,messageTypeList:void 0,senderUserIDList:void 0,startTime:void 0,endTime:void 0},keyMap:{request:{keywordListMatchType:"MatchType",account:"PeerAccount",groupID:"GroupID",messageTypeList:"MsgTypeList",senderUserIDList:"SendUserIDList"},response:{GroupID:"groupID",UserID:"userID",Count:"messageCount",LastMsgTime:"lastMessageTime",ConversationMsgs:"searchResult",IsNeedReadReceipt:"needReadReceipt",IsPeerRead:"readReceiptSentByPeer",MsgSeq:"sequence",ReqMsgSeq:"sequence",IsSystemMsg:"isSystemMessage",ToGroupId:"to",EnumFrom_AccountType:"fromAccountType",EnumTo_AccountType:"toAccountType",GroupCode:"groupCode",MsgContent:"content",ClientSeq:"clientSequence",ToTopicId:"topicID",InvisibleMsgSeq:"invisibleSequenceList",ErrorCode:"code",ErrorInfo:"message"}}}),this._configMap.set(le.ADD_C2C_MSG_REACTION,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.ADD_C2C_MSG_REACTION)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Add_Account"}}}),this._configMap.set(le.RM_C2C_MSG_REACTION,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.RM_C2C_MSG_REACTION)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Del_Account"}}}),this._configMap.set(le.GET_C2C_MSG_REACTIONS,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.GET_C2C_MSG_REACTIONS)}),body:{from:void 0,to:void 0,messageKeyList:void 0,count:void 0}}),this._configMap.set(le.GET_C2C_MSG_REACTION_USER_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.GET_C2C_MSG_REACTION_USER_LIST)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,count:void 0}}),this._configMap.set(le.ADD_GRP_MSG_REACTION,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.ADD_GRP_MSG_REACTION)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Add_Account"}}}),this._configMap.set(le.RM_GRP_MSG_REACTION,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.RM_GRP_MSG_REACTION)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Del_Account"}}}),this._configMap.set(le.GET_GRP_MSG_REACTIONS,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.GET_GRP_MSG_REACTIONS)}),body:{groupID:void 0,topicID:void 0,messageSequenceList:void 0,count:void 0},keyMap:{response:{MsgSeq:"messageSequence"}}}),this._configMap.set(le.GET_GRP_MSG_REACTION_USER_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM_MSG_EXT,".").concat(le.GET_GRP_MSG_REACTION_USER_LIST)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,nextSeq:void 0,count:void 0}}),this._configMap.set(le.GET_C2C_PEER_READ_TIME,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.GET_C2C_PEER_READ_TIME)}),body:{userIDList:void 0},keyMap:{request:{userIDList:"To_Account"},response:{ReadTime:"peerReadTimeList"}}}),this._configMap.set(le.PAGING_GET_CONV_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.PAGING_GET_CONV_LIST)}),body:{fromAccount:void 0,timeStamp:void 0,startIndex:void 0,pinnedTimeStamp:void 0,pinnedStartIndex:void 0,orderType:void 0,messageAssistFlag:15,assistFlag:31},keyMap:{request:{messageAssistFlag:"MsgAssistFlags",assistFlag:"AssistFlags",pinnedTimeStamp:"TopTimeStamp",pinnedStartIndex:"TopStartIndex"},response:{SessionItem:"conversations",ToAccount:"groupID",To_Account:"userID",UnreadMsgCount:"unreadCount",MsgGroupReadedSeq:"messageReadSeq",C2cPeerReadTime:"c2cPeerReadTime",LastMsgFlags:"lastMessageFlag",TopFlags:"isPinned",TopTimeStamp:"pinnedTimeStamp",TopStartIndex:"pinnedStartIndex",GroupId:"convGroupID",C2cRemark:"friendRemark",MsgRecvOption:"messageRemindType",GroupIgnoredUnreadSeqCount:"noUnreadCount",GroupNextMsgSeq:"nextMessageSeq"}}}),this._configMap.set(le.DEL_CONV,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.DEL_CONV)}),body:{fromAccount:"",conversationList:void 0,clearHistoryMessage:void 0},keyMap:{request:{toGroupID:"ToGroupid",clearHistoryMessage:"ClearRamble",conversationList:"ContactItem"},response:{ResultItem:"resultList",ToGroupid:"groupID",ResultCode:"code",ResultInfo:"info"}}}),this._configMap.set(le.CLEAR_HISTORY_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.CLEAR_HISTORY_MSG)}),body:{fromAccount:"",toAccount:void 0,type:1,toGroupID:void 0},keyMap:{request:{toGroupID:"ToGroupid"}}}),this._configMap.set(le.PIN_CONV,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.PIN_CONV)}),body:{fromAccount:"",operationType:1,itemList:void 0},keyMap:{request:{itemList:"RecentContactItem"}}}),this._configMap.set(le.DEL_GROUP_AT_TIPS,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.DEL_GROUP_AT_TIPS)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}),this._configMap.set(le.SET_CONV_CUSTOM_DATA,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.MARK_CONV)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}),this._configMap.set(le.MARK_CONV,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.MARK_CONV)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}),this._configMap.set(le.CREATE_CONV_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.CREATE_CONV_GRP)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"GroupContactItem",groupID:"ToGroupId"},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType"}}}),this._configMap.set(le.DEL_CONV_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.DEL_CONV_GRP)}),body:{fromAccount:"",groupName:void 0},keyMap:{request:{},response:{GroupId:"convGroupID"}}}),this._configMap.set(le.RENAME_CONV_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.RENAME_CONV_GRP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{oldName:"OldGroupName",newName:"NewGroupName",groupID:"ToGroupId",operationType:"ContactOptType",groupName:"OldGroupName",updateItem:"ContactUpdateItem"},response:{ContactOptType:"operationType",ToGroupId:"groupID",GroupId:"convGroupID"}}}),this._configMap.set(le.ADD_CONV_TO_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.RENAME_CONV_GRP)}),body:{fromAccount:"",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}},keyMap:{request:{},response:{}}}),this._configMap.set(le.DEL_CONV_FROM_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.RENAME_CONV_GRP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{},response:{}}}),this._configMap.set(le.GET_CONV_GRP_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.RECENT_CONTACT,".").concat(le.GET_CONV_GRP_LIST)}),body:{fromAccount:"",startTime:void 0,startIndex:void 0},keyMap:{request:{},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType",CustomMark:"customData",ContactGroupId:"convGroupIDList"}}}),this._configMap.set(le.GET_USER_PROFILE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.PROFILE,".").concat(le.GET_USER_PROFILE)}),body:{fromAccount:"",userItem:[]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}),this._configMap.set(le.UPDATE_MY_PROFILE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.PROFILE,".").concat(le.UPDATE_MY_PROFILE)}),body:{fromAccount:"",profileItem:[{tag:gt.NICK,value:""},{tag:gt.GENDER,value:""},{tag:gt.ALLOWTYPE,value:""},{tag:gt.AVATAR,value:""}]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}),this._configMap.set(le.GET_BL,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.GET_BL)}),body:{fromAccount:"",startIndex:0,maxLimited:30,lastSequence:0},keyMap:{response:{CurruentSequence:"currentSequence"}}}),this._configMap.set(le.ADD_TO_BL,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.ADD_TO_BL)}),body:{fromAccount:"",toAccount:[]}}),this._configMap.set(le.RM_FROM_BL,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.RM_FROM_BL)}),body:{fromAccount:"",toAccount:[]}}),this._configMap.set(le.SET_SELF_STATUS,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.SET_SELF_STATUS)}),body:{customStatus:""},keyMap:{}}),this._configMap.set(le.GET_USER_STATUS,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.GET_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{UserStatusList:"successUserList",ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID",Status:"statusType"}}}),this._configMap.set(le.SUB_USER_STATUS,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.SUB_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}),this._configMap.set(le.UNSUB_USER_STATUS,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.UNSUB_USER_STATUS)}),body:{userIDList:void 0,unsubscribeAll:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}),this._configMap.set(le.GET_FD_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.GET_FD_LIST)}),body:{fromAccount:"",startIndex:0,standardSequence:0,customSequence:0},keyMap:{response:{FriendNum:"friendCount",UserDataItem:"resultList",ValueItem:"tagValueList"}}}),this._configMap.set(le.ADD_FD,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.ADD_FD)}),body:{fromAccount:"",addFriendItem:[],type:""},keyMap:{request:{source:"AddSource",wording:"AddWording",type:"AddType"},response:{ResultItem:"resultList"}}}),this._configMap.set(le.UPDATE_FD,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.UPDATE_FD)}),body:{fromAccount:"",updateItem:void 0},keyMap:{request:{snsItem:"SnsItem"},response:{ResultItem:"resultList"}}}),this._configMap.set(le.DEL_FD,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.DEL_FD)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{request:{type:"DeleteType"},response:{ResultItem:"resultList"}}}),this._configMap.set(le.GET_FD_PROFILE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.GET_FD_PROFILE)}),body:{fromAccount:"",userIDList:void 0},keyMap:{response:{InfoItem:"resultList",SnsProfileItem:"tagValueList"}}}),this._configMap.set(le.CHECK_FD,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.CHECK_FD)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{request:{type:"CheckType"},response:{InfoItem:"resultList"}}}),this._configMap.set(le.GET_FD_APPLICATION_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.GET_FD_APPLICATION_LIST)}),body:{fromAccount:"",applicationType:"",startTime:0,maxLimited:0,lastSequence:0},keyMap:{response:{PendencyItem:"resultList",AddSource:"source",AddTime:"time",AddWording:"wording",Image:"avatar",UnreadPendencyCount:"unreadCount",To_Account:"userID",PendencyType:"type"}}}),this._configMap.set(le.RESPOND_FD_APPLICATION,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.RESPOND_FD_APPLICATION)}),body:{fromAccount:"",responseFriendItem:[]},keyMap:{request:{tag:"TagName",action:"ResponseAction"},response:{ResultItem:"resultList"}}}),this._configMap.set(le.DEL_FD_APPLICATION,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.DEL_FD_APPLICATION)}),body:{fromAccount:"",type:"",userIDList:void 0},keyMap:{request:{type:"PendencyType",userIDList:"To_Account"},response:{ResultItem:"resultList"}}}),this._configMap.set(le.REPORT_FD_APPLICATION,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.REPORT_FD_APPLICATION)}),body:{fromAccount:"",latestTimeStamp:""},keyMap:{request:{latestTimeStamp:"LatestPendencyTimeStamp"}}}),this._configMap.set(le.CREATE_FD_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.CREATE_FD_GRP)}),body:{fromAccount:"",groupName:void 0,userIDList:void 0},keyMap:{request:{groupName:"GroupName",userIDList:"To_Account"},response:{ResultItem:"resultList"}}}),this._configMap.set(le.DEL_FD_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.DEL_FD_GRP)}),body:{fromAccount:"",nameList:void 0},keyMap:{request:{nameList:"GroupName"}}}),this._configMap.set(le.GET_FD_GRP_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.GET_FD_GRP_LIST)}),body:{fromAccount:"",lastSequence:0,needFriend:"Need_Friend_Type_Yes"},keyMap:{response:{ResultItem:"resultList",GroupName:"name",FriendNumber:"friendCount",To_Account:"userIDList"}}}),this._configMap.set(le.UPDATE_FD_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FD,".").concat(le.UPDATE_FD_GRP)}),body:{fromAccount:"",oldName:"",newName:void 0,updateGroupItem:void 0},keyMap:{request:{oldName:"GroupOldName",newName:"GroupNewName"},response:{UpdateType:"type",ResultItem:"resultList"}}}),this._configMap.set(le.GET_GRP_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_GRP_LIST)}),body:{memberAccount:"",limit:void 0,offset:void 0,groupType:void 0,responseFilter:{groupBaseInfoFilter:void 0,selfInfoFilter:void 0},isSupportTopic:0},keyMap:{request:{memberAccount:"Member_Account"},response:{GroupIdList:"groups",NoUnreadSeqList:"excludedUnreadSequenceList",MsgSeq:"readedSequence",LastRecallTime:"_lastRevokedTime"}}}),this._configMap.set(le.GET_GRP_PROFILE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_GRP_PROFILE)}),body:{groupIDList:void 0,responseFilter:{groupBaseInfoFilter:void 0,groupCustomFieldFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0}},keyMap:{request:{groupIDList:"GroupIdList",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",groupCustomFieldFilter:"AppDefinedDataFilter_Group",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{GroupIdList:"groups",AppDefinedData:"groupCustomField",AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_Group:"groupCustomFieldFilter",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",InfoSeq:"infoSequence",MemberList:"members",GroupInfo:"groups",ShutUpUntil:"muteUntil",ShutUpAllMember:"muteAllMembers"}}}),this._configMap.set(le.CREATE_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.CREATE_GRP)}),body:{type:void 0,name:void 0,groupID:void 0,ownerID:void 0,introduction:void 0,notification:void 0,maxMemberNum:void 0,joinOption:void 0,memberList:void 0,groupCustomField:void 0,memberCustomField:void 0,webPushFlag:1,avatar:"",isSupportTopic:void 0,inviteOption:void 0},keyMap:{request:{ownerID:"Owner_Account",userID:"Member_Account",avatar:"FaceUrl",maxMemberNum:"MaxMemberCount",joinOption:"ApplyJoinOption",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",inviteOption:"InviteJoinOption"},response:{HugeGroupFlag:"avChatRoomFlag",OverJoinedGroupLimit_Account:"overLimitUserIDList"}}}),this._configMap.set(le.DISMISS_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.DISMISS_GRP)}),body:{groupID:void 0}}),this._configMap.set(le.UPDATE_GRP_PROFILE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.UPDATE_GRP_PROFILE)}),body:{groupID:void 0,name:void 0,introduction:void 0,notification:void 0,avatar:void 0,joinOption:void 0,groupCustomField:void 0,muteAllMembers:void 0,inviteOption:void 0},keyMap:{request:{groupCustomField:"AppDefinedData",muteAllMembers:"ShutUpAllMember",joinOption:"ApplyJoinOption",avatar:"FaceUrl",inviteOption:"InviteJoinOption"},response:{AppDefinedData:"groupCustomField",ShutUpAllMember:"muteAllMembers"}}}),this._configMap.set(le.APPLY_JOIN_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.APPLY_JOIN_GRP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1,historyMessageFlag:void 0},keyMap:{request:{applyMessage:"ApplyMsg",historyMessageFlag:"HugeGroupHistoryMsgFlag"},response:{HugeGroupFlag:"avChatRoomFlag",AVChatRoomKey:"avChatRoomKey",RspMsgList:"messageList",ToGroupId:"to"}}}),this._configMap.set(le.APPLY_JOIN_GRP_NOAUTH,(e.a2,e.tinyid,{head:u(u({},b(e,Og)),{},{servcmd:"".concat(re.NAME.BIG_GRP_NO_AUTH,".").concat(le.APPLY_JOIN_GRP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1},keyMap:{request:{applyMessage:"ApplyMsg"},response:{HugeGroupFlag:"avChatRoomFlag"}}})),this._configMap.set(le.QUIT_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.QUIT_GRP)}),body:{groupID:void 0}}),this._configMap.set(le.SEARCH_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.SEARCH_GRP)}),body:{groupIDList:void 0,responseFilter:{groupBasePublicInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","CreateTime","Owner_Account","LastInfoTime","LastMsgTime","NextMsgSeq","MemberNum","MaxMemberNum","ApplyJoinOption","InviteJoinOption"]}},keyMap:{response:{}}}),this._configMap.set(le.CHANGE_GRP_OWNER,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.CHANGE_GRP_OWNER)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{request:{newOwnerID:"NewOwner_Account"}}}),this._configMap.set(le.HANDLE_GRP_APPLICATION,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.HANDLE_GRP_APPLICATION)}),body:{groupID:void 0,applicant:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}),this._configMap.set(le.HANDLE_INVITE_JOIN_GRP,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.HANDLE_INVITE_JOIN_GRP)}),body:{groupID:void 0,applicant:void 0,invitee:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",invitee:"Invited_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg"}}}),this._configMap.set(le.HANDLE_GRP_INVITATION,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.HANDLE_GRP_INVITATION)}),body:{groupID:void 0,inviter:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{inviter:"Inviter_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}),this._configMap.set(le.GET_GRP_PENDENCY,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_GRP_PENDENCY)}),body:{startTime:void 0,limit:void 0,handleAccount:void 0},keyMap:{request:{handleAccount:"Handle_Account"},response:{To_Account:"userID",ApplyInviteMsg:"note"}}}),this._configMap.set(le.DEL_GRP_SYSTEM_NOTICE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.DEL_GRP_SYSTEM_NOTICE)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}),this._configMap.set(le.AV_POLLING,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.BIG_GRP_POLLING,".").concat(le.AV_POLLING)}),body:{USP:1,startSeq:1,startBroadcastSeq:void 0,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}),this._configMap.set(le.AV_NOAUTH_POLLING,(e.a2,e.tinyid,{head:u(u({},b(e,Rv)),{},{servcmd:"".concat(re.NAME.BIG_GRP_POLLING_NO_AUTH,".").concat(le.AV_POLLING)}),body:{USP:1,startSeq:1,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}})),this._configMap.set(le.GET_ONLINE_MBR_NUM,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_ONLINE_MBR_NUM)}),body:{groupID:void 0},keyMap:{response:{OnlineMemberNum:"memberCount"}}}),this._configMap.set(le.SET_GRP_ATTR,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.SET_GRP_ATTR)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}),this._configMap.set(le.MODIFY_GRP_ATTR,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.MODIFY_GRP_ATTR)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}),this._configMap.set(le.DEL_GRP_ATTR,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.DEL_GRP_ATTR)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key"}}}),this._configMap.set(le.CLEAR_GRP_ATTR,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.CLEAR_GRP_ATTR)}),body:{groupID:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]}}),this._configMap.set(le.GET_GRP_ATTR,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP_ATTR,".").concat(le.GET_GRP_ATTR)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{request:{avChatRoomKey:"Key",groupType:"GroupType"}}}),this._configMap.set(le.GET_GRP_NOTIFY,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_GRP_NOTIFY)}),body:{notifyReqList:[]},keyMap:{request:{notifyReqList:"NotifyReqList"},response:{NextMsgTime:"nextRevokedTime",NotifyMsgList:"notifyList",NotifyRspList:"notifyRspList"}}}),this._configMap.set(le.UPDATE_GRP_COUNTER,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.UPDATE_GRP_COUNTER)}),body:{groupID:void 0,counterList:void 0,avChatRoomKey:void 0,mode:void 0},keyMap:{request:{counterList:"GroupCounter"}}}),this._configMap.set(le.GET_GRP_COUNTER,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_GRP_COUNTER)}),body:{groupID:void 0,keyList:[],avChatRoomKey:void 0},keyMap:{request:{keyList:"GroupCounterKeys"}}}),this._configMap.set(le.CREATE_TOPIC,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP_COMMUNITY,".").concat(le.CREATE_TOPIC)}),body:{groupID:void 0,topicName:void 0,avatar:void 0,customData:void 0,topicID:void 0,notification:void 0,introduction:void 0},keyMap:{request:{avatar:"FaceUrl"}}}),this._configMap.set(le.DEL_TOPIC,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP_COMMUNITY,".").concat(le.DEL_TOPIC)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:"TopicIdList"},response:{DestroyResultItem:"resultList"}}}),this._configMap.set(le.UPDATE_TOPIC_PROFILE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP_COMMUNITY,".").concat(le.UPDATE_TOPIC_PROFILE)}),body:{groupID:void 0,topicID:void 0,avatar:void 0,customData:void 0,notification:void 0,introduction:void 0,muteAllMembers:void 0,topicName:void 0},keyMap:{request:{avatar:"FaceUrl",muteAllMembers:"ShutUpAllMember"}}}),this._configMap.set(le.GET_TOPIC_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP_COMMUNITY,".").concat(le.GET_TOPIC_LIST)}),body:{groupID:void 0,topicIDList:void 0,MemberInfoFilter:["NoUnreadSeqList"]},keyMap:{request:{topicIDList:"TopicIdList"},response:{TopicAndSelfInfo:"topicInfoList",TopicInfo:"topic",GroupID:"groupID",ShutUpTime:"muteTime",ShutUpAllFlag:"muteAllMembers",LastMsgTime:"lastMessageTime",MsgSeq:"readedSequence",LastMsgSeq:"sequence",NoUnreadSeqList:"excludedUnreadSequenceList"}}}),this._configMap.set(le.GET_GRP_MBR_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_GRP_MBR_LIST)}),body:{groupID:void 0,limit:0,offset:void 0,next:void 0,memberRoleFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",MemberList:"members",ShutUpUntil:"muteUntil"}}}),this._configMap.set(le.GET_AV_MBR_LIST,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP_AV,".").concat(le.GET_AV_MBR_LIST)}),body:{groupID:void 0,offset:void 0,filter:void 0},keyMap:{request:{offset:"Timestamp",filter:"Mark"},response:{NextTimestamp:"offset"}}}),this._configMap.set(le.GET_GRP_MBR_PROFILE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.GET_GRP_MBR_PROFILE)}),body:{groupID:void 0,userIDList:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{userIDList:"Member_List_Account",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{MemberList:"members",ShutUpUntil:"muteUntil",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",AppMemberDefinedData:"memberCustomField"}}}),this._configMap.set(le.ADD_GRP_MBR,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.ADD_GRP_MBR)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{request:{userID:"Member_Account",userIDList:"MemberList"},response:{MemberList:"members"}}}),this._configMap.set(le.DEL_GRP_MBR,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.DEL_GRP_MBR)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{request:{userIDList:"MemberToDel_Account"}}}),this._configMap.set(le.BAN_AV_MBR,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.BAN_AV_MBR)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:""},keyMap:{request:{userIDList:"Members_Account",duration:"Duration",reason:"Description"}}}),this._configMap.set(le.MODIFY_GRP_MBR_INFO,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP,".").concat(le.MODIFY_GRP_MBR_INFO)}),body:{groupID:void 0,topicID:void 0,userID:void 0,messageRemindType:void 0,nameCard:void 0,role:void 0,memberCustomField:void 0,muteTime:void 0},keyMap:{request:{userID:"Member_Account",memberCustomField:"AppMemberDefinedData",muteTime:"ShutUpTime",messageRemindType:"MsgFlag"}}}),this._configMap.set(le.MARK_AV_MBR_INFO,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.GRP_AV,".").concat(le.MARK_AV_MBR_INFO)}),body:{groupID:void 0,operationType:1,memberList:[]},keyMap:{request:{operationType:"CommandType",memberList:"MemberList",markType:"Marks",userID:"Member_Account"},response:{CommandType:"operationType",Marks:"markType",Member_Account:"userID"}}}),this._configMap.set(le.SSO_STAT,{head:u(u({},o),{},{servcmd:"".concat(re.NAME.IM_OPEN_STAT,".").concat(le.SSO_STAT)}),body:{header:{},event:[],quality:[]},keyMap:{request:{SDKType:"sdk_type",SDKVersion:"sdk_version",deviceType:"device_type",platform:"platform",instanceID:"instance_id",traceID:"trace_id",SDKAppID:"sdk_app_id",userID:"user_id",tinyID:"tiny_id",extension:"extension",timestamp:"timestamp",networkType:"network_type",eventType:"event_type",code:"error_code",message:"error_message",moreMessage:"more_message",duplicate:"duplicate",costTime:"cost_time",level:"level",qualityType:"quality_type",reportIndex:"report_index",wholePeriod:"whole_period",totalCount:"total_count",rttCount:"success_count_business",successRateOfRequest:"percent_business",countLessThan1Second:"success_count_business",percentOfCountLessThan1Second:"percent_business",countLessThan3Second:"success_count_platform",percentOfCountLessThan3Second:"percent_platform",successCountOfBusiness:"success_count_business",successRateOfBusiness:"percent_business",successCountOfPlatform:"success_count_platform",successRateOfPlatform:"percent_platform",successCountOfMessageReceived:"success_count_business",successRateOfMessageReceived:"percent_business",avgRTT:"average_value",avgDelay:"average_value",avgValue:"average_value",uiPlatform:"ui_platform"}}}),this._configMap.set(le.PING,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.HEARTBEAT,".").concat(le.PING)}),body:{}}),this._configMap.set(le.MSG_PUSH,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_PUSH,".").concat(le.MSG_PUSH)}),body:{},keyMap:{response:{C2cMsgArray:"C2CMessageArray",GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",C2cNotifyMsgArray:"C2CNotifyMessageArray",C2cMsgInfo:"C2CReadReceiptArray",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyAdd_Account:"userID",ProfileImNick:"nick",PendencyType:"applicationType",C2CReadAllMsg:"readAllC2CMessage",IsNeedReadReceipt:"needReadReceipt",Status:"statusType",CurrFollowType:"followType",Follow_Account:"userID"}}}),this._configMap.set(le.MULTI_MSG_PUSH,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_PUSH,".").concat(le.MULTI_MSG_PUSH)}),body:{},keyMap:{response:{GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyType:"applicationType"}}}),this._configMap.set(le.MSG_PUSH_ACK,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OPEN_IM,".").concat(le.MSG_PUSH_ACK)}),body:{sessionData:void 0},keyMap:{request:{sessionData:"SessionData"}}}),this._configMap.set(le.STATUS_FORCE_OFFLINE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.STATUS_FORCE_OFFLINE)}),body:{},keyMap:{response:{C2cNotifyMsgArray:"C2CNotifyMessageArray",NoticeSeq:"noticeSequence",KickoutMsgNotify:"kickoutMsgNotify",NewInstInfo:"newInstanceInfo"}}}),this._configMap.set(le.DOWNLOAD_MERGER_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_LONG_MSG,".").concat(le.DOWNLOAD_MERGER_MSG)}),body:{downloadKey:""},keyMap:{response:{Data:"data",Desc:"description",Ext:"extension",Download_Flag:"downloadFlag",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID"}}}),this._configMap.set(le.UPLOAD_MERGER_MSG,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_LONG_MSG,".").concat(le.UPLOAD_MERGER_MSG)}),body:{messageList:[]},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",type:"MsgType",content:"MsgContent",data:"Data",description:"Desc",extension:"Ext",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody"}}}),this._configMap.set(le.FOLLOW,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FOLLOW,".").concat(le.FOLLOW)}),body:{fromAccount:"",userIDList:[]},keyMap:{request:{userIDList:"FollowItem"},response:{ResultItem:"resultList",To_Account:"userID"}}}),this._configMap.set(le.UNFOLLOW,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FOLLOW,".").concat(le.UNFOLLOW)}),body:{fromAccount:"",userIDList:[]},keyMap:{request:{userIDList:"To_Account"},response:{ResultItem:"resultList",To_Account:"userID"}}}),this._configMap.set(le.GET_FOLLOW_INFO,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FOLLOW,".").concat(le.GET_FOLLOW_INFO)}),body:{fromAccount:"",userIDList:[]},keyMap:{request:{userIDList:"To_Account"},response:{FollowInfo:"followInfoList",To_Account:"userID",FollowerCount:"followersCount",FollowingCount:"followingCount",MutualFollowingCount:"mutualFollowersCount"}}}),this._configMap.set(le.GET_FOLLOW,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FOLLOW,".").concat(le.GET_FOLLOW)}),body:{fromAccount:"",type:1,startCursor:"",count:100},keyMap:{request:{type:"FollowType",count:"WantNum"},response:{FollowItem:"resultList",To_Account:"userID",ProfileItem:"profileList"}}}),this._configMap.set(le.CHECK_FOLLOW_TYPE,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.FOLLOW,".").concat(le.CHECK_FOLLOW_TYPE)}),body:{fromAccount:"",userIDList:[]},keyMap:{request:{userIDList:"To_Account"},response:{ResultItem:"resultList",To_Account:"userID"}}}),this._configMap.set(le.SET_TOKEN,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.SET_TOKEN)}),body:{tokenID:"",pushMsg:0,sdkAppID:0,businessID:"",deviceBrand:"",deviceToken:"",isTpns:0,isWebUniapp:0,notificationStatus:0,deviceModel:"",systemVersion:"",pushVersion:""},keyMap:{request:{tokenID:"TokenID",pushMsg:"PushMsg",sdkAppID:"EnterVersion",businessID:"BusiID",deviceBrand:"InstType",deviceToken:"VarToken",isTpns:"IsTpns",notificationStatus:"NotificationStatus",deviceModel:"DeviceModel",systemVersion:"SystemVersion",pushVersion:"PushPluginVersion"}}}),this._configMap.set(le.STAT_FOREGROUND,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.STAT_FOREGROUND)}),body:{isWebUniapp:0}}),this._configMap.set(le.STAT_BACKGROUND,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_OPEN_STATUS,".").concat(le.STAT_BACKGROUND)}),body:{C2CUnread:0,GroupUnread:0,isWebUniapp:0},keyMap:{request:{c2cUnreadCount:"C2cUnread",groupUnreadCount:"GrpUnread"}}}),this._configMap.set(le.PUSH_REPORT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.OFFLINE_PUSH_REPORT,".").concat(le.PUSH_REPORT)}),body:{eventList:[]},keyMap:{request:{eventList:"UinappPushEvents",type:"EventType",time:"EventTime",pushId:"ClickExt"}}}),this._configMap.set(le.SET_ALL_RECEIVE_MSG_OPT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_MSG_LOGIC,".").concat(le.SET_ALL_RECEIVE_MSG_OPT)}),body:{startTime:0,endTime:0,isRepeated:0,messageRemindType:0},keyMap:{request:{messageRemindType:"Level"}}}),this._configMap.set(le.GET_ALL_RECEIVE_MSG_OPT,{head:u(u({},e),{},{servcmd:"".concat(re.NAME.IM_MSG_LOGIC,".").concat(le.GET_ALL_RECEIVE_MSG_OPT)}),body:{toAccount:void 0}})}},{key:"has",value:function(e){return this._configMap.has(e)}},{key:"get",value:function(e){return this._configMap.get(e)}},{key:"update",value:function(){this._fillConfigMap()}},{key:"getKeyMap",value:function(e){return this.has(e)?this.get(e).keyMap||{}:(w.w("".concat(this._n,".getKeyMap unknown proto:").concat(e)),{})}},{key:"getProtocolData",value:function(o){var a=o.proto,n=o.data,o=this.get(a),a=null;if(n){var l,h=this._simpleDeepCopy(o),h=this._updateService(n,h),m=h.body,M=Object.create(null);for(l in m)if(Object.prototype.hasOwnProperty.call(m,l)){if(M[l]=m[l],n[l]===void 0)continue;M[l]=n[l]}h.body=M,a=this._getUplinkData(h)}else a=this._getUplinkData(o);return a}},{key:"_getUplinkData",value:function(n){var n=this._dataCleaner(n),o=zd(n.head),o=Cv(n.body,this._getRequestKeyMap(o));return n.body=o,n}},{key:"_updateService",value:function(e,n){var o,a,l=zd(n.head);return this._isFromGroupRequest(n)&&(o=e.type,a=e.groupID,e=(e=e.groupIDList)===void 0?[]:e,xe(a=a===void 0?void 0:a)&&(a=e[0]||""),Ii({type:o,groupID:a})&&(n.head.servcmd="".concat(re.NAME.GRP_COMMUNITY,".").concat(l))),n}},{key:"_isFromGroupRequest",value:function(e){return e.head.servcmd.includes(re.NAME.GRP)||e.head.servcmd.includes(re.NAME.GRP_ATTR)}},{key:"_getRequestKeyMap",value:function(e){return e=this.getKeyMap(e),u(u({},Or.request),e.request)}},{key:"_dataCleaner",value:function(e){var n,o=Array.isArray(e)?[]:Object.create(null);for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&Xs(n)&&e[n]!==null&&e[n]!==void 0&&(I(e[n])!=="object"?o[n]=e[n]:o[n]=this._dataCleaner.bind(this)(e[n]));return o}},{key:"_simpleDeepCopy",value:function(e){for(var n,o=Object.keys(e),a={},l=0,h=o.length;l<h;l++)n=o[l],At(e[n])?a[n]=Array.from(e[n]):oo(e[n])?a[n]=this._simpleDeepCopy(e[n]):a[n]=e[n];return a}}]),Du),VA=[le.MSG_PUSH_ACK],bg=(y(aa,[{key:"_c2cMessageArrayHandler",value:function(e){var n=this._sessionM.get(6);n&&(e.dataList.forEach(function(o){var a;o.isSyncMessage===1&&(a=o.from,o.from=o.to,o.to=a)}),e.needSync===1&&this._sessionM.get(19).startOnlineSync(),n.onNewC2CMessage({dataList:e.dataList,isInstantMessage:!0}))}},{key:"_c2cMessageModifiedHandler",value:function(e){var n=this._sessionM.get(6);n&&n.onC2CMessageModified(e)}},{key:"_groupMessageArrayHandler",value:function(e){var n=this._sessionM.get(7);n&&n.onNewGroupMessage({event:e.event,dataList:e.dataList,isInstantMessage:!0})}},{key:"_groupMessageModifiedHandler",value:function(e){var n=this._sessionM.get(7);n&&n.onGroupMessageModified(e)}},{key:"_groupTipsHandler",value:function(e){var n=this._sessionM.get(7);if(n){var o=e.event,a=e.dataList,l=e.isInstantMessage,h=l===void 0||l,m=e.isSyncingEnded;switch(o){case 4:case 6:n.onNewGroupTips({event:o,dataList:a});break;case 5:for(var M=0;M<a.length;M++)if(At(a[M].elements.revokedInfos))n.onGroupMessageRevoked({dataList:a});else if(At(a[M].elements.groupMessageReadNotice))n.onGroupMessageReadNotice({dataList:a});else{if(!At(a[M].elements.readReceiptList)){n.onNewGroupSystemNotice({dataList:a,isInstantMessage:h,isSyncingEnded:m});break}n.onReadReceiptList({dataList:a})}break;case 12:this._sessionM.get(11).onNewGroupAtTips({dataList:a});break;default:w.l("".concat(this._n,"._groupTipsHandler unknown event:").concat(o," dataList:"),a)}}}},{key:"_C2CNotifyMessageArrayHandler",value:function(e){var n,o=this,a=e.dataList;At(a)&&(n=this._sessionM.get(6),a.forEach(function(l){var h,m;Qt(l)&&(l.hasOwnProperty("kickoutMsgNotify")?(h=(m=l.kickoutMsgNotify).kickType,m=(m=m.newInstanceInfo)===void 0?{}:m,h===1?o._sessionM.onMultipleAccountKickedOut(m):h===2?o._sessionM.onMultipleDeviceKickedOut(m):h===3&&o._sessionM.onRestApiKickedOut(m)):l.hasOwnProperty("c2cMessageRevokedNotify")?n&&n.onC2CMessageRevoked({dataList:a}):l.hasOwnProperty("c2cMessageReadReceipt")?n&&n.onC2CMessageReadReceipt({dataList:a}):l.hasOwnProperty("c2cMessageReadNotice")?n&&n.onC2CMessageReadNotice({dataList:a}):l.hasOwnProperty("muteNotificationsSync")&&o._sessionM.get(11).onC2CMessageRemindTypeSynced({dataList:a}))}))}},{key:"_C2CReadReceiptArrayHandler",value:function(e){this._sessionM.get(6).onReadReceiptList(e)}},{key:"_profileHandler",value:function(e){this._sessionM.get(4).onProfileModified({dataList:e.dataList});var n=this._sessionM.get(8);n&&n.onFriendProfileModified({dataList:e.dataList})}},{key:"_relationChainHandler",value:function(e){this._sessionM.get(4).onRelationChainModified({dataList:e.dataList});var n=this._sessionM.get(8);n&&n.onRelationChainModified({dataList:e.dataList})}},{key:"_recentContactHandler",value:function(o){var n,o=o.dataList;!At(o)||(n=this._sessionM.get(11))&&o.forEach(function(a){var l,h,m=a.pushType;m===1?(l=a.recentContactDeleteItem,n.onConversationDeleted(l.recentContactList)):m===2?(l=a.recentContactTopItem,n.onConversationPinned(l.recentContactList)):m===3?(l=a.recentContactTopItem,n.onConversationUnpinned(l.recentContactList)):m===4?(l=a.recentContactMarkContact,n.onConversationMarkUpdated(l.recentContactMarkContactItem)):m===5?(l=a.recentContactCreateContactGroup,n.onConversationGroupCreated(l.msgContactGroupContactItem)):m===6?(l=a.recentContactDelContactGroup,n.onConversationGroupDeleted(l.msgGroupItem)):m===7&&(m=(l=a.recentContactUpdateContactGroup).updateType,a=l.msgUpdateGroup,l=l.msgUpdateContact,m===1?(h=a.updateGroupType)===1?n.onConversationGroupNameUpdated(a):h===2&&n.onConversationInGroupUpdated(a):m===2&&n.onConversationAddedToOrDeletedFromGroup(l))})}},{key:"_allMessageReadHandler",value:function(n){var n=n.dataList,o=this._sessionM.get(11);o&&o.onPushedAllMessageRead(n)}},{key:"_userStatusListHandler",value:function(e){this._sessionM.get(4).onUserStatusUpdated(e)}},{key:"_messageExtensionNotifyHandler",value:function(e){this._sessionM.get(3).onMessageExtensionNotify(e)}},{key:"_messageReactionNotifyListHandler",value:function(e){this._sessionM.get(34).onMessageReactionNotifyList(e)}},{key:"_messageReactionNotifyHandler",value:function(e){this._sessionM.get(34).onMessageReactionNotify(e)}},{key:"_followInfoHandler",value:function(e){this._sessionM.get(35).onFollowInfoNotify(e)}},{key:"onMessage",value:function(e){var n=this,o=e.body;if(this._filterMessageFromIMOpenPush(e)){var a,l=o.eventArray,h=o.isInstantMessage,m=o.isSyncingEnded,M=o.needSync;if(At(l))for(var L,F,$,ue=0,fe=l.length;ue<fe;ue++)($=(L=l[ue]).event)!==100?$!==24?(a=Object.keys(L).find(function(he){return n._keys.indexOf(he)!==-1}))?(F=$===14?{readAllC2CMessage:L[a],groupMessageReadInfoList:L.groupMessageReadNotice||[]}:$===16?{userID:L.userID,readReceiptList:L[a]}:L[a],this._eventHandlerMap.get(a)({event:$,dataList:F,isInstantMessage:h,isSyncingEnded:m,needSync:M})):w.l("".concat(this._n,".onMessage unknown eventItem:").concat(L)):this._onAllReceiveMessageOptNotify(L):this._onRoomCustomData(L.content)}}},{key:"_onRoomCustomData",value:function(e){this._sessionM.get(30).onRoomCustomDataReceived(e),w.l("".concat(this._n,"._onRoomCustomData data:").concat(e))}},{key:"_onAllReceiveMessageOptNotify",value:function(e){this._sessionM.get(11).onAllReceiveMessageOptNotify(e)}},{key:"_filterMessageFromIMOpenPush",value:function(n){var o=n.head,n=n.body,o=o.servcmd,a=!1;return!(a=xe(o)?a:o.includes(re.NAME.IM_CONFIG_MANAGER)||o.includes(re.NAME.OVERLOAD_PUSH)||o.includes(re.NAME.STAT_SERVICE))||(o.includes(le.PUSHED_CLOUD_CTRL_CONFIG)?this._sessionM.get(23).onPushedCloudControlConfig(n):o.includes(le.PUSHED_COMMERCIAL_CONFIG)?this._sessionM.get(27).onPushedConfig(n):o.includes(le.OVERLOAD_NOTIFY)?this._sessionM.onPushedServerOverload(n):o.includes(le.KICK_OTHER)&&(a=Date.now(),this._sessionM.reLoginOnKickOther(),n=new Be("kickOther"),a=a-(o=this._sessionM.get(1).getLastWsHelloTs()),n.setMessage("last wshello time:".concat(o," diff:").concat(a,"ms")).end()),!1)}}]),aa),Cu=[{cmd:le.GET_GRP_PROFILE,interval:1,count:8},{cmd:le.UPDATE_GRP_PROFILE,interval:1,count:8},{cmd:le.GET_AVCHATROOM_MBR_LIST,interval:3,count:1},{cmd:le.GET_GRP_PENDENCY,interval:1,count:15},{cmd:le.GET_TOPIC_LIST,interval:1,count:10},{cmd:le.SET_GRP_ATTR,interval:5,count:10},{cmd:le.MODIFY_GRP_ATTR,interval:5,count:10},{cmd:le.DEL_GRP_ATTR,interval:5,count:10},{cmd:le.CLEAR_GRP_ATTR,interval:5,count:10},{cmd:le.GET_GRP_ATTR,interval:5,count:20},{cmd:le.UPDATE_GRP_COUNTER,interval:5,count:20},{cmd:le.GET_GRP_COUNTER,interval:5,count:20},{cmd:le.SET_ALL_MSG_READ,interval:1,count:1},{cmd:le.GET_USER_STATUS,interval:5,count:20},{cmd:le.SUB_USER_STATUS,interval:5,count:20},{cmd:le.UNSUB_USER_STATUS,interval:5,count:20},{cmd:le.MSG_CLOUD_SEARCH,interval:1,count:2},{cmd:le.CHECK_FOLLOW_TYPE,interval:5,count:20}],Mu=new Map,Su=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],Rc=0,GA=Su.length;Rc<GA;Rc++)Mu.set(Rc,Su[Rc]);function aa(e){f(this,aa),this._sessionM=e,this._n="DownlinkHandler",this._eventHandlerMap=new Map,this._eventHandlerMap.set("C2CMessageArray",this._c2cMessageArrayHandler.bind(this)),this._eventHandlerMap.set("groupMessageArray",this._groupMessageArrayHandler.bind(this)),this._eventHandlerMap.set("groupTips",this._groupTipsHandler.bind(this)),this._eventHandlerMap.set("C2CNotifyMessageArray",this._C2CNotifyMessageArrayHandler.bind(this)),this._eventHandlerMap.set("C2CReadReceiptArray",this._C2CReadReceiptArrayHandler.bind(this)),this._eventHandlerMap.set("profileModify",this._profileHandler.bind(this)),this._eventHandlerMap.set("friendListMod",this._relationChainHandler.bind(this)),this._eventHandlerMap.set("recentContactMod",this._recentContactHandler.bind(this)),this._eventHandlerMap.set("readAllC2CMessage",this._allMessageReadHandler.bind(this)),this._eventHandlerMap.set("c2cMessageModified",this._c2cMessageModifiedHandler.bind(this)),this._eventHandlerMap.set("groupMessageModified",this._groupMessageModifiedHandler.bind(this)),this._eventHandlerMap.set("userStatusList",this._userStatusListHandler.bind(this)),this._eventHandlerMap.set("messageExtensionNotify",this._messageExtensionNotifyHandler.bind(this)),this._eventHandlerMap.set("messageReactionNotifyList",this._messageReactionNotifyListHandler.bind(this)),this._eventHandlerMap.set("messageReactionNotify",this._messageReactionNotifyHandler.bind(this)),this._eventHandlerMap.set("follow",this._followInfoHandler.bind(this)),this._keys=V(this._eventHandlerMap.keys())}function Du(e){f(this,Du),this._n="ProtocolHandler",this._sessionM=e,this._configMap=new Map,this._fillConfigMap()}function Lc(e){var n,o;return f(this,Lc),(e=Ng.call(this,e))._n="ChannelModule",e._socketHandler=new Rg(k(e)),e._probing=!1,e._isAppShowing=!0,e._previousState=C.NET_STATE_CONNECTED,Fe&&typeof Ne.onAppShow=="function"&&typeof Ne.onAppHide=="function"&&(n=e._onAppHide.bind(k(e)),o=e._onAppShow.bind(k(e)),typeof Ne.offAppHide=="function"&&Ne.offAppHide(n),typeof Ne.offAppShow=="function"&&Ne.offAppShow(o),Ne.onAppHide(n),Ne.onAppShow(o)),e._timerForNotLoggedIn=-1,e._timerForNotLoggedIn=setInterval(e.onCheckTimer.bind(k(e)),1e3),e._fatalErrorFlag=!1,e._disconnectedTS=0,e}function ar(e){f(this,ar),this._chM=e,this._n="SocketHandler",this._promiseMap=new Map,this._readyState=br,this._simpleRequestMap=new Map,this.MAX_SIZE=100,this._startSequence=Mi(),this._startTs=0,this._reConnectFlag=!1,this._nextPingTs=0,this._reConnectCount=0,this.MAX_RECONNECT_COUNT=3,this._socketID=-1,this._random=0,this._socket=null,this._url="",this._onOpenTs=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0,this._currentSite=me,this._setWebsocketHost(),this._initConnection()}function FA(e){f(this,FA);var n,o,a=(this._handler=e).getURL();this._socket=null,this._workerSocket=null,this._id=Mi(),this._handler.getIsWorkerEnabled()?(n=URL.createObjectURL(new Blob([';let _socket = null;onmessage = function(event) { if (event.data.cmd === "start") { const url = event.data.url; _socket = new WebSocket(url); _socket.binaryType = "arraybuffer"; _socket.onopen = function() { postMessage({ callback: "onOpen" }); }; _socket.onclose = function(e) { postMessage({ callback: "onOpen", e: { code: e.code, reason: e.reason } }); }; _socket.onmessage = function(e) { postMessage({ callback: "onMessage", data: e.data }); }; _socket.onerror = function(e) { postMessage({ callback: "onError", e: { isTrusted: "true" } }); }; } else if (event.data.cmd === "sendMessage") { if (_socket !== null) { _socket.send(event.data.data); } } else if (event.data.cmd === "stop") { if (_socket !== null) { _socket.close(event.data.code); _socket = null; } }};'],{type:"application/javascript; charset=utf-8"})),this._workerSocket=new Worker(n),(o=this)._workerSocket.onmessage=function(l){var m=l.data,h=m.callback,m=m.e;h==="onOpen"?o._onOpen():h==="onClose"?o._onClose(m):h==="onError"?o._onError(m):h==="onMessage"&&o._onMessage(l.data)},this._workerSocket.postMessage({cmd:"start",id:this._id,url:a})):Fe?Pe?(Ne.connectSocket({url:a,header:{"content-type":"application/json"}}),Ne.onSocketClose(this._onClose.bind(this)),Ne.onSocketOpen(this._onOpen.bind(this)),Ne.onSocketMessage(this._onMessage.bind(this)),Ne.onSocketError(this._onError.bind(this))):(this._socket=Ne.connectSocket({url:a,header:{"content-type":"application/json"},complete:function(){}}),this._socket.onClose(this._onClose.bind(this)),this._socket.onOpen(this._onOpen.bind(this)),this._socket.onMessage(this._onMessage.bind(this)),this._socket.onError(this._onError.bind(this))):lt&&(this._socket=new WebSocket(a),this._socket.binaryType="arraybuffer",this._socket.onopen=this._onOpen.bind(this),this._socket.onmessage=this._onMessage.bind(this),this._socket.onclose=this._onClose.bind(this),this._socket.onerror=this._onError.bind(this)),this._canIUseBinaryFrame=e.canIUseBinaryFrame()}function jA(e){for(var n,o,a=e,l="",h=0,m=(a=e.length%8!=0?"0".repeat(8-e.length%8)+e:a).length;h<m;h+=8)n=parseInt(a.slice(h,h+4),2),o=parseInt(a.slice(h+4,h+8),2),l+=Mu.get(n)+Mu.get(o);return l}function Lv(e){if(e<0||53<e)return NaN;var n=0|1073741824*Math.random();return 30<e?n+1073741824*(0|Math.random()*(1<<e-30)):n>>>30-e}function kg(e,n){for(var o=e.toString(16),a=n-o.length,l="0";0<a;a>>>=1,l+=l)1&a&&(o=l+o);return o}E(ca,Pn),Fg=B(ca),y(ca,[{key:"_init",value:function(){this._updateCommandFrequencyLimitMap(Cu)}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("cmd_frequency_limit");xe(e)||(e=JSON.parse(e),this._updateCommandFrequencyLimitMap(e))}},{key:"_updateCommandFrequencyLimitMap",value:function(e){var n=this;e.forEach(function(o){n._commandFrequencyLimitMap.set(o.cmd,{interval:o.interval,count:o.count})})}},{key:"updateProtocolConfig",value:function(){this._protocolHandler.update()}},{key:"req",value:function(a){w.d("".concat(this._n,".req options:"),a);var n=a.proto,o=a.tjgID;if(!this._protocolHandler.has(n))return w.w("".concat(this._n,".req unknown proto:").concat(n)),Ce({code:we.CANNOT_FIND_PROTOCOL});var a=this.getProtocolData(a),l=a.head.servcmd;if(this._isFrequencyOverLimit(l))return Ce({code:h=we.OVER_FREQUENCY_LIMIT,message:this.getErrorMessage(h,this._getCmd(l))});if(this._isServerOverload(l))return Ce({code:h=we.OPEN_SERVICE_OVERLOAD_ERROR,message:this.getErrorMessage(h,this._getCmd(l))});Je(o)||(a.head.tjgID=o);var h=this.get(21);return VA.includes(n)?h.simplySend(a):h.send(a)}},{key:"getKeyMap",value:function(e){return this._protocolHandler.getKeyMap(e)}},{key:"genCommonHead",value:function(){var e=this.get(12);return{ver:"v4",platform:this._platform,websdkappid:_e,websdkversion:ve,a2:e.getA2Key()||void 0,tinyid:e.getTinyID()||void 0,status_instid:e.getStatusInstanceID(),sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getA2Key()?void 0:e.getUserID(),usersig:e.getA2Key()?void 0:e.getUserSig(),sdkability:192371,sdkability_ext:jA(""),cappid:e.getApplicationID(),tjgID:""}}},{key:"genCosSpecifiedHead",value:function(){var e=this.get(12);return{ver:"v4",platform:this._platform,websdkappid:_e,websdkversion:ve,sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getUserID(),usersig:e.getUserSig(),status_instid:e.getStatusInstanceID(),sdkability:192371,sdkability_ext:jA(""),cappid:e.getApplicationID()}}},{key:"genSSOReportHead",value:function(){var e=this.get(12);return{ver:"v4",platform:this._platform,websdkappid:_e,websdkversion:ve,sdkappid:e.getSDKAppID(),contenttype:"",reqtime:0,identifier:"",usersig:"",status_instid:e.getStatusInstanceID(),sdkability:192371,sdkability_ext:jA(""),cappid:e.getApplicationID()}}},{key:"getProtocolData",value:function(e){return this._protocolHandler.getProtocolData(e)}},{key:"trans",value:function(n){var o=n.servcmd,n=n.data,o={head:u(u({},this.genCommonHead()),{},{servcmd:o}),body:n};return this.get(21).send(o)}},{key:"sendComboMessage",value:function(n){var o=n.servcmd,n=n.data,o={head:u(u({},this.genCommonHead()),{},{servcmd:o}),body:n};return this.get(21).send(o)}},{key:"onErrorCodeNotZero",value:function(e){var n,o=e.errorCode;o===we.HELLO_ANSWER_KICKED_OUT&&(n=e.kickType,e=(e=e.newInstanceInfo)===void 0?{}:e,n===1?this.onMultipleAccountKickedOut(e):n===2?this.onMultipleDeviceKickedOut(e):n===3&&this.onRestApiKickedOut(e)),o!==we.MSG_A2KEY_EXPIRED&&o!==we.ACCOUNT_A2KEY_EXPIRED||(this._onUserSigExpired(),this.get(21).reConnect())}},{key:"onMessage",value:function(e){var o=e.body,n=o.needAck,o=o.sessionData;(n===void 0?0:n)===1&&this._sendACK(o),this._messageDispatcher.onMessage(e)}},{key:"onReconnected",value:function(e){this._incrementalPullContactFlag=e<=300,this._reLoginOnReconnected()}},{key:"reLoginOnKickOther",value:function(){w.l("".concat(this._n,".reLoginOnKickOther")),this._reLogin()}},{key:"_reLoginOnReconnected",value:function(){w.l("".concat(this._n,"._reLoginOnReconnected")),this._reLogin()}},{key:"_reLogin",value:function(){var e,n,o,a=this,l="".concat(this._n,"._reLogin");this.isLoggedIn()&&(e=0,(n=this.get(1).getPushModule())&&(e=n.getUniAppPlatform()),o=new Be("reLogin"),this.req({proto:le.LOGIN,data:{isWebUniapp:e}}).then(function(m){var m=m.data,M=m.instanceID,m=m.customStatus,L=a.get(12),F=du(m),M=(L.setStatusInstanceID(M),"instanceID:".concat(M," customStatus:").concat(F)),M=(o.setMessage(M).end(!0),w.l("".concat(l," ok. ").concat(M)),L.getCustomStatus()!==F&&a.get(4).onUserStatusUpdated({dataList:[{to:a.getMyUserID(),statusType:C.USER_STATUS_ONLINE,customStatus:m}]}),a.get(21).diagnose(),a.get(11).syncConversationList(a._incrementalPullContactFlag).then(function(){w.l("".concat(l,", sync conversation list ok.")),a.get(25).start()}),a.get(7)),L=(M&&M.updateLocalMainSequenceOnReconnected(),a.get(10)),F=(L.resetGetTopicTime(),L.getTopicListOnReconnected(),a.get(35));F&&F.clearCacheOnReconnected()}))}},{key:"onMultipleAccountKickedOut",value:function(e){this.get(1).onMultipleAccountKickedOut(e)}},{key:"onMultipleDeviceKickedOut",value:function(e){this.get(1).onMultipleDeviceKickedOut(e)}},{key:"_onUserSigExpired",value:function(){this.get(1).onUserSigExpired()}},{key:"onRestApiKickedOut",value:function(e){this.get(1).onRestApiKickedOut(e)}},{key:"_sendACK",value:function(e){this.req({proto:le.MSG_PUSH_ACK,data:{sessionData:e}})}},{key:"_isFrequencyOverLimit",value:function(e){if(e=e.split(".")[1],!this._commandFrequencyLimitMap.has(e))return!1;if(!this._commandRequestInfoMap.has(e))return this._commandRequestInfoMap.set(e,{startTime:Date.now(),requestCount:1}),!1;var o=this._commandFrequencyLimitMap.get(e),n=o.count,o=o.interval,l=this._commandRequestInfoMap.get(e),a=l.startTime,l=l.requestCount;return Date.now()-a>1e3*o?(this._commandRequestInfoMap.set(e,{startTime:Date.now(),requestCount:1}),!1):(this._commandRequestInfoMap.set(e,{startTime:a,requestCount:l+=1}),n<l)}},{key:"_isServerOverload",value:function(e){if(!this._serverOverloadInfoMap.has(e))return!1;var o=this._serverOverloadInfoMap.get(e),n=o.overloadTime,o=o.waitingTime;return Date.now()-n<=1e3*o||(this._serverOverloadInfoMap.delete(e),!1)}},{key:"_getCmd",value:function(e){var n="";if(!e.includes("."))return n;var o,a=e.split(".")[1];for(o in le)if(le[o]===a){n=o;break}return n}},{key:"onPushedServerOverload",value:function(o){var n=o.overloadCommand,o=o.waitingTime;this._serverOverloadInfoMap.set(n,{overloadTime:Date.now(),waitingTime:o}),w.w("".concat(this._n,".onPushedServerOverload waitingTime:").concat(o,"s cmd:").concat(this._getCmd(n)))}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._updateCommandFrequencyLimitMap(Cu),this._commandRequestInfoMap.clear(),this._serverOverloadInfoMap.clear(),this._incrementalPullContactFlag=!0}}]);var Oc,wg,Pg,es,BA,Ug,xg,bc,Vg,Gg,Fg,kr=ca,Ov=(E(as,Pn),Gg=B(as),y(as,[{key:"getCloudConfig",value:function(e){return xe(e)?this._cloudConfig:this._cloudConfig.has(e)?this._cloudConfig.get(e):void 0}},{key:"getServerConfig",value:function(e){var n={code:0,data:""};return!xe(e)&&this._cloudConfig.has(e)&&(n.data=this._cloudConfig.get(e)),Promise.resolve(n)}},{key:"_canFetchConfig",value:function(){return this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime}},{key:"fetchConfig",value:function(){var e,n=this,o=this._canFetchConfig();w.l("".concat(this._n,".fetchConfig canFetchConfig:").concat(o)),o&&(e=new Be("fetchCloudControlConfig"),o=this.get(12).getSDKAppID(),this._isFetching=!0,this.req({proto:le.FETCH_CLOUD_CTRL_CONFIG,data:{SDKAppID:o,version:this._version}}).then(function(a){n._isFetching=!1,e.setMessage("version:".concat(n._version," newVersion:").concat(a.data.version," config:").concat(a.data.cloudControlConfig)).end(),w.l("".concat(n._n,".fetchConfig ok")),n._parseCloudControlConfig(a.data)}).catch(function(a){n._isFetching=!1,e.setError(a).end(),w.l("".concat(n._n,".fetchConfig failed. error:"),a),n._setExpiredTimeOnResponseError(12e4)}))}},{key:"onPushedCloudControlConfig",value:function(e){w.l("".concat(this._n,".onPushedCloudControlConfig")),new Be("pushedCloudControlConfig").setMessage("newVersion:".concat(e.version," config:").concat(e.cloudControlConfig)).end(),this._parseCloudControlConfig(e)}},{key:"onCheckTimer",value:function(e){this._canFetchConfig()&&this.fetchConfig()}},{key:"_parseCloudControlConfig",value:function(e){var n=this,o="".concat(this._n,"._parseCloudControlConfig"),a=e.errorCode,l=e.errorMessage,h=e.cloudControlConfig,m=e.version,M=e.expiredTime;if(a===0){if(this._version!==m){var L=null;try{L=JSON.parse(h)}catch{this.isPrivateNetWork()||w.e("".concat(o," JSON parse error. cloudControlConfig:"),h)}L&&(this._cloudConfig.clear(),Object.keys(L).forEach(function(F){n._cloudConfig.set(F,L[F])}),this._version=m,this.emitInnerEvent(Rn.CLOUD_CONFIG_UPDATED))}this._expiredTime=Date.now()+1e3*M}else xe(a)?(w.l("".concat(o," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(w.e("".concat(o," errorCode:").concat(a," errorMessage:").concat(l)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),as),bv=(E(sr,Pn),Vg=B(sr),y(sr,[{key:"start",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:"_recoverGroupChat",value:function(){var e,n,o,a,l=this,h=this._getLocalConversationList().filter(function(L){return L.type===C.CONV_GROUP&&L.groupProfile.type!==C.GRP_AVCHATROOM}),m=this.get(11),M=[];h.forEach(function($){var F=$.conversationID,$=$.lastMessage;e=F.replace(C.CONV_GROUP,""),n=m.getLocalLastMessage(F),$&&$.lastSequence!==0&&n?(o=$.lastSequence,n=n.sequence,a=o-n,0<n&&1<=a&&a<300?l._recoverGroupMessage({groupID:e,localLastMessageSequence:n,remoteLastMessageSequence:o}):M.push(e)):M.push(e)}),this._getGroupNotify(M)}},{key:"_recoverC2CChat",value:function(){var e,n,o,a=this,l=this._getLocalConversationList().filter(function(M){return M.type===C.CONV_C2C}),h=this.get(11),m=[Promise.resolve()];l.forEach(function(F){var L=F.conversationID,F=F.lastMessage;e=h.getLocalLastMessage(L),F&&F.lastTime!==0&&e&&(n=F.lastTime,e=e.time,o=n-e,0<e&&1<=o&&o<=600&&m.push(a._recoverC2CMessage({conversationID:L,localLastMessageTime:e,remoteLastMessageTime:n})))}),Promise.all(m).then(function(){w.l("".concat(a._n,"._recoverC2CChat all promise fulfilled, start to sync unread messages")),a.get(19).startSyncOnReconnected()})}},{key:"_getLocalConversationList",value:function(){return this.get(11).getLocalConversationList()}},{key:"_recoverGroupMessage",value:function(e){var n=this,o="".concat(this._n,"._recoverGroupMessage"),a=(w.l("".concat(o," options:"),e),e.groupID),l=e.localLastMessageSequence,h=e.remoteLastMessageSequence;this._getGroupRoamingMessage({groupID:a,sequence:l}).then(function(M){var M=M.data,L=M.complete,F=M.messageList;if(!xe(F)){var M=F[0].sequence,$=F.map(function(ze){return ze.sequence}),$="groupID:".concat(a," pkgLastSequence:").concat(M," remoteLastSequence:").concat(h," complete:").concat(L," sequenceList:").concat($),ue=(w.l("".concat(o," ").concat($)),M<h&&L!==2&&n._recoverGroupMessage({groupID:a,localLastMessageSequence:M,remoteLastMessageSequence:h}),new Be("recoverMessage").setMessage($).end(),n.get(7));1<F.length&&F.sort(function(ze,Ye){return ze.sequence-Ye.sequence});for(var fe=0;fe<F.length;fe++){var he=F[fe];he.from!==C.CONV_SYSTEM?ue.onNewGroupMessage({dataList:[he],isInstantMessage:!1,updateUnreadCount:!1}):ue.onNewGroupTips({event:he.event,dataList:[he]})}n._getGroupNotify([a])}})}},{key:"_genMultiGroupIDList",value:function(e,n){var o=n&&1<n?n:1,a=e.length,l=[];if(0<a)for(var h=0;h<a;h+=o)l.push(e.slice(h,h+o));return l}},{key:"_getGroupNotify",value:function(e){var n=this._genMultiGroupIDList(e,10);if(0<n.length)for(var o=this.get(7),a=0,l=n.length;a<l;a++)o.getGroupNotify(n[a])}},{key:"_getGroupRoamingMessage",value:function(o){var n=o.groupID,o=o.sequence;return this.req({proto:le.GET_GRP_ROAMING_MSG,data:{groupID:n,count:this.PULL_LIMIT_COUNT,sequence:o+this.PULL_LIMIT_COUNT-1}})}},{key:"_recoverC2CMessage",value:function(e){var n=this,o="".concat(this._n,"._recoverC2CMessage"),a=(w.l("".concat(o," options:"),e),e.conversationID),l=e.localLastMessageTime,h=e.remoteLastMessageTime;return this._getC2CRoamingMessage({conversationID:a,time:l}).then(function(L){var L=L.data,M=L.complete,L=L.messageList;if(!xe(L)){var F=L.length,F=(n.get(6).onNewC2CMessage({dataList:L,isInstantMessage:!0}),L[F-1].time),L=L.map(function(fe){return fe.random}),$=a.replace(C.CONV_C2C,""),$="peerAccount:".concat($," pkgLastTime:").concat(F," remoteLastTime:").concat(h," complete:").concat(M," randomList:").concat(L);if(w.l("".concat(o," ").concat($)),new Be("recoverMessage").setMessage($).end(),F<h&&M!==1)return n._recoverC2CMessage({conversationID:a,localLastMessageTime:F,remoteLastMessageTime:h})}})}},{key:"_getC2CRoamingMessage",value:function(o){var n=o.conversationID,o=o.time;return this.req({proto:le.GET_C2C_ROAMING_MSG,data:{peerAccount:n.replace(C.CONV_C2C,""),count:this.PULL_LIMIT_COUNT+1,lastMessageTime:o,direction:1}})}},{key:"reset",value:function(){w.l("".concat(this._n,".reset"))}}]),sr),jg=(y(Bc,[{key:"addMessageDelay",value:function(e){e=Se()-e,0<=e&&this._e2eDelayArray.push(e)}},{key:"_calcAvg",value:function(e,n){if(n===0)return 0;var o=0;return e.forEach(function(a){o+=a}),Zi(o/n,1)}},{key:"_calcCountWithLimit",value:function(e){var n=e.e2eDelayArray,o=e.min,a=e.max;return n.filter(function(l){return o<=l&&l<a}).length}},{key:"_calcPercent",value:function(e,n){return e=Zi(e/n*100,2),e=100<e?100:e}},{key:"_checkE2EDelayException",value:function(e,n){var o,a,l,h=e.filter(function(m){return n<m});0<h.length&&(o=h.length,a=Math.min.apply(Math,V(h)),l=Math.max.apply(Math,V(h)),h=this._calcAvg(h,o),50<(e=Zi(o/e.length*100,2))&&new Be("messageE2EDelayException").setMessage("count:".concat(o," min:").concat(a," max:").concat(l," avg:").concat(h," percent:").concat(e)).setLevel("warning").end())}},{key:"getStatResult",value:function(){var e=this._e2eDelayArray.length;if(e===0)return null;var n=V(this._e2eDelayArray),o=this._calcCountWithLimit({e2eDelayArray:n,min:0,max:1}),a=this._calcCountWithLimit({e2eDelayArray:n,min:1,max:3}),l=this._calcPercent(o,e),h=this._calcPercent(a,e),m=this._calcAvg(n,e);return this._checkE2EDelayException(n,3),n.length=0,this.reset(),{totalCount:e,countLessThan1Second:o,percentOfCountLessThan1Second:l,countLessThan3Second:a,percentOfCountLessThan3Second:h,avgDelay:m}}},{key:"reset",value:function(){this._e2eDelayArray.length=0}}]),Bc),kv=(y(oh,[{key:"addRequestCount",value:function(){this._requestCount+=1}},{key:"addRTT",value:function(e){this._rttArray.push(e)}},{key:"_calcTotalCount",value:function(){return this._requestCount}},{key:"_calcRTTCount",value:function(e){return e.length}},{key:"_calcSuccessRateOfRequest",value:function(e,n){return n===0?0:(e=Zi(e/n*100,2),e=100<e?100:e)}},{key:"_calcAvg",value:function(e,n){if(n===0)return 0;var o=0;return e.forEach(function(a){o+=a}),parseInt(o/n)}},{key:"_calcMax",value:function(){return Math.max.apply(Math,V(this._rttArray))}},{key:"_calcMin",value:function(){return Math.min.apply(Math,V(this._rttArray))}},{key:"getStatResult",value:function(){var e=this._calcTotalCount(),a=V(this._rttArray);if(e===0)return null;var n=this._calcRTTCount(a),o=this._calcSuccessRateOfRequest(n,e),a=this._calcAvg(a,n);return w.l("".concat(this._n,".getStatResult max:").concat(this._calcMax()," min:").concat(this._calcMin()," avg:").concat(a)),this.reset(),{totalCount:e,rttCount:n,successRateOfRequest:o,avgRTT:a}}},{key:"reset",value:function(){this._requestCount=0,this._rttArray.length=0}}]),oh),wv=(y(Lu,[{key:"initMap",value:function(e){var n=this;e.forEach(function(o){n._map.set(o,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})})}},{key:"addTotalCount",value:function(e){return!(xe(e)||!this._map.has(e)||(this._map.get(e).totalCount+=1,0))}},{key:"addSuccessCount",value:function(e){return!(xe(e)||!this._map.has(e)||(this._map.get(e).successCount+=1,0))}},{key:"addFailedCountOfUserSide",value:function(e){return!(xe(e)||!this._map.has(e)||(this._map.get(e).failedCountOfUserSide+=1,0))}},{key:"addCost",value:function(e,n){return!(xe(e)||!this._map.has(e)||(this._map.get(e).costArray.push(n),0))}},{key:"addFileSize",value:function(e,n){return!(xe(e)||!this._map.has(e)||(this._map.get(e).fileSizeArray.push(n),0))}},{key:"_calcSuccessRateOfBusiness",value:function(e){return xe(e)||!this._map.has(e)?-1:(e=this._map.get(e),e=Zi(e.successCount/e.totalCount*100,2),e=100<e?100:e)}},{key:"_calcSuccessRateOfPlatform",value:function(o){if(xe(o)||!this._map.has(o))return-1;var n=this._map.get(o),o=this._calcSuccessCountOfPlatform(o)/n.totalCount*100;return o=100<(o=Zi(o,2))?100:o}},{key:"_calcTotalCount",value:function(e){return xe(e)||!this._map.has(e)?-1:this._map.get(e).totalCount}},{key:"_calcSuccessCountOfBusiness",value:function(e){return xe(e)||!this._map.has(e)?-1:this._map.get(e).successCount}},{key:"_calcSuccessCountOfPlatform",value:function(e){return xe(e)||!this._map.has(e)?-1:(e=this._map.get(e),e.successCount+e.failedCountOfUserSide)}},{key:"_calcAvg",value:function(e){return xe(e)||!this._map.has(e)?-1:e===fi?this._calcAvgSpeed(e):this._calcAvgCost(e)}},{key:"_calcAvgCost",value:function(e){var n=this._map.get(e).costArray.length;if(n===0)return 0;var o=0;return this._map.get(e).costArray.forEach(function(a){o+=a}),parseInt(o/n)}},{key:"_calcAvgSpeed",value:function(e){var n=0,o=0;return this._map.get(e).costArray.forEach(function(a){n+=a}),this._map.get(e).fileSizeArray.forEach(function(a){o+=a}),parseInt(1e3*o/n)}},{key:"getStatResult",value:function(e){var n=this._calcTotalCount(e);if(n===0)return null;var o=this._calcSuccessCountOfBusiness(e),a=this._calcSuccessRateOfBusiness(e),l=this._calcSuccessCountOfPlatform(e),h=this._calcSuccessRateOfPlatform(e),m=this._calcAvg(e);return this.reset(e),{totalCount:n,successCountOfBusiness:o,successRateOfBusiness:a,successCountOfPlatform:l,successRateOfPlatform:h,avgValue:m}}},{key:"reset",value:function(e){xe(e)?this._map.clear():this._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}}]),Lu),Bg=(y(ih,[{key:"initMap",value:function(e){var n=this;e.forEach(function(o){n._lastMap.set(o,new Map),n._currentMap.set(o,new Map)})}},{key:"addMessageSequence",value:function(e){var n=e.key,l=e.message;if(xe(n)||!this._lastMap.has(n)||!this._currentMap.has(n))return!1;var o,a,h=l.conversationID,l=l.sequence,h=h.replace(C.CONV_GROUP,"");return this._lastMap.get(n).size!==0&&this._lastMap.get(n).has(h)?(a=(o=this._lastMap.get(n).get(h)).length-1,l>o[0]&&l<o[a]?(o.push(l),o.sort(),this._lastMap.get(n).set(h,o)):this._addCurrentMap(e)):this._addCurrentMap(e),!0}},{key:"_addCurrentMap",value:function(o){var n=o.key,o=o.message,a=o.conversationID,o=o.sequence,a=a.replace(C.CONV_GROUP,"");this._currentMap.get(n).has(a)||this._currentMap.get(n).set(a,[]),this._currentMap.get(n).get(a).push(o)}},{key:"_copyData",value:function(e){if(!xe(e)){this._lastMap.set(e,new Map);var n,o=this._lastMap.get(e),a=J(this._currentMap.get(e));try{for(a.s();!(n=a.n()).done;){var l=K(n.value,2),h=l[0],m=l[1];o.set(h,m)}}catch(M){a.e(M)}finally{a.f()}o=null,this._currentMap.set(e,new Map)}}},{key:"getStatResult",value:function(e){if(xe(this._currentMap.get(e))||xe(this._lastMap.get(e)))return null;if(this._lastMap.get(e).size===0)return this._copyData(e),null;var n=0,o=0;if(this._lastMap.get(e).forEach(function(M,h){var M=V(M.values()),m=M.length,M=M[m-1]-M[0]+1;n+=M,o+=m}),n===0)return null;var a=Zi(o/n*100,2);return 100<a&&(a=100),this._copyData(e),{totalCount:n,successCountOfMessageReceived:o,successRateOfMessageReceived:a}}},{key:"reset",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),ih),Pv=(E(sa,Pn),bc=B(sa),y(sa,[{key:"_onLoginSuccess",value:function(){var e=this,n=(this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems),this.get(13)),o=n.getItem(this.TAG,!1);!Je(o)&&Hn(o.forEach)&&(w.l("".concat(this._n,"._onLoginSuccess. logs count:").concat(o.length)),o.forEach(function(a){e._statInfoArr.push(a)}),n.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("q_rpt_interval"),n=this.getCloudConfig("q_rpt_sdkappid_bl"),o=this.getCloudConfig("q_rpt_tinyid_wl");xe(e)||(this.REPORT_INTERVAL=Number(e)),xe(n)||(this.REPORT_SDKAPPID_BLACKLIST=n.split(",").map(function(a){return Number(a)})),xe(o)||(this.REPORT_TINYID_WHITELIST=o.split(","))}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&e%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{key:"addRequestCount",value:function(){this._avgRTT.addRequestCount()}},{key:"addRTT",value:function(e){this._avgRTT.addRTT(e)}},{key:"addMessageDelay",value:function(e){this._avgE2EDelay.addMessageDelay(e)}},{key:"addTotalCount",value:function(e){this._rateMessageSent.addTotalCount(e)||w.w("".concat(this._n,".addTotalCount invalid key:"),e)}},{key:"addSuccessCount",value:function(e){this._rateMessageSent.addSuccessCount(e)||w.w("".concat(this._n,".addSuccessCount invalid key:"),e)}},{key:"addFailedCountOfUserSide",value:function(e){this._rateMessageSent.addFailedCountOfUserSide(e)||w.w("".concat(this._n,".addFailedCountOfUserSide invalid key:"),e)}},{key:"addCost",value:function(e,n){this._rateMessageSent.addCost(e,n)||w.w("".concat(this._n,".addCost invalid key or cost:"),e,n)}},{key:"addFileSize",value:function(e,n){this._rateMessageSent.addFileSize(e,n)||w.w("".concat(this._n,".addFileSize invalid key or size:"),e,n)}},{key:"addMessageSequence",value:function(e){this._rateMessageReceived.addMessageSequence(e)||w.w("".concat(this._n,".addMessageSequence invalid key:"),e.key)}},{key:"_getQualityItem",value:function(e){var n={},o=rg[this.get(15).getNetworkType()],o=(xe(o)&&(o=8),{qualityType:qa[e],timestamp:dt(),networkType:o,extension:""});switch(e){case rc:n=this._avgRTT.getStatResult();break;case ac:n=this._avgE2EDelay.getStatResult();break;case nr:case Po:case ir:case Dr:case fi:n=this._rateMessageSent.getStatResult(e);break;case Ba:case za:case sc:n=this._rateMessageReceived.getStatResult(e)}return n===null?null:u(u({},o),n)}},{key:"_report",value:function(h){var n=this,o=[],a=null,h=(xe(h)?this._qualityItems.forEach(function(m){(a=n._getQualityItem(m))!==null&&(a.reportIndex=n.reportIndex,a.wholePeriod=n.wholePeriod,o.push(a))}):(a=this._getQualityItem(h))!==null&&(a.reportIndex=this.reportIndex,a.wholePeriod=this.wholePeriod,o.push(a)),w.d("".concat(this._n,"._report"),o),0<this._statInfoArr.length&&(o=o.concat(this._statInfoArr),this._statInfoArr=[]),this.get(12)),l=h.getSDKAppID(),h=h.getTinyID();0<(o=Zl(this.REPORT_SDKAPPID_BLACKLIST,l)&&!$l(this.REPORT_TINYID_WHITELIST,h)?[]:o).length&&this._doReport(o)}},{key:"_doReport",value:function(e){var n=this,o={header:fg(this),quality:e};this.req({proto:le.SSO_STAT,data:u({},o)}).then(function(){n.reportIndex++,n.wholePeriod=!1}).catch(function(a){w.w("".concat(n._n,"._doReport failed. error:"),a),n._statInfoArr=n._statInfoArr.concat(e),n._flushAtOnce()})}},{key:"_flushAtOnce",value:function(){var e=this.get(13),n=e.getItem(this.TAG,!1),o=this._statInfoArr,a="".concat(this._n,"._flushAtOnce");Je(n)?(w.l("".concat(a," count:").concat(o.length)),e.setItem(this.TAG,o,!0,!1)):(10<(o=o.concat(n)).length&&(o=o.slice(0,10)),w.l("".concat(a," count:").concat(o.length)),e.setItem(this.TAG,o,!0,!1)),this._statInfoArr=[]}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}]),sa),zA=y(function e(n){f(this,e),Je(n)||(this.userID=n.userID||"",this.nick=n.nick||"",this.avatar=n.avatar||"",this.time=n.time||0,this.source=n.source||"",this.wording=n.wording||"",this.type=n.type||"")}),qA=(y(nh,[{key:"getLocalFriendApplicationList",value:function(){return{friendApplicationList:V(this._friendApplicationMap.values()),unreadCount:this._unreadCount}}},{key:"_onFriendApplicationListUpdated",value:function(){this._snsM.emitOuterEvent(R.FRIEND_APPLICATION_LIST_UPDATED,{friendApplicationList:V(this._friendApplicationMap.values()),unreadCount:this._unreadCount})}},{key:"onFriendApplicationRead",value:function(){this._unreadCount=0,this._onFriendApplicationListUpdated()}},{key:"onFriendApplicationAdded",value:function(e,n){var o,a,l=this;Je(e)||(o="",o=n===this._snsM.getMyUserID()?C.SNS_APPLICATION_SENT_BY_ME:C.SNS_APPLICATION_SENT_TO_ME,a=!1,e.forEach(function(h){var m="".concat(h.userID,"_").concat(o);o!==C.SNS_APPLICATION_SENT_TO_ME||l._friendApplicationMap.has(m)||(l._unreadCount+=1),l._friendApplicationMap.set(m,new zA(u(u({},h),{},{type:o}))),a=!0}),a&&this._onFriendApplicationListUpdated())}},{key:"onFriendApplicationDeleted",value:function(e){Je(e)||(this._startTime=0,this._currentSequence=0,this.getFriendApplicationList())}},{key:"getFriendApplicationList",value:function(){var e=this,n="".concat(this._n,".").concat("getFriendApplicationList"),o=new Be("getFriendApplicationList");return this._snsM.req({proto:le.GET_FD_APPLICATION_LIST,data:{applicationType:C.SNS_APPLICATION_TYPE_BOTH,fromAccount:this._snsM.getMyUserID(),maxLimited:this._maxLimited,startTime:this._startTime,lastSequence:this._currentSequence}}).then(function(M){var M=M.data,l=M.resultList,h=M.unreadCount,m=M.startTime,M=M.currentSequence,L=(e._startTime=m,e._currentSequence=M,e._unreadCount=h,At(l)?l.length:0),L="applicationCount:".concat(L," unreadCount:").concat(h," startTime:").concat(m," currentSequence:").concat(M);o.setMessage(L).end(),w.i("".concat(n," ok. ").concat(L)),e._friendApplicationMap.clear(),At(l)&&l.forEach(function(fe){var $=fe.userID,ue=fe.type,fe=new zA(fe);e._friendApplicationMap.set("".concat($,"_").concat(ue),fe)}),e._onFriendApplicationListUpdated()}).catch(function(a){return o.setError(a).end(),w.w("".concat(n," failed. error:"),a),Ce(a)})}},{key:"deleteFriendApplication",value:function(e){var n="".concat(this._n,".").concat("deleteFriendApplication"),o=e.userID,a=e.type;if(a&&(a===C.SNS_APPLICATION_SENT_BY_ME||a===C.SNS_APPLICATION_SENT_TO_ME)||(a=C.SNS_APPLICATION_SENT_TO_ME),!this._friendApplicationMap.has("".concat(o,"_").concat(a)))return Ce({code:we.FRIEND_APPLICATION_NOT_EXIST});var l=new Be("deleteFriendApplication");return l.setMessage("userID:".concat(o," type:").concat(a)),this._snsM.req({proto:le.DEL_FD_APPLICATION,data:{fromAccount:this._snsM.getMyUserID(),userIDList:[o],type:a}}).then(function(m){var m=m.data.resultList,F=m[0],M=F.to,L=F.resultCode,F=F.resultInfo;return l.setMoreMessage("resultList:".concat(JSON.stringify(m))).end(),w.i("".concat(n," ok. userID:").concat(o," type:").concat(a)),L===0?ft():Ce({userID:M,code:L,message:F})}).catch(function(h){return l.setError(h).end(),w.w("".concat(n," failed. error:"),h),Ce(h)})}},{key:"acceptFriendApplication",value:function(e){var n="".concat(this._n,".").concat("acceptFriendApplication"),o=e.userID,a=e.remark,l=e.tag,h=e.type,m=(h&&(h===C.SNS_APPLICATION_AGREE||h===C.SNS_APPLICATION_AGREE_AND_ADD)||(h=C.SNS_APPLICATION_AGREE_AND_ADD),new Be("acceptFriendApplication"));return m.setMessage("userID:".concat(o," type:").concat(h)),this._snsM.req({proto:le.RESPOND_FD_APPLICATION,data:{fromAccount:this._snsM.getMyUserID(),responseFriendItem:[{userID:o,remark:a,tag:l,action:h}]}}).then(function(F){m.end();var F=F.data.resultList[0],L=F.resultCode,F=F.resultInfo;if(L!==0)return Ce({code:L,message:F});w.i("".concat(n," ok. userID:").concat(o," type:").concat(h))}).catch(function(M){return m.setError(M).end(),w.w("".concat(n," failed. error:"),M),Ce(M)})}},{key:"refuseFriendApplication",value:function(e){var n="".concat(this._n,".").concat("refuseFriendApplication"),o=e.userID,a=new Be("refuseFriendApplication");return a.setMessage("userID:".concat(o)),this._snsM.req({proto:le.RESPOND_FD_APPLICATION,data:{fromAccount:this._snsM.getMyUserID(),responseFriendItem:[{userID:o,action:"Response_Action_Reject"}]}}).then(function(m){a.end();var m=m.data.resultList[0],h=m.resultCode,m=m.resultInfo;if(h!==0)return Ce({code:h,message:m});w.i("".concat(n," ok. userID:").concat(o))}).catch(function(l){return a.setError(l).end(),w.w("".concat(n," failed. error:"),l),Ce(l)})}},{key:"_onFriendApplicationProcessed",value:function(e){var n,o=this;e.length!==0&&(n=!1,e.forEach(function(a){a="".concat(a.to,"_").concat(C.SNS_APPLICATION_SENT_TO_ME),o._friendApplicationMap.has(a)&&(o._friendApplicationMap.delete(a),--o._unreadCount,n=!0)}),this._unreadCount<0&&(this._unreadCount=0),n&&this._onFriendApplicationListUpdated())}},{key:"setFriendApplicationRead",value:function(){var e=this,n="".concat(this._n,".").concat("setFriendApplicationRead"),o=new Be("setFriendApplicationRead");return this._snsM.req({proto:le.REPORT_FD_APPLICATION,data:{fromAccount:this._snsM.getMyUserID(),latestTimeStamp:Zi(dt()/1e3,0)}}).then(function(a){o.end(),w.i("".concat(n," ok")),e._unreadCount=0}).catch(function(a){return o.setError(a).end(),w.w("".concat(n," failed. error:"),a),Ce(a)})}},{key:"reset",value:function(){this._startIndex=0,this._maxLimited=100,this._currentSequence=0,this._unreadCount=0,this._friendApplicationMap.clear()}}]),nh),HA=(y(jc,[{key:"validate",value:function(e){var n,o=!0,a="";if(Je(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var l=e.profileCustomField.length,h=null,m=0;m<l;m++){if(h=e.profileCustomField[m],!wt(h.key)||h.key.indexOf("Tag_Profile_Custom")===-1)return{valid:!1,tips:"The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom"};if(!wt(h.value))return{valid:!1,tips:"The type of values of the custom profile key-value pairs (which is profileCustomField) must be String"}}for(n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(n==="profileCustomField")continue;if(Je(e[n])&&!wt(e[n])&&!qt(e[n])){a="key:"+n+", invalid value:"+e[n],o=!1;continue}switch(n){case"nick":wt(e[n])||(o=!(a="nick must be a string")),500<Tr(e[n])&&(a="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(Tr(e[n])," bytes"),o=!1);break;case"gender":er(An,e.gender)||(a="key:gender, invalid value:"+e.gender,o=!1);break;case"birthday":qt(e.birthday)||(o=!(a="birthday must be a number"));break;case"location":wt(e.location)||(o=!(a="location must be a string"));break;case"selfSignature":wt(e.selfSignature)||(o=!(a="selfSignature must be a string"));break;case"allowType":er(Ft,e.allowType)||(a="key:allowType, invalid value:"+e.allowType,o=!1);break;case"language":qt(e.language)||(o=!(a="language must be a number"));break;case"avatar":wt(e.avatar)||(o=!(a="avatar must be a string"));break;case"messageSettings":e.messageSettings!==0&&e.messageSettings!==1&&(o=!(a="messageSettings must be 0 or 1"));break;case"adminForbidType":er(Dt,e.adminForbidType)||(a="key:adminForbidType, invalid value:"+e.adminForbidType,o=!1);break;case"level":qt(e.level)||(o=!(a="level must be a number"));break;case"role":qt(e.role)||(o=!(a="role must be a number"));break;default:a="unknown key:"+n+" "+e[n],o=!1}}return{valid:o,tips:a}}},{key:"update",value:function(e){var n,o="",a=[];this.friendCustomField.forEach(function(M){a.push(M.key)});for(var l=0,h=e.length;l<h;l++)if(o=e[l].tag,n=e[l].value,-1<o.indexOf("Tag_SNS_Custom"))-1<a.indexOf(o)?this.friendCustomField.forEach(function(M){M.key===o&&(M.value=n)}):this.friendCustomField.push({key:o,value:n});else if(-1<o.indexOf("Tag_Profile_Custom")){var m=!1;this.profile.profileCustomField.forEach(function(M){M.key===o&&(M.value=n,m=!0)}),m||this.profile.profileCustomField.push({key:o,value:n})}else switch(o){case gt.NICK:this.profile.nick=n;break;case gt.GENDER:this.profile.gender=n;break;case gt.BIRTHDAY:this.profile.birthday=n;break;case gt.LOCATION:this.profile.location=n;break;case gt.SELFSIGNATURE:this.profile.selfSignature=n;break;case gt.ALLOWTYPE:this.profile.allowType=n;break;case gt.LANGUAGE:this.profile.language=n;break;case gt.AVATAR:this.profile.avatar=n;break;case gt.MESSAGESETTINGS:this.profile.messageSettings=n;break;case gt.ADMINFORBIDTYPE:this.profile.adminForbidType=n;break;case gt.LEVEL:this.profile.level=n;break;case gt.ROLE:this.profile.role=n;break;case kt.REMARK:this.remark=n;break;case kt.ADDTIME:this.addTime=n;break;case kt.GROUP:this.groupList=JSON.parse(JSON.stringify(n));break;case kt.ADDSOURCE:this.source=n;break;case kt.ADDWORDING:break;default:w.d("snsProfileItem unkown tag->",e[l].tag)}this.timestamp=Date.now(),a.length=0}},{key:"updateProfile",value:function(e){this.profile=JSON.parse(JSON.stringify(e)),this.timestamp=Date.now()}},{key:"addToGroupList",value:function(e){this.groupList.indexOf(e)===-1&&(this.groupList.push(e),this.count=this.groupList.length)}},{key:"removeFromGroupList",value:function(e){e=this.groupList.indexOf(e),-1<e&&(this.groupList.splice(e,1),this.count=this.groupList.length)}}]),jc),Uv=(y(Fc,[{key:"getLocalFriendList",value:function(){return V(this._friendMap.values())}},{key:"getFriendRemark",value:function(e){return this._friendMap.has(e)?this._friendMap.get(e).remark:""}},{key:"onFriendProfileModified",value:function(a){var n,o=this,a=a.dataList;Je(a)||(n=this._snsM.get(11),a.forEach(function(M){var h,m=M.userID,M=M.profileList;o.isMyFriend(m)&&(w.l("".concat(o._n,".onFriendProfileModified. friend account:").concat(m,", profileList:").concat(JSON.stringify(M))),(h=o._friendMap.get(m)).update(M),n.modifyMessageSentByPeer({conversationID:"".concat(C.CONV_C2C).concat(m),latestNick:h.profile.nick,latestAvatar:h.profile.avatar}))}),this._onFriendListUpdated())}},{key:"onFriendAdded",value:function(e){var n=this;e.length!==0&&(w.l("".concat(this._n,".onFriendAdded userIDList:").concat(e)),e.forEach(function(o){n._friendMap.set(o,new HA(o))}),this.getFriendProfile({userIDList:e}).then(function(o){e.forEach(function(a){var l=n._friendMap.get(a);0<l.groupList.length&&n._snsM.updateWhenFriendAdded({nameList:l.groupList,userID:a})}),n._onFriendListUpdated()}))}},{key:"onFriendDeleted",value:function(e){var n=this;e.length!==0&&(w.l("".concat(this._n,".onFriendDeleted userIDList:").concat(e)),e.forEach(function(o){var a=n._friendMap.get(o);0<a.groupList.length&&n._snsM.updateWhenFriendDeleted({nameList:a.groupList,userID:o}),n._friendMap.delete(o)}),this._onFriendListUpdated())}},{key:"_onFriendListUpdated",value:function(){this._snsM.emitOuterEvent(R.FRIEND_LIST_UPDATED),this._snsM.get(11).checkAndPatchRemark()}},{key:"getFriendProfile",value:function(a){var n=this,o="".concat(this._n,".").concat("getFriendProfile"),a=a.userIDList,l=[],h=[],m=[];if(a.forEach(function(L){var F;n._friendMap.has(L)?(F=n._friendMap.get(L),Date.now()-F.timestamp<n._expirationTime?h.push(F):m.push(L)):l.push({userID:L,code:we.NOT_MY_FRIEND,message:n._snsM.getErrorMessage(we.NOT_MY_FRIEND)})}),m.length===0)return w.i("".concat(o," newUserIDList is empty")),St({friendList:h,failureUserIDList:l});var M=new Be("getFriendProfile");return M.setMessage("userIDList:".concat(m)),w.i("".concat(o," userIDList:").concat(m)),this._snsM.req({proto:le.GET_FD_PROFILE,data:{fromAccount:this._snsM.getMyUserID(),userIDList:m}}).then(function(L){return M.end(),w.i("".concat(o," ok")),L.data.resultList.forEach(function(be){var $,ue=be.to,fe=be.resultCode,he=be.resultInfo,be=be.tagValueList;xe(fe)||fe===0?(n._friendMap.has(ue)?($=n._friendMap.get(ue)).update(be):($=new HA(ue,be),n._friendMap.set(ue,$)),h.push($)):l.push({userID:ue,code:fe,message:he})}),ft({friendList:h,failureUserIDList:l})}).catch(function(L){return M.setError(L).end(),w.w("".concat(o," failed. error:"),L),Ce(L)})}},{key:"isMyFriend",value:function(e){return this._friendMap.has(e)}},{key:"pagingGetFriendList",value:function(){var e=this,n="".concat(this._n,".").concat("getFriendList"),o=new Be("getFriendList"),a=Date.now();this._snsM.req({proto:le.GET_FD_LIST,data:{fromAccount:this._snsM.getMyUserID(),startIndex:this._startIndex,standardSequence:this._standardSequence,customSequence:this._customSequence}}).then(function(F){var F=F.data,$=F.friendCount,h=F.resultList,m=F.nextStartIndex,M=F.standardSequence,L=F.customSequence,F=F.completeFlag,$=(e._startIndex=m,e._standardSequence=M,e._customSequence=L,"friendCount:".concat($," nextStartIndex:").concat(m," standardSequence:").concat(M," ")+"customSequence:".concat(L," completeFlag:").concat(F," cost:").concat(Zn(a)));o.setMessage($).end(),w.i("".concat(n," ok."),$),Je(h)||h.forEach(function(he){var fe=he.to,he=he.tagValueList;e._friendMap.set(fe,new HA(fe,he))}),F===0?e.pagingGetFriendList():(e._snsM.emitOuterEvent(R.FRIEND_LIST_UPDATED),e._pagingGetFriendProfile())}).catch(function(l){return o.setError(l).end(),w.w("".concat(n," failed. error:"),l),Ce(l)})}},{key:"_pagingGetFriendProfile",value:function(){var e=this,n=V(this._friendMap.keys()),o=this._snsM.get(4),a=n.length,l=a<=100?1:Math.ceil(a/100);w.l("".concat(this._n,"._pagingGetFriendProfile friendCount:").concat(a," pageCount:").concat(l));for(var h=0;h<l;h++)o.getUserProfile({userIDList:n.slice(100*h,100*(h+1))}).then(function(m){m.data.forEach(function(M){var L=e._friendMap.get(M.userID);L&&L.updateProfile(M)}),e._onFriendListUpdated()})}},{key:"addFriend",value:function(L){var n=this,o="".concat(this._n,".").concat("addFriend");if(this._friendMap.has(L.to))return Ce({code:we.ALREADY_MY_FRIEND});if(L.wording&&this._snsM.filterProfanity("wording",L)===!1)return Ce({code:we.PROFANITY_FOUND});var a=L.to,l=L.source,h=L.type,m=L.wording,M=L.remark,L=L.groupName,F=h,$=(F&&(F===C.SNS_ADD_TYPE_SINGLE||F===C.SNS_ADD_TYPE_BOTH)||(F=C.SNS_ADD_TYPE_BOTH),new Be("addFriend"));return $.setMessage("to:".concat(a," source:").concat(l," type:").concat(F)),this._snsM.req({proto:le.ADD_FD,data:{fromAccount:this._snsM.getMyUserID(),addFriendItem:[{to:a,source:l,wording:m,remark:M,groupName:L}],type:F}}).then(function(be){var be=be.data.resultList,be=($.setMoreMessage("resultList:".concat(JSON.stringify(be))).end(),be[0]),fe=be.to,he=be.resultCode,be=be.resultInfo;return w.i("".concat(o," ok. to:").concat(fe," type:").concat(F," code:").concat(he)),xe(he)||he===0?ft({userID:fe,code:0}):he===30539?ft({userID:fe,code:he,message:n._snsM.getErrorMessage(he)}):Ce({userID:fe,code:he,message:n._snsM.getErrorMessage(he)||be})}).catch(function(ue){return $.setError(ue).end(),w.w("".concat(o," failed. error:"),ue),Ce(ue)})}},{key:"deleteFriend",value:function(a){var n=this,o="".concat(this._n,".").concat("deleteFriend"),M=a.userIDList,a=a.type,l=(1e3<M.length&&(w.w("".concat(o," ").concat(Zr(1e3))),M.length=1e3),[]),h=[],m=[];if(M.forEach(function(F){n._friendMap.has(F)?m.push(F):l.push({userID:F,code:we.NOT_MY_FRIEND,message:n._snsM.getErrorMessage(we.NOT_MY_FRIEND)})}),m.length===0)return St({successUserIDList:h,failureUserIDList:l});var M=a,L=(M&&(M===C.SNS_DELETE_TYPE_SINGLE||M===C.SNS_DELETE_TYPE_BOTH)||(M=C.SNS_DELETE_TYPE_BOTH),new Be("deleteFriend"));return L.setMessage("userIDList:".concat(m," type:").concat(M)),this._snsM.req({proto:le.DEL_FD,data:{fromAccount:this._snsM.getMyUserID(),userIDList:m,type:M}}).then(function(F){return L.end(),w.i("".concat(o," ok")),F=F.data.resultList,Je(F)||F.forEach(function(he){var ue=he.to,fe=he.resultCode,he=he.resultInfo;xe(fe)||fe===0?h.push({userID:ue}):l.push({userID:ue,code:fe,message:he})}),ft({successUserIDList:h,failureUserIDList:l})}).catch(function(F){return L.setError(F).end(),w.w("".concat(o," error:"),F),Ce(F)})}},{key:"updateFriend",value:function(e){var n=this,o=e.userID,a=e.remark,l=e.friendCustomField;if(!this._friendMap.has(o))return Ce({code:we.NOT_MY_FRIEND});var h="".concat(this._n,".").concat("updateFriend"),m=new Be("updateFriend"),M=(m.setMessage("userID:".concat(o," remark:").concat(a," friendCustomField:").concat(l)),[]);return xe(a)||M.push({tag:kt.REMARK,value:a}),At(l)&&0<l.length&&l.forEach(function(L){M.push({tag:L.key,value:L.value})}),this._snsM.req({proto:le.UPDATE_FD,data:{fromAccount:this._snsM.getMyUserID(),updateItem:[{to:o,snsItem:M}]}}).then(function(ue){m.end(),w.i("".concat(h," ok"));var ue=ue.data.resultList[0],F=ue.to,$=ue.resultCode,ue=ue.resultInfo;return xe($)||$===0?((F=n._friendMap.get(F))&&(xe(a)||(F.remark=a),At(l)&&0<l.length&&xa(F.friendCustomField,l),n._onFriendListUpdated()),ft(F)):Ce({code:$,message:ue})}).catch(function(L){return m.setError(L).end(),w.w("".concat(h," failed. error:"),L),Ce(L)})}},{key:"checkFriend",value:function(e){var n="".concat(this._n,".").concat("checkFriend"),o=e.userIDList,a=e.type,l=(a&&(a===C.SNS_CHECK_TYPE_SINGLE||a===C.SNS_CHECK_TYPE_BOTH)||(a=C.SNS_CHECK_TYPE_BOTH),new Be("checkFriend"));return l.setMessage("userIDList:".concat(o," type:").concat(a)),this._snsM.req({proto:le.CHECK_FD,data:{fromAccount:this._snsM.getMyUserID(),userIDList:o,type:a}}).then(function(L){l.end(),w.i("".concat(n," ok. userIDList:").concat(o," type:").concat(a));var m=[],M=[],L=L.data.resultList;return At(L)&&L.forEach(function(he){var $=he.to,ue=he.relation,fe=he.resultCode,he=he.resultInfo;xe(fe)||fe===0?m.push({userID:$,code:0,relation:ue}):M.push({userID:$,code:fe,message:he})}),ft({successUserIDList:m,failureUserIDList:M})}).catch(function(h){return l.setError(h).end(),w.w("".concat(n," failed. error:"),h),Ce(h)})}},{key:"updateWhenAddedToFriendGroup",value:function(a){var n=this,o=a.name,a=a.userIDList;w.l("".concat(this._n,".updateWhenAddedToFriendGroup groupName:").concat(o," userIDList:").concat(a)),o&&!Je(a)&&a.forEach(function(l){n._friendMap.has(l)&&n._friendMap.get(l).addToGroupList(o)})}},{key:"updateWhenRemovedFromFriendGroup",value:function(a){var n=this,o=a.name,a=a.userIDList;w.l("".concat(this._n,".updateWhenRemovedFromFriendGroup groupName:").concat(o," userIDList:").concat(a)),o&&!Je(a)&&a.forEach(function(l){n._friendMap.has(l)&&n._friendMap.get(l).removeFromGroupList(o)})}},{key:"reset",value:function(){this._friendMap.clear(),this._startIndex=0,this._standardSequence=0,this._customSequence=0}}]),Fc),ts=(y(th,[{key:"addToUserIDList",value:function(e){this.userIDList.indexOf(e)===-1&&(this.userIDList.push(e),this.count=this.userIDList.length)}},{key:"removeFromUserIDList",value:function(e){e=this.userIDList.indexOf(e),-1<e&&(this.userIDList.splice(e,1),this.count=this.userIDList.length)}}]),th),zg=(y(eh,[{key:"getLocalFriendGroupList",value:function(){return V(this._friendGroupMap.values())}},{key:"_emitFriendGroupListUpdated",value:function(){var e=V(this._friendGroupMap.values());this._snsM.emitOuterEvent(R.FRIEND_GROUP_LIST_UPDATED,e)}},{key:"getFriendGroupList",value:function(){var e=this,n="".concat(this._n,".").concat("getFriendGroupList"),o=new Be("getFriendGroupList");return this._snsM.req({proto:le.GET_FD_GRP_LIST,data:{fromAccount:this._snsM.getMyUserID()}}).then(function(a){o.end(),a=a.data.resultList,Je(a)?w.i("".concat(n," ok. friend group count:0")):(w.i("".concat(n," ok. friend group count:").concat(a.length)),e._friendGroupMap.clear(),a.forEach(function(l){var h=new ts(l);e._friendGroupMap.set(l.name,h)}),e._emitFriendGroupListUpdated())}).catch(function(a){return o.setError(a).end(),w.w("".concat(n," error:"),a),Ce(a)})}},{key:"createFriendGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("createFriendGroup"),a=e.name,l=e.userIDList;if(this._friendGroupMap.has(a))return Ce({code:we.FRIEND_GRP_EXISTED});var h=new Be("createFriendGroup");return h.setMessage("name:".concat(a," userIDList:").concat(l)),this._snsM.req({proto:le.CREATE_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),groupName:[a],userIDList:At(l)?l:void 0}}).then(function(F){h.end(),w.l("".concat(o," ok. name:").concat(a," userIDList:").concat(l));var F=F.data.resultList,M=[],L=[],F=(F&&F.forEach(function($){var ue=$.to,fe=$.resultCode,he=$.resultInfo;xe(fe)||fe===0?M.push(ue):(ue={userID:$.to,code:fe,message:he},L.push(ue))}),new ts({name:a,userIDList:M}));return n._friendGroupMap.set(a,F),n._snsM.updateWhenAddedToFriendGroup({name:a,userIDList:M}),n._emitFriendGroupListUpdated(),ft({friendGroup:F,failureUserIDList:L})}).catch(function(m){return h.setError(m).end(),w.w("".concat(o," failed. error:"),m),Ce(m)})}},{key:"deleteFriendGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("deleteFriendGroup"),a=e.name;if(!this._friendGroupMap.has(a))return Ce({code:we.FRIEND_GRP_NOT_EXIST});var l=new Be("deleteFriendGroup");return l.setMessage("name:".concat(a)),this._snsM.req({proto:le.DEL_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),nameList:[a]}}).then(function(h){l.end(),w.l("".concat(o," ok. name:").concat(a));var m=n._friendGroupMap.get(a);return m&&(n._snsM.updateWhenRemovedFromFriendGroup({name:a,userIDList:m.userIDList}),n._friendGroupMap.delete(a),m.userIDList.length=0),n._emitFriendGroupListUpdated(),ft(m)}).catch(function(h){return l.setError(h).end(),w.w("".concat(o," failed. error:"),h),Ce(h)})}},{key:"renameFriendGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("renameFriendGroup"),a=e.oldName,l=e.newName;if(!this._friendGroupMap.has(a))return Ce({code:we.FRIEND_GRP_NOT_EXIST});var h=new Be("renameFriendGroup");return h.setMessage("oldName:".concat(a," newName:").concat(l)),this._snsM.req({proto:le.UPDATE_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),oldName:a,newName:l}}).then(function(){var m;return h.end(),w.l("".concat(o," ok. oldName:").concat(a," newName:").concat(l)),n._friendGroupMap.has(a)?((m=n._friendGroupMap.get(a)).name=l,n._friendGroupMap.delete(a),n._friendGroupMap.set(l,m),n._snsM.updateWhenRemovedFromFriendGroup({name:a,userIDList:m.userIDList}),n._snsM.updateWhenAddedToFriendGroup({name:l,userIDList:m.userIDList}),n._emitFriendGroupListUpdated(),ft(m)):ft()}).catch(function(m){return h.setError(m).end(),w.w("".concat(o," failed. error:"),m),Ce(m)})}},{key:"addToFriendGroup",value:function(l){var n=this,o="".concat(this._n,".").concat("addToFriendGroup"),a=l.name,l=l.userIDList;if(!this._friendGroupMap.has(a))return this._onFriendGroupNotExist(a);var h=new Be("addToFriendGroup");return h.setMessage("name:".concat(a," userIDList:").concat(l)),w.l("".concat(o," name:").concat(a," userIDList:").concat(l)),this._snsM.req({proto:le.UPDATE_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),oldName:a,updateGroupItem:l.filter(function(m){return n._snsM.isMyFriend(m)}).map(function(m){return{to:m,updateType:"Update_Type_Add"}})}}).then(function(m){return h.end(),n._onFriendGroupUpdated(a,m)}).catch(function(m){return h.setError(m).end(),w.w("".concat(o," failed. error:"),m),Ce(m)})}},{key:"removeFromFriendGroup",value:function(l){var n=this,o="".concat(this._n,".").concat("removeFromFriendGroup"),a=l.name,l=l.userIDList;if(!this._friendGroupMap.has(a))return this._onFriendGroupNotExist(a);var h=new Be("removeFromFriendGroup");return h.setMessage("name:".concat(a," userIDList:").concat(l)),w.l("".concat(o," name:").concat(a," userIDList:").concat(l)),this._snsM.req({proto:le.UPDATE_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),oldName:a,updateGroupItem:l.filter(function(m){return n._snsM.isMyFriend(m)}).map(function(m){return{to:m,updateType:"Update_Type_Delete"}})}}).then(function(m){return h.end(),n._onFriendGroupUpdated(a,m)}).catch(function(m){return h.setError(m).end(),w.w("".concat(o," failed. error:"),m),Ce(m)})}},{key:"_onFriendGroupUpdated",value:function(e,o){var o=o.data.resultList,a=this._friendGroupMap.get(e),l=[],h=[],m=[];return At(o)&&o.forEach(function(M){var L=M.to,F=M.resultCode,$=M.resultInfo,ue=M.type;F===0?ue==="Update_Type_Add"?a&&(a.addToUserIDList(L),h.push(L)):ue==="Update_Type_Delete"&&a&&(a.removeFromUserIDList(L),m.push(L)):l.push({to:M.to,code:F,message:$})}),w.l("".concat(this._n,"._onFriendGroupUpdated name:").concat(e," userIDList:").concat(a.userIDList)),0<h.length&&this._snsM.updateWhenAddedToFriendGroup({name:e,userIDList:h}),0<m.length&&this._snsM.updateWhenRemovedFromFriendGroup({name:e,userIDList:m}),ft({friendGroup:a,failureUserIDList:l})}},{key:"updateWhenFriendAdded",value:function(e){var n=this,o=e.nameList,a=e.userID;w.l("".concat(this._n,".updateWhenFriendAdded userID:").concat(a," nameList:").concat(o)),Je(o)||o.forEach(function(l){n._friendGroupMap.has(l)&&n._friendGroupMap.get(l).addToUserIDList(a)})}},{key:"updateWhenFriendDeleted",value:function(e){var n=this,o=e.nameList,a=e.userID;w.l("".concat(this._n,".updateWhenFriendDeleted userID:").concat(a," nameList:").concat(o)),Je(o)||o.forEach(function(l){n._friendGroupMap.has(l)&&n._friendGroupMap.get(l).removeFromUserIDList(a)})}},{key:"reset",value:function(){this._friendGroupMap.clear()}}]),eh),kc=(E(Gc,Pn),xg=B(Gc),y(Gc,[{key:"onContextUpdated",value:function(e){this._friendHandler.pagingGetFriendList(),this._friendGroupHandler.getFriendGroupList(),this._friendApplicationHandler.getFriendApplicationList()}},{key:"onRelationChainModified",value:function(L){var n,o,a,l,h,m,M=this,L=L.dataList;Je(L)||(n=[],o=[],a=[],h=!(l=[]),m="",L.forEach(function(F){var $;F.pushType!==3&&F.pushType!==4||!F.from||(m=F.from),F.friendAddAccount&&(n.push.apply(n,V(F.friendAddAccount)),l.push.apply(l,V(F.friendAddAccount))),F.friendDelAccount&&o.push.apply(o,V(F.friendDelAccount)),F.friendApplicationAdded&&a.push.apply(a,V(F.friendApplicationAdded)),F.friendApplicationDeletedUserIDList&&l.push.apply(l,V(F.friendApplicationDeletedUserIDList)),F.reportTime&&F.pushType===7&&(h=!0),F.friendUpInfo&&($={dataList:[]},F.friendUpInfo.forEach(function(ue){$.dataList.push({userID:ue.friendAccount,profileList:V(ue.sns)})}),M.onFriendProfileModified($))}),h&&this._friendApplicationHandler.onFriendApplicationRead(),this._friendApplicationHandler.onFriendApplicationAdded(a,m),this._friendApplicationHandler.onFriendApplicationDeleted(l),this._friendHandler.onFriendAdded(n),this._friendHandler.onFriendDeleted(o))}},{key:"isMyFriend",value:function(e){return this._friendHandler.isMyFriend(e)}},{key:"filterProfanity",value:function(e,n){var a=this.get(29);if(!a)return!0;var a=a.filterText(n[e],"sns"),o=a.isAllowedToSend,a=a.modifiedText;return o===!0&&(n[e]=a,!0)}},{key:"onFriendProfileModified",value:function(e){this._friendHandler.onFriendProfileModified(e)}},{key:"getLocalFriendList",value:function(){var e=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],n=this._friendHandler.getLocalFriendList();return e?St(n):n}},{key:"getFriendRemark",value:function(e){return this._friendHandler.getFriendRemark(e)}},{key:"getFriendList",value:function(){return this._friendHandler.pagingGetFriendList()}},{key:"addFriend",value:function(e){return this._friendHandler.addFriend(e)}},{key:"deleteFriend",value:function(e){return this._friendHandler.deleteFriend(e)}},{key:"checkFriend",value:function(e){return this._friendHandler.checkFriend(e)}},{key:"getFriendProfile",value:function(e){return this._friendHandler.getFriendProfile(e)}},{key:"updateFriend",value:function(e){return this._friendHandler.updateFriend(e)}},{key:"updateWhenAddedToFriendGroup",value:function(e){this._friendHandler.updateWhenAddedToFriendGroup(e)}},{key:"updateWhenRemovedFromFriendGroup",value:function(e){this._friendHandler.updateWhenRemovedFromFriendGroup(e)}},{key:"getLocalFriendApplicationList",value:function(){var e=this._friendApplicationHandler.getLocalFriendApplicationList();return St(e)}},{key:"deleteFriendApplication",value:function(e){return this._friendApplicationHandler.deleteFriendApplication(e)}},{key:"refuseFriendApplication",value:function(e){return this._friendApplicationHandler.refuseFriendApplication(e)}},{key:"acceptFriendApplication",value:function(e){return this._friendApplicationHandler.acceptFriendApplication(e)}},{key:"setFriendApplicationRead",value:function(e){return this._friendApplicationHandler.setFriendApplicationRead(e)}},{key:"getLocalFriendGroupList",value:function(){var e=this._friendGroupHandler.getLocalFriendGroupList();return St(e)}},{key:"createFriendGroup",value:function(e){return this._friendGroupHandler.createFriendGroup(e)}},{key:"deleteFriendGroup",value:function(e){return this._friendGroupHandler.deleteFriendGroup(e)}},{key:"addToFriendGroup",value:function(e){return this._friendGroupHandler.addToFriendGroup(e)}},{key:"removeFromFriendGroup",value:function(e){return this._friendGroupHandler.removeFromFriendGroup(e)}},{key:"renameFriendGroup",value:function(e){return this._friendGroupHandler.renameFriendGroup(e)}},{key:"onAddToFriendGroup",value:function(e){return this._friendGroupHandler.onAddToFriendGroup(e)}},{key:"updateWhenFriendAdded",value:function(e){this._friendGroupHandler.updateWhenFriendAdded(e)}},{key:"updateWhenFriendDeleted",value:function(e){this._friendGroupHandler.updateWhenFriendDeleted(e)}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._friendHandler.reset(),this._friendGroupHandler.reset(),this._friendApplicationHandler.reset()}}]),Gc),ns=(E(rs,Pn),Ug=B(rs),y(rs,[{key:"isWorkerEnabled",value:function(){return this._isWorkerEnabled&&kn}},{key:"startWorkerTimer",value:function(){w.l("".concat(this._n,".startWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("start")}},{key:"stopWorkerTimer",value:function(){w.l("".concat(this._n,".stopWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("stop")}},{key:"_init",value:function(){var e,n;kn&&(e=URL.createObjectURL(new Blob(['let interval = -1;onmessage = function(event) { if (event.data === "start") { if (interval > 0) { clearInterval(interval); } interval = setInterval(() => { postMessage(""); }, 1000); postMessage(interval); } else if (event.data === "stop") { clearInterval(interval); interval = -1; }};'],{type:"application/javascript; charset=utf-8"})),this._workerTimer=new Worker(e),(n=this)._workerTimer.onmessage=function(o){o.data?(n._timerID=o.data,w.l("".concat(n._n,"._init seed:").concat(n._timerID))):n._m.onCheckTimer()})}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("enable_worker");w.l("".concat(this._n,"._onCloudConfigUpdated enableWorker:").concat(e)),xe(e)||e==="1"?!this._isWorkerEnabled&&kn&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&kn&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:"terminate",value:function(){w.l("".concat(this._n,".terminate")),this._workerTimer&&(this._workerTimer.terminate(),this._workerTimer=null,this._timerID=-1)}},{key:"getTimerID",value:function(){return this._timerID}},{key:"reset",value:function(){w.l("".concat(this._n,".reset"))}}]),rs),qg=(y($A,[{key:"isValidPurchaseBits",value:function(e){return e&&typeof e=="string"&&1<=e.length&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:"parsePurchaseBits",value:function(e){if(this.isValidPurchaseBits(e)){this._featureMap.clear();for(var n,o=e.length-1,a=0;0<=o;o--,a++)n=(a<32?new Z(0,Math.pow(2,a)):new Z(Math.pow(2,a-32),0)).toString(),e[o]==="1"?this._featureMap.set(n,!0):this._featureMap.set(n,!1)}else w.w("".concat(this._n,".parsePurchaseBits invalid purchasebits:").concat(e))}},{key:"hasPurchasedFeature",value:function(e){return!!this._featureMap.get(e)}},{key:"isFeatureEnabled",value:function(e){for(var n=parseInt(e).toString(2),o=void 0,a=!0,l=n.length-1,h=0;0<=l;l--,h++)if(n.charAt(l)==="1"&&(o=(h<32?new Z(0,Math.pow(2,h)):new Z(Math.pow(2,h-32),0)).toString(),!this._featureMap.get(o))){a=!1;break}return w.l("".concat(this._n,".isFeatureEnabled decimalNumber:").concat(e," key:").concat(o," ret:").concat(a)),St({enabled:a})}},{key:"isFeatureEnabledForStat",value:function(e){for(var n=parseInt(e).toString(2),o=n.length-1,a=0;0<=o;o--,a++)if(n.charAt(o)==="1"){if(l=(a<32?new Z(0,Math.pow(2,a)):new Z(Math.pow(2,a-32),0)).toString(),!this._featureMap.get(l))break;var l,h="",m=0;l===pe.SEARCH_MSG?(h="plugin_search",m=6):l===pe.PLUGIN_TRANSLATE?(h="plugin_translate",m=16):l===pe.PLUGIN_VOICE_TO_TEXT?(h="plugin_voice_to_text",m=17):l===pe.PLUGIN_CS?(h="plugin_cs",m=14):l===pe.PLUGIN_PUSH?(h="plugin_push",m=13):l===pe.PLUGIN_BOT?(h="plugin_bot",m=15):l===pe.MSG_REACTION&&(h="plugin_emoji_reaction",m=18),h!==""&&(l=this._commercialConfigM.get(12).getUIPlatform(),new Be(h).setCode(m).setUIPlatform(l).end(),w.l("".concat(this._n,".isFeatureEnabledForStat ").concat(h," code:").concat(m," uiPlatform:").concat(l)))}}},{key:"clear",value:function(){this._featureMap.clear()}}]),$A),WA=(y(Ru,[{key:"_canFetch",value:function(){return this.get(12).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:"onCheckTimer",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:"fetchConfig",value:function(){var e,n,o=this,a=this._canFetch(),l="".concat(this._n,".fetchConfig");w.l("".concat(l," canFetch:").concat(a)),a&&(e=new Be("fetchCommercialConfig"),a=this.get(12).getSDKAppID(),n=this.get(20),this._isFetching=!0,n.req({proto:le.FETCH_COMMERCIAL_CONFIG,data:{SDKAppID:a}}).then(function(h){e.setMessage("purchaseBits:".concat(h.data.purchaseBits)).end(),w.l("".concat(l," ok.")),o._parseConfig(h.data),o._isFetching=!1}).catch(function(h){e.setError(h).end(),o._isFetching=!1}))}},{key:"onPushedConfig",value:function(e){var n="".concat(this._n,".onPushedConfig data:").concat(JSON.stringify(e));w.l("".concat(n)),new Be("pushedCommercialConfig").setMessage("purchaseBits:".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:"_parseConfig",value:function(e){var n="".concat(this._n,"._parseConfig"),o=e.errorCode,a=e.errorMessage,l=e.purchaseBits,h=e.expiredTime;o===0?(this._purchasedFeatureHandler.parsePurchaseBits(l),this._expiredTime=Date.now()+1e3*h):xe(o)?(w.l("".concat(n," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(w.e("".concat(n," errorCode:").concat(o," errorMessage:").concat(a)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"canIUse",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:"isFeatureEnabled",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:"isFeatureEnabledForStat",value:function(e){this._purchasedFeatureHandler.isFeatureEnabledForStat(e)}},{key:"get",value:function(e){return this._m.get(e)}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),Ru),YA=(E(os,Pn),BA=B(os),y(os,[{key:"registerPlugin",value:function(e){var n,o,a,l,h,m,M,L,F,$,ue,fe,he;We?(this._offlinePushPlugin=e["tim-offline-push-plugin"],n=(he=e.offlinePushConfig||{}).huaweiBusinessID,o=he.xiaomiBusinessID,a=he.xiaomiAppID,l=he.xiaomiAppKey,h=he.meizuBusinessID,m=he.meizuAppID,M=he.meizuAppKey,L=he.vivoBusinessID,F=he.oppoBusinessID,$=he.oppoAppKey,ue=he.oppoAppSecret,fe=he.honorBusinessID,he=he.iosBusinessID,this._androidPushConfig.huaweiPushBussinessId=n,this._androidPushConfig.xiaomiPushBussinessId=o,this._androidPushConfig.xiaomiPushAppId=a,this._androidPushConfig.xiaomiPushAppKey=l,this._androidPushConfig.meizuPushBussinessId=h,this._androidPushConfig.meizuPushAppId=m,this._androidPushConfig.meizuPushAppKey=M,this._androidPushConfig.vivoPushBussinessId=L,this._androidPushConfig.oppoPushBussinessId=F,this._androidPushConfig.oppoPushAppKey=$,this._androidPushConfig.oppoPushAppSecret=ue,this._androidPushConfig.honorPushBussinessId=fe,new Be("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!xe(this._offlinePushPlugin))).end(!0),w.l("".concat(this._n,".").concat("registerPlugin"," ok. offlinePushConfig:").concat(JSON.stringify(e.offlinePushConfig))),this._iosBusinessID=he,this._setAppShowListener()):this.outputWarning("OfflinePushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:"_getDeviceToken",value:function(){var e,n=this,o="".concat(this._n,".").concat("_getDeviceToken");Hn(this._offlinePushPlugin.getDeviceToken)?(e="androidPushConfig:".concat(JSON.stringify(this._androidPushConfig),", iosBusinessID:").concat(this._iosBusinessID),w.l("".concat(o," start. ").concat(e)),new Be("_getDeviceToken").setMessage("".concat(e)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,function(a){var l,h,m,M,L=new Be("getDeviceTokenRes"),F=a.code,$=a.msg;F===0?(l=(M=a.data).deviceToken,h=M.deviceBrand,m=M.deviceType,M=M.bussinessId,n._deviceToken=l,n._businessID=M||n._iosBusinessID,e="deviceToken:".concat(l,", deviceBrand:").concat(h||m,", businessID:").concat(n._businessID),w.l("".concat(o," ok. ").concat(e)),L.setMessage(e).end(!0),n._setToken()):(L.setMessage("code:".concat(F,", msg:").concat($)).end(!0),w.e("".concat(o," failed. error:"),a))})):w.e("".concat(o," getDeviceToken is not a function"))}},{key:"canIUseOfflinePush",value:function(){return We&&!xe(this._offlinePushPlugin)}},{key:"_setAppShowListener",value:function(){var e=this,n="".concat(this._n,".").concat("_setAppShowListener");xe(this._offlinePushPlugin)?w.e("".concat(n," offlinePushPlugin is undefined")):Hn(this._offlinePushPlugin.setAppShowListener)?(new Be("_setAppShowListener").end(!0),w.l("".concat(n," start")),this._offlinePushPlugin.setAppShowListener(function(o){o=(o||{}).appShow,new Be("setAppShowListenerRes").setMessage("appShow:".concat(o)).end(!0),w.l("".concat(n," ok. appShow:").concat(o)),e._m.isReady()&&(o===0?(e._getConvUnreadCount(),e._onBackground()):o===1&&e._onForeground())})):w.e("".concat(n," setAppShowListener is not a function"))}},{key:"getDeviceBrand",value:function(){var e;if(!xe(this._offlinePushPlugin)&&Hn(this._offlinePushPlugin.getDeviceType))return e=(this._offlinePushPlugin.getDeviceType()||{}).deviceType,w.l("".concat(this._n,".getDeviceBrand ok. deviceType:").concat(e)),e}},{key:"_setToken",value:function(){var e="".concat(this._n,"._setToken"),n=this.get(12),o=1,a="",l="",M=(Je(this._deviceToken)&&(o=0),this.getUniAppPlatform()),h=this.getDeviceBrand(),m=(M===oe.IOS||M===oe.IPAD||M===oe.MAC?l=this._deviceToken:M===oe.ANDROID&&(a=this._deviceToken),new Be("offlinePushSetToken")),M="deviceToken:".concat(l||a,", businessID:").concat(this._businessID,", ")+"deviceBrand:".concat(h,", isWebUniapp:").concat(this._isWebUniapp,", pushMsg:").concat(o,", platform:").concat(M);return m.setMessage("".concat(M)),w.l("".concat(e," ").concat(M)),this.req({proto:le.SET_TOKEN,data:{tokenID:a,pushMsg:o,sdkAppID:n.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:h,deviceToken:l,isWebUniapp:this._isWebUniapp}}).then(function(L){return m.end(),w.l("".concat(e," ok")),L}).catch(function(L){return m.setError(L).end(),w.e("".concat(e," failed. error:"),L),Ce(L)})}},{key:"_getConvUnreadCount",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.get(11).getLocalConversationList().forEach(function(n){n.type===C.CONV_C2C&&(e._c2cUnreadCount+=n.unreadCount),n.type===C.CONV_GROUP&&(e._groupUnreadCount+=n.unreadCount)})}},{key:"_onBackground",value:function(){var e=this,n="".concat(this._n,".").concat("_onBackground"),o=new Be("_onBackground");this.req({proto:le.STAT_BACKGROUND,data:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then(function(a){return o.setMessage("c2cUnreadCount: ".concat(e._c2cUnreadCount,", groupUnreadCount: ").concat(e._groupUnreadCount)).end(),w.l("".concat(n," ok")),a}).catch(function(a){o.setError(a).end(),w.e("".concat(n," failed. error:"),a)})}},{key:"_onForeground",value:function(){var e="".concat(this._n,".").concat("_onForeground"),n=new Be("_onForeground");this.req({proto:le.STAT_FOREGROUND,data:{isWebUniapp:this._isWebUniapp}}).then(function(o){return n.end(),w.l("".concat(e," ok")),o}).catch(function(o){n.setError(o).end(),w.e("".concat(e," failed. error:"),o)})}},{key:"getUniAppPlatform",value:function(){var e=uni.getSystemInfoSync().platform,n=this.getDeviceBrand();return e==="ios"?oe.IOS:e==="android"?oe.ANDROID:n===1002?oe.IPAD:n===1001?oe.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,w.l("".concat(this._n,".reset"))}}]),os),xv=(E(Vc,Pn),es=B(Vc),y(Vc,[{key:"registerPlugin",value:function(e){var n,o,a;We?(n="".concat(this._n,".").concat("registerPlugin"),this._pushPlugin=e["tim-push"],this._getDeviceInfo(),o=(a=e.pushConfig||{}).androidConfig,a=a.iOSConfig,oo(o)&&(this._androidPushConfig=o[this._deviceInfo.packageName]),o=(a||{}).iOSBusinessID,this._iOSBusinessID=o,a=!xe(this._pushPlugin),new Be("registerPlugin").setMessage(this._pluginName).setMoreMessage("isExisted:".concat(a)).end(!0),w.l("".concat(n," ok. pushConfig:").concat(JSON.stringify(e.pushConfig))),a?(this._setAppShowListener(),this._setPushEventReportListener()):w.e("".concat(n," ").concat(this._pluginName," is undefined"))):this.outputWarning("TIMPushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._reportEventCacheList(),this._getDeviceToken(),this.get(27).isFeatureEnabledForStat(Math.pow(2,41))}},{key:"_reportEventCacheList",value:function(){var e=this,n="".concat(this._n,".").concat("_reportEventCacheList");Hn(this._pushPlugin.getPushEventCacheList)?(new Be("_reportEventCacheList").end(!0),this._pushPlugin.getPushEventCacheList(function(o){var a=o.code,l=o.data.eventList,h=new Be("getPushEventCacheListRes");if(h.setCode(a),a!==0)h.setMessage("res:".concat(JSON.stringify(o))).end(!0),w.e("".concat(n," failed. error:").concat(JSON.stringify(o)));else{a=l.length<10?"eventList:".concat(JSON.stringify(l)):"eventList.length:".concat(l.length),w.l("".concat(n," ok. ").concat(a)),h.setMessage(a).end(!0);for(var m=u(u({},o.data),{},{eventList:[]});0<l.length;)m.eventList=l.splice(0,40),e._pushReport(m)}})):w.e("".concat(this._pluginName,".getPushEventCacheList is not a function"))}},{key:"_getDeviceToken",value:function(){var e,n=this,o="".concat(this._n,".").concat("_getDeviceToken");Hn(this._pushPlugin.getDeviceToken)?(e="androidPushConfig:".concat(JSON.stringify(this._androidPushConfig)," iOSBusinessID:").concat(this._iOSBusinessID),w.l("".concat(o," start. ").concat(e)),new Be("_getDeviceToken").setMessage("".concat(e)).end(!0),this._pushPlugin.getDeviceToken(this._androidPushConfig,function(a){var l,h,m,M=a.code,L=a.msg,F=new Be("getDeviceTokenRes");if(F.setCode(M),M===0)return l=(M=a.data).deviceToken,h=M.deviceBrand,m=M.deviceType,M=M.bussinessId,n._deviceToken=l,n._businessID=M||n._iOSBusinessID,e="deviceToken:".concat(l," deviceBrand:").concat(h||m," businessID:").concat(n._businessID),w.l("".concat(o," ok. ").concat(e)),F.setMessage(e).end(!0),void n._setToken();F.setMessage(L).end(!0),w.e("".concat(o," failed. error:").concat(JSON.stringify(a)))})):w.e("".concat(this._pluginName,".getDeviceToken is not a function"))}},{key:"_getDeviceInfo",value:function(){var e="".concat(this._n,".").concat("_getDeviceInfo");if(Hn(this._pushPlugin.getDeviceInfo)){var n=this._pushPlugin.getDeviceInfo(),o=n.code,a=n.data,l=new Be("_getDeviceInfo");if(l.setCode(o),o===0)return this._deviceInfo=u(u({},this._deviceInfo),a),this._deviceInfo.pushVersion||(this._deviceInfo.pushVersion="1.0.1"),o="deviceInfo:".concat(JSON.stringify(this._deviceInfo)),w.l("".concat(e," ok. ").concat(o)),void l.setMessage(o).end(!0);l.setMessage("deviceInfoRes:".concat(JSON.stringify(n))).end(!0),w.e("".concat(e," failed. error:").concat(JSON.stringify(n)))}else w.e("".concat(this._pluginName,".getDeviceInfo is not a function"))}},{key:"canIUseTIMPush",value:function(){return We&&!xe(this._pushPlugin)}},{key:"_setAppShowListener",value:function(){var e=this,n="".concat(this._n,".").concat("_setAppShowListener");Hn(this._pushPlugin.setAppShowListener)?(new Be("_setAppShowListener").end(!0),w.l("".concat(n," start")),this._pushPlugin.setAppShowListener(function(o){o=(o||{}).appShow,new Be("setAppShowListenerRes").setMessage("appShow:".concat(o)).end(!0),w.l("".concat(n," ok. appShow:").concat(o)),e._m.isReady()&&(o===0?(e._getConvUnreadCount(),e._onBackground()):o===1&&e._onForeground())})):w.e("".concat(this._pluginName,".setAppShowListener is not a function"))}},{key:"_setPushEventReportListener",value:function(){var e=this,n="".concat(this._n,".").concat("_setPushEventReportListener");Hn(this._pushPlugin.setPushEventReportListener)?(new Be("_setPushEventReportListener").end(!0),this._pushPlugin.setPushEventReportListener(function(o){var a=o.code,l=o.data,h=l.eventList,m=new Be("setPushEventReportListenerRes");if(m.setCode(a),a===0)return a="eventList:".concat(JSON.stringify(h)),w.l("".concat(n," ok. ").concat(a)),m.setMessage(a).end(!0),void(e._m.isReady()&&At(h)&&0<h.length&&e._pushReport(l));m.setMessage("res:".concat(JSON.stringify(o))).end(!0),w.e("".concat(n," failed. error:").concat(JSON.stringify(o)))})):w.e("".concat(this._pluginName,".setPushEventReportListener is not a function"))}},{key:"getDeviceBrand",value:function(){var e;if(!xe(this._pushPlugin)&&Hn(this._pushPlugin.getDeviceType))return e=(this._pushPlugin.getDeviceType()||{}).deviceType,w.l("".concat(this._n,".getDeviceBrand ok. deviceType:").concat(e)),e}},{key:"_setToken",value:function(){var e="".concat(this._n,".").concat("_setToken"),n=this.get(12),o=1,M="",a="",h=(Je(this._deviceToken)&&(o=0),this.getUniAppPlatform()),l=this.getDeviceBrand(),h=(h===oe.IOS||h===oe.IPAD||h===oe.MAC?a=this._deviceToken:h===oe.ANDROID&&(M=this._deviceToken),u({tokenID:M,pushMsg:o,sdkAppID:n.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:l,deviceToken:a,isWebUniapp:this._isWebUniapp},this._deviceInfo)),m=new Be("_setToken"),M="data:".concat(JSON.stringify(h));m.setMessage("".concat(M)),w.l("".concat(e," ").concat(M)),this.req({proto:le.SET_TOKEN,data:h}).then(function(){m.end(),w.l("".concat(e," ok"))}).catch(function(L){m.setError(L).end(),w.e("".concat(e," failed. error:"),L),Ce(L)})}},{key:"_getConvUnreadCount",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.get(11).getLocalConversationList().forEach(function(n){n.type===C.CONV_C2C&&(e._c2cUnreadCount+=n.unreadCount),n.type===C.CONV_GROUP&&(e._groupUnreadCount+=n.unreadCount)})}},{key:"_onBackground",value:function(){var e=this,n="".concat(this._n,".").concat("_onBackground"),o=new Be("_onBackground");this.req({proto:le.STAT_BACKGROUND,data:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then(function(){o.setMessage("c2cUnreadCount:".concat(e._c2cUnreadCount," groupUnreadCount:").concat(e._groupUnreadCount)).end(),w.l("".concat(n," ok"))}).catch(function(a){o.setError(a).end(),w.e("".concat(n," failed. error:"),a)})}},{key:"_onForeground",value:function(){var e="".concat(this._n,".").concat("_onForeground"),n=new Be("_onForeground");this.req({proto:le.STAT_FOREGROUND,data:{isWebUniapp:this._isWebUniapp}}).then(function(){n.end(),w.l("".concat(e," ok"))}).catch(function(o){n.setError(o).end(),w.e("".concat(e," failed. error:"),o)})}},{key:"_pushReport",value:function(e){var n=this,o="".concat(this._n,".").concat("_pushReport"),a=new Be("_pushReport");this.req({proto:le.PUSH_REPORT,data:{eventList:e.eventList}}).then(function(){a.end(),n._notifyReportSuccess(e)}).catch(function(l){a.setError(l).end(),w.e("".concat(o," failed. error:"),l)})}},{key:"_notifyReportSuccess",value:function(e){!xe(this._pushPlugin)&&Hn(this._pushPlugin.notifyReportSuccess)&&(this._pushPlugin.notifyReportSuccess(e),w.l("".concat(this._n,"._notifyReportSuccess ok")))}},{key:"getUniAppPlatform",value:function(){var e=uni.getSystemInfoSync().platform,n=this.getDeviceBrand();return e==="ios"?oe.IOS:e==="android"?oe.ANDROID:n===1002?oe.IPAD:n===1001?oe.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,w.l("".concat(this._n,".reset"))}}]),Vc),Vv=(E(is,Pn),Pg=B(is),y(is,[{key:"init",value:function(){var e=this.get(18).getPlugin("tim-profanity-filter-plugin");e?(this._plugin=new e({logger:w,isArray:At,isMap:ji,isDevMode:this.isDevMode()}),this._getLexicon()):this.outputWarning("ProfanityPluginNotFound")}},{key:"onCheckTimer",value:function(){this._plugin&&this._canIUseLexicon&&this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime&&this._getLexicon()}},{key:"filterMessage",value:function(e,a){var o=!0;if(!this._plugin||!this._canIUseLexicon||a&&a.messageControlInfo&&a.messageControlInfo.excludedFromContentModeration===!0)return o;var a=e.type,l=e.conversationType;if(a!==C.MSG_TEXT&&a!==C.MSG_CUSTOM)return o;var h,m="".concat(this._n,".filterMessage");if(w.l("".concat(m)),a===C.MSG_TEXT){if(l===C.CONV_C2C?h="c2c_text_message":l===C.CONV_GROUP&&(h="group_text_message"),!this._isConfigOn(h))return o;var L=this._plugin.filter(e.payload.text),M=L.type,L=L.modifiedText;M===1?o=!1:M===2&&(e.payload.text=L)}else if(a===C.MSG_CUSTOM){if(l===C.CONV_C2C?h="c2c_custom_message":l===C.CONV_GROUP&&(h="group_custom_message"),!this._isConfigOn(h))return o;M=this._plugin.filter(e.payload.data),L=this._plugin.filter(e.payload.description),a=this._plugin.filter(e.payload.extension),M.type===1||L.type===1||a.type===1?o=!1:(M.type===2&&(e.payload.data=M.modifiedText),L.type===2&&(e.payload.description=L.modifiedText),a.type===2&&(e.payload.extension=a.modifiedText))}return w.l("".concat(m," done. isAllowedToSend:").concat(o)),o}},{key:"filterText",value:function(e,n){var o="".concat(this._n,".filterText"),a={isAllowedToSend:!0,modifiedText:e};return!this._plugin||!this._canIUseLexicon||!this._isConfigOn(n)?a:(w.l("".concat(o)),n=this._plugin.filter(e),e=n.type,n=n.modifiedText,e===1?a.isAllowedToSend=!1:e===2&&(a.modifiedText=n),w.l("".concat(o," done. ret:"),a),a)}},{key:"_getLexicon",value:function(){var e=this,n=new Be("profanityFilter"),o="".concat(this._n,"._getLexicon");this._isFetching=!0,this.req({proto:le.GET_PROFANITY_LIST,data:{startIndex:this._startIndex,version:this._version}}).then(function(ue){var ue=ue.data,l=ue.errorInfo,h=ue.filterConfig,m=ue.lexicon,M=ue.strToken,L=ue.completeFlag,F=ue.nextStartIndex,$=ue.version,ue=ue.expiredTime,fe=l.errorCode,he=l.errorMessage;return fe!==0?(e._isFetching=!1,w.w("".concat(o," failed. error:"),l),void n.setCode(fe).setMessage(he).end()):(e._onFilterConfig(h),e._getToken(M),L===1?(w.l("".concat(o," done. version:").concat($," expiredTime:").concat(ue)),e._version=$,e._canIUseLexicon=!0,e._isFetching=!1,e._expiredTime=Date.now()+1e3*ue,void e._plugin.onLexiconCompleted(m)):(e._startIndex=F,e._plugin.onLexiconSliced(m),void e._getLexicon()))}).catch(function(a){n.setError(a).end(),e._isFetching=!1,w.l("".concat(o," failed. error:"),a)})}},{key:"_onFilterConfig",value:function(e){var n=this;Je(e)||(this._filterConfigMap.clear(),Object.keys(e).forEach(function(o){n._filterConfigMap.set(o,e[o])}),w.l("".concat(this._n,"._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys())," values:").concat(Array.from(this._filterConfigMap.values()))))}},{key:"_isConfigOn",value:function(e){return this._filterConfigMap.get(e)===1}},{key:"_getToken",value:function(e){if(wt(e)){var n=e.length,o="";if(n%2==0)for(var a=0;a<=n-1;a+=2)o=(o+=e[a+1])+e[a];else{for(var l=0;l<n-1;l+=2)o=(o+=e[l+1])+e[l];o+=e[n-1]}this._plugin.onToken(o)}}},{key:"reset",value:function(){w.l("".concat(this._n,".reset")),this._plugin&&(this._plugin.reset(),this._plugin=null),this._filterConfigMap.clear(),this._startIndex=0,this._version=0,this._canIUseLexicon=!1,this._isFetching=!1,this._expiredTime=0}}]),is),Gv=(y(ZA,[{key:"_onCloudConfigUpdated",value:function(){var e=this,n=this._m.get(23).getCloudConfig("rtc_cmd");xe(n)||((n=JSON.parse(n)).forEach(function(o){e._TRTCCommandList.includes(o)||e._TRTCCommandList.push(o)}),this._setTRTCCommandMap())}},{key:"_setTRTCCommandMap",value:function(){for(var e,n=0,o=this._TRTCCommandList.length;n<o;n++)e=this._TRTCCommandList[n].split(".")[0],this._TRTCCommandMap.set(e,1)}},{key:"onRoomCustomDataReceived",value:function(e){this._m.getOuterEmitterInstance().emit(R.ROOM_CUSTOM_DATA_RECEIVED,e)}},{key:"sendTRTCCustomData",value:function(o){var n=o.serviceCommand,o=o.data,a="".concat(re.NAME.TUIROOM_SVR,".*");return xe(n)||(a=n),this._isValidServiceCommand(a)?this._trans({servcmd:a,data:o}):Ce({code:we.INVALID_TRTC_CMD})}},{key:"_trans",value:function(o){w.d("".concat(this._n,"._trans. options:").concat(JSON.stringify(o)));var n=o.servcmd,o=o.data;return this._m.get(20).trans({servcmd:n,data:wt(o)?JSON.parse(o):o})}},{key:"_isValidServiceCommand",value:function(e){return e.endsWith(".*")?this._TRTCCommandList.includes(e):(e=e.split(".")[0],this._TRTCCommandMap.has(e))}},{key:"isTRTCCommand",value:function(e){return e=e.split(".")[0],this._TRTCCommandMap.has(e)}},{key:"reset",value:function(){w.l("".concat(this._n,".reset"))}}]),ZA),Hg=(y(JA,[{key:"_init",value:function(){var e,n=this._getStorageModule().getItem(this.TIM_ERROR_ASSISTANCE,!1);if(n){try{e=JSON.parse(n)}catch(o){this._getStorageModule().removeItem(this.TIM_ERROR_ASSISTANCE,!1),w.w("".concat(this._n,"._init error:"),o)}e&&(this._needToUpdate(e)?this._fetch():this._fillMap(e.message))}else this._fetch()}},{key:"_needToUpdate",value:function(o){var n=o.localSavedTime,o=o.localSavedVersion,n=n&&new Date().getTime()-n>=this.STORAGE_EXPIRES_TIME,o=!o||o!=="3.3.1";return w.l("".concat(this._n,"._needToUpdate isTimeout:").concat(n," isDifferentVersion:").concat(o)),n||o}},{key:"_fetch",value:function(){var e,n,o,a,l,h;this._m.get(12).isPrivateNetWork()||(e="https://web.sdk.qcloud.com/im/download/error-message/v3/0.0.5/tim-error-message.txt",n="application/x-www-form-urlencoded;charset=UTF-8",o="".concat(this._n,"._fetch ok in"),a=this,Fe?Ne.request({url:e,method:"GET",timeout:3e3,header:{"content-type":n},dataType:"text",success:function(m){a._fillAndSave(m.data),w.l("".concat(o," mini program"))},fail:function(){}}):(l=new XMLHttpRequest,h=setTimeout(function(){l.abort()},3e3),l.onreadystatechange=function(){l.readyState===4&&(clearTimeout(h),l.status!==200&&l.status!==304||(w.l("".concat(o," browser")),a._fillAndSave(l.responseText)))},l.open("GET",e,!0),l.setRequestHeader("Content-type",n),l.send()))}},{key:"_fillAndSave",value:function(e){this._fillMap(e),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:e,localSavedTime:new Date().getTime(),localSavedVersion:"3.3.1"}),!0,!1)}},{key:"_getStorageModule",value:function(){return this._m.get(13)}},{key:"_fillMap",value:function(e){this._map.clear();for(var n,o,a=e.split(`;
|