@crystaldesign/diva-support 25.5.0-beta.30 → 25.5.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see diva-support.umd.min.js.LICENSE.txt */
|
|
2
|
-
var CrystaldesignDivaSupport;(()=>{var j,K,$,ee,te={4249:j=>{window,j.exports=function(j){var K={};function s($){if(K[$])return K[$].exports;var ee=K[$]={i:$,l:!1,exports:{}};return j[$].call(ee.exports,ee,ee.exports,s),ee.l=!0,ee.exports}return s.m=j,s.c=K,s.d=function(j,K,$){s.o(j,K)||Object.defineProperty(j,K,{enumerable:!0,get:$})},s.r=function(j){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})},s.t=function(j,K){if(1&K&&(j=s(j)),8&K)return j;if(4&K&&"object"==typeof j&&j&&j.__esModule)return j;var $=Object.create(null);if(s.r($),Object.defineProperty($,"default",{enumerable:!0,value:j}),2&K&&"string"!=typeof j)for(var ee in j)s.d($,ee,function(K){return j[K]}.bind(null,ee));return $},s.n=function(j){var K=j&&j.__esModule?function(){return j.default}:function(){return j};return s.d(K,"a",K),K},s.o=function(j,K){return Object.prototype.hasOwnProperty.call(j,K)},s.p="",s(s.s=38)}([function(j,K,$){"use strict";K.__esModule=!0,K.validateConversationType=K.validateUpdateUser=K.validateCreateUser=K.validateMessage=K.validateChatType=K.validateMsgId=K.validateArray=K.validateHideMessagesFromBlockedUsers=K.validateId=K.validateCreateGroup=K.validateJoinGroup=K.validateUpdateGroup=K.validateScope=K.isAudio=K.isVideo=K.isImage=K.getUpdatedSettings=K.getAppSettings=K.getCurrentTime=K.Logger=K.createUidFromJid=K.format=K.getOrdinalSuffix=K.isFalsy=K.isTruthy=K.isObject=K.getJidHost=K.getChatHost=void 0;var ee=$(14),te=$(1),ne=$(6),re=$(2),oe=$(16),ie=$(17),ae=$(19),se=$(3),le=$(13);function l(j){return null!=j&&("string"==typeof j&&(j=j.trim()),"object"==typeof j&&0===Object.keys(j).length&&(j=void 0)),["",0,"0",!1,null,"null",void 0,"undefined"].includes(j)}function p(j){for(var K=[],$=1;$<arguments.length;$++)K[$-1]=arguments[$];return j.split("%s").reduce((function(j,$,ee){return j+$+(K[ee]||"")}),"")}K.getChatHost=function(j){return j[te.APP_SETTINGS.KEYS.CHAT_HOST_OVERRIDE]?j[te.APP_SETTINGS.KEYS.CHAT_HOST_OVERRIDE]:j[te.APP_SETTINGS.KEYS.CHAT_HOST_APP_SPECIFIC]?j[te.APP_SETTINGS.KEYS.CHAT_HOST_APP_SPECIFIC]:j[te.APP_SETTINGS.KEYS.CHAT_HOST]},K.getJidHost=function(j){return j[te.APP_SETTINGS.KEYS.JID_HOST_OVERRIDE]?j[te.APP_SETTINGS.KEYS.JID_HOST_OVERRIDE]:j[te.APP_SETTINGS.KEYS.CHAT_HOST]},K.isObject=function(j){return j instanceof Object&&j.constructor===Object},K.isTruthy=function(j){return[!0,1,"1","true","TRUE"].includes(j)},K.isFalsy=l,K.getOrdinalSuffix=function(j){var K=j%10,$=j%100;return 1==K&&11!=$?j+"st":2==K&&12!=$?j+"nd":3==K&&13!=$?j+"rd":j+"th"},K.format=p,K.createUidFromJid=function(j){return j.substring(j.lastIndexOf("]")+1,j.lastIndexOf("@"))};var ce=function(){function t(){}return t.log=function(j,K){},t.error=function(j,K){},t.info=function(j,K){},t}();function T(){return new Promise((function(j,K){ne.makeApiCall("appSettings").then((function(K){ee.LocalStorage.getInstance().set(te.LOCAL_STORE.KEY_APP_SETTINGS,K.data),K.data.MODE&&se.CometChat.setMode(K.data.MODE),j(K.data)}),(function(j){K(new re.CometChatException(j.error))}))}))}K.Logger=ce,K.getCurrentTime=function(){return(new Date).getTime()},K.getAppSettings=function(){return new Promise((function(j,K){ee.LocalStorage.getInstance().get(te.LOCAL_STORE.KEY_APP_SETTINGS).then((function($){l($)?T().then((function(K){j(K)}),(function(j){K(j)})):j($)}),(function(j){K(j)}))}))},K.getUpdatedSettings=T,K.isImage=function(j){var K;return j.type&&j.type.toLowerCase().includes("image")&&(K=!0),K},K.isVideo=function(j){var K;return j.type&&j.type.toLowerCase().includes("video")&&(K=!0),K},K.isAudio=function(j){var K;return j.type&&j.type.toLowerCase().includes("audio")&&(K=!0),K},K.validateScope=function(j){return typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"SCOPE","SCOPE","Scope"))):l(j)?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"SCOPE","SCOPE","scope","scope"))):j!=se.CometChat.GROUP_MEMBER_SCOPE.ADMIN&&j!=se.CometChat.GROUP_MEMBER_SCOPE.MODERATOR&&j!=se.CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT?new re.CometChatException(te.GroupErrors.INVALID_SCOPE):void 0},K.validateUpdateGroup=function(j){return j.hasOwnProperty(te.GroupConstants.KEYS.GUID)?typeof j[te.GroupConstants.KEYS.GUID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID"))):l(j[te.GroupConstants.KEYS.GUID])?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID"))):j.hasOwnProperty(te.GroupConstants.KEYS.NAME)&&""===j[te.GroupConstants.KEYS.NAME]?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"GROUP_NAME","GROUP_NAME","Group name"))):void 0:new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GUID","GUID","GUID","GUID")))},K.validateJoinGroup=function(j,K,$){if(typeof j==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.OBJECT){if(!j.hasOwnProperty(te.GroupConstants.KEYS.GUID))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GUID","GUID","GUID","GUID")));if(typeof j[te.GroupConstants.KEYS.GUID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(l(j[te.GroupConstants.KEYS.GUID]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID")));if(!j.hasOwnProperty(te.GroupConstants.KEYS.TYPE))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GROUP_TYPE","GROUP_TYPE","Group type","Group type")));if(typeof j[te.GroupConstants.KEYS.TYPE]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_TYPE","GROUP_TYPE","Group type")));if(l(j[te.GroupConstants.KEYS.TYPE]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_TYPE","GROUP_TYPE","type","type")));if(j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PUBLIC&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PASSWORD&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PROTECTED&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PRIVATE)return new re.CometChatException(te.GroupErrors.INVALID_GROUP_TYPE);if(j[te.GroupConstants.KEYS.TYPE].toLowerCase()==se.CometChat.GROUP_TYPE.PASSWORD){if(!j.hasOwnProperty(te.GroupConstants.KEYS.PASSWORD))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PASSWORD_COMPULSORY),"PASSWORD","PASSWORD")));if(typeof j[te.GroupConstants.KEYS.PASSWORD]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"PASSWORD","PASSWORD","Password")));if(l(j[te.GroupConstants.KEYS.PASSWORD]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"PASSWORD","PASSWORD","password","password")))}}else{if(void 0!==j){if(typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(l(j))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID")))}if(void 0!==K){if(typeof K!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_TYPE","GROUP_TYPE","Group type")));if(l(K))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_TYPE","GROUP_TYPE","type","type")));if(K.toLowerCase()!=se.CometChat.GROUP_TYPE.PUBLIC&&K.toLowerCase()!=se.CometChat.GROUP_TYPE.PASSWORD&&K.toLowerCase()!=se.CometChat.GROUP_TYPE.PROTECTED&&K.toLowerCase()!=se.CometChat.GROUP_TYPE.PRIVATE)return new re.CometChatException(te.GroupErrors.INVALID_GROUP_TYPE);if(K.toLowerCase()==se.CometChat.GROUP_TYPE.PASSWORD){if(typeof $!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"PASSWORD","PASSWORD","Password")));if(l($))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"PASSWORD","PASSWORD","password","password")))}}}},K.validateCreateGroup=function(j){if(!j.hasOwnProperty(te.GroupConstants.KEYS.GUID))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GUID","GUID","GUID","GUID")));if(typeof j[te.GroupConstants.KEYS.GUID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(l(j[te.GroupConstants.KEYS.GUID]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID")));if(!j.hasOwnProperty(te.GroupConstants.KEYS.NAME))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GROUP_NAME","GROUP_NAME","Group name","Group name")));if(typeof j[te.GroupConstants.KEYS.NAME]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_NAME","GROUP_NAME","Group name")));if(l(j[te.GroupConstants.KEYS.NAME]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_NAME","GROUP_NAME","name","name")));if(!j.hasOwnProperty(te.GroupConstants.KEYS.TYPE))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GROUP_TYPE","GROUP_TYPE","Group type","Group type")));if(typeof j[te.GroupConstants.KEYS.TYPE]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_TYPE","GROUP_TYPE","Group type")));if(l(j[te.GroupConstants.KEYS.TYPE]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_TYPE","GROUP_TYPE","type","type")));if(j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PUBLIC&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PASSWORD&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PROTECTED&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PRIVATE)return new re.CometChatException(te.GroupErrors.INVALID_GROUP_TYPE);if(j[te.GroupConstants.KEYS.TYPE].toLowerCase()==se.CometChat.GROUP_TYPE.PASSWORD){if(!j.hasOwnProperty(te.GroupConstants.KEYS.PASSWORD))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PASSWORD_COMPULSORY),"PASSWORD","PASSWORD")));if(typeof j[te.GroupConstants.KEYS.PASSWORD]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"PASSWORD","PASSWORD","Password")));if(l(j[te.GroupConstants.KEYS.PASSWORD]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"PASSWORD","PASSWORD","password","password")))}if(j.hasOwnProperty(te.GroupConstants.KEYS.TAGS)){if(!Array.isArray(j[te.GroupConstants.KEYS.TAGS]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_AN_ARRAY),"GROUP_TAGS","GROUP_TAGS","Group tags")));if(0===j[te.GroupConstants.KEYS.TAGS].length)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_ARRAY),"GROUP_TAGS","GROUP_TAGS","Group tags")))}},K.validateId=function(j,K){if("user"===K){if(typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"UID","UID","UID")));if(l(j))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"UID","UID","UID","UID")))}if("group"===K){if(typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(l(j))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"GUID","GUID","GUID","GUID")))}},K.validateHideMessagesFromBlockedUsers=function(j){if(typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_BOOLEAN),"HIDE_MESSAGES_FROM_BLOCKED_USERS","HIDE_MESSAGES_FROM_BLOCKED_USERS","hideMessagesFromBlockedUsers")))},K.validateArray=function(j,K){var $="List should be an array.";return $="blockUsers"===K?"blockUsers() method accepts an array of users.":"unblockUsers"===K?"unblockUsers() method accepts an array of users.":"groupMembers"===K?"addMembersToGroup() method accepts members list as an array of users.":"addMembersToGroup() method accepts bannedMembers list as an array of users.",typeof j!=te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.OBJECT?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_ARRAY),"USER_LIST","USER_LIST",$))):Array.isArray(j)?void 0:new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_ARRAY),"USER_LIST","USER_LIST",$)))},K.validateMsgId=function(j){return isNaN(j)?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_NUMBER),"MESSAGE_ID","MESSAGE_ID","Message Id"))):l(j)?new re.CometChatException(le.ERRORS.PARAMETER_MISSING):void 0},K.validateChatType=function(j){return typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver type"))):l(j)?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"RECEIVER_TYPE","RECEIVER_TYPE","receiver type","receiver type"))):j!=te.MessageConstatnts.RECEIVER_TYPE.GROUP&&j!=te.MessageConstatnts.RECEIVER_TYPE.USER?new re.CometChatException(te.MessageErrors.INVALID_RECEIVER_TYPE):void 0},K.validateMessage=function(j){var K=j;if(typeof K.getReceiverId()!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"RECEIVER_ID","RECEIVER_ID","Receiver Id")));if(l(K.getReceiverId()))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"RECEIVER_ID","RECEIVER_ID","receiver id","receiver id")));if(typeof K.getReceiverType()!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver Type")));if(l(K.getReceiverType()))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"RECEIVER_TYPE","RECEIVER_TYPE","receiver type","receiver type")));if(K.getReceiverType()!=te.MessageConstatnts.RECEIVER_TYPE.GROUP&&K.getReceiverType()!=te.MessageConstatnts.RECEIVER_TYPE.USER)return new re.CometChatException(te.MessageErrors.INVALID_RECEIVER_TYPE);if(j instanceof oe.TextMessage){var $=j;if(typeof $.getText()!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"MESSAGE_TEXT","MESSAGE_TEXT","Message text")));if(""===$.getText().trim())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"MESSAGE_TEXT","MESSAGE_TEXT","Message text")))}if(j instanceof ie.MediaMessage){var ee=j;if(ee.getData()&&ee.getData().hasOwnProperty("attachments"))for(var ne=ee.getAttachments(),se=0;se<ne.length;se++){if(!ne[se].getExtension())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MISSING_KEY),"extension","Attachment")));if(!ne[se].getMimeType())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MISSING_KEY),"mimeType","Attachment")));if(!ne[se].getName())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MISSING_KEY),"name","Attachment")));if(!ne[se].getUrl())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MISSING_KEY),"url","Attachment")))}if(ee.hasOwnProperty("files"))for(se=0;se<ee.files.length;se++)if(!(ee.files[se]instanceof Blob))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_BLOB),"MEDIA_OBJECT","MEDIA_OBJECT","Media object")))}return j instanceof ae.CustomMessage&&l(j.getCustomData())?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"CUSTOM_DATA","CUSTOM_DATA","custom data","custom data"))):void 0},K.validateCreateUser=function(j){if(!j.hasOwnProperty(te.UserConstants.UID))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"UID","UID","UID","UID")));if(typeof j[te.UserConstants.UID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"UID","UID","UID")));if(l(j[te.UserConstants.UID]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_USER_PROPERTY),"UID","UID","UID","UID")));if(!j.hasOwnProperty(te.UserConstants.NAME))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"USER_NAME","USER_NAME","User name","User name")));if(typeof j[te.UserConstants.NAME]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"USER_NAME","USER_NAME","User name")));if(l(j[te.UserConstants.NAME]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_USER_PROPERTY),"USER_NAME","USER_NAME","name","name")));if(j.hasOwnProperty(te.UserConstants.AVATAR)&&""===j[te.UserConstants.AVATAR])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_AVATAR","USER_AVATAR","User avatar")));if(j.hasOwnProperty(te.UserConstants.META_DATA)&&""===j[te.UserConstants.META_DATA])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_METADATA","USER_METADATA","User metadata")));if(j.hasOwnProperty(te.UserConstants.LINK)&&""===j[te.UserConstants.LINK])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_LINK","USER_LINK","User link")));if(j.hasOwnProperty(te.UserConstants.STATUS_MESSAGE)&&""===j[te.UserConstants.STATUS_MESSAGE])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_STATUS_MESSAGE","USER_STATUS_MESSAGE","User status message")));if(j.hasOwnProperty(te.UserConstants.ROLE)&&""===j[te.UserConstants.ROLE])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_ROLE","USER_ROLE","User role")));if(j.hasOwnProperty(te.UserConstants.TAGS)){if(!Array.isArray(j[te.UserConstants.TAGS]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_AN_ARRAY),"USER_TAGS","USER_TAGS","User tags")));if(0===j[te.UserConstants.TAGS].length)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_ARRAY),"USER_TAGS","USER_TAGS","User tags")))}},K.validateUpdateUser=function(j){return j.hasOwnProperty(te.UserConstants.UID)?typeof j[te.UserConstants.UID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"UID","UID","UID"))):l(j[te.UserConstants.UID])?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_USER_PROPERTY),"UID","UID","UID","UID"))):j.hasOwnProperty(te.UserConstants.NAME)&&""===j[te.UserConstants.NAME]?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_NAME","USER_NAME","User name"))):void 0:new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"UID","UID","UID","UID")))},K.validateConversationType=function(j){return typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"CONVERSATION_TYPE","CONVERSATION_TYPE","Conversation type"))):l(j)?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"CONVERSATION_TYPE","CONVERSATION_TYPE","conversation type","conversation type"))):(j=j.toLowerCase())!=se.CometChat.RECEIVER_TYPE.USER&&j!=se.CometChat.RECEIVER_TYPE.GROUP?new re.CometChatException(te.ConversationErrors.INVALID_CONVERSATION_TYPE):void 0}},function(j,K,$){"use strict";K.__esModule=!0,K.ONLINE_MEMBER_COUNT_API=K.JWT_API=K.ProsodyApiErrors=K.PROSODY_API=K.API_ERROR_CODES=K.SESSION_STORE=K.CONNECTION_STATUS=K.COMMON_UTILITY_CONSTANTS=K.APP_SETTINGS=K.PresenceConstatnts=K.FeatureRestrictionErrors=K.MessageErrors=K.ExtensionErrors=K.ConversationErrors=K.GroupErrors=K.UserErrors=K.ReceiptErrors=K.GENERAL_ERROR=K.PARAMETER_ERROR=K.CALL_ERROR=K.Errors=K.UserConstants=K.GroupMemersConstans=K.GroupConstants=K.CallConstants=K.BlockedUsersConstants=K.ActionConstatnts=K.TYPING_NOTIFICATION=K.MessageCategory=K.ATTACHMENTS_CONSTANTS=K.MessageConstatnts=K.READ_RECEIPTS=K.DELIVERY_RECEIPTS=K.ResponseConstants=K.LOCAL_STORE=K.ANALYTICS=K.WS=K.SDKHeader=K.APPINFO=K.GROUP_MEMBER_SCOPE=K.GroupMemberScope=K.GROUP_TYPE=K.GroupType=K.CALLING_COMPONENT_VERSION=K.DEFAULT_VALUES=K.constants=void 0;var ee,te,ne,re=$(2);K.constants={DEFAULT_STORE:"cometchat",MSG_VER_PRE:"store-ver-pre",MSG_VER_POST:"store-ver-post"},K.DEFAULT_VALUES={ZERO:0,MSGS_LIMIT:30,MSGS_MAX_LIMIT:100,USERS_LIMIT:30,USERS_MAX_LIMIT:100,GROUPS_LIMIT:30,GROUPS_MAX_LIMIT:100,CONVERSATION_MAX_LIMIT:50,CALL_TIMEOUT:45,DEFAULT_MSG_ID:0,DEFAULT_MAX_TYPING_INDICATOR_LIMIT:5,REGION_DEFAULT:"eu",REGION_DEFAULT_EU:"eu",REGION_DEFAULT_US:"us",REGION_DEFAULT_IN:"in",REGION_DEFAULT_PRIVATE:"private"},K.CALLING_COMPONENT_VERSION=5,(ee=K.GroupType||(K.GroupType={})).Public="public",ee.Private="private",ee.Protected="protected",ee.Password="password",K.GROUP_TYPE={PUBLIC:"public",PRIVATE:"private",PROTECTED:"password",PASSWORD:"password"},(te=K.GroupMemberScope||(K.GroupMemberScope={})).Admin="admin",te.Moderator="moderator",te.Member="member",K.GROUP_MEMBER_SCOPE={ADMIN:"admin",MODERATOR:"moderator",PARTICIPANT:"participant"},K.APPINFO={platform:"WEB",sdkVersion:"v3.0.11",apiVersion:"v3.0",sdkVersionWithUnderScore:"3_0_11"},K.SDKHeader={platform:"javascript",sdkVersion:"3.0.11",sdk:"%s@%s"},K.WS={CONVERSATION:{TYPE:{CHAT:"chat",GROUP_CHAT:"groupchat"}}},K.ANALYTICS={analyticsHost:"metrics-%s.cometchat.io",analyticsVersion:"v1"},K.LOCAL_STORE={COMMON_STORE:"common_store",MESSAGE_LISTENERS_LIST:"message_listeners_list",USERS_STORE:"users_store",MESSAGES_STORE:"messages_store",KEYS_STORE:"keys_store",STORE_STRING:"%s:%s",KEY_STRING:"%s/%s",KEY_USER:"user",KEY_APP_SETTINGS:"app_settings",KEY_APP_ID:"appId",KEY_DEVICE_ID:"deviceId",KEY_MESSAGE_LISTENER_LIST:"all"},K.ResponseConstants={RESPONSE_KEYS:{KEY_DATA:"data",KEY_META:"meta",KEY_CURSOR:"cursor",KEY_ACTION:"action",KEY_MESSAGE:"message",KEY_ERROR:"error",KEY_ERROR_DETAILS:"details",KEY_ERROR_CODE:"code",KEY_ERROR_MESSAGE:"message",KEY_AUTH_TOKEN:"authToken",KEY_WS_CHANNEL:"wsChannel",KEY_IDENTITY:"identity",KEY_SERVICE:"identity",KEY_ENTITIES:"entities",KEY_ENTITITY:"entity",KEY_ENTITYTYPE:"entityType",KEY_ATTACHMENTS:"attachments",CODE_REQUEST_OK:200,CODE_BAD_REQUEST:401,UNREAD_UNDELIVERED_KEYS:{ENTITY:"entity",ENTITY_TYPE:"entityType",ENTITY_Id:"entityId",COUNT:"count"},GROUP_MEMBERS_RESPONSE:{SUCCESS:"success",ERROR:"error",MESSAGE:"message"},KEY_ENTITY_TYPE:{USER:"user",GROUP:"group"}}},K.DELIVERY_RECEIPTS={RECEIVER_ID:"receiverId",RECEIVER_TYPE:"type",RECIPIENT:"recipient",MESSAGE_ID:"messageId",RECEIVED:"delivered",DELIVERED_AT:"deliveredAt",ID:"id",TIME:"time",DELIVERED_TO_ME_AT:"deliveredToMeAt"},K.READ_RECEIPTS={RECEIVER_ID:"receiverId",RECEIVER_TYPE:"type",RECIPIENT:"recipient",MESSAGE_ID:"messageId",READ:"read",READ_AT:"readAt",ID:"id",TIME:"time",READ_BY_ME_AT:"readByMeAt"},K.MessageConstatnts={TYPE:{TEXT:"text",MEDIA:"media",IMAGE:"image",VIDEO:"video",AUDIO:"audio",FILE:"file",CUSTOM:"custom"},CATEGORY:{MESSAGE:"message",ACTION:"action",CALL:"call",CUSTOM:"custom"},RECEIVER_TYPE:{USER:"user",GROUP:"group"},KEYS:{ATTATCHMENT:"attatchment",ATTATCHMENTS:"attachments",ACTION:"action",TYPE:"type",DATA:"data",ID:"id",MUID:"muid",SENDER:"sender",RECEIVER:"receiver",RECEIVER_ID:"receiverId",CATEGORY:"category",RECEIVER_TYPE:"receiverType",SENT_AT:"sentAt",STATUS:"status",TEXT:"text",URL:"url",METADATA:"metadata",RECEIPTS:"receipts",MY_RECEIPTS:"myReceipt",CUSTOM_DATA:"customData",CUSTOM_SUB_TYPE:"subType",RESOURCE:"resource"},KNOWN_MEDIA_TYPE:{IMAGE:[],VIDEO:[],AUDIO:[],FILE:[]},PAGINATION:{AFFIX:{APPEND:"append",PREPEND:"prepend"},CURSOR_FILEDS:{ID:"id",SENT_AT:"sentAt"},CURSOR_AFFIX_DEFAULT:"prepend",CURSOR_FIELD_DEFAULT:"sentAt",KEYS:{PER_PAGE:"per_page",CURSOR_AFFIX:"cursorAffix",AFFIX:"affix",CURSOR_FIELD:"cursorField",CURSOR_VALUE:"cursorValue",UID:"uid",SENT_AT:"sentAt",ID:"id",CURRENT_PAGE:"page",UNREAD:"unread",HIDE_MESSAGES_FROM_BLOCKED_USER:"hideMessagesFromBlockedUsers",SEARCH_KEY:"searchKey",ONLY_UPDATES:"onlyUpdates",UPDATED_AT:"updatedAt",CATEGORY:"category",CATEGORIES:"categories",TYPE:"type",TYPES:"types",HIDE_REPLIES:"hideReplies",HIDE_DELETED_MESSAGES:"hideDeleted",WITH_TAGS:"withTags",TAGS:"tags"}}},K.ATTACHMENTS_CONSTANTS={KEYS:{EXTENSION:"extension",MIME_TYPE:"mimeType",NAME:"name",SIZE:"size",URL:"url"}},(ne=K.MessageCategory||(K.MessageCategory={})).ACTION="action",ne.MESSAGE="message",ne.CALL="call",ne.CUSTOM="custom",K.TYPING_NOTIFICATION={RECEIVER_ID:"receiverId",RECEIVER_TYPE:"receiverType",META:"metadata",KEYS:{TYPING_NOTIFICATION:"typingNotification",TIMESTAMP:"timestamp"},ACTIONS:{STARTED:"started",ENDED:"ended"}},K.ActionConstatnts={ACTION_SUBJECTS:{ACTION_ON:"on",ACTION_BY:"by",ACTION_FOR:"for"},ACTION_ENTITY_TYPE:{GROUP_USER:"groupuser",USER:"user",GROUP:"group",MESSAGE:"message"},ACTION_KEYS:{ACTION_CREATED:"created",ACTION_UPDATED:"updated",ACTION_DELETED:"deleted",ENTITIES:"entities",ENTITY:"entity",ENTITY_TYPE:"entityType",TYPE_MEMBER_JOINED:"joined",TYPE_MEMBER_LEFT:"left",TYPE_MEMBER_KICKED:"kicked",TYPE_MEMBER_BANNED:"banned",TYPE_MEMBER_UNBANNED:"unbanned",TYPE_MEMBER_INVITED:"invited",TYPE_MEMBER_ADDED:"added",ACTION_SCOPE_CHANGED:"scopeChanged",ACTION_TYPE_USER:"user",ACTION_TYPE_GROUP:"group",ACTION_TYPE_GROUP_MEMBER:"groupMember",TYPE_MESSAGE_EDITED:"edited",TYPE_MESSAGE_DELETED:"deleted",ACTION_TYPE_CALL:"call",EXTRAS:"extras",SCOPE:"scope",NEW:"new",OLD:"old"},ActionMessages:{ACTION_GROUP_JOINED_MESSAGE:"%s joined",ACTION_GROUP_LEFT_MESSAGE:"%s left",ACTION_MEMBER_KICKED_MESSAGE:"%s kicked %s",ACTION_MEMBER_BANNED_MESSAGE:"%s banned %s",ACTION_MEMBER_UNBANNED_MESSAGE:"%s unbanned %s",ACTION_MEMBER_INVITED_MESSAGE:"%s banned %s",ACTION_MESSAGE_EDITED_MESSAGE:" Message Edited",ACTION_MESSAGE_DELETED_MESSAGE:"Message Deleted",ACTION_MEMBER_SCOPE_CHANGED:"%s made %s %s",ACTION_MEMBER_ADDED_TO_GROUP:"%s added %s"},ACTION_TYPE:{TYPE_MEMBER_JOINED:"joined",TYPE_MEMBER_LEFT:"left",TYPE_MEMBER_KICKED:"kicked",TYPE_MEMBER_BANNED:"banned",TYPE_MEMBER_UNBANNED:"unbanned",TYPE_MEMBER_INVITED:"invited",TYPE_MEMBER_SCOPE_CHANGED:"scopeChanged",TYPE_MESSAGE:"message",TYPE_MESSAGE_EDITED:"edited",TYPE_MESSAGE_DELETED:"deleted",TYPE_MEMBER_ADDED:"added"},ACTIONS:{MEMBER_ADDED:"added",MEMBER_JOINED:"joined",MEMBER_LEFT:"left",MEMBER_KICKED:"kicked",MEMBER_BANNED:"banned",MEMBER_UNBANNED:"unbanned",MEMBER_INVITED:"invited",MEMBER_SCOPE_CHANGED:"scopeChanged",MESSAGE_EDITED:"edited",MESSSAGE_DELETED:"deleted",TYPE_USER:"user",TYPE_GROUP:"group",TYPE_GROUP_MEMBER:"groupMember"}},K.BlockedUsersConstants={REQUEST_KEYS:{DIRECTIONS:{BOTH:"both",HAS_BLOCKED_ME:"hasBlockedMe",BLOCKED_BY_ME:"blockedByMe"}}},K.CallConstants={CALL_MODE:{DEFAULT:"DEFAULT",SPOTLIGHT:"SPOTLIGHT",SINGLE:"SINGLE",TILE:"TILE",GRID:"GRID"},CALL_TYPE:{AUDIO:"audio",VIDEO:"video"},RECEIVER_TYPE_GROUP:"group",RECEIVER_TYPE_USER:"user",CALL_KEYS:{CALL_DATA:"data",CALL_ID:"id",CALL_SESSION_ID:"sessionid",CALL_RECEIVER:"receiver",CALL_SENDER:"sender",CALL_RECEIVER_TYPE:"receiverType",CALL_STATUS:"status",CALL_TYPE:"type",CALL_INITIATED_AT:"initiatedAt",CALL_JOINED_AT:"joinedAt",CALL_LEFT_AT:"leftAt",CALL_METADATA:"metadata",CALL_ENTITIES:"entities",CALL_ENTITY_TYPE:"entityType",CALL_ENTITY:"entity",CALL_ENTITY_USER:"user",CALL_ENTITY_GROUP:"group"},CALL_STATUS:{INITIATED:"initiated",ONGOING:"ongoing",UNANSWERED:"unanswered",REJECTED:"rejected",BUSY:"busy",CANCELLED:"cancelled",ENDED:"ended"},AUDIO_INPUT_DEVICES:"audioInputDevices",AUDIO_OUTPUT_DEVICES:"audioOutputDevices",VIDEO_INPUT_DEVICES:"videoInputDevices",POST_MESSAGES:{TYPES:{ACTION_MESSAGE:"cometchat_action_message",HANGUP:"hangup",COMETCHAT_RTC_SETTINGS:"cometchat_rtc_settings"},ACTIONS:{USER_JOINED:"onUserJoined",USER_LEFT:"onUserLeft",USER_LIST_CHANGED:"onUserListChanged",INITIAL_DEVICE_LIST:"initialDeviceList",DEVICE_CHANGE:"onDeviceChange",LOAD:"LOAD",CHANGE_AUDIO_INPUT:"changeAudioInput",CHANGE_AUDIO_OUTPUT:"changeAudioOutput",CHANGE_VIDEO_INPUT:"changeVideoInput",MUTE_AUDIO:"muteAudio",UNMUTE_AUDIO:"unMuteAudio",PAUSE_VIDEO:"pauseVideo",UNPAUSE_VIDEO:"unPauseVideo",SWITCH_MODE:"switchMode",START_SCREENSHARE:"startScreenShare",STOP_SCREENSHARE:"stopScreenShare",END_CALL:"endCall",START_RECORDING:"startRecording",STOP_RECORDING:"stopRecording",RECORDING_TOGGLED:"onRecordingToggled",USER_MUTED:"onUserMuted",SCREEN_SHARE_STARTED:"SCREEN_SHARE_STARTED",SCREEN_SHARE_STOPPED:"SCREEN_SHARE_ENDED",SWITCH_TO_VIDEO_CALL:"switchedToVideo",SWITCHED_TO_VIDEO_CALL:"onCallSwitchedToVideo",OPEN_VIRTUAL_BACKGROUND:"openVirtualBackgroundMenu",SET_BACKGROUND_BLUR:"setBackgroundBlur",SET_BACKGROUND_IMAGE:"setBackgroundImage"}},MEDIA_DEVICE:{ID:"id",NAME:"name",ACTIVE:"active"},ZOOM_BUTTON_DEFAULT_PARAMS:{position:"bottom-right",visible:!0},NAME_LABEL_DEFAULT_PARAMS:{position:"bottom-left",visible:!0,color:"rgba(27, 27, 27, 0.4)"},NETWORK_LABEL_DEFAULT_PARAMS:{position:"bottom-right",visible:!0},MAIN_VIDEO_CONTAINER_SETTINGS:{KEYS:{POSITION:"position",VISIBILITY:"visible",COLOR:"color"}}},K.GroupConstants={KEYS:{NAME:"name",GUID:"guid",TYPE:"type",PASSWORD:"password",ICON:"icon",DESCRIPTION:"description",OWNER:"owner",METADATA:"metadata",CREATED_AT:"createdAt",UPDATED_AT:"updatedAt",HAS_JOINED:"hasJoined",WS_CHANNEL:"wsChannel",TAGS:"tags"}},K.GroupMemersConstans={KEYS:{SCOPE:"scope",UID:"uid",GUID:"guid",USER:"user",NAME:"name"}},K.UserConstants={UID:"uid",NAME:"name",AUTH_TOKEN:"authToken",AVATAR:"avatar",LAST_ACTIVE_AT:"lastActiveAt",LINK:"link",META_DATA:"metadata",ROLE:"role",STATUS:"status",STATUS_MESSAGE:"statusMessage",USER_NAME:"user_name",TAGS:"tags",SORT_BY:{NAME:"name",STATUS:"status"},SORT_ORDER:{ASCENDING:"asc",DESCENDING:"desc"}},K.Errors={ERROR_IO_EXCEPTION:"ERROR_IO_EXCEPTION",ERROR_JSON_EXCEPTION:"ERROR_JSON_EXCEPTION",ERROR_PASSWORD_MISSING:"ERROR_PASSWORD_MISSING",ERROR_LIMIT_EXCEEDED:"ERROR_LIMIT_EXCEEDED",ERROR_USER_NOT_LOGGED_IN:"ERROR_USER_NOT_LOGGED_IN",ERROR_INVALID_GUID:"ERROR_INVALID_GUID",ERROR_PASSWORD_MISSING_MESSAGE:"Password is mandatory for a password group",ERROR_LIMIT_EXCEEDED_MESSAGE:"Limit Exceeded Max limit of %s",ERROR_USER_NOT_LOGGED_IN_MESSAGE:"Please log in to CometChat before calling this method",ERROR_INVALID_GUID_MESSAGE:"Please provide a valid GUID",ERROR_DEFAULT_MESSAGE:"Something went wrong",ERR_SETTINGS_HASH_OUTDATED:"ERR_SETTINGS_HASH_OUTDATED",ERR_NO_AUTH:"ERR_NO_AUTH"},K.CALL_ERROR={CALL_ALREADY_INITIATED:{code:"CALL_ALREADY_INITIATED",name:"CALL_ALREADY_INITIATED",message:"There is already call in progress",details:{}},ERROR_IN_CALLING:{code:"CALL_IN_PROGRESS",name:"CALL_ALREADY_INITIATED",message:"There is already call in progress",details:{}},CANNOT_ACCEPT_CALL:{code:"CALL_IN_PROGRESS",name:"CALL_IN_PROGRESS",message:"There is already a call in progress",details:{}},NOT_INITIALIZED:{code:"NOT_INITIALIZED",name:"NOT_INITIALIZED",message:"Please call the CometChat.init() method before calling any other methods related to CometChat.",details:{}},NOT_LOGGED_IN:{code:"NOT_LOGGED_IN",name:"NOT_LOGGED_IN",message:"Please login before starting a call.",details:{}},SESSION_ID_REQUIRED:{code:"SESSION_ID_REQUIRED",name:"SESSION_ID_REQUIRED",message:"Please make sure you are passing correct session id.",details:{}},CALL_SETTINGS_REQUIRED:{code:"CALL_SETTINGS_REQUIRED",name:"CALL_SETTINGS_REQUIRED",message:"Please make sure you are passing the call settings object.",details:{}},JWT_NOT_FOUND:{code:"JWT_NOT_FOUND",name:"JWT_NOT_FOUND",message:"There was some issue while fetching JWT from API.",details:{}}},K.PARAMETER_ERROR={PARAMETER_REQUIRED:{code:"%s_NOT_PROVIDED",name:"%s_NOT_PROVIDED",message:"please provide the %s.",details:{}}},K.GENERAL_ERROR={MUST_BE_A_STRING:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a string.",details:{}},MUST_BE_A_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a number.",details:{}},MUST_BE_A_OBJECT:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a object.",details:{}},MUST_BE_AN_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be an array.",details:{}},MUST_BE_A_BOOLEAN:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a boolean.",details:{}},MUST_BE_A_BLOB:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a blob.",details:{}},INVALID:{code:"INVALID_%s",name:"INVALID_%s",message:"Invalid %s. Please provide a valid %s.",details:{}},METHOD_COMPULSORY:{code:"%s_IS_COMPULSORY",name:"%s_IS_COMPULSORY",message:"%s is required.",details:{}},LIMIT_EXCEEDED:{code:"ERROR_%s_EXCEEDED",name:"ERROR_%s_EXCEEDED",message:"Limit exceeded max limit of %s.",details:{}},MUST_BE_A_POSITIVE_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a postive integer greater than 0.",details:{}},INVALID_MEDIA_FILE:{code:"INVALID_%s",name:"INVALID_%s",message:"The message type does not match the file's mime type.",details:{}},EMPTY_STRING:{code:"INVALID_%s",name:"INVALID_%s",message:"%s cannot be empty.",details:{}},MISSING_KEY:{code:"MISSING_KEY",name:"MISSING_KEY",message:"The key %s is missing from the %s object.",details:{}},EMPTY_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"The parameter %s should be an array and it cannot be empty.",details:{}},INVALID_SEARCH_KEYWORD:{code:"INVALID_SEARCH_KEYWORD",name:"INVALID_SEARCH_KEYWORD",message:"Invalid search keyword. Please provide a valid search keyword.",details:{}},INVALID_GROUP_PROPERTY:{code:"INVALID_%s",name:"INVALID_%s",message:"Invalid %s provided for the group. Please provide a valid %s.",details:{}},INVALID_USER_PROPERTY:{code:"INVALID_%s",name:"INVALID_%s",message:"Invalid %s provided for a user. Please provide a valid %s.",details:{}},PARAMETER_MUST_BE_A_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as a number.",details:{}},PARAMETER_MUST_BE_AN_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as an array.",details:{}},PARAMETER_MUST_BE_A_BOOLEAN:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as a boolean.",details:{}},PARAMETER_MUST_BE_A_POSITIVE_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter to be a positive number greater than 0.",details:{}},PARAMETER_MUST_BE_A_STRING:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as a string.",details:{}},PARAMETER_COMPULSORY:{code:"%s_IS_COMPULSORY",name:"%s_IS_COMPULSORY",message:"%s cannot be blank. Please provide a valid %s.",details:{}},PASSWORD_COMPULSORY:{code:"%s_IS_COMPULSORY",name:"%s_IS_COMPULSORY",message:"Password is mandatory for a password group.",details:{}},INVALID_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"%s",details:{}}},K.ReceiptErrors={MISSING_PARAMETERS:{code:"MISSING_PARAMETERS",name:"MISSING_PARAMETERS",message:"Expected 4 parameters received 3",details:{}},INVALID_PARAMETER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s",details:{}},NO_WEBSOCKET_CONNECTION:{code:"NO_WEBSOCKET_CONNECTION",name:"NO_WEBSOCKET_CONNECTION",message:"Connection to our Websockets server is broken. Please retry after some time.",details:{}},RECEIPTS_TEMPORARILY_BLOCKED:{code:"RECEIPTS_TEMPORARILY_BLOCKED",name:"RECEIPTS_TEMPORARILY_BLOCKED",message:"Due to high load. Receipts have been blocked for your app.",details:{}},UNKNOWN_ERROR_OCCURRED:{code:"UNKNOWN_ERROR_OCCURRED",name:"UNKNOWN_ERROR_OCCURRED",message:"Unknown error occurred while marking a message as read.",details:{}}},K.UserErrors={INVALID_STATUS:new re.CometChatException({code:"INVALID_STATUS_VALUE",name:"INVALID_STATUS_VALUE",message:"The `status` parameter accepts only `online` or `offline`.",details:""}),INVALID_DIRECTION:new re.CometChatException({code:"INVALID_DIRECTION_VALUE",name:"INVALID_DIRECTION_VALUE",message:"The `direction` parameter accepts only `both`, `blockeyByMe` or `hasBlockedMe`.",details:""}),USER_NOT_LOGGED_IN:new re.CometChatException({code:"USER_NOT_LOGGED_IN",name:"USER_NOT_LOGGED_IN",message:"Please log in to CometChat before calling this method.",details:""})},K.GroupErrors={NOT_A_GROUP:new re.CometChatException({code:"NOT_A_GROUP",message:"Please use group class to construct a new group."}),INVALID_SCOPE:new re.CometChatException({code:"INVALID_SCOPE_VALUE",name:"INVALID_SCOPE_VALUE",message:"Scope can be `admin`, `moderator` or `participant`.",details:""}),INVALID_GROUP_TYPE:new re.CometChatException({code:"INVALID_GROUP_TYPE",name:"INVALID_GROUP_TYPE",message:"Group type can be `public`, `private`, `protected` or `password`.",details:""})},K.ConversationErrors={INVALID_CONVERSATION_TYPE:{code:"INVALID_CONVERSATION_TYPE",name:"INVALID_CONVERSATION_TYPE",message:"Conversation type can be `user` or `group`.",details:"Please check the value of conversationType."},CONVERSATION_NOT_FOUND:{code:"CONVERSATION_NOT_FOUND",name:"CONVERSATION_NOT_FOUND",message:"Conversation for %s %s not found.",details:"Please check the value of conversationWith and conversationType."}},K.ExtensionErrors={INVALID_EXTENSION:{code:"ERROR_INVALID_EXTENSION",name:"ERROR_INVALID_EXTENSION",message:"The provided extension cannot be null or empty. Please provide a valid extension.",details:{}},EXTENSION_NOT_FOUND:{code:"ERROR_EXTENSION_NOT_FOUND",name:"ERROR_EXTENSION_NOT_FOUND",message:"The provided extension could not be found.",details:{}}},K.MessageErrors={INVALID_RECEIVER_TYPE:{code:"INVALID_RECEIVER_TYPE",name:"INVALID_RECEIVER_TYPE",message:"Receiver type can be `user` or `group`.",details:"Please check the value of receiverType."}},K.FeatureRestrictionErrors={INVALID_FEATURE:{code:"ERROR_INVALID_FEATURE",name:"ERROR_INVALID_FEATURE",message:"The provided feature cannot be null or empty. Please provide a valid feature.",details:{}},FEATURE_NOT_FOUND:{code:"ERROR_FEATURE_NOT_FOUND",name:"ERROR_FEATURE_NOT_FOUND",message:"The provided feature could not be found.",details:{}}},K.PresenceConstatnts={STATUS:{ONLINE:"online",AVAILABLE:"available",OFFLINE:"offline",JOINED:"JOINED",LEFT:"LEFT"}},K.APP_SETTINGS={APP_SETTINGS:"app_settings",KEYS:{CHAT_HOST:"CHAT_HOST",CHAT_USE_SSL:"CHAT_USE_SSL",GROUP_SERVICE:"GROUP_SERVICE",CALL_SERVICE:"CALL_SERVICE",CHAT_WS_PORT:"CHAT_WS_PORT",CHAT_WSS_PORT:"CHAT_WSS_PORT",CHAT_HTTP_BIND_PORT:"CHAT_HTTP_BIND_PORT",CHAT_HTTPS_BIND_PORT:"CHAT_HTTPS_BIND_PORT",ADMIN_API_HOST:"ADMIN_API_HOST",CLIENT_API_HOST:"CLIENT_API_HOST",WEBRTC_HOST:"WEBRTC_HOST",WEBRTC_USE_SSL:"WEBRTC_USE_SSL",WEBRTC_WS_PORT:"WEBRTC_WS_PORT",WEBRTC_WSS_PORT:"WEBRTC_WSS_PORT",WEBRTC_HTTP_BIND_PORT:"WEBRTC_HTTP_BIND_PORT",WEBRTC_HTTPS_BIND_PORT:"WEBRTC_HTTPS_BIND_PORT",EXTENSION_LIST:"extensions",EXTENSION_KEYS:{ID:"id",NAME:"name"},JID_HOST_OVERRIDE:"JID_HOST_OVERRIDE",CHAT_HOST_OVERRIDE:"CHAT_HOST_OVERRIDE",CHAT_HOST_APP_SPECIFIC:"CHAT_HOST_APP_SPECIFIC",MODE:"MODE",CONNECTION_TYPE:"connection_type",DEFAULT_MODE:"DEFAULT",LIMITED_TRANSIENT:"LIMITED_TRANSIENT",NO_TRANSIENT:"NO_TRANSIENT",POLLING_ENABLED:"POLLING_ENABLED",POLLING_INTERVAL:"POLLING_INTERVAL",ANALYTICS_PING_DISABLED:"ANALYTICS_PING_DISABLED",ANALYTICS_HOST:"ANALYTICS_HOST",ANALYTICS_VERSION:"ANALYTICS_VERSION",ANALYTICS_USE_SSL:"ANALYTICS_USE_SSL",SETTINGS_HASH:"settingsHash",SETTINGS_HASH_RECEIVED_AT:"settingsHashReceivedAt",DENY_FALLBACK_TO_POLLING:"DENY_FALLBACK_TO_POLLING",APP_VERSION:"APP_VERSION",MAIN_DOMAIN:"MAIN_DOMAIN",CHAT_API_VERSION:"CHAT_API_VERSION",WS_API_VERSION:"WS_API_VERSION",REGION:"REGION",EXTENSION_DOMAIN:"EXTENSION_DOMAIN",WEBRTC_API_SUBDOMAIN:"WEBRTC_API_SUBDOMAIN",WEBRTC_WEB_FRONTEND_HOST:"WEBRTC_WEB_FRONTEND_HOST",WEBRTC_WEB_FRONTEND_VERSION:"WEBRTC_WEB_FRONTEND_VERSION"}},K.COMMON_UTILITY_CONSTANTS={TYPE_CONSTANTS:{BOOLEAN:"boolean",STRING:"string",OBJECT:"object",NUMBER:"number"}},K.CONNECTION_STATUS={CONNECTED:"connected",CONNECTING:"connecting",DISCONNECTED:"disconnected",FEATURE_THROTTLED:"featureThrottled"},K.SESSION_STORE={SESSION_ID:"sessionId"},K.API_ERROR_CODES={AUTH_ERR_AUTH_TOKEN_NOT_FOUND:"AUTH_ERR_AUTH_TOKEN_NOT_FOUND"},K.PROSODY_API={DOMAIN_PREFIX:"xmpp",PATH:{ROOM:"room",ROOM_SIZE:"room-size",SESSIONS:"sessions"},RESPONSE:{PARTICIPANTS:"participants"},QUERY_PARAMETERS:{DOMAIN:"domain",ROOM:"room"}},K.ProsodyApiErrors={INVALID_SESSIONID:{code:"ERROR_INVALID_SESSIONID",name:"ERROR_INVALID_SESSIONID",message:"The provided sessionId cannot be null or empty. Please provide a valid sessionId.",details:""},INVALID_TYPE:{code:"ERROR_INVALID_TYPE",name:"ERROR_INVALID_TYPE",message:"The provided type cannot be null or empty. Please provide a valid type.",details:""}},K.JWT_API={KEYS:{PASSTHROUGH:"passthrough",EXPAND:"expand"}},K.ONLINE_MEMBER_COUNT_API={ENDPOINTS:{GET_ONLINE_MEMBER_COUNT:"api/%s/online-members"},RESPONSE:{ONLINE_USERS_COUNT:"onlineUsersCount",GROUPS:"groups"},ERRORS:{INVALID_GROUPLIST:{code:"ERROR_INVALID_GROUPLIST",name:"ERROR_INVALID_GROUPLIST",message:"Grouplist cannot be null or empty.",details:""}}}},function(j,K,$){"use strict";K.__esModule=!0,K.CometChatException=void 0;var o=function(j){null!==j.code&&void 0!==j.code&&""!==j.code&&(this.code=j.code),null!==j.name&&void 0!==j.name&&""!==j.name&&(this.name=j.name),null!==j.message&&void 0!==j.message&&""!==j.message&&(this.message=j.message),null!==j.details&&void 0!==j.details&&""!==j.details&&(this.details=j.details)};K.CometChatException=o},function(j,K,$){"use strict";var ee=this&&this.__assign||function(){return(ee=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)},te=this&&this.__awaiter||function(j,K,$,ee){return new($||($=Promise))((function(te,ne){function o(j){try{r(ee.next(j))}catch(j){ne(j)}}function s(j){try{r(ee.throw(j))}catch(j){ne(j)}}function r(j){var K;j.done?te(j.value):(K=j.value,K instanceof $?K:new $((function(j){j(K)}))).then(o,s)}r((ee=ee.apply(j,K||[])).next())}))},ne=this&&this.__generator||function(j,K){var $,ee,te,ne,re={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return ne={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(ne[Symbol.iterator]=function(){return this}),ne;function e(ne){return function(oe){return function(ne){if($)throw new TypeError("Generator is already executing.");for(;re;)try{if($=1,ee&&(te=2&ne[0]?ee.return:ne[0]?ee.throw||((te=ee.return)&&te.call(ee),0):ee.next)&&!(te=te.call(ee,ne[1])).done)return te;switch(ee=0,te&&(ne=[2&ne[0],te.value]),ne[0]){case 0:case 1:te=ne;break;case 4:return re.label++,{value:ne[1],done:!1};case 5:re.label++,ee=ne[1],ne=[0];continue;case 7:ne=re.ops.pop(),re.trys.pop();continue;default:if(!(te=0<(te=re.trys).length&&te[te.length-1])&&(6===ne[0]||2===ne[0])){re=0;continue}if(3===ne[0]&&(!te||ne[1]>te[0]&&ne[1]<te[3])){re.label=ne[1];break}if(6===ne[0]&&re.label<te[1]){re.label=te[1],te=ne;break}if(te&&re.label<te[2]){re.label=te[2],re.ops.push(ne);break}te[2]&&re.ops.pop(),re.trys.pop();continue}ne=K.call(j,re)}catch(j){ne=[6,j],ee=0}finally{$=te=0}if(5&ne[0])throw ne[1];return{value:ne[0]?ne[1]:void 0,done:!0}}([ne,oe])}}};K.__esModule=!0,K.CometChat=void 0;var re=$(28),oe=$(0),ie=$(2),ae=$(6),se=$(4),le=$(14),ce=$(17),ue=$(7),de=$(16),pe=$(10),ge=$(11),he=$(1),me=$(8),fe=$(15),ye=$(30),be=$(23),ve=$(21),Me=$(31),Ee=$(13),Se=$(20),Ce=$(40),_e=$(41),Te=$(42),Ae=$(43),Ie=$(45),Ne=$(46),Oe=$(25),we=$(26),De=$(36),xe=$(19),je=$(34),Le=$(48),ke=$(49),Pe=$(50),Re=$(35),ze=$(24),Ue=$(18),Ge=$(51),Be=$(52),Ze=$(53),Ye=$(37),He=$(5),We=$(62),Ve=$(29),Fe=$(32),Qe=$(27),Ke=$(63),Je=Ze.WSConnectionHelper.getInstance(),Xe=Ye.ListenerHandlers.getInstance(),qe=function(){function G(j){try{G.appId=j,G.localStorage=le.LocalStorage.getInstance(),G.keyStore=ye.KeyStore.getInstance()}catch(j){oe.Logger.error("CometChat: constructor",j)}}return G.setAuthToken=function(j){try{G.authToken=j}catch(j){oe.Logger.error("CometChat: setAuthToken",j)}},G.prototype.getAuthToken=function(){try{return G.authToken}catch(j){oe.Logger.error("CometChat: getAuthToken",j)}},G.getAppId=function(){try{return G.appId}catch(j){oe.Logger.error("CometChat: getAppId",j)}},G.prototype.getApiKey=function(){try{return G.apiKey}catch(j){oe.Logger.error("CometChat: getApiKey",j)}},G.getMode=function(){try{return G.mode}catch(j){oe.Logger.error("CometChat: getMode",j)}},G.setMode=function(j){try{G.mode=j}catch(j){oe.Logger.error("CometChat: getMode",j)}},G.getSessionId=function(){try{return G.sessionId}catch(j){oe.Logger.error("CometChat: getSessionId",j)}},G.onStorageEvent=function(j){if(document&&!document.hasFocus()){var K=G.appId+":common_store/user";j.key===K&&null===j.newValue&&(G.authToken=void 0,G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer(),Je.WSLogout(),G.pushToLoginListener("","Logout_Success")),j.key===K&&null===j.oldValue&&le.LocalStorage.getInstance().get("user").then((function(j){j&&(G.user=new se.Me(j),G.setAuthToken(G.user.getAuthToken()),j.jwt&&(G.jwt=j.jwt),le.LocalStorage.getInstance().get("app_settings").then((function(j){if(j){if(j.hasOwnProperty(he.APP_SETTINGS.KEYS.APP_VERSION)){var K=parseInt(he.APPINFO.sdkVersion.charAt(1));j[he.APP_SETTINGS.KEYS.APP_VERSION]<K&&(G.appSettings.shouldAutoEstablishSocketConnection()||(G.shouldConnectToWS=!1),G.getInstance().internalRestart(G.user.getAuthToken()))}else G.appSettings.shouldAutoEstablishSocketConnection()||(G.shouldConnectToWS=!1),G.getInstance().internalRestart(G.user.getAuthToken());if(j[he.APP_SETTINGS.KEYS.MODE]&&(G.mode=j[he.APP_SETTINGS.KEYS.MODE]),j[he.APP_SETTINGS.KEYS.SETTINGS_HASH]&&(G.settingsHash=j[he.APP_SETTINGS.KEYS.SETTINGS_HASH]),j[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]&&(G.settingsHashReceivedAt=j[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]),G.isAnalyticsDisabled=!!j[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED],G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.getConnectionStatus()!==he.CONNECTION_STATUS.CONNECTED){var $=new se.User(G.user);G.pushToLoginListener($,"Login_Success"),G.appSettings.shouldAutoEstablishSocketConnection()&&G.WSLogin(G.user)}}})))}))}},G.beforeUnload=function(j){var K=G.getDataFromSessionStorage(he.SESSION_STORE.SESSION_ID);G.removeDataFromSessionStorage(he.SESSION_STORE.SESSION_ID),le.LocalStorage.getInstance().set(he.SESSION_STORE.SESSION_ID,K)},G.didAnalyticsPingStart=function(){try{return G.isAnalyticsPingStarted}catch(j){oe.Logger.error("CometChat: didAnalyticsPingStart",j)}},G.getDataFromSessionStorage=function(j){if(window.sessionStorage)return window.sessionStorage.getItem(j)},G.addDataToSessionStorage=function(j,K){window.sessionStorage&&window.sessionStorage.setItem(j,K)},G.removeDataFromSessionStorage=function(j){window.sessionStorage&&window.sessionStorage.removeItem(j)},G.init=function(j,K){var $=this;return void 0===j&&(j=""),new Promise((function(ee,te){try{"object"==typeof j&&(j.hasOwnProperty("appId")&&(j=j.appId),j.hasOwnProperty("appSettings")&&(K=j.appSettings)),oe.isFalsy(K)?K=(new ke.AppSettingsBuilder).setRegion(ke.AppSettings.REGION_EU).build():K.getRegion()==ke.AppSettings.REGION_PRIVATE&&(K.region=j),$.appSettings=K,oe.isFalsy(j)?te(new ie.CometChatException(Ee.INIT_ERROR.NO_APP_ID)):(window.addEventListener&&(window.addEventListener("storage",G.onStorageEvent,!1),window.addEventListener("beforeunload",G.beforeUnload,!1)),$.initialzed=!0,G.appId=j,G.getInstance(j),le.LocalStorage.getInstance().get(he.SESSION_STORE.SESSION_ID).then((function(K){null==K||null==K?(G.sessionId=he.APPINFO.platform+"-"+he.APPINFO.sdkVersionWithUnderScore+"-"+Ke()+"-"+(new Date).getTime(),G.addDataToSessionStorage(he.SESSION_STORE.SESSION_ID,G.getSessionId()),le.LocalStorage.getInstance().remove(he.SESSION_STORE.SESSION_ID)):(G.sessionId=K.toLocaleString(),le.LocalStorage.getInstance().remove(he.SESSION_STORE.SESSION_ID),G.addDataToSessionStorage(he.SESSION_STORE.SESSION_ID,G.getSessionId())),le.LocalStorage.getInstance().get(he.LOCAL_STORE.KEY_APP_ID).then((function(K){if(null==K||null==K)G.appId=j,G.getInstance(j),le.LocalStorage.getInstance().set(he.LOCAL_STORE.KEY_APP_ID,j),ee(!0);else{var te=K.toLocaleString();te===j?(G.appId=te,G.getInstance(te),le.LocalStorage.getInstance().get(he.LOCAL_STORE.KEY_USER).then((function(j){j?(G.isLoggedOut=!1,G.user=new se.Me(j),G.setAuthToken(G.user.getAuthToken()),j.jwt&&(G.jwt=j.jwt),ee(!0),le.LocalStorage.getInstance().get(he.LOCAL_STORE.KEY_APP_SETTINGS).then((function(j){if(j){if(j.hasOwnProperty(he.APP_SETTINGS.KEYS.APP_VERSION)){var K=parseInt(he.APPINFO.sdkVersion.charAt(1));j[he.APP_SETTINGS.KEYS.APP_VERSION]<K&&($.appSettings.shouldAutoEstablishSocketConnection()||(G.shouldConnectToWS=!1),G.getInstance().internalRestart(G.user.getAuthToken()))}else $.appSettings.shouldAutoEstablishSocketConnection()||(G.shouldConnectToWS=!1),G.getInstance().internalRestart(G.user.getAuthToken());j[he.APP_SETTINGS.KEYS.MODE]&&(G.mode=j[he.APP_SETTINGS.KEYS.MODE]),j[he.APP_SETTINGS.KEYS.SETTINGS_HASH]&&(G.settingsHash=j[he.APP_SETTINGS.KEYS.SETTINGS_HASH]),j[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]&&(G.settingsHashReceivedAt=j[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]),G.isAnalyticsDisabled=!!j[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED],G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!$.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),Je&&!Je.connection&&$.appSettings.shouldAutoEstablishSocketConnection()&&(G.isConnectingFromInit=!0,G.WSLogin(G.user))}}))):ee(!0)}))):$.clearCache().then((function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,Je.WSLogout(),G.appId=j,le.LocalStorage.getInstance().set(he.LOCAL_STORE.KEY_APP_ID,j),G.getInstance(j),ee(!0)}))}ye.KeyStore.getInstance().get(he.LOCAL_STORE.KEY_DEVICE_ID).then((function(K){if(null==K){var $=Ke(),ee=(new Date).getTime(),te=j+"_"+$+"_"+ee;ye.KeyStore.getInstance().set(he.LOCAL_STORE.KEY_DEVICE_ID,te)}}))}))})))}catch(j){te(new ie.CometChatException(j))}}))},G.isInitialized=function(){try{return this.initialzed}catch(j){oe.Logger.error("CometChat: isInitialized",j)}},G.getInstance=function(j){try{return this.cometChat||(this.cometChat=new G(j)),this.cometChat}catch(j){oe.Logger.error("CometChat: getInstance",j)}},G.registerTokenForPushNotification=function(j,K){var $=this;return new Promise((function(ee,te){try{G.keyStore.get(he.LOCAL_STORE.KEY_DEVICE_ID).then((function(ne){G.keyStore.get(he.LOCAL_STORE.KEY_APP_SETTINGS).then((function(re){var oe="",se=ne,le=he.APPINFO.platform,ce=he.APPINFO.sdkVersion,ue=re[he.APP_SETTINGS.KEYS.CHAT_API_VERSION];if(navigator&&(oe=navigator.userAgent),null==se){var de=Ke(),pe=(new Date).getTime();se=$.appId+"_"+de+"_"+pe,G.keyStore.set(he.LOCAL_STORE.KEY_DEVICE_ID,se)}var ge={platform:le,deviceId:se,appInfo:{version:ce,apiVersion:ue,userAgent:oe,pushNotification:{fcmDeviceToken:j,settings:K}}};ae.makeApiCall("updateMyDetails",{},ge,!1).then((function(j){ee("Token Registration successful")}),(function(j){te(new ie.CometChatException(j.error))})).catch((function(j){te(new ie.CometChatException(j))}))}))}))}catch(j){te(new ie.CometChatException(j))}}))},G.pushToLoginListener=function(j,K){Xe.loginHandlers.map((function($){try{if($._eventListener)switch(K){case"Login_Success":oe.isFalsy($._eventListener.loginSuccess)||$._eventListener.loginSuccess(j);break;case"Login_Failure":oe.isFalsy($._eventListener.loginFailure)||$._eventListener.loginFailure(j);break;case"Logout_Success":oe.isFalsy($._eventListener.logoutSuccess)||$._eventListener.logoutSuccess()}}catch($){oe.Logger.error("ConnectionHandlers: onConnected Status",$)}}))},G.login=function(){for(var j=this,K=[],$=0;$<arguments.length;$++)K[$]=arguments[$];return new Promise((function($,ee){try{if(G.loginInProgress){G.isLoggedOut=!0;var te=new ie.CometChatException(Ee.LOGIN_ERROR.REQUEST_IN_PROGRESS);return ee(te)}G.loginInProgress=!0,G.isConnectingFromInit=!1,G.localStorage.get(he.LOCAL_STORE.KEY_APP_ID).then((function(te){if(null==te||null==te){var ne=new ie.CometChatException(Ee.LOGIN_ERROR.NOT_INITIALIZED);return G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne)}var re=te.toLocaleString();if(j.getInstance(re),G.appId=re,le.LocalStorage.getInstance().set(he.LOCAL_STORE.KEY_APP_ID,re),"object"==typeof K[0]){var ae=K[0];K[0].hasOwnProperty("authToken")?K[0]=ae.authToken:K[0].hasOwnProperty("username")&&K[0].hasOwnProperty("apiKey")&&(K[0]=ae.username,K[1]=ae.apiKey)}if(2==K.length){if(oe.isFalsy(K[0])||oe.isFalsy(K[1]))return ne=new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING),G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne)}else{if(1!=K.length)return ne=new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING),G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne);if(oe.isFalsy(K[0]))return ne=new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING),G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne)}return oe.isFalsy(j.getAppId())?(ne=new ie.CometChatException(Ee.LOGIN_ERROR.NOT_INITIALIZED),G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne)):G.localStorage.get(he.LOCAL_STORE.KEY_USER).then((function(te){if(2==K.length){G.apiKey=K[1];var ne=K[0];if(null!=te&&te.uid!==K[0])G.localStorage.clearStore().then((function(){Je.WSLogout(),G.generateAuthToken(ne).then((function(j){G.user=new se.Me(j),G.setAuthToken(G.user.getAuthToken()),G.getLoggedInUser().then((function(j){(G.user=new se.Me(j)).setAuthToken(G.authToken),G.setAuthToken(G.user.getAuthToken());var K=G.user;K.setStatus(he.PresenceConstatnts.STATUS.ONLINE),G.localStorage.set("user",K);var ee=new se.User(K);$(ee),G.isConnectingFromInit||G.internalRestart||G.pushToLoginListener(ee,"Login_Success"),G.loginInProgress=!1,G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.isLoggedOut=!1,(G.appSettings.shouldAutoEstablishSocketConnection()||G.internalRestart)&&G.shouldConnectToWS&&G.WSLogin(G.user)}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}));else{if(!oe.isFalsy(G.authToken)){var re=new se.User(j.user);return G.internalRestart||G.pushToLoginListener(re,"Login_Success"),G.loginInProgress=!1,G.isLoggedOut=!1,$(re)}if(!oe.isFalsy(ne)){if(oe.isFalsy(G.apiKey)){var ae=new ie.CometChatException(Ee.LOGIN_ERROR.UNAUTHORISED);return G.internalRestart||G.pushToLoginListener(ae,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ae)}j.generateAuthToken(ne).then((function(K){j.user=new se.Me(K),j.setAuthToken(G.user.getAuthToken()),j.getLoggedInUser().then((function(K){j.user=new se.Me(K),j.user.setAuthToken(G.authToken),j.setAuthToken(j.user.getAuthToken()),Je.WSLogout();var ee=j.user;ee.setStatus(he.PresenceConstatnts.STATUS.ONLINE),j.localStorage.set("user",ee);var te=new se.User(ee);$(te),G.isConnectingFromInit||G.internalRestart||G.pushToLoginListener(te,"Login_Success"),G.loginInProgress=!1,G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.isLoggedOut=!1,(G.appSettings.shouldAutoEstablishSocketConnection()||G.internalRestart)&&G.shouldConnectToWS&&j.WSLogin(j.user)}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}}}else G.authToken=K[0],j.getLoggedInUser().then((function(ne){if(ne.authToken!=K[0]){var re=j;re.localStorage.clearStore().then((function(){Je.WSLogout(),re.getLoggedInUser().then((function(j){(G.user=new se.Me(j)).setAuthToken(G.authToken),G.setAuthToken(G.user.getAuthToken());var K=G.user;K.setStatus(he.PresenceConstatnts.STATUS.ONLINE),re.localStorage.set("user",K);var ee=new se.User(K);$(ee),G.isConnectingFromInit||G.internalRestart||G.pushToLoginListener(ee,"Login_Success"),G.loginInProgress=!1,G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.isLoggedOut=!1,(G.appSettings.shouldAutoEstablishSocketConnection()||G.internalRestart)&&G.shouldConnectToWS&&G.WSLogin(new se.Me(j))}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}))}else{if(te){var oe=new se.User(ne);return G.internalRestart||G.pushToLoginListener(oe,"Login_Success"),G.loginInProgress=!1,G.isLoggedOut=!1,$(oe)}(G.user=new se.Me(ne)).setAuthToken(G.authToken),G.setAuthToken(G.user.getAuthToken());var ie=G.user;ie.setStatus(he.PresenceConstatnts.STATUS.ONLINE),G.localStorage.set("user",ie);var ae=new se.User(ie);$(ae),G.isConnectingFromInit||G.internalRestart||G.pushToLoginListener(ae,"Login_Success"),G.loginInProgress=!1,G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.isLoggedOut=!1,(G.appSettings.shouldAutoEstablishSocketConnection()||G.internalRestart)&&G.shouldConnectToWS&&G.WSLogin(new se.Me(ne))}}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}))}))}catch(j){return te=new ie.CometChatException(j),G.internalRestart||G.pushToLoginListener(te,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(te)}}))},G.sendMessage=function(j){var K=this;return new Promise((function($,ee){return te(K,void 0,void 0,(function(){var K,re,se,le=this;return ne(this,(function(ue){try{return j instanceof de.TextMessage||j instanceof ce.MediaMessage||j instanceof xe.CustomMessage||(j=j[he.MessageConstatnts.KEYS.ATTATCHMENT]?(K=he.MessageConstatnts.TYPE.FILE,oe.isImage(j[he.MessageConstatnts.KEYS.ATTATCHMENT])?K=he.MessageConstatnts.TYPE.IMAGE:oe.isAudio(j[he.MessageConstatnts.KEYS.ATTATCHMENT])?K=he.MessageConstatnts.TYPE.AUDIO:oe.isVideo(j[he.MessageConstatnts.KEYS.ATTATCHMENT])&&(K=he.MessageConstatnts.TYPE.VIDEO),new ce.MediaMessage(j[he.MessageConstatnts.KEYS.RECEIVER_ID],j[he.MessageConstatnts.KEYS.ATTATCHMENT],K,j[he.MessageConstatnts.KEYS.RECEIVER_TYPE])):new de.TextMessage(j[he.MessageConstatnts.KEYS.RECEIVER_ID],j[he.MessageConstatnts.KEYS.TEXT],j[he.MessageConstatnts.KEYS.RECEIVER_TYPE])),(re=oe.validateMessage(j))instanceof ie.CometChatException?(ee(re),[2]):(j.receiver=j.receiverId,delete j.receiverId,se=j.parentMessageId,[2,ae.makeApiCall(se?"sendMessageInThread":"sendMessage",se?{parentId:se}:{},j,j instanceof ce.MediaMessage).then((function(j){return te(le,void 0,void 0,(function(){var K;return ne(this,(function(ee){return K=pe.MessageController.trasformJSONMessge(j.data),Oe.MessageListnerMaping.getInstance().set("all",parseInt(K.id)),$(K),[2]}))}))}),(function(j){ee(new ie.CometChatException(j.error))}))])}catch(ue){ee(new ie.CometChatException(ue))}return[2]}))}))}))},G.sendDirectMessage=function(j){try{return Object.assign(j,{receiverType:he.MessageConstatnts.RECEIVER_TYPE.USER}),this.sendMessage(j)}catch(j){oe.Logger.error("CometChat: sendDirectMessage",j)}},G.sendGroupMessage=function(j){try{return Object.assign(j,{receiverType:he.MessageConstatnts.RECEIVER_TYPE.GROUP}),this.sendMessage(j)}catch(j){oe.Logger.error("CometChat: sendGroupMessage",j)}},G.sendMediaMessage=function(j){try{return this.sendMessage(j)}catch(j){oe.Logger.error("CometChat: sendMediaMessage",j)}},G.sendCustomMessage=function(j){try{return this.sendMessage(j)}catch(j){oe.Logger.error("CometChat: sendCustomMessage",j)}},G.getLastDeliveredMessageId=function(){return te(this,void 0,void 0,(function(){var j;return ne(this,(function(K){switch(K.label){case 0:return K.trys.push([0,2,,3]),[4,Oe.MessageListnerMaping.getInstance().get(he.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST)];case 1:return[2,K.sent()];case 2:return j=K.sent(),oe.Logger.error("CometChat: getLastDeliveredMessageId",j),[3,3];case 3:return[2]}}))}))},G.startTyping=function(j){try{if(oe.isFalsy(j))return;var K=void 0,$=this.RECEIVER_TYPE.USER,ee={};if(j instanceof we.TypingIndicator)K=j.getReceiverId(),$=j.getReceiverType(),ee=j.getMetadata();else{if(!j.hasOwnProperty(he.TYPING_NOTIFICATION.RECEIVER_ID))return;K=j[he.TYPING_NOTIFICATION.RECEIVER_ID],j.hasOwnProperty(he.TYPING_NOTIFICATION.RECEIVER_TYPE)&&($=j[he.TYPING_NOTIFICATION.RECEIVER_TYPE]),j.hasOwnProperty(he.TYPING_NOTIFICATION.META)&&(ee=j[he.TYPING_NOTIFICATION.META])}if(oe.isFalsy(K))return;if(null==De.TypingNotificationController.getTypingStartedMap(K)){var te=G.getMode();return oe.isFalsy(te)||te&&te!==he.APP_SETTINGS.KEYS.NO_TRANSIENT&&te!==he.APP_SETTINGS.KEYS.LIMITED_TRANSIENT?(Je.startTypingIndicator(K,$,ee),De.TypingNotificationController.addTypingStarted(K),void De.TypingNotificationController.removeTypingEnded(K)):void 0}}catch(j){oe.Logger.error("CometChat: startTyping",j)}},G.endTyping=function(j){try{if(oe.isFalsy(j))return;var K=void 0,$=this.RECEIVER_TYPE.USER,ee={};if(j instanceof we.TypingIndicator)K=j.getReceiverId(),$=j.getReceiverType(),ee=j.getMetadata();else{if(!j.hasOwnProperty(he.TYPING_NOTIFICATION.RECEIVER_ID))return;K=j[he.TYPING_NOTIFICATION.RECEIVER_ID],j.hasOwnProperty(he.TYPING_NOTIFICATION.RECEIVER_TYPE)&&($=j[he.TYPING_NOTIFICATION.RECEIVER_TYPE]),$=$==this.RECEIVER_TYPE.USER?he.WS.CONVERSATION.TYPE.CHAT:he.WS.CONVERSATION.TYPE.GROUP_CHAT,j.hasOwnProperty(he.TYPING_NOTIFICATION.META)&&(ee=j[he.TYPING_NOTIFICATION.META])}if(oe.isFalsy(K))return;if(null==De.TypingNotificationController.getTypingEndedMap(K)){var te=G.getMode();return oe.isFalsy(te)||te&&te!==he.APP_SETTINGS.KEYS.NO_TRANSIENT&&te!==he.APP_SETTINGS.KEYS.LIMITED_TRANSIENT?(Je.pauseTypingIndicator(K,$,ee),De.TypingNotificationController.addTypingEnded(K),void De.TypingNotificationController.removeTypingStarted(K)):void 0}}catch(j){oe.Logger.error("CometChat: endTyping",j)}},G.markAsRead=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];return new Promise((function(K,$){try{var ee=void 0,te=void 0,ne=void 0,re=void 0;if(3===j.length)return $(new ie.CometChatException(he.ReceiptErrors.MISSING_PARAMETERS));if(4===j.length){if(oe.isFalsy(j[0])||"string"!=typeof j[0])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"MESSAGE_ID","MESSAGE_ID","Message ID should be a string."))));if(ee=j[0],oe.isFalsy(j[1])||"string"!=typeof j[1])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"RECEIVER_ID","RECEIVER_ID","Receiver ID should be a string."))));if(te=j[1],oe.isFalsy(j[2])||"string"!=typeof j[2])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver type should be a string."))));if(ne=j[2],oe.isFalsy(j[3])||"string"!=typeof j[3])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"SENDER_ID","SENDER_ID","Sender ID should be a string."))));re=j[3]}else{if(1!==j.length)return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"ARGUMENTS","ARGUMENTS","markAsRead() expects either 1 or 4 arguments."))));if(oe.isFalsy(j[0])||!(j[0]instanceof ue.BaseMessage))return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"MESSAGE","MESSAGE","Invalid message object received."))));var ae=j[0];ee=ae.getId().toString(),te=(ne=ae.getReceiverType())===he.MessageConstatnts.RECEIVER_TYPE.USER?ae.getSender().getUid()===G.user.getUid()?ae.getReceiverId():ae.getSender().getUid():ae.getReceiverId(),re=ae.getSender().getUid()}var se=G.getMode();return oe.isFalsy(se)||se&&se!==he.APP_SETTINGS.KEYS.NO_TRANSIENT&&se!==he.APP_SETTINGS.KEYS.LIMITED_TRANSIENT?G.getConnectionStatus()===he.CONNECTION_STATUS.CONNECTED?(Je.markAsRead(te,ne,ee,re),K()):$(new ie.CometChatException(he.ReceiptErrors.NO_WEBSOCKET_CONNECTION)):$(new ie.CometChatException(he.ReceiptErrors.RECEIPTS_TEMPORARILY_BLOCKED))}catch(K){return oe.Logger.error("CometChat: markAsRead",K),$(new ie.CometChatException(he.ReceiptErrors.UNKNOWN_ERROR_OCCURRED))}}))},G.markAsDelivered=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];return new Promise((function(K,$){try{var ee=void 0,te=void 0,ne=void 0,re=void 0;if(3===j.length)return $(new ie.CometChatException(he.ReceiptErrors.MISSING_PARAMETERS));if(4===j.length){if(oe.isFalsy(j[0])||"string"!=typeof j[0])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"MESSAGE_ID","MESSAGE_ID","Message ID should be a string."))));if(ee=j[0],oe.isFalsy(j[1])||"string"!=typeof j[1])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"RECEIVER_ID","RECEIVER_ID","Receiver ID should be a string."))));if(te=j[1],oe.isFalsy(j[2])||"string"!=typeof j[2])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver type should be a string."))));if(ne=j[2],oe.isFalsy(j[3])||"string"!=typeof j[3])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"SENDER_ID","SENDER_ID","Sender ID should be a string."))));re=j[3]}else{if(1!==j.length)return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"ARGUMENTS","ARGUMENTS","markAsDelivered() expects either 1 or 4 arguments."))));if(oe.isFalsy(j[0])||!(j[0]instanceof ue.BaseMessage))return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"MESSAGE","MESSAGE","Invalid message object received."))));var ae=j[0];ee=ae.getId().toString(),te=(ne=ae.getReceiverType())===he.MessageConstatnts.RECEIVER_TYPE.USER?ae.getSender().getUid()===G.user.getUid()?ae.getReceiverId():ae.getSender().getUid():ae.getReceiverId(),re=ae.getSender().getUid()}var se=G.getMode();return oe.isFalsy(se)||se&&se!==he.APP_SETTINGS.KEYS.NO_TRANSIENT&&se!==he.APP_SETTINGS.KEYS.LIMITED_TRANSIENT?G.getConnectionStatus()===he.CONNECTION_STATUS.CONNECTED?(Je.markAsDelivered(te,ne,ee,re),K()):$(new ie.CometChatException(he.ReceiptErrors.NO_WEBSOCKET_CONNECTION)):$(new ie.CometChatException(he.ReceiptErrors.RECEIPTS_TEMPORARILY_BLOCKED))}catch(K){return oe.Logger.error("CometChat: markAsDelivered",K),$(new ie.CometChatException(he.ReceiptErrors.UNKNOWN_ERROR_OCCURRED))}}))},G.sendTransientMessage=function(j){try{if(oe.isFalsy(j))return;var K=void 0,$=void 0,ee={};if(!(j instanceof Qe.TransientMessage))return;if(K=j.getReceiverId(),$=j.getReceiverType(),ee=j.getData(),oe.isFalsy(K)||oe.isFalsy($))return;var te=G.getMode();return oe.isFalsy(te)||te&&te!==he.APP_SETTINGS.KEYS.NO_TRANSIENT?void Je.sendTransientMessage(K,$,ee):void 0}catch(j){oe.Logger.error("CometChat: sendTransientMessage",j)}},G.sendTestMessage=function(j){return te(this,void 0,void 0,(function(){var K,$;return ne(this,(function(ee){switch(ee.label){case 0:return ee.trys.push([0,3,,4]),(K=j)instanceof ue.BaseMessage?[3,2]:[4,Pe.CometChatHelper.processMessage(j)];case 1:K=ee.sent(),ee.label=2;case 2:return K instanceof de.TextMessage&&Ze.WSConnectionHelper.getInstance().publishMessage(K),[3,4];case 3:return $=ee.sent(),oe.Logger.error("CometChat: sendTestMessage",$),[3,4];case 4:return[2]}}))}))},G.getMessageDetails=function(j){return new Promise((function(K,$){try{oe.isFalsy(j)?$(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING)):ae.makeApiCall("getMessageDetails",{messageId:j}).then((function(j){K(pe.MessageController.trasformJSONMessge(j.data))}),(function(j){oe.Logger.error("CometChat:GetMessageDetails:",j),$(new ie.CometChatException(j.error))}))}catch(j){$(new ie.CometChatException(j))}}))},G.getMessageReceipts=function(j){return new Promise((function(K,$){try{var ee=oe.validateMsgId(j);if(ee instanceof ie.CometChatException)return void $(ee);oe.isFalsy(j)?$(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING)):ae.makeApiCall("getMessageDetails",{messageId:j}).then((function(j){pe.MessageController.getReceiptsFromJSON(j.data).then((function(j){K(j)}),(function(j){$(new ie.CometChatException(j))}))}),(function(j){oe.Logger.error("CometChat:GetMessageDetails:",j),$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getUnreadMessageCount=function(j){void 0===j&&(j=!1);var K=0;return new Promise((function($,ee){try{var te=oe.validateHideMessagesFromBlockedUsers(j);if(te instanceof ie.CometChatException)return void ee(te);j&&(K=1),ae.makeApiCall("getMessages",{},{unread:1,count:1,hideMessagesFromBlockedUsers:K}).then((function(j){var K={},ee={};j.data.map((function(j){j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_TYPE]==he.MessageConstatnts.RECEIVER_TYPE.GROUP?ee[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT]:K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT]})),$({users:K,groups:ee})}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.getUnreadMessageCountForAllUsers=function(j){void 0===j&&(j=!1);var K=0;return new Promise((function($,te){try{var ne=oe.validateHideMessagesFromBlockedUsers(j);if(ne instanceof ie.CometChatException)return void te(ne);j&&(K=1),ae.makeApiCall("getMessages",{},{hideMessagesFromBlockedUsers:K,receiverType:he.MessageConstatnts.RECEIVER_TYPE.USER,unread:1,count:1}).then((function(j){var K={};j.data.map((function(j){K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT]})),$(ee({},K))}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.getUnreadMessageCountForAllGroups=function(j){void 0===j&&(j=!1);var K=0;return new Promise((function($,te){try{var ne=oe.validateHideMessagesFromBlockedUsers(j);if(ne instanceof ie.CometChatException)return void te(ne);j&&(K=1),ae.makeApiCall("getMessages",{},{hideMessagesFromBlockedUsers:K,receiverType:he.MessageConstatnts.RECEIVER_TYPE.GROUP,unread:1,count:1}).then((function(j){var K={};j.data.map((function(j){j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_TYPE]==he.MessageConstatnts.RECEIVER_TYPE.GROUP&&(K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT])})),$(ee({},K))}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.getUnreadMessageCountForUser=function(j,K){void 0===K&&(K=!1);var $=0;return new Promise((function(te,ne){try{var re=oe.validateId(j,"user");if(re instanceof ie.CometChatException)return void ne(re);var se=oe.validateHideMessagesFromBlockedUsers(K);if(se instanceof ie.CometChatException)return void ne(se);K&&($=1),ae.makeApiCall("getUserMessages",{listId:j},{hideMessagesFromBlockedUsers:$,unread:1,count:1,uid:j}).then((function(j){var K={};j.data.map((function(j){K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT]})),te(ee({},K))}),(function(j){ne(new ie.CometChatException(j.error))}))}catch(re){ne(new ie.CometChatException(re))}}))},G.getUnreadMessageCountForGroup=function(j,K){void 0===K&&(K=!1);var $=0;return new Promise((function(te,ne){try{var re=oe.validateId(j,"group");if(re instanceof ie.CometChatException)return void ne(re);var se=oe.validateHideMessagesFromBlockedUsers(K);if(se instanceof ie.CometChatException)return void ne(se);K&&($=1),ae.makeApiCall("getGroupMessages",{listId:j},{hideMessagesFromBlockedUsers:$,unread:1,count:1,guid:j}).then((function(j){var K={};j.data.map((function(j){j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_TYPE]==he.MessageConstatnts.RECEIVER_TYPE.GROUP&&(K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT])})),te(ee({},K))}),(function(j){ne(new ie.CometChatException(j.error))}))}catch(re){ne(new ie.CometChatException(re))}}))},G.editMessage=function(j){return new Promise((function(K,$){try{var ee=oe.validateMsgId(j.getId());if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("updateMessage",{messageId:j.getId()},j).then((function(j){K(pe.MessageController.trasformJSONMessge(j.data).getActionOn())}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.deleteMessage=function(j){return new Promise((function(K,$){try{var ee=oe.validateMsgId(j);if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("deleteMessage",{messageId:j},{id:j}).then((function(j){K(pe.MessageController.trasformJSONMessge(j.data).getActionOn())}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getOnlineUserCount=function(){return new Promise((function(j,K){try{oe.getAppSettings().then((function($){var ee=oe.format((new re.EndpointFactory).wsApi,oe.getChatHost($),oe.format(he.ONLINE_MEMBER_COUNT_API.ENDPOINTS.GET_ONLINE_MEMBER_COUNT,$[he.APP_SETTINGS.KEYS.WS_API_VERSION])),te={appId:G.appId,Authorization:G.jwt,Accept:"application/json","Content-Type":"application/json"};ae.postData(ee,"POST",{},te,!1).then((function(j){return j.json()})).then((function($){return $.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA)?j($[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA][he.ONLINE_MEMBER_COUNT_API.RESPONSE.ONLINE_USERS_COUNT]):K(new ie.CometChatException($.error))})).catch((function(){var j={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};return K(j)}))}),(function(j){return K(new ie.CometChatException(j))}))}catch(j){return K(new ie.CometChatException(j))}}))},G.getOnlineGroupMemberCount=function(j){return new Promise((function(K,$){try{if(!j||0==j.length)return $(new ie.CometChatException(he.ONLINE_MEMBER_COUNT_API.ERRORS.INVALID_GROUPLIST));oe.getAppSettings().then((function(ee){var te=oe.format((new re.EndpointFactory).wsApi,oe.getChatHost(ee),oe.format(he.ONLINE_MEMBER_COUNT_API.ENDPOINTS.GET_ONLINE_MEMBER_COUNT,ee[he.APP_SETTINGS.KEYS.WS_API_VERSION])),ne={groups:j},se={appId:G.appId,Authorization:G.jwt,Accept:"application/json","Content-Type":"application/json"};ae.postData(te,"POST",ne,se,!1).then((function(j){return j.json()})).then((function(j){return j.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA)?K(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA][he.ONLINE_MEMBER_COUNT_API.RESPONSE.GROUPS]):$(new ie.CometChatException(j.error))})).catch((function(){var j={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};return $(j)}))}),(function(j){return $(new ie.CometChatException(j))}))}catch(j){return $(new ie.CometChatException(j))}}))},G.createUser=function(j,K){return new Promise((function($,ee){try{if(oe.isFalsy(K))return void ee(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.GENERAL_ERROR.INVALID),"AUTH_KEY","AUTH_KEY","AUTH_KEY","AUTH_KEY"))));G.apiKey=K;var te=oe.validateCreateUser(j);if(te instanceof ie.CometChatException)return void ee(te);if(!(j instanceof se.User)){var ne=void 0;if(!j.hasOwnProperty(he.UserConstants.UID))return void ee(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));if(!j.hasOwnProperty(he.UserConstants.NAME))return void ee(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));ne=new se.User(j[he.UserConstants.UID],j[he.UserConstants.NAME]),j.hasOwnProperty(he.UserConstants.AVATAR)&&ne.setAvatar(j[he.UserConstants.AVATAR]),j.hasOwnProperty(he.UserConstants.ROLE)&&ne.setRole(j[he.UserConstants.ROLE]),j.hasOwnProperty(he.UserConstants.META_DATA)&&ne.setMetadata(j[he.UserConstants.META_DATA]),j.hasOwnProperty(he.UserConstants.LINK)&&ne.setLink(j[he.UserConstants.LINK]),j.hasOwnProperty(he.UserConstants.STATUS_MESSAGE)&&ne.setStatusMessage(j[he.UserConstants.STATUS_MESSAGE]),j.hasOwnProperty(he.UserConstants.TAGS)&&ne.setTags(j[he.UserConstants.TAGS]),j=ne}ae.makeApiCall("createUser",{},j).then((function(j){var K=ge.UsersController.trasformJSONUser(j.data);$(K)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.updateUser=function(j,K){var $=this;return new Promise((function(ee,te){try{if(oe.isFalsy(K))return void te(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.GENERAL_ERROR.INVALID),"AUTH_KEY","AUTH_KEY","AUTH_KEY","AUTH_KEY"))));G.apiKey=K;var ne=oe.validateUpdateUser(j);if(ne instanceof ie.CometChatException)return void te(ne);if(!(j instanceof se.User)){var re=void 0;if(!j.hasOwnProperty(he.UserConstants.UID))return void te(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));re=new se.User(j[he.UserConstants.UID]),j.hasOwnProperty(he.UserConstants.NAME)&&re.setName(j[he.UserConstants.NAME]),j.hasOwnProperty(he.UserConstants.AVATAR)&&re.setAvatar(j[he.UserConstants.AVATAR]),j.hasOwnProperty(he.UserConstants.ROLE)&&re.setRole(j[he.UserConstants.ROLE]),j.hasOwnProperty(he.UserConstants.META_DATA)&&re.setMetadata(j[he.UserConstants.META_DATA]),j.hasOwnProperty(he.UserConstants.LINK)&&re.setLink(j[he.UserConstants.LINK]),j.hasOwnProperty(he.UserConstants.STATUS_MESSAGE)&&re.setStatusMessage(j[he.UserConstants.STATUS_MESSAGE]),j.hasOwnProperty(he.UserConstants.TAGS)&&re.setTags(j[he.UserConstants.TAGS]),j=re}var ce=j.uid;ae.makeApiCall("updateUser",{uid:ce},j).then((function(j){if($.user&&ce.toLocaleLowerCase()===$.user.getUid().toLocaleLowerCase())le.LocalStorage.getInstance().get("user").then((function(K){if(K){var te=ge.UsersController.trasformJSONUser(j.data),ne=j.data;ne.wsChannel=K.wsChannel,ne.authToken=G.authToken,ne.status=he.PresenceConstatnts.STATUS.ONLINE,K.jwt&&(ne.jwt=K.jwt),G.user=new se.Me(ne),$.localStorage.set("user",G.user),ee(te)}}));else{var K=ge.UsersController.trasformJSONUser(j.data);ee(K)}}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.updateCurrentUserDetails=function(j){var K=this;return new Promise((function($,ee){try{j.uid=K.user.uid;var te=oe.validateUpdateUser(j);if(te instanceof ie.CometChatException)return void ee(te);if(!(j instanceof se.User)){var ne=void 0;j.hasOwnProperty(he.UserConstants.UID)&&(ne=new se.User(j[he.UserConstants.UID])),j.hasOwnProperty(he.UserConstants.NAME)&&ne.setName(j[he.UserConstants.NAME]),j.hasOwnProperty(he.UserConstants.AVATAR)&&ne.setAvatar(j[he.UserConstants.AVATAR]),j.hasOwnProperty(he.UserConstants.ROLE)&&ne.setRole(j[he.UserConstants.ROLE]),j.hasOwnProperty(he.UserConstants.META_DATA)&&ne.setMetadata(j[he.UserConstants.META_DATA]),j.hasOwnProperty(he.UserConstants.LINK)&&ne.setLink(j[he.UserConstants.LINK]),j.hasOwnProperty(he.UserConstants.STATUS_MESSAGE)&&ne.setStatusMessage(j[he.UserConstants.STATUS_MESSAGE]),j.hasOwnProperty(he.UserConstants.TAGS)&&ne.setTags(j[he.UserConstants.TAGS]),j=ne}ae.makeApiCall("updateMyDetails",{},j).then((function(j){var K=ge.UsersController.trasformJSONUser(j.data),ee=G.user=new se.Me(j.data);ee.setStatus(he.PresenceConstatnts.STATUS.ONLINE),G.localStorage.set("user",ee),$(K)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.getUser=function(j){return new Promise((function(K,$){try{"object"==typeof j&&j.hasOwnProperty("uid")&&(j=j.uid);var ee=oe.validateId(j,"user");if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("user",{uid:j}).then((function(j){var $=ge.UsersController.trasformJSONUser(j.data);K($)})).catch((function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getLoggedInUser=function(){var j=this;return new Promise((function(K,$){try{G.localStorage.get(he.LOCAL_STORE.KEY_USER).then((function(ee){if(ee)K(G.user=new se.Me(ee));else{var te="",ne="",re=he.APPINFO.platform,ce=he.APPINFO.sdkVersion,ue=he.APPINFO.apiVersion;G.keyStore.get(he.LOCAL_STORE.KEY_DEVICE_ID).then((function(ee){if(ne=ee,navigator&&(te=navigator.userAgent),null==ne){var de=Ke(),pe=(new Date).getTime();ne=j.appId+"_"+de+"_"+pe,G.keyStore.set(he.LOCAL_STORE.KEY_DEVICE_ID,ne)}var ge={version:ce,apiVersion:ue,userAgent:te};oe.isFalsy(j.platform)||(ge.platform=j.platform),oe.isFalsy(j.language)||(ge.language=j.language),oe.isFalsy(j.resource)||(ge.resource=j.resource);var me={platform:re,deviceId:ne,appInfo:ge};ae.makeApiCall("updateMyDetails",{},me,!1).then((function(j){j.data.jwt&&(G.jwt=j.data.jwt);var $=j.data.settings;$&&(le.LocalStorage.getInstance().set("app_settings",$),$[he.APP_SETTINGS.KEYS.MODE]&&G.setMode($[he.APP_SETTINGS.KEYS.MODE]),$[he.APP_SETTINGS.KEYS.SETTINGS_HASH]&&(G.settingsHash=$[he.APP_SETTINGS.KEYS.SETTINGS_HASH]),$[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]&&(G.settingsHashReceivedAt=$[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]),G.isAnalyticsDisabled=!!$[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED]),K(new se.Me(j.data))}),(function(j){$(new ie.CometChatException(j.error))})).catch((function(j){$(new ie.CometChatException(j))}))}))}}))}catch(j){$(new ie.CometChatException(j))}}))},G.getLoggedinUser=function(){return new Promise((function(j,K){try{G.localStorage.get(he.LOCAL_STORE.KEY_USER).then((function(K){j(K?new se.User(K):null)}),(function(K){j(null)}))}catch(j){K(new ie.CometChatException(j))}}))},G.blockUsers=function(j){return new Promise((function(K,$){try{var ee=oe.validateArray(j,"blockUsers");if(ee instanceof ie.CometChatException)return void $(ee);oe.isFalsy(j)?$(new ie.CometChatException(Ee.USERS_REQUEST_ERRORS.EMPTY_USERS_LIST)):ae.makeApiCall("blockUsers",{},{blockedUids:j}).then((function(j){K(j.data)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.unblockUsers=function(j){return new Promise((function(K,$){try{var ee=oe.validateArray(j,"unblockUsers");if(ee instanceof ie.CometChatException)return void $(ee);oe.isFalsy(j)?$(new ie.CometChatException(Ee.USERS_REQUEST_ERRORS.EMPTY_USERS_LIST)):ae.makeApiCall("unblockUsers",{},{blockedUids:j}).then((function(j){K(j.data)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getConversation=function(j,K){return new Promise((function($,ee){try{var te=oe.validateConversationType(K);if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(j,K);if(ne instanceof ie.CometChatException)return void ee(ne);K=K.toLowerCase(),j=j.toLowerCase();var re={},se="";K===he.MessageConstatnts.RECEIVER_TYPE.GROUP?(se="getGroupConversation",re.guid=j):(se="getUserConversation",re.uid=j),ae.makeApiCall(se,re).then((function(te){if(te.data){var ne=te.data;$(ze.ConversationController.trasformJSONConversation(ne.conversationId,ne.conversationType,ne.lastMessage,ne.conversationWith,parseInt(ne.unreadMessageCount),ne.tags?ne.tags:[]))}else ee(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ConversationErrors.CONVERSATION_NOT_FOUND),K,j))))}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.tagConversation=function(j,K,$){return void 0===$&&($=[]),new Promise((function(ee,te){try{var ne=oe.validateConversationType(K);if(ne instanceof ie.CometChatException)return void te(ne);var re=oe.validateId(j,K);if(re instanceof ie.CometChatException)return void te(re);K=K.toLowerCase(),j=j.toLowerCase();var se={},le="";K===he.MessageConstatnts.RECEIVER_TYPE.GROUP?(le="updateGroupConversation",se.guid=j):(le="updateUserConversation",se.uid=j),ae.makeApiCall(le,se,{tags:$}).then((function($){if($.data){var ne=$.data;ee(ze.ConversationController.trasformJSONConversation(ne.conversationId,ne.conversationType,ne.lastMessage,ne.conversationWith,parseInt(ne.unreadMessageCount),ne.tags?ne.tags:[]))}else te(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ConversationErrors.CONVERSATION_NOT_FOUND),K,j))))}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.deleteConversation=function(j,K){return new Promise((function($,ee){try{var te=oe.validateConversationType(K);if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(j,K);if(ne instanceof ie.CometChatException)return void ee(ne);var re={},se="";K=K.toLowerCase(),j=j.toLowerCase(),K===he.MessageConstatnts.RECEIVER_TYPE.GROUP?(se="deleteGroupConversation",re.guid=j):(se="deleteUserConversation",re.uid=j),ae.makeApiCall(se,re).then((function(j){$("Conversation deleted successfully.")}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.createGroup=function(j){return new Promise((function(K,$){try{var ee=oe.validateCreateGroup(j);if(ee instanceof ie.CometChatException)return void $(ee);if(!(j instanceof me.Group)){var te=void 0;if(!j.hasOwnProperty(he.GroupConstants.KEYS.GUID))return void $(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));if(!j.hasOwnProperty(he.GroupConstants.KEYS.NAME))return void $(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));if(te=new me.Group(j[he.GroupConstants.KEYS.GUID],j[he.GroupConstants.KEYS.NAME],""),j.hasOwnProperty(he.GroupConstants.KEYS.TYPE))if(j[he.GroupConstants.KEYS.TYPE].toLocaleLowerCase()==he.GroupType.Password){if(!j.hasOwnProperty(he.GroupConstants.KEYS.PASSWORD))return void $(new ie.CometChatException(Ee.GROUP_CREATION_ERRORS.EMPTY_PASSWORD));te.setType(he.GROUP_TYPE.PASSWORD),te.setPassword(j[he.GroupConstants.KEYS.PASSWORD])}else te.setType(j[he.GroupConstants.KEYS.TYPE]);else te.setType(he.GROUP_TYPE.PUBLIC);j.hasOwnProperty(he.GroupConstants.KEYS.ICON)&&te.setIcon(j[he.GroupConstants.KEYS.ICON]),j.hasOwnProperty(he.GroupConstants.KEYS.DESCRIPTION)&&te.setDescription(j[he.GroupConstants.KEYS.DESCRIPTION]),j.hasOwnProperty(he.GroupConstants.KEYS.TAGS)&&te.setTags(j[he.GroupConstants.KEYS.TAGS]),j=te}ae.makeApiCall("createGroup",{},j).then((function(j){fe.GroupsController.trasformJSONGroup(j.data).setHasJoined(!0),K(fe.GroupsController.trasformJSONGroup(j.data))}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getGroup=function(j){return new Promise((function(K,$){try{"object"==typeof j&&j.hasOwnProperty("guid")&&(j=j.guid);var ee=oe.validateId(j,"group");if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("getGroup",{guid:j}).then((function(j){K(fe.GroupsController.trasformJSONGroup(j.data))}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.joinGroup=function(j,K,$){return void 0===K&&(K=he.GroupType.Public),void 0===$&&($=""),new Promise((function(ee,te){try{var ne=oe.validateJoinGroup(j,K,$);if(ne instanceof ie.CometChatException)return void te(ne);var re=void 0;"object"==typeof j&&(j.hasOwnProperty(he.GroupConstants.KEYS.GUID)?(j.hasOwnProperty(he.GroupConstants.KEYS.TYPE)&&(K=j[he.GroupConstants.KEYS.TYPE],j[he.GroupConstants.KEYS.TYPE].toLocaleLowerCase()===he.GroupType.Password&&j.hasOwnProperty(he.GroupConstants.KEYS.PASSWORD)&&($=j[he.GroupConstants.KEYS.PASSWORD])),j=j[he.GroupConstants.KEYS.GUID]):te(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING))),re=oe.isFalsy($)?new me.Group(j,"name",K):new me.Group(j,"name",K,$),ae.makeApiCall("joinGroup",re,re).then((function(j){var K=fe.GroupsController.trasformJSONGroup(j.data[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA][he.ActionConstatnts.ACTION_KEYS.ENTITIES][he.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][he.ActionConstatnts.ACTION_KEYS.ENTITY]);K.setHasJoined(!0),ee(K)}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.updateGroup=function(j){return new Promise((function(K,$){try{var ee=oe.validateUpdateGroup(j);if(ee instanceof ie.CometChatException)return void $(ee);if(!(j instanceof me.Group)){var te=void 0;if(!j.hasOwnProperty(he.GroupConstants.KEYS.GUID))return void $(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));te=new me.Group(he.GroupConstants.KEYS.GUID,"",""),j.hasOwnProperty(he.GroupConstants.KEYS.TYPE)?te.setType(j[he.GroupConstants.KEYS.TYPE]):(j[he.GroupConstants.KEYS.TYPE]=he.GROUP_TYPE.PUBLIC,te.setType[he.GROUP_TYPE.PUBLIC]),j.hasOwnProperty(he.GroupConstants.KEYS.NAME)&&te.setName(j[he.GroupConstants.KEYS.NAME]),j.hasOwnProperty(he.GroupConstants.KEYS.ICON)&&te.setIcon(j[he.GroupConstants.KEYS.ICON]),j.hasOwnProperty(he.GroupConstants.KEYS.DESCRIPTION)&&te.setDescription(j[he.GroupConstants.KEYS.DESCRIPTION]),j.hasOwnProperty(he.GroupConstants.KEYS.TAGS)&&te.setTags(j[he.GroupConstants.KEYS.TAGS]),j=te}ae.makeApiCall("updateGroup",j,j).then((function(j){K(fe.GroupsController.trasformJSONGroup(j.data))}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.deleteGroup=function(j){return new Promise((function(K,$){try{var ee=oe.validateId(j,"group");if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("deleteGroup",{guid:j}).then((function(j){K(!0)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.leaveGroup=function(j){return new Promise((function(K,$){try{var ee=oe.validateId(j,"group");if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("leaveGroup",{guid:j}).then((function(j){K(!0)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.kickGroupMember=function(j,K){return new Promise((function($,ee){try{var te=oe.validateId(j,"group");if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(K,"user");if(ne instanceof ie.CometChatException)return void ee(ne);ae.makeApiCall("kickGroupMembers",{guid:j,uid:K}).then((function(j){$(!0)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.updateGroupMemberScope=function(j,K,$){return new Promise((function(ee,te){try{var ne=oe.validateId(j,"group");if(ne instanceof ie.CometChatException)return void te(ne);var re=oe.validateId(K,"user");if(re instanceof ie.CometChatException)return void te(re);var se=oe.validateScope($);if(se instanceof ie.CometChatException)return void te(se);ae.makeApiCall("changeScopeOfMember",{guid:j,uid:K},{scope:$}).then((function(j){ee(!0)}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.banGroupMember=function(j,K){return new Promise((function($,ee){try{var te=oe.validateId(j,"group");if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(K,"user");if(ne instanceof ie.CometChatException)return void ee(ne);ae.makeApiCall("banGroupMember",{guid:j,uid:K}).then((function(j){$(!0)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.unbanGroupMember=function(j,K){return new Promise((function($,ee){try{var te=oe.validateId(j,"group");if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(K,"user");if(ne instanceof ie.CometChatException)return void ee(ne);ae.makeApiCall("unbanGroupMember",{guid:j,uid:K}).then((function(j){$(!0)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.addMembersToGroup=function(j,K,$){var te=[],ne=[],re=[],se=[];return new Promise((function(le,ce){try{var ue=oe.validateId(j,"group");if(ue instanceof ie.CometChatException)return void ce(ue);var de=oe.validateArray(K,"groupMembers");if(de instanceof ie.CometChatException)return void ce(de);if($){var pe=oe.validateArray($,"bannedMembers");if(pe instanceof ie.CometChatException)return void ce(pe)}oe.isFalsy(K)&&oe.isFalsy($)?ce(new ie.CometChatException({})):oe.isFalsy(K)||oe.isFalsy($)?oe.isFalsy(K)?$.map((function(j){se.push(j)})):(K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.ADMIN)return!0})).map((function(j){te.push(j.getUid())})),K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.MODERATOR)return!0})).map((function(j){ne.push(j.getUid())})),K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.PARTICIPANT)return!0})).map((function(j){re.push(j.getUid())}))):(K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.ADMIN)return!0})).map((function(j){te.push(j.getUid())})),K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.MODERATOR)return!0})).map((function(j){ne.push(j.getUid())})),K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.PARTICIPANT)return!0})).map((function(j){re.push(j.getUid())})),$.map((function(j){se.push(j)})));var ge={};oe.isFalsy(te)||(ge=ee(ee({},ge),{admins:te})),oe.isFalsy(re)||(ge=ee(ee({},ge),{participants:re})),oe.isFalsy(ne)||(ge=ee(ee({},ge),{moderators:ne})),oe.isFalsy(se)||(ge=ee(ee({},ge),{usersToBan:se})),ae.makeApiCall("addMemebersToGroup",{guid:j},ge).then((function(j){var K={};Object.keys(j.data.admins).map((function($){j.data.admins[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K[$]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K[$]=j.data.admins[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys(j.data.participants).map((function($){j.data.participants[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K[$]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K[$]=j.data.participants[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys(j.data.moderators).map((function($){j.data.moderators[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K[$]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K[$]=j.data.moderators[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys(j.data.usersToBan).map((function($){j.data.usersToBan[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K[$]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K[$]=j.data.usersToBan[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),le(K)}),(function(j){ce(new ie.CometChatException(j.error))}))}catch(le){ce(new ie.CometChatException(le))}}))},G.transferGroupOwnership=function(j,K){return new Promise((function($,ee){try{var te=oe.validateId(j,"group");if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(K,"user");if(ne instanceof ie.CometChatException)return void ee(ne);ae.makeApiCall("transferOwnership",{guid:j},{owner:K}).then((function(ee){var te;te=ee&&ee.data&&ee.data.message?ee.data.message:"Ownership transferred to user "+K+" for the group with guid "+j+".",$(te)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.createGroupWithMembers=function(j,K,$){var te=[],ne=[],re=[],se=[];return new Promise((function(le,ce){try{var ue=oe.validateCreateGroup(j);if(ue instanceof ie.CometChatException)return void ce(ue);if(K&&0<K.length){var de=oe.validateArray(K,"groupMembers");if(de instanceof ie.CometChatException)return void ce(de);K.map((function(j){j.getScope()===he.GROUP_MEMBER_SCOPE.ADMIN&&te.push(j.getUid()),j.getScope()===he.GROUP_MEMBER_SCOPE.MODERATOR&&ne.push(j.getUid()),j.getScope()===he.GROUP_MEMBER_SCOPE.PARTICIPANT&&re.push(j.getUid())}))}if($&&0<$.length){var pe=oe.validateArray($,"bannedMembers");if(pe instanceof ie.CometChatException)return void ce(pe);$.map((function(j){se.push(j)}))}var ge={};ge=ee({},j),oe.isFalsy(te)||(ge.members=ee(ee({},ge.members),{admins:te})),oe.isFalsy(re)||(ge.members=ee(ee({},ge.members),{participants:re})),oe.isFalsy(ne)||(ge.members=ee(ee({},ge.members),{moderators:ne})),oe.isFalsy(se)||(ge.members=ee(ee({},ge.members),{usersToBan:se})),ae.makeApiCall("createGroup",{},ge).then((function(j){var K={members:{}},$=j.data.members.data?j.data.members.data:{admins:{},moderators:{},participants:{},usersToBan:{}};Object.keys($.admins).map((function(j){$.admins[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K.members[j]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K.members[j]=$.admins[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys($.participants).map((function(j){$.participants[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K.members[j]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K.members[j]=$.participants[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys($.moderators).map((function(j){$.moderators[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K.members[j]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K.members[j]=$.moderators[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys($.usersToBan).map((function(j){$.usersToBan[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K.members[j]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K.members[j]=$.usersToBan[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),delete j.data.members;var te=j.data,ne=fe.GroupsController.trasformJSONGroup(te);ne.setHasJoined(!0),K=ee(ee({},K),{group:ne}),le(K)}),(function(j){ce(new ie.CometChatException(j.error))}))}catch(ue){ce(new ie.CometChatException(ue))}}))},G.initiateCall=function(j){var K=this;return new Promise((function($,ee){var te=K.getActiveCall();if(null===te)try{oe.isFalsy(JSON.parse(JSON.stringify(j)).sender)?oe.isFalsy(te)?(j.setStatus(he.CallConstants.CALL_STATUS.INITIATED),j.receiver=j.receiverId.toString(),delete j.receiverId,ae.makeApiCall("createCallSession",{},j).then((function(j){var K=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);Me.CallController.getInstance().initiateCall(K).then((function(j){$(K)})).catch((function(j){ee(new ie.CometChatException(j))}))}),(function(j){ee(new ie.CometChatException(j.error))}))):ee(new ie.CometChatException(he.CALL_ERROR.ERROR_IN_CALLING)):Me.CallController.getInstance().initiateCall(j).then((function(K){$(Object.assign(j))})).catch((function(j){ee(new ie.CometChatException(j))}))}catch(te){ee(new ie.CometChatException(te))}else ee(new ie.CometChatException(he.CALL_ERROR.CALL_ALREADY_INITIATED))}))},G.acceptCall=function(j){var K=this;return new Promise((function($,ee){if(null===K.getActiveCall())try{var te={};te[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.ONGOING,ae.makeApiCall("updateCallSession",{sessionid:j},te).then((function(j){var K=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);Me.CallController.getInstance().onCallStarted(K),$(K)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}else ee(new ie.CometChatException(he.CALL_ERROR.CANNOT_ACCEPT_CALL))}))},G.rejectCall=function(j,K){try{switch(K){case he.CallConstants.CALL_STATUS.REJECTED:return this.rejectIncomingCall(j);case he.CallConstants.CALL_STATUS.CANCELLED:return this.cancelCall(j);case he.CallConstants.CALL_STATUS.BUSY:return this.sendBusyResponse(j);default:return this.endCall(j,!0)}}catch(j){oe.Logger.error("CometChat: rejectCall",j)}},G.endCall=function(j,K){var $=this;return new Promise((function(ee,te){oe.isFalsy(K)&&(K=!1);var ne=$.getActiveCall();if(null!==ne){if(ne.getSessionId()===j)try{var re={};re[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.ENDED,ne.getJoinedAt()&&(re[he.CallConstants.CALL_KEYS.CALL_JOINED_AT]=ne.getJoinedAt()),ae.makeApiCall("updateCallSession",{sessionid:j},re).then((function(j){K||Me.CallController.getInstance().endSession();var $=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);ee($),Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onCallEnded($),Me.CallController.getInstance().endCall()}),(function(j){oe.Logger.log("calling Log",{error:j}),K||Me.CallController.getInstance().endSession(),ne.setStatus(he.CallConstants.CALL_STATUS.ENDED),ee(ne),Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onCallEnded(ne),Me.CallController.getInstance().endCall()}))}catch(re){te(new ie.CometChatException(re))}}else K||Me.CallController.getInstance().endSession(),ee(null),Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onCallEnded(null),Me.CallController.getInstance().endCall()}))},G.getActiveCall=function(){try{return Me.CallController.getInstance().getActiveCall()}catch(j){oe.Logger.error("CometChat: getActiveCall",j)}},G.startCall=function(j,K,$){var ee=this;try{var te,ne,re,ae,se,le,ce,ue,de,pe,ge=this.getActiveCall(),me=!1,fe=!0,ye=!0,be=!0,ve=!0,Ee=!0,Se=!0,Ce=!1,_e=!1,Te=he.CallConstants.CALL_MODE.DEFAULT,Ae=!1,Ie=!1,Ne=!1,Oe=!0,we=!0,De={},xe=this.user;ae=(new Ge.VirtualBackgroundBuilder).build(),se=new Ge.MainVideoContainerSetting,oe.getAppSettings().then((function(je){if(ue=je[he.APP_SETTINGS.KEYS.WEBRTC_HOST],De[he.APP_SETTINGS.KEYS.ANALYTICS_HOST]=je[he.APP_SETTINGS.KEYS.ANALYTICS_HOST],De[he.APP_SETTINGS.KEYS.ANALYTICS_VERSION]=je[he.APP_SETTINGS.KEYS.ANALYTICS_VERSION],De[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED]=je[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED],De[he.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL]=je[he.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL],le=je[he.APP_SETTINGS.KEYS.REGION],oe.isFalsy($)||Me.CallController.getInstance().setCallListner($),oe.isFalsy(ee.appSettings))Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.NOT_INITIALIZED));else if(le)if(xe)if((pe=new Be.RTCUser(xe.getUid())).setName(xe.getName()),pe.setAvatar(xe.getAvatar()),pe.setResource(G.getSessionId()),G.appId)if(ce=G.appId,"string"==typeof j){if(ge){var Le=ge.getType();me=Le===he.CallConstants.CALL_TYPE.AUDIO,ne=ge.getSessionId()}else{if(oe.isFalsy(j))return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.SESSION_ID_REQUIRED)));ne=("v1."+le+"."+G.getAppId()+"."+j).toLowerCase()}if(!ne)return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.SESSION_ID_REQUIRED)));Oe=!!me;var ke={uid:xe.getUid(),sessionId:ne};G.getJWT(ke).then((function(j){j.hasOwnProperty("token")?(pe.setJWT(j.token),te=(new Ge.CallSettingsBuilder).setSessionID(ne).enableDefaultLayout(fe).setIsAudioOnlyCall(me).setUser(pe).setRegion(le).setAppId(ce).setDomain(ue).showEndCallButton(ve).showMuteAudioButton(be).showPauseVideoButton(ye).showScreenShareButton(Ee).showModeButton(Se).setMode(Te).setAnalyticsSettings(De).startWithAudioMuted(Ce).startWithVideoMuted(_e).showRecordingButton(Ae).startRecordingOnCallStart(Ie).forceLegacyUI(Ne).showSwitchToVideoCallButton(Oe).setVirtualBackground(ae).showVirtualBackgroundSetting(we).setMainVideoContainerSetting(se).build(),Me.CallController.getInstance().startCall(te,K)):Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.JWT_NOT_FOUND))}),(function(j){Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(j))}))}else{if(oe.isFalsy(j))return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.CALL_SETTINGS_REQUIRED)));if(ge)Le=ge.getType(),me=Le===he.CallConstants.CALL_TYPE.AUDIO,ne=ge.getSessionId();else{if(me=j.isAudioOnlyCall(),oe.isFalsy(j.getSessionId()))return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.SESSION_ID_REQUIRED)));ne=("v1."+le+"."+G.getAppId()+"."+j.getSessionId()).toLowerCase()}if(!ne)return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.SESSION_ID_REQUIRED)));fe=j.isDefaultLayoutEnabled(),ye=j.isPauseVideoButtonEnabled(),be=j.isMuteAudioButtonEnabled(),ve=j.isEndCallButtonEnabled(),Ee=j.isScreenShareButtonEnabled(),Te=j.getMode(),de=j.getLocalizedStringObject(),re=j.getCustomCSS(),Se=j.isModeButtonEnabled(),Ce=j.getStartWithAudioMuted(),_e=j.getStartWithVideoMuted(),Ae=j.isRecordingButtonEnabled(),Ie=j.shouldStartRecordingOnCallStart(),Ne=j.shouldUseLegacyUI(),Oe=!!me&&j.isAudioToVideoButtonEnabled(),ae=j.getVirtualBackground(),we=j.isVirtualBackgroundSettingEnabled(),se=j.getMainVideoContainerSetting(),ke={uid:xe.getUid(),sessionId:ne},G.getJWT(ke).then((function(j){j.hasOwnProperty("token")?(pe.setJWT(j.token),te=(new Ge.CallSettingsBuilder).setSessionID(ne).enableDefaultLayout(fe).setIsAudioOnlyCall(me).setUser(pe).setRegion(le).setAppId(ce).setDomain(ue).showEndCallButton(ve).showMuteAudioButton(be).showPauseVideoButton(ye).showScreenShareButton(Ee).showModeButton(Se).setMode(Te).setLocalizedStringObject(de).setCustomCSS(re).setAnalyticsSettings(De).startWithAudioMuted(Ce).startWithVideoMuted(_e).showRecordingButton(Ae).startRecordingOnCallStart(Ie).forceLegacyUI(Ne).showSwitchToVideoCallButton(Oe).setVirtualBackground(ae).showVirtualBackgroundSetting(we).setMainVideoContainerSetting(se).build(),Me.CallController.getInstance().startCall(te,K)):Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.JWT_NOT_FOUND))}),(function(j){Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(j))}))}else Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.NOT_INITIALIZED));else Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.NOT_LOGGED_IN));else Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.NOT_INITIALIZED))}),(function(j){oe.Logger.error("CometChat: startCall",j)}))}catch(j){oe.Logger.error("CometChat: startCall",j)}},G.getCallParticipantCount=function(j,K){return new Promise((function($,ee){try{oe.getAppSettings().then((function(te){if(oe.isFalsy(j))return ee(new ie.CometChatException(he.ProsodyApiErrors.INVALID_SESSIONID));if(oe.isFalsy(K))return ee(new ie.CometChatException(he.ProsodyApiErrors.INVALID_TYPE));var ne=te[he.APP_SETTINGS.KEYS.REGION],se={},le=te[he.APP_SETTINGS.KEYS.WEBRTC_HOST],ce=te[he.APP_SETTINGS.KEYS.WEBRTC_API_SUBDOMAIN],ue=oe.format((new re.EndpointFactory).prosodyApi,ce,le,he.PROSODY_API.PATH.ROOM_SIZE);"direct"===K.toLowerCase()&&(j=("v1."+ne+"."+G.getAppId()+"."+j).toLowerCase()),se[he.PROSODY_API.QUERY_PARAMETERS.DOMAIN]=le,se[he.PROSODY_API.QUERY_PARAMETERS.ROOM]=j,ae.postData(ue,"GET",se,{},!1).then((function(j){return j.text()})).then((function(j){var K=j?JSON.parse(j):{};return K.hasOwnProperty(he.PROSODY_API.RESPONSE.PARTICIPANTS)?$(K[he.PROSODY_API.RESPONSE.PARTICIPANTS]):$(0)})).catch((function(){var j={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};return ee(j)}))}),(function(j){return ee(new ie.CometChatException(j))}))}catch(j){return ee(new ie.CometChatException(j))}}))},G.rejectIncomingCall=function(j){return new Promise((function(K,$){try{var ee={};ee[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.REJECTED,ae.makeApiCall("updateCallSession",{sessionid:j},ee).then((function(j){var $=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);K($)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.cancelCall=function(j){var K=this;return new Promise((function($,ee){try{var te={};te[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.CANCELLED,ae.makeApiCall("updateCallSession",{sessionid:j},te).then((function(ee){var te=pe.MessageController.trasformJSONMessge(ee[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);K.getActiveCall().getSessionId()===j&&Me.CallController.getInstance().endCallSession(),$(te)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.sendBusyResponse=function(j){return new Promise((function(K,$){try{var ee={};ee[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.BUSY,ae.makeApiCall("updateCallSession",{sessionid:j},ee).then((function(j){var $=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);K($)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.sendUnansweredResponse=function(j){return new Promise((function(K,$){try{var ee={};ee[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.UNANSWERED,ae.makeApiCall("updateCallSession",{sessionid:j},ee).then((function(j){var $=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);Je.publishCallMessage($),K($)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.addConnectionListener=function(j,K){try{Xe.addConnectionEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addConnectionListener",j)}},G.removeConnectionListener=function(j){try{Xe.removeConnectionEventListener(j)}catch(j){oe.Logger.error("CometChat: removeConnectionListener",j)}},G.addMessageListener=function(j,K){try{Xe.addMessageEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addMessageListener",j)}},G.removeMessageListener=function(j){try{Xe.removeMessageEventListener(j)}catch(j){oe.Logger.error("CometChat: removeMessageListener",j)}},G.addCallListener=function(j,K){try{Xe.addCallEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addCallListener",j)}},G.removeCallListener=function(j){try{Xe.removeCallEventListener(j)}catch(j){oe.Logger.error("CometChat: removeCallListener",j)}},G.addUserListener=function(j,K){try{Xe.addUserEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addUserListener",j)}},G.removeUserListener=function(j){try{Xe.removeUserEventListener(j)}catch(j){oe.Logger.error("CometChat: removeUserListener",j)}},G.addGroupListener=function(j,K){try{Xe.addGroupEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addGroupListener",j)}},G.removeGroupListener=function(j){try{Xe.removeGroupEventListener(j)}catch(j){oe.Logger.error("CometChat: removeGroupListener",j)}},G.addLoginListener=function(j,K){try{Xe.addLoginEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addLoginListener",j)}},G.removeLoginListener=function(j){try{Xe.removeLoginEventListener(j)}catch(j){oe.Logger.error("CometChat: removeLoginListener",j)}},G.generateAuthToken=function(j){var K=this;return new Promise((function($,ee){try{var te={},ne="",re="",se=he.APPINFO.platform,le=he.APPINFO.sdkVersion,ce=he.APPINFO.apiVersion;navigator&&(re=navigator.userAgent),G.keyStore.get(he.LOCAL_STORE.KEY_DEVICE_ID).then((function(oe){if(null==(ne=oe)){var ue=Ke(),de=(new Date).getTime();ne=K.appId+"_"+ue+"_"+de,G.keyStore.set(he.LOCAL_STORE.KEY_DEVICE_ID,ne)}te={platform:se,deviceId:ne,appInfo:{version:le,apiVersion:ce,userAgent:re}},ae.makeApiCall("authToken",{uid:j},te).then((function(j){$(j.data)})).catch((function(j){ee(new ie.CometChatException(j.error))}))}),(function(j){oe.Logger.error("Got error while fetching data from key store",j)}))}catch(j){ee(new ie.CometChatException(j))}}))},G.tryReconnectingToWS=function(){G.WSReconnectionInProgress||G.startWSReconnectionTimer()},G.prototype.makeWSConnection=function(){G.WSLogin(G.user)},G.prototype.accidentallyDisconnected=function(){G.currentConnectionStatus=he.CONNECTION_STATUS.CONNECTING,Xe.connectionHandlers.map((function(j){try{j._eventListener&&(oe.isFalsy(j._eventListener.inConnecting)||j._eventListener.inConnecting())}catch(j){oe.Logger.error("ConnectionHandlers: inConnecting Status",j)}})),G.tryReconnectingToWS()},G.WSLogin=function(j){var K=this;Je.connection?oe.Logger.error("CometChat :: WSLogin",Je.connection):Je.WSLogin(j.getJWT(),(function(j){switch(j){case He.READY_STATE.CONNECTING:($=G.getConnectionStatus())==he.CONNECTION_STATUS.DISCONNECTED&&(K.currentConnectionStatus=he.CONNECTION_STATUS.CONNECTING,Xe.connectionHandlers.map((function(j){try{j._eventListener&&(oe.isFalsy(j._eventListener.inConnecting)||j._eventListener.inConnecting())}catch(j){oe.Logger.error("connectionHandlers: Connecting Status",j)}})));break;case He.READY_STATE.OPEN:($=G.getConnectionStatus())==he.CONNECTION_STATUS.CONNECTING&&(K.currentConnectionStatus=he.CONNECTION_STATUS.CONNECTED,Xe.connectionHandlers.map((function(j){try{j._eventListener&&(oe.isFalsy(j._eventListener.onConnected)||j._eventListener.onConnected())}catch(j){oe.Logger.error("connectionHandlers: Connected Status",j)}}))),G.WSReconnectionInProgress&&G.clearWSReconnectionTimer();break;case He.READY_STATE.CLOSING:break;case He.READY_STATE.CLOSED:var $;($=G.getConnectionStatus())!==he.CONNECTION_STATUS.DISCONNECTED&&$!==he.CONNECTION_STATUS.CONNECTING&&(K.currentConnectionStatus=he.CONNECTION_STATUS.DISCONNECTED,Xe.connectionHandlers.map((function(j){try{j._eventListener&&(oe.isFalsy(j._eventListener.onDisconnected)||j._eventListener.onDisconnected())}catch(j){oe.Logger.error("connectionHandlers: Disconnected Status",j)}}))),Je.connection&&(Je.connection=null),G.isLoggedOut||G.disconnectedByUser||K.tryReconnectingToWS()}}))},G.pingAnalytics=function(){var j=this;try{G.keyStore.get("deviceId").then((function(K){oe.getAppSettings().then((function($){var ee=null;window&&window.location&&window.location.origin&&(ee=window.location.origin);var te="",ne=K,re={version:he.SDKHeader.sdkVersion,apiVersion:$[he.APP_SETTINGS.KEYS.CHAT_API_VERSION],origin:ee,uts:(new Date).getTime()};oe.isFalsy(j.resource)||(re.resource=j.resource),oe.isFalsy(j.platform)||(re.platform=j.platform),oe.isFalsy(j.language)||(re.language=j.language),navigator&&(te=navigator.userAgent);var se={appInfo:re,uid:G.user.getUid(),userAgent:te,deviceId:ne,platform:he.SDKHeader.platform};oe.isFalsy(G.getSessionId())||(se.wsId=G.getSessionId());var le="https://"+$[he.APP_SETTINGS.KEYS.ANALYTICS_HOST]+"/"+$[he.APP_SETTINGS.KEYS.ANALYTICS_VERSION]+"/ping",ce={appId:G.appId,sdk:oe.format(he.SDKHeader.sdk,he.SDKHeader.platform,he.SDKHeader.sdkVersion),"Content-Type":"application/json"};G.settingsHash&&(ce.settingsHash=G.settingsHash),G.settingsHashReceivedAt&&(ce.settingsHashReceivedAt=G.settingsHashReceivedAt),G.jwt&&(ce.Authorization="Bearer "+G.jwt),G.authToken&&(ce.authToken=G.authToken),ae.postData(le,"POST",se,ce,!1).then((function(j){return j.json()})).then((function(K){if(K.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA))oe.Logger.log("Analytics Ping Request Data",K[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);else if(K.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_ERROR)){var $=K[he.ResponseConstants.RESPONSE_KEYS.KEY_ERROR];oe.Logger.log("Analytics Ping Request Error",new ie.CometChatException($));var ee=$.code;if(ee===he.Errors.ERR_SETTINGS_HASH_OUTDATED){var te=G.authToken;G.getInstance().internalRestart(te)}ee===he.Errors.ERR_NO_AUTH&&j.updateJWT()}})).catch((function(j){oe.Logger.error("CometChat: pingAnalytics Fetch Error",j)}))}),(function(j){oe.Logger.error("CometChat: pingAnalytics getSettings Error",j)}))}),(function(j){oe.Logger.error("CometChat: pingAnalytics getDeviceId Error",j)}))}catch(j){oe.Logger.error("CometChat: pingAnalytics",j)}},G.updateJWT=function(){ae.makeApiCall("getMyDetails",{},{},!1).then((function(j){var K=j.data,$=K.settings,ee=new se.Me(K);if(K.hasOwnProperty("jwt")&&K.jwt&&(G.jwt=K.jwt),le.LocalStorage.getInstance().set("user",ee),$&&$[he.APP_SETTINGS.KEYS.SETTINGS_HASH]&&G.settingsHash!==$[he.APP_SETTINGS.KEYS.SETTINGS_HASH]){var te=G.getInstance().getAuthToken();G.getInstance().internalRestart(te)}oe.Logger.log("CometChat: updateJWT response",j)}),(function(j){oe.Logger.error("CometChat: updateJWT Fetch Error",j)})).catch((function(j){oe.Logger.error("CometChat: updateJWT",j)}))},G.startAnalyticsPingTimer=function(){var j=this;G.isAnalyticsPingStarted=!0,G.analyticsPingTimer=setInterval((function(){try{j.pingAnalytics()}catch(j){oe.Logger.error("CometChat: startAnalyticsPingTimer",j)}}),G.settingsInterval)},G.clearAnalyticsPingTimer=function(){try{G.isAnalyticsPingStarted=!1,clearInterval(G.analyticsPingTimer)}catch(j){oe.Logger.error("CometChat: clearAnalyticsPingTimer",j)}},G.startWSReconnectionTimer=function(){G.WSReconnectionInProgress=!0,G.WSReconnectionTimer=setInterval((function(){try{G.WSLogin(G.user)}catch(j){oe.Logger.error("CometChat: startWSReconnectionTimer",j)}}),G.WSReconnectionTimerInterval)},G.clearWSReconnectionTimer=function(){G.WSReconnectionInProgress=!1,clearInterval(G.WSReconnectionTimer)},G.getJWT=function(j){return new Promise((function(K,$){try{Ve.getEndPoint("getJWT").then((function(ee){var te={appId:G.appId,Accept:"application/json",authToken:G.authToken,resource:G.getSessionId(),sdk:oe.format(he.SDKHeader.sdk,he.SDKHeader.platform,he.SDKHeader.sdkVersion),"Content-Type":"application/json"},ne={};ne[he.JWT_API.KEYS.PASSTHROUGH]=j,ae.postData(ee.endpoint,ee.method,ne,te,!1).then((function(j){return j.json()})).then((function(j){j.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA)?K(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]):$(new ie.CometChatException(j.error))})).catch((function(j){var K={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};$(new ie.CometChatException(K))}))}),(function(j){$(new ie.CometChatException(j))}))}catch(j){$(new ie.CometChatException(j))}}))},G.getConnectionStatus=function(){return this.currentConnectionStatus},G.prototype.setConnectionStatus=function(j){G.currentConnectionStatus=j},G.isExtensionEnabled=function(j){return new Promise((function(K,$){try{if(oe.isFalsy(j))return $(new ie.CometChatException(he.ExtensionErrors.INVALID_EXTENSION));oe.getAppSettings().then((function(ee){if(ee.extensions){var te=ee.extensions;if(0<te.length){var ne=te.some((function(K){return K.id===j}));return K(ne)}return K(!1)}return $(new ie.CometChatException(he.ExtensionErrors.EXTENSION_NOT_FOUND))}),(function(j){return $(new ie.CometChatException(j))}))}catch(j){return $(new ie.CometChatException(j))}}))},G.getExtensionDetails=function(j){return new Promise((function(K,$){try{if(oe.isFalsy(j))return $(new ie.CometChatException(he.ExtensionErrors.INVALID_EXTENSION));oe.getAppSettings().then((function(ee){if(ee.extensions){var te=ee.extensions;if(0<te.length){var ne=te.filter((function(K){return K.id===j}));if(0<ne.length){var re=new We.CCExtension(ne[0]);return K(re)}return $(new ie.CometChatException(he.ExtensionErrors.EXTENSION_NOT_FOUND))}return $(new ie.CometChatException(he.ExtensionErrors.EXTENSION_NOT_FOUND))}return $(new ie.CometChatException(he.ExtensionErrors.EXTENSION_NOT_FOUND))}),(function(j){return $(new ie.CometChatException(j))}))}catch(j){return $(new ie.CometChatException(j))}}))},G.getAppSettings=function(){return new Promise((function(j,K){try{ae.makeApiCall("appSettings").then((function(K){le.LocalStorage.getInstance().set(he.LOCAL_STORE.KEY_APP_SETTINGS,K.data),j(K.data)}),(function(j){K(new ie.CometChatException(j.error))}))}catch(j){K(new ie.CometChatException(j))}}))},G.isFeatureEnabled=function(j){return new Promise((function(K,$){try{if(oe.isFalsy(j))return $(new ie.CometChatException(he.FeatureRestrictionErrors.INVALID_FEATURE));oe.getAppSettings().then((function(ee){if(ee.parameters){var te=ee.parameters;return te.hasOwnProperty(j)?K(te[j]):K(!1)}return $(new ie.CometChatException(he.FeatureRestrictionErrors.FEATURE_NOT_FOUND))}),(function(j){return $(new ie.CometChatException(j))}))}catch(j){return $(new ie.CometChatException(j))}}))},G.logout=function(){var j=this;return new Promise((function(K,$){try{G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer(),G.WSReconnectionInProgress&&G.clearWSReconnectionTimer(),G.isLoggedOut=!0,G.WSReconnectionInProgress=!1,G.isAnalyticsDisabled=!1,ae.makeApiCall("userLogout").then((function($){j.clearCache().then((function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,Je.WSLogout(),G.pushToLoginListener("","Logout_Success"),K($.data)}))}),(function(ee){j.clearCache().then((function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,Je.WSLogout(),G.pushToLoginListener("","Logout_Success"),new ie.CometChatException(ee.error).code==Ee.SERVER_ERRORS.AUTH_ERR.code?K({}):$(new ie.CometChatException(ee.error))}))}))}catch(j){$(new ie.CometChatException(j))}}))},G.callExtension=function(j,K,$,ee){return void 0===ee&&(ee={}),new Promise((function(te,ne){try{oe.getAppSettings().then((function(se){var le=oe.format((new re.EndpointFactory).extensionApi,j,se[he.APP_SETTINGS.KEYS.REGION],se[he.APP_SETTINGS.KEYS.EXTENSION_DOMAIN],$),ce={appId:G.appId,Accept:"application/json",authToken:G.authToken,resource:G.getSessionId(),sdk:oe.format(he.SDKHeader.sdk,he.SDKHeader.platform,he.SDKHeader.sdkVersion),chatApiVersion:se[he.APP_SETTINGS.KEYS.CHAT_API_VERSION],"Content-Type":"application/json"};ae.postData(le,K,ee,ce,!1).then((function(j){return j.json()})).then((function(j){j.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA)?te(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]):ne(new ie.CometChatException(j.error))})).catch((function(j){var K={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};ne(K)}))}),(function(j){return ne(new ie.CometChatException(j))}))}catch(j){return ne(new ie.CometChatException(j))}}))},G.setSource=function(j,K,$){oe.isFalsy(j)||(this.resource=j),oe.isFalsy(K)||(this.platform=K),oe.isFalsy($)||(this.language=$)},G.clearCache=function(){return new Promise((function(j,K){try{le.LocalStorage.getInstance().clearStore().then((function(){G.removeDataFromSessionStorage(he.SESSION_STORE.SESSION_ID),oe.Logger.info("CometChat: clearCache => All store cleared successfully","true"),j(!0)}))}catch(j){oe.Logger.error("CometChat: clearCache",j),K(j)}}))},G.connect=function(){G.user&&(Je.connection||(G.disconnectedByUser=!1,G.WSLogin(G.user)),G.didAnalyticsPingStart()||G.isAnalyticsDisabled||(G.pingAnalytics(),G.startAnalyticsPingTimer()))},G.disconnect=function(){G.user&&(G.disconnectedByUser=!0,Je.connection&&Je.WSLogout(),G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer())},G.prototype.internalRestart=function(j){G.internalRestart||G.getInstance().internalLogout(!1).then((function(){G.internalRestart=!0,G.login(j).then((function(j){G.shouldConnectToWS=!0,G.internalRestart=!1}),(function(j){oe.Logger.error("CometChat: internalRestart :: login",j),G.internalRestart=!1}))}),(function(j){oe.Logger.error("CometChat: internalRestart :: internalLogout",j)}))},G.prototype.internalLogout=function(j){return void 0===j&&(j=!0),new Promise((function(K,$){try{G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer(),G.WSReconnectionInProgress&&G.clearWSReconnectionTimer(),G.isLoggedOut=!0,G.WSReconnectionInProgress=!1,G.isAnalyticsDisabled=!1,G.clearCache().then((function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,Je.WSLogout(),j&&G.pushToLoginListener("","Logout_Success"),K(!0)}))}catch(K){oe.Logger.error("CometChat: internalLogout",K),$(K)}}))},G.initialzed=!1,G.CometChatException=ie.CometChatException,G.TextMessage=de.TextMessage,G.MediaMessage=ce.MediaMessage,G.CustomMessage=xe.CustomMessage,G.Action=Se.Action,G.Call=ve.Call,G.TypingIndicator=we.TypingIndicator,G.TransientMessage=Qe.TransientMessage,G.Group=me.Group,G.User=se.User,G.GroupMember=je.GroupMember,G.Conversation=Re.Conversation,G.USER_STATUS={ONLINE:he.PresenceConstatnts.STATUS.ONLINE,OFFLINE:he.PresenceConstatnts.STATUS.OFFLINE},G.MessagesRequest=Ne.MessagesRequest,G.MessagesRequestBuilder=Ne.MessagesRequestBuilder,G.UsersRequest=Ae.UsersRequest,G.UsersRequestBuilder=Ae.UsersRequestBuilder,G.ConversationsRequest=Ie.ConversationsRequest,G.ConversationsRequestBuilder=Ie.ConversationsRequestBuilder,G.BlockedUsersRequest=Le.BlockedUsersRequest,G.BlockedUsersRequestBuilder=Le.BlockedUsersRequestBuilder,G.GroupsRequest=Ce.GroupsRequest,G.GroupsRequestBuilder=Ce.GroupsRequestBuilder,G.GroupMembersRequest=_e.GroupMembersRequest,G.GroupMembersRequestBuilder=_e.GroupMembersRequestBuilder,G.BannedMembersRequest=Te.BannedMembersRequest,G.BannedMembersRequestBuilder=Te.BannedMembersRequestBuilder,G.CallSettings=Ge.CallSettings,G.CallSettingsBuilder=Ge.CallSettingsBuilder,G.MainVideoContainerSetting=Ge.MainVideoContainerSetting,G.VirtualBackground=Ge.VirtualBackground,G.VirtualBackgroundBuilder=Ge.VirtualBackgroundBuilder,G.AppSettings=ke.AppSettings,G.AppSettingsBuilder=ke.AppSettingsBuilder,G.MessageListener=be.MessageListener,G.UserListener=be.UserListener,G.GroupListener=be.GroupListener,G.OngoingCallListener=be.OngoingCallListener,G.CallListener=be.CallListener,G.ConnectionListener=be.ConnectionListener,G.LoginListener=be.LoginListener,G.CallController=Me.CallController,G.CometChatHelper=Pe.CometChatHelper,G.Attachment=Ue.Attachment,G.MediaDevice=Fe.MediaDevice,G.MESSAGE_TYPE=he.MessageConstatnts.TYPE,G.CATEGORY_MESSAGE=he.MessageConstatnts.CATEGORY.MESSAGE,G.CATEGORY_ACTION=he.MessageConstatnts.CATEGORY.ACTION,G.CATEGORY_CALL=he.MessageConstatnts.CATEGORY.CALL,G.CATEGORY_CUSTOM=he.MessageConstatnts.CATEGORY.CUSTOM,G.ACTION_TYPE=he.ActionConstatnts.ACTIONS,G.CALL_TYPE=he.CallConstants.CALL_TYPE,G.RECEIVER_TYPE=he.MessageConstatnts.RECEIVER_TYPE,G.CALL_STATUS=he.CallConstants.CALL_STATUS,G.GROUP_MEMBER_SCOPE=he.GROUP_MEMBER_SCOPE,G.GROUP_TYPE=he.GROUP_TYPE,G.MESSAGE_REQUEST=he.MessageConstatnts.PAGINATION.CURSOR_FILEDS,G.CONNECTION_STATUS=he.CONNECTION_STATUS,G.CALL_MODE=he.CallConstants.CALL_MODE,G.SORT_BY=he.UserConstants.SORT_BY,G.SORT_ORDER=he.UserConstants.SORT_ORDER,G.WSReconnectionInProgress=!1,G.WSReconnectionTimerInterval=5e3,G.currentConnectionStatus=he.CONNECTION_STATUS.DISCONNECTED,G.isConnectingFromInit=!1,G.loginInProgress=!1,G.internalRestart=!1,G.settingsInterval=6e4,G.isAnalyticsPingStarted=!1,G.isLoggedOut=!0,G.isAnalyticsDisabled=!1,G.disconnectedByUser=!1,G.shouldConnectToWS=!0,G}();K.CometChat=qe},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.Me=K.User=void 0;var ne=$(2),re=$(13),oe=$(1),ie=function(){function t(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];if(this.hasBlockedMe=!1,this.blockedByMe=!1,this.deactivatedAt=0,1===j.length)typeof j[0]===oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?this.uid=j[0]:(this.uid=j[0].uid,this.name=j[0].name,j[0].authToken&&(this.authToken=j[0].authToken),j[0].avatar&&(this.avatar=j[0].avatar),j[0].lastActiveAt&&(this.lastActiveAt=j[0].lastActiveAt),j[0].link&&(this.link=j[0].link),j[0].metadata&&(this.metadata=j[0].metadata),j[0].role&&(this.role=j[0].role),j[0].statusMessage&&(this.statusMessage=j[0].statusMessage),j[0].status&&"offline"!==j[0].status?this.status="online":this.status="offline",j[0].tags&&(this.tags=j[0].tags),j[0].deactivatedAt&&(this.deactivatedAt=j[0].deactivatedAt));else{if(2!==j.length)throw new ne.CometChatException(re.ERRORS.PARAMETER_MISSING);this.uid=j[0],this.name=j[1]}}return t.prototype.getUid=function(){return this.uid.toString()},t.prototype.setUid=function(j){this.uid=j},t.prototype.getName=function(){return this.name.toString()},t.prototype.setName=function(j){j&&(this.name=j)},t.prototype.getAuthToken=function(){return this.authToken},t.prototype.setAuthToken=function(j){this.authToken=j},t.prototype.getAvatar=function(){return this.avatar},t.prototype.setAvatar=function(j){this.avatar=j},t.prototype.getLastActiveAt=function(){return this.lastActiveAt},t.prototype.setLastActiveAt=function(j){this.lastActiveAt=j},t.prototype.getLink=function(){return this.link},t.prototype.setLink=function(j){return this.link=j},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(j){this.metadata=j},t.prototype.getRole=function(){return this.role},t.prototype.setRole=function(j){this.role=j},t.prototype.getStatus=function(){return this.status},t.prototype.setStatus=function(j){this.status=j},t.prototype.getStatusMessage=function(){return this.statusMessage},t.prototype.setStatusMessage=function(j){this.statusMessage=j},t.prototype.setBlockedByMe=function(j){this.blockedByMe=j},t.prototype.getBlockedByMe=function(){return this.blockedByMe},t.prototype.setHasBlockedMe=function(j){this.hasBlockedMe=j},t.prototype.getHasBlockedMe=function(){return this.hasBlockedMe},t.prototype.setTags=function(j){this.tags=j},t.prototype.getTags=function(){return this.tags},t.prototype.setDeactivatedAt=function(j){this.deactivatedAt=j},t.prototype.getDeactivatedAt=function(){return this.deactivatedAt},t}(),ae=function(j){function t(K){var $=j.call(this,K)||this;return $.wsChannel=K.wsChannel,K.jwt&&($.jwt=K.jwt),$}return te(t,j),t.prototype.getWsChannel=function(){return this.wsChannel},t.prototype.getJWT=function(){return this.jwt},t}(K.User=ie);K.Me=ae},function(j,K,$){"use strict";K.__esModule=!0,K.KEYS=K.AUTH=K.MESSAGE=K.PRESENCE=K.RECEIPTS=K.TRANSIENT_MESSAGE=K.TYPING_INDICATOR=K.LOGOUT_REASON=K.LOGOUT_CODE=K.READY_STATE=K.WS=void 0,K.WS={protocol:"wss://"},K.READY_STATE={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3,INVALID_JWT:4},K.LOGOUT_CODE=1e3,K.LOGOUT_REASON="User logged out",K.TYPING_INDICATOR={TYPE:"typing_indicator",ACTION:{STARTED:"started",ENDED:"ended"}},K.TRANSIENT_MESSAGE={TYPE:"transient_message"},K.RECEIPTS={TYPE:"receipts",ACTION:{READ:"read",DELIVERED:"delivered"},RECEIPT_TYPE:{READ_RECEIPT:"read",DELIVERY_RECEIPT:"delivery"}},K.PRESENCE={TYPE:"presence",ACTION:{ONLINE:"online",AVAILABLE:"available",OFFLINE:"offline"}},K.MESSAGE={TYPE:"message"},K.AUTH={TYPE:"auth"},K.KEYS={TYPE:"type",ACTION:"action",APP_ID:"appId",RECEIVER:"receiver",RECEIVER_TYPE:"receiverType",DEVICE_ID:"deviceId",BODY:"body",USER:"user",METADATA:"metadata",MESSAGE_ID:"messageId",TIMESTAMP:"timestamp",STATUS:"status",CODE:"code",SENDER:"sender",MESSAGE_SENDER:"messageSender",PRESENCE_SUBSCRIPTION:"presenceSubscription",AUTH:"auth",PING:"ping",DATA:"data",PARAMS:"params",ACK:"ack",PONG:"pong"}},function(j,K,$){"use strict";K.__esModule=!0,K.postData=K.makeAdminApiCall=K.makeApiCall=void 0;var ee=$(29),te=$(3),ne=$(0),re=$(2),oe=$(13),ie=$(1);function C(j,K,$,ee,te){var re;return void 0===j&&(j=""),void 0===K&&(K="GET"),void 0===$&&($={}),void 0===ee&&(ee={}),$=ne.isFalsy($)?void 0:("GET"==K&&(j+="?",Object.keys($).map((function(K,ee){j=ee===Object.keys($).length-1?j+K+"="+$[K]:j+K+"="+$[K]+"&"})),$=void 0),te&&(re=new FormData,Object.keys($).map((function(j){if("data"!=j){if("tags"==j)re.append(j+"[]",$[j]);else if("metadata"!=j)if("files"===j)for(var K=0;K<$[j].length;K++)re.append(j+"[]",$[j][K]);else re.append(j,$[j])}else re.append(j,JSON.stringify($[j]))}))),JSON.stringify($)),fetch(j,{method:K,mode:"cors",cache:"no-cache",headers:ee,redirect:"follow",referrer:"no-referrer",body:te?re:$})}K.makeApiCall=function(j,K,$,ae){void 0===j&&(j=""),void 0===K&&(K={}),void 0===$&&($={});var se=te.CometChat.getInstance(te.CometChat.getAppId());return new Promise((function(le,ce){try{ee.getEndPoint(j,K).then((function(K){var ee={resource:te.CometChat.getSessionId(),appId:te.CometChat.getAppId(),Accept:"application/json",sdk:ne.format(ie.SDKHeader.sdk,ie.SDKHeader.platform,ie.SDKHeader.sdkVersion)};ae||(ee["Content-Type"]="application/json"),K.hasOwnProperty("isAdminApi")&&K.isAdminApi?se.getApiKey()?ee.apiKey=se.getApiKey():ce({error:{code:"API_KEY_NOT_SET",message:"An apiKey is needed to use the "+j+" api.",name:"API_KEY_NOT_SET"}}):se.getAuthToken()?ee.authToken=se.getAuthToken():ce({error:{code:"USER_NOT_LOGED_IN",message:"An authToken is need to use the "+j+" end-point. PS- We are aware of the spelling mistake, but in order to maintain backward compatibility we cannot change it :(",name:"User not logged-in"}}),C(K.endpoint,K.method,$,ee,ae).then((function(j){return j.json()})).then((function(j){if(j.hasOwnProperty("data"))j.data.hasOwnProperty("authToken")&&te.CometChat.setAuthToken(j.data.authToken),le(j);else{if(j.hasOwnProperty("error")){var K=j.error;K.hasOwnProperty("code")&&K.code===ie.API_ERROR_CODES.AUTH_ERR_AUTH_TOKEN_NOT_FOUND&&te.CometChat.getInstance().internalLogout().then((function(){ne.Logger.log("CometChat: makeApiCall","User logged out")}))}ce(j)}})).catch((function(j){var K={error:oe.FETCH_ERROR.ERROR_IN_API_CALL};ce(K)}))})).catch((function(j){return ce}))}catch(j){ce(new re.CometChatException(j))}}))},K.makeAdminApiCall=function(j,K,$,re){void 0===j&&(j=""),void 0===K&&(K={}),void 0===$&&($={});var ae=te.CometChat.getInstance(te.CometChat.getAppId());return new Promise((function(se,le){ee.getEndPoint(j,K).then((function(K){var ee={appId:te.CometChat.getAppId(),Accept:"application/json",sdk:ne.format(ie.SDKHeader.sdk,ie.SDKHeader.platform,ie.SDKHeader.sdkVersion)};re||(ee["Content-Type"]="application/json"),K.hasOwnProperty("isAdminApi")&&K.isAdminApi?ae.getApiKey()?ee.apiKey=ae.getApiKey():le({error:"An apiKey is need to use the "+j+" api."}):ae.getAuthToken()?ee.authToken=ae.getAuthToken():le({error:"An authToken is need to use the "+j+" api."}),C(K.endpoint,K.method,$,ee,re).then((function(j){return j.json()})).then((function(j){j.hasOwnProperty("data")?(j.data.hasOwnProperty("authToken")&&te.CometChat.setAuthToken(j.data.authToken),se(j)):le(j)})).catch((function(j){var K={error:oe.FETCH_ERROR.ERROR_IN_API_CALL};le(K)}))})).catch((function(j){return le}))}))},K.postData=C},function(j,K,$){"use strict";K.__esModule=!0,K.BaseMessage=void 0;var ee=function(){function t(j,K,$,ee){this.receiverId=j,this.type=K,this.receiverType=$,this.category=ee}return t.prototype.getId=function(){return this.id},t.prototype.setId=function(j){this.id=j},t.prototype.getConversationId=function(){return this.conversationId},t.prototype.setConversationId=function(j){this.conversationId=j},t.prototype.getParentMessageId=function(){return this.parentMessageId},t.prototype.setParentMessageId=function(j){this.parentMessageId=j},t.prototype.getMuid=function(){return this.muid},t.prototype.setMuid=function(j){this.muid=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(j){this.receiver=j},t.prototype.getReceiverId=function(){return this.receiverId},t.prototype.setReceiverId=function(j){this.receiverId=j},t.prototype.getType=function(){return this.type},t.prototype.setType=function(j){this.type=j},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getSentAt=function(){return this.sentAt},t.prototype.setSentAt=function(j){this.sentAt=j},t.prototype.getStatus=function(){return this.status},t.prototype.setStatus=function(j){this.status=j},t.prototype.getDeliveredAt=function(){return this.deliveredAt},t.prototype.setDeliveredAt=function(j){this.deliveredAt=j},t.prototype.getDeliveredToMeAt=function(){return this.deliveredToMeAt},t.prototype.setDeliveredToMeAt=function(j){this.deliveredToMeAt=j},t.prototype.getReadAt=function(){return this.readAt},t.prototype.setReadAt=function(j){this.readAt=j},t.prototype.getReadByMeAt=function(){return this.readByMeAt},t.prototype.setReadByMeAt=function(j){this.readByMeAt=j},t.prototype.getCategory=function(){return this.category},t.prototype.setCategory=function(j){this.category=j},t.prototype.getEditedAt=function(){return this.editedAt},t.prototype.setEditedAt=function(j){this.editedAt=j},t.prototype.getEditedBy=function(){return this.editedBy},t.prototype.setEditedBy=function(j){this.editedBy=j},t.prototype.getDeletedAt=function(){return this.deletedAt},t.prototype.setDeletedAt=function(j){this.deletedAt=j},t.prototype.getDeletedBy=function(){return this.deletedBy},t.prototype.setDeletedBy=function(j){this.deletedBy=j},t.prototype.getReplyCount=function(){return this.replyCount},t.prototype.setReplyCount=function(j){this.replyCount=j},t.prototype.getRawMessage=function(){return this.rawMessage},t.prototype.setRawMessage=function(j){this.rawMessage=j},t}();K.BaseMessage=ee},function(j,K,$){"use strict";K.__esModule=!0,K.Group=void 0;var ee=$(1),te=function(){function t(j,K,$,ee,te,ne,re){this.hasJoined=!1,this.membersCount=0,this.guid=j,K&&(this.name=K),$&&(this.type=$),!ee&&""!==ee||"password"!=$||(this.password=ee),(te||""===te)&&(this.icon=te),(ne||""===ne)&&(this.description=ne),re&&(this.hasJoined=re)}return t.prototype.getGuid=function(){return this.guid},t.prototype.setGuid=function(j){this.guid=j},t.prototype.getName=function(){return this.name},t.prototype.setName=function(j){j&&(this.name=j)},t.prototype.getType=function(){return this.type},t.prototype.setType=function(j){this.type=j},t.prototype.getPassword=function(){return this.password},t.prototype.setPassword=function(j){this.password=j},t.prototype.getIcon=function(){return this.icon},t.prototype.setIcon=function(j){this.icon=j},t.prototype.getDescription=function(){return this.description},t.prototype.setDescription=function(j){this.description=j},t.prototype.getOwner=function(){return this.owner},t.prototype.setOwner=function(j){this.owner=j},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(j){this.metadata=j},t.prototype.getCreatedAt=function(){return this.createdAt},t.prototype.setCreatedAt=function(j){this.createdAt=j},t.prototype.getUpdatedAt=function(){return this.updatedAt},t.prototype.setUpdatedAt=function(j){this.updatedAt=j},t.prototype.getHasJoined=function(){return this.hasJoined},t.prototype.setHasJoined=function(j){this.hasJoined=j},t.prototype.getWsChannel=function(){return this.wsChannel},t.prototype.setWsChannel=function(j){this.wsChannel=j},t.prototype.setScope=function(j){this.scope=j},t.prototype.getScope=function(){return this.scope},t.prototype.getJoinedAt=function(){return this.joinedAt},t.prototype.setJoinedAt=function(j){this.joinedAt=j},t.prototype.getMembersCount=function(){return this.membersCount},t.prototype.setMembersCount=function(j){this.membersCount=j},t.prototype.setTags=function(j){this.tags=j},t.prototype.getTags=function(){return this.tags},t.TYPE=ee.GroupType,t.Type=t.TYPE,t}();K.Group=te},function(j,K,$){"use strict";K.__esModule=!0,K.CometChatEvent=void 0;var ee=$(0),te=$(5),ne=function(){function t(j,K,$,te,ne,re){ee.isFalsy(j)||(this.appId=j),ee.isFalsy(K)||(this.receiver=K),ee.isFalsy($)||(this.receiverType=$),ee.isFalsy(ne)||(this.deviceId=ne),ee.isFalsy(te)||(this.sender=te),ee.isFalsy(re)||(this.messageSender=re)}return t.prototype.getAppId=function(){return this.appId},t.prototype.setAppId=function(j){this.appId=j},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(j){this.receiver=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getType=function(){return this.type},t.prototype.setType=function(j){this.type=j},t.prototype.getDeviceId=function(){return this.deviceId},t.prototype.setDeviceId=function(j){this.deviceId=j},t.prototype.getMessageSender=function(){return this.messageSender},t.prototype.setMessageSender=function(j){this.messageSender=j},t.prototype.getCometChatEventJSON=function(){var j={};return j[te.KEYS.APP_ID]=this.getAppId(),j[te.KEYS.RECEIVER]=this.getReceiver(),j[te.KEYS.RECEIVER_TYPE]=this.getReceiverType(),j[te.KEYS.DEVICE_ID]=this.getDeviceId(),j[te.KEYS.TYPE]=this.getType(),j[te.KEYS.SENDER]=this.getSender(),ee.isFalsy(this.getMessageSender())||(j[te.KEYS.MESSAGE_SENDER]=this.getMessageSender()),j},t}();K.CometChatEvent=ne},function(j,K,$){"use strict";K.__esModule=!0,K.MessageController=void 0;var ee=$(7),te=$(16),ne=$(17),re=$(0),oe=$(1),ie=$(20),ae=$(21),se=$(22),le=$(2),ce=$(18),ue=$(19),de=$(3),pe=$(11),ge=function(){function t(){}return t.trasformJSONMessge=function(j){try{var K=null;j.hasOwnProperty("rawMessage")||(K=JSON.parse(JSON.stringify(j)));var $=void 0;switch(j[oe.MessageConstatnts.KEYS.CATEGORY]){case oe.MessageConstatnts.CATEGORY.ACTION:$=ie.Action.actionFromJSON(j);break;case oe.MessageConstatnts.CATEGORY.CALL:$=ae.Call.callFromJSON(j);break;case oe.MessageConstatnts.CATEGORY.MESSAGE:switch(j[oe.MessageConstatnts.KEYS.TYPE]){case oe.MessageConstatnts.TYPE.TEXT:$=new te.TextMessage(j[oe.MessageConstatnts.KEYS.RECEIVER],j[oe.MessageConstatnts.KEYS.DATA][oe.MessageConstatnts.KEYS.TEXT],j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;case oe.MessageConstatnts.TYPE.CUSTOM:$=new ue.CustomMessage(j[oe.MessageConstatnts.KEYS.RECEIVER],j[oe.MessageConstatnts.KEYS.DATA][oe.MessageConstatnts.KEYS.CUSTOM_DATA],j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;default:if($=new ne.MediaMessage(j[oe.MessageConstatnts.KEYS.RECEIVER],j[oe.MessageConstatnts.KEYS.DATA][oe.MessageConstatnts.KEYS.URL],j[oe.MessageConstatnts.KEYS.TYPE],j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),j.hasOwnProperty(oe.MessageConstatnts.KEYS.DATA)){var le=j[oe.MessageConstatnts.KEYS.DATA];if(le.hasOwnProperty(oe.MessageConstatnts.KEYS.ATTATCHMENTS)){var de,pe=le[oe.MessageConstatnts.KEYS.ATTATCHMENTS];new Array,pe.map((function(j){de=new ce.Attachment(j)})),$.setAttachment(de)}le.hasOwnProperty(oe.MessageConstatnts.KEYS.TEXT)&&$.setCaption(le[oe.MessageConstatnts.KEYS.TEXT])}$.hasOwnProperty("file")&&delete $.file}break;case oe.MessageConstatnts.CATEGORY.CUSTOM:$=new ue.CustomMessage(j[oe.MessageConstatnts.KEYS.RECEIVER],j[oe.MessageConstatnts.KEYS.DATA][oe.MessageConstatnts.KEYS.CUSTOM_DATA],j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE],j.type)}j[oe.MessageConstatnts.KEYS.MY_RECEIPTS]&&(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS]=j[oe.MessageConstatnts.KEYS.MY_RECEIPTS],Object.keys(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS]).map((function(K){var $=new se.MessageReceipt;K==oe.DELIVERY_RECEIPTS.DELIVERED_AT&&($.setReceiptType($.RECEIPT_TYPE.DELIVERY_RECEIPT),$.setDeliveredAt(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.DELIVERY_RECEIPTS.DELIVERED_AT]),re.isFalsy(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.DELIVERY_RECEIPTS.RECIPIENT])?j[oe.DELIVERY_RECEIPTS.DELIVERED_TO_ME_AT]=j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.DELIVERY_RECEIPTS.DELIVERED_AT]:$.setSender(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.DELIVERY_RECEIPTS.RECIPIENT]),$.setReceiverType(j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),$.setReceiver(j[oe.MessageConstatnts.KEYS.RECEIVER])),j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.READ_AT]&&($.setReceiptType($.RECEIPT_TYPE.READ_RECEIPT),$.setReadAt(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.READ_AT]),re.isFalsy(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.RECIPIENT])?j[oe.READ_RECEIPTS.READ_BY_ME_AT]=j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.READ_AT]:$.setSender(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.RECIPIENT]),$.setReceiverType(j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),$.setReceiver(j[oe.MessageConstatnts.KEYS.RECEIVER]))})));try{if(Object.assign($,j),(j=$).parentId&&(j.parentMessageId=j.parentId,delete j.parentId),j instanceof ee.BaseMessage&&(re.isFalsy(K)||j.setRawMessage(K)),j instanceof te.TextMessage)j.setSender(j.getSender()),j.setReceiver(j.getReceiver()),j.getData()[oe.MessageConstatnts.KEYS.METADATA]&&j.setMetadata(j.getData()[oe.MessageConstatnts.KEYS.METADATA]);else if(j instanceof ne.MediaMessage)j.getData()[oe.MessageConstatnts.KEYS.METADATA]&&j.setMetadata(j.getData()[oe.MessageConstatnts.KEYS.METADATA]),j.setSender(j.getSender()),j.setReceiver(j.getReceiver());else if(j instanceof ie.Action)j.setSender(j.getSender()),j.setReceiver(j.getActionFor()),j.setActionBy(j.getActionBy()),j.setActionOn(j.getActionOn()),j.setActionFor(j.getActionFor()),j.setMessage(j.getMessage());else if(j instanceof ae.Call){try{j.setSender(j.getSender())}catch(K){re.Logger.error("MessageController: trasformJSONMessge: setSender",K)}try{j.setCallInitiator(j.getCallInitiator())}catch(K){re.Logger.error("MessageController: trasformJSONMessge: setCallInitiator",K)}try{j.setReceiver(j.getCallReceiver()),j.setCallReceiver(j.getCallReceiver())}catch(K){re.Logger.error("MessageController: trasformJSONMessge: setCallreceiver",K)}}else j instanceof ue.CustomMessage&&(j.getData()[oe.MessageConstatnts.KEYS.METADATA]&&j.setMetadata(j.getData()[oe.MessageConstatnts.KEYS.METADATA]),j.setCustomData(j.getData()[oe.MessageConstatnts.KEYS.CUSTOM_DATA]),j.setSubType(j.getData()[oe.MessageConstatnts.KEYS.CUSTOM_SUB_TYPE]),j.setSender(j.getSender()),j.setReceiver(j.getReceiver()))}catch(K){re.Logger.error("MessageController: trasformJSONMessge: Main",K),j=null}return j}catch(K){re.Logger.error("MessageController: trasformJSONMessge",K)}},t.getReceiptsFromJSON=function(j){return new Promise((function(K,$){try{var ee=[];de.CometChat.getLoggedInUser().then((function($){re.isFalsy(j.receipts)?K([]):(j.receipts.data.map((function(K){var te=new se.MessageReceipt;K[oe.DELIVERY_RECEIPTS.DELIVERED_AT]&&(te.setReceiptType(te.RECEIPT_TYPE.DELIVERY_RECEIPT),te.setDeliveredAt(K[oe.DELIVERY_RECEIPTS.DELIVERED_AT]),te.setTimestamp(K[oe.DELIVERY_RECEIPTS.DELIVERED_AT]),re.isFalsy(K[oe.DELIVERY_RECEIPTS.RECIPIENT])?te.setSender($):te.setSender(pe.UsersController.trasformJSONUser(K[oe.DELIVERY_RECEIPTS.RECIPIENT])),te.setReceiverType(j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),te.setReceiver(j[oe.MessageConstatnts.KEYS.RECEIVER])),K[oe.READ_RECEIPTS.READ_AT]&&(te.setReceiptType(te.RECEIPT_TYPE.READ_RECEIPT),te.setReadAt(K[oe.READ_RECEIPTS.READ_AT]),te.setTimestamp(K[K[oe.READ_RECEIPTS.READ_AT]]),re.isFalsy(K[oe.READ_RECEIPTS.RECIPIENT])?te.setSender($):te.setSender(pe.UsersController.trasformJSONUser(K[oe.READ_RECEIPTS.RECIPIENT])),te.setReceiverType(j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),te.setReceiver(j[oe.MessageConstatnts.KEYS.RECEIVER])),ee.push(te)})),K(ee))}))}catch(K){$(new le.CometChatException(K))}}))},t}();K.MessageController=ge},function(j,K,$){"use strict";K.__esModule=!0,K.UsersController=void 0;var ee=$(4),te=$(0),ne=function(){function t(){}return t.trasformJSONUser=function(j){var K;try{j.uid=j.uid.toString(),j.name=j.name.toString(),j.status&&"offline"!==j.status?j.status="online":j.status="offline",K=new ee.User(j),Object.assign(K,j),j=K}catch(j){te.Logger.error("UsersController:transformJSONUser",j)}return j},t}();K.UsersController=ne},function(j,K,$){(function(K){j.exports=function s(j,K,$){function E(te,ne){if(!K[te]){if(!j[te]){if(ee)return ee(te,!0);var re=new Error("Cannot find module '"+te+"'");throw re.code="MODULE_NOT_FOUND",re}var oe=K[te]={exports:{}};j[te][0].call(oe.exports,(function(K){return E(j[te][1][K]||K)}),oe,oe.exports,s,j,K,$)}return K[te].exports}for(var ee=!1,te=0;te<$.length;te++)E($[te]);return E}({1:[function(j,$,ee){(function(j){"use strict";var K,ee,te=j.MutationObserver||j.WebKitMutationObserver;if(te){var ne=0,re=new te(c),oe=j.document.createTextNode("");re.observe(oe,{characterData:!0}),K=function(){oe.data=ne=++ne%2}}else if(j.setImmediate||void 0===j.MessageChannel)K="document"in j&&"onreadystatechange"in j.document.createElement("script")?function(){var K=j.document.createElement("script");K.onreadystatechange=function(){c(),K.onreadystatechange=null,K.parentNode.removeChild(K),K=null},j.document.documentElement.appendChild(K)}:function(){setTimeout(c,0)};else{var ie=new j.MessageChannel;ie.port1.onmessage=c,K=function(){ie.port2.postMessage(0)}}var ae=[];function c(){var j,K;ee=!0;for(var $=ae.length;$;){for(K=ae,ae=[],j=-1;++j<$;)K[j]();$=ae.length}ee=!1}$.exports=function(j){1!==ae.push(j)||ee||K()}}).call(this,void 0!==K?K:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(j,K,$){"use strict";var ee=j(1);function c(){}var te={},ne=["REJECTED"],re=["FULFILLED"],oe=["PENDING"];function o(j){if("function"!=typeof j)throw new TypeError("resolver must be a function");this.state=oe,this.queue=[],this.outcome=void 0,j!==c&&p(this,j)}function E(j,K,$){this.promise=j,"function"==typeof K&&(this.onFulfilled=K,this.callFulfilled=this.otherCallFulfilled),"function"==typeof $&&(this.onRejected=$,this.callRejected=this.otherCallRejected)}function S(j,K,$){ee((function(){var ee;try{ee=K($)}catch(ee){return te.reject(j,ee)}ee===j?te.reject(j,new TypeError("Cannot resolve promise with itself")):te.resolve(j,ee)}))}function l(j){var K=j&&j.then;if(j&&("object"==typeof j||"function"==typeof j)&&"function"==typeof K)return function(){K.apply(j,arguments)}}function p(j,K){var $=!1;function o(K){$||($=!0,te.reject(j,K))}function s(K){$||($=!0,te.resolve(j,K))}var ee=C((function(){K(s,o)}));"error"===ee.status&&o(ee.value)}function C(j,K){var $={};try{$.value=j(K),$.status="success"}catch(j){$.status="error",$.value=j}return $}(K.exports=o).prototype.catch=function(j){return this.then(null,j)},o.prototype.then=function(j,K){if("function"!=typeof j&&this.state===re||"function"!=typeof K&&this.state===ne)return this;var $=new this.constructor(c);return this.state!==oe?S($,this.state===re?j:K,this.outcome):this.queue.push(new E($,j,K)),$},E.prototype.callFulfilled=function(j){te.resolve(this.promise,j)},E.prototype.otherCallFulfilled=function(j){S(this.promise,this.onFulfilled,j)},E.prototype.callRejected=function(j){te.reject(this.promise,j)},E.prototype.otherCallRejected=function(j){S(this.promise,this.onRejected,j)},te.resolve=function(j,K){var $=C(l,K);if("error"===$.status)return te.reject(j,$.value);var ee=$.value;if(ee)p(j,ee);else{j.state=re,j.outcome=K;for(var ne=-1,oe=j.queue.length;++ne<oe;)j.queue[ne].callFulfilled(K)}return j},te.reject=function(j,K){j.state=ne,j.outcome=K;for(var $=-1,ee=j.queue.length;++$<ee;)j.queue[$].callRejected(K);return j},o.resolve=function(j){return j instanceof this?j:te.resolve(new this(c),j)},o.reject=function(j){var K=new this(c);return te.reject(K,j)},o.all=function(j){var K=this;if("[object Array]"!==Object.prototype.toString.call(j))return this.reject(new TypeError("must be an array"));var $=j.length,ee=!1;if(!$)return this.resolve([]);for(var ne=new Array($),re=0,oe=-1,ie=new this(c);++oe<$;)E(j[oe],oe);return ie;function E(j,oe){K.resolve(j).then((function(j){ne[oe]=j,++re!==$||ee||(ee=!0,te.resolve(ie,ne))}),(function(j){ee||(ee=!0,te.reject(ie,j))}))}},o.race=function(j){var K=this;if("[object Array]"!==Object.prototype.toString.call(j))return this.reject(new TypeError("must be an array"));var $=j.length,ee=!1;if(!$)return this.resolve([]);for(var ne,re=-1,oe=new this(c);++re<$;)ne=j[re],K.resolve(ne).then((function(j){ee||(ee=!0,te.resolve(oe,j))}),(function(j){ee||(ee=!0,te.reject(oe,j))}));return oe}},{1:1}],3:[function(j,$,ee){(function(K){"use strict";"function"!=typeof K.Promise&&(K.Promise=j(2))}).call(this,void 0!==K?K:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(j,K,$){"use strict";var ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(j){return typeof j}:function(j){return j&&"function"==typeof Symbol&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},te=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(j){return}}();function i(j,K){j=j||[],K=K||{};try{return new Blob(j,K)}catch(te){if("TypeError"!==te.name)throw te;for(var $=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),ee=0;ee<j.length;ee+=1)$.append(j[ee]);return $.getBlob(K.type)}}"undefined"==typeof Promise&&j(3);var ne=Promise;function l(j,K){K&&j.then((function(j){K(null,j)}),(function(j){K(j)}))}function c(j,K,$){"function"==typeof K&&j.then(K),"function"==typeof $&&j.catch($)}function u(j){return"string"!=typeof j&&(j=String(j)),j}function r(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var re="local-forage-detect-blob-support",oe=void 0,ie={},ae=Object.prototype.toString,se="readonly",le="readwrite";function _(j){return"boolean"==typeof oe?ne.resolve(oe):(K=j,new ne((function(j){var $=K.transaction(re,le),ee=i([""]);$.objectStore(re).put(ee,"key"),$.onabort=function(K){K.preventDefault(),K.stopPropagation(),j(!1)},$.oncomplete=function(){var K=navigator.userAgent.match(/Chrome\/(\d+)/),$=navigator.userAgent.match(/Edge\//);j($||!K||43<=parseInt(K[1],10))}})).catch((function(){return!1}))).then((function(j){return oe=j}));var K}function g(j){var K=ie[j.name],$={};$.promise=new ne((function(j,K){$.resolve=j,$.reject=K})),K.deferredOperations.push($),K.dbReady?K.dbReady=K.dbReady.then((function(){return $.promise})):K.dbReady=$.promise}function h(j){var K=ie[j.name].deferredOperations.pop();if(K)return K.resolve(),K.promise}function A(j,K){var $=ie[j.name].deferredOperations.pop();if($)return $.reject(K),$.promise}function R(j,K){return new ne((function($,ee){if(ie[j.name]=ie[j.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},j.db){if(!K)return $(j.db);g(j),j.db.close()}var ne=[j.name];K&&ne.push(j.version);var oe=te.open.apply(te,ne);K&&(oe.onupgradeneeded=function(K){var $=oe.result;try{$.createObjectStore(j.storeName),K.oldVersion<=1&&$.createObjectStore(re)}catch(K){if("ConstraintError"!==K.name)throw K}}),oe.onerror=function(j){j.preventDefault(),ee(oe.error)},oe.onsuccess=function(){$(oe.result),h(j)}}))}function I(j){return R(j,!1)}function f(j){return R(j,!0)}function O(j,K){if(!j.db)return!0;var $=!j.db.objectStoreNames.contains(j.storeName),ee=j.version<j.db.version,te=j.version>j.db.version;if(ee&&(j.version,j.version=j.db.version),te||$){if($){var ne=j.db.version+1;ne>j.version&&(j.version=ne)}return!0}return!1}function N(j){var K=function(j){for(var K=j.length,$=new ArrayBuffer(K),ee=new Uint8Array($),te=0;te<K;te++)ee[te]=j.charCodeAt(te);return $}(atob(j.data));return i([K],{type:j.type})}function y(j){return j&&j.__local_forage_encoded_blob}function m(j){var K=this,$=K._initReady().then((function(){var j=ie[K._dbInfo.name];if(j&&j.dbReady)return j.dbReady}));return c($,j,j),$}function L(j,K,$,ee){void 0===ee&&(ee=1);try{var te=j.db.transaction(j.storeName,K);$(null,te)}catch(te){if(0<ee&&(!j.db||"InvalidStateError"===te.name||"NotFoundError"===te.name))return ne.resolve().then((function(){if(!j.db||"NotFoundError"===te.name&&!j.db.objectStoreNames.contains(j.storeName)&&j.version<=j.db.version)return j.db&&(j.version=j.db.version+1),f(j)})).then((function(){return function(j){g(j);for(var K=ie[j.name],$=K.forages,ee=0;ee<$.length;ee++){var te=$[ee];te._dbInfo.db&&(te._dbInfo.db.close(),te._dbInfo.db=null)}return j.db=null,I(j).then((function(K){return j.db=K,O(j)?f(j):K})).then((function(ee){j.db=K.db=ee;for(var te=0;te<$.length;te++)$[te]._dbInfo.db=ee})).catch((function(K){throw A(j,K),K}))}(j).then((function(){L(j,K,$,ee-1)}))})).catch($);$(te)}}var ce={_driver:"asyncStorage",_initStorage:function(j){var K=this,$={db:null};if(j)for(var ee in j)$[ee]=j[ee];var te=ie[$.name];te||(te={forages:[],db:null,dbReady:null,deferredOperations:[]},ie[$.name]=te),te.forages.push(K),K._initReady||(K._initReady=K.ready,K.ready=m);var re=[];function i(){return ne.resolve()}for(var oe=0;oe<te.forages.length;oe++){var ae=te.forages[oe];ae!==K&&re.push(ae._initReady().catch(i))}var se=te.forages.slice(0);return ne.all(re).then((function(){return $.db=te.db,I($)})).then((function(j){return $.db=j,O($,K._defaultConfig.version)?f($):j})).then((function(j){$.db=te.db=j,K._dbInfo=$;for(var ee=0;ee<se.length;ee++){var ne=se[ee];ne!==K&&(ne._dbInfo.db=$.db,ne._dbInfo.version=$.version)}}))},_support:function(){try{if(!te)return!1;var j="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),K="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!j||K)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(j){return!1}}(),iterate:function(j,K){var $=this,ee=new ne((function(K,ee){$.ready().then((function(){L($._dbInfo,se,(function(te,ne){if(te)return ee(te);try{var re=ne.objectStore($._dbInfo.storeName).openCursor(),oe=1;re.onsuccess=function(){var $=re.result;if($){var ee=$.value;y(ee)&&(ee=N(ee));var te=j(ee,$.key,oe++);void 0!==te?K(te):$.continue()}else K()},re.onerror=function(){ee(re.error)}}catch(te){ee(te)}}))})).catch(ee)}));return l(ee,K),ee},getItem:function(j,K){var $=this;j=u(j);var ee=new ne((function(K,ee){$.ready().then((function(){L($._dbInfo,se,(function(te,ne){if(te)return ee(te);try{var re=ne.objectStore($._dbInfo.storeName).get(j);re.onsuccess=function(){var j=re.result;void 0===j&&(j=null),y(j)&&(j=N(j)),K(j)},re.onerror=function(){ee(re.error)}}catch(te){ee(te)}}))})).catch(ee)}));return l(ee,K),ee},setItem:function(j,K,$){var ee=this;j=u(j);var te=new ne((function($,te){var re;ee.ready().then((function(){return re=ee._dbInfo,"[object Blob]"===ae.call(K)?_(re.db).then((function(j){return j?K:($=K,new ne((function(j,K){var ee=new FileReader;ee.onerror=K,ee.onloadend=function(K){var ee=btoa(K.target.result||"");j({__local_forage_encoded_blob:!0,data:ee,type:$.type})},ee.readAsBinaryString($)})));var $})):K})).then((function(K){L(ee._dbInfo,le,(function(ne,re){if(ne)return te(ne);try{var oe=re.objectStore(ee._dbInfo.storeName);null===K&&(K=void 0);var ie=oe.put(K,j);re.oncomplete=function(){void 0===K&&(K=null),$(K)},re.onabort=re.onerror=function(){var j=ie.error?ie.error:ie.transaction.error;te(j)}}catch(ne){te(ne)}}))})).catch(te)}));return l(te,$),te},removeItem:function(j,K){var $=this;j=u(j);var ee=new ne((function(K,ee){$.ready().then((function(){L($._dbInfo,le,(function(te,ne){if(te)return ee(te);try{var re=ne.objectStore($._dbInfo.storeName).delete(j);ne.oncomplete=function(){K()},ne.onerror=function(){ee(re.error)},ne.onabort=function(){var j=re.error?re.error:re.transaction.error;ee(j)}}catch(te){ee(te)}}))})).catch(ee)}));return l(ee,K),ee},clear:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){L(K._dbInfo,le,(function(ee,te){if(ee)return $(ee);try{var ne=te.objectStore(K._dbInfo.storeName).clear();te.oncomplete=function(){j()},te.onabort=te.onerror=function(){var j=ne.error?ne.error:ne.transaction.error;$(j)}}catch(ee){$(ee)}}))})).catch($)}));return l($,j),$},length:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){L(K._dbInfo,se,(function(ee,te){if(ee)return $(ee);try{var ne=te.objectStore(K._dbInfo.storeName).count();ne.onsuccess=function(){j(ne.result)},ne.onerror=function(){$(ne.error)}}catch(ee){$(ee)}}))})).catch($)}));return l($,j),$},key:function(j,K){var $=this,ee=new ne((function(K,ee){j<0?K(null):$.ready().then((function(){L($._dbInfo,se,(function(te,ne){if(te)return ee(te);try{var re=ne.objectStore($._dbInfo.storeName),oe=!1,ie=re.openCursor();ie.onsuccess=function(){var $=ie.result;$?0===j||oe?K($.key):(oe=!0,$.advance(j)):K(null)},ie.onerror=function(){ee(ie.error)}}catch(te){ee(te)}}))})).catch(ee)}));return l(ee,K),ee},keys:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){L(K._dbInfo,se,(function(ee,te){if(ee)return $(ee);try{var ne=te.objectStore(K._dbInfo.storeName).openCursor(),re=[];ne.onsuccess=function(){var K=ne.result;K?(re.push(K.key),K.continue()):j(re)},ne.onerror=function(){$(ne.error)}}catch(ee){$(ee)}}))})).catch($)}));return l($,j),$},dropInstance:function(j,K){K=r.apply(this,arguments);var $,ee=this.config();if((j="function"!=typeof j&&j||{}).name||(j.name=j.name||ee.name,j.storeName=j.storeName||ee.storeName),j.name){var re=j.name===ee.name&&this._dbInfo.db?ne.resolve(this._dbInfo.db):I(j).then((function(K){var $=ie[j.name],ee=$.forages;$.db=K;for(var te=0;te<ee.length;te++)ee[te]._dbInfo.db=K;return K}));$=j.storeName?re.then((function(K){if(K.objectStoreNames.contains(j.storeName)){var $=K.version+1;g(j);var ee=ie[j.name],re=ee.forages;K.close();for(var oe=0;oe<re.length;oe++){var ae=re[oe];ae._dbInfo.db=null,ae._dbInfo.version=$}var se=new ne((function(K,ee){var ne=te.open(j.name,$);ne.onerror=function(j){ne.result.close(),ee(j)},ne.onupgradeneeded=function(){ne.result.deleteObjectStore(j.storeName)},ne.onsuccess=function(){var j=ne.result;j.close(),K(j)}}));return se.then((function(j){ee.db=j;for(var K=0;K<re.length;K++){var $=re[K];$._dbInfo.db=j,h($._dbInfo)}})).catch((function(K){throw(A(j,K)||ne.resolve()).catch((function(){})),K}))}})):re.then((function(K){g(j);var $=ie[j.name],ee=$.forages;K.close();for(var re=0;re<ee.length;re++)ee[re]._dbInfo.db=null;var oe=new ne((function(K,$){var ee=te.deleteDatabase(j.name);ee.onerror=ee.onblocked=function(j){var K=ee.result;K&&K.close(),$(j)},ee.onsuccess=function(){var j=ee.result;j&&j.close(),K(j)}}));return oe.then((function(j){$.db=j;for(var K=0;K<ee.length;K++)h(ee[K]._dbInfo)})).catch((function(K){throw(A(j,K)||ne.resolve()).catch((function(){})),K}))}))}else $=ne.reject("Invalid arguments");return l($,K),$}},ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",de=/^~~local_forage_type~([^~]+)~/,pe="__lfsc__:",ge=pe.length,he="arbf",me="blob",fe=ge+he.length,ye=Object.prototype.toString;function b(j){var K,$,ee,te,ne,re=.75*j.length,oe=j.length,ie=0;"="===j[j.length-1]&&(re--,"="===j[j.length-2]&&re--);var ae=new ArrayBuffer(re),se=new Uint8Array(ae);for(K=0;K<oe;K+=4)$=ue.indexOf(j[K]),ee=ue.indexOf(j[K+1]),te=ue.indexOf(j[K+2]),ne=ue.indexOf(j[K+3]),se[ie++]=$<<2|ee>>4,se[ie++]=(15&ee)<<4|te>>2,se[ie++]=(3&te)<<6|63≠return ae}function B(j){var K,$=new Uint8Array(j),ee="";for(K=0;K<$.length;K+=3)ee+=ue[$[K]>>2],ee+=ue[(3&$[K])<<4|$[K+1]>>4],ee+=ue[(15&$[K+1])<<2|$[K+2]>>6],ee+=ue[63&$[K+2]];return $.length%3==2?ee=ee.substring(0,ee.length-1)+"=":$.length%3==1&&(ee=ee.substring(0,ee.length-2)+"=="),ee}var be={serialize:function(j,K){var $="";if(j&&($=ye.call(j)),j&&("[object ArrayBuffer]"===$||j.buffer&&"[object ArrayBuffer]"===ye.call(j.buffer))){var ee,te=pe;j instanceof ArrayBuffer?(ee=j,te+=he):(ee=j.buffer,"[object Int8Array]"===$?te+="si08":"[object Uint8Array]"===$?te+="ui08":"[object Uint8ClampedArray]"===$?te+="uic8":"[object Int16Array]"===$?te+="si16":"[object Uint16Array]"===$?te+="ur16":"[object Int32Array]"===$?te+="si32":"[object Uint32Array]"===$?te+="ui32":"[object Float32Array]"===$?te+="fl32":"[object Float64Array]"===$?te+="fl64":K(new Error("Failed to get type for BinaryArray"))),K(te+B(ee))}else if("[object Blob]"===$){var ne=new FileReader;ne.onload=function(){var $="~~local_forage_type~"+j.type+"~"+B(this.result);K(pe+me+$)},ne.readAsArrayBuffer(j)}else try{K(JSON.stringify(j))}catch($){K(null,$)}},deserialize:function(j){if(j.substring(0,ge)!==pe)return JSON.parse(j);var K,$=j.substring(fe),ee=j.substring(ge,fe);if(ee===me&&de.test($)){var te=$.match(de);K=te[1],$=$.substring(te[0].length)}var ne=b($);switch(ee){case he:return ne;case me:return i([ne],{type:K});case"si08":return new Int8Array(ne);case"ui08":return new Uint8Array(ne);case"uic8":return new Uint8ClampedArray(ne);case"si16":return new Int16Array(ne);case"ur16":return new Uint16Array(ne);case"si32":return new Int32Array(ne);case"ui32":return new Uint32Array(ne);case"fl32":return new Float32Array(ne);case"fl64":return new Float64Array(ne);default:throw new Error("Unkown type: "+ee)}},stringToBuffer:b,bufferToString:B};function V(j,K,$,ee){j.executeSql("CREATE TABLE IF NOT EXISTS "+K.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],$,ee)}function x(j,K,$,ee,te,ne){j.executeSql($,ee,te,(function(j,re){re.code===re.SYNTAX_ERR?j.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[K.storeName],(function(j,oe){oe.rows.length?ne(j,re):V(j,K,(function(){j.executeSql($,ee,te,ne)}),ne)}),ne):ne(j,re)}),ne)}function k(j,K,$,ee){var te=this;j=u(j);var re=new ne((function(ne,re){te.ready().then((function(){void 0===K&&(K=null);var oe=K,ie=te._dbInfo;ie.serializer.serialize(K,(function(K,ae){ae?re(ae):ie.db.transaction((function($){x($,ie,"INSERT OR REPLACE INTO "+ie.storeName+" (key, value) VALUES (?, ?)",[j,K],(function(){ne(oe)}),(function(j,K){re(K)}))}),(function(K){if(K.code===K.QUOTA_ERR){if(0<ee)return void ne(k.apply(te,[j,oe,$,ee-1]));re(K)}}))}))})).catch(re)}));return l(re,$),re}var ve={_driver:"webSQLStorage",_initStorage:function(j){var K=this,$={db:null};if(j)for(var ee in j)$[ee]="string"!=typeof j[ee]?j[ee].toString():j[ee];var te=new ne((function(j,ee){try{$.db=openDatabase($.name,String($.version),$.description,$.size)}catch(j){return ee(j)}$.db.transaction((function(te){V(te,$,(function(){K._dbInfo=$,j()}),(function(j,K){ee(K)}))}),ee)}));return $.serializer=be,te},_support:"function"==typeof openDatabase,iterate:function(j,K){var $=this,ee=new ne((function(K,ee){$.ready().then((function(){var te=$._dbInfo;te.db.transaction((function($){x($,te,"SELECT * FROM "+te.storeName,[],(function($,ee){for(var ne=ee.rows,re=ne.length,oe=0;oe<re;oe++){var ie=ne.item(oe),ae=ie.value;if(ae&&(ae=te.serializer.deserialize(ae)),void 0!==(ae=j(ae,ie.key,oe+1)))return void K(ae)}K()}),(function(j,K){ee(K)}))}))})).catch(ee)}));return l(ee,K),ee},getItem:function(j,K){var $=this;j=u(j);var ee=new ne((function(K,ee){$.ready().then((function(){var te=$._dbInfo;te.db.transaction((function($){x($,te,"SELECT * FROM "+te.storeName+" WHERE key = ? LIMIT 1",[j],(function(j,$){var ee=$.rows.length?$.rows.item(0).value:null;ee&&(ee=te.serializer.deserialize(ee)),K(ee)}),(function(j,K){ee(K)}))}))})).catch(ee)}));return l(ee,K),ee},setItem:function(j,K,$){return k.apply(this,[j,K,$,1])},removeItem:function(j,K){var $=this;j=u(j);var ee=new ne((function(K,ee){$.ready().then((function(){var te=$._dbInfo;te.db.transaction((function($){x($,te,"DELETE FROM "+te.storeName+" WHERE key = ?",[j],(function(){K()}),(function(j,K){ee(K)}))}))})).catch(ee)}));return l(ee,K),ee},clear:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){var ee=K._dbInfo;ee.db.transaction((function(K){x(K,ee,"DELETE FROM "+ee.storeName,[],(function(){j()}),(function(j,K){$(K)}))}))})).catch($)}));return l($,j),$},length:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){var ee=K._dbInfo;ee.db.transaction((function(K){x(K,ee,"SELECT COUNT(key) as c FROM "+ee.storeName,[],(function(K,$){var ee=$.rows.item(0).c;j(ee)}),(function(j,K){$(K)}))}))})).catch($)}));return l($,j),$},key:function(j,K){var $=this,ee=new ne((function(K,ee){$.ready().then((function(){var te=$._dbInfo;te.db.transaction((function($){x($,te,"SELECT key FROM "+te.storeName+" WHERE id = ? LIMIT 1",[j+1],(function(j,$){var ee=$.rows.length?$.rows.item(0).key:null;K(ee)}),(function(j,K){ee(K)}))}))})).catch(ee)}));return l(ee,K),ee},keys:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){var ee=K._dbInfo;ee.db.transaction((function(K){x(K,ee,"SELECT key FROM "+ee.storeName,[],(function(K,$){for(var ee=[],te=0;te<$.rows.length;te++)ee.push($.rows.item(te).key);j(ee)}),(function(j,K){$(K)}))}))})).catch($)}));return l($,j),$},dropInstance:function(j,K){K=r.apply(this,arguments);var $=this.config();(j="function"!=typeof j&&j||{}).name||(j.name=j.name||$.name,j.storeName=j.storeName||$.storeName);var ee,te=this;return l(ee=j.name?new ne((function(K){var ee,re;ee=j.name===$.name?te._dbInfo.db:openDatabase(j.name,"","",0),j.storeName?K({db:ee,storeNames:[j.storeName]}):K((re=ee,new ne((function(j,K){re.transaction((function($){$.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(K,$){for(var ee=[],te=0;te<$.rows.length;te++)ee.push($.rows.item(te).name);j({db:re,storeNames:ee})}),(function(j,$){K($)}))}),(function(j){K(j)}))}))))})).then((function(j){return new ne((function(K,$){j.db.transaction((function(ee){function t(j){return new ne((function(K,$){ee.executeSql("DROP TABLE IF EXISTS "+j,[],(function(){K()}),(function(j,K){$(K)}))}))}for(var te=[],re=0,oe=j.storeNames.length;re<oe;re++)te.push(t(j.storeNames[re]));ne.all(te).then((function(){K()})).catch((function(j){$(j)}))}),(function(j){$(j)}))}))})):ne.reject("Invalid arguments"),K),ee}};function H(j,K){var $=j.name+"/";return j.storeName!==K.storeName&&($+=j.storeName+"/"),$}function W(){return!function(){var j="_localforage_support_test";try{return localStorage.setItem(j,!0),localStorage.removeItem(j),!1}catch(j){return!0}}()||0<localStorage.length}var Me={_driver:"localStorageWrapper",_initStorage:function(j){var K={};if(j)for(var $ in j)K[$]=j[$];return K.keyPrefix=H(j,this._defaultConfig),W()?((this._dbInfo=K).serializer=be,ne.resolve()):ne.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(j){return!1}}(),iterate:function(j,K){var $=this,ee=$.ready().then((function(){for(var K=$._dbInfo,ee=K.keyPrefix,te=ee.length,ne=localStorage.length,re=1,oe=0;oe<ne;oe++){var ie=localStorage.key(oe);if(0===ie.indexOf(ee)){var ae=localStorage.getItem(ie);if(ae&&(ae=K.serializer.deserialize(ae)),void 0!==(ae=j(ae,ie.substring(te),re++)))return ae}}}));return l(ee,K),ee},getItem:function(j,K){var $=this;j=u(j);var ee=$.ready().then((function(){var K=$._dbInfo,ee=localStorage.getItem(K.keyPrefix+j);return ee&&(ee=K.serializer.deserialize(ee)),ee}));return l(ee,K),ee},setItem:function(j,K,$){var ee=this;j=u(j);var te=ee.ready().then((function(){void 0===K&&(K=null);var $=K;return new ne((function(te,ne){var re=ee._dbInfo;re.serializer.serialize(K,(function(K,ee){if(ee)ne(ee);else try{localStorage.setItem(re.keyPrefix+j,K),te($)}catch(K){"QuotaExceededError"!==K.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==K.name||ne(K),ne(K)}}))}))}));return l(te,$),te},removeItem:function(j,K){var $=this;j=u(j);var ee=$.ready().then((function(){var K=$._dbInfo;localStorage.removeItem(K.keyPrefix+j)}));return l(ee,K),ee},clear:function(j){var K=this,$=K.ready().then((function(){for(var j=K._dbInfo.keyPrefix,$=localStorage.length-1;0<=$;$--){var ee=localStorage.key($);0===ee.indexOf(j)&&localStorage.removeItem(ee)}}));return l($,j),$},length:function(j){var K=this.keys().then((function(j){return j.length}));return l(K,j),K},key:function(j,K){var $=this,ee=$.ready().then((function(){var K,ee=$._dbInfo;try{K=localStorage.key(j)}catch(ee){K=null}return K&&(K=K.substring(ee.keyPrefix.length)),K}));return l(ee,K),ee},keys:function(j){var K=this,$=K.ready().then((function(){for(var j=K._dbInfo,$=localStorage.length,ee=[],te=0;te<$;te++){var ne=localStorage.key(te);0===ne.indexOf(j.keyPrefix)&&ee.push(ne.substring(j.keyPrefix.length))}return ee}));return l($,j),$},dropInstance:function(j,K){if(K=r.apply(this,arguments),!(j="function"!=typeof j&&j||{}).name){var $=this.config();j.name=j.name||$.name,j.storeName=j.storeName||$.storeName}var ee,te=this;return l(ee=j.name?new ne((function(K){j.storeName?K(H(j,te._defaultConfig)):K(j.name+"/")})).then((function(j){for(var K=localStorage.length-1;0<=K;K--){var $=localStorage.key(K);0===$.indexOf(j)&&localStorage.removeItem($)}})):ne.reject("Invalid arguments"),K),ee}},X=function(j,K){for(var $=j.length,ee=0;ee<$;){if((te=j[ee])===(ne=K)||"number"==typeof te&&"number"==typeof ne&&isNaN(te)&&isNaN(ne))return!0;ee++}var te,ne;return!1},Ee=Array.isArray||function(j){return"[object Array]"===Object.prototype.toString.call(j)},Se={},Ce={},_e={INDEXEDDB:ce,WEBSQL:ve,LOCALSTORAGE:Me},Te=[_e.INDEXEDDB._driver,_e.WEBSQL._driver,_e.LOCALSTORAGE._driver],Ae=["dropInstance"],Ie=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ae),Ne={description:"",driver:Te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ot(j,K){j[K]=function(){var $=arguments;return j.ready().then((function(){return j[K].apply(j,$)}))}}function st(){for(var j=1;j<arguments.length;j++){var K=arguments[j];if(K)for(var $ in K)K.hasOwnProperty($)&&(Ee(K[$])?arguments[0][$]=K[$].slice():arguments[0][$]=K[$])}return arguments[0]}var Oe=function(){function s(j){for(var K in function(j,K){if(!(j instanceof K))throw new TypeError("Cannot call a class as a function")}(this,s),_e)if(_e.hasOwnProperty(K)){var $=_e[K],ee=$._driver;this[K]=ee,Se[ee]||this.defineDriver($)}this._defaultConfig=st({},Ne),this._config=st({},this._defaultConfig,j),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return s.prototype.config=function(j){if("object"!==(void 0===j?"undefined":ee(j)))return"string"==typeof j?this._config[j]:this._config;if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var K in j){if("storeName"===K&&(j[K]=j[K].replace(/\W/g,"_")),"version"===K&&"number"!=typeof j[K])return new Error("Database version must be a number.");this._config[K]=j[K]}return!("driver"in j&&j.driver)||this.setDriver(this._config.driver)},s.prototype.defineDriver=function(j,K,$){var ee=new ne((function(K,$){try{var ee=j._driver,te=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!j._driver)return void $(te);for(var re=Ie.concat("_initStorage"),oe=0,ie=re.length;oe<ie;oe++){var ae=re[oe];if((!X(Ae,ae)||j[ae])&&"function"!=typeof j[ae])return void $(te)}!function(){for(var t=function(j){return function(){var K=new Error("Method "+j+" is not implemented by the current driver"),$=ne.reject(K);return l($,arguments[arguments.length-1]),$}},K=0,$=Ae.length;K<$;K++){var ee=Ae[K];j[ee]||(j[ee]=t(ee))}}();var c=function($){Se[ee],Se[ee]=j,Ce[ee]=$,K()};"_support"in j?j._support&&"function"==typeof j._support?j._support().then(c,$):c(!!j._support):c(!0)}catch(te){$(te)}}));return c(ee,K,$),ee},s.prototype.driver=function(){return this._driver||null},s.prototype.getDriver=function(j,K,$){var ee=Se[j]?ne.resolve(Se[j]):ne.reject(new Error("Driver not found."));return c(ee,K,$),ee},s.prototype.getSerializer=function(j){var K=ne.resolve(be);return c(K,j),K},s.prototype.ready=function(j){var K=this,$=K._driverSet.then((function(){return null===K._ready&&(K._ready=K._initDriver()),K._ready}));return c($,j,j),$},s.prototype.setDriver=function(j,K,$){var ee=this;Ee(j)||(j=[j]);var te=this._getSupportedDrivers(j);function i(){ee._config.driver=ee.driver()}function a(j){return ee._extend(j),i(),ee._ready=ee._initStorage(ee._config),ee._ready}var re=null!==this._driverSet?this._driverSet.catch((function(){return ne.resolve()})):ne.resolve();return this._driverSet=re.then((function(){var j=te[0];return ee._dbInfo=null,ee._ready=null,ee.getDriver(j).then((function(j){var K;ee._driver=j._driver,i(),ee._wrapLibraryMethodsWithReady(),ee._initDriver=(K=te,function(){var j=0;function o(){for(;j<K.length;){var $=K[j];return j++,ee._dbInfo=null,ee._ready=null,ee.getDriver($).then(a).catch(o)}i();var te=new Error("No available storage method found.");return ee._driverSet=ne.reject(te),ee._driverSet}return o()})}))})).catch((function(){i();var j=new Error("No available storage method found.");return ee._driverSet=ne.reject(j),ee._driverSet})),c(this._driverSet,K,$),this._driverSet},s.prototype.supports=function(j){return!!Ce[j]},s.prototype._extend=function(j){st(this,j)},s.prototype._getSupportedDrivers=function(j){for(var K=[],$=0,ee=j.length;$<ee;$++){var te=j[$];this.supports(te)&&K.push(te)}return K},s.prototype._wrapLibraryMethodsWithReady=function(){for(var j=0,K=Ie.length;j<K;j++)ot(this,Ie[j])},s.prototype.createInstance=function(j){return new s(j)},s}(),we=new Oe;K.exports=we},{3:3}]},{},[4])(4)}).call(this,$(39))},function(j,K,$){"use strict";K.__esModule=!0,K.FETCH_ERROR=K.TYPINGNOTIFICATION_CONSTANTS=K.LOGIN_ERROR=K.MESSAGE_ERRORS=K.MESSAGES_REQUEST_ERRORS=K.USERS_REQUEST_ERRORS=K.GROUP_CREATION_ERRORS=K.INIT_ERROR=K.ERRORS=K.SERVER_ERRORS=void 0,K.SERVER_ERRORS={AUTH_ERR:{code:"AUTH_ERR_AUTH_TOKEN_NOT_FOUND",message:"The auth token %s% does not exist. Please make sure you are logged in and have a valid auth token or try login again."}},K.ERRORS={PARAMETER_MISSING:{code:"MISSING_PARAMETERS",name:"Invalid or no parameter passed to the method."}},K.INIT_ERROR={NO_APP_ID:{code:K.ERRORS.PARAMETER_MISSING.code,name:K.ERRORS.PARAMETER_MISSING.name,message:"AppID cannot be empty. Please specify a valid appID.",details:{}}},K.GROUP_CREATION_ERRORS={EMPTY_PASSWORD:{code:"ERR_EMPTY_GROUP_PASS",details:void 0,message:"Password is mandatory to join a group.",name:void 0}},K.USERS_REQUEST_ERRORS={EMPTY_USERS_LIST:{code:"EMPTY_USERS_LIST",name:"EMPTY_USERS_LIST",message:"The users list needs to have atleast one UID.",details:{}}},K.MESSAGES_REQUEST_ERRORS={REQUEST_IN_PROGRESS_ERROR:{code:"REQUEST_IN_PROGRESS",name:"REQUEST_IN_PROGRESS",message:"Request in progress.",details:{}},NOT_ENOUGH_PARAMS:{code:"NOT_ENOUGH_PARAMETERS",name:"NOT_ENOUGH_PARAMETERS",message:"`Timestamp`, `MessageId` or `updatedAfter` is required to use the 'fetchNext()' method.",details:{}}},K.MESSAGE_ERRORS={INVALID_CUSTOM_DATA:{code:"-1",name:"%s_CUSTOM_DATA",message:"",details:{}}},K.LOGIN_ERROR={NOT_INITIALIZED:{code:"-1",name:"COMETCHAT_INITIALIZATION_NOT_DONE",message:"please initialize the cometchat before using login method.",details:{}},UNAUTHORISED:{code:401,name:"USER_NOT_AUTHORISED",message:"The `authToken` of the user is not authorised. Please verify again.",details:{}},WS_CONNECTION_FAIL:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. %s",details:{}},WS_CONNECTION_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. Trying to connect with port: %s",details:{}},WS_CONNECTION_FALLBACK_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FALLBACK_FAIL",message:"WS Connection fallback failed. Trying to connect with port: %s",details:{}},WS_AUTH_FAIL:{code:-1,name:"WS_AUTH_FAIL",message:"WS username/password not correct.",details:{}},NO_INTERNET:{code:-1,name:"NO_INTERNET_CONNECTION",message:"You do not have internet connection.",details:{}},REQUEST_IN_PROGRESS:{code:-1,name:"LOGIN_IN_PROGRESS",message:"Please wait until the previous login request ends.",details:{}}},K.TYPINGNOTIFICATION_CONSTANTS={TOO_MANY_REQUEST:{code:"TOO_MANY_REQUEST",name:"TOO MANY REQUEST",message:"too many request, wait for `%s` seconds before sending next request.",details:{}}},K.FETCH_ERROR={ERROR_IN_API_CALL:{code:"FAILED_TO_FETCH",name:"FAILED_TO_FETCH",message:"There is an unknown issue with the API request. Please check your internet connection and verify the api call.",details:{}}}},function(j,K,$){"use strict";K.__esModule=!0,K.LocalStorage=void 0;var ee=$(0),te=$(1),ne=$(12),re=$(3),oe=$(2),ie=function(){function t(j){this.store=te.constants.DEFAULT_STORE,ee.isFalsy(j)||(this.store=j),this.localStore=ne.createInstance({name:ee.format(te.LOCAL_STORE.STORE_STRING,re.CometChat.getAppId(),te.LOCAL_STORE.COMMON_STORE)}),this.localStore.setDriver([ne.LOCALSTORAGE,ne.INDEXEDDB,ne.WEBSQL])}return t.getInstance=function(){return null==t.localStorage&&(t.localStorage=new t),t.localStorage},t.prototype.set=function(j,K){return this.localStore.setItem(j,JSON.stringify(K))},t.prototype.remove=function(j){this.localStore.removeItem(j)},t.prototype.update=function(j,K){this.remove(j),this.set(j,K)},t.prototype.get=function(j){var K=this;return new Promise((function($,ee){try{K.localStore.getItem(j).then((function(j){try{$(JSON.parse(j))}catch(K){$(j)}}),(function(j){ee(j)}))}catch(j){ee(new oe.CometChatException(j))}}))},t.prototype.clearStore=function(){var j=this;return new Promise((function(K,$){try{j.localStore.keys().then((function($){if(0<$.length)for(var ee=0;ee<$.length;ee++)"appId"!==$[ee]&&j.localStore.removeItem($[ee]),ee===$.length-1&&K(!0)}))}catch(j){$(j)}}))},t.prototype.clear=function(j){},t.prototype.selectStore=function(j){this.store=j},t.localStorage=null,t}();K.LocalStorage=ie},function(j,K,$){"use strict";K.__esModule=!0,K.GroupsController=void 0;var ee=$(8),te=$(1),ne=$(0),re=function(){function t(){}return t.trasformJSONGroup=function(j){var K;try{K=new ee.Group(j[te.GroupConstants.KEYS.GUID],j[te.GroupConstants.KEYS.NAME],j[te.GroupConstants.KEYS.TYPE]),j.wsChannel&&delete j.wsChannel,Object.assign(K,j),j=K}catch(j){ne.Logger.error("GroupsController:transformJSONGroup",j)}return j},t}();K.GroupsController=re},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.TextMessage=void 0;var re=$(7),oe=$(1),ie=$(4),ae=$(8),se=$(0),le=function(j){function t(K,$,ee){var te=j.call(this,K,"text",ee,oe.MessageCategory.MESSAGE)||this;return te.type="text",te.data={text:$},te.text=$,te}return te(t,j),t.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},t.prototype.getReceiver=function(){try{return this.getReceiverFromData()}catch(j){return this.receiver}},t.prototype.getMetadata=function(){return this.data.metadata&&(this.metadata=this.data.metadata),this.metadata},t.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},t.prototype.getData=function(){return this.data},t.prototype.setData=function(j){this.data=j},t.prototype.getText=function(){return this.text},t.prototype.setText=function(j){this.text=j,this.data.text=j},t.prototype.setProcessedText=function(j){this.processedText=j},t.prototype.getProcessedText=function(){return this.processedText},t.prototype.getTags=function(){return this.tags},t.prototype.setTags=function(j){this.tags=j},t.prototype.getSenderFromData=function(){try{var j=this.getData();if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])return new ie.User(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])}catch(j){se.Logger.error("TextMessageModel: getSenderFromData",j)}},t.prototype.getReceiverFromData=function(){try{var j=this.getData(),K=j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY];if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITYTYPE]==[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITY_TYPE.USER])return new ie.User(K);var $=new ae.Group(K[oe.GroupConstants.KEYS.GUID],K[oe.GroupConstants.KEYS.NAME],K[oe.MessageConstatnts.KEYS.TYPE]);return Object.assign($,K)}catch(j){se.Logger.error("TextMessageModel: getReceiverFromData",j)}},t.TYPE=oe.MessageConstatnts.TYPE.TEXT,t.RECEIVER_TYPE=oe.MessageConstatnts.RECEIVER_TYPE,t.CATEGORY=oe.MessageConstatnts.CATEGORY.MESSAGE,t}(re.BaseMessage);K.TextMessage=le},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.MediaMessage=void 0;var re=$(7),oe=$(1),ie=$(4),ae=$(18),se=$(8),le=$(0),ce=function(j){function t(K,$,ee,te){var ne=j.call(this,K,ee,te,oe.MessageCategory.MESSAGE)||this;return ne.data={},"object"!=typeof $?ne.data={url:$}:$&&(0<$.length?ne.files=$:ne.files=[$]),ne}return te(t,j),t.prototype.setCaption=function(j){this.caption=j,this.data[oe.MessageConstatnts.KEYS.TEXT]=j},t.prototype.getCaption=function(){return this.data[oe.MessageConstatnts.KEYS.TEXT]},t.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},t.prototype.getReceiver=function(){try{return this.getReceiverFromData()}catch(j){return this.receiver}},t.prototype.getMetadata=function(){return this.data.metadata&&(this.metadata=this.data.metadata),this.metadata},t.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},t.prototype.getData=function(){return this.data},t.prototype.setData=function(j){this.data=j},t.prototype.getAttachment=function(){return new ae.Attachment(this.data.attachments[0])},t.prototype.setAttachment=function(j){this.data.attachments=[ae.Attachment.toJSON(j)]},t.prototype.getAttachments=function(){var j=[];if(this.data.attachments&&0<this.data.attachments.length)for(var K=0;K<this.data.attachments.length;K++)j.push(new ae.Attachment(this.data.attachments[K]));return j},t.prototype.setAttachments=function(j){var K=[];if(j&&0<j.length)for(var $=0;$<j.length;$++)K.push(ae.Attachment.toJSON(j[$]));this.data.attachments=K},t.prototype.getURL=function(){try{var j=this.getData();if(j[oe.MessageConstatnts.KEYS.URL])return j[oe.MessageConstatnts.KEYS.URL]}catch(j){le.Logger.error("MediaMessageModel: getURL",j)}},t.prototype.getTags=function(){return this.tags},t.prototype.setTags=function(j){this.tags=j},t.prototype.getSenderFromData=function(){try{var j=this.getData();if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])return new ie.User(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])}catch(j){le.Logger.error("MediaMessageModel: getSenderFromData",j)}},t.prototype.getReceiverFromData=function(){try{var j=this.getData(),K=j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY];if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITYTYPE]==[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITY_TYPE.USER])return new ie.User(K);var $=new se.Group(K[oe.GroupConstants.KEYS.GUID],K[oe.GroupConstants.KEYS.NAME],K[oe.MessageConstatnts.KEYS.TYPE]);return Object.assign($,K)}catch(j){le.Logger.error("MediaMessageModel: getReceiverFromData",j)}},t.TYPE=oe.MessageConstatnts.TYPE,t.RECEIVER_TYPE=oe.MessageConstatnts.RECEIVER_TYPE,t.CATEGORY=oe.MessageConstatnts.CATEGORY,t}(re.BaseMessage);K.MediaMessage=ce},function(j,K,$){"use strict";K.__esModule=!0,K.Attachment=void 0;var ee=$(1),te=function(){function e(j){j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.EXTENSION)&&(this.extension=j[ee.ATTACHMENTS_CONSTANTS.KEYS.EXTENSION]),j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.MIME_TYPE)&&(this.mimeType=j[ee.ATTACHMENTS_CONSTANTS.KEYS.MIME_TYPE]),j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.NAME)&&(this.name=j[ee.ATTACHMENTS_CONSTANTS.KEYS.NAME]),j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.SIZE)&&(this.size=j[ee.ATTACHMENTS_CONSTANTS.KEYS.SIZE]),j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.URL)&&(this.url=j[ee.ATTACHMENTS_CONSTANTS.KEYS.URL])}return e.prototype.createFileFromJSON=function(j){return new e(j)},e.toJSON=function(j){return{extension:j.getExtension(),mimeType:j.getMimeType(),name:j.getName(),url:j.getUrl(),size:j.getSize()}},e.prototype.getExtension=function(){return this.extension},e.prototype.setExtension=function(j){this.extension=j},e.prototype.getMimeType=function(){return this.mimeType},e.prototype.setMimeType=function(j){this.mimeType=j},e.prototype.getName=function(){return this.name},e.prototype.setName=function(j){this.name=j},e.prototype.getSize=function(){return this.size},e.prototype.setSize=function(j){this.size=j},e.prototype.getUrl=function(){return this.url},e.prototype.setUrl=function(j){this.url=j},e}();K.Attachment=te},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.CustomMessage=void 0;var re=$(7),oe=$(1),ie=$(4),ae=$(0),se=$(8),le=function(j){function t(){for(var K=[],$=0;$<arguments.length;$++)K[$]=arguments[$];var ee=this;if(3==K.length){var te=K[0],ne=K[1],re=K[2];ee=j.call(this,te,oe.MessageConstatnts.TYPE.CUSTOM,ne,oe.MessageCategory.MESSAGE)||this,("object"!=typeof re||Array.isArray(re))&&(re={}),ee.customData=re,ae.isFalsy(ee.data)&&(ee.data={}),ee.data[oe.MessageConstatnts.KEYS.CUSTOM_DATA]=re}if(4==K.length){te=K[0],ne=K[1];var ie=K[2];re=K[3],ee=j.call(this,te,ie,ne,oe.MessageCategory.CUSTOM)||this,("object"!=typeof re||Array.isArray(re))&&(re={}),ee.customData=re,ae.isFalsy(ee.data)&&(ee.data={}),ee.data[oe.MessageConstatnts.KEYS.CUSTOM_DATA]=re}return ee}return te(t,j),t.prototype.getCustomData=function(){return this.customData},t.prototype.setCustomData=function(j){this.customData=j,this.data[oe.MessageConstatnts.KEYS.CUSTOM_DATA]=j},t.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},t.prototype.getReceiver=function(){try{return this.getReceiverFromData()}catch(j){return this.receiver}},t.prototype.getSubType=function(){return this.subType},t.prototype.setSubType=function(j){this.subType=j,this.data=ne(ne({},this.data),{subType:j})},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},t.prototype.getData=function(){return this.data},t.prototype.getTags=function(){return this.tags},t.prototype.setTags=function(j){this.tags=j},t.prototype.getSenderFromData=function(){try{var j=this.getData();if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])return new ie.User(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])}catch(j){ae.Logger.error("CustomMessageModel: getSenderFromData",j)}},t.prototype.getReceiverFromData=function(){try{var j=this.getData(),K=j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY];if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITYTYPE]==[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITY_TYPE.USER])return new ie.User(K);var $=new se.Group(K[oe.GroupConstants.KEYS.GUID],K[oe.GroupConstants.KEYS.NAME],K[oe.MessageConstatnts.KEYS.TYPE]);return Object.assign($,K)}catch(j){ae.Logger.error("CustomMessageModel: getReceiverFromData",j)}},t}(re.BaseMessage);K.CustomMessage=le},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.Action=void 0;var re=$(7),oe=$(8),ie=$(4),ae=$(1),se=$(0),le=$(10),ce=function(j){function e(){return null!==j&&j.apply(this,arguments)||this}return te(e,j),e.actionFromJSON=function(j){var K=new this(j[ae.MessageConstatnts.KEYS.RECEIVER],j[ae.MessageConstatnts.KEYS.TYPE],j[ae.MessageConstatnts.KEYS.RECEIVER_TYPE],ae.MessageCategory.ACTION),$=j[ae.MessageConstatnts.KEYS.DATA];if(K.data=$,K.setAction($[ae.MessageConstatnts.KEYS.ACTION]),$[ae.ActionConstatnts.ACTION_KEYS.EXTRAS]){var ee=$[ae.ActionConstatnts.ACTION_KEYS.EXTRAS];if(ee[ae.ActionConstatnts.ACTION_KEYS.SCOPE]){var te=ee[ae.ActionConstatnts.ACTION_KEYS.SCOPE];te[ae.ActionConstatnts.ACTION_KEYS.NEW]&&te[ae.ActionConstatnts.ACTION_KEYS.OLD]&&(K.setOldScope(te[ae.ActionConstatnts.ACTION_KEYS.OLD]),K.setNewScope(te[ae.ActionConstatnts.ACTION_KEYS.NEW]))}}$[ae.MessageConstatnts.KEYS.METADATA]&&K.setMetadata($[ae.MessageConstatnts.KEYS.METADATA]);var ne=$[ae.ActionConstatnts.ACTION_KEYS.ENTITIES];if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY])if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.USER){var re=new ie.User(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]);Object.assign(re,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionBy=re,K.setSender(re)}else{var se=new oe.Group("","","");Object.assign(se,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionBy=se}if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR]&&(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.USER?(re=new ie.User(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),Object.assign(re,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionFor=re):(se=new oe.Group("","",""),Object.assign(se,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionFor=se)),ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON])if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.USER)re=new ie.User(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),Object.assign(re,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionOn=re;else if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.GROUP)se=new oe.Group("","",""),Object.assign(se,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionOn=se;else if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.MESSAGE){var ce=le.MessageController.trasformJSONMessge(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY]);K.actionOn=ce}return K.setMessage(K.getActionMessage(K)),K},e.prototype.getOldScope=function(){return this.oldScope},e.prototype.setOldScope=function(j){this.oldScope=j},e.prototype.getNewScope=function(){return this.newScope},e.prototype.setNewScope=function(j){this.newScope=j},e.prototype.getRawData=function(){return this.rawData},e.prototype.setRawData=function(j){this.rawData=j},e.prototype.getMessage=function(){return this.message},e.prototype.setMessage=function(j){this.message=j},e.prototype.getAction=function(){return this.action},e.prototype.setAction=function(j){this.action=j},e.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},e.prototype.getActionBy=function(){return this.actionBy},e.prototype.setActionBy=function(j){this.actionBy=j},e.prototype.getActionOn=function(){return this.actionOn},e.prototype.setActionOn=function(j){this.actionOn=j},e.prototype.getActionFor=function(){return this.actionFor},e.prototype.setActionFor=function(j){this.actionFor=j},e.prototype.getMetadata=function(){return this.data.metadata&&(this.metadata=this.data.metadata),this.metadata},e.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},e.prototype.getActionMessage=function(j){var K="";switch(j.getType()){case ae.ActionConstatnts.ACTION_KEYS.ACTION_TYPE_USER:case ae.ActionConstatnts.ACTION_KEYS.ACTION_TYPE_GROUP:switch(j.getAction()){case ae.ActionConstatnts.ACTION_KEYS.ACTION_CREATED:case ae.ActionConstatnts.ACTION_KEYS.ACTION_UPDATED:case ae.ActionConstatnts.ACTION_KEYS.ACTION_DELETED:}break;case ae.ActionConstatnts.ACTION_KEYS.ACTION_TYPE_GROUP_MEMBER:switch(j.getAction()){case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_JOINED:var $=j.getActionBy();K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_GROUP_JOINED_MESSAGE,$.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_LEFT:$=j.getActionBy(),K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_GROUP_LEFT_MESSAGE,$.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_KICKED:$=j.getActionBy();var ee=j.getActionOn();K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_KICKED_MESSAGE,$.getName(),ee.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_BANNED:$=j.getActionBy(),ee=j.getActionOn(),K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_BANNED_MESSAGE,$.getName(),ee.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_UNBANNED:$=j.getActionBy(),ee=j.getActionOn(),K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_UNBANNED_MESSAGE,$.getName(),ee.getName());break;case ae.ActionConstatnts.ACTION_KEYS.ACTION_SCOPE_CHANGED:$=j.getActionBy(),ee=j.getActionOn();var te=j.getNewScope();K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_SCOPE_CHANGED,$.getName(),ee.getName(),te);break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_ADDED:$=j.getActionBy(),ee=j.getActionOn(),K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_ADDED_TO_GROUP,$.getName(),ee.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MESSAGE_EDITED:K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MESSAGE_EDITED_MESSAGE,"");break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MESSAGE_DELETED:K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MESSAGE_DELETED_MESSAGE,"")}}return K},e.prototype.getSenderFromData=function(){var j=this.data[ae.ActionConstatnts.ACTION_KEYS.ENTITIES];if(j[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY]&&j[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.USER){var K=new ie.User(j[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]);return Object.assign(K,j[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K}},e.TYPE=ae.MessageConstatnts.TYPE,e.RECEIVER_TYPE=ae.MessageConstatnts.RECEIVER_TYPE,e.CATEGORY=ae.MessageConstatnts.CATEGORY,e.ACTION_TYPE=ae.ActionConstatnts.ACTION_TYPE,e}(re.BaseMessage);K.Action=ce},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.Call=void 0;var re=$(7),oe=$(8),ie=$(1),ae=$(0),se=$(4),le=function(j){function t(K,$,ee,te){return ae.isFalsy(te)?j.call(this,K,$,ee,ie.MessageCategory.CALL)||this:j.call(this,K,$,ee,te)||this}return te(t,j),t.prototype.getCallInitiator=function(){return this.getCallInitiatedByFromData()},t.prototype.setCallInitiator=function(j){this.callInitiator=j},t.prototype.getCallReceiver=function(){return this.getCallReceivedByFromData()},t.prototype.setCallReceiver=function(j){this.callReceiver=j},t.prototype.getData=function(){return this.data},t.prototype.setData=function(j){this.data=j},t.prototype.getSessionId=function(){return this.sessionId},t.prototype.setSessionId=function(j){this.sessionId=j},t.prototype.getMetadata=function(){return this.data.metadata&&(this.metadata=this.data.metadata),this.metadata},t.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},t.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},t.prototype.getAction=function(){return this.action},t.prototype.setAction=function(j){this.action=j},t.prototype.getInitiatedAt=function(){return this.initiatedAt},t.prototype.setInitiatedAt=function(j){this.initiatedAt=j},t.prototype.getJoinedAt=function(){return this.joinedAt},t.prototype.setJoinedAt=function(j){this.joinedAt=j},t.prototype.getRawData=function(){return this.rawData},t.prototype.setRawData=function(j){this.rawData=j},t.callFromJSON=function(j){try{var K=new this(j[ie.MessageConstatnts.KEYS.RECEIVER],j[ie.MessageConstatnts.KEYS.TYPE],j[ie.MessageConstatnts.KEYS.RECEIVER_TYPE],ie.MessageCategory.CALL),$=j[ie.MessageConstatnts.KEYS.DATA];K.setAction($[ie.MessageConstatnts.KEYS.ACTION]),$[ie.MessageConstatnts.KEYS.METADATA]&&K.setMetadata($[ie.MessageConstatnts.KEYS.METADATA]);var ee=$[ie.ActionConstatnts.ACTION_KEYS.ENTITIES];if(ee[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY]&&ee[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY],ee[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON]){var te=ee[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON];if(te[ie.CallConstants.CALL_KEYS.CALL_ENTITY]){var ne=te[ie.CallConstants.CALL_KEYS.CALL_ENTITY];if(ne[ie.CallConstants.CALL_KEYS.CALL_SESSION_ID]&&(K.sessionId=ne[ie.CallConstants.CALL_KEYS.CALL_SESSION_ID]),ne[ie.CallConstants.CALL_KEYS.CALL_STATUS]&&(K.status=ne[ie.CallConstants.CALL_KEYS.CALL_STATUS]),ne[ie.CallConstants.CALL_KEYS.CALL_DATA]){var re=ne[ie.CallConstants.CALL_KEYS.CALL_DATA];re[ie.CallConstants.CALL_KEYS.CALL_METADATA]&&(K.metadata=re[ie.CallConstants.CALL_KEYS.CALL_METADATA]),re[ie.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES]&&re[ie.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES]}ne[ie.CallConstants.CALL_KEYS.CALL_INITIATED_AT]&&(K.initiatedAt=ne[ie.CallConstants.CALL_KEYS.CALL_INITIATED_AT]),ne[ie.CallConstants.CALL_KEYS.CALL_JOINED_AT]&&(K.joinedAt=ne[ie.CallConstants.CALL_KEYS.CALL_JOINED_AT]),ne[ie.CallConstants.CALL_KEYS.CALL_LEFT_AT]&&(K.joinedAt=ne[ie.CallConstants.CALL_KEYS.CALL_LEFT_AT])}}return K}catch(j){ae.Logger.error("CallModel: callFromJSON",j)}},t.prototype.getSenderFromData=function(){try{var j=this.getData();if((j=j[ie.ActionConstatnts.ACTION_KEYS.ENTITIES])[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ie.CallConstants.CALL_KEYS.CALL_ENTITY])return new se.User(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ie.CallConstants.CALL_KEYS.CALL_ENTITY])}catch(j){ae.Logger.error("CallModel:getSenderFromData",j)}},t.prototype.getCallInitiatedByFromData=function(){try{var j=this.getData();if((j=j[ie.ActionConstatnts.ACTION_KEYS.ENTITIES])[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.CallConstants.CALL_KEYS.CALL_DATA][ie.ActionConstatnts.ACTION_KEYS.ENTITIES][ie.CallConstants.CALL_KEYS.CALL_SENDER])return new se.User(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.CallConstants.CALL_KEYS.CALL_DATA][ie.ActionConstatnts.ACTION_KEYS.ENTITIES][ie.CallConstants.CALL_KEYS.CALL_SENDER][ie.CallConstants.CALL_KEYS.CALL_ENTITY])}catch(j){ae.Logger.error("CallModel:getCallInitiatedByFromData",j)}},t.prototype.getCallReceivedByFromData=function(){try{var j=this.getData();if((j=j[ie.ActionConstatnts.ACTION_KEYS.ENTITIES])[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY]){if(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY_TYPE]==ie.CallConstants.CALL_KEYS.CALL_ENTITY_USER)return new se.User(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY]);var K=new oe.Group(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.GroupConstants.KEYS.GUID],j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.GroupConstants.KEYS.NAME],j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.GroupConstants.KEYS.TYPE]);return Object.assign(K,j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY])}}catch(j){ae.Logger.error("CallModel:getCallReceivedByFromData",j)}},t.TYPE=ie.MessageConstatnts.TYPE,t.RECEIVER_TYPE=ie.MessageConstatnts.RECEIVER_TYPE,t.CATEGORY=ie.MessageConstatnts.CATEGORY,t.ACTION_TYPE=ie.ActionConstatnts.ACTION_TYPE,t}(re.BaseMessage);K.Call=le},function(j,K,$){"use strict";K.__esModule=!0,K.MessageReceipt=void 0;var ee=function(){function t(){this.RECEIPT_TYPE={READ_RECEIPT:"read",DELIVERY_RECEIPT:"delivery"},this.receiptType=this.RECEIPT_TYPE.DELIVERY_RECEIPT}return t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(j){this.receiver=j},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(j){this.timestamp=j},t.prototype.setReadAt=function(j){this.readAt=j},t.prototype.getReadAt=function(){return this.readAt},t.prototype.setDeliveredAt=function(j){this.deliveredAt=j},t.prototype.getDeliveredAt=function(){return this.deliveredAt},t.prototype.getMessageId=function(){return this.messageId},t.prototype.setMessageId=function(j){this.messageId=j},t.prototype.getReceiptType=function(){return this.receiptType},t.prototype.setReceiptType=function(j){void 0===j&&(j=this.RECEIPT_TYPE.DELIVERY_RECEIPT),this.receiptType=j},t}();K.MessageReceipt=ee},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.WSConnectionListener=K.UserLoginListener=K.CallsListener=K.UserCallListener=K.GroupsListener=K.UsersListener=K.MessagesListener=K.Listener=K.ConnectionListener=K.LoginListener=K.OngoingCallListener=K.GroupListener=K.UserListener=K.CallListener=K.MessageListener=void 0;var ne=$(0),r=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];this.onTextMessageReceived=void 0,this.onMediaMessageReceived=void 0,this.onCustomMessageReceived=void 0,this.onTypingStarted=void 0,this.onTypingEnded=void 0,this.onMessagesDelivered=void 0,this.onMessagesRead=void 0,this.onMessageEdited=void 0,this.onMessageDeleted=void 0,this.onTransientMessageReceived=void 0,ne.isFalsy(j[0].onTextMessageReceived)||(this.onTextMessageReceived=j[0].onTextMessageReceived),ne.isFalsy(j[0].onMediaMessageReceived)||(this.onMediaMessageReceived=j[0].onMediaMessageReceived),ne.isFalsy(j[0].onTypingStarted)||(this.onTypingStarted=j[0].onTypingStarted),ne.isFalsy(j[0].onTypingEnded)||(this.onTypingEnded=j[0].onTypingEnded),ne.isFalsy(j[0].onMessagesDelivered)||(this.onMessagesDelivered=j[0].onMessagesDelivered),ne.isFalsy(j[0].onMessagesRead)||(this.onMessagesRead=j[0].onMessagesRead),ne.isFalsy(j[0].onCustomMessageReceived)||(this.onCustomMessageReceived=j[0].onCustomMessageReceived),ne.isFalsy(j[0].onMessageEdited)||(this.onMessageEdited=j[0].onMessageEdited),ne.isFalsy(j[0].onMessageDeleted)||(this.onMessageDeleted=j[0].onMessageDeleted),ne.isFalsy(j[0].onTransientMessageReceived)||(this.onTransientMessageReceived=j[0].onTransientMessageReceived)};K.MessageListener=r;var a=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];this.onIncomingCallReceived=void 0,this.onOutgoingCallAccepted=void 0,this.onOutgoingCallRejected=void 0,this.onIncomingCallCancelled=void 0,ne.isFalsy(j[0].onIncomingCallReceived)||(this.onIncomingCallReceived=j[0].onIncomingCallReceived),ne.isFalsy(j[0].onOutgoingCallAccepted)||(this.onOutgoingCallAccepted=j[0].onOutgoingCallAccepted),ne.isFalsy(j[0].onOutgoingCallRejected)||(this.onOutgoingCallRejected=j[0].onOutgoingCallRejected),ne.isFalsy(j[0].onIncomingCallCancelled)||(this.onIncomingCallCancelled=j[0].onIncomingCallCancelled)};K.CallListener=a;var E=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];ne.isFalsy(j[0].onUserOnline)||(this.onUserOnline=j[0].onUserOnline),ne.isFalsy(j[0].onUserOffline)||(this.onUserOffline=j[0].onUserOffline)};K.UserListener=E;var c=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];ne.isFalsy(j[0].onGroupMemberJoined)||(this.onGroupMemberJoined=j[0].onGroupMemberJoined),ne.isFalsy(j[0].onGroupMemberLeft)||(this.onGroupMemberLeft=j[0].onGroupMemberLeft),ne.isFalsy(j[0].onGroupMemberKicked)||(this.onGroupMemberKicked=j[0].onGroupMemberKicked),ne.isFalsy(j[0].onGroupMemberBanned)||(this.onGroupMemberBanned=j[0].onGroupMemberBanned),ne.isFalsy(j[0].onGroupMemberUnbanned)||(this.onGroupMemberUnbanned=j[0].onGroupMemberUnbanned),ne.isFalsy(j[0].onGroupMemberScopeChanged)||(this.onGroupMemberScopeChanged=j[0].onGroupMemberScopeChanged),ne.isFalsy(j[0].onMemberAddedToGroup)||(this.onGroupMemberAddedToGroup=j[0].onMemberAddedToGroup)};K.GroupListener=c;var u=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];ne.isFalsy(j[0].onYouLeft)||(this.onYouLeft=j[0].onYouLeft),ne.isFalsy(j[0].onYouJoined)||(this.onYouJoined=j[0].onYouJoined),ne.isFalsy(j[0].onUserJoined)||(this.onUserJoined=j[0].onUserJoined),ne.isFalsy(j[0].onUserLeft)||(this.onUserLeft=j[0].onUserLeft),ne.isFalsy(j[0].onUserListUpdated)||(this.onUserListUpdated=j[0].onUserListUpdated),ne.isFalsy(j[0].onMediaDeviceListUpdated)||(this.onMediaDeviceListUpdated=j[0].onMediaDeviceListUpdated),ne.isFalsy(j[0].onRecordingStarted)||(this.onRecordingStarted=j[0].onRecordingStarted),ne.isFalsy(j[0].onRecordingStopped)||(this.onRecordingStopped=j[0].onRecordingStopped),ne.isFalsy(j[0].onScreenShareStarted)||(this.onScreenShareStarted=j[0].onScreenShareStarted),ne.isFalsy(j[0].onScreenShareStopped)||(this.onScreenShareStopped=j[0].onScreenShareStopped),ne.isFalsy(j[0].onUserMuted)||(this.onUserMuted=j[0].onUserMuted),ne.isFalsy(j[0].onCallSwitchedToVideo)||(this.onCallSwitchedToVideo=j[0].onCallSwitchedToVideo),ne.isFalsy(j[0].onCallEnded)||(this.onCallEnded=j[0].onCallEnded),ne.isFalsy(j[0].onError)||(this.onError=j[0].onError)};K.OngoingCallListener=u;var S=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];ne.isFalsy(j[0].loginSuccess)||(this.loginSuccess=j[0].loginSuccess),ne.isFalsy(j[0].loginFailure)||(this.loginFailure=j[0].loginFailure),ne.isFalsy(j[0].logoutSuccess)||(this.logoutSuccess=j[0].logoutSuccess),ne.isFalsy(j[0].logoutFailure)||(this.logoutFailure=j[0].logoutFailure)};K.LoginListener=S;var l=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];this.onConnected=void 0,this.inConnecting=void 0,this.onDisconnected=void 0,this.onFeatureThrottled=void 0,ne.isFalsy(j[0].onConnected)||(this.onConnected=j[0].onConnected),ne.isFalsy(j[0].inConnecting)||(this.inConnecting=j[0].inConnecting),ne.isFalsy(j[0].onDisconnected)||(this.onDisconnected=j[0].onDisconnected),ne.isFalsy(j[0].onFeatureThrottled)||(this.onFeatureThrottled=j[0].onFeatureThrottled)};K.ConnectionListener=l;var p=function(j,K){this._name=j,this._callback=K},re=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(K.Listener=p);K.MessagesListener=re;var oe=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(p);K.UsersListener=oe;var ie=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(p);K.GroupsListener=ie;var ae=function(j){function t(K,$,ee){var te=j.call(this,"callListner",ee)||this;return te._eventListener=K,te}return te(t,j),t}(p);K.UserCallListener=ae;var se=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ne}return te(t,j),t}(p);K.CallsListener=se;var le=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(p);K.UserLoginListener=le;var ce=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(p);K.WSConnectionListener=ce},function(j,K,$){"use strict";K.__esModule=!0,K.ConversationController=void 0;var ee=$(35),te=$(0),ne=function(){function t(){}return t.trasformJSONConversation=function(j,K,$,ne,re,oe){var ie;try{ie=new ee.Conversation(j,K,$,ne,re,oe)}catch(j){te.Logger.error("ConversationController:transformJSONConversation",j)}return ie},t}();K.ConversationController=ne},function(j,K,$){"use strict";K.__esModule=!0,K.MessageListnerMaping=void 0;var ee=$(0),te=$(1),ne=$(12),re=$(3),oe=function(){function t(j){this.store=te.constants.DEFAULT_STORE,ee.isFalsy(j)||(this.store=j),this.settingsStore=ne.createInstance({name:ee.format(te.LOCAL_STORE.STORE_STRING,re.CometChat.getAppId(),te.LOCAL_STORE.MESSAGE_LISTENERS_LIST)}),this.settingsStore.setDriver([ne.LOCALSTORAGE,ne.INDEXEDDB,ne.WEBSQL])}return t.getInstance=function(){return null==t.settingsStore&&(t.settingsStore=new t),t.settingsStore},t.prototype.set=function(j,K){return this.settingsStore.setItem(j,K)},t.prototype.remove=function(j){this.settingsStore.removeItem(j)},t.prototype.get=function(j){return this.settingsStore.getItem(j)},t.prototype.clearStore=function(){return this.settingsStore.clear()},t.prototype.clear=function(j){},t.prototype.selectStore=function(j){this.store=j},t.settingsStore=null,t}();K.MessageListnerMaping=oe},function(j,K,$){"use strict";K.__esModule=!0,K.TypingIndicator=void 0;var ee=function(){function t(j,K,$){this.receiverId=j,this.receiverType=K,this.metadata=$}return t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getReceiverId=function(){return this.receiverId},t.prototype.setReceiverId=function(j){this.receiverId=j},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(j){this.metadata=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t}();K.TypingIndicator=ee},function(j,K,$){"use strict";K.__esModule=!0,K.TransientMessage=void 0;var ee=function(){function t(j,K,$){this.receiverId=j,this.receiverType=K,this.data=$||{}}return t.prototype.getReceiverId=function(){return this.receiverId},t.prototype.setReceiverId=function(j){this.receiverId=j},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getData=function(){return this.data},t.prototype.setData=function(j){this.data=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t}();K.TransientMessage=ee},function(j,K,$){"use strict";K.__esModule=!0,K.EndpointFactory=void 0;var ee=$(0),te=$(1),ne=$(14),re=$(3),oe=$(2),ie=function(){function a(){this.baseUrl="https://%s.apiclient-%s.cometchat.io/",this.apiVersion=te.APPINFO.apiVersion,this.adminApiUrl="https://%s.api-%s.cometchat.io/",this.adminApiVersion=te.APPINFO.apiVersion,this.extensionApi="https://%s-%s.%s/%s",this.prosodyApi="https://%s.%s/%s",this.wsApi="https://%s/%s",this.uriEndpoints={authToken:{endpoint:"users/{{uid}}/auth_tokens",method:"POST",data:{uid:"string|max:100"},isAdminApi:!0},appSettings:{endpoint:"settings",method:"GET"},login:{endpoint:"admin/users/auth",method:"POST",data:{uid:"string|max:100"}},logout:{endpoint:"admin/users/auth/{{authToken}}",method:"DELETE"},getMyDetails:{endpoint:"me",method:"GET"},updateMyDetails:{endpoint:"me",method:"PUT"},getJWT:{endpoint:"me/jwt",method:"POST"},users:{endpoint:"users",method:"GET"},user:{endpoint:"users/{{uid}}",method:"GET"},blockUsers:{endpoint:"blockedusers",method:"POST"},blockedUsersList:{endpoint:"blockedusers",method:"GET"},unblockUsers:{endpoint:"blockedusers",method:"DELETE"},userLogout:{endpoint:"me",method:"DELETE"},createUser:{endpoint:"users",method:"POST",isAdminApi:!0},updateUser:{endpoint:"users/{{uid}}",method:"PUT",isAdminApi:!0},sendFriendRequests:{endpoint:"user/friends",method:"POST",data:{uids:"array<string|max:100>"}},getFriends:{endpoint:"user/friends",method:"GET"},unfriend:{endpoint:"user/friends/{{uid}}/{{gid}}",method:"DELETE",data:{uids:"array<string|max:100>"}},acceptFriendRequest:{endpoint:"user/friends/{{uid}}/accept",method:"PUT",data:{uids:"array<string|max:100>"}},rejectFriendRequest:{endpoint:"user/friends/{{uid}}/reject",method:"DELETE",data:{uids:"array<string|max:100>"}},createGroup:{endpoint:"groups",method:"POST",data:{guid:"required|string|max:100",name:"required|string|max:100",type:"enum|public,protected,password",password:"filled|string|max:100"}},getGroups:{endpoint:"groups",method:"GET"},getGroup:{endpoint:"groups/{{guid}}",method:"GET"},updateGroup:{endpoint:"groups/{{guid}}",method:"PUT"},deleteGroup:{endpoint:"groups/{{guid}}",method:"DELETE"},addGroupMembers:{endpoint:"groups/{{guid}}/members",method:"POST",data:{uids:"array<string|max:100>"}},getGroupMembers:{endpoint:"groups/{{guid}}/members",method:"GET"},joinGroup:{endpoint:"groups/{{guid}}/members",method:"POST"},leaveGroup:{endpoint:"groups/{{guid}}/members",method:"DELETE"},kickGroupMembers:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"DELETE",data:{uids:"array<string|max:100>"}},changeScopeOfMember:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"PUT",data:{uids:"array<string|max:100>"}},banGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"POST",data:{uids:"array<string|max:100>"}},unbanGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"DELETE",data:{uids:"array<string|max:100>"}},addMemebersToGroup:{endpoint:"groups/{{guid}}/members",method:"PUT"},getBannedGroupMembers:{endpoint:"groups/{{guid}}/bannedusers",method:"GET"},promotemoteGroupMember:{endpoint:"groups/{{guid}}/promote",method:"PUT",data:{uids:"array<string|max:100>"}},demoteGroupMember:{endpoint:"groups/{{guid}}/demote",method:"DELETE",data:{uids:"array<string|max:100>"}},transferOwnership:{endpoint:"groups/{{guid}}/owner",method:"PATCH"},sendMessage:{endpoint:"messages",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},sendMessageInThread:{endpoint:"messages/{{parentId}}/thread",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},getMessages:{endpoint:"messages",method:"GET"},getMessageDetails:{endpoint:"messages/{{messageId}}",method:"GET"},getUserMessages:{endpoint:"users/{{listId}}/messages",method:"GET"},getGroupMessages:{endpoint:"groups/{{listId}}/messages",method:"GET"},getThreadMessages:{endpoint:"messages/{{listId}}/thread",method:"GET"},getMessage:{endpoint:"user/messages/{{muid}}",method:"GET"},updateMessage:{endpoint:"messages/{{messageId}}",method:"PUT"},deleteMessage:{endpoint:"messages/{{messageId}}",method:"DELETE"},createCallSession:{endpoint:"calls",method:"POST",data:{}},updateCallSession:{endpoint:"calls/{{sessionid}}",method:"put",data:{}},getConversations:{endpoint:"conversations",method:"GET"},getUserConversation:{endpoint:"users/{{uid}}/conversation",method:"GET"},getGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"GET"},deleteUserConversation:{endpoint:"users/{{uid}}/conversation",method:"DELETE"},deleteGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"DELETE"},updateUserConversation:{endpoint:"users/{{uid}}/conversation",method:"PUT"},updateGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"PUT"},updateCallType:{endpoint:"calls/{{sessionid}}/type",method:"PATCH"}}}return a.prototype.getEndpointData=function(j){return new Promise((function(K,$){try{var ie=re.CometChat.appSettings.getAdminHost(),ae=re.CometChat.appSettings.getClientHost();ne.LocalStorage.getInstance().get(te.LOCAL_STORE.KEY_APP_SETTINGS).then((function($){if(ee.isFalsy($)){var ne={};if((new a).uriEndpoints.hasOwnProperty(j))if((ne=(new a).uriEndpoints[j]).hasOwnProperty("isAdminApi"))if(ee.isFalsy(ie)){var oe=ee.format((new a).adminApiUrl,re.CometChat.getAppId(),re.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+ne.endpoint;ne.endpoint=oe}else oe="https://"+ie+"/"+ne.endpoint,ne.endpoint=oe;else ee.isFalsy(ae)?(oe=ee.format((new a).baseUrl,re.CometChat.getAppId(),re.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+ne.endpoint,ne.endpoint=oe):(oe="https://"+ae+"/"+ne.endpoint,ne.endpoint=oe);K(ne)}else ne={},(new a).uriEndpoints.hasOwnProperty(j)&&((ne=(new a).uriEndpoints[j]).hasOwnProperty("isAdminApi")?ne.endpoint="https://"+$[te.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+$[te.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+ne.endpoint:ne.endpoint="https://"+$[te.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+$[te.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+ne.endpoint),K(ne)}),(function($){var te;(new a).uriEndpoints.hasOwnProperty(j)&&((te=(new a).uriEndpoints[j]).hasOwnProperty(["isAdminApi"])?ee.isFalsy(ie)?te.endpoint=ee.format((new a).adminApiUrl,re.CometChat.getAppId(),re.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+te.endpoint:te.endpoint="https://"+ie+"/"+te.endpoint:ee.isFalsy(ae)?te.endpoint=ee.format((new a).baseUrl,re.CometChat.getAppId(),re.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+te.endpoint:te.endpoint="https://"+ae+"/"+te.endpoint),K(te)}))}catch(j){$(new oe.CometChatException(j))}}))},a}();K.EndpointFactory=ie},function(j,K,$){"use strict";K.__esModule=!0,K.getEndPoint=void 0;var ee=$(28),te=$(2);K.getEndPoint=function(j,K){void 0===j&&(j=""),void 0===K&&(K={});var $=new ee.EndpointFactory;return new Promise((function(ee,ne){try{$.getEndpointData(j).then((function(j){var $=j;if($){for(var te in K)$.endpoint=$.endpoint.replace("{{"+te+"}}",K[te]);ee($)}else ne({error:"Unknown endPoint name."})}))}catch(j){ne(new te.CometChatException(j))}}))}},function(j,K,$){"use strict";K.__esModule=!0,K.KeyStore=void 0;var ee=$(3),te=$(0),ne=$(1),re=$(12),oe=$(2),ie=function(){function t(j){this.store=ne.constants.DEFAULT_STORE,te.isFalsy(j)||(this.store=j),this.keyStore=re.createInstance({name:te.format(ne.LOCAL_STORE.STORE_STRING,ee.CometChat.getAppId(),ne.LOCAL_STORE.KEYS_STORE)}),this.keyStore.setDriver([re.LOCALSTORAGE,re.INDEXEDDB,re.WEBSQL])}return t.getInstance=function(){return null==t.KeyStore&&(t.KeyStore=new t),t.KeyStore},t.prototype.set=function(j,K){return this.keyStore.setItem(j,K)},t.prototype.remove=function(j){this.keyStore.removeItem(j)},t.prototype.get=function(j){var K=this;return new Promise((function($,ee){try{K.keyStore.getItem(j).then((function(j){try{$(JSON.parse(j))}catch(K){$(j)}}),(function(j){ee(j)}))}catch(j){ee(new oe.CometChatException(j))}}))},t.prototype.clearStore=function(){return this.keyStore.clear()},t}();K.KeyStore=ie},function(j,K,$){"use strict";K.__esModule=!0,K.CallController=void 0;var ee=$(1),te=$(0),ne=$(3),re=$(2),oe=$(23),ie=$(32),ae=$(4),se=$(6),le=function(){function g(){this.TAG="calling Log",this.CALL_NO_ANSWER_INTERVAL=45e3,this.view=void 0,this.isDev=!1}return g.prototype.getCallListner=function(){return g.callListner},g.prototype.setCallListner=function(j){g.callListner=new oe.UserCallListener(j)},g.getInstance=function(){try{return null!=this.callController&&null!=this.callController||(this.callController=new g),this.callController}catch(j){te.Logger.error("CallController: getInstance",j)}},g.prototype.getActiveCall=function(){try{return te.isFalsy(this.call)?null:this.call}catch(j){te.Logger.error("CallController: getActiveCall",j)}},g.prototype.initiateCall=function(j){var K=this;return new Promise((function($,ne){try{te.isFalsy(K.call)?null!=j&&null!=j?(K.call=j,K.startCallTimer(),$(j)):ne(new re.CometChatException(ee.CALL_ERROR.ERROR_IN_CALLING)):ne(new re.CometChatException(ee.CALL_ERROR.CALL_ALREADY_INITIATED))}catch($){ne(new re.CometChatException($))}}))},g.prototype.endCall=function(j){var K=this;try{document.getElementsByName("frame").forEach((function(j){K.view&&(K.view.removeChild(j),K.view=void 0)})),this.endCallSession()}catch(j){te.Logger.error("CallController: endCall",j)}},g.prototype.onCallStarted=function(j){var K=this;return new Promise((function($,ne){try{te.isFalsy(K.call)?null!=j&&null!=j?$(K.call=j):ne(new re.CometChatException(ee.CALL_ERROR.ERROR_IN_CALLING)):ne(new re.CometChatException(ee.CALL_ERROR.CALL_ALREADY_INITIATED))}catch($){ne(new re.CometChatException($))}}))},g.prototype.endCallSession=function(){try{this.call=void 0,g.callController=void 0,this.timer&&this.stopCallTimer(),this.view=void 0,this.removeListener(),g.callScreen=null,g.callSettings=null}catch(j){te.Logger.error("CallController:EndCallSession",{e:j})}},g.prototype.startCallTimer=function(){var j=this;try{this.timer=setTimeout((function(){j.call?ne.CometChat.sendUnansweredResponse(j.call.getSessionId()).then((function(K){j.endCallSession()}),(function(K){j.endCallSession()})):j.endCallSession()}),this.CALL_NO_ANSWER_INTERVAL)}catch(j){te.Logger.error("CallController: startCallTimer",j)}},g.prototype.stopCallTimer=function(){try{clearTimeout(this.timer)}catch(j){te.Logger.error("CallController: stopCallTimer",j)}},g.prototype.startCall=function(j,K){var $=this;try{this.timer&&this.stopCallTimer();var ee=document.createElement("iframe");this.getCallUrl().then((function(te){ee.src=te+"",ee.name="frame",ee.setAttribute("allow","camera; microphone; display-capture;"),ee.setAttribute("width","100%"),ee.setAttribute("height","100%"),g.callScreen=ee,g.callSettings=j,K&&($.view=K),K.appendChild(ee),$.addListener()}))}catch(j){te.Logger.error("CallController: startCall",j)}},g.prototype.addListener=function(){window.addEventListener("message",this.handler,!0)},g.prototype.removeListener=function(){window.removeEventListener("message",this.handler,!0)},g.prototype.handler=function(j){var K,$=this,re=g.callSettings,oe=g.callScreen,ie=g.getInstance().getActiveCall();try{if(void 0!==(K=JSON.parse(j.data))&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.HANGUP)g.deviceList=null,ie?(te.Logger.info(this.TAG,g.callListner),window.setTimeout((function(){ne.CometChat.endCall(ie.getSessionId(),!0).then((function(j){te.Logger.info($.TAG,{call:j})})).catch((function(j){te.Logger.info($.TAG,"The Call Was Already Ended")}))}),1e3)):ne.CometChat.endCall(re.getSessionId(),!0).then((function(j){te.Logger.info($.TAG,{call:j})})).catch((function(j){te.Logger.info($.TAG,"The Call Was Already Ended")}));else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.USER_JOINED){if(K.value){var le=void 0,ce=K.value;te.isFalsy(ce.uid)||te.isFalsy(ce.name)||((le=new ae.User(ce)).setStatus("online"),ne.CometChat.user.getUid().toLowerCase()!=le.getUid().toLowerCase()&&g.callListner&&(te.isFalsy(g.callListner._eventListener.onUserJoined)||g.callListner._eventListener.onUserJoined(le)))}}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.USER_LEFT)K.value&&(le=void 0,ce=K.value,te.isFalsy(ce.uid)||te.isFalsy(ce.name)||((le=new ae.User(ce)).setStatus("online"),ne.CometChat.user.getUid().toLowerCase()!=le.getUid().toLowerCase()&&g.callListner&&(te.isFalsy(g.callListner._eventListener.onUserLeft)||g.callListner._eventListener.onUserLeft(le))));else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.USER_LIST_CHANGED){var ue=[];K.value&&0<K.value.length&&(K.value.map((function(j){if(!te.isFalsy(j.uid)&&!te.isFalsy(j.name)){var K=new ae.User(j);K.setStatus("online"),ue.push(K)}})),g.callListner&&(te.isFalsy(g.callListner._eventListener.onUserListUpdated)||g.callListner._eventListener.onUserListUpdated(ue)))}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.INITIAL_DEVICE_LIST)te.Logger.info("initialDeviceList received in SDK = ",K),K.value&&(g.deviceList=K.value);else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.DEVICE_CHANGE){if(te.Logger.info("onDeviceChange received in SDK = ",K),K.value){g.deviceList=K.value;var de=g.getAvailableDeviceObject(g.deviceList);g.callListner&&(te.isFalsy(g.callListner._eventListener.onMediaDeviceListUpdated)||g.callListner._eventListener.onMediaDeviceListUpdated(de))}}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.RECORDING_TOGGLED){if(te.Logger.info("onRecordingToggled received in SDK = ",K),K.value&&(fe=K.value).hasOwnProperty("user")&&fe.hasOwnProperty("recordingStarted")&&!te.isFalsy(fe.user.uid)&&!te.isFalsy(fe.user.name)){var pe=new ae.User(fe.user);pe.setStatus("online");var ge=fe.recordingStarted;g.callListner&&(ge?te.isFalsy(g.callListner._eventListener.onRecordingStarted)||g.callListner._eventListener.onRecordingStarted(pe):te.isFalsy(g.callListner._eventListener.onRecordingStopped)||g.callListner._eventListener.onRecordingStopped(pe))}}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.USER_MUTED){if(te.Logger.info("onUserMuted received in SDK = ",K),K.value&&(fe=K.value).hasOwnProperty("muted")&&fe.hasOwnProperty("mutedBy")&&!te.isFalsy(fe.muted.uid)&&!te.isFalsy(fe.muted.name)&&!te.isFalsy(fe.mutedBy.uid)&&!te.isFalsy(fe.mutedBy.name)){var he=new ae.User(fe.muted);he.setStatus("online");var me=new ae.User(fe.mutedBy);me.setStatus("online"),g.callListner&&(te.isFalsy(g.callListner._eventListener.onUserMuted)||g.callListner._eventListener.onUserMuted(he,me))}}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.SCREEN_SHARE_STARTED)g.callListner&&(te.isFalsy(g.callListner._eventListener.onScreenShareStarted)||g.callListner._eventListener.onScreenShareStarted(null));else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.SCREEN_SHARE_STOPPED)g.callListner&&(te.isFalsy(g.callListner._eventListener.onScreenShareStopped)||g.callListner._eventListener.onScreenShareStopped(null));else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.SWITCHED_TO_VIDEO_CALL){if(K.value){var fe=K.value;if(te.Logger.info("onCallSwitchedToVideo received in SDK = ",fe),fe.hasOwnProperty("initiator")&&fe.hasOwnProperty("sessionId")&&!te.isFalsy(fe.initiator.uid)&&!te.isFalsy(fe.sessionId)&&fe.hasOwnProperty("accepted")&&!te.isFalsy(fe.accepted.uid)){var ye=fe.sessionId,be=new ae.User(fe.initiator);be.setStatus("online");var ve=new ae.User(fe.accepted);if(ve.setStatus("online"),g.getInstance().getCallListner()&&(te.isFalsy(g.getInstance().getCallListner()._eventListener.onCallSwitchedToVideo)||g.getInstance().getCallListner()._eventListener.onCallSwitchedToVideo(ye,be,ve)),fe.initiator.uid.toLowerCase()===ne.CometChat.user.getUid().toLowerCase()&&!fe.sessionId.includes("v1."))try{se.makeApiCall("updateCallType",{sessionid:ye},{type:"video"}).then((function(j){}),(function(j){te.Logger.error("CallController :: onSwitchedToVideo",j)}))}catch(j){te.Logger.error("CallController :: onSwitchedToVideo",j)}}}}else void 0!==K&&K.type&&K.action&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.LOAD&&null!=oe.contentWindow&&oe.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.COMETCHAT_RTC_SETTINGS,callsettings:JSON.stringify(re)},"*")}catch(j){K=void 0,te.Logger.error("CallController: startCall",j)}},g.prototype.getCallUrl=function(){var j=this,K=void 0;return new Promise((function($,ne){try{j.isDev?(K="https://rtc-test.cometchat.io/?v="+ee.CALLING_COMPONENT_VERSION,$(K)):te.getAppSettings().then((function(j){K="https://"+j[ee.APP_SETTINGS.KEYS.WEBRTC_WEB_FRONTEND_HOST]+"/?v="+ee.CALLING_COMPONENT_VERSION,$(K)}))}catch(j){ne(new re.CometChatException(j))}}))},g.getAvailableDeviceArray=function(j){var K=[];try{return j&&0<j.length&&j.map((function(j){K.push(new ie.MediaDevice(j.deviceId,j.label,j.active))})),K}catch(j){return te.Logger.error("CallController: getAvailableDeviceArray",j),K}},g.getAvailableDeviceObject=function(j){var K=[],$=[],ne=[];try{return te.isFalsy(j)||te.isFalsy(j[ee.CallConstants.AUDIO_INPUT_DEVICES])||(K=g.getAvailableDeviceArray(j[ee.CallConstants.AUDIO_INPUT_DEVICES])),te.isFalsy(j)||te.isFalsy(j[ee.CallConstants.AUDIO_OUTPUT_DEVICES])||($=g.getAvailableDeviceArray(j[ee.CallConstants.AUDIO_OUTPUT_DEVICES])),te.isFalsy(j)||te.isFalsy(j[ee.CallConstants.VIDEO_INPUT_DEVICES])||(ne=g.getAvailableDeviceArray(j[ee.CallConstants.VIDEO_INPUT_DEVICES])),{audioInputDevices:K,audioOutputDevices:$,videoInputDevices:ne}}catch(j){return te.Logger.error("CallController: getAvailableDeviceObject",j),{audioInputDevices:K,audioOutputDevices:$,videoInputDevices:ne}}},g.prototype.getAudioInputDevices=function(){var j=[];try{return te.isFalsy(g.deviceList)||te.isFalsy(g.deviceList[ee.CallConstants.AUDIO_INPUT_DEVICES])||(j=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.AUDIO_INPUT_DEVICES])),j}catch(K){return te.Logger.error("CallController: getAudioInputDevices",K),j}},g.prototype.getAudioOutputDevices=function(){var j=[];try{return te.isFalsy(g.deviceList)||te.isFalsy(g.deviceList[ee.CallConstants.AUDIO_OUTPUT_DEVICES])||(j=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.AUDIO_OUTPUT_DEVICES])),j}catch(K){return te.Logger.error("CallController: getAudioOutputDevices",K),j}},g.prototype.getVideoInputDevices=function(){var j=[];try{return te.isFalsy(g.deviceList)||te.isFalsy(g.deviceList[ee.CallConstants.VIDEO_INPUT_DEVICES])||(j=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.VIDEO_INPUT_DEVICES])),j}catch(K){return te.Logger.error("CallController: getVideoInputDevices",K),j}},g.prototype.setAudioInputDevice=function(j){try{if(g.callScreen&&!te.isFalsy(j)){var K=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.AUDIO_INPUT_DEVICES]).filter((function(K){return K[ee.CallConstants.MEDIA_DEVICE.ID]===j&&!K[ee.CallConstants.MEDIA_DEVICE.ACTIVE]}));K&&0<K.length&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.CHANGE_AUDIO_INPUT,value:j},"*")}}catch(K){te.Logger.error("CallController: setAudioInputDevice",K)}},g.prototype.setAudioOutputDevice=function(j){try{if(g.callScreen&&!te.isFalsy(j)){var K=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.AUDIO_OUTPUT_DEVICES]).filter((function(K){return K[ee.CallConstants.MEDIA_DEVICE.ID]===j&&!K[ee.CallConstants.MEDIA_DEVICE.ACTIVE]}));K&&0<K.length&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.CHANGE_AUDIO_OUTPUT,value:j},"*")}}catch(K){te.Logger.error("CallController: setAudioOutputDevice",K)}},g.prototype.setVideoInputDevice=function(j){try{if(g.callScreen&&!te.isFalsy(j)){var K=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.VIDEO_INPUT_DEVICES]).filter((function(K){return K[ee.CallConstants.MEDIA_DEVICE.ID]===j&&!K[ee.CallConstants.MEDIA_DEVICE.ACTIVE]}));K&&0<K.length&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.CHANGE_VIDEO_INPUT,value:j},"*")}}catch(K){te.Logger.error("CallController: setVideoInputDevice",K)}},g.prototype.muteAudio=function(j){try{g.callScreen&&(j?g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.MUTE_AUDIO},"*"):g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.UNMUTE_AUDIO},"*"))}catch(j){te.Logger.error("CallController: muteAudio",j)}},g.prototype.pauseVideo=function(j){try{g.callScreen&&(j?g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.PAUSE_VIDEO},"*"):g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.UNPAUSE_VIDEO},"*"))}catch(j){te.Logger.error("CallController: pauseVideo",j)}},g.prototype.setMode=function(j){try{g.callScreen&&!te.isFalsy(j)&&(j=j.toUpperCase(),-1<Object.values(ee.CallConstants.CALL_MODE).indexOf(j)&&j!=ee.CallConstants.CALL_MODE.SINGLE&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.SWITCH_MODE,value:j},"*"))}catch(j){te.Logger.error("CallController: setMode",j)}},g.prototype.startScreenShare=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.START_SCREENSHARE},"*")}catch(j){te.Logger.error("CallController: startScreenShare",j)}},g.prototype.stopScreenShare=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.STOP_SCREENSHARE},"*")}catch(j){te.Logger.error("CallController: stopScreenShare",j)}},g.prototype.startRecording=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.START_RECORDING},"*")}catch(j){te.Logger.error("CallController: startRecording",j)}},g.prototype.stopRecording=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.STOP_RECORDING},"*")}catch(j){te.Logger.error("CallController: stopRecording",j)}},g.prototype.switchToVideoCall=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.SWITCH_TO_VIDEO_CALL},"*")}catch(j){te.Logger.error("CallController: switchToVideoCall",j)}},g.prototype.openVirtualBackground=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.OPEN_VIRTUAL_BACKGROUND},"*")}catch(j){te.Logger.error("CallController: openVirtualBackground",j)}},g.prototype.setBackgroundBlur=function(j){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.SET_BACKGROUND_BLUR,value:j},"*")}catch(j){te.Logger.error("CallController: openVirtualBackground",j)}},g.prototype.setBackgroundImage=function(j){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.SET_BACKGROUND_IMAGE,value:j},"*")}catch(j){te.Logger.error("CallController: openVirtualBackground",j)}},g.prototype.endSession=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.END_CALL},"*")}catch(j){te.Logger.error("CallController: endSession",j)}},g.callController=void 0,g.callListner=void 0,g}();K.CallController=le},function(j,K,$){"use strict";K.__esModule=!0,K.MediaDevice=void 0;var ee=$(0),te=function(){function t(j,K,$){this.id="",this.name="",this.active=!1,ee.isFalsy(j)||(this.id=j),ee.isFalsy(K)||(this.name=K),this.active=!!$}return t.prototype.getId=function(){return this.id},t.prototype.setId=function(j){this.id=j||""},t.prototype.getName=function(){return this.name},t.prototype.setName=function(j){this.name=j||""},t.prototype.getIsActive=function(){return this.active},t.prototype.setIsActive=function(j){this.active=!!j},t}();K.MediaDevice=te},function(j,K,$){"use strict";K.__esModule=!0,K.GroupMembersController=void 0;var ee=$(34),te=$(1),ne=$(0),re=function(){function t(){}return t.trasformJSONGroupMember=function(j){var K;try{return j.status&&"offline"!==j.status?j.status="online":j.status="offline",K=new ee.GroupMember(j[te.GroupMemersConstans.KEYS.UID]),Object.assign(K,j),K}catch(K){return ne.Logger.error("GroupMembersController:trasformJSONGroupMember",{e:K,groupMember:j}),j}},t}();K.GroupMembersController=re},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.GroupMember=void 0;var ne=$(4),re=$(1),oe=function(j){function t(K,$){var ee=j.call(this,K)||this;return ee.joinedAt=0,$&&(ee.scope=$),ee}return te(t,j),t.prototype.setScope=function(j){this.scope=j},t.prototype.setJoinedAt=function(j){this.joinedAt=j},t.prototype.setGuid=function(j){this.guid=j},t.prototype.getScope=function(){return this.scope},t.prototype.getJoinedAt=function(){return this.joinedAt},t.prototype.getGuid=function(){return this.guid},t.GroupMemberScope=re.GroupMemberScope,t}(ne.User);K.GroupMember=oe},function(j,K,$){"use strict";K.__esModule=!0,K.Conversation=void 0;var ee=$(10),te=$(1),ne=$(11),re=$(15),oe=function(){function t(j,K,$,oe,ie,ae){this.conversationId=j,this.conversationType=K,ae&&0<ae.length&&(this.tags=ae),void 0!==$&&void 0!==(this.lastMessage=$).id&&(this.lastMessage=ee.MessageController.trasformJSONMessge($)),this.conversationType==te.MessageConstatnts.RECEIVER_TYPE.USER?this.conversationWith=ne.UsersController.trasformJSONUser(oe):this.conversationWith=re.GroupsController.trasformJSONGroup(oe),this.unreadMessageCount=void 0!==ie?ie:0}return t.prototype.setConversationId=function(j){this.conversationId=j},t.prototype.setConversationType=function(j){this.conversationType=j},t.prototype.setLastMessage=function(j){this.lastMessage=j},t.prototype.setConversationWith=function(j){this.conversationWith=j},t.prototype.setUnreadMessageCount=function(j){this.unreadMessageCount=j},t.prototype.getConversationId=function(){return this.conversationId},t.prototype.getConversationType=function(){return this.conversationType},t.prototype.getLastMessage=function(){return this.lastMessage},t.prototype.getConversationWith=function(){return this.conversationWith},t.prototype.getUnreadMessageCount=function(){return this.unreadMessageCount},t.prototype.getTags=function(){return this.tags},t}();K.Conversation=oe},function(j,K,$){"use strict";K.__esModule=!0,K.TypingNotificationController=void 0;var ee=$(0),te=function(){function t(){}return t.addTypingStarted=function(j){this.TYPING_STARTED_MAP[j]=ee.getCurrentTime()},t.removeTypingStarted=function(j){delete this.TYPING_STARTED_MAP[j]},t.getTypingStartedMap=function(j){if(j)return this.TYPING_STARTED_MAP[j]},t.addTypingEnded=function(j){this.TYPING_ENDED_MAP[j]=ee.getCurrentTime()},t.removeTypingEnded=function(j){delete this.TYPING_ENDED_MAP[j]},t.getTypingEndedMap=function(j){if(j)return this.TYPING_ENDED_MAP[j]},t.addIncomingTypingStarted=function(j){this.INCOMING_TYPING_STARTED_MAP[j.getReceiverId()]={typingNotification:j,timestamp:ee.getCurrentTime()}},t.removeIncomingTypingStarted=function(j){delete this.INCOMING_TYPING_STARTED_MAP[j.getReceiverId()]},t.TYPING_STARTED_MAP={},t.TYPING_ENDED_MAP={},t.INCOMING_TYPING_STARTED_MAP={},t}();K.TypingNotificationController=te},function(j,K,$){"use strict";var ee=this&&this.__spreadArrays||function(){for(var j=0,K=0,$=arguments.length;K<$;K++)j+=arguments[K].length;var ee=Array(j),te=0;for(K=0;K<$;K++)for(var ne=arguments[K],re=0,oe=ne.length;re<oe;re++,te++)ee[te]=ne[re];return ee};K.__esModule=!0,K.ListenerHandlers=void 0;var te=$(0),ne=$(23),re=function(){function t(){this.connectionHandlers=[],this.loginHandlers=[],this.messageHandlers=[],this.userHandlers=[],this.groupHandlers=[],this.callHandlers=[]}return t.getInstance=function(){return null!=this.listenerHandlers&&null!=this.listenerHandlers||(this.listenerHandlers=new t),this.listenerHandlers},t.prototype.addConnectionEventListener=function(j,K){try{this.connectionHandlers=this.connectionHandlers.filter((function(K){return K._name!=j})),this.connectionHandlers=ee(this.connectionHandlers,[new ne.WSConnectionListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addWSConnectionEventListener",K)}},t.prototype.removeConnectionEventListener=function(j){try{this.connectionHandlers=this.connectionHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeWSConnectionEventListener",j)}},t.prototype.addLoginEventListener=function(j,K){try{this.loginHandlers=this.loginHandlers.filter((function(K){return K._name!=j})),this.loginHandlers=ee(this.loginHandlers,[new ne.UserLoginListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addLoginEventListener",K)}},t.prototype.removeLoginEventListener=function(j){try{this.loginHandlers=this.loginHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeLoginEventListener",j)}},t.prototype.addMessageEventListener=function(j,K){try{this.messageHandlers=this.messageHandlers.filter((function(K){return K._name!=j})),this.messageHandlers=ee(this.messageHandlers,[new ne.MessagesListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addMessageEventListener",K)}},t.prototype.removeMessageEventListener=function(j){try{this.messageHandlers=this.messageHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeMessageEventListener",j)}},t.prototype.addUserEventListener=function(j,K){try{this.userHandlers=this.userHandlers.filter((function(K){return K._name!=j})),this.userHandlers=ee(this.userHandlers,[new ne.UsersListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addUserEventListener",K)}},t.prototype.removeUserEventListener=function(j){try{this.userHandlers=this.userHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeUserEventListener",j)}},t.prototype.addGroupEventListener=function(j,K){try{this.groupHandlers=this.groupHandlers.filter((function(K){return K._name!=j})),this.groupHandlers=ee(this.groupHandlers,[new ne.GroupsListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addGroupEventListener",K)}},t.prototype.removeGroupEventListener=function(j){try{this.groupHandlers=this.groupHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeGroupEventListener",j)}},t.prototype.addCallEventListener=function(j,K){try{this.callHandlers=this.callHandlers.filter((function(K){return K._name!=j})),this.callHandlers=ee(this.callHandlers,[new ne.CallsListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addCallEventListener",K)}},t.prototype.removeCallEventListener=function(j){try{this.callHandlers=this.callHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeCallEventListener",j)}},t.listenerHandlers=new t,t}();K.ListenerHandlers=re},function(j,K,$){"use strict";K.__esModule=!0,K.CometChat=K.init=void 0;var ee=$(3);K.init=function(j){return ee.CometChat.getInstance(j)},K.CometChat=ee.CometChat},function(j,K){var $;$=function(){return this}();try{$=$||new Function("return this")()}catch(j){"object"==typeof window&&($=window)}j.exports=$},function(j,K,$){"use strict";K.__esModule=!0,K.GroupsRequestBuilder=K.GroupsRequest=void 0;var ee=$(6),te=$(0),ne=$(2),re=$(15),oe=$(1),ie=function(){function t(j){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.hasJoined=0,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},te.isFalsy(j)||(te.isFalsy(j.limit)||(this.limit=j.limit),te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.hasJoined)||(this.hasJoined=1),te.isFalsy(j.tags)||(this.tags=j.tags),te.isFalsy(j.showTags)||(this.withTags=j.showTags))}return t.prototype.validateGroupBuilder=function(){if(void 0===this.limit)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>oe.DEFAULT_VALUES.GROUPS_MAX_LIMIT)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",oe.DEFAULT_VALUES.GROUPS_MAX_LIMIT)));if(this.limit<oe.DEFAULT_VALUES.ZERO)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(void 0!==this.withTags){if(typeof this.withTags!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"WITH_TAGS","WITH_TAGS","withTags()")));1==this.withTags?this.withTags=!0:this.withTags=!1}return void 0===this.tags||Array.isArray(this.tags)?void 0:new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"TAGS","TAGS","setTags()")))},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{var te=j.validateGroupBuilder();if(te instanceof ne.CometChatException)return void $(te);ee.makeApiCall("getGroups",{},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(j,K){ee.push(re.GroupsController.trasformJSONGroup(j))})),K(ee)}K([])}),(function(j){$(new ne.CometChatException(j.error))}))}catch(te){$(new ne.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),te.isFalsy(this.hasJoined)||(j.hasJoined=1),te.isFalsy(this.tags)||(j.tags=this.tags),te.isFalsy(this.withTags)||(j.withTags=1),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t.MAX_LIMIT=100,t.DEFAULT_LIMIT=30,t}();K.GroupsRequest=ie;var ae=function(){function t(){}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.joinedOnly=function(j){return this.hasJoined=j,this},t.prototype.setTags=function(j){return this.tags=j,this},t.prototype.withTags=function(j){return this.showTags=j,this},t.prototype.build=function(){return new ie(this)},t}();K.GroupsRequestBuilder=ae},function(j,K,$){"use strict";K.__esModule=!0,K.GroupMembersRequestBuilder=K.GroupMembersRequest=void 0;var ee=$(6),te=$(0),ne=$(14),re=$(2),oe=$(33),ie=$(1),ae=function(){function t(j){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},this.store=ne.LocalStorage.getInstance(),te.isFalsy(j)||(this.limit=j.limit,this.guid=j.guid,te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.scopes)||(this.scopes=j.scopes))}return t.prototype.validateGroupMembersBuilder=function(){if(void 0===this.limit)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>ie.DEFAULT_VALUES.USERS_MAX_LIMIT)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",ie.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limit<ie.DEFAULT_VALUES.ZERO)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(void 0!==this.guid){if(typeof this.guid!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"GUID","GUID","GroupMembersRequestBuilder()")));if(te.isFalsy(this.guid))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"GUID","GUID","GUID","GUID")))}return void 0===this.scopes||Array.isArray(this.scopes)?void 0:new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_SCOPES","SET_SCOPES","setScopes()")))},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{var te=j.validateGroupMembersBuilder();if(te instanceof re.CometChatException)return void $(te);ee.makeApiCall("getGroupMembers",{guid:j.guid},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(K){K.guid=j.guid,ee.push(oe.GroupMembersController.trasformJSONGroupMember(K))})),K(ee)}else K([])}),(function(j){$(new re.CometChatException(j.error))}))}catch(te){$(new re.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),te.isFalsy(this.scopes)||(j.scopes=this.scopes),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();K.GroupMembersRequest=ae;var se=function(){function t(j){this.guid=j}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.setScopes=function(j){return this.scopes=j,this},t.prototype.build=function(){return new ae(this)},t}();K.GroupMembersRequestBuilder=se},function(j,K,$){"use strict";K.__esModule=!0,K.BannedMembersRequestBuilder=K.BannedMembersRequest=void 0;var ee=$(6),te=$(0),ne=$(2),re=$(33),oe=$(1),ie=function(){function t(j){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},te.isFalsy(j)||(this.limit=j.limit,this.guid=j.guid,te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.scopes)||(this.scopes=j.scopes))}return t.prototype.validateBannedMembersBuilder=function(){if(void 0===this.limit)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>oe.DEFAULT_VALUES.USERS_MAX_LIMIT)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",oe.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limit<oe.DEFAULT_VALUES.ZERO)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(void 0!==this.guid){if(typeof this.guid!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"GUID","GUID","GroupMembersRequestBuilder()")));if(te.isFalsy(this.guid))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.INVALID),"GUID","GUID","GUID","GUID")))}return void 0===this.scopes||Array.isArray(this.scopes)?void 0:new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_SCOPES","SET_SCOPES","setScopes()")))},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{var te=j.validateBannedMembersBuilder();if(te instanceof ne.CometChatException)return void $(te);ee.makeApiCall("getBannedGroupMembers",{guid:j.guid},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(K){K.guid=j.guid,ee.push(re.GroupMembersController.trasformJSONGroupMember(K))})),K(ee)}else K([])}),(function(j){$(new ne.CometChatException(j.error))}))}catch(te){$(new ne.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),te.isFalsy(this.scopes)||(j.scopes=this.scopes),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();K.BannedMembersRequest=ie;var ae=function(){function t(j){this.guid=j}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.setScopes=function(j){return this.scopes=j,this},t.prototype.build=function(){return new ie(this)},t}();K.BannedMembersRequestBuilder=ae},function(j,K,$){"use strict";K.__esModule=!0,K.UsersRequestBuilder=K.UsersRequest=void 0;var ee=$(6),te=$(0),ne=$(11),re=$(2),oe=$(44),ie=$(1),ae=function(){function e(j){this.next_page=1,this.current_page=1,this.total_pages=-1,this.hideBlockedUsers=!1,this.friendsOnly=!1,this.fetchingInProgress=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},e.userStore=oe.UserStore.getInstance(),te.isFalsy(j)||(this.limit=j.limit,te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.status)||(j.status==e.USER_STATUS.ONLINE?this.status=ie.PresenceConstatnts.STATUS.AVAILABLE:this.status=j.status),te.isFalsy(j.shouldHideBlockedUsers)||(this.hideBlockedUsers=j.shouldHideBlockedUsers),te.isFalsy(j.showFriendsOnly)||(this.friendsOnly=j.showFriendsOnly),te.isFalsy(j.showTags)||(this.withTags=j.showTags),te.isFalsy(j.role)||(this.role=j.role),te.isFalsy(j.roles)||(this.roles=j.roles),te.isFalsy(j.tags)||(this.tags=j.tags),te.isFalsy(j.UIDs)||(this.UIDs=j.UIDs),te.isFalsy(j.SortBy)||(this.sortBy=j.SortBy),te.isFalsy(j.SearchIn)||(this.searchIn=j.SearchIn),te.isFalsy(j.SortOrder)||(this.sortOrder=j.SortOrder))}return e.prototype.validateUserBuilder=function(){if(void 0===this.limit)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>ie.DEFAULT_VALUES.USERS_MAX_LIMIT)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",ie.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limit<ie.DEFAULT_VALUES.ZERO)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(this.status){if(typeof this.status!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_STATUS","SET_STATUS","setStatus()")));if("available"!=this.status.toLowerCase()&&"offline"!=this.status.toLowerCase())return new re.CometChatException(ie.UserErrors.INVALID_STATUS)}if(void 0!==this.hideBlockedUsers){if(typeof this.hideBlockedUsers!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"HIDE_BLOCKED_USERS","HIDE_BLOCKED_USERS","hideBlockedUsers()")));1==this.hideBlockedUsers?this.hideBlockedUsers=!0:this.hideBlockedUsers=!1}if(void 0!==this.friendsOnly){if(typeof this.friendsOnly!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"FRIENDS_ONLY","FRIENDS_ONLY","friendsOnly()")));1==this.friendsOnly?this.friendsOnly=!0:this.friendsOnly=!1}if(void 0!==this.withTags){if(typeof this.withTags!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.MUST_BE_A_BOOLEAN),"WITH_TAGS","WITH_TAGS","withTags()")));1==this.withTags?this.withTags=!0:this.withTags=!1}if(void 0!==this.roles&&!Array.isArray(this.roles))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"ROLES","ROLES","setRoles()")));if(void 0!==this.tags&&!Array.isArray(this.tags))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"TAGS","TAGS","setTags()")));if(void 0!==this.UIDs&&!Array.isArray(this.UIDs))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"UIDs","UIDs","setUIDs()")));if(this.sortBy){if(typeof this.sortBy!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SORT_BY","SORT_BY","sortBy()")));if(te.isFalsy(this.sortBy.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"SORT_BY","SORT_BY","sort by","sort by")));this.sortBy=this.sortBy.trim().toLowerCase()}if(this.sortOrder){if(typeof this.sortOrder!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SORT_BY_ORDER","SORT_BY_ORDER","sortByOrder()")));if(te.isFalsy(this.sortOrder.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"SORT_BY_ORDER","SORT_BY_ORDER","sort order","sort order")));this.sortOrder=this.sortOrder.trim().toLowerCase()}return this.searchIn&&!Array.isArray(this.searchIn)?new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SEARCH_IN","SEARCH_IN","searchIn()"))):void 0},e.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{if(j.fetchingInProgress)j.fetchingInProgress=!1,K([]);else{j.fetchingInProgress=!0;var te=j.validateUserBuilder();if(te instanceof re.CometChatException)return void $(te);ee.makeApiCall("users",{},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(j){ee.push(ne.UsersController.trasformJSONUser(j))})),K(ee)}else K([]);j.fetchingInProgress=!1}),(function(K){j.fetchingInProgress=!1,$(new re.CometChatException(K.error))}))}}catch(te){j.fetchingInProgress=!1,$(new re.CometChatException(te))}}))},e.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),te.isFalsy(this.status)||(j.status=this.status),te.isFalsy(this.hideBlockedUsers)||(j.hideBlockedUsers=1),te.isFalsy(this.role)||(j.roles=this.role),te.isFalsy(this.roles)||(j.roles=this.roles),te.isFalsy(this.tags)||(j.tags=this.tags),te.isFalsy(this.friendsOnly)||(j.friendsOnly=1),te.isFalsy(this.withTags)||(j.withTags=1),te.isFalsy(this.UIDs)||(j.uids=this.UIDs),te.isFalsy(this.sortBy)||(j.sortBy=this.sortBy),te.isFalsy(this.sortOrder)||(j.sortOrder=this.sortOrder),te.isFalsy(this.searchIn)||(j.searchIn=this.searchIn),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},e.USER_STATUS={ONLINE:ie.PresenceConstatnts.STATUS.ONLINE,OFFLINE:ie.PresenceConstatnts.STATUS.OFFLINE},e}();K.UsersRequest=ae;var se=function(){function t(){this.shouldHideBlockedUsers=!1}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setStatus=function(j){return this.status=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.hideBlockedUsers=function(j){return this.shouldHideBlockedUsers=j,this},t.prototype.setRole=function(j){return this.role=j,this},t.prototype.setRoles=function(j){return this.roles=j,this},t.prototype.friendsOnly=function(j){return this.showFriendsOnly=j,this},t.prototype.setTags=function(j){return this.tags=j,this},t.prototype.withTags=function(j){return this.showTags=j,this},t.prototype.setUIDs=function(j){return this.UIDs=j,this},t.prototype.sortBy=function(j){return this.SortBy=j,this},t.prototype.sortByOrder=function(j){return this.SortOrder=j,this},t.prototype.searchIn=function(j){return this.SearchIn=j,this},t.prototype.build=function(){return this.role&&this.roles&&this.roles.push(this.role),new ae(this)},t}();K.UsersRequestBuilder=se},function(j,K,$){"use strict";K.__esModule=!0,K.UserStore=void 0;var ee=$(3),te=$(0),ne=$(1),re=$(12),oe=function(){function t(j){this.store=ne.constants.DEFAULT_STORE,te.isFalsy(j)||(this.store=j),this.userStore=re.createInstance({name:te.format(ne.LOCAL_STORE.STORE_STRING,ee.CometChat.getAppId(),ne.LOCAL_STORE.USERS_STORE)}),this.userStore.setDriver([re.LOCALSTORAGE,re.INDEXEDDB,re.WEBSQL])}return t.getInstance=function(){return null==t.UserStore&&(t.UserStore=new t),t.UserStore},t.prototype.set=function(j,K){return this.userStore.setItem(j,K)},t.prototype.remove=function(j){this.userStore.removeItem(j)},t.prototype.get=function(j){return this.userStore.getItem(j)},t.prototype.clearStore=function(){var j=this;return new Promise((function(K,$){j.userStore.clear().then((function(){K(!0)})).catch((function(j){$(j)}))}))},t.prototype.clear=function(j){},t.prototype.selectStore=function(j){this.store=j},t.prototype.storeUsers=function(j){var K=this;return j.map((function(j){K.set(j.getUid(),j)})),!0},t.prototype.storeUser=function(j){return this.set(j.getUid(),j),!0},t}();K.UserStore=oe},function(j,K,$){"use strict";K.__esModule=!0,K.ConversationsRequestBuilder=K.ConversationsRequest=void 0;var ee=$(6),te=$(0),ne=$(2),re=$(24),oe=$(1),ie=function(){function t(j){this.limit=100,this.next_page=1,this.current_page=1,this.total_pages=-1,this.fetchingInProgress=!1,this.getUserAndGroupTags=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},te.isFalsy(j)||(this.limit=j.limit,te.isFalsy(j.conversationType)||(this.conversationType=j.conversationType),te.isFalsy(j.getUserAndGroupTags)||(this.getUserAndGroupTags=j.getUserAndGroupTags),j.tags&&(this.tags=j.tags),te.isFalsy(j.WithTags)||(this.withTags=j.WithTags),j.groupTags&&(this.groupTags=j.groupTags),j.userTags&&(this.userTags=j.userTags))}return t.prototype.validateConversationBuilder=function(){return void 0===this.limit?new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))):isNaN(this.limit)?new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))):this.limit>oe.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT?new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",oe.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT))):this.limit<oe.DEFAULT_VALUES.ZERO?new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))):void 0},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{if(j.fetchingInProgress)j.fetchingInProgress=!1,K([]);else{j.fetchingInProgress=!0;var te=j.validateConversationBuilder();if(te instanceof ne.CometChatException)return void $(te);ee.makeApiCall("getConversations",{},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(j){ee.push(re.ConversationController.trasformJSONConversation(j.conversationId,j.conversationType,j.lastMessage,j.conversationWith,parseInt(j.unreadMessageCount),j.tags?j.tags:[]))})),K(ee)}else K([]);j.fetchingInProgress=!1}),(function(K){j.fetchingInProgress=!1,$(new ne.CometChatException(K.error))}))}}catch(te){j.fetchingInProgress=!1,$(new ne.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.conversationType)||(j.conversationType=this.conversationType),te.isFalsy(this.getUserAndGroupTags)||(j.withUserAndGroupTags=this.getUserAndGroupTags),te.isFalsy(this.tags)||(j.tags=this.tags),te.isFalsy(this.withTags)||(j.withTags=this.withTags),te.isFalsy(this.userTags)||(j.userTags=this.userTags),te.isFalsy(this.groupTags)||(j.groupTags=this.groupTags),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t}();K.ConversationsRequest=ie;var ae=function(){function t(){this.WithTags=!1}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setConversationType=function(j){return this.conversationType=j,this},t.prototype.withUserAndGroupTags=function(j){return"boolean"==typeof j&&(this.getUserAndGroupTags=j),this},t.prototype.setTags=function(j){return this.tags=j,this},t.prototype.withTags=function(j){return this.WithTags=j,this},t.prototype.setGroupTags=function(j){return this.groupTags=j,this},t.prototype.setUserTags=function(j){return this.userTags=j,this},t.prototype.build=function(){return new ie(this)},t}();K.ConversationsRequestBuilder=ae},function(j,K,$){"use strict";var ee=this&&this.__awaiter||function(j,K,$,ee){return new($||($=Promise))((function(te,ne){function o(j){try{r(ee.next(j))}catch(j){ne(j)}}function s(j){try{r(ee.throw(j))}catch(j){ne(j)}}function r(j){var K;j.done?te(j.value):(K=j.value,K instanceof $?K:new $((function(j){j(K)}))).then(o,s)}r((ee=ee.apply(j,K||[])).next())}))},te=this&&this.__generator||function(j,K){var $,ee,te,ne,re={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return ne={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(ne[Symbol.iterator]=function(){return this}),ne;function e(ne){return function(oe){return function(ne){if($)throw new TypeError("Generator is already executing.");for(;re;)try{if($=1,ee&&(te=2&ne[0]?ee.return:ne[0]?ee.throw||((te=ee.return)&&te.call(ee),0):ee.next)&&!(te=te.call(ee,ne[1])).done)return te;switch(ee=0,te&&(ne=[2&ne[0],te.value]),ne[0]){case 0:case 1:te=ne;break;case 4:return re.label++,{value:ne[1],done:!1};case 5:re.label++,ee=ne[1],ne=[0];continue;case 7:ne=re.ops.pop(),re.trys.pop();continue;default:if(!(te=0<(te=re.trys).length&&te[te.length-1])&&(6===ne[0]||2===ne[0])){re=0;continue}if(3===ne[0]&&(!te||ne[1]>te[0]&&ne[1]<te[3])){re.label=ne[1];break}if(6===ne[0]&&re.label<te[1]){re.label=te[1],te=ne;break}if(te&&re.label<te[2]){re.label=te[2],re.ops.push(ne);break}te[2]&&re.ops.pop(),re.trys.pop();continue}ne=K.call(j,re)}catch(j){ne=[6,j],ee=0}finally{$=te=0}if(5&ne[0])throw ne[1];return{value:ne[0]?ne[1]:void 0,done:!0}}([ne,oe])}}},ne=this&&this.__spreadArrays||function(){for(var j=0,K=0,$=arguments.length;K<$;K++)j+=arguments[K].length;var ee=Array(j),te=0;for(K=0;K<$;K++)for(var ne=arguments[K],re=0,oe=ne.length;re<oe;re++,te++)ee[te]=ne[re];return ee};K.__esModule=!0,K.MessagesRequestBuilder=K.MessagesRequest=void 0;var re=$(2),oe=$(6),ie=$(10),ae=$(0),se=$(47),le=$(1),ce=$(13),ue=$(25),de=function(){function t(j){this.limit=le.DEFAULT_VALUES.MSGS_LIMIT,this.timestamp=0,this.id=le.DEFAULT_VALUES.DEFAULT_MSG_ID,this.messageStore=se.MessagesStore.getInstance(),this.endpointName="getUserMessages",this.listId="",this.totalPages=0,this.unread=!1,this.inProgress=!1,this.hideMessagesFromBlockedUsers=!1,this.updatedAt=0,this.onlyUpdates=0,this.paginationMeta={},this.WithTags=!1,this.hideDeletedMessages=!1,this.limit=j.limit,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,this.uid=j.uid,this.guid=j.guid,this.parentMessageId=j.parentMessageId,this.timestamp=j.timestamp,this.timestamp&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=this.timestamp),this.id=j.id,this.id!=le.DEFAULT_VALUES.DEFAULT_MSG_ID&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.ID]=this.id),this.hideMessagesFromBlockedUsers=j.HideMessagesFromBlockedUsers,this.hideMessagesFromBlockedUsers&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_MESSAGES_FROM_BLOCKED_USER]=this.hideMessagesFromBlockedUsers),this.unread=j.unread,this.unread&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.UNREAD]=this.unread),j.searchKey&&(this.searchKey=j.searchKey,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SEARCH_KEY]=this.searchKey),j.onlyUpdate&&(this.onlyUpdates=j.onlyUpdate,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.ONLY_UPDATES]=this.onlyUpdates),j.updatedAt&&(this.updatedAt=j.updatedAt,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=this.updatedAt),j.category&&(this.category=j.category),j.categories&&(this.categories=j.categories),j.type&&(this.type=j.type),j.types&&(this.types=j.types),j.WithTags&&(this.WithTags=j.WithTags),j.tags&&(this.tags=j.tags),j.HideReplies&&(this.hideReplies=j.HideReplies,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES]=this.hideReplies),this.hideDeletedMessages=j.HideDeletedMessages,this.hideDeletedMessages&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_DELETED_MESSAGES]=this.hideDeletedMessages)}return t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){return ee(j,void 0,void 0,(function(){var j,ee,ne;return te(this,(function(te){switch(te.label){case 0:if(te.trys.push([0,5,,6]),this.inProgress)return this.inProgress=!1,$(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.REQUEST_IN_PROGRESS_ERROR)),[2];if(this.inProgress=!0,this.onlyUpdates){if(0==this.updatedAt)return this.inProgress=!1,$(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS)),[2]}else if(0==this.timestamp&&0==this.id&&0==this.updatedAt)return this.inProgress=!1,$(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS)),[2];this.affix=le.MessageConstatnts.PAGINATION.AFFIX.APPEND,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,this.currentMethod=le.MessageConstatnts.PAGINATION.AFFIX.APPEND,te.label=1;case 1:return te.trys.push([1,3,,4]),[4,this.makeAPICall()];case 2:return j=te.sent(),K(j),this.inProgress=!1,[3,4];case 3:return ee=te.sent(),this.inProgress=!1,$(new re.CometChatException(ee)),[3,4];case 4:return[3,6];case 5:return ne=te.sent(),this.inProgress=!1,$(new re.CometChatException(ne)),[3,6];case 6:return[2]}}))}))}))},t.prototype.fetchPrevious=function(){var j=this;return new Promise((function(K,$){return ee(j,void 0,void 0,(function(){var j,ee,ne;return te(this,(function(te){switch(te.label){case 0:if(te.trys.push([0,5,,6]),this.inProgress)return $(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.REQUEST_IN_PROGRESS_ERROR)),this.inProgress=!1,[2];if(this.inProgress=!0,this.onlyUpdates&&0==this.updatedAt)return this.inProgress=!1,$(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS)),[2];this.affix=le.MessageConstatnts.PAGINATION.AFFIX.PREPEND,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,this.currentMethod=le.MessageConstatnts.PAGINATION.AFFIX.PREPEND,te.label=1;case 1:return te.trys.push([1,3,,4]),[4,this.makeAPICall()];case 2:return j=te.sent(),K(j),this.inProgress=!1,[3,4];case 3:return ee=te.sent(),this.inProgress=!1,$(new re.CometChatException(ee)),[3,4];case 4:return[3,6];case 5:return ne=te.sent(),this.inProgress=!1,$(new re.CometChatException(ne)),[3,6];case 6:return[2]}}))}))}))},t.prototype.makeAPICall=function(){var j=this;return new Promise((function(K,$){try{var ne=j.uid;if(void 0!==ne){if(typeof ne!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"UID","UID","setUID()"))));if(ae.isFalsy(ne.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"UID","UID","UID","UID"))));j.uid=ne.trim()}var se=j.guid;if(void 0!==se){if(typeof se!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"GUID","GUID","setGUID()"))));if(ae.isFalsy(se.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"GUID","GUID","GUID","GUID"))));j.guid=se.trim()}var ce=j.parentMessageId;if(void 0!==ce){if(isNaN(ce))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"PARENT_MESSAGE_ID","PARENT_MESSAGE_ID","setParentMessageId()"))));if(ce<le.DEFAULT_VALUES.ZERO)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"PARENT_MESSAGE_ID","PARENT_MESSAGE_ID","setParentMessageId()"))))}var de=j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.PER_PAGE];if(void 0===de)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))));if(isNaN(de))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))));if(de>le.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",le.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(de<le.DEFAULT_VALUES.ZERO)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))));var pe=j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SEARCH_KEY];if(void 0!==pe){if(typeof pe!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()"))));if(ae.isFalsy(pe.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SEARCH_KEY]=pe.trim()}var ge=j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.ID];if(void 0!==ge){if(isNaN(ge))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"MESSAGE_ID","MESSAGE_ID","setMessageId()"))));if(ge<le.DEFAULT_VALUES.ZERO)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"MESSAGE_ID","MESSAGE_ID","setMessageId()"))))}var he=j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SENT_AT];if(void 0!==he){if(isNaN(he))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"TIMESTAMP","TIMESTAMP","setTimestamp()"))));if(he<le.DEFAULT_VALUES.ZERO)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"TIMESTAMP","TIMESTAMP","setTimestamp()"))))}var me=j.hideMessagesFromBlockedUsers;if(void 0!==me){if(typeof me!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"HIDE_MESSAGES_FROM_BLOCKED_USERS","HIDE_MESSAGES_FROM_BLOCKED_USERS","hideMessagesFromBlockedUsers()"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_MESSAGES_FROM_BLOCKED_USER]=1==me?1:0}var fe=j.unread;if(void 0!==fe){if(typeof fe!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"UNREAD","UNREAD","setUnread()"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.UNREAD]=1==fe?1:0}var ye=j.category;if(void 0!==ye){if(typeof ye!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_CATEGORY","SET_CATEGORY","setCategory()"))));if(ae.isFalsy(ye.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"SET_CATEGORY","SET_CATEGORY","category","category"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.CATEGORIES]=ye.trim()}var be=j.categories;if(void 0!==be){if(!Array.isArray(be))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_CATEGORIES","SET_CATEGORIES","setCategories()"))));0<be.length&&(j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.CATEGORIES]=be)}var ve=j.type;if(void 0!==ve){if(typeof ve!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_TYPE","SET_TYPE","setType()"))));if(ae.isFalsy(ve.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"SET_TYPE","SET_TYPE","type","type"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.TYPES]=ve.trim()}var Me=j.types;if(void 0!==Me){if(!Array.isArray(Me))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_TYPES","SET_TYPES","setTypes()"))));0<Me.length&&(j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.TYPES]=Me)}var Ee=j.tags;if(void 0!==Ee){if(!Array.isArray(Ee))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_TAGS","SET_TAGS","setTags()"))));0<Ee.length&&(j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.TAGS]=Ee)}var Se=j.WithTags;if(void 0!==Se){if(typeof Se!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"WITH_TAGS","WITH_TAGS","withTags()"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.WITH_TAGS]=1==Se?1:0}var Ce=j.hideDeletedMessages;if(void 0!==Ce){if(typeof Ce!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"HIDE_DELETED_MESSAGES","HIDE_DELETED_MESSAGES","hideDeletedMessages()"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_DELETED_MESSAGES]=1==Ce?1:0}if(j.createEndpoint(),j.totalPages)if(1!=j.totalPages);else if(j.lastAffix==j.affix)return void K([]);oe.makeApiCall(j.endpointName,{listId:j.listId},j.paginationMeta).then((function($){return ee(j,void 0,void 0,(function(){var j,ee=this;return te(this,(function(te){return j=[],$[le.ResponseConstants.RESPONSE_KEYS.KEY_META][le.ResponseConstants.RESPONSE_KEYS.KEY_CURSOR].hasOwnProperty(le.MessageConstatnts.PAGINATION.KEYS.ID)&&0==this.id&&(this.id=parseInt($.meta.cursor[le.MessageConstatnts.PAGINATION.KEYS.ID])),$[le.ResponseConstants.RESPONSE_KEYS.KEY_META][le.ResponseConstants.RESPONSE_KEYS.KEY_CURSOR].hasOwnProperty(le.MessageConstatnts.PAGINATION.KEYS.SENT_AT)&&0==this.timestamp&&(this.timestamp=$.meta.cursor[le.MessageConstatnts.PAGINATION.KEYS.SENT_AT]),$.meta.pagination.hasOwnProperty("total_pages")&&(this.totalPages=$.meta.pagination.total_pages),$.meta.cursor.hasOwnProperty("affix")&&(this.lastAffix=$.meta.cursor.affix),$.data[0]?(0<this.id&&(this.id=parseInt($.data[0].id)),0<this.timestamp&&(this.timestamp=$.data[0].sentAt),$.data.map((function(K){ue.MessageListnerMaping.getInstance().get(le.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST).then((function(j){parseInt(K.id)>j&&ue.MessageListnerMaping.getInstance().set(le.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(K.id))}),(function(j){ue.MessageListnerMaping.getInstance().set(le.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(K.id))})),ee.affix==le.MessageConstatnts.PAGINATION.AFFIX.APPEND?(ee.id<parseInt(K.id)&&0<ee.id&&(ee.id=parseInt(K.id)),ee.timestamp<K.sentAt&&0<ee.timestamp&&(ee.timestamp=K.sentAt),ee.updatedAt<K.updatedAt&&0<ee.updatedAt&&(ee.updatedAt=K.updatedAt)):(ee.id>parseInt(K.id)&&(ee.id=parseInt(K.id)),ee.timestamp>K.sentAt&&(ee.timestamp=K.sentAt),ee.updatedAt>K.updatedAt&&(ee.updatedAt=K.updatedAt)),ee.id&&(ee.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.ID]=ee.id),ee.timestamp&&(ee.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=ee.timestamp),ee.updatedAt&&(ee.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=ee.updatedAt),j.push(ie.MessageController.trasformJSONMessge(K))}))):j=[],K(j),[2]}))}))}),(function(j){$(new re.CometChatException(j.error))}))}catch(ne){$(new re.CometChatException(ne))}}))},t.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES])):(ae.isFalsy(this.guid)||ae.isFalsy(this.uid))&&ae.isFalsy(this.guid)?(ae.isFalsy(this.uid)?this.endpointName="getMessages":this.endpointName="getUserMessages",this.listId=this.uid):(this.endpointName="getGroupMessages",this.listId=this.guid)},t.prototype.makeData=function(){var j={};j[le.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,j[le.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(ae.isFalsy(this.guid)||ae.isFalsy(this.uid))&&ae.isFalsy(this.guid)&&ae.isFalsy(this.uid)},t.prototype.getFilteredPreviousDataByReceiverId=function(j){return ee(this,void 0,void 0,(function(){var K,$=this;return te(this,(function(ee){switch(ee.label){case 0:switch(K=[],j){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,se.MessagesStore.getInstance().get(this.uid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 2:return ee.sent(),[3,9];case 3:return[4,se.MessagesStore.getInstance().get(this.guid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 4:ee.sent(),ee.label=5;case 5:return[4,se.MessagesStore.getInstance().get(this.guid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).filter((function(K){return j[K].sender.uid==$.uid})).map((function($){K=ne(K,[j[$]])}))}))];case 6:return ee.sent(),[3,9];case 7:return[4,se.MessagesStore.getInstance().getAllMessages().then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 8:return ee.sent(),[3,9];case 9:return[2,K]}}))}))},t.prototype.getFilteredNextDataByReceiverId=function(j){return ee(this,void 0,void 0,(function(){var K,$=this;return te(this,(function(ee){switch(ee.label){case 0:switch(K=[],j){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,se.MessagesStore.getInstance().get(this.uid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 2:return ee.sent(),[3,9];case 3:return[4,se.MessagesStore.getInstance().get(this.guid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 4:ee.sent(),ee.label=5;case 5:return[4,se.MessagesStore.getInstance().get(this.guid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).filter((function(K){return j[K].sender.uid==$.uid})).map((function($){K=ne(K,[j[$]])}))}))];case 6:return ee.sent(),[3,9];case 7:return[4,se.MessagesStore.getInstance().getAllMessages().then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 8:return ee.sent(),[3,9];case 9:return[2,K]}}))}))},t}();K.MessagesRequest=de;var pe=function(){function t(){this.maxLimit=le.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=le.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!1}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setGUID=function(j){return this.guid=j,this},t.prototype.setUID=function(j){return this.uid=j,this},t.prototype.setParentMessageId=function(j){return this.parentMessageId=j,this},t.prototype.setTimestamp=function(j){return void 0===j&&(j=ae.getCurrentTime()),this.timestamp=j,this},t.prototype.setMessageId=function(j){return void 0===j&&(j=le.DEFAULT_VALUES.DEFAULT_MSG_ID),this.id=j,this},t.prototype.setUnread=function(j){return void 0===j&&(j=!1),this.unread=j,this},t.prototype.hideMessagesFromBlockedUsers=function(j){return void 0===j&&(j=!1),this.HideMessagesFromBlockedUsers=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKey=j,this},t.prototype.setUpdatedAfter=function(j){return this.updatedAt=j,this},t.prototype.updatesOnly=function(j){return j&&(this.onlyUpdate=1),this},t.prototype.setCategory=function(j){return this.category=j,this},t.prototype.setCategories=function(j){return this.categories=j,this},t.prototype.setType=function(j){return this.type=j,this},t.prototype.setTypes=function(j){return this.types=j,this},t.prototype.hideReplies=function(j){return this.HideReplies=j,this},t.prototype.hideDeletedMessages=function(j){return this.HideDeletedMessages=j,this},t.prototype.setTags=function(j){return this.tags=j,this},t.prototype.withTags=function(j){return this.WithTags=j,this},t.prototype.build=function(){return this.category&&this.categories&&this.categories.push(this.category),this.type&&this.types&&this.types.push(this.type),new de(this)},t}();K.MessagesRequestBuilder=pe},function(j,K,$){"use strict";var ee=this&&this.__assign||function(){return(ee=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.MessagesStore=void 0;var te=$(3),ne=$(0),re=$(1),oe=$(12),ie=function(){function t(j){this.store=re.constants.DEFAULT_STORE,ne.isFalsy(j)||(this.store=j),this.messagesStore=oe.createInstance({name:ne.format(re.LOCAL_STORE.STORE_STRING,te.CometChat.getAppId(),re.LOCAL_STORE.MESSAGES_STORE)}),this.messagesStore.setDriver([oe.LOCALSTORAGE,oe.INDEXEDDB,oe.WEBSQL])}return t.getInstance=function(){return null==t.MessagesStore&&(t.MessagesStore=new t),t.MessagesStore},t.prototype.set=function(j,K){return this.messagesStore.setItem(j,K)},t.prototype.remove=function(j){this.messagesStore.removeItem(j)},t.prototype.get=function(j){return this.messagesStore.getItem(j)},t.prototype.clearStore=function(){var j=this;return new Promise((function(K,$){j.messagesStore.clear().then((function(){K(!0)})).catch((function(j){$(j)}))}))},t.prototype.getAllMessages=function(){var j=this,K={};return new Promise((function($,te){j.messagesStore.iterate((function(j,$,te){$!=re.constants.MSG_VER_POST&&$!=re.constants.MSG_VER_POST&&(K=ee(ee({},K),j))})).then((function(){$(K)}))}))},t.prototype.clear=function(j){},t.prototype.selectStore=function(j){this.store=j},t.prototype.storeMessages=function(j){var K=this;if(te.CometChat.user.getUid()){var $=te.CometChat.user.getUid(),oe={},ie=0;return this.get(re.constants.MSG_VER_POST).then((function(te){j.map((function(j){var K;if(!ne.isFalsy(j)){0==ie&&(ie=parseInt(j.getId().toString())),ie>j.getId()&&(ie=parseInt(j.getId().toString())),te<j.getId()&&(te=parseInt(j.getId().toString()));var ae=void 0;ae=j.getSender()instanceof Object?j.getSender().getUid():j.getSender(),j.getReceiverType()==re.MessageConstatnts.RECEIVER_TYPE.GROUP&&(ae=j.getReceiver()),j.getSender()instanceof Object?j.getSender().getUid()==$&&(ae=j.getReceiver()):j.getSender()==$&&(ae=j.getReceiver()),oe[ae]||(oe[ae]={}),oe[ae]=ee(ee({},oe[ae]),((K={})[j.getId()]=j,K))}})),K.get(re.constants.MSG_VER_PRE).then((function(j){(0<ie&&ie<j||null==j)&&K.set(re.constants.MSG_VER_PRE,ie)}))&&0<te&&K.set(re.constants.MSG_VER_POST,te),Object.keys(oe).map((function(j){K.get(j).then((function($){null==$&&($={}),K.set(j,ee(ee({},oe[j]),$))}))}))})),!0}},t}();K.MessagesStore=ie},function(j,K,$){"use strict";K.__esModule=!0,K.BlockedUsersRequestBuilder=K.BlockedUsersRequest=void 0;var ee=$(6),te=$(0),ne=$(11),re=$(2),oe=$(1),ie=function(){function t(j){this.next_page=1,this.current_page=1,this.total_pages=-1,this.fetchingInProgress=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},te.isFalsy(j)||(this.limit=j.limit,te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.direction)||(this.direction=j.direction))}return t.prototype.validateBlockedUsersBuilder=function(){if(void 0===this.limit)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>oe.DEFAULT_VALUES.USERS_MAX_LIMIT)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",oe.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limit<oe.DEFAULT_VALUES.ZERO)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(void 0!==this.direction){if(typeof this.direction!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_DIRECTION","SET_DIRECTION","setDirection()")));if(this.direction!=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BOTH&&this.direction!=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME&&this.direction!=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME)return new re.CometChatException(oe.UserErrors.INVALID_DIRECTION)}},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{if(j.fetchingInProgress)j.fetchingInProgress=!1,K([]);else{j.fetchingInProgress=!0;var te=j.validateBlockedUsersBuilder();if(te instanceof re.CometChatException)return void $(te);ee.makeApiCall("blockedUsersList",{},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(j){ee.push(ne.UsersController.trasformJSONUser(j))})),K(ee)}else K([]);j.fetchingInProgress=!1}),(function(K){j.fetchingInProgress=!1,$(new re.CometChatException(K.error))}))}}catch(te){j.fetchingInProgress=!1,$(new re.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.direction)||(j.direction=this.direction),te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t.directions=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS,t}();K.BlockedUsersRequest=ie;var ae=function(){function t(){}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.setDirection=function(j){return this.direction=j,this},t.prototype.blockedByMe=function(){return this.direction=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME,this},t.prototype.hasBlockedMe=function(){return this.direction=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME,this},t.prototype.build=function(){return new ie(this)},t}();K.BlockedUsersRequestBuilder=ae},function(j,K,$){"use strict";K.__esModule=!0,K.AppSettingsBuilder=K.AppSettings=void 0;var ee=$(1),te=function(){function e(j){this.subscriptionType=e.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=ee.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null,this.subscriptionType=j.subscriptionType,this.roles=j.roles,this.region=j.region,this.autoJoinGroup=j.autoJoinGroup,this.establishSocketConnection=j.establishSocketConnection,this.adminHost=j.adminHost,this.clientHost=j.clientHost}return e.prototype.getSubscriptionType=function(){return this.subscriptionType},e.prototype.getRoles=function(){return this.roles},e.prototype.getRegion=function(){return this.region},e.prototype.getIsAutoJoinEnabled=function(){return this.autoJoinGroup},e.prototype.shouldAutoEstablishSocketConnection=function(){return this.establishSocketConnection},e.prototype.getAdminHost=function(){return this.adminHost},e.prototype.getClientHost=function(){return this.clientHost},e.SUBSCRIPTION_TYPE_NONE="NONE",e.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",e.SUBSCRIPTION_TYPE_ROLES="ROLES",e.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",e.REGION_EU=ee.DEFAULT_VALUES.REGION_DEFAULT_EU,e.REGION_US=ee.DEFAULT_VALUES.REGION_DEFAULT_US,e.REGION_IN=ee.DEFAULT_VALUES.REGION_DEFAULT_IN,e.REGION_PRIVATE=ee.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,e}();K.AppSettings=te;var ne=function(){function t(){this.subscriptionType=te.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=ee.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null}return t.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=te.SUBSCRIPTION_TYPE_ALL_USERS,this},t.prototype.subscribePresenceForRoles=function(j){return this.subscriptionType=te.SUBSCRIPTION_TYPE_ROLES,this.roles=j,this},t.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=te.SUBSCRIPTION_TYPE_FRIENDS,this},t.prototype.setRegion=function(j){return void 0===j&&(j=ee.DEFAULT_VALUES.REGION_DEFAULT),this.region=j.toLowerCase(),this},t.prototype.enableAutoJoinForGroups=function(j){return void 0===j&&(j=!0),this.autoJoinGroup=j,this},t.prototype.autoEstablishSocketConnection=function(j){return void 0===j&&(j=!0),this.establishSocketConnection=j,this},t.prototype.overrideAdminHost=function(j){return this.adminHost=j,this},t.prototype.overrideClientHost=function(j){return this.clientHost=j,this},t.prototype.build=function(){return new te(this)},t}();K.AppSettingsBuilder=ne},function(j,K,$){"use strict";K.__esModule=!0,K.CometChatHelper=void 0;var ee=$(10),te=$(1),ne=$(11),re=$(15),oe=$(24),ie=$(3),ae=$(2),se=$(0),le=function(){function t(){}return t.processMessage=function(j){try{return ee.MessageController.trasformJSONMessge(j)}catch(j){se.Logger.error("CometChatHelper: processMessage",j)}},t.getConversationFromMessage=function(j){return new Promise((function(K,$){try{ie.CometChat.getLoggedinUser().then((function(ie){if(null!==ie){var ae=ee.MessageController.trasformJSONMessge(j),se=ae.receiverType,le=ae.conversationId,ce=void 0,ue=ee.MessageController.trasformJSONMessge(j);if(se==te.MessageConstatnts.RECEIVER_TYPE.USER){var de=ne.UsersController.trasformJSONUser(ae[te.MessageConstatnts.KEYS.SENDER]);ce=de.getUid()==ie.getUid()?ne.UsersController.trasformJSONUser(ae[te.MessageConstatnts.KEYS.RECEIVER]):de}else ce=re.GroupsController.trasformJSONGroup(ae[te.MessageConstatnts.KEYS.RECEIVER]);var pe=oe.ConversationController.trasformJSONConversation(le,se,ue,ce,0,[]);K(pe)}else $(te.UserErrors.USER_NOT_LOGGED_IN)}),(function(j){$(new ae.CometChatException(j.error))}))}catch(j){$(new ae.CometChatException(j))}}))},t}();K.CometChatHelper=le},function(j,K,$){"use strict";K.__esModule=!0,K.MainVideoContainerSetting=K.VirtualBackgroundBuilder=K.VirtualBackground=K.CallSettingsBuilder=K.CallSettings=void 0;var ee=$(1),te=$(0),ne=function(){function t(j){this.sessionID=j.sessionID,this.defaultLayout=j.defaultLayout,this.isAudioOnly=j.isAudioOnly,this.region=j.region,this.user=j.user,this.mode=j.mode,this.domain=j.domain,this.ShowEndCallButton=j.ShowEndCallButton,this.ShowMuteAudioButton=j.ShowMuteAudioButton,this.ShowPauseVideoButton=j.ShowPauseVideoButton,this.ShowScreenShareButton=j.ShowScreenShareButton,this.ShowSwitchModeButton=j.ShowSwitchModeButton,this.StartAudioMuted=j.StartAudioMuted,this.StartVideoMuted=j.StartVideoMuted,this.localizedObject=j.localizedObject,this.analyticsSettings=j.analyticsSettings,this.appId=j.appId,this.customCSS=j.customCSS,this.ShowRecordingButton=j.ShowRecordingButton,this.StartRecordingOnCallStart=j.StartRecordingOnCallStart,this.useLegacyUI=j.useLegacyUI,this.ShowSwitchToVideoCallButton=j.ShowSwitchToVideoCallButton,this.VirtualBackground=j.virtualBackground,this.ShowVirtualBackgroundSetting=j.ShowVirtualBackgroundSetting,this.MainVideoContainerSetting=j.MainVideoContainerSetting}return t.prototype.shouldUseLegacyUI=function(){return this.useLegacyUI},t.prototype.isRecordingButtonEnabled=function(){return this.ShowRecordingButton},t.prototype.shouldStartRecordingOnCallStart=function(){return this.StartRecordingOnCallStart},t.prototype.getCustomCSS=function(){return this.customCSS},t.prototype.getSessionId=function(){return this.sessionID},t.prototype.isAudioOnlyCall=function(){return this.isAudioOnly},t.prototype.getUser=function(){return this.user},t.prototype.getRegion=function(){return this.region},t.prototype.getAppId=function(){return this.appId},t.prototype.getDomain=function(){return this.domain},t.prototype.isDefaultLayoutEnabled=function(){return this.defaultLayout},t.prototype.getMode=function(){return this.mode},t.prototype.getStartWithAudioMuted=function(){return this.StartAudioMuted},t.prototype.getStartWithVideoMuted=function(){return this.StartVideoMuted},t.prototype.isEndCallButtonEnabled=function(){return this.ShowEndCallButton},t.prototype.isMuteAudioButtonEnabled=function(){return this.ShowMuteAudioButton},t.prototype.isPauseVideoButtonEnabled=function(){return this.ShowPauseVideoButton},t.prototype.isScreenShareButtonEnabled=function(){return this.ShowScreenShareButton},t.prototype.isModeButtonEnabled=function(){return this.ShowSwitchModeButton},t.prototype.getLocalizedStringObject=function(){return this.localizedObject},t.prototype.getAnalyticsSettings=function(){return this.analyticsSettings},t.prototype.isAudioToVideoButtonEnabled=function(){return this.ShowSwitchToVideoCallButton},t.prototype.getVirtualBackground=function(){return this.VirtualBackground},t.prototype.isVirtualBackgroundSettingEnabled=function(){return this.ShowVirtualBackgroundSetting},t.prototype.getMainVideoContainerSetting=function(){return this.MainVideoContainerSetting},t.POSITION_TOP_LEFT="top-left",t.POSITION_TOP_RIGHT="top-right",t.POSITION_BOTTOM_LEFT="bottom-left",t.POSITION_BOTTOM_RIGHT="bottom-right",t.ASPECT_RATIO_DEFAULT="default",t.ASPECT_RATIO_CONTAIN="contain",t.ASPECT_RATIO_COVER="cover",t}();K.CallSettings=ne;var re=function(){function t(){this.defaultLayout=!0,this.isAudioOnly=!1,this.mode=ee.CallConstants.CALL_MODE.DEFAULT,this.ShowEndCallButton=!0,this.ShowMuteAudioButton=!0,this.ShowPauseVideoButton=!0,this.ShowScreenShareButton=!0,this.ShowSwitchModeButton=!0,this.StartAudioMuted=!1,this.StartVideoMuted=!1,this.localizedObject={},this.analyticsSettings={},this.ShowRecordingButton=!1,this.StartRecordingOnCallStart=!1,this.useLegacyUI=!1,this.ShowSwitchToVideoCallButton=!0,this.virtualBackground=(new ie).build(),this.ShowVirtualBackgroundSetting=!0,this.MainVideoContainerSetting=new ae}return t.prototype.setSessionID=function(j){return this.sessionID=j,this},t.prototype.enableDefaultLayout=function(j){return this.defaultLayout=j,this},t.prototype.setIsAudioOnlyCall=function(j){return this.isAudioOnly=j,this},t.prototype.setRegion=function(j){return this.region=j,this},t.prototype.setDomain=function(j){return this.domain=j,this},t.prototype.setUser=function(j){return this.user=j,this},t.prototype.setMode=function(j){return this.mode=j,this},t.prototype.showEndCallButton=function(j){return this.ShowEndCallButton=j,this},t.prototype.showMuteAudioButton=function(j){return this.ShowMuteAudioButton=j,this},t.prototype.showPauseVideoButton=function(j){return this.ShowPauseVideoButton=j,this},t.prototype.showScreenShareButton=function(j){return this.ShowScreenShareButton=j,this},t.prototype.showModeButton=function(j){return this.ShowSwitchModeButton=j,this},t.prototype.setLocalizedStringObject=function(j){return this.localizedObject=j,this},t.prototype.setAnalyticsSettings=function(j){return this.analyticsSettings=j,this},t.prototype.setAppId=function(j){return this.appId=j,this},t.prototype.startWithAudioMuted=function(j){return this.StartAudioMuted=j,this},t.prototype.startWithVideoMuted=function(j){return this.StartVideoMuted=j,this},t.prototype.setCustomCSS=function(j){return this.customCSS=j,this},t.prototype.showRecordingButton=function(j){return this.ShowRecordingButton=j,this},t.prototype.startRecordingOnCallStart=function(j){return this.StartRecordingOnCallStart=j,this},t.prototype.forceLegacyUI=function(j){return this.useLegacyUI=j,this},t.prototype.showSwitchToVideoCallButton=function(j){return this.ShowSwitchToVideoCallButton=j,this},t.prototype.setVirtualBackground=function(j){return this.virtualBackground=j,this},t.prototype.showVirtualBackgroundSetting=function(j){return this.ShowVirtualBackgroundSetting=j,this},t.prototype.setMainVideoContainerSetting=function(j){return this.MainVideoContainerSetting=j,this},t.prototype.build=function(){return new ne(this)},t}();K.CallSettingsBuilder=re;var oe=function(){function t(j){this.AllowBackgroundBlur=j.AllowBackgroundBlur,this.AllowUserImages=j.AllowUserImages,this.ShowDefaultImages=j.ShowDefaultImages,this.SetImages=j.SetImages,this.EnforceBackgroundBlur=j.EnforceBackgroundBlur,this.EnforceBackgroundImage=j.EnforceBackgroundImage}return t.prototype.shouldAllowBackgroundBlur=function(){return this.AllowBackgroundBlur},t.prototype.shouldAllowUserImages=function(){return this.AllowUserImages},t.prototype.shouldShowDefaultImages=function(){return this.ShowDefaultImages},t.prototype.getImages=function(){return this.SetImages},t.prototype.isBackgroundBlurEnforced=function(){return this.EnforceBackgroundBlur},t.prototype.getEnforcedBackgroundImage=function(){return this.EnforceBackgroundImage},t}();K.VirtualBackground=oe;var ie=function(){function t(){this.AllowBackgroundBlur=!0,this.AllowUserImages=!0,this.ShowDefaultImages=!0,this.SetImages=[],this.EnforceBackgroundBlur=0,this.EnforceBackgroundImage=""}return t.prototype.allowBackgroundBlur=function(j){return this.AllowBackgroundBlur=j,this},t.prototype.allowUserImages=function(j){return this.AllowUserImages=j,this},t.prototype.showDefaultImages=function(j){return this.ShowDefaultImages=j,this},t.prototype.setImages=function(j){return this.SetImages=j,this},t.prototype.enforceBackgroundBlur=function(j){return this.EnforceBackgroundBlur=j,this},t.prototype.enforceBackgroundImage=function(j){return this.EnforceBackgroundImage=j,this},t.prototype.build=function(){return new oe(this)},t}();K.VirtualBackgroundBuilder=ie;var ae=function(){function t(){this.videoFit=ne.ASPECT_RATIO_CONTAIN,this.zoomButton=ee.CallConstants.ZOOM_BUTTON_DEFAULT_PARAMS,this.nameLabel=ee.CallConstants.NAME_LABEL_DEFAULT_PARAMS,this.network=ee.CallConstants.NETWORK_LABEL_DEFAULT_PARAMS}return t.prototype.setMainVideoAspectRatio=function(j){this.videoFit=j},t.prototype.setFullScreenButtonParams=function(j,K){te.isFalsy(j)||(this.zoomButton[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=j),null!=K&&null!=K&&(this.zoomButton[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=K)},t.prototype.setNameLabelParams=function(j,K,$){te.isFalsy(j)||(this.nameLabel[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=j),null!=K&&null!=K&&(this.nameLabel[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=K),te.isFalsy($)||(this.nameLabel[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.COLOR]=$)},t.prototype.setNetworkLabelParams=function(j,K){te.isFalsy(j)||(this.network[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=j),null!=K&&null!=K&&(this.network[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=K)},t}();K.MainVideoContainerSetting=ae},function(j,K,$){"use strict";K.__esModule=!0,K.RTCUser=void 0;var ee=$(0),te=function(){function t(j){this.avatar="",ee.isFalsy(j)||(this.uid=j.toString())}return t.prototype.setUID=function(j){this.uid=j?j.toString():""},t.prototype.getUID=function(){return this.uid.toString()},t.prototype.setName=function(j){this.name=j?j.toString():""},t.prototype.getName=function(){return this.name.toString()},t.prototype.setAvatar=function(j){this.avatar=j?j.toString():""},t.prototype.getAvatar=function(){return this.avatar.toString()},t.prototype.setJWT=function(j){this.jwt=j?j.toString():""},t.prototype.getJWT=function(){return this.jwt.toString()},t.prototype.setResource=function(j){this.resource=j?j.toString():""},t.prototype.getResource=function(){return this.resource.toString()},t}();K.RTCUser=te},function(j,K,$){"use strict";var ee=this&&this.__awaiter||function(j,K,$,ee){return new($||($=Promise))((function(te,ne){function o(j){try{r(ee.next(j))}catch(j){ne(j)}}function s(j){try{r(ee.throw(j))}catch(j){ne(j)}}function r(j){var K;j.done?te(j.value):(K=j.value,K instanceof $?K:new $((function(j){j(K)}))).then(o,s)}r((ee=ee.apply(j,K||[])).next())}))},te=this&&this.__generator||function(j,K){var $,ee,te,ne,re={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return ne={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(ne[Symbol.iterator]=function(){return this}),ne;function e(ne){return function(oe){return function(ne){if($)throw new TypeError("Generator is already executing.");for(;re;)try{if($=1,ee&&(te=2&ne[0]?ee.return:ne[0]?ee.throw||((te=ee.return)&&te.call(ee),0):ee.next)&&!(te=te.call(ee,ne[1])).done)return te;switch(ee=0,te&&(ne=[2&ne[0],te.value]),ne[0]){case 0:case 1:te=ne;break;case 4:return re.label++,{value:ne[1],done:!1};case 5:re.label++,ee=ne[1],ne=[0];continue;case 7:ne=re.ops.pop(),re.trys.pop();continue;default:if(!(te=0<(te=re.trys).length&&te[te.length-1])&&(6===ne[0]||2===ne[0])){re=0;continue}if(3===ne[0]&&(!te||ne[1]>te[0]&&ne[1]<te[3])){re.label=ne[1];break}if(6===ne[0]&&re.label<te[1]){re.label=te[1],te=ne;break}if(te&&re.label<te[2]){re.label=te[2],re.ops.push(ne);break}te[2]&&re.ops.pop(),re.trys.pop();continue}ne=K.call(j,re)}catch(j){ne=[6,j],ee=0}finally{$=te=0}if(5&ne[0])throw ne[1];return{value:ne[0]?ne[1]:void 0,done:!0}}([ne,oe])}}};K.__esModule=!0,K.WSConnectionHelper=void 0;var ne=$(3),re=$(1),oe=$(31),ie=$(36),ae=$(0),se=$(37),le=$(30),ce=$(25),ue=$(20),de=$(21),pe=$(54),ge=$(55),he=$(56),me=$(57),fe=$(58),ye=$(59),be=$(60),ve=$(22),Me=$(27),Ee=$(26),Se=$(5),Ce=$(61),_e=se.ListenerHandlers.getInstance(),Te=function(){function e(){}return e.getInstance=function(){try{return null!=this.wsConnectionHelper&&null!=this.wsConnectionHelper||(this.wsConnectionHelper=new e),this.wsConnectionHelper}catch(j){ae.Logger.error("WSConnectionHelper: getInstance",j)}},e.prototype.WSLogin=function(j,K){var $=this;try{Ce.getWSURL().then((function(ee){$.connection=new WebSocket(ee),K&&$.connection&&$.connection.readyState==Se.READY_STATE.CONNECTING&&K($.connection.readyState),$.connection.onopen=function(ee){$.onOpen(ee,K),$.authenticateUser(j)},$.connection.onclose=function(j){$.onClose(j,K)},$.connection.onmessage=function(j){$.onMessage(j)}}),(function(j){ae.Logger.error("WSConnectionHelper :: WSLogin",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: WSLogin",j)}},e.prototype.onOpen=function(j,K){try{K&&this.connection&&K(this.connection.readyState)}catch(j){ae.Logger.error("WSConnectionHelper: onOpen",j)}},e.prototype.onClose=function(j,K){try{K&&this.connection&&K(this.connection.readyState)}catch(j){ae.Logger.error("WSConnectionHelper: onClose",j)}},e.prototype.onMessage=function(j){if(j.data&&"string"==typeof j.data)try{var K=JSON.parse(j.data);if(K&&K.action&&K.action===Se.KEYS.PONG)return;var $=this.getCometChatEventFromMessage(JSON.parse(j.data));if($.getDeviceId()===ne.CometChat.getSessionId()&&$.getType()!==Se.AUTH.TYPE)return;switch($.getType()){case Se.TYPING_INDICATOR.TYPE:this.publishTypingIndicator($);break;case Se.RECEIPTS.TYPE:this.publishReceipts($);break;case Se.PRESENCE.TYPE:this.publishPresence($);break;case Se.AUTH.TYPE:this.authResponseReceived($);break;case Se.MESSAGE.TYPE:this.publishMessages($);break;case Se.TRANSIENT_MESSAGE.TYPE:this.publishTransientMessage($);break;default:ae.Logger.log("WSHelper: onMessage :: unknown type",j.data)}}catch(j){ae.Logger.error("WSHelper: onMessage",j)}else ae.Logger.log("WSHelper: onMessage :: object data",j.data)},e.prototype.authenticateUser=function(j){var K=this;try{ne.CometChat.getLoggedinUser().then((function($){$?le.KeyStore.getInstance().get("deviceId").then((function(ee){ae.getAppSettings().then((function(te){var oe=null;window&&window.location&&window.location.origin&&(oe=window.location.origin);var ie="",se=ee,le={version:re.SDKHeader.sdkVersion,apiVersion:te[re.APP_SETTINGS.KEYS.CHAT_API_VERSION],origin:oe,uts:(new Date).getTime()};ae.isFalsy(ne.CometChat.resource)||(le.resource=ne.CometChat.resource),ae.isFalsy(ne.CometChat.platform)||(le.platform=ne.CometChat.platform),ae.isFalsy(ne.CometChat.language)||(le.language=ne.CometChat.language),navigator&&(ie=navigator.userAgent);var ce={appInfo:le,userAgent:ie,deviceId:se,platform:re.SDKHeader.platform},ue=new pe.CometChatAuthEvent(ne.CometChat.getAppId(),"","",$.getUid(),ne.CometChat.getSessionId());if(ue.setAuth(j),ue.setPresenceSubscription(ne.CometChat.appSettings.getSubscriptionType()),ue.setDeviceId(ne.CometChat.getSessionId()),ue.setExtraParmaeters(ce),Ce.checkConnection(K.connection)){var de=ue.getAsString();K.connection.send(de)}}))})):ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: startTypingIndicator",j)}},e.prototype.authResponseReceived=function(j){try{"200"===j.getCode()&&"OK"===j.getStatus()&&this.startPingingWS()}catch(j){ae.Logger.error("WSConnectionHelper: authResponseReceived",j)}},e.prototype.WSLogout=function(){try{this.clearPingTimer(),Ce.checkConnection(this.connection)&&this.connection.close(Se.LOGOUT_CODE,Se.LOGOUT_REASON)}catch(j){ae.Logger.error("WSConnectionHelper: WSLogout",j)}},e.prototype.startPingingWS=function(){var j=this;try{e.pingTimer||(e.pingTimer=setInterval((function(){return ee(j,void 0,void 0,(function(){var j,K;return te(this,(function($){switch($.label){case 0:return Ce.checkConnection(this.connection)?(j=new he.CometChatPingEvent("","","","",""),K=j.getAsString(),this.connection.send(K),[4,this.listenForPong()]):[3,2];case 1:$.sent()?(ae.Logger.log("WSConnectionHelper :: startPingingWS","pong success"),ne.CometChat.getConnectionStatus()!=re.CONNECTION_STATUS.CONNECTED&&(this.WSLogout(),this.connection=null,ne.CometChat.getInstance().makeWSConnection())):(ae.Logger.log("WSConnectionHelper :: startPingingWS","pong failure"),this.WSLogout(),this.connection=null,ne.CometChat.getInstance().setConnectionStatus(re.CONNECTION_STATUS.DISCONNECTED),_e.connectionHandlers.map((function(j){try{j._eventListener&&(ae.isFalsy(j._eventListener.onDisconnected)||j._eventListener.onDisconnected())}catch(j){ae.Logger.error("WSConnectionHandlers: Disconnected Status",j)}})),ne.CometChat.getInstance().accidentallyDisconnected()),$.label=2;case 2:return[2]}}))}))}),15e3))}catch(j){ae.Logger.error("WSConnectionHelper: startPingingWS",j)}},e.prototype.listenForPong=function(){var j=this;return new Promise((function(K,$){var ee=setTimeout((function(){K(!1)}),3e3);j.connection.addEventListener("message",(function(j){j&&j.data&&"string"==typeof j.data&&JSON.parse(j.data).action===Se.KEYS.PONG&&(clearTimeout(ee),K(!0))}))}))},e.prototype.clearPingTimer=function(){e.pingTimer&&(clearInterval(e.pingTimer),e.pingTimer=void 0)},e.prototype.sendOnlineEvent=function(){var j=this;try{Ce.checkConnection(this.connection)&&ne.CometChat.getLoggedinUser().then((function(K){if(K){K.authToken&&delete K.authToken;var $={appId:ne.CometChat.getAppId(),deviceId:ne.CometChat.getSessionId(),type:Se.PRESENCE.TYPE,body:{action:Se.PRESENCE.ACTION.ONLINE,timestamp:Math.floor((new Date).getTime()/1e3),user:K}};if(Ce.checkConnection(j.connection)){var ee=Ce.stringifyMessage($);j.connection.send(ee)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: sendOnlineEvent",j)}},e.prototype.sendOfflineEvent=function(){var j=this;try{Ce.checkConnection(this.connection)&&ne.CometChat.getLoggedinUser().then((function(K){if(K){K.authToken&&delete K.authToken;var $={appId:ne.CometChat.getAppId(),deviceId:ne.CometChat.getSessionId(),type:Se.PRESENCE.TYPE,body:{action:Se.PRESENCE.ACTION.OFFLINE,timestamp:Math.floor((new Date).getTime()/1e3),user:K}};if(Ce.checkConnection(j.connection)){var ee=Ce.stringifyMessage($);j.connection.send(ee)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: sendOfflineEvent",j)}},e.prototype.startTypingIndicator=function(j,K,$){var ee=this;try{ne.CometChat.getLoggedinUser().then((function(te){if(te){var re=new Ee.TypingIndicator(j,K);te.authToken&&delete te.authToken,re.setSender(te),$&&re.setMetadata($);var oe=new be.CometChatTypingEvent(ne.CometChat.getAppId(),j,K,te.getUid(),ne.CometChat.getSessionId());if(oe.setAction(Se.TYPING_INDICATOR.ACTION.STARTED),oe.setTypingIndicator(re),Ce.checkConnection(ee.connection)){var ie=oe.getAsString();ee.connection.send(ie)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: startTypingIndicator",j)}},e.prototype.pauseTypingIndicator=function(j,K,$){var ee=this;try{ne.CometChat.getLoggedinUser().then((function(te){if(te){var re=new Ee.TypingIndicator(j,K);te.authToken&&delete te.authToken,re.setSender(te),$&&re.setMetadata($);var oe=new be.CometChatTypingEvent(ne.CometChat.getAppId(),j,K,te.getUid(),ne.CometChat.getSessionId());if(oe.setAction(Se.TYPING_INDICATOR.ACTION.ENDED),oe.setTypingIndicator(re),Ce.checkConnection(ee.connection)){var ie=oe.getAsString();ee.connection.send(ie)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: pauseTypingIndicator",j)}},e.prototype.markAsRead=function(j,K,$,ee){var te=this;try{ne.CometChat.getMode(),ne.CometChat.getLoggedinUser().then((function(re){if(re){var oe=new fe.CometChatReceiptEvent(ne.CometChat.getAppId(),j,K,re.getUid(),ne.CometChat.getSessionId(),ee);oe.setAction(Se.RECEIPTS.ACTION.READ);var ie=new ve.MessageReceipt;if(re.authToken&&delete re.authToken,ie.setSender(re),ie.setReceiverType(K),ie.setReceiver(j),ie.setReceiptType(Se.RECEIPTS.RECEIPT_TYPE.READ_RECEIPT),ie.setMessageId($),ie.setTimestamp(Math.floor((new Date).getTime()/1e3).toString()),oe.setMessageReceipt(ie),Ce.checkConnection(te.connection)){var se=oe.getAsString();te.connection.send(se)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: markAsRead",j)}},e.prototype.markAsDelivered=function(j,K,$,ee){var te=this;try{ne.CometChat.getMode(),ne.CometChat.getLoggedinUser().then((function(re){if(re){var oe=new fe.CometChatReceiptEvent(ne.CometChat.getAppId(),j,K,re.getUid(),ne.CometChat.getSessionId(),ee);oe.setAction(Se.RECEIPTS.ACTION.DELIVERED);var ie=new ve.MessageReceipt;if(re.authToken&&delete re.authToken,ie.setSender(re),ie.setReceiverType(K),ie.setReceiver(j),ie.setReceiptType(Se.RECEIPTS.RECEIPT_TYPE.DELIVERY_RECEIPT),ie.setMessageId($),ie.setTimestamp(Math.floor((new Date).getTime()/1e3).toString()),oe.setMessageReceipt(ie),Ce.checkConnection(te.connection)){var se=oe.getAsString();te.connection.send(se)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: markAsDelivered",j)}},e.prototype.sendTransientMessage=function(j,K,$){var ee=this;try{ne.CometChat.getLoggedinUser().then((function(te){if(te){var re=new Me.TransientMessage(j,K,$);te.authToken&&delete te.authToken,re.setSender(te);var oe=new ye.CometChatTransientEvent(ne.CometChat.getAppId(),j,K,te.getUid(),ne.CometChat.getSessionId());if(oe.setTransientMessage(re),Ce.checkConnection(ee.connection)){var ie=oe.getAsString();ee.connection.send(ie)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: sendTransientMessage",j)}},e.prototype.publishTypingIndicator=function(j){try{var K=j.getTypingIndicator();switch(j.getAction()){case Se.TYPING_INDICATOR.ACTION.STARTED:_e.messageHandlers.map((function(j){j._eventListener.onTypingStarted&&j._eventListener.onTypingStarted(K)})),ie.TypingNotificationController.addIncomingTypingStarted(K);break;case Se.TYPING_INDICATOR.ACTION.ENDED:_e.messageHandlers.map((function(j){j._eventListener.onTypingEnded&&j._eventListener.onTypingEnded(K)})),ie.TypingNotificationController.removeIncomingTypingStarted(K)}}catch(j){ae.Logger.error("WSHelper: publishTypingIndicator",j)}},e.prototype.publishReceipts=function(j){try{var K=j.getMessageReceipt();switch(j.getAction()){case Se.RECEIPTS.ACTION.DELIVERED:_e.messageHandlers.map((function(j){j._eventListener.onMessagesDelivered&&j._eventListener.onMessagesDelivered(K)}));break;case Se.RECEIPTS.ACTION.READ:_e.messageHandlers.map((function(j){j._eventListener.onMessagesRead&&j._eventListener.onMessagesRead(K)}))}}catch(j){ae.Logger.error("WSHelper: publishReceipts",j)}},e.prototype.publishPresence=function(j){try{var K=j.getUser();switch(K.setLastActiveAt(j.getTimestamp()),j.getAction()){case Se.PRESENCE.ACTION.ONLINE:case Se.PRESENCE.ACTION.AVAILABLE:K.setStatus(re.PresenceConstatnts.STATUS.ONLINE),_e.userHandlers.map((function(j){ae.isFalsy(j._eventListener.onUserOnline)||j._eventListener.onUserOnline(K)}));break;case Se.PRESENCE.ACTION.OFFLINE:K.setStatus(re.PresenceConstatnts.STATUS.OFFLINE),_e.userHandlers.map((function(j){ae.isFalsy(j._eventListener.onUserOffline)||j._eventListener.onUserOffline(K)}))}}catch(j){ae.Logger.error("WSHelper: publishPresence",j)}},e.prototype.publishMessages=function(j){try{var K=j.getMessage();K&&K.getId()&&ce.MessageListnerMaping.getInstance().set("all",K.getId()),K instanceof de.Call?this.publishCallMessage(K):K instanceof ue.Action?this.publishActionMessage(K):this.publishMessage(K)}catch(j){ae.Logger.error("WSHelper: publishMessages",j)}},e.prototype.publishMessage=function(j){try{_e.messageHandlers.map((function(K){if(K._eventListener){var $=j;switch($.getType()){case re.MessageConstatnts.TYPE.TEXT:ae.isFalsy(K._eventListener.onTextMessageReceived)||K._eventListener.onTextMessageReceived(j);break;case re.MessageConstatnts.TYPE.CUSTOM:ae.isFalsy(K._eventListener.onCustomMessageReceived)||K._eventListener.onCustomMessageReceived(j);break;default:$.getCategory()==re.MessageCategory.CUSTOM?ae.isFalsy(K._eventListener.onCustomMessageReceived)||K._eventListener.onCustomMessageReceived(j):ae.isFalsy(K._eventListener.onMediaMessageReceived)||K._eventListener.onMediaMessageReceived(j)}}}))}catch(j){ae.Logger.error("WSHelper: publishMessage",j)}},e.prototype.publishCallMessage=function(j){try{var K=oe.CallController.getInstance().getActiveCall();switch(j.getStatus()){case re.CallConstants.CALL_STATUS.INITIATED:j.getReceiverType()==re.CallConstants.RECEIVER_TYPE_GROUP?_e.callHandlers.map((function(K){j.getCallInitiator().getUid().toLocaleLowerCase()!=ne.CometChat.user.getUid().toLocaleLowerCase()&&(ae.isFalsy(K._eventListener.onIncomingCallReceived)||K._eventListener.onIncomingCallReceived(j))})):_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onIncomingCallReceived)||K._eventListener.onIncomingCallReceived(j)}));break;case re.CallConstants.CALL_STATUS.ONGOING:j.getReceiverType()==re.CallConstants.RECEIVER_TYPE_GROUP?j.getCallInitiator().getUid().toLocaleLowerCase()==ne.CometChat.user.getUid().toLocaleLowerCase()&&_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallAccepted)||K._eventListener.onOutgoingCallAccepted(j)})):_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallAccepted)||K._eventListener.onOutgoingCallAccepted(j)}));break;case re.CallConstants.CALL_STATUS.UNANSWERED:if(j.getCallInitiator().getUid().toLocaleLowerCase()==ne.CometChat.user.getUid().toLocaleLowerCase())_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallRejected)||K._eventListener.onOutgoingCallRejected(j)}));else{if(null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch(j){ae.Logger.error("CallError",j)}_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onIncomingCallCancelled)||K._eventListener.onIncomingCallCancelled(j)}))}break;case re.CallConstants.CALL_STATUS.REJECTED:if(j.getReceiverType()==re.CallConstants.RECEIVER_TYPE_GROUP)j.getCallInitiator().getUid().toLocaleLowerCase()==ne.CometChat.user.getUid().toLocaleLowerCase()&&_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallRejected)||K._eventListener.onOutgoingCallRejected(j)}));else{if(null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch(j){ae.Logger.error("CallError",j)}_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallRejected)||K._eventListener.onOutgoingCallRejected(j)}))}break;case re.CallConstants.CALL_STATUS.BUSY:j.getReceiverType()==re.CallConstants.RECEIVER_TYPE_GROUP?j.getCallInitiator().getUid().toLocaleLowerCase()==ne.CometChat.user.getUid().toLocaleLowerCase()&&_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallRejected)||K._eventListener.onOutgoingCallRejected(j)})):_e.callHandlers.map((function($){if(null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch($){ae.Logger.error("CallError",$)}ae.isFalsy($._eventListener.onOutgoingCallRejected)||$._eventListener.onOutgoingCallRejected(j)}));break;case re.CallConstants.CALL_STATUS.CANCELLED:if(_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onIncomingCallCancelled)||K._eventListener.onIncomingCallCancelled(j)})),null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch(j){ae.Logger.error("CallError",j)}break;case re.CallConstants.CALL_STATUS.ENDED:if(oe.CallController.getInstance().getCallListner()&&oe.CallController.getInstance().getCallListner()._eventListener.onCallEnded(j),null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch(j){ae.Logger.error("CallError",j)}break;default:ae.Logger.log("WSHelper: publishCallMessage :: unknown status",j)}}catch(j){ae.Logger.error("WSHelper: publishCallMessage",j)}},e.prototype.publishActionMessage=function(j){try{switch(j.getAction()){case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_JOINED:case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_INVITED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberJoined)||K._eventListener.onGroupMemberJoined(j,j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_LEFT:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberLeft)||K._eventListener.onGroupMemberLeft(j,j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_BANNED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberBanned)||K._eventListener.onGroupMemberBanned(j,j.getActionOn(),j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_KICKED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberKicked)||K._eventListener.onGroupMemberKicked(j,j.getActionOn(),j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_UNBANNED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberUnbanned)||K._eventListener.onGroupMemberUnbanned(j,j.getActionOn(),j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_SCOPE_CHANGED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberScopeChanged)||K._eventListener.onGroupMemberScopeChanged(j,j.getActionOn(),j.getNewScope(),j.getOldScope(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MESSAGE_EDITED:_e.messageHandlers.map((function(K){ae.isFalsy(K._eventListener.onMessageEdited)||K._eventListener.onMessageEdited(j.getActionOn())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MESSAGE_DELETED:_e.messageHandlers.map((function(K){ae.isFalsy(K._eventListener.onMessageDeleted)||K._eventListener.onMessageDeleted(j.getActionOn())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_ADDED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberAddedToGroup)||K._eventListener.onGroupMemberAddedToGroup(j,j.getActionOn(),j.getActionBy(),j.getActionFor())}));break;default:ae.Logger.log("WSHelper: publishActionMessage :: unknown action",j)}}catch(j){ae.Logger.error("WSHelper: publishActionMessage",j)}},e.prototype.publishTransientMessage=function(j){try{var K=j.getTransientMessage();_e.messageHandlers.map((function(j){j._eventListener.onTransientMessageReceived&&j._eventListener.onTransientMessageReceived(K)}))}catch(j){ae.Logger.error("WSHelper: publishTransientMessage",j)}},e.prototype.getCometChatEventFromMessage=function(j){try{if(j.hasOwnProperty(Se.KEYS.TYPE))switch(j.type){case Se.TYPING_INDICATOR.TYPE:return be.CometChatTypingEvent.getTypingEventFromJSON(j);case Se.RECEIPTS.TYPE:return fe.CometChatReceiptEvent.getReceiptEventFromJSON(j);case Se.PRESENCE.TYPE:return me.CometChatPresenceEvent.getPresenceEventFromJSON(j);case Se.MESSAGE.TYPE:return ge.CometChatMessageEvent.getMessageEventFromJSON(j);case Se.AUTH.TYPE:return pe.CometChatAuthEvent.getAuthEventFromJSON(j);case Se.TRANSIENT_MESSAGE.TYPE:return ye.CometChatTransientEvent.getTransientEventFromJSON(j)}}catch(j){ae.Logger.error("WSConnectionHelper: getCometChatEventFromMessage",j)}},e.wsConnectionHelper=new e,e}();K.WSConnectionHelper=Te},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatAuthEvent=void 0;var ne=$(5),re=function(j){function u(K,$,ee,te,re){var oe=j.call(this,K,$,ee,te,re)||this;return oe.setType(ne.AUTH.TYPE),oe}return te(u,j),u.prototype.getStatus=function(){return this.status},u.prototype.setStatus=function(j){this.status=j},u.prototype.getCode=function(){return this.code},u.prototype.setCode=function(j){this.code=j},u.prototype.setAuth=function(j){this.auth=j},u.prototype.getAuth=function(){return this.auth},u.prototype.setPresenceSubscription=function(j){this.presenceSubscription=j},u.prototype.getPresenceSubscription=function(){return this.presenceSubscription},u.prototype.setDeviceId=function(j){this.deviceId=j},u.prototype.getdeviceId=function(){return this.deviceId},u.prototype.setExtraParmaeters=function(j){this.params=j},u.prototype.getExtraParameters=function(){return this.params},u.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},u.prototype.getAsJSONObject=function(){var j=this.getCometChatEventJSON(),K={};return K[ne.KEYS.AUTH]=this.auth,K[ne.KEYS.DEVICE_ID]=this.deviceId,K[ne.KEYS.PRESENCE_SUBSCRIPTION]=this.presenceSubscription,K[ne.KEYS.PARAMS]=this.params,j[ne.KEYS.BODY]=K,j},u.getAuthEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.RECEIVER],ee=j[ne.KEYS.RECEIVER_TYPE],te=j[ne.KEYS.DEVICE_ID],re=j[ne.KEYS.SENDER],oe=j[ne.KEYS.BODY],ie=oe[ne.KEYS.STATUS],ae=oe[ne.KEYS.CODE],se=new u(K,$,ee,re,te);return se.setStatus(ie),se.setCode(ae),se},u}($(9).CometChatEvent);K.CometChatAuthEvent=re},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatMessageEvent=void 0;var ne=$(10),re=$(5),oe=function(j){function c(K,$,ee,te,ne){var oe=j.call(this,K,$,ee,te,ne)||this;return oe.setType(re.MESSAGE.TYPE),oe}return te(c,j),c.prototype.getMessage=function(){return this.message},c.prototype.setMessage=function(j){this.message=j},c.getMessageEventFromJSON=function(j){var K=j[re.KEYS.APP_ID],$=j[re.KEYS.RECEIVER],ee=j[re.KEYS.RECEIVER_TYPE],te=j[re.KEYS.DEVICE_ID],oe=j[re.KEYS.SENDER],ie=j[re.KEYS.BODY],ae=new c(K,$,ee,oe,te),se=ne.MessageController.trasformJSONMessge(ie);return ae.setMessage(se),ae},c}($(9).CometChatEvent);K.CometChatMessageEvent=oe},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatPingEvent=void 0;var ne=$(5),re=function(j){function t(K,$,ee,te,ne){return j.call(this,K,$,ee,te,ne)||this}return te(t,j),t.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},t.prototype.getAsJSONObject=function(){var j={};return j[ne.KEYS.ACTION]=ne.KEYS.PING,j[ne.KEYS.ACK]="true",j},t}($(9).CometChatEvent);K.CometChatPingEvent=re},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatPresenceEvent=void 0;var ne=$(5),re=$(9),oe=$(4),ie=function(j){function c(K,$,ee,te,re){var oe=j.call(this,K,$,ee,te,re)||this;return oe.setType(ne.PRESENCE.TYPE),oe}return te(c,j),c.prototype.getAction=function(){return this.action},c.prototype.setAction=function(j){this.action=j},c.prototype.getUser=function(){return this.user},c.prototype.setUser=function(j){this.user=j},c.prototype.getTimestamp=function(){return this.timestamp},c.prototype.setTimestamp=function(j){this.timestamp=j},c.getPresenceEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.DEVICE_ID],ee=j[ne.KEYS.SENDER],te=j[ne.KEYS.BODY],re=te[ne.KEYS.ACTION],ie=te[ne.KEYS.USER],ae=te[ne.KEYS.TIMESTAMP],se=new c(K,"","",ee,$);return se.setAction(re),se.setUser(new oe.User(ie)),se.setTimestamp(ae),se},c}(re.CometChatEvent);K.CometChatPresenceEvent=ie},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatReceiptEvent=void 0;var ne=$(5),re=$(9),oe=$(22),ie=$(4),ae=function(j){function p(K,$,ee,te,re,oe){var ie=j.call(this,K,$,ee,te,re,oe)||this;return ie.setType(ne.RECEIPTS.TYPE),ie}return te(p,j),p.prototype.getAction=function(){return this.action},p.prototype.setAction=function(j){this.action=j},p.prototype.getMessageReceipt=function(){return this.receipt},p.prototype.setMessageReceipt=function(j){this.receipt=j},p.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},p.prototype.getAsJSONObject=function(){var j=this.getCometChatEventJSON(),K={};return K[ne.KEYS.ACTION]=this.action,K[ne.KEYS.MESSAGE_ID]=this.receipt.getMessageId(),K[ne.KEYS.USER]=this.receipt.getSender(),j[ne.KEYS.BODY]=K,j},p.getReceiptEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.RECEIVER],ee=j[ne.KEYS.RECEIVER_TYPE],te=j[ne.KEYS.DEVICE_ID],re=j[ne.KEYS.SENDER],ae=j[ne.KEYS.BODY],se=ae[ne.KEYS.ACTION],le=ae[ne.KEYS.USER],ce=ae[ne.KEYS.MESSAGE_ID],ue=ae[ne.KEYS.TIMESTAMP],de=new p(K,$,ee,re,te);de.setAction(se);var pe=new oe.MessageReceipt;return pe.setSender(new ie.User(le)),pe.setReceiverType(ee),pe.setReceiver($),se===ne.RECEIPTS.ACTION.DELIVERED&&(pe.setReceiptType(ne.RECEIPTS.RECEIPT_TYPE.DELIVERY_RECEIPT),pe.setDeliveredAt(ue)),se===ne.RECEIPTS.ACTION.READ&&(pe.setReceiptType(ne.RECEIPTS.RECEIPT_TYPE.READ_RECEIPT),pe.setReadAt(ue)),pe.setMessageId(ce.toString()),pe.setTimestamp(ue),de.setMessageReceipt(pe),de},p}(re.CometChatEvent);K.CometChatReceiptEvent=ae},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatTransientEvent=void 0;var ne=$(5),re=$(9),oe=$(27),ie=$(4),ae=function(j){function S(K,$,ee,te,re){var oe=j.call(this,K,$,ee,te,re)||this;return oe.setType(ne.TRANSIENT_MESSAGE.TYPE),oe}return te(S,j),S.prototype.getTransientMessage=function(){return this.transientMessage},S.prototype.setTransientMessage=function(j){this.transientMessage=j},S.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},S.prototype.getAsJSONObject=function(){var j=this.getCometChatEventJSON(),K={};return K[ne.KEYS.USER]=this.transientMessage.getSender(),this.transientMessage.getData()&&(K[ne.KEYS.DATA]=this.transientMessage.getData()),j[ne.KEYS.BODY]=K,j},S.getTransientEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.RECEIVER],ee=j[ne.KEYS.RECEIVER_TYPE],te=j[ne.KEYS.DEVICE_ID],re=j[ne.KEYS.SENDER],ae=j[ne.KEYS.BODY],se=ae[ne.KEYS.USER],le=ae[ne.KEYS.DATA],ce=new S(K,$,ee,re,te),ue=new oe.TransientMessage($,ee,le);return ue.setSender(new ie.User(se)),ae.hasOwnProperty(ne.KEYS.DATA)&&ae[ne.KEYS.DATA]&&ue.setData(le),ce.setTransientMessage(ue),ce},S}(re.CometChatEvent);K.CometChatTransientEvent=ae},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatTypingEvent=void 0;var ne=$(5),re=$(9),oe=$(26),ie=$(4),ae=function(j){function l(K,$,ee,te,re){var oe=j.call(this,K,$,ee,te,re)||this;return oe.setType(ne.TYPING_INDICATOR.TYPE),oe}return te(l,j),l.prototype.getAction=function(){return this.action},l.prototype.setAction=function(j){this.action=j},l.prototype.getTypingIndicator=function(){return this.typingIndicator},l.prototype.setTypingIndicator=function(j){this.typingIndicator=j},l.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},l.prototype.getAsJSONObject=function(){var j=this.getCometChatEventJSON(),K={};return K[ne.KEYS.ACTION]=this.action,K[ne.KEYS.USER]=this.typingIndicator.getSender(),this.typingIndicator.getMetadata()&&(K[ne.KEYS.METADATA]=this.typingIndicator.getMetadata()),j[ne.KEYS.BODY]=K,j},l.getTypingEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.RECEIVER],ee=j[ne.KEYS.RECEIVER_TYPE],te=j[ne.KEYS.DEVICE_ID],re=j[ne.KEYS.SENDER],ae=j[ne.KEYS.BODY],se=ae[ne.KEYS.ACTION],le=ae[ne.KEYS.USER],ce=ae[ne.KEYS.METADATA],ue=new l(K,$,ee,re,te);ue.setAction(se);var de=new oe.TypingIndicator($,ee);return de.setSender(new ie.User(le)),ae.hasOwnProperty(ne.KEYS.METADATA)&&ae[ne.KEYS.METADATA]&&de.setMetadata(ce),ue.setTypingIndicator(de),ue},l}(re.CometChatEvent);K.CometChatTypingEvent=ae},function(j,K,$){"use strict";K.__esModule=!0,K.getWSURL=K.stringifyMessage=K.checkConnection=void 0;var ee=$(1),te=$(0),ne=$(5);K.checkConnection=function(j){return j&&j.readyState===ne.READY_STATE.OPEN},K.stringifyMessage=function(j){return JSON.stringify(j)},K.getWSURL=function(){return new Promise((function(j,K){te.getAppSettings().then((function(K){var $=ne.WS.protocol+te.getChatHost(K)+":"+K[ee.APP_SETTINGS.KEYS.CHAT_WSS_PORT];j($)}),(function(j){te.Logger.error("WSHelper :: getWSURL",j)}))}))}},function(j,K,$){"use strict";K.__esModule=!0,K.CCExtension=void 0;var ee=$(0),te=function(){function t(j){this.id="",this.name="",j&&(ee.isFalsy(j.id)||(this.id=j.id),ee.isFalsy(j.name)||(this.name=j.name))}return t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t}();K.CCExtension=te},function(j,K,$){var ee=$(64),te=$(65);j.exports=function(j,K,$){var ne=K&&$||0;"string"==typeof j&&(K="binary"===j?new Array(16):null,j=null);var re=(j=j||{}).random||(j.rng||ee)();if(re[6]=15&re[6]|64,re[8]=63&re[8]|128,K)for(var oe=0;oe<16;++oe)K[ne+oe]=re[oe];return K||te(re)}},function(j,K){var $="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if($){var ee=new Uint8Array(16);j.exports=function(){return $(ee),ee}}else{var te=new Array(16);j.exports=function(){for(var j,K=0;K<16;K++)0==(3&K)&&(j=4294967296*Math.random()),te[K]=j>>>((3&K)<<3)&255;return te}}},function(j,K){for(var $=[],ee=0;ee<256;++ee)$[ee]=(ee+256).toString(16).substr(1);j.exports=function(j,K){var ee=K||0,te=$;return[te[j[ee++]],te[j[ee++]],te[j[ee++]],te[j[ee++]],"-",te[j[ee++]],te[j[ee++]],"-",te[j[ee++]],te[j[ee++]],"-",te[j[ee++]],te[j[ee++]],"-",te[j[ee++]],te[j[ee++]],te[j[ee++]],te[j[ee++]],te[j[ee++]],te[j[ee++]]].join("")}}])},9094:(j,K,$)=>{"use strict";$.d(K,{$L:()=>ee,Ab:()=>be,Cq:()=>ce,DO:()=>Ge,EC:()=>ue,IE:()=>Ve,Ie:()=>Te,JK:()=>ae,JY:()=>Ne,Ks:()=>Ye,Mu:()=>Pe,O5:()=>fe,P5:()=>Qe,Q:()=>Ke,Qb:()=>Ue,RW:()=>de,Sg:()=>He,TU:()=>ve,UA:()=>Ie,Vm:()=>Be,W8:()=>he,Wt:()=>De,XM:()=>_e,XZ:()=>Fe,Xu:()=>ge,YI:()=>ze,Yo:()=>le,Yr:()=>me,_H:()=>Ee,dO:()=>Ce,e$:()=>$e,e0:()=>Je,gv:()=>pe,io:()=>ie,jK:()=>re,jR:()=>Ae,k2:()=>Re,m$:()=>je,mU:()=>Xe,nv:()=>xe,nw:()=>Le,o2:()=>Ze,oZ:()=>se,os:()=>ne,ot:()=>Oe,p4:()=>Se,pS:()=>qe,pm:()=>ye,pn:()=>we,r9:()=>oe,s6:()=>nt,sG:()=>et,wO:()=>We,x9:()=>Me,x_:()=>te,yw:()=>ke});var ee="schedule",te="invoke",ne="addEventListener",re=["link","css","script","img","xmlhttprequest","fetch","beacon","iframe"],oe=5e3,ie=3e5,ae=1e3,se="page-load",le="custom",ce="user-interaction",ue="http-request",de="temporary",pe="Unknown",ge="page-exit",he=[se,"route-change",ce,ue,le,de],me="success",fe="failure",ye="unknown",be=60,ve="transaction:start",Me="transaction:end",Ee="config:change",Se="queue:flush",Ce="queue:add_transaction",_e="transaction:ignore",Te="xmlhttprequest",Ae="fetch",Ie="history",Ne="eventtarget",Oe="click",we="error",De=":before",xe=":after",je="elastic_apm_config",Le="longtask",ke="paint",Pe="measure",Re="navigation",ze="resource",Ue="first-contentful-paint",Ge="largest-contentful-paint",Be="first-input",Ze="layout-shift",Ye="event",He="errors",We="transactions",Ve="ConfigService",Fe="LoggingService",Qe="TransactionService",Ke="ApmServer",Je="PerformanceMonitoring",Xe="ErrorLogging",qe=".truncated",$e=1024,et=18e5,nt=1e4},5951:function(j,K,$){var ee,te,ne;!function(re,oe){"use strict";te=[$(8742)],void 0===(ne="function"==typeof(ee=function ErrorStackParser(j){var K=/(^|@)\S+\:\d+/,$=/^\s*at .*(\S+\:\d+|\(native\))/m,ee=/^(eval@)?(\[native code\])?$/;function _map(j,K,$){if("function"==typeof Array.prototype.map)return j.map(K,$);for(var ee=new Array(j.length),te=0;te<j.length;te++)ee[te]=K.call($,j[te]);return ee}function _filter(j,K,$){if("function"==typeof Array.prototype.filter)return j.filter(K,$);for(var ee=[],te=0;te<j.length;te++)K.call($,j[te])&&ee.push(j[te]);return ee}function _indexOf(j,K){if("function"==typeof Array.prototype.indexOf)return j.indexOf(K);for(var $=0;$<j.length;$++)if(j[$]===K)return $;return-1}return{parse:function ErrorStackParser$$parse(j){if(void 0!==j.stacktrace||void 0!==j["opera#sourceloc"])return this.parseOpera(j);if(j.stack&&j.stack.match($))return this.parseV8OrIE(j);if(j.stack)return this.parseFFOrSafari(j);throw new Error("Cannot parse given Error object")},extractLocation:function ErrorStackParser$$extractLocation(j){if(-1===j.indexOf(":"))return[j];var K=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(j.replace(/[\(\)]/g,""));return[K[1],K[2]||void 0,K[3]||void 0]},parseV8OrIE:function ErrorStackParser$$parseV8OrIE(K){return _map(_filter(K.stack.split("\n"),(function(j){return!!j.match($)}),this),(function(K){K.indexOf("(eval ")>-1&&(K=K.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var $=K.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),ee=this.extractLocation($.pop()),te=$.join(" ")||void 0,ne=_indexOf(["eval","<anonymous>"],ee[0])>-1?void 0:ee[0];return new j(te,void 0,ne,ee[1],ee[2],K)}),this)},parseFFOrSafari:function ErrorStackParser$$parseFFOrSafari(K){return _map(_filter(K.stack.split("\n"),(function(j){return!j.match(ee)}),this),(function(K){if(K.indexOf(" > eval")>-1&&(K=K.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===K.indexOf("@")&&-1===K.indexOf(":"))return new j(K);var $=K.split("@"),ee=this.extractLocation($.pop()),te=$.join("@")||void 0;return new j(te,void 0,ee[0],ee[1],ee[2],K)}),this)},parseOpera:function ErrorStackParser$$parseOpera(j){return!j.stacktrace||j.message.indexOf("\n")>-1&&j.message.split("\n").length>j.stacktrace.split("\n").length?this.parseOpera9(j):j.stack?this.parseOpera11(j):this.parseOpera10(j)},parseOpera9:function ErrorStackParser$$parseOpera9(K){for(var $=/Line (\d+).*script (?:in )?(\S+)/i,ee=K.message.split("\n"),te=[],ne=2,re=ee.length;ne<re;ne+=2){var oe=$.exec(ee[ne]);oe&&te.push(new j(void 0,void 0,oe[2],oe[1],void 0,ee[ne]))}return te},parseOpera10:function ErrorStackParser$$parseOpera10(K){for(var $=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,ee=K.stacktrace.split("\n"),te=[],ne=0,re=ee.length;ne<re;ne+=2){var oe=$.exec(ee[ne]);oe&&te.push(new j(oe[3]||void 0,void 0,oe[2],oe[1],void 0,ee[ne]))}return te},parseOpera11:function ErrorStackParser$$parseOpera11($){return _map(_filter($.stack.split("\n"),(function(j){return!!j.match(K)&&!j.match(/^Error created at/)}),this),(function(K){var $,ee=K.split("@"),te=this.extractLocation(ee.pop()),ne=ee.shift()||"",re=ne.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;ne.match(/\(([^\)]*)\)/)&&($=ne.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var oe=void 0===$||"[arguments not available]"===$?void 0:$.split(",");return new j(re,oe,te[0],te[1],te[2],K)}),this)}}})?ee.apply(K,te):ee)||(j.exports=ne)}()},8742:function(j,K){var $,ee,te;!function(ne,re){"use strict";ee=[],void 0===(te="function"==typeof($=function(){function _isNumber(j){return!isNaN(parseFloat(j))&&isFinite(j)}function StackFrame(j,K,$,ee,te,ne){void 0!==j&&this.setFunctionName(j),void 0!==K&&this.setArgs(K),void 0!==$&&this.setFileName($),void 0!==ee&&this.setLineNumber(ee),void 0!==te&&this.setColumnNumber(te),void 0!==ne&&this.setSource(ne)}return StackFrame.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(j){this.functionName=String(j)},getArgs:function(){return this.args},setArgs:function(j){if("[object Array]"!==Object.prototype.toString.call(j))throw new TypeError("Args must be an Array");this.args=j},getFileName:function(){return this.fileName},setFileName:function(j){this.fileName=String(j)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(j){if(!_isNumber(j))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(j)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(j){if(!_isNumber(j))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(j)},getSource:function(){return this.source},setSource:function(j){this.source=String(j)},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(_isNumber(this.getLineNumber())?":"+this.getLineNumber():"")+(_isNumber(this.getColumnNumber())?":"+this.getColumnNumber():"")}},StackFrame})?$.apply(K,ee):$)||(j.exports=te)}()},9010:(j,K,$)=>{"use strict";function createStackTraces(j,K){var $=K.error,ee=K.filename,te=K.lineno,ne=K.colno,re=[];if($)try{re=j.parse($)}catch(j){}return function isValidStackTrace(j){return 0!==j.length&&(1!==j.length||"lineNumber"in j[0])}(re)||(re=[{fileName:ee,lineNumber:te,columnNumber:ne}]),function normalizeStackFrames(j){return j.map((function(j){return j.functionName&&(j.functionName=function normalizeFunctionName(j){var K=j.split("/");return j=K.length>1?["Object",K[K.length-1]].join("."):K[0],j=(K=(j=(j=j.replace(/.<$/gi,".<anonymous>")).replace(/^Anonymous function$/,"<anonymous>")).split(".")).length>1?K[K.length-1]:K[0]}(j.functionName)),j}))}(re).map((function(j){var K=j.fileName,$=j.lineNumber,ee=j.columnNumber,te=j.functionName,ne=void 0===te?"<anonymous>":te;if(!K&&!$)return{};if(!ee&&!$)return{};var re=function cleanFilePath(j){return void 0===j&&(j=""),"<anonymous>"===j&&(j=""),j}(K),oe=function filePathToFileName(j){var K=window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");return j.indexOf(K)>-1&&(j=j.replace(K+"/","")),j}(re);return function isFileInline(j){return!!j&&0===window.location.href.indexOf(j)}(re)&&(oe="(inline script)"),{abs_path:K,filename:oe,function:ne,lineno:$,colno:ee}}))}$.d(K,{tu:()=>vt,S1:()=>Mt});const ee=function finallyConstructor(j){var K=this.constructor;return this.then((function($){return K.resolve(j()).then((function(){return $}))}),(function($){return K.resolve(j()).then((function(){return K.reject($)}))}))};const te=function allSettled(j){return new this((function(K,$){if(!j||void 0===j.length)return $(new TypeError(typeof j+" "+j+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var ee=Array.prototype.slice.call(j);if(0===ee.length)return K([]);var te=ee.length;function res(j,$){if($&&("object"==typeof $||"function"==typeof $)){var ne=$.then;if("function"==typeof ne)return void ne.call($,(function(K){res(j,K)}),(function($){ee[j]={status:"rejected",reason:$},0==--te&&K(ee)}))}ee[j]={status:"fulfilled",value:$},0==--te&&K(ee)}for(var ne=0;ne<ee.length;ne++)res(ne,ee[ne])}))};var ne=$(5108),re=setTimeout;function isArray(j){return Boolean(j&&void 0!==j.length)}function noop(){}function Promise(j){if(!(this instanceof Promise))throw new TypeError("Promises must be constructed via new");if("function"!=typeof j)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],doResolve(j,this)}function handle(j,K){for(;3===j._state;)j=j._value;0!==j._state?(j._handled=!0,Promise._immediateFn((function(){var $=1===j._state?K.onFulfilled:K.onRejected;if(null!==$){var ee;try{ee=$(j._value)}catch(j){return void reject(K.promise,j)}resolve(K.promise,ee)}else(1===j._state?resolve:reject)(K.promise,j._value)}))):j._deferreds.push(K)}function resolve(j,K){try{if(K===j)throw new TypeError("A promise cannot be resolved with itself.");if(K&&("object"==typeof K||"function"==typeof K)){var $=K.then;if(K instanceof Promise)return j._state=3,j._value=K,void finale(j);if("function"==typeof $)return void doResolve(function bind(j,K){return function(){j.apply(K,arguments)}}($,K),j)}j._state=1,j._value=K,finale(j)}catch(K){reject(j,K)}}function reject(j,K){j._state=2,j._value=K,finale(j)}function finale(j){2===j._state&&0===j._deferreds.length&&Promise._immediateFn((function(){j._handled||Promise._unhandledRejectionFn(j._value)}));for(var K=0,$=j._deferreds.length;K<$;K++)handle(j,j._deferreds[K]);j._deferreds=null}function Handler(j,K,$){this.onFulfilled="function"==typeof j?j:null,this.onRejected="function"==typeof K?K:null,this.promise=$}function doResolve(j,K){var $=!1;try{j((function(j){$||($=!0,resolve(K,j))}),(function(j){$||($=!0,reject(K,j))}))}catch(j){if($)return;$=!0,reject(K,j)}}Promise.prototype.catch=function(j){return this.then(null,j)},Promise.prototype.then=function(j,K){var $=new this.constructor(noop);return handle(this,new Handler(j,K,$)),$},Promise.prototype.finally=ee,Promise.all=function(j){return new Promise((function(K,$){if(!isArray(j))return $(new TypeError("Promise.all accepts an array"));var ee=Array.prototype.slice.call(j);if(0===ee.length)return K([]);var te=ee.length;function res(j,ne){try{if(ne&&("object"==typeof ne||"function"==typeof ne)){var re=ne.then;if("function"==typeof re)return void re.call(ne,(function(K){res(j,K)}),$)}ee[j]=ne,0==--te&&K(ee)}catch(j){$(j)}}for(var ne=0;ne<ee.length;ne++)res(ne,ee[ne])}))},Promise.allSettled=te,Promise.resolve=function(j){return j&&"object"==typeof j&&j.constructor===Promise?j:new Promise((function(K){K(j)}))},Promise.reject=function(j){return new Promise((function(K,$){$(j)}))},Promise.race=function(j){return new Promise((function(K,$){if(!isArray(j))return $(new TypeError("Promise.race accepts an array"));for(var ee=0,te=j.length;ee<te;ee++)Promise.resolve(j[ee]).then(K,$)}))},Promise._immediateFn="function"==typeof setImmediate&&function(j){setImmediate(j)}||function(j){re(j,0)},Promise._unhandledRejectionFn=function _unhandledRejectionFn(j){void 0!==ne&&ne&&ne.warn("Possible Unhandled Promise Rejection:",j)};const oe=Promise;var ie={};le?ie=window:"undefined"!=typeof self&&(ie=self);var ae="Promise"in ie?ie.Promise:oe,se=[].slice,le="undefined"!=typeof window,ce=le&&"undefined"!=typeof performance?performance:{};for(var ue=[],de=0;de<256;++de)ue[de]=(de+256).toString(16).substr(1);var pe=new Uint8Array(16);function generateRandomId(j){return function bytesToHex(j){for(var K=[],$=0;$<j.length;$++)K.push(ue[j[$]]);return K.join("")}(function rng(){return"undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues?crypto.getRandomValues(pe):"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues?msCrypto.getRandomValues(pe):pe}()).substr(0,j)}function setRequestHeader(j,K,$){"function"==typeof j.setRequestHeader?j.setRequestHeader(K,$):j.headers&&"function"==typeof j.headers.append?j.headers.append(K,$):j[K]=$}function checkSameOrigin(j,K){var $=!1;return"string"==typeof K?$=j===K:K&&"function"==typeof K.test?$=K.test(j):Array.isArray(K)&&K.forEach((function(K){$||($=checkSameOrigin(j,K))})),$}function isPlatformSupported(){return le&&"function"==typeof Set&&"function"==typeof JSON.stringify&&ce&&"function"==typeof ce.now&&function isCORSSupported(){return"withCredentials"in new window.XMLHttpRequest}()}function setLabel(j,K,$){if($&&j){var ee=removeInvalidChars(j),te=typeof K;return null!=K&&"boolean"!==te&&"number"!==te&&(K=String(K)),$[ee]=K,$}}function stripQueryStringFromUrl(j){return j&&j.split("?")[0]}function isObject(j){return null!==j&&"object"==typeof j}function baseExtend(j,K,$){for(var ee=0,te=K.length;ee<te;++ee){var ne=K[ee];if(isObject(ne)||"function"==typeof ne)for(var re=Object.keys(ne),oe=0,ie=re.length;oe<ie;oe++){var ae=re[oe],se=ne[ae];$&&isObject(se)?(isObject(j[ae])||(j[ae]=Array.isArray(se)?[]:{}),baseExtend(j[ae],[se],!1)):j[ae]=se}}return j}function getCurrentScript(){if("undefined"!=typeof document){var j=document.currentScript;return j||function getElasticScript(){if("undefined"!=typeof document)for(var j=document.getElementsByTagName("script"),K=0,$=j.length;K<$;K++){var ee=j[K];if(ee.src.indexOf("elastic")>0)return ee}}()}}function extend(){return baseExtend(Object.create(null),se.call(arguments),!1)}function merge(){return baseExtend(Object.create(null),se.call(arguments),!0)}function isUndefined(j){return void 0===j}function utils_noop(){}function removeInvalidChars(j){return j.replace(/[.*"]/g,"_")}function getLatestSpan(j,K){for(var $=null,ee=0;ee<j.length;ee++){var te=j[ee];K&&K(te.type)&&(!$||$._end<te._end)&&($=te)}return $}function now(){return ce.now()}function getTime(j){return"number"==typeof j&&j>=0?j:now()}function getDuration(j,K){return isUndefined(K)||isUndefined(j)?null:parseInt(K-j)}function scheduleMicroTask(j){ae.resolve().then(j)}function isPerfTimelineSupported(){return"function"==typeof ce.getEntriesByType}function isPerfTypeSupported(j){return"undefined"!=typeof PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.indexOf(j)>=0}function isPerfInteractionCountSupported(){return"interactionCount"in performance}function isRedirectInfoAvailable(j){return j.redirectStart>0}var ge=[["#","hash"],["?","query"],["/","path"],["@","auth",1],[NaN,"host",void 0,1]],he=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,me=function(){function Url(j){var K,$=this.extractProtocol(j||""),ee=$.protocol,te=$.address,ne=$.slashes,re=!ee&&!ne,oe=this.getLocation(),ie=ge.slice();te=te.replace("\\","/"),ne||(ie[2]=[NaN,"path"]);for(var ae=0;ae<ie.length;ae++){var se=ie[ae],le=se[0],ce=se[1];if("string"==typeof le){if(~(K=te.indexOf(le))){var ue=se[2];if(ue){var de=te.lastIndexOf(le);K=Math.max(K,de),this[ce]=te.slice(0,K),te=te.slice(K+ue)}else this[ce]=te.slice(K),te=te.slice(0,K)}}else this[ce]=te,te="";this[ce]=this[ce]||re&&se[3]&&oe[ce]||"",se[3]&&(this[ce]=this[ce].toLowerCase())}if(re&&"/"!==this.path.charAt(0)&&(this.path="/"+this.path),this.relative=re,this.protocol=ee||oe.protocol,this.hostname=this.host,this.port="",/:\d+$/.test(this.host)){var pe=this.host.split(":"),he=pe.pop(),me=pe.join(":");!function isDefaultPort(j,K){switch(K){case"http:":return"80"===j;case"https:":return"443"===j}return!0}(he,this.protocol)?this.port=he:this.host=me,this.hostname=me}this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null",this.href=this.toString()}var j=Url.prototype;return j.toString=function toString(){var j=this.protocol;if(j+="//",this.auth){var K="[REDACTED]",$=this.auth.split(":");j+=($[0]?K:"")+($[1]?":"+K:"")+"@"}return j+=this.host,j+=this.path,j+=this.query,j+=this.hash},j.getLocation=function getLocation(){var j={};return le&&(j=window),j.location},j.extractProtocol=function extractProtocol(j){var K=he.exec(j);return{protocol:K[1]?K[1].toLowerCase():"",slashes:!!K[2],address:K[3]}},Url}();var fe=$(9094),ye=["tags"];function getResponseContext(j){var K={transfer_size:j.transferSize,encoded_body_size:j.encodedBodySize,decoded_body_size:j.decodedBodySize},$=function getServerTimingInfo(j){void 0===j&&(j=[]);for(var K=[],$=0;$<j.length;$++){var ee=j[$],te=ee.name,ne=ee.duration,re=ee.description,oe=te;re&&(oe+=";desc="+re),ne&&(oe+=";dur="+ne),K.push(oe)}return K.join(", ")}(j.serverTiming);return $&&(K.headers={"server-timing":$}),K}function getDestination(j){var K=j.port,$=j.protocol,ee=j.hostname,te=function getPortNumber(j,K){return""===j&&(j="http:"===K?"80":"https:"===K?"443":""),j}(K,$),ne=91===ee.charCodeAt(0)&&93===ee.charCodeAt(ee.length-1),re=ee;return ne&&(re=ee.slice(1,-1)),{service:{resource:ee+":"+te,name:"",type:""},address:re,port:Number(te)}}function getPageContext(){return{page:{referer:document.referrer,url:location.href}}}function addSpanContext(j,K){if(K){var $;switch(j.type){case"external":$=function getExternalContext(j){var K,$=j.url,ee=j.method,te=j.target,ne=j.response,re=new me($),oe=getDestination(re),ie={http:{method:ee,url:re.href},destination:oe};return te&&void 0!==te.status?K=te.status:ne&&(K=ne.status),ie.http.status_code=K,ie}(K);break;case"resource":$=function getResourceContext(j){var K=j.entry,$=j.url,ee=getDestination(new me($));return{http:{url:$,response:getResponseContext(K)},destination:ee}}(K);break;case"hard-navigation":$=function getNavigationContext(j){var K=j.url;return{destination:getDestination(new me(K))}}(K)}j.addContext($)}}function addTransactionContext(j,K){var $=void 0===K?{}:K,ee=($.tags,function _objectWithoutPropertiesLoose(j,K){if(null==j)return{};var $,ee,te={},ne=Object.keys(j);for(ee=0;ee<ne.length;ee++)$=ne[ee],K.indexOf($)>=0||(te[$]=j[$]);return te}($,ye)),te=getPageContext(),ne={};if(j.type===fe.Xu)j.ensureContext(),j.context.page&&j.context.page.url&&(te.page.url=j.context.page.url);else if(j.type===fe.oZ&&isPerfTimelineSupported()){var re=ce.getEntriesByType(fe.k2);re&&re.length>0&&(ne={response:getResponseContext(re[0])})}j.addContext(te,ne,ee)}var be={service:{name:[fe.e$,!0],version:!0,agent:{version:[fe.e$,!0]},environment:!0},labels:{"*":!0}},ve={"*":!0,headers:{"*":!0}},Me={user:{id:!0,email:!0,username:!0},tags:{"*":!0},http:{response:ve},destination:{address:[fe.e$],service:{"*":[fe.e$,!0]}},response:ve},Ee={name:[fe.e$,!0],type:[fe.e$,!0],id:[fe.e$,!0],trace_id:[fe.e$,!0],parent_id:[fe.e$,!0],transaction_id:[fe.e$,!0],subtype:!0,action:!0,context:Me},Se={name:!0,parent_id:!0,type:[fe.e$,!0],id:[fe.e$,!0],trace_id:[fe.e$,!0],span_count:{started:[fe.e$,!0]},context:Me},Ce={id:[fe.e$,!0],trace_id:!0,transaction_id:!0,parent_id:!0,culprit:!0,exception:{type:!0},transaction:{type:!0},context:Me};function isEmpty(j){return null==j||""===j||void 0===j}function replaceValue(j,K,$){var ee=function truncate(j,K,$,ee){return void 0===K&&(K=fe.e$),void 0===$&&($=!1),void 0===ee&&(ee="N/A"),$&&isEmpty(j)&&(j=ee),"string"==typeof j?j.substring(0,K):j}(j[K],$[0],$[1]);isEmpty(ee)?delete j[K]:j[K]=ee}function truncateModel(j,K,$){void 0===j&&(j={}),void 0===$&&($=K);for(var ee=Object.keys(j),te=[],ne=function _loop(ne){var re=ee[ne],oe=!0===j[re]?te:j[re];Array.isArray(oe)?"*"===re?Object.keys($).forEach((function(j){return replaceValue($,j,oe)})):replaceValue($,re,oe):truncateModel(oe,K,$[re])},re=0;re<ee.length;re++)ne(re);return K}var _e=$(5951),Te=$.n(_e),Ae=["tags"];var Ie=["stack","message"],Ne="Unhandled promise rejection: ";var Oe=function(){function ErrorLogging(j,K,$){this._apmServer=j,this._configService=K,this._transactionService=$}var j=ErrorLogging.prototype;return j.createErrorDataModel=function createErrorDataModel(j){var K=function filterInvalidFrames(j){return j.filter((function(j){var K=j.filename,$=j.lineno;return void 0!==K&&void 0!==$}))}(createStackTraces(Te(),j)),$="(inline script)",ee=K[K.length-1];ee&&ee.filename&&($=ee.filename);var te=j.message,ne=j.error,re=te,oe="",ie={};if(ne&&"object"==typeof ne){re=re||ne.message,oe=ne.name;var ae=function getErrorProperties(j){var K=!1,$={};if(Object.keys(j).forEach((function(ee){if(!(Ie.indexOf(ee)>=0)){var te=j[ee];if(null!=te&&"function"!=typeof te){if("object"==typeof te){if("function"!=typeof te.toISOString)return;te=te.toISOString()}$[ee]=te,K=!0}}})),K)return $}(ne);ae&&(ie.custom=ae)}oe||re&&re.indexOf(":")>-1&&(oe=re.split(":")[0]);var se=this._transactionService.getCurrentTransaction(),le=se?se.context:{},ce=this._configService.get("context"),ue=(ce.tags,function error_logging_objectWithoutPropertiesLoose(j,K){if(null==j)return{};var $,ee,te={},ne=Object.keys(j);for(ee=0;ee<ne.length;ee++)$=ne[ee],K.indexOf($)>=0||(te[$]=j[$]);return te}(ce,Ae)),de=merge({},getPageContext(),le,ue,ie),pe={id:generateRandomId(),culprit:$,exception:{message:re,stacktrace:K,type:oe},context:de};return se&&(pe=extend(pe,{trace_id:se.traceId,parent_id:se.id,transaction_id:se.id,transaction:{type:se.type,sampled:se.sampled}})),truncateModel(Ce,pe)},j.logErrorEvent=function logErrorEvent(j){if(void 0!==j){var K=this.createErrorDataModel(j);void 0!==K.exception.message&&this._apmServer.addError(K)}},j.registerListeners=function registerListeners(){var j=this;window.addEventListener("error",(function(K){return j.logErrorEvent(K)})),window.addEventListener("unhandledrejection",(function(K){return j.logPromiseEvent(K)}))},j.logPromiseEvent=function logPromiseEvent(j){var K,$=j.reason;if(null==$&&($="<no reason specified>"),"string"==typeof $.message){var ee=$.name?$.name+": ":"";K={error:$,message:Ne+ee+$.message}}else K=this._parseRejectReason($);this.logErrorEvent(K)},j.logError=function logError(j){var K={};return"string"==typeof j?K.message=j:K.error=j,this.logErrorEvent(K)},j._parseRejectReason=function _parseRejectReason(j){var K={message:Ne};if(Array.isArray(j))K.message+="<object>";else if("object"==typeof j)try{K.message+=JSON.stringify(j),K.error=j}catch(j){K.message+="<object>"}else K.message+="function"==typeof j?"<function>":j;return K},ErrorLogging}();const we=Oe;const De=function(){function Queue(j,K){void 0===K&&(K={}),this.onFlush=j,this.items=[],this.queueLimit=K.queueLimit||-1,this.flushInterval=K.flushInterval||0,this.timeoutId=void 0}var j=Queue.prototype;return j._setTimer=function _setTimer(){var j=this;this.timeoutId=setTimeout((function(){return j.flush()}),this.flushInterval)},j._clear=function _clear(){void 0!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.items=[]},j.flush=function flush(){this.onFlush(this.items),this._clear()},j.add=function add(j){this.items.push(j),-1!==this.queueLimit&&this.items.length>=this.queueLimit?this.flush():void 0===this.timeoutId&&this._setTimer()},Queue}();const xe=function(){function NDJSON(){}return NDJSON.stringify=function stringify(j){return JSON.stringify(j)+"\n"},NDJSON}();var je=["fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"],Le=["fs","ls","le","cs","ce","qs","rs","re","dl","di","ds","de","dc","es","ee"];function getPageLoadMarks(j){var K=function getNavigationTimingMarks(j){var K=j.redirectStart,$=j.fetchStart,ee=j.navigationStart,te=j.responseStart,ne=j.responseEnd;if($>=ee&&te>=$&&ne>=te){var re={};return je.forEach((function(ee){var te=j[ee];te&&te>=$&&(isRedirectInfoAvailable(j)?re[ee]=parseInt(te-K):re[ee]=parseInt(te-$))})),re}return null}(j);return null==K?null:{navigationTiming:K,agent:{timeToFirstByte:K.responseStart,domInteractive:K.domInteractive,domComplete:K.domComplete}}}function compressResponse(j){return{ts:j.transfer_size,ebs:j.encoded_body_size,dbs:j.decoded_body_size}}function compressContext(j){if(!j)return null;var K={},$=j.page,ee=j.http,te=j.response,ne=j.destination,re=j.user,oe=j.custom;if($&&(K.p={rf:$.referer,url:$.url}),ee&&(K.h=function compressHTTP(j){var K={},$=j.method,ee=j.status_code,te=j.url,ne=j.response;return K.url=te,$&&(K.mt=$),ee&&(K.sc=ee),ne&&(K.r=compressResponse(ne)),K}(ee)),te&&(K.r=compressResponse(te)),ne){var ie=ne.service;K.dt={se:{n:ie.name,t:ie.type,rc:ie.resource},ad:ne.address,po:ne.port}}return re&&(K.u={id:re.id,un:re.username,em:re.email}),oe&&(K.cu=oe),K}function compressMarks(j){if(!j)return null;var K=function compressNavigationTimingMarks(j){if(!j)return null;var K={};return Le.forEach((function($,ee){var te=je[ee];K[$]=j[te]})),K}(j.navigationTiming);return{nt:K,a:compressAgentMarks(K,j.agent)}}function compressAgentMarks(j,K){var $={};if(j&&($={fb:j.rs,di:j.di,dc:j.dc}),K){var ee=K.firstContentfulPaint,te=K.largestContentfulPaint;ee&&($.fp=ee),te&&($.lp=te)}return 0===Object.keys($).length?null:$}function compressPayload(j,K){void 0===K&&(K="gzip");var $="function"==typeof CompressionStream;return new ae((function(ee){if(!$)return ee(j);if(function isBeaconInspectionEnabled(){var j="_elastic_inspect_beacon_";if(null!=sessionStorage.getItem(j))return!0;if(!window.URL||!window.URLSearchParams)return!1;try{var K=new URL(window.location.href).searchParams.has(j);return K&&sessionStorage.setItem(j,!0),K}catch(j){}return!1}())return ee(j);var te=j.payload,ne=j.headers,re=j.beforeSend,oe=new Blob([te]).stream().pipeThrough(new CompressionStream(K));return new Response(oe).blob().then((function(j){return ne["Content-Encoding"]=K,ee({payload:j,headers:ne,beforeSend:re})}))}))}var ke=!1,Pe={bootstrapTime:null,lastHiddenStart:Number.MIN_SAFE_INTEGER};function isResponseSuccessful(j){return!(0===j||j>399&&j<600)}function _extends(){return _extends=Object.assign||function(j){for(var K=1;K<arguments.length;K++){var $=arguments[K];for(var ee in $)Object.prototype.hasOwnProperty.call($,ee)&&(j[ee]=$[ee])}return j},_extends.apply(this,arguments)}function shouldUseFetchWithKeepAlive(j,K){if(!isFetchSupported())return!1;if(!("keepalive"in new Request("")))return!1;var $=function calculateSize(j){if(!j)return 0;if(j instanceof Blob)return j.size;return new Blob([j]).size}(K);return"POST"===j&&$<6e4}function isFetchSupported(){return"function"==typeof window.fetch&&"function"==typeof window.Request}var Re={fetchInProgress:!1};function apmSymbol(j){return"__apm_symbol__"+j}function patchMethod(j,K,$){for(var ee=j;ee&&!ee.hasOwnProperty(K);)ee=Object.getPrototypeOf(ee);!ee&&j[K]&&(ee=j);var te,ne=apmSymbol(K);if(ee&&!(te=ee[ne])&&(te=ee[ne]=ee[K],function isPropertyWritable(j){return!j||!1!==j.writable&&!("function"==typeof j.get&&void 0===j.set)}(ee&&Object.getOwnPropertyDescriptor(ee,K)))){var re=$(te,ne,K);ee[K]=function(){return re(this,arguments)},function attachOriginToPatched(j,K){j[apmSymbol("OriginalDelegate")]=K}(ee[K],te)}return te}var ze=apmSymbol("xhrIgnore"),Ue=apmSymbol("xhrSync"),Ge=apmSymbol("xhrURL"),Be=apmSymbol("xhrMethod");function sendXHR(j,K,$){var ee=$.timeout,te=void 0===ee?HTTP_REQUEST_TIMEOUT:ee,ne=$.payload,re=$.headers,oe=$.beforeSend,ie=$.sendCredentials;return new ae((function($,ee){var ae=new window.XMLHttpRequest;if(ae[ze]=!0,ae.open(j,K,!0),ae.timeout=te,ae.withCredentials=ie,re)for(var se in re)re.hasOwnProperty(se)&&ae.setRequestHeader(se,re[se]);ae.onreadystatechange=function(){if(4===ae.readyState){var j=ae.status,te=ae.responseText;isResponseSuccessful(j)?$(ae):ee({url:K,status:j,responseText:te})}},ae.onerror=function(){var j=ae.status,$=ae.responseText;ee({url:K,status:j,responseText:$})};var le=!0;"function"==typeof oe&&(le=oe({url:K,method:j,headers:re,payload:ne,xhr:ae})),le?ae.send(ne):ee({url:K,status:0,responseText:"Request rejected by user configuration."})}))}var Ze=function(){function ApmServer(j,K){this._configService=j,this._loggingService=K,this.queue=void 0,this.throttleEvents=utils_noop}var j=ApmServer.prototype;return j.init=function init(){var j=this,K=this._configService.get("queueLimit"),$=this._configService.get("flushInterval"),ee=this._configService.get("eventsLimit");this.queue=new De((function onFlush(K){var $=j.sendEvents(K);$&&$.catch((function(K){j._loggingService.warn("Failed sending events!",j._constructError(K))}))}),{queueLimit:K,flushInterval:$}),this.throttleEvents=function throttle(j,K,$){var ee,te=this,ne=$.limit,re=$.interval,oe=0;return function(){return oe++,void 0===ee&&(ee=setTimeout((function(){oe=0,ee=void 0}),re)),oe>ne&&"function"==typeof K?K.apply(te,arguments):j.apply(te,arguments)}}(this.queue.add.bind(this.queue),(function(){return j._loggingService.warn("Dropped events due to throttling!")}),{limit:ee,interval:6e4}),this._configService.observeEvent(fe.p4,(function(){j.queue.flush()}))},j._postJson=function _postJson(j,K){var $=this,ee={payload:K,headers:{"Content-Type":"application/x-ndjson"},beforeSend:this._configService.get("apmRequest")};return compressPayload(ee).catch((function(j){return ee})).then((function(K){return $._makeHttpRequest("POST",j,K)})).then((function(j){return j.responseText}))},j._constructError=function _constructError(j){var K=j.url,$=j.status;j.responseText;if(void 0===$)return j;var ee=K+" HTTP status: "+$;return new Error(ee)},j._makeHttpRequest=function _makeHttpRequest(j,K,$){var ee=void 0===$?{}:$,te=ee.timeout,ne=void 0===te?fe.s6:te,re=ee.payload,oe=ee.headers,ie=ee.beforeSend,ae=this._configService.get("sendCredentials");return!ie&&shouldUseFetchWithKeepAlive(j,re)?function sendFetchRequest(j,K,$){var ee,te=$.keepalive,ne=void 0!==te&&te,re=$.timeout,oe=void 0===re?fe.s6:re,ie=$.payload,ae=$.headers,se=$.sendCredentials,le={};if("function"==typeof AbortController){var ce=new AbortController;le.signal=ce.signal,setTimeout((function(){return ce.abort()}),oe)}return window.fetch(K,_extends({body:ie,headers:ae,method:j,keepalive:ne,credentials:se?"include":"omit"},le)).then((function(j){return(ee=j).text()})).then((function(j){var $={url:K,status:ee.status,responseText:j};if(!isResponseSuccessful(ee.status))throw $;return $}))}(j,K,{keepalive:!0,timeout:ne,payload:re,headers:oe,sendCredentials:ae}).catch((function($){if($ instanceof TypeError)return sendXHR(j,K,{timeout:ne,payload:re,headers:oe,beforeSend:ie,sendCredentials:ae});throw $})):sendXHR(j,K,{timeout:ne,payload:re,headers:oe,beforeSend:ie,sendCredentials:ae})},j.fetchConfig=function fetchConfig(j,K){var $=this,ee=this.getEndpoints().configEndpoint;if(!j)return ae.reject("serviceName is required for fetching central config.");ee+="?service.name="+j,K&&(ee+="&service.environment="+K);var te=this._configService.getLocalConfig();te&&(ee+="&ifnonematch="+te.etag);var ne=this._configService.get("apmRequest");return this._makeHttpRequest("GET",ee,{timeout:5e3,beforeSend:ne}).then((function(j){var K=j.status,ee=j.responseText;if(304===K)return te;var ne=JSON.parse(ee),re=j.getResponseHeader("etag");return re&&(ne.etag=re.replace(/["]/g,""),$._configService.setLocalConfig(ne,!0)),ne})).catch((function(j){var K=$._constructError(j);return ae.reject(K)}))},j.createMetaData=function createMetaData(){var j=this._configService,K={service:{name:j.get("serviceName"),version:j.get("serviceVersion"),agent:{name:"rum-js",version:j.version},language:{name:"javascript"},environment:j.get("environment")},labels:j.get("context.tags")};return truncateModel(be,K)},j.addError=function addError(j){var K;this.throttleEvents(((K={})[fe.Sg]=j,K))},j.addTransaction=function addTransaction(j){var K;this.throttleEvents(((K={})[fe.wO]=j,K))},j.ndjsonErrors=function ndjsonErrors(j,K){var $=K?"e":"error";return j.map((function(j){var ee;return xe.stringify(((ee={})[$]=K?function compressError(j){var K,$=j.exception,ee={id:j.id,cl:j.culprit,ex:{mg:$.message,st:(K=$.stacktrace,K.map((function(j){return{ap:j.abs_path,f:j.filename,fn:j.function,li:j.lineno,co:j.colno}}))),t:j.type},c:compressContext(j.context)},te=j.transaction;return te&&(ee.tid=j.trace_id,ee.pid=j.parent_id,ee.xid=j.transaction_id,ee.x={t:te.type,sm:te.sampled}),ee}(j):j,ee))}))},j.ndjsonMetricsets=function ndjsonMetricsets(j){return j.map((function(j){return xe.stringify({metricset:j})})).join("")},j.ndjsonTransactions=function ndjsonTransactions(j,K){var $=this,ee=K?"x":"transaction";return j.map((function(j){var te,ne="",re="";return K||(j.spans&&(ne=j.spans.map((function(j){return xe.stringify({span:j})})).join(""),delete j.spans),j.breakdown&&(re=$.ndjsonMetricsets(j.breakdown),delete j.breakdown)),xe.stringify(((te={})[ee]=K?function compressTransaction(j){var K,$=j.spans.map((function(K){var $={id:K.id,n:K.name,t:K.type,s:K.start,d:K.duration,c:compressContext(K.context),o:K.outcome,sr:K.sample_rate};return K.parent_id!==j.id&&($.pid=K.parent_id),!0===K.sync&&($.sy=!0),K.subtype&&($.su=K.subtype),K.action&&($.ac=K.action),$})),ee={id:j.id,pid:j.parent_id,tid:j.trace_id,n:j.name,t:j.type,d:j.duration,c:compressContext(j.context),k:compressMarks(j.marks),me:(K=j.breakdown,K.map((function(j){var K=j.span,$=j.samples;return{y:{t:K.type},sa:{ysc:{v:$["span.self_time.count"].value},yss:{v:$["span.self_time.sum.us"].value}}}}))),y:$,yc:{sd:$.length},sm:j.sampled,sr:j.sample_rate,o:j.outcome};if(j.experience){var te=j.experience,ne=te.cls,re=te.fid,oe=te.tbt,ie=te.longtask;ee.exp={cls:ne,fid:re,tbt:oe,lt:ie}}if(j.session){var ae=j.session,se=ae.id,le=ae.sequence;ee.ses={id:se,seq:le}}return ee}(j):j,te))+ne+re}))},j.sendEvents=function sendEvents(j){var K,$;if(0!==j.length){for(var ee=[],te=[],ne=0;ne<j.length;ne++){var re=j[ne];re[fe.wO]&&ee.push(re[fe.wO]),re[fe.Sg]&&te.push(re[fe.Sg])}if(0!==ee.length||0!==te.length){var oe=this._configService,ie=((K={})[fe.wO]=ee,K[fe.Sg]=te,K),ae=oe.applyFilters(ie);if(ae){var se=oe.get("apiVersion")>2,le=[],ce=this.createMetaData(),ue=se?"m":"metadata";le.push(xe.stringify((($={})[ue]=se?function compressMetadata(j){var K=j.service,$=j.labels,ee=K.agent,te=K.language;return{se:{n:K.name,ve:K.version,a:{n:ee.name,ve:ee.version},la:{n:te.name},en:K.environment},l:$}}(ce):ce,$)));var de=(le=le.concat(this.ndjsonErrors(ae[fe.Sg],se),this.ndjsonTransactions(ae[fe.wO],se))).join(""),pe=this.getEndpoints().intakeEndpoint;return this._postJson(pe,de)}this._loggingService.warn("Dropped payload due to filtering!")}}},j.getEndpoints=function getEndpoints(){var j=this._configService.get("serverUrl"),K=this._configService.get("apiVersion");return{intakeEndpoint:j+(this._configService.get("serverUrlPrefix")||"/intake/v"+K+"/rum/events"),configEndpoint:j+"/config/v1/rum/agents"}},ApmServer}();const Ye=Ze;var He=$(5108);const We=function(){function EventHandler(){this.observers={}}var j=EventHandler.prototype;return j.observe=function observe(j,K){var $=this;if("function"==typeof K)return this.observers[j]||(this.observers[j]=[]),this.observers[j].push(K),function(){var ee=$.observers[j].indexOf(K);ee>-1&&$.observers[j].splice(ee,1)}},j.sendOnly=function sendOnly(j,K){var $=this.observers[j];$&&$.forEach((function(j){try{j.apply(void 0,K)}catch(j){He.log(j,j.stack)}}))},j.send=function send(j,K){this.sendOnly(j+fe.Wt,K),this.sendOnly(j,K),this.sendOnly(j+fe.nv,K)},EventHandler}();function config_service_extends(){return config_service_extends=Object.assign||function(j){for(var K=1;K<arguments.length;K++){var $=arguments[K];for(var ee in $)Object.prototype.hasOwnProperty.call($,ee)&&(j[ee]=$[ee])}return j},config_service_extends.apply(this,arguments)}var Ve=function(){function Config(){this.config={serviceName:"",serviceVersion:"",environment:"",serverUrl:"http://localhost:8200",serverUrlPrefix:"",active:!0,instrument:!0,disableInstrumentations:[],logLevel:"warn",breakdownMetrics:!1,ignoreTransactions:[],eventsLimit:80,queueLimit:-1,flushInterval:500,distributedTracing:!0,distributedTracingOrigins:[],distributedTracingHeaderName:"traceparent",pageLoadTraceId:"",pageLoadSpanId:"",pageLoadSampled:!1,pageLoadParentId:"",pageLoadTransactionName:"",propagateTracestate:!1,transactionSampleRate:1,centralConfig:!1,monitorLongtasks:!0,apiVersion:2,context:{},session:!1,apmRequest:null,sendCredentials:!1},this.events=new We,this.filters=[],this.version=""}var j=Config.prototype;return j.init=function init(){var j=function getConfigFromScript(){var j=function getDataAttributesFromNode(j){if(!j)return{};for(var K={},$=/^data-([\w-]+)$/,ee=j.attributes,te=0;te<ee.length;te++){var ne=ee[te];$.test(ne.nodeName)&&(K[ne.nodeName.match($)[1].split("-").map((function(j,K){return K>0?j.charAt(0).toUpperCase()+j.substring(1):j})).join("")]=ne.value||ne.nodeValue)}return K}(getCurrentScript());return j}();this.setConfig(j)},j.setVersion=function setVersion(j){this.version=j},j.addFilter=function addFilter(j){if("function"!=typeof j)throw new Error("Argument to must be function");this.filters.push(j)},j.applyFilters=function applyFilters(j){for(var K=0;K<this.filters.length;K++)if(!(j=this.filters[K](j)))return;return j},j.get=function get(j){return j.split(".").reduce((function(j,K){return j&&j[K]}),this.config)},j.setUserContext=function setUserContext(j){void 0===j&&(j={});var K={},$=j,ee=$.id,te=$.username,ne=$.email;"number"!=typeof ee&&"string"!=typeof ee||(K.id=ee),"string"==typeof te&&(K.username=te),"string"==typeof ne&&(K.email=ne),this.config.context.user=extend(this.config.context.user||{},K)},j.setCustomContext=function setCustomContext(j){void 0===j&&(j={}),this.config.context.custom=extend(this.config.context.custom||{},j)},j.addLabels=function addLabels(j){var K=this;this.config.context.tags||(this.config.context.tags={}),Object.keys(j).forEach((function($){return setLabel($,j[$],K.config.context.tags)}))},j.setConfig=function setConfig(j){void 0===j&&(j={});var K=j,$=K.transactionSampleRate,ee=K.serverUrl;ee&&(j.serverUrl=ee.replace(/\/+$/,"")),isUndefined($)||($<1e-4&&$>0&&($=1e-4),j.transactionSampleRate=Math.round(1e4*$)/1e4),this.config=merge(this.config,j),this.events.send(fe._H,[this.config])},j.validate=function validate(j){void 0===j&&(j={});var K=["serviceName","serverUrl"],$=Object.keys(this.config),ee={missing:[],invalid:[],unknown:[]};Object.keys(j).forEach((function(te){-1===K.indexOf(te)||j[te]||ee.missing.push(te),-1===$.indexOf(te)&&ee.unknown.push(te)})),j.serviceName&&!/^[a-zA-Z0-9 _-]+$/.test(j.serviceName)&&ee.invalid.push({key:"serviceName",value:j.serviceName,allowed:"a-z, A-Z, 0-9, _, -, <space>"});var te=j.transactionSampleRate;return void 0!==te&&("number"!=typeof te||isNaN(te)||te<0||te>1)&&ee.invalid.push({key:"transactionSampleRate",value:te,allowed:"Number between 0 and 1"}),ee},j.getLocalConfig=function getLocalConfig(){var j=sessionStorage;this.config.session&&(j=localStorage);var K=j.getItem(fe.m$);if(K)return JSON.parse(K)},j.setLocalConfig=function setLocalConfig(j,K){if(j){if(K)j=config_service_extends({},this.getLocalConfig(),j);var $=sessionStorage;this.config.session&&($=localStorage),$.setItem(fe.m$,JSON.stringify(j))}},j.dispatchEvent=function dispatchEvent(j,K){this.events.send(j,K)},j.observeEvent=function observeEvent(j,K){return this.events.observe(j,K)},Config}();const Fe=Ve;var Qe=$(5108);const Ke=function(){function LoggingService(j){void 0===j&&(j={}),this.levels=["trace","debug","info","warn","error"],this.level=j.level||"warn",this.prefix=j.prefix||"",this.resetLogMethods()}var j=LoggingService.prototype;return j.shouldLog=function shouldLog(j){return this.levels.indexOf(j)>=this.levels.indexOf(this.level)},j.setLevel=function setLevel(j){j!==this.level&&(this.level=j,this.resetLogMethods())},j.resetLogMethods=function resetLogMethods(){var j=this;this.levels.forEach((function(K){j[K]=j.shouldLog(K)?function log(){var j=K;"trace"!==K&&"debug"!==K||(j="info");var $=arguments;if($[0]=this.prefix+$[0],Qe){var ee=Qe[j]||Qe.log;"function"==typeof ee&&ee.apply(Qe,$)}}:utils_noop}))},LoggingService}();$(5108);var Je,Xe=((Je={})[fe.IE]=function(){return new Fe},Je[fe.XZ]=function(){return new Ke({prefix:"[Elastic APM] "})},Je[fe.Q]=function(j){var K=j.getService([fe.IE,fe.XZ]),$=K[0],ee=K[1];return new Ye($,ee)},Je),qe=function(){function ServiceFactory(){this.instances={},this.initialized=!1}var j=ServiceFactory.prototype;return j.init=function init(){if(!this.initialized){this.initialized=!0;var j=this.getService(fe.IE);j.init();var K=this.getService([fe.XZ,fe.Q]),$=K[0],ee=K[1];j.events.observe(fe._H,(function(){var K=j.get("logLevel");$.setLevel(K)})),ee.init()}},j.getService=function getService(j){var K=this;return"string"==typeof j?(this.instances[j]||"function"==typeof Xe[j]&&(this.instances[j]=Xe[j](this)),this.instances[j]):Array.isArray(j)?j.map((function(j){return K.getService(j)})):void 0},ServiceFactory}();function patchXMLHttpRequest(j){var K=XMLHttpRequest.prototype;if(K&&K[fe.os])var $="readystatechange",ee="load",te="error",ne=patchMethod(K,"open",(function(){return function(j,K){return j[ze]||(j[Be]=K[0],j[Ge]=K[1],j[Ue]=!1===K[2]),ne.apply(j,K)}})),re=patchMethod(K,"send",(function(){return function(K,ne){if(K[ze])return re.apply(K,ne);var oe={source:fe.Ie,state:"",type:"macroTask",data:{target:K,method:K[Be],sync:K[Ue],url:K[Ge],status:""}};try{return function scheduleTask(K){if(K.state!==fe.$L){K.state=fe.$L,j(fe.$L,K);var ne=K.data.target;addListener($),addListener(ee),addListener("timeout"),addListener(te),addListener("abort")}function addListener(j){ne[fe.os](j,(function(j){var te=j.type;te===$?4===ne.readyState&&0!==ne.status&&invokeTask(K,"success"):invokeTask(K,te===ee?"success":te)}))}}(oe),re.apply(K,ne)}catch(j){throw invokeTask(oe,te),j}}}));function invokeTask(K,$){K.state!==fe.x_&&(K.state=fe.x_,K.data.status=$,j(fe.x_,K))}}var $e=new We,et=!1;function patchAll(){return et||(et=!0,patchXMLHttpRequest((function(j,K){$e.send(fe.Ie,[j,K])})),function patchFetch(j){if(isFetchSupported()){var K=window.fetch;window.fetch=function(j,$){var ee,te,ne=this,re=arguments,oe=j instanceof URL;if("string"==typeof j||oe)ee=new Request(j,$),te=oe?ee.url:j;else{if(!j)return K.apply(ne,re);te=(ee=j).url}var ie={source:fe.jR,state:"",type:"macroTask",data:{target:ee,method:ee.method,url:te,aborted:!1}};return new ae((function(j,$){var te;Re.fetchInProgress=!0,scheduleTask(ie);try{te=K.apply(ne,[ee])}catch(j){return $(j),ie.data.error=j,invokeTask(ie),void(Re.fetchInProgress=!1)}te.then((function(K){var $=K.clone?K.clone():{};j(K),scheduleMicroTask((function(){ie.data.response=K;var j=$.body;j?readStream(j,ie):invokeTask(ie)}))}),(function(j){$(j),scheduleMicroTask((function(){handleResponseError(ie,j)}))})),Re.fetchInProgress=!1}))}}function scheduleTask(K){K.state=fe.$L,j(fe.$L,K)}function invokeTask(K){K.state=fe.x_,j(fe.x_,K)}function handleResponseError(j,K){j.data.aborted=function isAbortError(j){return j&&"AbortError"===j.name}(K),j.data.error=K,invokeTask(j)}function readStream(j,K){var $=j.getReader();!function read(){$.read().then((function(j){j.done?invokeTask(K):read()}),(function(j){handleResponseError(K,j)}))}()}}((function(j,K){$e.send(fe.jR,[j,K])})),function patchHistory(j){if(window.history){var K=history.pushState;"function"==typeof K&&(history.pushState=function($,ee,te){var ne={source:fe.UA,data:{state:$,title:ee,url:te}};j(fe.x_,ne),K.apply(this,arguments)})}}((function(j,K){$e.send(fe.UA,[j,K])}))),$e}var nt=function(){function PerformanceMonitoring(j,K,$,ee){this._apmServer=j,this._configService=K,this._logginService=$,this._transactionService=ee}var j=PerformanceMonitoring.prototype;return j.init=function init(j){var K=this;void 0===j&&(j={}),this._configService.events.observe(fe.x9+fe.nv,(function(j){var $=K.createTransactionPayload(j);$&&(K._apmServer.addTransaction($),K._configService.dispatchEvent(fe.dO))})),j[fe.UA]&&$e.observe(fe.UA,this.getHistorySub()),j[fe.Ie]&&$e.observe(fe.Ie,this.getXHRSub()),j[fe.jR]&&$e.observe(fe.jR,this.getFetchSub())},j.getHistorySub=function getHistorySub(){var j=this._transactionService;return function(K,$){$.source===fe.UA&&K===fe.x_&&j.startTransaction($.data.title,"route-change",{managed:!0,canReuse:!0})}},j.getXHRSub=function getXHRSub(){var j=this;return function(K,$){$.source!==fe.Ie||Re.fetchInProgress||j.processAPICalls(K,$)}},j.getFetchSub=function getFetchSub(){var j=this;return function(K,$){$.source===fe.jR&&j.processAPICalls(K,$)}},j.processAPICalls=function processAPICalls(j,K){var $=this._configService,ee=this._transactionService;if(K.data&&K.data.url){var te=this._apmServer.getEndpoints();if(Object.keys(te).some((function(j){return-1!==K.data.url.indexOf(te[j])})))return}if(j===fe.$L&&K.data){var ne=K.data,re=new me(ne.url),oe=ne.method+" "+(re.relative?re.path:stripQueryStringFromUrl(re.href));ee.getCurrentTransaction()||ee.startTransaction(oe,fe.EC,{managed:!0});var ie=ee.startSpan(oe,"external.http",{blocking:!0});if(!ie)return;var ae=$.get("distributedTracing"),se=$.get("distributedTracingOrigins"),le=new me(window.location.href),ce=checkSameOrigin(re.origin,le.origin)||checkSameOrigin(re.origin,se),ue=ne.target;if(ae&&ce&&ue)this.injectDtHeader(ie,ue),$.get("propagateTracestate")&&this.injectTSHeader(ie,ue);else ke;ne.sync&&(ie.sync=ne.sync),ne.span=ie}else if(j===fe.x_){var de=K.data;if(de&&de.span){var pe,ge,he=de.span,ye=de.response,be=de.target;pe=ye?ye.status:be.status,ge="abort"==de.status||de.aborted?fe.pm:pe>=400||0==pe?fe.O5:fe.Yr,he.outcome=ge;var ve=ee.getCurrentTransaction();ve&&ve.type===fe.EC&&(ve.outcome=ge),ee.endSpan(he,de)}}},j.injectDtHeader=function injectDtHeader(j,K){var $=this._configService.get("distributedTracingHeaderName"),ee=function getDtHeaderValue(j){if(j&&j.traceId&&j.id&&j.parentId){var K=j.sampled?"01":"00",$=j.sampled?j.id:j.parentId;return"00-"+j.traceId+"-"+$+"-"+K}}(j);(function isDtHeaderValid(j){return/^[\da-f]{2}-[\da-f]{32}-[\da-f]{16}-[\da-f]{2}$/.test(j)&&"00000000000000000000000000000000"!==j.slice(3,35)&&"0000000000000000"!==j.slice(36,52)})(ee)&&ee&&$&&setRequestHeader(K,$,ee)},j.injectTSHeader=function injectTSHeader(j,K){var $=function getTSHeaderValue(j){var K=j.sampleRate;if(!("number"!=typeof K||String(K).length>256))return"es=s:"+K}(j);$&&setRequestHeader(K,"tracestate",$)},j.extractDtHeader=function extractDtHeader(j){var K=this._configService.get("distributedTracingHeaderName");if(j)return function parseDtHeaderValue(j){var K=/^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})$/.exec(j);if(K){var $="00"!==K[4];return{traceId:K[2],id:K[3],sampled:$}}}(j[K])},j.filterTransaction=function filterTransaction(j){var K=j.duration();if(!K)return!1;if(j.isManaged()){if(K>6e4)return!1;if(j.sampled&&0===j.spans.length)return!1}return!0},j.createTransactionDataModel=function createTransactionDataModel(j){var K=j._start,$=j.spans.map((function($){var ee={id:$.id,transaction_id:j.id,parent_id:$.parentId||j.id,trace_id:j.traceId,name:$.name,type:$.type,subtype:$.subtype,action:$.action,sync:$.sync,start:parseInt($._start-K),duration:$.duration(),context:$.context,outcome:$.outcome,sample_rate:$.sampleRate};return truncateModel(Ee,ee)})),ee={id:j.id,parent_id:j.parentId,trace_id:j.traceId,session:j.session,name:j.name,type:j.type,duration:j.duration(),spans:$,context:j.context,marks:j.marks,breakdown:j.breakdownTimings,span_count:{started:$.length},sampled:j.sampled,sample_rate:j.sampleRate,experience:j.experience,outcome:j.outcome};return truncateModel(Se,ee)},j.createTransactionPayload=function createTransactionPayload(j){var K=function adjustTransaction(j){if(j.sampled){var K=j.spans.filter((function(K){return K.duration()>0&&K._start>=j._start&&K._end<=j._end}));if(j.isManaged()){var $=function groupSmallContinuouslySimilarSpans(j,K,$){j.sort((function(j,K){return j._start-K._start}));var ee=[],te=1;return j.forEach((function(ne,re){if(0===ee.length)ee.push(ne);else{var oe=ee[ee.length-1],ie=oe.type===ne.type&&oe.subtype===ne.subtype&&oe.action===ne.action&&oe.name===ne.name&&ne.duration()/K<$&&(ne._start-oe._end)/K<$,ae=j.length===re+1;ie&&(te++,oe._end=ne._end),te>1&&(!ie||ae)&&(oe.name=te+"x "+oe.name,te=1),ie||ee.push(ne)}})),ee}(K,j.duration(),.05);j.spans=$}else j.spans=K}else j.resetFields();return j}(j);if(this.filterTransaction(K))return this.createTransactionDataModel(j);this._configService.dispatchEvent(fe.XM)},PerformanceMonitoring}();const rt=function(){function SpanBase(j,K,$){void 0===$&&($={}),j||(j=fe.gv),K||(K=fe.Yo),this.name=j,this.type=K,this.options=$,this.id=$.id||generateRandomId(16),this.traceId=$.traceId,this.sampled=$.sampled,this.sampleRate=$.sampleRate,this.timestamp=$.timestamp,this._start=getTime($.startTime),this._end=void 0,this.ended=!1,this.outcome=void 0,this.onEnd=$.onEnd}var j=SpanBase.prototype;return j.ensureContext=function ensureContext(){this.context||(this.context={})},j.addLabels=function addLabels(j){this.ensureContext();var K=this.context;K.tags||(K.tags={}),Object.keys(j).forEach((function($){return setLabel($,j[$],K.tags)}))},j.addContext=function addContext(){for(var j=arguments.length,K=new Array(j),$=0;$<j;$++)K[$]=arguments[$];0!==K.length&&(this.ensureContext(),this.context=merge.apply(void 0,[this.context].concat(K)))},j.end=function end(j){this.ended||(this.ended=!0,this._end=getTime(j),this.callOnEnd())},j.callOnEnd=function callOnEnd(){"function"==typeof this.onEnd&&this.onEnd(this)},j.duration=function duration(){return getDuration(this._start,this._end)},SpanBase}();function _setPrototypeOf(j,K){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(j,K){return j.__proto__=K,j},_setPrototypeOf(j,K)}const it=function(j){function Span(K,$,ee){var te;if((te=j.call(this,K,$,ee)||this).parentId=te.options.parentId,te.subtype=void 0,te.action=void 0,-1!==te.type.indexOf(".")){var ne=te.type.split(".",3);te.type=ne[0],te.subtype=ne[1],te.action=ne[2]}return te.sync=te.options.sync,te}return function _inheritsLoose(j,K){j.prototype=Object.create(K.prototype),j.prototype.constructor=j,_setPrototypeOf(j,K)}(Span,j),Span.prototype.end=function end(K,$){j.prototype.end.call(this,K),addSpanContext(this,$)},Span}(rt);var at=[["domainLookupStart","domainLookupEnd","DNS"],["connectStart","connectEnd","TCP"],["requestStart","responseStart","Request"],["responseStart","responseEnd","Response"],["domLoading","domComplete","Processing"],["loadEventStart","loadEventEnd","Load"]];function getValue(j){return{value:j}}function getSpanBreakdown(j,K){var $=K.details,ee=K.count,te=void 0===ee?1:ee,ne=K.duration;return{transaction:j,span:$,samples:{"span.self_time.count":getValue(te),"span.self_time.sum.us":getValue(1e3*ne)}}}function breakdown_captureBreakdown(j,K){void 0===K&&(K=ce.timing);var $=[],ee=j.name,te=j.type,ne=j.sampled,re={name:ee,type:te};if(!ne)return $;if(te===fe.oZ&&K)for(var oe=0;oe<at.length;oe++){var ie=at[oe],ae=getDuration(K[ie[0]],K[ie[1]]);0!==ae&&null!=ae&&$.push(getSpanBreakdown(re,{details:{type:ie[2]},duration:ae}))}else{var se=function groupSpans(j){var K={},$=function calculateSelfTime(j){var K=j.spans,$=j._start,ee=j._end;if(0===K.length)return j.duration();K.sort((function(j,K){return j._start-K._start}));for(var te=K[0],ne=te._end,re=te._start,oe=ne,ie=re-$,ae=1;ae<K.length;ae++)re=(te=K[ae])._start,ne=te._end,re>oe?(ie+=re-oe,oe=ne):ne>oe&&(oe=ne);return oe<ee&&(ie+=ee-oe),ie}(j);K.app={count:1,duration:$};for(var ee=j.spans,te=0;te<ee.length;te++){var ne=ee[te],re=ne.duration();if(0!==re&&null!=re){var oe=ne.type,ie=ne.subtype,ae=oe.replace(fe.pS,"");ie&&(ae+="."+ie),K[ae]||(K[ae]={duration:0,count:0}),K[ae].count++,K[ae].duration+=re}}return K}(j);Object.keys(se).forEach((function(j){var K=j.split("."),ee=K[0],te=K[1],ne=se[j],oe=ne.duration,ie=ne.count;$.push(getSpanBreakdown(re,{details:{type:ee,subtype:te},duration:oe,count:ie}))}))}return $}function transaction_setPrototypeOf(j,K){return transaction_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(j,K){return j.__proto__=K,j},transaction_setPrototypeOf(j,K)}const lt=function(j){function Transaction(K,$,ee){var te;return(te=j.call(this,K,$,ee)||this).traceId=generateRandomId(),te.marks=void 0,te.spans=[],te._activeSpans={},te._activeTasks=new Set,te.blocked=!1,te.captureTimings=!1,te.breakdownTimings=[],te.sampleRate=te.options.transactionSampleRate,te.sampled=Math.random()<=te.sampleRate,te}!function transaction_inheritsLoose(j,K){j.prototype=Object.create(K.prototype),j.prototype.constructor=j,transaction_setPrototypeOf(j,K)}(Transaction,j);var K=Transaction.prototype;return K.addMarks=function addMarks(j){this.marks=merge(this.marks||{},j)},K.mark=function mark(j){var K=removeInvalidChars(j),$=now()-this._start,ee={};ee[K]=$,this.addMarks({custom:ee})},K.canReuse=function canReuse(){var j=this.options.reuseThreshold||fe.r9;return!!this.options.canReuse&&!this.ended&&now()-this._start<j},K.redefine=function redefine(j,K,$){j&&(this.name=j),K&&(this.type=K),$&&(this.options.reuseThreshold=$.reuseThreshold,this.options=extend(this.options,$))},K.startSpan=function startSpan(j,K,$){var ee=this;if(!this.ended){var te=extend({},$);te.onEnd=function(j){ee._onSpanEnd(j)},te.traceId=this.traceId,te.sampled=this.sampled,te.sampleRate=this.sampleRate,te.parentId||(te.parentId=this.id);var ne=new it(j,K,te);return this._activeSpans[ne.id]=ne,te.blocking&&this.addTask(ne.id),ne}},K.isFinished=function isFinished(){return!this.blocked&&0===this._activeTasks.size},K.detectFinish=function detectFinish(){this.isFinished()&&this.end()},K.end=function end(j){if(!this.ended){for(var K in this.ended=!0,this._end=getTime(j),this._activeSpans){var $=this._activeSpans[K];$.type=$.type+fe.pS,$.end(j)}this.callOnEnd()}},K.captureBreakdown=function captureBreakdown(){this.breakdownTimings=breakdown_captureBreakdown(this)},K.block=function block(j){this.blocked=j,this.blocked||this.detectFinish()},K.addTask=function addTask(j){return j||(j="task-"+generateRandomId(16)),this._activeTasks.add(j),j},K.removeTask=function removeTask(j){this._activeTasks.delete(j)&&this.detectFinish()},K.resetFields=function resetFields(){this.spans=[],this.sampleRate=0},K._onSpanEnd=function _onSpanEnd(j){this.spans.push(j),delete this._activeSpans[j.id],this.removeTask(j.id)},K.isManaged=function isManaged(){return!!this.options.managed},Transaction}(rt);function metrics_extends(){return metrics_extends=Object.assign||function(j){for(var K=1;K<arguments.length;K++){var $=arguments[K];for(var ee in $)Object.prototype.hasOwnProperty.call($,ee)&&(j[ee]=$[ee])}return j},metrics_extends.apply(this,arguments)}var ct={fid:0,fcp:0,tbt:{start:1/0,duration:0},cls:{score:0,firstEntryTime:Number.NEGATIVE_INFINITY,prevEntryTime:Number.NEGATIVE_INFINITY,currentSessionScore:0},longtask:{count:0,duration:0,max:0}};function captureObserverEntries(j,K){var $=K.isHardNavigation,ee=K.trStart,te=j.getEntriesByType(fe.nw).filter((function(j){return j.startTime>=ee})),ne=function createLongTaskSpans(j,K){for(var $=[],ee=0;ee<j.length;ee++){var te=j[ee],ne=te.name,re=te.startTime,oe=te.duration,ie=te.attribution,ae=re+oe,se=new it("Longtask("+ne+")",fe.nw,{startTime:re});if(K.count++,K.duration+=oe,K.max=Math.max(oe,K.max),ie.length>0){var le=ie[0],ce=le.name,ue=le.containerType,de=le.containerName,pe=le.containerId,ge={attribution:ce,type:ue};de&&(ge.name=de),pe&&(ge.id=pe),se.addContext({custom:ge})}se.end(ae),$.push(se)}return $}(te,ct.longtask),re={spans:ne,marks:{}};if(!$)return re;var oe=j.getEntriesByType(fe.DO),ie=oe[oe.length-1];if(ie){var ae=parseInt(ie.startTime);ct.lcp=ae,re.marks.largestContentfulPaint=ae}var se=ce.timing,le=se.fetchStart-se.navigationStart;isRedirectInfoAvailable(se)&&(le=0);var ue=j.getEntriesByName(fe.Qb)[0];if(ue){var de=parseInt(le>=0?ue.startTime-le:ue.startTime);ct.fcp=de,re.marks.firstContentfulPaint=de}var pe=function createFirstInputDelaySpan(j){var K=j[0];if(K){var $=K.startTime,ee=K.processingStart,te=new it("First Input Delay",fe.Vm,{startTime:$});return te.end(ee),te}}(j.getEntriesByType(fe.Vm));return pe&&(ct.fid=pe.duration(),re.spans.push(pe)),function calculateTotalBlockingTime(j){j.forEach((function(j){var K=j.name,$=j.startTime,ee=j.duration;if(!($<ct.fcp||"self"!==K&&-1===K.indexOf("same-origin"))){ct.tbt.start=Math.min(ct.tbt.start,$);var te=ee-50;te>0&&(ct.tbt.duration+=te)}}))}(te),function calculateCumulativeLayoutShift(j){j.forEach((function(j){!j.hadRecentInput&&j.value&&((j.startTime-ct.cls.firstEntryTime>5e3||j.startTime-ct.cls.prevEntryTime>1e3)&&(ct.cls.firstEntryTime=j.startTime,ct.cls.currentSessionScore=0),ct.cls.prevEntryTime=j.startTime,ct.cls.currentSessionScore+=j.value,ct.cls.score=Math.max(ct.cls.score,ct.cls.currentSessionScore))}))}(j.getEntriesByType(fe.o2)),re}var ut=function(){function PerfEntryRecorder(j){this.po={observe:utils_noop,disconnect:utils_noop},window.PerformanceObserver&&(this.po=new PerformanceObserver(j))}var j=PerfEntryRecorder.prototype;return j.start=function start(j,K){void 0===K&&(K={buffered:!0});try{if(!isPerfTypeSupported(j))return;this.po.observe(metrics_extends({type:j},K))}catch(j){}},j.stop=function stop(){this.po.disconnect()},PerfEntryRecorder}();function shouldCreateSpan(j,K,$,ee,te){return void 0===te&&(te=0),"number"==typeof j&&"number"==typeof K&&j>=te&&K>j&&j-te>=$&&K-te<=ee&&K-j<fe.io&&j-te<fe.io&&K-te<fe.io}var dt=[["redirectStart","redirectEnd","Redirect"],["domainLookupStart","domainLookupEnd","Domain lookup"],["connectStart","connectEnd","Making a connection to the server"],["requestStart","responseEnd","Requesting and receiving the document"],["domLoading","domInteractive","Parsing the document, executing sync. scripts"],["domContentLoadedEventStart","domContentLoadedEventEnd",'Fire "DOMContentLoaded" event'],["loadEventStart","loadEventEnd",'Fire "load" event']];function createResourceTimingSpan(j){var K=j.name,$=j.initiatorType,ee=j.startTime,te=j.responseEnd,ne="resource";$&&(ne+="."+$);var re=stripQueryStringFromUrl(K),oe=new it(re,ne);return oe._start=ee,oe.end(te,{url:K,entry:j}),oe}function isCapturedByPatching(j,K){return null!=K&&j>K}function captureNavigation(j){if(j.captureTimings){var K=j._end;if(j.type===fe.oZ){if(j.marks&&j.marks.custom){var $=j.marks.custom;Object.keys($).forEach((function(K){$[K]+=j._start}))}j._start=0;var ee=ce.timing;(function createNavigationTimingSpans(j,K,$,ee){for(var te=[],ne=0;ne<dt.length;ne++){var re=j[dt[ne][0]],oe=j[dt[ne][1]];if(shouldCreateSpan(re,oe,$,ee,K)){var ie=new it(dt[ne][2],"hard-navigation.browser-timing"),ae=null;"requestStart"===dt[ne][0]&&(ie.pageResponse=!0,ae={url:location.origin}),ie._start=re-K,ie.end(oe-K,ae),te.push(ie)}}return te})(ee,isRedirectInfoAvailable(ee)?ee.redirectStart:ee.fetchStart,0,K).forEach((function(K){K.traceId=j.traceId,K.sampled=j.sampled,K.pageResponse&&j.options.pageLoadSpanId&&(K.id=j.options.pageLoadSpanId),j.spans.push(K)})),j.options.pageLoadParentId&&(j.parentId=j.options.pageLoadParentId),j.addMarks(getPageLoadMarks(ee))}if(isPerfTimelineSupported()){var te=j._start;(function createResourceTimingSpans(j,K,$,ee){for(var te=[],ne=0;ne<j.length;ne++){var re=j[ne],oe=re.initiatorType,ie=re.name,ae=re.startTime,se=re.responseEnd;-1!==fe.jK.indexOf(oe)&&null!=ie&&(("xmlhttprequest"===oe||"fetch"===oe)&&(/intake\/v\d+\/rum\/events/.test(ie)||isCapturedByPatching(ae,K))||shouldCreateSpan(ae,se,$,ee)&&te.push(createResourceTimingSpan(j[ne])))}return te})(ce.getEntriesByType(fe.YI),Pe.bootstrapTime,te,K).forEach((function(K){return j.spans.push(K)})),function createUserTimingSpans(j,K,$){for(var ee=[],te=0;te<j.length;te++){var ne=j[te],re=ne.name,oe=ne.startTime,ie=ne.duration,ae=oe+ie;if(!(ie<=fe.Ab)&&shouldCreateSpan(oe,ae,K,$)){var se=new it(re,"app");se._start=oe,se.end(ae),ee.push(se)}}return ee}(ce.getEntriesByType(fe.Mu),te,K).forEach((function(K){return j.spans.push(K)}))}}else j.type===fe.oZ&&(j._start=0)}var pt=function(){function TransactionService(j,K){var $=this;this._config=K,this._logger=j,this.currentTransaction=void 0,this.respIntervalId=void 0,this.recorder=new ut((function(j){var K=$.getCurrentTransaction();if(K&&K.captureTimings){var ee,te=K.type===fe.oZ,ne=captureObserverEntries(j,{isHardNavigation:te,trStart:te?0:K._start}),re=ne.spans,oe=ne.marks;(ee=K.spans).push.apply(ee,re),K.addMarks({agent:oe})}}))}var j=TransactionService.prototype;return j.createCurrentTransaction=function createCurrentTransaction(j,K,$){var ee=new lt(j,K,$);return this.currentTransaction=ee,ee},j.getCurrentTransaction=function getCurrentTransaction(){if(this.currentTransaction&&!this.currentTransaction.ended)return this.currentTransaction},j.createOptions=function createOptions(j){var K=this._config.config,$=extend({transactionSampleRate:K.transactionSampleRate},j);return $.managed&&($=extend({pageLoadTraceId:K.pageLoadTraceId,pageLoadSampled:K.pageLoadSampled,pageLoadSpanId:K.pageLoadSpanId,pageLoadTransactionName:K.pageLoadTransactionName,pageLoadParentId:K.pageLoadParentId},$)),$},j.startManagedTransaction=function startManagedTransaction(j,K,$){var ee=this.getCurrentTransaction(),te=!1;if(ee)if(ee.canReuse()&&$.canReuse){var ne=ee.type,re=fe.W8.indexOf(ee.type),oe=fe.W8.indexOf(K);re>=0&&oe<re&&(ne=K),ee.redefine(j,ne,$),te=!0}else ee.end(),ee=this.createCurrentTransaction(j,K,$);else ee=this.createCurrentTransaction(j,K,$);return ee.type===fe.oZ&&(te||(this.recorder.start(fe.DO),this.recorder.start(fe.yw),this.recorder.start(fe.Vm),this.recorder.start(fe.o2)),$.pageLoadTraceId&&(ee.traceId=$.pageLoadTraceId),$.pageLoadSampled&&(ee.sampled=$.pageLoadSampled),ee.name===fe.gv&&$.pageLoadTransactionName&&(ee.name=$.pageLoadTransactionName)),!te&&this._config.get("monitorLongtasks")&&this.recorder.start(fe.nw),ee.sampled&&(ee.captureTimings=!0),ee},j.startTransaction=function startTransaction(j,K,$){var ee,te=this,ne=this.createOptions($),re=!0;ne.managed?this.currentTransaction===(ee=this.startManagedTransaction(j,K,ne))&&(re=!1):ee=new lt(j,K,ne);return ee.onEnd=function(){return te.handleTransactionEnd(ee)},re&&this._config.events.send(fe.TU,[ee]),ee},j.handleTransactionEnd=function handleTransactionEnd(j){var K=this;this.recorder.stop();var $=window.location.href;return ae.resolve().then((function(){var ee=j.name,te=j.type;if(Pe.lastHiddenStart>=j._start)K._config.dispatchEvent(fe.XM);else if(K.shouldIgnoreTransaction(ee)||te===fe.RW)K._config.dispatchEvent(fe.XM);else{if(te===fe.oZ){var ne=K._config.get("pageLoadTransactionName");if(ee===fe.gv&&ne&&(j.name=ne),j.captureTimings){var re=ct.cls,oe=ct.fid,ie=ct.tbt,ae=ct.longtask;ie.duration>0&&j.spans.push(function createTotalBlockingTimeSpan(j){var K=j.start,$=j.duration,ee=new it("Total Blocking Time",fe.nw,{startTime:K});return ee.end(K+$),ee}(ie)),j.experience={},isPerfTypeSupported(fe.nw)&&(j.experience.tbt=ie.duration),isPerfTypeSupported(fe.o2)&&(j.experience.cls=re.score),oe>0&&(j.experience.fid=oe),ae.count>0&&(j.experience.longtask={count:ae.count,sum:ae.duration,max:ae.max})}K.setSession(j)}j.name===fe.gv&&(j.name=function slugifyUrl(j,K){void 0===K&&(K=2);for(var $=new me(j),ee=$.query,te=$.path.substring(1).split("/"),ne=":id",re=/\W|_/g,oe=/[0-9]/g,ie=/[a-z]/g,ae=/[A-Z]/g,se=[],le=!1,ce=0;ce<te.length;ce++){var ue=te[ce];if(le||ce>K-1){ue&&se.push("*");break}if((ue.match(re)||[]).length>=2)se.push(ne),le=!0;else{var de=(ue.match(oe)||[]).length;if(de>3||ue.length>3&&de/ue.length>=.3)se.push(ne),le=!0;else{var pe=(ue.match(ae)||[]).length,ge=(ue.match(ie)||[]).length/ue.length,he=pe/ue.length;ue.length>5&&(he>.3&&he<.6||ge>.3&&ge<.6)?(se.push(ne),le=!0):ue&&se.push(ue)}}}return"/"+(se.length>=2?se.join("/"):se.join(""))+(ee?"?{query}":"")}($)),captureNavigation(j),K.adjustTransactionTime(j),K._config.get("breakdownMetrics")&&j.captureBreakdown();var se=K._config.get("context");addTransactionContext(j,se),K._config.events.send(fe.x9,[j])}}),(function(j){ke}))},j.setSession=function setSession(j){var K=this._config.get("session");if(K){"boolean"==typeof K||K.timestamp&&Date.now()-K.timestamp>fe.sG?j.session={id:generateRandomId(16),sequence:1}:j.session={id:K.id,sequence:K.sequence?K.sequence+1:1};var $={session:{id:j.session.id,sequence:j.session.sequence,timestamp:Date.now()}};this._config.setConfig($),this._config.setLocalConfig($,!0)}},j.adjustTransactionTime=function adjustTransactionTime(j){var K=j.spans,$=function getEarliestSpan(j){for(var K=j[0],$=1;$<j.length;$++){var ee=j[$];K._start>ee._start&&(K=ee)}return K}(K);$&&$._start<j._start&&(j._start=$._start);var ee=function getLatestNonXHRSpan(j){return getLatestSpan(j,(function(j){return-1===String(j).indexOf("external")}))}(K)||{},te=ee._end||0;if(j.type===fe.oZ){var ne=j._end-fe.JK,re=ct.lcp||0,oe=function getLatestXHRSpan(j){return getLatestSpan(j,(function(j){return-1!==String(j).indexOf("external")}))}(K)||{},ie=oe._end||0;j._end=Math.max(te,ie,re,ne)}else te>j._end&&(j._end=te);this.truncateSpans(K,j._end)},j.truncateSpans=function truncateSpans(j,K){for(var $=0;$<j.length;$++){var ee=j[$];ee._end>K&&(ee._end=K,ee.type+=fe.pS),ee._start>K&&(ee._start=K)}},j.shouldIgnoreTransaction=function shouldIgnoreTransaction(j){var K=this._config.get("ignoreTransactions");if(K&&K.length)for(var $=0;$<K.length;$++){var ee=K[$];if("function"==typeof ee.test){if(ee.test(j))return!0}else if(ee===j)return!0}return!1},j.startSpan=function startSpan(j,K,$){var ee=this.getCurrentTransaction();ee||(ee=this.createCurrentTransaction(void 0,fe.RW,this.createOptions({canReuse:!0,managed:!0})));var te=ee.startSpan(j,K,$);return te},j.endSpan=function endSpan(j,K){j&&j.end(null,K)},TransactionService}();const gt=pt;function createServiceFactory(){return function performance_monitoring_registerServices(){Xe[fe.P5]=function(j){var K=j.getService([fe.XZ,fe.IE]),$=K[0],ee=K[1];return new gt($,ee)},Xe[fe.e0]=function(j){var K=j.getService([fe.Q,fe.IE,fe.XZ,fe.P5]),$=K[0],ee=K[1],te=K[2],ne=K[3];return new nt($,ee,te,ne)}}(),function registerServices(){Xe[fe.mU]=function(j){var K=j.getService([fe.Q,fe.IE,fe.P5]),$=K[0],ee=K[1],te=K[2];return new we($,ee,te)}}(),new qe}var ht=$(5108),mt=!1;function bootstrap(){return isPlatformSupported()?(patchAll(),Pe.bootstrapTime=now(),mt=!0):le&&ht.log("[Elastic APM] platform is not supported!"),mt}var ft={minInteractionId:1/0,maxInteractionId:0,interactionCount:0,longestInteractions:[]};function processUserInteractions(j){j.getEntries().forEach((function(j){j.interactionId&&(!function updateInteractionCount(j){if(isPerfInteractionCountSupported())return;ft.minInteractionId=Math.min(ft.minInteractionId,j.interactionId),ft.maxInteractionId=Math.max(ft.maxInteractionId,j.interactionId),ft.interactionCount=(ft.maxInteractionId-ft.minInteractionId)/7+1}(j),j.duration<40||function storeUserInteraction(j){var K=ft.longestInteractions[ft.longestInteractions.length-1];if(void 0!==K&&j.duration<=K.duration&&j.interactionId!=K.id)return;var $=ft.longestInteractions.filter((function(K){return K.id===j.interactionId}));if($.length>0){var ee=$[0];ee.duration=Math.max(ee.duration,j.duration)}else ft.longestInteractions.push({id:j.interactionId,duration:j.duration});ft.longestInteractions.sort((function(j,K){return K.duration-j.duration})),ft.longestInteractions.splice(10)}(j))}))}function interactionCount(){return performance.interactionCount||ft.interactionCount}function reportInp(j){var K=function calculateInp(){if(0===ft.longestInteractions.length)return interactionCount()>0?0:void 0;var j=Math.min(ft.longestInteractions.length-1,Math.floor(interactionCount()/50));return ft.longestInteractions[j].duration}();if(K>=0){var $=now(),ee=j.startTransaction(fe.Xu,fe.Xu,{startTime:$}),te=performance.getEntriesByType("navigation");if(te.length>0){var ne=te[0].name;ee.addContext({page:{url:ne}})}ee.addLabels({inp_value:K});var re=$+K+1;return ee.end(re),function restoreINPState(){ft.minInteractionId=1/0,ft.maxInteractionId=0,ft.interactionCount=0,ft.longestInteractions=[]}(),ee}}function onPageHidden(j,K){if(reportInp(K))var $=j.observeEvent(fe.dO,(function(){endManagedTransaction(j,K),$()}));else endManagedTransaction(j,K)}function endManagedTransaction(j,K){var $=K.getCurrentTransaction();if($){var ee=j.observeEvent(fe.XM,(function(){Pe.lastHiddenStart=now(),ee(),te()})),te=j.observeEvent(fe.dO,(function(){j.dispatchEvent(fe.p4),Pe.lastHiddenStart=now(),te(),ee()}));$.end()}else j.dispatchEvent(fe.p4),Pe.lastHiddenStart=now()}var yt="a[data-transaction-name], button[data-transaction-name]";function observePageClicks(j){var K=function clickHandler(K){K.target instanceof Element&&function createUserInteractionTransaction(j,K){var $=function getTransactionMetadata(j){var K={transactionName:null,context:null};K.transactionName=function buildTransactionName(j){var K=function findCustomTransactionName(j){var K="data-transaction-name",$=j.getAttribute(K);if(j.closest){var ee=j.closest(yt);return ee?ee.getAttribute(K):$}return $}(j);if(K)return K;var $=j.tagName.toLowerCase(),ee=j.getAttribute("name");if(ee)return $+'["'+ee+'"]';return $}(j);var $=j.getAttribute("class");$&&(K.context={custom:{classes:$}});return K}(K),ee=$.transactionName,te=$.context,ne=j.startTransaction("Click - "+ee,fe.Cq,{managed:!0,canReuse:!0,reuseThreshold:300});ne&&te&&ne.addContext(te)}(j,K.target)},$="click";return window.addEventListener($,K,true),function(){window.removeEventListener($,K,true)}}var bt=function(){function ApmBase(j,K){this._disable=K,this.serviceFactory=j,this._initialized=!1}var j=ApmBase.prototype;return j.isEnabled=function isEnabled(){return!this._disable},j.isActive=function isActive(){var j=this.serviceFactory.getService(fe.IE);return this.isEnabled()&&this._initialized&&j.get("active")},j.init=function init(j){var K=this;if(this.isEnabled()&&!this._initialized){this._initialized=!0;var $=this.serviceFactory.getService([fe.IE,fe.XZ,fe.P5]),ee=$[0],te=$[1],ne=$[2];ee.setVersion("5.16.3"),this.config(j);var re=ee.get("logLevel");if(te.setLevel(re),ee.get("active")){this.serviceFactory.init();var oe=function getInstrumentationFlags(j,K){var $,ee=(($={})[fe.Ie]=!1,$[fe.jR]=!1,$[fe.UA]=!1,$[fe.oZ]=!1,$[fe.pn]=!1,$[fe.JY]=!1,$[fe.ot]=!1,$);return j?(Object.keys(ee).forEach((function(j){-1===K.indexOf(j)&&(ee[j]=!0)})),ee):ee}(ee.get("instrument"),ee.get("disableInstrumentations"));if(this.serviceFactory.getService(fe.e0).init(oe),oe[fe.pn])this.serviceFactory.getService(fe.mU).registerListeners();if(ee.get("session")){var ie=ee.getLocalConfig();ie&&ie.session&&ee.setConfig({session:ie.session})}var ae=function sendPageLoad(){return oe[fe.oZ]&&K._sendPageLoadMetrics()};ee.get("centralConfig")?this.fetchCentralConfig().then(ae):ae(),function observePageVisibility(j,K){"hidden"===document.visibilityState&&(Pe.lastHiddenStart=0);var $=function visibilityChangeHandler(){"hidden"===document.visibilityState&&onPageHidden(j,K)},ee=function pageHideHandler(){return onPageHidden(j,K)},te=!0;return window.addEventListener("visibilitychange",$,te),window.addEventListener("pagehide",ee,te),function(){window.removeEventListener("visibilitychange",$,te),window.removeEventListener("pagehide",ee,te)}}(ee,ne),oe[fe.JY]&&oe[fe.ot]&&observePageClicks(ne),function observeUserInteractions(j){void 0===j&&(j=new ut(processUserInteractions));var K=isPerfInteractionCountSupported(),$=K?40:16;j.start(fe.Ks,{buffered:!0,durationThreshold:$}),K||j.start(fe.Vm)}()}else this._disable=!0,te.warn("RUM agent is inactive")}return this},j.fetchCentralConfig=function fetchCentralConfig(){var j=this.serviceFactory.getService([fe.Q,fe.XZ,fe.IE]),K=j[0],$=j[1],ee=j[2];return K.fetchConfig(ee.get("serviceName"),ee.get("environment")).then((function(j){var K=j.transaction_sample_rate;if(K){var te={transactionSampleRate:K=Number(K)},ne=ee.validate(te).invalid;if(0===ne.length)ee.setConfig(te);else{var re=ne[0],oe=re.key,ie=re.value,ae=re.allowed;$.warn('invalid value "'+ie+'" for '+oe+". Allowed: "+ae+".")}}return j})).catch((function(j){$.warn("failed fetching config:",j)}))},j._sendPageLoadMetrics=function _sendPageLoadMetrics(){var j=this.startTransaction(void 0,fe.oZ,{managed:!0,canReuse:!0});if(j){j.addTask(fe.oZ);var K=function sendPageLoadMetrics(){setTimeout((function(){return j.removeTask(fe.oZ)}),fe.JK)};"complete"===document.readyState?K():window.addEventListener("load",K)}},j.observe=function observe(j,K){this.serviceFactory.getService(fe.IE).events.observe(j,K)},j.config=function config(j){var K=this.serviceFactory.getService([fe.IE,fe.XZ]),$=K[0],ee=K[1],te=$.validate(j),ne=te.missing,re=te.invalid,oe=te.unknown;if(oe.length>0){var ie="Unknown config options are specified for RUM agent: "+oe.join(", ");ee.warn(ie)}if(0===ne.length&&0===re.length)$.setConfig(j);else{var ae=", ",se="RUM agent isn't correctly configured. ";ne.length>0&&(se+=ne.join(ae)+" is missing",re.length>0&&(se+=ae)),re.forEach((function(j,K){var $=j.key,ee=j.value,te=j.allowed;se+=$+' "'+ee+'" contains invalid characters! (allowed: '+te+")"+(K!==re.length-1?ae:"")})),ee.error(se),$.setConfig({active:!1})}},j.setUserContext=function setUserContext(j){this.serviceFactory.getService(fe.IE).setUserContext(j)},j.setCustomContext=function setCustomContext(j){this.serviceFactory.getService(fe.IE).setCustomContext(j)},j.addLabels=function addLabels(j){this.serviceFactory.getService(fe.IE).addLabels(j)},j.setInitialPageLoadName=function setInitialPageLoadName(j){this.serviceFactory.getService(fe.IE).setConfig({pageLoadTransactionName:j})},j.startTransaction=function startTransaction(j,K,$){if(this.isEnabled())return this.serviceFactory.getService(fe.P5).startTransaction(j,K,$)},j.startSpan=function startSpan(j,K,$){if(this.isEnabled())return this.serviceFactory.getService(fe.P5).startSpan(j,K,$)},j.getCurrentTransaction=function getCurrentTransaction(){if(this.isEnabled())return this.serviceFactory.getService(fe.P5).getCurrentTransaction()},j.captureError=function captureError(j){if(this.isEnabled())return this.serviceFactory.getService(fe.mU).logError(j)},j.addFilter=function addFilter(j){this.serviceFactory.getService(fe.IE).addFilter(j)},ApmBase}();var vt=function getApmBase(){if(le&&window.elasticApm)return window.elasticApm;var j=bootstrap(),K=createServiceFactory(),$=new bt(K,!j);return le&&(window.elasticApm=$),$}(),Mt=vt.init.bind(vt)},9521:(j,K,$)=>{"use strict";$.d(K,{Z:()=>Ce});var ee=$(6375),te=Math.abs,ne=String.fromCharCode,re=Object.assign;function trim(j){return j.trim()}function Utility_replace(j,K,$){return j.replace(K,$)}function indexof(j,K){return j.indexOf(K)}function Utility_charat(j,K){return 0|j.charCodeAt(K)}function Utility_substr(j,K,$){return j.slice(K,$)}function Utility_strlen(j){return j.length}function Utility_sizeof(j){return j.length}function Utility_append(j,K){return K.push(j),j}var oe=1,ie=1,ae=0,se=0,le=0,ce="";function node(j,K,$,ee,te,ne,re){return{value:j,root:K,parent:$,type:ee,props:te,children:ne,line:oe,column:ie,length:re,return:""}}function Tokenizer_copy(j,K){return re(node("",null,null,"",null,null,0),j,{length:-j.length},K)}function prev(){return le=se>0?Utility_charat(ce,--se):0,ie--,10===le&&(ie=1,oe--),le}function next(){return le=se<ae?Utility_charat(ce,se++):0,ie++,10===le&&(ie=1,oe++),le}function peek(){return Utility_charat(ce,se)}function caret(){return se}function slice(j,K){return Utility_substr(ce,j,K)}function token(j){switch(j){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function alloc(j){return oe=ie=1,ae=Utility_strlen(ce=j),se=0,[]}function dealloc(j){return ce="",j}function delimit(j){return trim(slice(se-1,delimiter(91===j?j+2:40===j?j+1:j)))}function whitespace(j){for(;(le=peek())&&le<33;)next();return token(j)>2||token(le)>3?"":" "}function escaping(j,K){for(;--K&&next()&&!(le<48||le>102||le>57&&le<65||le>70&&le<97););return slice(j,caret()+(K<6&&32==peek()&&32==next()))}function delimiter(j){for(;next();)switch(le){case j:return se;case 34:case 39:34!==j&&39!==j&&delimiter(le);break;case 40:41===j&&delimiter(j);break;case 92:next()}return se}function commenter(j,K){for(;next()&&j+le!==57&&(j+le!==84||47!==peek()););return"/*"+slice(K,se-1)+"*"+ne(47===j?j:next())}function identifier(j){for(;!token(peek());)next();return slice(j,se)}var ue="-ms-",de="-moz-",pe="-webkit-",ge="comm",he="rule",me="decl",fe="@keyframes";function Serializer_serialize(j,K){for(var $="",ee=Utility_sizeof(j),te=0;te<ee;te++)$+=K(j[te],te,j,K)||"";return $}function stringify(j,K,$,ee){switch(j.type){case"@layer":if(j.children.length)break;case"@import":case me:return j.return=j.return||j.value;case ge:return"";case fe:return j.return=j.value+"{"+Serializer_serialize(j.children,ee)+"}";case he:j.value=j.props.join(",")}return Utility_strlen($=Serializer_serialize(j.children,ee))?j.return=j.value+"{"+$+"}":""}function compile(j){return dealloc(parse("",null,null,null,[""],j=alloc(j),0,[0],j))}function parse(j,K,$,ee,te,re,oe,ie,ae){for(var se=0,le=0,ce=oe,ue=0,de=0,pe=0,ge=1,he=1,me=1,fe=0,ye="",be=te,ve=re,Me=ee,Ee=ye;he;)switch(pe=fe,fe=next()){case 40:if(108!=pe&&58==Utility_charat(Ee,ce-1)){-1!=indexof(Ee+=Utility_replace(delimit(fe),"&","&\f"),"&\f")&&(me=-1);break}case 34:case 39:case 91:Ee+=delimit(fe);break;case 9:case 10:case 13:case 32:Ee+=whitespace(pe);break;case 92:Ee+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:Utility_append(comment(commenter(next(),caret()),K,$),ae);break;default:Ee+="/"}break;case 123*ge:ie[se++]=Utility_strlen(Ee)*me;case 125*ge:case 59:case 0:switch(fe){case 0:case 125:he=0;case 59+le:-1==me&&(Ee=Utility_replace(Ee,/\f/g,"")),de>0&&Utility_strlen(Ee)-ce&&Utility_append(de>32?declaration(Ee+";",ee,$,ce-1):declaration(Utility_replace(Ee," ","")+";",ee,$,ce-2),ae);break;case 59:Ee+=";";default:if(Utility_append(Me=ruleset(Ee,K,$,se,le,te,ie,ye,be=[],ve=[],ce),re),123===fe)if(0===le)parse(Ee,K,Me,Me,be,re,ce,ie,ve);else switch(99===ue&&110===Utility_charat(Ee,3)?100:ue){case 100:case 108:case 109:case 115:parse(j,Me,Me,ee&&Utility_append(ruleset(j,Me,Me,0,0,te,ie,ye,te,be=[],ce),ve),te,ve,ce,ie,ee?be:ve);break;default:parse(Ee,Me,Me,Me,[""],ve,0,ie,ve)}}se=le=de=0,ge=me=1,ye=Ee="",ce=oe;break;case 58:ce=1+Utility_strlen(Ee),de=pe;default:if(ge<1)if(123==fe)--ge;else if(125==fe&&0==ge++&&125==prev())continue;switch(Ee+=ne(fe),fe*ge){case 38:me=le>0?1:(Ee+="\f",-1);break;case 44:ie[se++]=(Utility_strlen(Ee)-1)*me,me=1;break;case 64:45===peek()&&(Ee+=delimit(next())),ue=peek(),le=ce=Utility_strlen(ye=Ee+=identifier(caret())),fe++;break;case 45:45===pe&&2==Utility_strlen(Ee)&&(ge=0)}}return re}function ruleset(j,K,$,ee,ne,re,oe,ie,ae,se,le){for(var ce=ne-1,ue=0===ne?re:[""],de=Utility_sizeof(ue),pe=0,ge=0,me=0;pe<ee;++pe)for(var fe=0,ye=Utility_substr(j,ce+1,ce=te(ge=oe[pe])),be=j;fe<de;++fe)(be=trim(ge>0?ue[fe]+" "+ye:Utility_replace(ye,/&\f/g,ue[fe])))&&(ae[me++]=be);return node(j,K,$,0===ne?he:ie,ae,se,le)}function comment(j,K,$){return node(j,K,$,ge,ne(function Tokenizer_char(){return le}()),Utility_substr(j,2,-2),0)}function declaration(j,K,$,ee){return node(j,K,$,me,Utility_substr(j,0,ee),Utility_substr(j,ee+1,-1),ee)}var ye=function identifierWithPointTracking(j,K,$){for(var ee=0,te=0;ee=te,te=peek(),38===ee&&12===te&&(K[$]=1),!token(te);)next();return slice(j,se)},be=function getRules(j,K){return dealloc(function toRules(j,K){var $=-1,ee=44;do{switch(token(ee)){case 0:38===ee&&12===peek()&&(K[$]=1),j[$]+=ye(se-1,K,$);break;case 2:j[$]+=delimit(ee);break;case 4:if(44===ee){j[++$]=58===peek()?"&\f":"",K[$]=j[$].length;break}default:j[$]+=ne(ee)}}while(ee=next());return j}(alloc(j),K))},ve=new WeakMap,Me=function compat(j){if("rule"===j.type&&j.parent&&!(j.length<1)){for(var K=j.value,$=j.parent,ee=j.column===$.column&&j.line===$.line;"rule"!==$.type;)if(!($=$.parent))return;if((1!==j.props.length||58===K.charCodeAt(0)||ve.get($))&&!ee){ve.set(j,!0);for(var te=[],ne=be(K,te),re=$.props,oe=0,ie=0;oe<ne.length;oe++)for(var ae=0;ae<re.length;ae++,ie++)j.props[ie]=te[oe]?ne[oe].replace(/&\f/g,re[ae]):re[ae]+" "+ne[oe]}}},Ee=function removeLabel(j){if("decl"===j.type){var K=j.value;108===K.charCodeAt(0)&&98===K.charCodeAt(2)&&(j.return="",j.value="")}};function emotion_cache_browser_esm_prefix(j,K){switch(function hash(j,K){return 45^Utility_charat(j,0)?(((K<<2^Utility_charat(j,0))<<2^Utility_charat(j,1))<<2^Utility_charat(j,2))<<2^Utility_charat(j,3):0}(j,K)){case 5103:return"-webkit-print-"+j+j;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return pe+j+j;case 5349:case 4246:case 4810:case 6968:case 2756:return pe+j+de+j+ue+j+j;case 6828:case 4268:return pe+j+ue+j+j;case 6165:return pe+j+ue+"flex-"+j+j;case 5187:return pe+j+Utility_replace(j,/(\w+).+(:[^]+)/,"-webkit-box-$1$2-ms-flex-$1$2")+j;case 5443:return pe+j+ue+"flex-item-"+Utility_replace(j,/flex-|-self/,"")+j;case 4675:return pe+j+ue+"flex-line-pack"+Utility_replace(j,/align-content|flex-|-self/,"")+j;case 5548:return pe+j+ue+Utility_replace(j,"shrink","negative")+j;case 5292:return pe+j+ue+Utility_replace(j,"basis","preferred-size")+j;case 6060:return"-webkit-box-"+Utility_replace(j,"-grow","")+pe+j+ue+Utility_replace(j,"grow","positive")+j;case 4554:return pe+Utility_replace(j,/([^-])(transform)/g,"$1-webkit-$2")+j;case 6187:return Utility_replace(Utility_replace(Utility_replace(j,/(zoom-|grab)/,"-webkit-$1"),/(image-set)/,"-webkit-$1"),j,"")+j;case 5495:case 3959:return Utility_replace(j,/(image-set\([^]*)/,"-webkit-$1$`$1");case 4968:return Utility_replace(Utility_replace(j,/(.+:)(flex-)?(.*)/,"-webkit-box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+pe+j+j;case 4095:case 3583:case 4068:case 2532:return Utility_replace(j,/(.+)-inline(.+)/,"-webkit-$1$2")+j;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Utility_strlen(j)-1-K>6)switch(Utility_charat(j,K+1)){case 109:if(45!==Utility_charat(j,K+4))break;case 102:return Utility_replace(j,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1-moz-"+(108==Utility_charat(j,K+3)?"$3":"$2-$3"))+j;case 115:return~indexof(j,"stretch")?emotion_cache_browser_esm_prefix(Utility_replace(j,"stretch","fill-available"),K)+j:j}break;case 4949:if(115!==Utility_charat(j,K+1))break;case 6444:switch(Utility_charat(j,Utility_strlen(j)-3-(~indexof(j,"!important")&&10))){case 107:return Utility_replace(j,":",":-webkit-")+j;case 101:return Utility_replace(j,/(.+:)([^;!]+)(;|!.+)?/,"$1-webkit-"+(45===Utility_charat(j,14)?"inline-":"")+"box$3$1"+"-webkit-$2$3$1"+"-ms-$2box$3")+j}break;case 5936:switch(Utility_charat(j,K+11)){case 114:return pe+j+ue+Utility_replace(j,/[svh]\w+-[tblr]{2}/,"tb")+j;case 108:return pe+j+ue+Utility_replace(j,/[svh]\w+-[tblr]{2}/,"tb-rl")+j;case 45:return pe+j+ue+Utility_replace(j,/[svh]\w+-[tblr]{2}/,"lr")+j}return pe+j+ue+j+j}return j}var Se=[function prefixer(j,K,$,ee){if(j.length>-1&&!j.return)switch(j.type){case me:j.return=emotion_cache_browser_esm_prefix(j.value,j.length);break;case fe:return Serializer_serialize([Tokenizer_copy(j,{value:Utility_replace(j.value,"@","@-webkit-")})],ee);case he:if(j.length)return function Utility_combine(j,K){return j.map(K).join("")}(j.props,(function(K){switch(function Utility_match(j,K){return(j=K.exec(j))?j[0]:j}(K,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Serializer_serialize([Tokenizer_copy(j,{props:[Utility_replace(K,/:(read-\w+)/,":-moz-$1")]})],ee);case"::placeholder":return Serializer_serialize([Tokenizer_copy(j,{props:[Utility_replace(K,/:(plac\w+)/,":-webkit-input-$1")]}),Tokenizer_copy(j,{props:[Utility_replace(K,/:(plac\w+)/,":-moz-$1")]}),Tokenizer_copy(j,{props:[Utility_replace(K,/:(plac\w+)/,"-ms-input-$1")]})],ee)}return""}))}}],Ce=function createCache(j){var K=j.key;if("css"===K){var $=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call($,(function(j){-1!==j.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(j),j.setAttribute("data-s",""))}))}var te,ne,re=j.stylisPlugins||Se,oe={},ie=[];te=j.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+K+' "]'),(function(j){for(var K=j.getAttribute("data-emotion").split(" "),$=1;$<K.length;$++)oe[K[$]]=!0;ie.push(j)}));var ae,se,le=[stringify,(se=function(j){ae.insert(j)},function(j){j.root||(j=j.return)&&se(j)})],ce=function middleware(j){var K=Utility_sizeof(j);return function($,ee,te,ne){for(var re="",oe=0;oe<K;oe++)re+=j[oe]($,ee,te,ne)||"";return re}}([Me,Ee].concat(re,le));ne=function insert(j,K,$,ee){ae=$,function stylis(j){Serializer_serialize(compile(j),ce)}(j?j+"{"+K.styles+"}":K.styles),ee&&(ue.inserted[K.name]=!0)};var ue={key:K,sheet:new ee.m({key:K,container:te,nonce:j.nonce,speedy:j.speedy,prepend:j.prepend,insertionPoint:j.insertionPoint}),nonce:j.nonce,inserted:oe,registered:{},insert:ne};return ue.sheet.hydrate(ie),ue}},546:(j,K,$)=>{"use strict";function memoize(j){var K=Object.create(null);return function($){return void 0===K[$]&&(K[$]=j($)),K[$]}}$.d(K,{Z:()=>memoize})},5037:(j,K,$)=>{"use strict";$.d(K,{C:()=>ae,E:()=>ge,T:()=>le,c:()=>de,h:()=>ce,w:()=>se});var ee=$(7363),te=$(9521),ne=$(5469),re=$(7267),oe=$(5251),ie=ee.createContext("undefined"!=typeof HTMLElement?(0,te.Z)({key:"css"}):null),ae=ie.Provider,se=function withEmotionCache(j){return(0,ee.forwardRef)((function(K,$){var te=(0,ee.useContext)(ie);return j(K,te,$)}))},le=ee.createContext({});var ce={}.hasOwnProperty,ue="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",de=function createEmotionProps(j,K){var $={};for(var ee in K)ce.call(K,ee)&&($[ee]=K[ee]);return $[ue]=j,$},pe=function Insertion(j){var K=j.cache,$=j.serialized,ee=j.isStringTag;return(0,ne.hC)(K,$,ee),(0,oe.L)((function(){return(0,ne.My)(K,$,ee)})),null},ge=se((function(j,K,$){var te=j.css;"string"==typeof te&&void 0!==K.registered[te]&&(te=K.registered[te]);var oe=j[ue],ie=[te],ae="";"string"==typeof j.className?ae=(0,ne.fp)(K.registered,ie,j.className):null!=j.className&&(ae=j.className+" ");var se=(0,re.O)(ie,void 0,ee.useContext(le));ae+=K.key+"-"+se.name;var de={};for(var ge in j)ce.call(j,ge)&&"css"!==ge&&ge!==ue&&(de[ge]=j[ge]);return de.className=ae,$&&(de.ref=$),ee.createElement(ee.Fragment,null,ee.createElement(pe,{cache:K,serialized:se,isStringTag:"string"==typeof oe}),ee.createElement(oe,de))}))},6502:(j,K,$)=>{"use strict";$.d(K,{F4:()=>keyframes,iv:()=>css,tZ:()=>ie,xB:()=>ae});var ee=$(5037),te=$(7363),ne=$(5469),re=$(5251),oe=$(7267),ie=($(9521),$(3790),function jsx(j,K){var $=arguments;if(null==K||!ee.h.call(K,"css"))return te.createElement.apply(void 0,$);var ne=$.length,re=new Array(ne);re[0]=ee.E,re[1]=(0,ee.c)(j,K);for(var oe=2;oe<ne;oe++)re[oe]=$[oe];return te.createElement.apply(null,re)});!function(j){var K;K||(K=j.JSX||(j.JSX={}))}(ie||(ie={}));var ae=(0,ee.w)((function(j,K){var $=j.styles,ie=(0,oe.O)([$],void 0,te.useContext(ee.T)),ae=te.useRef();return(0,re.j)((function(){var j=K.key+"-global",$=new K.sheet.constructor({key:j,nonce:K.sheet.nonce,container:K.sheet.container,speedy:K.sheet.isSpeedy}),ee=!1,te=document.querySelector('style[data-emotion="'+j+" "+ie.name+'"]');return K.sheet.tags.length&&($.before=K.sheet.tags[0]),null!==te&&(ee=!0,te.setAttribute("data-emotion",j),$.hydrate([te])),ae.current=[$,ee],function(){$.flush()}}),[K]),(0,re.j)((function(){var j=ae.current,$=j[0];if(j[1])j[1]=!1;else{if(void 0!==ie.next&&(0,ne.My)(K,ie.next,!0),$.tags.length){var ee=$.tags[$.tags.length-1].nextElementSibling;$.before=ee,$.flush()}K.insert("",ie,$,!1)}}),[K,ie.name]),null}));function css(){for(var j=arguments.length,K=new Array(j),$=0;$<j;$++)K[$]=arguments[$];return(0,oe.O)(K)}function keyframes(){var j=css.apply(void 0,arguments),K="animation-"+j.name;return{name:K,styles:"@keyframes "+K+"{"+j.styles+"}",anim:1,toString:function toString(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}},7267:(j,K,$)=>{"use strict";$.d(K,{O:()=>serializeStyles});var ee={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},te=$(546),ne=/[A-Z]|^ms/g,re=/_EMO_([^_]+?)_([^]*?)_EMO_/g,oe=function isCustomProperty(j){return 45===j.charCodeAt(1)},ie=function isProcessableValue(j){return null!=j&&"boolean"!=typeof j},ae=(0,te.Z)((function(j){return oe(j)?j:j.replace(ne,"-$&").toLowerCase()})),se=function processStyleValue(j,K){switch(j){case"animation":case"animationName":if("string"==typeof K)return K.replace(re,(function(j,K,$){return le={name:K,styles:$,next:le},K}))}return 1===ee[j]||oe(j)||"number"!=typeof K||0===K?K:K+"px"};function handleInterpolation(j,K,$){if(null==$)return"";var ee=$;if(void 0!==ee.__emotion_styles)return ee;switch(typeof $){case"boolean":return"";case"object":var te=$;if(1===te.anim)return le={name:te.name,styles:te.styles,next:le},te.name;var ne=$;if(void 0!==ne.styles){var re=ne.next;if(void 0!==re)for(;void 0!==re;)le={name:re.name,styles:re.styles,next:le},re=re.next;return ne.styles+";"}return function createStringFromObject(j,K,$){var ee="";if(Array.isArray($))for(var te=0;te<$.length;te++)ee+=handleInterpolation(j,K,$[te])+";";else for(var ne in $){var re=$[ne];if("object"!=typeof re){var oe=re;null!=K&&void 0!==K[oe]?ee+=ne+"{"+K[oe]+"}":ie(oe)&&(ee+=ae(ne)+":"+se(ne,oe)+";")}else if(!Array.isArray(re)||"string"!=typeof re[0]||null!=K&&void 0!==K[re[0]]){var le=handleInterpolation(j,K,re);switch(ne){case"animation":case"animationName":ee+=ae(ne)+":"+le+";";break;default:ee+=ne+"{"+le+"}"}}else for(var ce=0;ce<re.length;ce++)ie(re[ce])&&(ee+=ae(ne)+":"+se(ne,re[ce])+";")}return ee}(j,K,$);case"function":if(void 0!==j){var oe=le,ce=$(j);return le=oe,handleInterpolation(j,K,ce)}}var ue=$;if(null==K)return ue;var de=K[ue];return void 0!==de?de:ue}var le,ce=/label:\s*([^\s;{]+)\s*(;|$)/g;function serializeStyles(j,K,$){if(1===j.length&&"object"==typeof j[0]&&null!==j[0]&&void 0!==j[0].styles)return j[0];var ee=!0,te="";le=void 0;var ne=j[0];null==ne||void 0===ne.raw?(ee=!1,te+=handleInterpolation($,K,ne)):te+=ne[0];for(var re=1;re<j.length;re++){if(te+=handleInterpolation($,K,j[re]),ee)te+=ne[re]}ce.lastIndex=0;for(var oe,ie="";null!==(oe=ce.exec(te));)ie+="-"+oe[1];var ae=function murmur2(j){for(var K,$=0,ee=0,te=j.length;te>=4;++ee,te-=4)K=1540483477*(65535&(K=255&j.charCodeAt(ee)|(255&j.charCodeAt(++ee))<<8|(255&j.charCodeAt(++ee))<<16|(255&j.charCodeAt(++ee))<<24))+(59797*(K>>>16)<<16),$=1540483477*(65535&(K^=K>>>24))+(59797*(K>>>16)<<16)^1540483477*(65535&$)+(59797*($>>>16)<<16);switch(te){case 3:$^=(255&j.charCodeAt(ee+2))<<16;case 2:$^=(255&j.charCodeAt(ee+1))<<8;case 1:$=1540483477*(65535&($^=255&j.charCodeAt(ee)))+(59797*($>>>16)<<16)}return((($=1540483477*(65535&($^=$>>>13))+(59797*($>>>16)<<16))^$>>>15)>>>0).toString(36)}(te)+ie;return{name:ae,styles:te,next:le}}},6375:(j,K,$)=>{"use strict";$.d(K,{m:()=>ee});var ee=function(){function StyleSheet(j){var K=this;this._insertTag=function(j){var $;$=0===K.tags.length?K.insertionPoint?K.insertionPoint.nextSibling:K.prepend?K.container.firstChild:K.before:K.tags[K.tags.length-1].nextSibling,K.container.insertBefore(j,$),K.tags.push(j)},this.isSpeedy=void 0===j.speedy||j.speedy,this.tags=[],this.ctr=0,this.nonce=j.nonce,this.key=j.key,this.container=j.container,this.prepend=j.prepend,this.insertionPoint=j.insertionPoint,this.before=null}var j=StyleSheet.prototype;return j.hydrate=function hydrate(j){j.forEach(this._insertTag)},j.insert=function insert(j){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function createStyleElement(j){var K=document.createElement("style");return K.setAttribute("data-emotion",j.key),void 0!==j.nonce&&K.setAttribute("nonce",j.nonce),K.appendChild(document.createTextNode("")),K.setAttribute("data-s",""),K}(this));var K=this.tags[this.tags.length-1];if(this.isSpeedy){var $=function sheetForTag(j){if(j.sheet)return j.sheet;for(var K=0;K<document.styleSheets.length;K++)if(document.styleSheets[K].ownerNode===j)return document.styleSheets[K]}(K);try{$.insertRule(j,$.cssRules.length)}catch(j){}}else K.appendChild(document.createTextNode(j));this.ctr++},j.flush=function flush(){this.tags.forEach((function(j){var K;return null==(K=j.parentNode)?void 0:K.removeChild(j)})),this.tags=[],this.ctr=0},StyleSheet}()},5251:(j,K,$)=>{"use strict";$.d(K,{L:()=>ne,j:()=>re});var ee=$(7363),te=!!ee.useInsertionEffect&&ee.useInsertionEffect,ne=te||function syncFallback(j){return j()},re=te||ee.useLayoutEffect},5469:(j,K,$)=>{"use strict";$.d(K,{My:()=>te,fp:()=>getRegisteredStyles,hC:()=>ee});function getRegisteredStyles(j,K,$){var ee="";return $.split(" ").forEach((function($){void 0!==j[$]?K.push(j[$]+";"):$&&(ee+=$+" ")})),ee}var ee=function registerStyles(j,K,$){var ee=j.key+"-"+K.name;!1===$&&void 0===j.registered[ee]&&(j.registered[ee]=K.styles)},te=function insertStyles(j,K,$){ee(j,K,$);var te=j.key+"-"+K.name;if(void 0===j.inserted[K.name]){var ne=K;do{j.insert(K===ne?"."+te:"",ne,j.sheet,!0),ne=ne.next}while(void 0!==ne)}}},6437:(j,K,$)=>{"use strict";$.d(K,{Z:()=>ne});var ee=$(6177),te=$(7514);const ne=(0,ee.Z)((0,te.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack")},1682:(j,K,$)=>{"use strict";$.d(K,{Z:()=>ne});var ee=$(6177),te=$(7514);const ne=(0,ee.Z)((0,te.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},6005:(j,K,$)=>{"use strict";$.d(K,{Z:()=>de});var ee=$(7363),te=$(7726),ne=$(9916),re=$(7843),oe=$(2893),ie=$(7562),ae=$(7321),se=$(4685),le=$(9503);function getBackdropUtilityClass(j){return(0,le.ZP)("MuiBackdrop",j)}(0,se.Z)("MuiBackdrop",["root","invisible"]);var ce=$(7514);const ue=(0,re.ZP)("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(j,K)=>{const{ownerState:$}=j;return[K.root,$.invisible&&K.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),de=ee.forwardRef((function Backdrop(j,K){const $=(0,oe.i)({props:j,name:"MuiBackdrop"}),{children:ee,className:re,component:se="div",invisible:le=!1,open:de,components:pe={},componentsProps:ge={},slotProps:he={},slots:me={},TransitionComponent:fe,transitionDuration:ye,...be}=$,ve={...$,component:se,invisible:le},Me=(j=>{const{classes:K,invisible:$}=j,ee={root:["root",$&&"invisible"]};return(0,ne.Z)(ee,getBackdropUtilityClass,K)})(ve),Ee={slots:{transition:fe,root:pe.Root,...me},slotProps:{...ge,...he}},[Se,Ce]=(0,ie.Z)("root",{elementType:ue,externalForwardedProps:Ee,className:(0,te.Z)(Me.root,re),ownerState:ve}),[_e,Te]=(0,ie.Z)("transition",{elementType:ae.Z,externalForwardedProps:Ee,ownerState:ve});return(0,ce.jsx)(_e,{in:de,timeout:ye,...be,...Te,children:(0,ce.jsx)(Se,{"aria-hidden":!0,...Ce,classes:Me,ref:K,children:ee})})}))},3335:(j,K,$)=>{"use strict";$.d(K,{Z:()=>Te});var ee=$(7363),te=$(7726);function resolveProps(j,K){const $={...K};for(const ee in j)if(Object.prototype.hasOwnProperty.call(j,ee)){const te=ee;if("components"===te||"slots"===te)$[te]={...j[te],...$[te]};else if("componentsProps"===te||"slotProps"===te){const ee=j[te],ne=K[te];if(ne)if(ee){$[te]={...ne};for(const j in ee)if(Object.prototype.hasOwnProperty.call(ee,j)){const K=j;$[te][K]=resolveProps(ee[K],ne[K])}}else $[te]=ne;else $[te]=ee||{}}else void 0===$[te]&&($[te]=j[te])}return $}var ne=$(9916),re=$(5689),oe=$(4532),ie=$(4039),ae=$(7843),se=$(518),le=$(2893),ce=$(9495),ue=$(3830),de=$(2791),pe=$(8981),ge=$(4685),he=$(9503);function getButtonUtilityClass(j){return(0,he.ZP)("MuiButton",j)}const me=(0,ge.Z)("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]);const fe=ee.createContext({});const ye=ee.createContext(void 0);var be=$(7514);const ve=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Me=(0,ae.ZP)(ce.Z,{shouldForwardProp:j=>(0,ie.Z)(j)||"classes"===j,name:"MuiButton",slot:"Root",overridesResolver:(j,K)=>{const{ownerState:$}=j;return[K.root,K[$.variant],K[`${$.variant}${(0,de.Z)($.color)}`],K[`size${(0,de.Z)($.size)}`],K[`${$.variant}Size${(0,de.Z)($.size)}`],"inherit"===$.color&&K.colorInherit,$.disableElevation&&K.disableElevation,$.fullWidth&&K.fullWidth,$.loading&&K.loading]}})((0,se.Z)((({theme:j})=>{const K="light"===j.palette.mode?j.palette.grey[300]:j.palette.grey[800],$="light"===j.palette.mode?j.palette.grey.A100:j.palette.grey[700];return{...j.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(j.vars||j).shape.borderRadius,transition:j.transitions.create(["background-color","box-shadow","border-color","color"],{duration:j.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${me.disabled}`]:{color:(j.vars||j).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(j.vars||j).shadows[2],"&:hover":{boxShadow:(j.vars||j).shadows[4],"@media (hover: none)":{boxShadow:(j.vars||j).shadows[2]}},"&:active":{boxShadow:(j.vars||j).shadows[8]},[`&.${me.focusVisible}`]:{boxShadow:(j.vars||j).shadows[6]},[`&.${me.disabled}`]:{color:(j.vars||j).palette.action.disabled,boxShadow:(j.vars||j).shadows[0],backgroundColor:(j.vars||j).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${me.disabled}`]:{border:`1px solid ${(j.vars||j).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(j.palette).filter((0,pe.Z)()).map((([K])=>({props:{color:K},style:{"--variant-textColor":(j.vars||j).palette[K].main,"--variant-outlinedColor":(j.vars||j).palette[K].main,"--variant-outlinedBorder":j.vars?`rgba(${j.vars.palette[K].mainChannel} / 0.5)`:(0,re.Fq)(j.palette[K].main,.5),"--variant-containedColor":(j.vars||j).palette[K].contrastText,"--variant-containedBg":(j.vars||j).palette[K].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(j.vars||j).palette[K].dark,"--variant-textBg":j.vars?`rgba(${j.vars.palette[K].mainChannel} / ${j.vars.palette.action.hoverOpacity})`:(0,re.Fq)(j.palette[K].main,j.palette.action.hoverOpacity),"--variant-outlinedBorder":(j.vars||j).palette[K].main,"--variant-outlinedBg":j.vars?`rgba(${j.vars.palette[K].mainChannel} / ${j.vars.palette.action.hoverOpacity})`:(0,re.Fq)(j.palette[K].main,j.palette.action.hoverOpacity)}}}}))),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":j.vars?j.vars.palette.Button.inheritContainedBg:K,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":j.vars?j.vars.palette.Button.inheritContainedHoverBg:$,"--variant-textBg":j.vars?`rgba(${j.vars.palette.text.primaryChannel} / ${j.vars.palette.action.hoverOpacity})`:(0,re.Fq)(j.palette.text.primary,j.palette.action.hoverOpacity),"--variant-outlinedBg":j.vars?`rgba(${j.vars.palette.text.primaryChannel} / ${j.vars.palette.action.hoverOpacity})`:(0,re.Fq)(j.palette.text.primary,j.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:j.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:j.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:j.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:j.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:j.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:j.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${me.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${me.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:j.transitions.create(["background-color","box-shadow","border-color"],{duration:j.transitions.duration.short}),[`&.${me.loading}`]:{color:"transparent"}}}]}}))),Ee=(0,ae.ZP)("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(j,K)=>{const{ownerState:$}=j;return[K.startIcon,$.loading&&K.startIconLoadingStart,K[`iconSize${(0,de.Z)($.size)}`]]}})((({theme:j})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:j.transitions.create(["opacity"],{duration:j.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...ve]}))),Se=(0,ae.ZP)("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(j,K)=>{const{ownerState:$}=j;return[K.endIcon,$.loading&&K.endIconLoadingEnd,K[`iconSize${(0,de.Z)($.size)}`]]}})((({theme:j})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:j.transitions.create(["opacity"],{duration:j.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...ve]}))),Ce=(0,ae.ZP)("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(j,K)=>K.loadingIndicator})((({theme:j})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(j.vars||j).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]}))),_e=(0,ae.ZP)("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(j,K)=>K.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),Te=ee.forwardRef((function Button(j,K){const $=ee.useContext(fe),re=ee.useContext(ye),ie=resolveProps($,j),ae=(0,le.i)({props:ie,name:"MuiButton"}),{children:se,color:ce="primary",component:pe="button",className:ge,disabled:he=!1,disableElevation:me=!1,disableFocusRipple:ve=!1,endIcon:Te,focusVisibleClassName:Ae,fullWidth:Ie=!1,id:Ne,loading:Oe=null,loadingIndicator:we,loadingPosition:De="center",size:xe="medium",startIcon:je,type:Le,variant:ke="text",...Pe}=ae,Re=(0,oe.Z)(Ne),ze=we??(0,be.jsx)(ue.Z,{"aria-labelledby":Re,color:"inherit",size:16}),Ue={...ae,color:ce,component:pe,disabled:he,disableElevation:me,disableFocusRipple:ve,fullWidth:Ie,loading:Oe,loadingIndicator:ze,loadingPosition:De,size:xe,type:Le,variant:ke},Ge=(j=>{const{color:K,disableElevation:$,fullWidth:ee,size:te,variant:re,loading:oe,loadingPosition:ie,classes:ae}=j,se={root:["root",oe&&"loading",re,`${re}${(0,de.Z)(K)}`,`size${(0,de.Z)(te)}`,`${re}Size${(0,de.Z)(te)}`,`color${(0,de.Z)(K)}`,$&&"disableElevation",ee&&"fullWidth",oe&&`loadingPosition${(0,de.Z)(ie)}`],startIcon:["icon","startIcon",`iconSize${(0,de.Z)(te)}`],endIcon:["icon","endIcon",`iconSize${(0,de.Z)(te)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},le=(0,ne.Z)(se,getButtonUtilityClass,ae);return{...ae,...le}})(Ue),Be=(je||Oe&&"start"===De)&&(0,be.jsx)(Ee,{className:Ge.startIcon,ownerState:Ue,children:je||(0,be.jsx)(_e,{className:Ge.loadingIconPlaceholder,ownerState:Ue})}),Ze=(Te||Oe&&"end"===De)&&(0,be.jsx)(Se,{className:Ge.endIcon,ownerState:Ue,children:Te||(0,be.jsx)(_e,{className:Ge.loadingIconPlaceholder,ownerState:Ue})}),Ye=re||"",He="boolean"==typeof Oe?(0,be.jsx)("span",{className:Ge.loadingWrapper,style:{display:"contents"},children:Oe&&(0,be.jsx)(Ce,{className:Ge.loadingIndicator,ownerState:Ue,children:ze})}):null;return(0,be.jsxs)(Me,{ownerState:Ue,className:(0,te.Z)($.className,Ge.root,ge,Ye),component:pe,disabled:he||Oe,focusRipple:!ve,focusVisibleClassName:(0,te.Z)(Ge.focusVisible,Ae),ref:K,type:Le,id:Oe?Re:Ne,...Pe,classes:Ge,children:[Be,"end"!==De&&He,se,"end"===De&&He,Ze]})}))},9495:(j,K,$)=>{"use strict";$.d(K,{Z:()=>we});var ee=$(7363),te=$.n(ee),ne=$(7726),re=$(9916);function isFocusVisible(j){try{return j.matches(":focus-visible")}catch(j){0}return!1}var oe=$(7843),ie=$(2893),ae=$(8080),se=$(8376),le=$(2035);class LazyRipple{static create(){return new LazyRipple}static use(){const j=(0,le.Z)(LazyRipple.create).current,[K,$]=ee.useState(!1);return j.shouldMount=K,j.setShouldMount=$,ee.useEffect(j.mountEffect,[K]),j}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=function createControlledPromise(){let j,K;const $=new Promise((($,ee)=>{j=$,K=ee}));return $.resolve=j,$.reject=K,$}(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&null!==this.ref.current&&(this.didMount=!0,this.mounted.resolve())};start(...j){this.mount().then((()=>this.ref.current?.start(...j)))}stop(...j){this.mount().then((()=>this.ref.current?.stop(...j)))}pulsate(...j){this.mount().then((()=>this.ref.current?.pulsate(...j)))}}var ce=$(9451);function _extends(){return _extends=Object.assign?Object.assign.bind():function(j){for(var K=1;K<arguments.length;K++){var $=arguments[K];for(var ee in $)({}).hasOwnProperty.call($,ee)&&(j[ee]=$[ee])}return j},_extends.apply(null,arguments)}var ue=$(1936),de=$(5175);function getChildMapping(j,K){var $=Object.create(null);return j&&ee.Children.map(j,(function(j){return j})).forEach((function(j){$[j.key]=function mapper(j){return K&&(0,ee.isValidElement)(j)?K(j):j}(j)})),$}function getProp(j,K,$){return null!=$[K]?$[K]:j.props[K]}function getNextChildMapping(j,K,$){var te=getChildMapping(j.children),ne=function mergeChildMappings(j,K){function getValueForKey($){return $ in K?K[$]:j[$]}j=j||{},K=K||{};var $,ee=Object.create(null),te=[];for(var ne in j)ne in K?te.length&&(ee[ne]=te,te=[]):te.push(ne);var re={};for(var oe in K){if(ee[oe])for($=0;$<ee[oe].length;$++){var ie=ee[oe][$];re[ee[oe][$]]=getValueForKey(ie)}re[oe]=getValueForKey(oe)}for($=0;$<te.length;$++)re[te[$]]=getValueForKey(te[$]);return re}(K,te);return Object.keys(ne).forEach((function(re){var oe=ne[re];if((0,ee.isValidElement)(oe)){var ie=re in K,ae=re in te,se=K[re],le=(0,ee.isValidElement)(se)&&!se.props.in;!ae||ie&&!le?ae||!ie||le?ae&&ie&&(0,ee.isValidElement)(se)&&(ne[re]=(0,ee.cloneElement)(oe,{onExited:$.bind(null,oe),in:se.props.in,exit:getProp(oe,"exit",j),enter:getProp(oe,"enter",j)})):ne[re]=(0,ee.cloneElement)(oe,{in:!1}):ne[re]=(0,ee.cloneElement)(oe,{onExited:$.bind(null,oe),in:!0,exit:getProp(oe,"exit",j),enter:getProp(oe,"enter",j)})}})),ne}var pe=Object.values||function(j){return Object.keys(j).map((function(K){return j[K]}))},ge=function(j){function TransitionGroup(K,$){var ee,te=(ee=j.call(this,K,$)||this).handleExited.bind(function _assertThisInitialized(j){if(void 0===j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}(ee));return ee.state={contextValue:{isMounting:!0},handleExited:te,firstRender:!0},ee}(0,ue.Z)(TransitionGroup,j);var K=TransitionGroup.prototype;return K.componentDidMount=function componentDidMount(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},K.componentWillUnmount=function componentWillUnmount(){this.mounted=!1},TransitionGroup.getDerivedStateFromProps=function getDerivedStateFromProps(j,K){var $,te,ne=K.children,re=K.handleExited;return{children:K.firstRender?($=j,te=re,getChildMapping($.children,(function(j){return(0,ee.cloneElement)(j,{onExited:te.bind(null,j),in:!0,appear:getProp(j,"appear",$),enter:getProp(j,"enter",$),exit:getProp(j,"exit",$)})}))):getNextChildMapping(j,ne,re),firstRender:!1}},K.handleExited=function handleExited(j,K){var $=getChildMapping(this.props.children);j.key in $||(j.props.onExited&&j.props.onExited(K),this.mounted&&this.setState((function(K){var $=_extends({},K.children);return delete $[j.key],{children:$}})))},K.render=function render(){var j=this.props,K=j.component,$=j.childFactory,ee=(0,ce.Z)(j,["component","childFactory"]),ne=this.state.contextValue,re=pe(this.state.children).map($);return delete ee.appear,delete ee.enter,delete ee.exit,null===K?te().createElement(de.Z.Provider,{value:ne},re):te().createElement(de.Z.Provider,{value:ne},te().createElement(K,ee,re))},TransitionGroup}(te().Component);ge.propTypes={},ge.defaultProps={component:"div",childFactory:function childFactory(j){return j}};const he=ge;var me=$(3968),fe=$(6502),ye=$(7514);const be=function Ripple(j){const{className:K,classes:$,pulsate:te=!1,rippleX:re,rippleY:oe,rippleSize:ie,in:ae,onExited:se,timeout:le}=j,[ce,ue]=ee.useState(!1),de=(0,ne.Z)(K,$.ripple,$.rippleVisible,te&&$.ripplePulsate),pe={width:ie,height:ie,top:-ie/2+oe,left:-ie/2+re},ge=(0,ne.Z)($.child,ce&&$.childLeaving,te&&$.childPulsate);return ae||ce||ue(!0),ee.useEffect((()=>{if(!ae&&null!=se){const j=setTimeout(se,le);return()=>{clearTimeout(j)}}}),[se,ae,le]),(0,ye.jsx)("span",{className:de,style:pe,children:(0,ye.jsx)("span",{className:ge})})};var ve=$(4685);const Me=(0,ve.Z)("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Ee=fe.F4`
|
|
2
|
+
var CrystaldesignDivaSupport;(()=>{var j,K,$,ee,te={4249:j=>{window,j.exports=function(j){var K={};function s($){if(K[$])return K[$].exports;var ee=K[$]={i:$,l:!1,exports:{}};return j[$].call(ee.exports,ee,ee.exports,s),ee.l=!0,ee.exports}return s.m=j,s.c=K,s.d=function(j,K,$){s.o(j,K)||Object.defineProperty(j,K,{enumerable:!0,get:$})},s.r=function(j){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})},s.t=function(j,K){if(1&K&&(j=s(j)),8&K)return j;if(4&K&&"object"==typeof j&&j&&j.__esModule)return j;var $=Object.create(null);if(s.r($),Object.defineProperty($,"default",{enumerable:!0,value:j}),2&K&&"string"!=typeof j)for(var ee in j)s.d($,ee,function(K){return j[K]}.bind(null,ee));return $},s.n=function(j){var K=j&&j.__esModule?function(){return j.default}:function(){return j};return s.d(K,"a",K),K},s.o=function(j,K){return Object.prototype.hasOwnProperty.call(j,K)},s.p="",s(s.s=38)}([function(j,K,$){"use strict";K.__esModule=!0,K.validateConversationType=K.validateUpdateUser=K.validateCreateUser=K.validateMessage=K.validateChatType=K.validateMsgId=K.validateArray=K.validateHideMessagesFromBlockedUsers=K.validateId=K.validateCreateGroup=K.validateJoinGroup=K.validateUpdateGroup=K.validateScope=K.isAudio=K.isVideo=K.isImage=K.getUpdatedSettings=K.getAppSettings=K.getCurrentTime=K.Logger=K.createUidFromJid=K.format=K.getOrdinalSuffix=K.isFalsy=K.isTruthy=K.isObject=K.getJidHost=K.getChatHost=void 0;var ee=$(14),te=$(1),ne=$(6),re=$(2),oe=$(16),ie=$(17),ae=$(19),se=$(3),le=$(13);function l(j){return null!=j&&("string"==typeof j&&(j=j.trim()),"object"==typeof j&&0===Object.keys(j).length&&(j=void 0)),["",0,"0",!1,null,"null",void 0,"undefined"].includes(j)}function p(j){for(var K=[],$=1;$<arguments.length;$++)K[$-1]=arguments[$];return j.split("%s").reduce((function(j,$,ee){return j+$+(K[ee]||"")}),"")}K.getChatHost=function(j){return j[te.APP_SETTINGS.KEYS.CHAT_HOST_OVERRIDE]?j[te.APP_SETTINGS.KEYS.CHAT_HOST_OVERRIDE]:j[te.APP_SETTINGS.KEYS.CHAT_HOST_APP_SPECIFIC]?j[te.APP_SETTINGS.KEYS.CHAT_HOST_APP_SPECIFIC]:j[te.APP_SETTINGS.KEYS.CHAT_HOST]},K.getJidHost=function(j){return j[te.APP_SETTINGS.KEYS.JID_HOST_OVERRIDE]?j[te.APP_SETTINGS.KEYS.JID_HOST_OVERRIDE]:j[te.APP_SETTINGS.KEYS.CHAT_HOST]},K.isObject=function(j){return j instanceof Object&&j.constructor===Object},K.isTruthy=function(j){return[!0,1,"1","true","TRUE"].includes(j)},K.isFalsy=l,K.getOrdinalSuffix=function(j){var K=j%10,$=j%100;return 1==K&&11!=$?j+"st":2==K&&12!=$?j+"nd":3==K&&13!=$?j+"rd":j+"th"},K.format=p,K.createUidFromJid=function(j){return j.substring(j.lastIndexOf("]")+1,j.lastIndexOf("@"))};var ce=function(){function t(){}return t.log=function(j,K){},t.error=function(j,K){},t.info=function(j,K){},t}();function T(){return new Promise((function(j,K){ne.makeApiCall("appSettings").then((function(K){ee.LocalStorage.getInstance().set(te.LOCAL_STORE.KEY_APP_SETTINGS,K.data),K.data.MODE&&se.CometChat.setMode(K.data.MODE),j(K.data)}),(function(j){K(new re.CometChatException(j.error))}))}))}K.Logger=ce,K.getCurrentTime=function(){return(new Date).getTime()},K.getAppSettings=function(){return new Promise((function(j,K){ee.LocalStorage.getInstance().get(te.LOCAL_STORE.KEY_APP_SETTINGS).then((function($){l($)?T().then((function(K){j(K)}),(function(j){K(j)})):j($)}),(function(j){K(j)}))}))},K.getUpdatedSettings=T,K.isImage=function(j){var K;return j.type&&j.type.toLowerCase().includes("image")&&(K=!0),K},K.isVideo=function(j){var K;return j.type&&j.type.toLowerCase().includes("video")&&(K=!0),K},K.isAudio=function(j){var K;return j.type&&j.type.toLowerCase().includes("audio")&&(K=!0),K},K.validateScope=function(j){return typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"SCOPE","SCOPE","Scope"))):l(j)?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"SCOPE","SCOPE","scope","scope"))):j!=se.CometChat.GROUP_MEMBER_SCOPE.ADMIN&&j!=se.CometChat.GROUP_MEMBER_SCOPE.MODERATOR&&j!=se.CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT?new re.CometChatException(te.GroupErrors.INVALID_SCOPE):void 0},K.validateUpdateGroup=function(j){return j.hasOwnProperty(te.GroupConstants.KEYS.GUID)?typeof j[te.GroupConstants.KEYS.GUID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID"))):l(j[te.GroupConstants.KEYS.GUID])?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID"))):j.hasOwnProperty(te.GroupConstants.KEYS.NAME)&&""===j[te.GroupConstants.KEYS.NAME]?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"GROUP_NAME","GROUP_NAME","Group name"))):void 0:new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GUID","GUID","GUID","GUID")))},K.validateJoinGroup=function(j,K,$){if(typeof j==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.OBJECT){if(!j.hasOwnProperty(te.GroupConstants.KEYS.GUID))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GUID","GUID","GUID","GUID")));if(typeof j[te.GroupConstants.KEYS.GUID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(l(j[te.GroupConstants.KEYS.GUID]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID")));if(!j.hasOwnProperty(te.GroupConstants.KEYS.TYPE))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GROUP_TYPE","GROUP_TYPE","Group type","Group type")));if(typeof j[te.GroupConstants.KEYS.TYPE]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_TYPE","GROUP_TYPE","Group type")));if(l(j[te.GroupConstants.KEYS.TYPE]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_TYPE","GROUP_TYPE","type","type")));if(j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PUBLIC&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PASSWORD&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PROTECTED&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PRIVATE)return new re.CometChatException(te.GroupErrors.INVALID_GROUP_TYPE);if(j[te.GroupConstants.KEYS.TYPE].toLowerCase()==se.CometChat.GROUP_TYPE.PASSWORD){if(!j.hasOwnProperty(te.GroupConstants.KEYS.PASSWORD))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PASSWORD_COMPULSORY),"PASSWORD","PASSWORD")));if(typeof j[te.GroupConstants.KEYS.PASSWORD]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"PASSWORD","PASSWORD","Password")));if(l(j[te.GroupConstants.KEYS.PASSWORD]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"PASSWORD","PASSWORD","password","password")))}}else{if(void 0!==j){if(typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(l(j))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID")))}if(void 0!==K){if(typeof K!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_TYPE","GROUP_TYPE","Group type")));if(l(K))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_TYPE","GROUP_TYPE","type","type")));if(K.toLowerCase()!=se.CometChat.GROUP_TYPE.PUBLIC&&K.toLowerCase()!=se.CometChat.GROUP_TYPE.PASSWORD&&K.toLowerCase()!=se.CometChat.GROUP_TYPE.PROTECTED&&K.toLowerCase()!=se.CometChat.GROUP_TYPE.PRIVATE)return new re.CometChatException(te.GroupErrors.INVALID_GROUP_TYPE);if(K.toLowerCase()==se.CometChat.GROUP_TYPE.PASSWORD){if(typeof $!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"PASSWORD","PASSWORD","Password")));if(l($))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"PASSWORD","PASSWORD","password","password")))}}}},K.validateCreateGroup=function(j){if(!j.hasOwnProperty(te.GroupConstants.KEYS.GUID))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GUID","GUID","GUID","GUID")));if(typeof j[te.GroupConstants.KEYS.GUID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(l(j[te.GroupConstants.KEYS.GUID]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GUID","GUID","GUID","GUID")));if(!j.hasOwnProperty(te.GroupConstants.KEYS.NAME))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GROUP_NAME","GROUP_NAME","Group name","Group name")));if(typeof j[te.GroupConstants.KEYS.NAME]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_NAME","GROUP_NAME","Group name")));if(l(j[te.GroupConstants.KEYS.NAME]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_NAME","GROUP_NAME","name","name")));if(!j.hasOwnProperty(te.GroupConstants.KEYS.TYPE))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"GROUP_TYPE","GROUP_TYPE","Group type","Group type")));if(typeof j[te.GroupConstants.KEYS.TYPE]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GROUP_TYPE","GROUP_TYPE","Group type")));if(l(j[te.GroupConstants.KEYS.TYPE]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"GROUP_TYPE","GROUP_TYPE","type","type")));if(j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PUBLIC&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PASSWORD&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PROTECTED&&j[te.GroupConstants.KEYS.TYPE].toLowerCase()!=se.CometChat.GROUP_TYPE.PRIVATE)return new re.CometChatException(te.GroupErrors.INVALID_GROUP_TYPE);if(j[te.GroupConstants.KEYS.TYPE].toLowerCase()==se.CometChat.GROUP_TYPE.PASSWORD){if(!j.hasOwnProperty(te.GroupConstants.KEYS.PASSWORD))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PASSWORD_COMPULSORY),"PASSWORD","PASSWORD")));if(typeof j[te.GroupConstants.KEYS.PASSWORD]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"PASSWORD","PASSWORD","Password")));if(l(j[te.GroupConstants.KEYS.PASSWORD]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_GROUP_PROPERTY),"PASSWORD","PASSWORD","password","password")))}if(j.hasOwnProperty(te.GroupConstants.KEYS.TAGS)){if(!Array.isArray(j[te.GroupConstants.KEYS.TAGS]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_AN_ARRAY),"GROUP_TAGS","GROUP_TAGS","Group tags")));if(0===j[te.GroupConstants.KEYS.TAGS].length)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_ARRAY),"GROUP_TAGS","GROUP_TAGS","Group tags")))}},K.validateId=function(j,K){if("user"===K){if(typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"UID","UID","UID")));if(l(j))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"UID","UID","UID","UID")))}if("group"===K){if(typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"GUID","GUID","GUID")));if(l(j))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"GUID","GUID","GUID","GUID")))}},K.validateHideMessagesFromBlockedUsers=function(j){if(typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_BOOLEAN),"HIDE_MESSAGES_FROM_BLOCKED_USERS","HIDE_MESSAGES_FROM_BLOCKED_USERS","hideMessagesFromBlockedUsers")))},K.validateArray=function(j,K){var $="List should be an array.";return $="blockUsers"===K?"blockUsers() method accepts an array of users.":"unblockUsers"===K?"unblockUsers() method accepts an array of users.":"groupMembers"===K?"addMembersToGroup() method accepts members list as an array of users.":"addMembersToGroup() method accepts bannedMembers list as an array of users.",typeof j!=te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.OBJECT?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_ARRAY),"USER_LIST","USER_LIST",$))):Array.isArray(j)?void 0:new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_ARRAY),"USER_LIST","USER_LIST",$)))},K.validateMsgId=function(j){return isNaN(j)?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_NUMBER),"MESSAGE_ID","MESSAGE_ID","Message Id"))):l(j)?new re.CometChatException(le.ERRORS.PARAMETER_MISSING):void 0},K.validateChatType=function(j){return typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver type"))):l(j)?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"RECEIVER_TYPE","RECEIVER_TYPE","receiver type","receiver type"))):j!=te.MessageConstatnts.RECEIVER_TYPE.GROUP&&j!=te.MessageConstatnts.RECEIVER_TYPE.USER?new re.CometChatException(te.MessageErrors.INVALID_RECEIVER_TYPE):void 0},K.validateMessage=function(j){var K=j;if(typeof K.getReceiverId()!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"RECEIVER_ID","RECEIVER_ID","Receiver Id")));if(l(K.getReceiverId()))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"RECEIVER_ID","RECEIVER_ID","receiver id","receiver id")));if(typeof K.getReceiverType()!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver Type")));if(l(K.getReceiverType()))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"RECEIVER_TYPE","RECEIVER_TYPE","receiver type","receiver type")));if(K.getReceiverType()!=te.MessageConstatnts.RECEIVER_TYPE.GROUP&&K.getReceiverType()!=te.MessageConstatnts.RECEIVER_TYPE.USER)return new re.CometChatException(te.MessageErrors.INVALID_RECEIVER_TYPE);if(j instanceof oe.TextMessage){var $=j;if(typeof $.getText()!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"MESSAGE_TEXT","MESSAGE_TEXT","Message text")));if(""===$.getText().trim())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"MESSAGE_TEXT","MESSAGE_TEXT","Message text")))}if(j instanceof ie.MediaMessage){var ee=j;if(ee.getData()&&ee.getData().hasOwnProperty("attachments"))for(var ne=ee.getAttachments(),se=0;se<ne.length;se++){if(!ne[se].getExtension())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MISSING_KEY),"extension","Attachment")));if(!ne[se].getMimeType())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MISSING_KEY),"mimeType","Attachment")));if(!ne[se].getName())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MISSING_KEY),"name","Attachment")));if(!ne[se].getUrl())return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MISSING_KEY),"url","Attachment")))}if(ee.hasOwnProperty("files"))for(se=0;se<ee.files.length;se++)if(!(ee.files[se]instanceof Blob))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_BLOB),"MEDIA_OBJECT","MEDIA_OBJECT","Media object")))}return j instanceof ae.CustomMessage&&l(j.getCustomData())?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"CUSTOM_DATA","CUSTOM_DATA","custom data","custom data"))):void 0},K.validateCreateUser=function(j){if(!j.hasOwnProperty(te.UserConstants.UID))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"UID","UID","UID","UID")));if(typeof j[te.UserConstants.UID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"UID","UID","UID")));if(l(j[te.UserConstants.UID]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_USER_PROPERTY),"UID","UID","UID","UID")));if(!j.hasOwnProperty(te.UserConstants.NAME))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"USER_NAME","USER_NAME","User name","User name")));if(typeof j[te.UserConstants.NAME]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"USER_NAME","USER_NAME","User name")));if(l(j[te.UserConstants.NAME]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_USER_PROPERTY),"USER_NAME","USER_NAME","name","name")));if(j.hasOwnProperty(te.UserConstants.AVATAR)&&""===j[te.UserConstants.AVATAR])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_AVATAR","USER_AVATAR","User avatar")));if(j.hasOwnProperty(te.UserConstants.META_DATA)&&""===j[te.UserConstants.META_DATA])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_METADATA","USER_METADATA","User metadata")));if(j.hasOwnProperty(te.UserConstants.LINK)&&""===j[te.UserConstants.LINK])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_LINK","USER_LINK","User link")));if(j.hasOwnProperty(te.UserConstants.STATUS_MESSAGE)&&""===j[te.UserConstants.STATUS_MESSAGE])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_STATUS_MESSAGE","USER_STATUS_MESSAGE","User status message")));if(j.hasOwnProperty(te.UserConstants.ROLE)&&""===j[te.UserConstants.ROLE])return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_ROLE","USER_ROLE","User role")));if(j.hasOwnProperty(te.UserConstants.TAGS)){if(!Array.isArray(j[te.UserConstants.TAGS]))return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_AN_ARRAY),"USER_TAGS","USER_TAGS","User tags")));if(0===j[te.UserConstants.TAGS].length)return new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_ARRAY),"USER_TAGS","USER_TAGS","User tags")))}},K.validateUpdateUser=function(j){return j.hasOwnProperty(te.UserConstants.UID)?typeof j[te.UserConstants.UID]!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"UID","UID","UID"))):l(j[te.UserConstants.UID])?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID_USER_PROPERTY),"UID","UID","UID","UID"))):j.hasOwnProperty(te.UserConstants.NAME)&&""===j[te.UserConstants.NAME]?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.EMPTY_STRING),"USER_NAME","USER_NAME","User name"))):void 0:new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.PARAMETER_COMPULSORY),"UID","UID","UID","UID")))},K.validateConversationType=function(j){return typeof j!==te.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.MUST_BE_A_STRING),"CONVERSATION_TYPE","CONVERSATION_TYPE","Conversation type"))):l(j)?new re.CometChatException(JSON.parse(p(JSON.stringify(te.GENERAL_ERROR.INVALID),"CONVERSATION_TYPE","CONVERSATION_TYPE","conversation type","conversation type"))):(j=j.toLowerCase())!=se.CometChat.RECEIVER_TYPE.USER&&j!=se.CometChat.RECEIVER_TYPE.GROUP?new re.CometChatException(te.ConversationErrors.INVALID_CONVERSATION_TYPE):void 0}},function(j,K,$){"use strict";K.__esModule=!0,K.ONLINE_MEMBER_COUNT_API=K.JWT_API=K.ProsodyApiErrors=K.PROSODY_API=K.API_ERROR_CODES=K.SESSION_STORE=K.CONNECTION_STATUS=K.COMMON_UTILITY_CONSTANTS=K.APP_SETTINGS=K.PresenceConstatnts=K.FeatureRestrictionErrors=K.MessageErrors=K.ExtensionErrors=K.ConversationErrors=K.GroupErrors=K.UserErrors=K.ReceiptErrors=K.GENERAL_ERROR=K.PARAMETER_ERROR=K.CALL_ERROR=K.Errors=K.UserConstants=K.GroupMemersConstans=K.GroupConstants=K.CallConstants=K.BlockedUsersConstants=K.ActionConstatnts=K.TYPING_NOTIFICATION=K.MessageCategory=K.ATTACHMENTS_CONSTANTS=K.MessageConstatnts=K.READ_RECEIPTS=K.DELIVERY_RECEIPTS=K.ResponseConstants=K.LOCAL_STORE=K.ANALYTICS=K.WS=K.SDKHeader=K.APPINFO=K.GROUP_MEMBER_SCOPE=K.GroupMemberScope=K.GROUP_TYPE=K.GroupType=K.CALLING_COMPONENT_VERSION=K.DEFAULT_VALUES=K.constants=void 0;var ee,te,ne,re=$(2);K.constants={DEFAULT_STORE:"cometchat",MSG_VER_PRE:"store-ver-pre",MSG_VER_POST:"store-ver-post"},K.DEFAULT_VALUES={ZERO:0,MSGS_LIMIT:30,MSGS_MAX_LIMIT:100,USERS_LIMIT:30,USERS_MAX_LIMIT:100,GROUPS_LIMIT:30,GROUPS_MAX_LIMIT:100,CONVERSATION_MAX_LIMIT:50,CALL_TIMEOUT:45,DEFAULT_MSG_ID:0,DEFAULT_MAX_TYPING_INDICATOR_LIMIT:5,REGION_DEFAULT:"eu",REGION_DEFAULT_EU:"eu",REGION_DEFAULT_US:"us",REGION_DEFAULT_IN:"in",REGION_DEFAULT_PRIVATE:"private"},K.CALLING_COMPONENT_VERSION=5,(ee=K.GroupType||(K.GroupType={})).Public="public",ee.Private="private",ee.Protected="protected",ee.Password="password",K.GROUP_TYPE={PUBLIC:"public",PRIVATE:"private",PROTECTED:"password",PASSWORD:"password"},(te=K.GroupMemberScope||(K.GroupMemberScope={})).Admin="admin",te.Moderator="moderator",te.Member="member",K.GROUP_MEMBER_SCOPE={ADMIN:"admin",MODERATOR:"moderator",PARTICIPANT:"participant"},K.APPINFO={platform:"WEB",sdkVersion:"v3.0.11",apiVersion:"v3.0",sdkVersionWithUnderScore:"3_0_11"},K.SDKHeader={platform:"javascript",sdkVersion:"3.0.11",sdk:"%s@%s"},K.WS={CONVERSATION:{TYPE:{CHAT:"chat",GROUP_CHAT:"groupchat"}}},K.ANALYTICS={analyticsHost:"metrics-%s.cometchat.io",analyticsVersion:"v1"},K.LOCAL_STORE={COMMON_STORE:"common_store",MESSAGE_LISTENERS_LIST:"message_listeners_list",USERS_STORE:"users_store",MESSAGES_STORE:"messages_store",KEYS_STORE:"keys_store",STORE_STRING:"%s:%s",KEY_STRING:"%s/%s",KEY_USER:"user",KEY_APP_SETTINGS:"app_settings",KEY_APP_ID:"appId",KEY_DEVICE_ID:"deviceId",KEY_MESSAGE_LISTENER_LIST:"all"},K.ResponseConstants={RESPONSE_KEYS:{KEY_DATA:"data",KEY_META:"meta",KEY_CURSOR:"cursor",KEY_ACTION:"action",KEY_MESSAGE:"message",KEY_ERROR:"error",KEY_ERROR_DETAILS:"details",KEY_ERROR_CODE:"code",KEY_ERROR_MESSAGE:"message",KEY_AUTH_TOKEN:"authToken",KEY_WS_CHANNEL:"wsChannel",KEY_IDENTITY:"identity",KEY_SERVICE:"identity",KEY_ENTITIES:"entities",KEY_ENTITITY:"entity",KEY_ENTITYTYPE:"entityType",KEY_ATTACHMENTS:"attachments",CODE_REQUEST_OK:200,CODE_BAD_REQUEST:401,UNREAD_UNDELIVERED_KEYS:{ENTITY:"entity",ENTITY_TYPE:"entityType",ENTITY_Id:"entityId",COUNT:"count"},GROUP_MEMBERS_RESPONSE:{SUCCESS:"success",ERROR:"error",MESSAGE:"message"},KEY_ENTITY_TYPE:{USER:"user",GROUP:"group"}}},K.DELIVERY_RECEIPTS={RECEIVER_ID:"receiverId",RECEIVER_TYPE:"type",RECIPIENT:"recipient",MESSAGE_ID:"messageId",RECEIVED:"delivered",DELIVERED_AT:"deliveredAt",ID:"id",TIME:"time",DELIVERED_TO_ME_AT:"deliveredToMeAt"},K.READ_RECEIPTS={RECEIVER_ID:"receiverId",RECEIVER_TYPE:"type",RECIPIENT:"recipient",MESSAGE_ID:"messageId",READ:"read",READ_AT:"readAt",ID:"id",TIME:"time",READ_BY_ME_AT:"readByMeAt"},K.MessageConstatnts={TYPE:{TEXT:"text",MEDIA:"media",IMAGE:"image",VIDEO:"video",AUDIO:"audio",FILE:"file",CUSTOM:"custom"},CATEGORY:{MESSAGE:"message",ACTION:"action",CALL:"call",CUSTOM:"custom"},RECEIVER_TYPE:{USER:"user",GROUP:"group"},KEYS:{ATTATCHMENT:"attatchment",ATTATCHMENTS:"attachments",ACTION:"action",TYPE:"type",DATA:"data",ID:"id",MUID:"muid",SENDER:"sender",RECEIVER:"receiver",RECEIVER_ID:"receiverId",CATEGORY:"category",RECEIVER_TYPE:"receiverType",SENT_AT:"sentAt",STATUS:"status",TEXT:"text",URL:"url",METADATA:"metadata",RECEIPTS:"receipts",MY_RECEIPTS:"myReceipt",CUSTOM_DATA:"customData",CUSTOM_SUB_TYPE:"subType",RESOURCE:"resource"},KNOWN_MEDIA_TYPE:{IMAGE:[],VIDEO:[],AUDIO:[],FILE:[]},PAGINATION:{AFFIX:{APPEND:"append",PREPEND:"prepend"},CURSOR_FILEDS:{ID:"id",SENT_AT:"sentAt"},CURSOR_AFFIX_DEFAULT:"prepend",CURSOR_FIELD_DEFAULT:"sentAt",KEYS:{PER_PAGE:"per_page",CURSOR_AFFIX:"cursorAffix",AFFIX:"affix",CURSOR_FIELD:"cursorField",CURSOR_VALUE:"cursorValue",UID:"uid",SENT_AT:"sentAt",ID:"id",CURRENT_PAGE:"page",UNREAD:"unread",HIDE_MESSAGES_FROM_BLOCKED_USER:"hideMessagesFromBlockedUsers",SEARCH_KEY:"searchKey",ONLY_UPDATES:"onlyUpdates",UPDATED_AT:"updatedAt",CATEGORY:"category",CATEGORIES:"categories",TYPE:"type",TYPES:"types",HIDE_REPLIES:"hideReplies",HIDE_DELETED_MESSAGES:"hideDeleted",WITH_TAGS:"withTags",TAGS:"tags"}}},K.ATTACHMENTS_CONSTANTS={KEYS:{EXTENSION:"extension",MIME_TYPE:"mimeType",NAME:"name",SIZE:"size",URL:"url"}},(ne=K.MessageCategory||(K.MessageCategory={})).ACTION="action",ne.MESSAGE="message",ne.CALL="call",ne.CUSTOM="custom",K.TYPING_NOTIFICATION={RECEIVER_ID:"receiverId",RECEIVER_TYPE:"receiverType",META:"metadata",KEYS:{TYPING_NOTIFICATION:"typingNotification",TIMESTAMP:"timestamp"},ACTIONS:{STARTED:"started",ENDED:"ended"}},K.ActionConstatnts={ACTION_SUBJECTS:{ACTION_ON:"on",ACTION_BY:"by",ACTION_FOR:"for"},ACTION_ENTITY_TYPE:{GROUP_USER:"groupuser",USER:"user",GROUP:"group",MESSAGE:"message"},ACTION_KEYS:{ACTION_CREATED:"created",ACTION_UPDATED:"updated",ACTION_DELETED:"deleted",ENTITIES:"entities",ENTITY:"entity",ENTITY_TYPE:"entityType",TYPE_MEMBER_JOINED:"joined",TYPE_MEMBER_LEFT:"left",TYPE_MEMBER_KICKED:"kicked",TYPE_MEMBER_BANNED:"banned",TYPE_MEMBER_UNBANNED:"unbanned",TYPE_MEMBER_INVITED:"invited",TYPE_MEMBER_ADDED:"added",ACTION_SCOPE_CHANGED:"scopeChanged",ACTION_TYPE_USER:"user",ACTION_TYPE_GROUP:"group",ACTION_TYPE_GROUP_MEMBER:"groupMember",TYPE_MESSAGE_EDITED:"edited",TYPE_MESSAGE_DELETED:"deleted",ACTION_TYPE_CALL:"call",EXTRAS:"extras",SCOPE:"scope",NEW:"new",OLD:"old"},ActionMessages:{ACTION_GROUP_JOINED_MESSAGE:"%s joined",ACTION_GROUP_LEFT_MESSAGE:"%s left",ACTION_MEMBER_KICKED_MESSAGE:"%s kicked %s",ACTION_MEMBER_BANNED_MESSAGE:"%s banned %s",ACTION_MEMBER_UNBANNED_MESSAGE:"%s unbanned %s",ACTION_MEMBER_INVITED_MESSAGE:"%s banned %s",ACTION_MESSAGE_EDITED_MESSAGE:" Message Edited",ACTION_MESSAGE_DELETED_MESSAGE:"Message Deleted",ACTION_MEMBER_SCOPE_CHANGED:"%s made %s %s",ACTION_MEMBER_ADDED_TO_GROUP:"%s added %s"},ACTION_TYPE:{TYPE_MEMBER_JOINED:"joined",TYPE_MEMBER_LEFT:"left",TYPE_MEMBER_KICKED:"kicked",TYPE_MEMBER_BANNED:"banned",TYPE_MEMBER_UNBANNED:"unbanned",TYPE_MEMBER_INVITED:"invited",TYPE_MEMBER_SCOPE_CHANGED:"scopeChanged",TYPE_MESSAGE:"message",TYPE_MESSAGE_EDITED:"edited",TYPE_MESSAGE_DELETED:"deleted",TYPE_MEMBER_ADDED:"added"},ACTIONS:{MEMBER_ADDED:"added",MEMBER_JOINED:"joined",MEMBER_LEFT:"left",MEMBER_KICKED:"kicked",MEMBER_BANNED:"banned",MEMBER_UNBANNED:"unbanned",MEMBER_INVITED:"invited",MEMBER_SCOPE_CHANGED:"scopeChanged",MESSAGE_EDITED:"edited",MESSSAGE_DELETED:"deleted",TYPE_USER:"user",TYPE_GROUP:"group",TYPE_GROUP_MEMBER:"groupMember"}},K.BlockedUsersConstants={REQUEST_KEYS:{DIRECTIONS:{BOTH:"both",HAS_BLOCKED_ME:"hasBlockedMe",BLOCKED_BY_ME:"blockedByMe"}}},K.CallConstants={CALL_MODE:{DEFAULT:"DEFAULT",SPOTLIGHT:"SPOTLIGHT",SINGLE:"SINGLE",TILE:"TILE",GRID:"GRID"},CALL_TYPE:{AUDIO:"audio",VIDEO:"video"},RECEIVER_TYPE_GROUP:"group",RECEIVER_TYPE_USER:"user",CALL_KEYS:{CALL_DATA:"data",CALL_ID:"id",CALL_SESSION_ID:"sessionid",CALL_RECEIVER:"receiver",CALL_SENDER:"sender",CALL_RECEIVER_TYPE:"receiverType",CALL_STATUS:"status",CALL_TYPE:"type",CALL_INITIATED_AT:"initiatedAt",CALL_JOINED_AT:"joinedAt",CALL_LEFT_AT:"leftAt",CALL_METADATA:"metadata",CALL_ENTITIES:"entities",CALL_ENTITY_TYPE:"entityType",CALL_ENTITY:"entity",CALL_ENTITY_USER:"user",CALL_ENTITY_GROUP:"group"},CALL_STATUS:{INITIATED:"initiated",ONGOING:"ongoing",UNANSWERED:"unanswered",REJECTED:"rejected",BUSY:"busy",CANCELLED:"cancelled",ENDED:"ended"},AUDIO_INPUT_DEVICES:"audioInputDevices",AUDIO_OUTPUT_DEVICES:"audioOutputDevices",VIDEO_INPUT_DEVICES:"videoInputDevices",POST_MESSAGES:{TYPES:{ACTION_MESSAGE:"cometchat_action_message",HANGUP:"hangup",COMETCHAT_RTC_SETTINGS:"cometchat_rtc_settings"},ACTIONS:{USER_JOINED:"onUserJoined",USER_LEFT:"onUserLeft",USER_LIST_CHANGED:"onUserListChanged",INITIAL_DEVICE_LIST:"initialDeviceList",DEVICE_CHANGE:"onDeviceChange",LOAD:"LOAD",CHANGE_AUDIO_INPUT:"changeAudioInput",CHANGE_AUDIO_OUTPUT:"changeAudioOutput",CHANGE_VIDEO_INPUT:"changeVideoInput",MUTE_AUDIO:"muteAudio",UNMUTE_AUDIO:"unMuteAudio",PAUSE_VIDEO:"pauseVideo",UNPAUSE_VIDEO:"unPauseVideo",SWITCH_MODE:"switchMode",START_SCREENSHARE:"startScreenShare",STOP_SCREENSHARE:"stopScreenShare",END_CALL:"endCall",START_RECORDING:"startRecording",STOP_RECORDING:"stopRecording",RECORDING_TOGGLED:"onRecordingToggled",USER_MUTED:"onUserMuted",SCREEN_SHARE_STARTED:"SCREEN_SHARE_STARTED",SCREEN_SHARE_STOPPED:"SCREEN_SHARE_ENDED",SWITCH_TO_VIDEO_CALL:"switchedToVideo",SWITCHED_TO_VIDEO_CALL:"onCallSwitchedToVideo",OPEN_VIRTUAL_BACKGROUND:"openVirtualBackgroundMenu",SET_BACKGROUND_BLUR:"setBackgroundBlur",SET_BACKGROUND_IMAGE:"setBackgroundImage"}},MEDIA_DEVICE:{ID:"id",NAME:"name",ACTIVE:"active"},ZOOM_BUTTON_DEFAULT_PARAMS:{position:"bottom-right",visible:!0},NAME_LABEL_DEFAULT_PARAMS:{position:"bottom-left",visible:!0,color:"rgba(27, 27, 27, 0.4)"},NETWORK_LABEL_DEFAULT_PARAMS:{position:"bottom-right",visible:!0},MAIN_VIDEO_CONTAINER_SETTINGS:{KEYS:{POSITION:"position",VISIBILITY:"visible",COLOR:"color"}}},K.GroupConstants={KEYS:{NAME:"name",GUID:"guid",TYPE:"type",PASSWORD:"password",ICON:"icon",DESCRIPTION:"description",OWNER:"owner",METADATA:"metadata",CREATED_AT:"createdAt",UPDATED_AT:"updatedAt",HAS_JOINED:"hasJoined",WS_CHANNEL:"wsChannel",TAGS:"tags"}},K.GroupMemersConstans={KEYS:{SCOPE:"scope",UID:"uid",GUID:"guid",USER:"user",NAME:"name"}},K.UserConstants={UID:"uid",NAME:"name",AUTH_TOKEN:"authToken",AVATAR:"avatar",LAST_ACTIVE_AT:"lastActiveAt",LINK:"link",META_DATA:"metadata",ROLE:"role",STATUS:"status",STATUS_MESSAGE:"statusMessage",USER_NAME:"user_name",TAGS:"tags",SORT_BY:{NAME:"name",STATUS:"status"},SORT_ORDER:{ASCENDING:"asc",DESCENDING:"desc"}},K.Errors={ERROR_IO_EXCEPTION:"ERROR_IO_EXCEPTION",ERROR_JSON_EXCEPTION:"ERROR_JSON_EXCEPTION",ERROR_PASSWORD_MISSING:"ERROR_PASSWORD_MISSING",ERROR_LIMIT_EXCEEDED:"ERROR_LIMIT_EXCEEDED",ERROR_USER_NOT_LOGGED_IN:"ERROR_USER_NOT_LOGGED_IN",ERROR_INVALID_GUID:"ERROR_INVALID_GUID",ERROR_PASSWORD_MISSING_MESSAGE:"Password is mandatory for a password group",ERROR_LIMIT_EXCEEDED_MESSAGE:"Limit Exceeded Max limit of %s",ERROR_USER_NOT_LOGGED_IN_MESSAGE:"Please log in to CometChat before calling this method",ERROR_INVALID_GUID_MESSAGE:"Please provide a valid GUID",ERROR_DEFAULT_MESSAGE:"Something went wrong",ERR_SETTINGS_HASH_OUTDATED:"ERR_SETTINGS_HASH_OUTDATED",ERR_NO_AUTH:"ERR_NO_AUTH"},K.CALL_ERROR={CALL_ALREADY_INITIATED:{code:"CALL_ALREADY_INITIATED",name:"CALL_ALREADY_INITIATED",message:"There is already call in progress",details:{}},ERROR_IN_CALLING:{code:"CALL_IN_PROGRESS",name:"CALL_ALREADY_INITIATED",message:"There is already call in progress",details:{}},CANNOT_ACCEPT_CALL:{code:"CALL_IN_PROGRESS",name:"CALL_IN_PROGRESS",message:"There is already a call in progress",details:{}},NOT_INITIALIZED:{code:"NOT_INITIALIZED",name:"NOT_INITIALIZED",message:"Please call the CometChat.init() method before calling any other methods related to CometChat.",details:{}},NOT_LOGGED_IN:{code:"NOT_LOGGED_IN",name:"NOT_LOGGED_IN",message:"Please login before starting a call.",details:{}},SESSION_ID_REQUIRED:{code:"SESSION_ID_REQUIRED",name:"SESSION_ID_REQUIRED",message:"Please make sure you are passing correct session id.",details:{}},CALL_SETTINGS_REQUIRED:{code:"CALL_SETTINGS_REQUIRED",name:"CALL_SETTINGS_REQUIRED",message:"Please make sure you are passing the call settings object.",details:{}},JWT_NOT_FOUND:{code:"JWT_NOT_FOUND",name:"JWT_NOT_FOUND",message:"There was some issue while fetching JWT from API.",details:{}}},K.PARAMETER_ERROR={PARAMETER_REQUIRED:{code:"%s_NOT_PROVIDED",name:"%s_NOT_PROVIDED",message:"please provide the %s.",details:{}}},K.GENERAL_ERROR={MUST_BE_A_STRING:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a string.",details:{}},MUST_BE_A_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a number.",details:{}},MUST_BE_A_OBJECT:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a object.",details:{}},MUST_BE_AN_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be an array.",details:{}},MUST_BE_A_BOOLEAN:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a boolean.",details:{}},MUST_BE_A_BLOB:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a blob.",details:{}},INVALID:{code:"INVALID_%s",name:"INVALID_%s",message:"Invalid %s. Please provide a valid %s.",details:{}},METHOD_COMPULSORY:{code:"%s_IS_COMPULSORY",name:"%s_IS_COMPULSORY",message:"%s is required.",details:{}},LIMIT_EXCEEDED:{code:"ERROR_%s_EXCEEDED",name:"ERROR_%s_EXCEEDED",message:"Limit exceeded max limit of %s.",details:{}},MUST_BE_A_POSITIVE_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s should be a postive integer greater than 0.",details:{}},INVALID_MEDIA_FILE:{code:"INVALID_%s",name:"INVALID_%s",message:"The message type does not match the file's mime type.",details:{}},EMPTY_STRING:{code:"INVALID_%s",name:"INVALID_%s",message:"%s cannot be empty.",details:{}},MISSING_KEY:{code:"MISSING_KEY",name:"MISSING_KEY",message:"The key %s is missing from the %s object.",details:{}},EMPTY_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"The parameter %s should be an array and it cannot be empty.",details:{}},INVALID_SEARCH_KEYWORD:{code:"INVALID_SEARCH_KEYWORD",name:"INVALID_SEARCH_KEYWORD",message:"Invalid search keyword. Please provide a valid search keyword.",details:{}},INVALID_GROUP_PROPERTY:{code:"INVALID_%s",name:"INVALID_%s",message:"Invalid %s provided for the group. Please provide a valid %s.",details:{}},INVALID_USER_PROPERTY:{code:"INVALID_%s",name:"INVALID_%s",message:"Invalid %s provided for a user. Please provide a valid %s.",details:{}},PARAMETER_MUST_BE_A_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as a number.",details:{}},PARAMETER_MUST_BE_AN_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as an array.",details:{}},PARAMETER_MUST_BE_A_BOOLEAN:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as a boolean.",details:{}},PARAMETER_MUST_BE_A_POSITIVE_NUMBER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter to be a positive number greater than 0.",details:{}},PARAMETER_MUST_BE_A_STRING:{code:"INVALID_%s",name:"INVALID_%s",message:"%s method accepts parameter as a string.",details:{}},PARAMETER_COMPULSORY:{code:"%s_IS_COMPULSORY",name:"%s_IS_COMPULSORY",message:"%s cannot be blank. Please provide a valid %s.",details:{}},PASSWORD_COMPULSORY:{code:"%s_IS_COMPULSORY",name:"%s_IS_COMPULSORY",message:"Password is mandatory for a password group.",details:{}},INVALID_ARRAY:{code:"INVALID_%s",name:"INVALID_%s",message:"%s",details:{}}},K.ReceiptErrors={MISSING_PARAMETERS:{code:"MISSING_PARAMETERS",name:"MISSING_PARAMETERS",message:"Expected 4 parameters received 3",details:{}},INVALID_PARAMETER:{code:"INVALID_%s",name:"INVALID_%s",message:"%s",details:{}},NO_WEBSOCKET_CONNECTION:{code:"NO_WEBSOCKET_CONNECTION",name:"NO_WEBSOCKET_CONNECTION",message:"Connection to our Websockets server is broken. Please retry after some time.",details:{}},RECEIPTS_TEMPORARILY_BLOCKED:{code:"RECEIPTS_TEMPORARILY_BLOCKED",name:"RECEIPTS_TEMPORARILY_BLOCKED",message:"Due to high load. Receipts have been blocked for your app.",details:{}},UNKNOWN_ERROR_OCCURRED:{code:"UNKNOWN_ERROR_OCCURRED",name:"UNKNOWN_ERROR_OCCURRED",message:"Unknown error occurred while marking a message as read.",details:{}}},K.UserErrors={INVALID_STATUS:new re.CometChatException({code:"INVALID_STATUS_VALUE",name:"INVALID_STATUS_VALUE",message:"The `status` parameter accepts only `online` or `offline`.",details:""}),INVALID_DIRECTION:new re.CometChatException({code:"INVALID_DIRECTION_VALUE",name:"INVALID_DIRECTION_VALUE",message:"The `direction` parameter accepts only `both`, `blockeyByMe` or `hasBlockedMe`.",details:""}),USER_NOT_LOGGED_IN:new re.CometChatException({code:"USER_NOT_LOGGED_IN",name:"USER_NOT_LOGGED_IN",message:"Please log in to CometChat before calling this method.",details:""})},K.GroupErrors={NOT_A_GROUP:new re.CometChatException({code:"NOT_A_GROUP",message:"Please use group class to construct a new group."}),INVALID_SCOPE:new re.CometChatException({code:"INVALID_SCOPE_VALUE",name:"INVALID_SCOPE_VALUE",message:"Scope can be `admin`, `moderator` or `participant`.",details:""}),INVALID_GROUP_TYPE:new re.CometChatException({code:"INVALID_GROUP_TYPE",name:"INVALID_GROUP_TYPE",message:"Group type can be `public`, `private`, `protected` or `password`.",details:""})},K.ConversationErrors={INVALID_CONVERSATION_TYPE:{code:"INVALID_CONVERSATION_TYPE",name:"INVALID_CONVERSATION_TYPE",message:"Conversation type can be `user` or `group`.",details:"Please check the value of conversationType."},CONVERSATION_NOT_FOUND:{code:"CONVERSATION_NOT_FOUND",name:"CONVERSATION_NOT_FOUND",message:"Conversation for %s %s not found.",details:"Please check the value of conversationWith and conversationType."}},K.ExtensionErrors={INVALID_EXTENSION:{code:"ERROR_INVALID_EXTENSION",name:"ERROR_INVALID_EXTENSION",message:"The provided extension cannot be null or empty. Please provide a valid extension.",details:{}},EXTENSION_NOT_FOUND:{code:"ERROR_EXTENSION_NOT_FOUND",name:"ERROR_EXTENSION_NOT_FOUND",message:"The provided extension could not be found.",details:{}}},K.MessageErrors={INVALID_RECEIVER_TYPE:{code:"INVALID_RECEIVER_TYPE",name:"INVALID_RECEIVER_TYPE",message:"Receiver type can be `user` or `group`.",details:"Please check the value of receiverType."}},K.FeatureRestrictionErrors={INVALID_FEATURE:{code:"ERROR_INVALID_FEATURE",name:"ERROR_INVALID_FEATURE",message:"The provided feature cannot be null or empty. Please provide a valid feature.",details:{}},FEATURE_NOT_FOUND:{code:"ERROR_FEATURE_NOT_FOUND",name:"ERROR_FEATURE_NOT_FOUND",message:"The provided feature could not be found.",details:{}}},K.PresenceConstatnts={STATUS:{ONLINE:"online",AVAILABLE:"available",OFFLINE:"offline",JOINED:"JOINED",LEFT:"LEFT"}},K.APP_SETTINGS={APP_SETTINGS:"app_settings",KEYS:{CHAT_HOST:"CHAT_HOST",CHAT_USE_SSL:"CHAT_USE_SSL",GROUP_SERVICE:"GROUP_SERVICE",CALL_SERVICE:"CALL_SERVICE",CHAT_WS_PORT:"CHAT_WS_PORT",CHAT_WSS_PORT:"CHAT_WSS_PORT",CHAT_HTTP_BIND_PORT:"CHAT_HTTP_BIND_PORT",CHAT_HTTPS_BIND_PORT:"CHAT_HTTPS_BIND_PORT",ADMIN_API_HOST:"ADMIN_API_HOST",CLIENT_API_HOST:"CLIENT_API_HOST",WEBRTC_HOST:"WEBRTC_HOST",WEBRTC_USE_SSL:"WEBRTC_USE_SSL",WEBRTC_WS_PORT:"WEBRTC_WS_PORT",WEBRTC_WSS_PORT:"WEBRTC_WSS_PORT",WEBRTC_HTTP_BIND_PORT:"WEBRTC_HTTP_BIND_PORT",WEBRTC_HTTPS_BIND_PORT:"WEBRTC_HTTPS_BIND_PORT",EXTENSION_LIST:"extensions",EXTENSION_KEYS:{ID:"id",NAME:"name"},JID_HOST_OVERRIDE:"JID_HOST_OVERRIDE",CHAT_HOST_OVERRIDE:"CHAT_HOST_OVERRIDE",CHAT_HOST_APP_SPECIFIC:"CHAT_HOST_APP_SPECIFIC",MODE:"MODE",CONNECTION_TYPE:"connection_type",DEFAULT_MODE:"DEFAULT",LIMITED_TRANSIENT:"LIMITED_TRANSIENT",NO_TRANSIENT:"NO_TRANSIENT",POLLING_ENABLED:"POLLING_ENABLED",POLLING_INTERVAL:"POLLING_INTERVAL",ANALYTICS_PING_DISABLED:"ANALYTICS_PING_DISABLED",ANALYTICS_HOST:"ANALYTICS_HOST",ANALYTICS_VERSION:"ANALYTICS_VERSION",ANALYTICS_USE_SSL:"ANALYTICS_USE_SSL",SETTINGS_HASH:"settingsHash",SETTINGS_HASH_RECEIVED_AT:"settingsHashReceivedAt",DENY_FALLBACK_TO_POLLING:"DENY_FALLBACK_TO_POLLING",APP_VERSION:"APP_VERSION",MAIN_DOMAIN:"MAIN_DOMAIN",CHAT_API_VERSION:"CHAT_API_VERSION",WS_API_VERSION:"WS_API_VERSION",REGION:"REGION",EXTENSION_DOMAIN:"EXTENSION_DOMAIN",WEBRTC_API_SUBDOMAIN:"WEBRTC_API_SUBDOMAIN",WEBRTC_WEB_FRONTEND_HOST:"WEBRTC_WEB_FRONTEND_HOST",WEBRTC_WEB_FRONTEND_VERSION:"WEBRTC_WEB_FRONTEND_VERSION"}},K.COMMON_UTILITY_CONSTANTS={TYPE_CONSTANTS:{BOOLEAN:"boolean",STRING:"string",OBJECT:"object",NUMBER:"number"}},K.CONNECTION_STATUS={CONNECTED:"connected",CONNECTING:"connecting",DISCONNECTED:"disconnected",FEATURE_THROTTLED:"featureThrottled"},K.SESSION_STORE={SESSION_ID:"sessionId"},K.API_ERROR_CODES={AUTH_ERR_AUTH_TOKEN_NOT_FOUND:"AUTH_ERR_AUTH_TOKEN_NOT_FOUND"},K.PROSODY_API={DOMAIN_PREFIX:"xmpp",PATH:{ROOM:"room",ROOM_SIZE:"room-size",SESSIONS:"sessions"},RESPONSE:{PARTICIPANTS:"participants"},QUERY_PARAMETERS:{DOMAIN:"domain",ROOM:"room"}},K.ProsodyApiErrors={INVALID_SESSIONID:{code:"ERROR_INVALID_SESSIONID",name:"ERROR_INVALID_SESSIONID",message:"The provided sessionId cannot be null or empty. Please provide a valid sessionId.",details:""},INVALID_TYPE:{code:"ERROR_INVALID_TYPE",name:"ERROR_INVALID_TYPE",message:"The provided type cannot be null or empty. Please provide a valid type.",details:""}},K.JWT_API={KEYS:{PASSTHROUGH:"passthrough",EXPAND:"expand"}},K.ONLINE_MEMBER_COUNT_API={ENDPOINTS:{GET_ONLINE_MEMBER_COUNT:"api/%s/online-members"},RESPONSE:{ONLINE_USERS_COUNT:"onlineUsersCount",GROUPS:"groups"},ERRORS:{INVALID_GROUPLIST:{code:"ERROR_INVALID_GROUPLIST",name:"ERROR_INVALID_GROUPLIST",message:"Grouplist cannot be null or empty.",details:""}}}},function(j,K,$){"use strict";K.__esModule=!0,K.CometChatException=void 0;var o=function(j){null!==j.code&&void 0!==j.code&&""!==j.code&&(this.code=j.code),null!==j.name&&void 0!==j.name&&""!==j.name&&(this.name=j.name),null!==j.message&&void 0!==j.message&&""!==j.message&&(this.message=j.message),null!==j.details&&void 0!==j.details&&""!==j.details&&(this.details=j.details)};K.CometChatException=o},function(j,K,$){"use strict";var ee=this&&this.__assign||function(){return(ee=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)},te=this&&this.__awaiter||function(j,K,$,ee){return new($||($=Promise))((function(te,ne){function o(j){try{r(ee.next(j))}catch(j){ne(j)}}function s(j){try{r(ee.throw(j))}catch(j){ne(j)}}function r(j){var K;j.done?te(j.value):(K=j.value,K instanceof $?K:new $((function(j){j(K)}))).then(o,s)}r((ee=ee.apply(j,K||[])).next())}))},ne=this&&this.__generator||function(j,K){var $,ee,te,ne,re={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return ne={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(ne[Symbol.iterator]=function(){return this}),ne;function e(ne){return function(oe){return function(ne){if($)throw new TypeError("Generator is already executing.");for(;re;)try{if($=1,ee&&(te=2&ne[0]?ee.return:ne[0]?ee.throw||((te=ee.return)&&te.call(ee),0):ee.next)&&!(te=te.call(ee,ne[1])).done)return te;switch(ee=0,te&&(ne=[2&ne[0],te.value]),ne[0]){case 0:case 1:te=ne;break;case 4:return re.label++,{value:ne[1],done:!1};case 5:re.label++,ee=ne[1],ne=[0];continue;case 7:ne=re.ops.pop(),re.trys.pop();continue;default:if(!(te=0<(te=re.trys).length&&te[te.length-1])&&(6===ne[0]||2===ne[0])){re=0;continue}if(3===ne[0]&&(!te||ne[1]>te[0]&&ne[1]<te[3])){re.label=ne[1];break}if(6===ne[0]&&re.label<te[1]){re.label=te[1],te=ne;break}if(te&&re.label<te[2]){re.label=te[2],re.ops.push(ne);break}te[2]&&re.ops.pop(),re.trys.pop();continue}ne=K.call(j,re)}catch(j){ne=[6,j],ee=0}finally{$=te=0}if(5&ne[0])throw ne[1];return{value:ne[0]?ne[1]:void 0,done:!0}}([ne,oe])}}};K.__esModule=!0,K.CometChat=void 0;var re=$(28),oe=$(0),ie=$(2),ae=$(6),se=$(4),le=$(14),ce=$(17),ue=$(7),de=$(16),pe=$(10),ge=$(11),he=$(1),me=$(8),fe=$(15),ye=$(30),be=$(23),ve=$(21),Me=$(31),Ee=$(13),Se=$(20),Ce=$(40),_e=$(41),Te=$(42),Ae=$(43),Ie=$(45),Ne=$(46),Oe=$(25),we=$(26),De=$(36),xe=$(19),je=$(34),Le=$(48),ke=$(49),Pe=$(50),Re=$(35),ze=$(24),Ue=$(18),Ge=$(51),Be=$(52),Ze=$(53),Ye=$(37),He=$(5),We=$(62),Ve=$(29),Fe=$(32),Qe=$(27),Ke=$(63),Je=Ze.WSConnectionHelper.getInstance(),Xe=Ye.ListenerHandlers.getInstance(),qe=function(){function G(j){try{G.appId=j,G.localStorage=le.LocalStorage.getInstance(),G.keyStore=ye.KeyStore.getInstance()}catch(j){oe.Logger.error("CometChat: constructor",j)}}return G.setAuthToken=function(j){try{G.authToken=j}catch(j){oe.Logger.error("CometChat: setAuthToken",j)}},G.prototype.getAuthToken=function(){try{return G.authToken}catch(j){oe.Logger.error("CometChat: getAuthToken",j)}},G.getAppId=function(){try{return G.appId}catch(j){oe.Logger.error("CometChat: getAppId",j)}},G.prototype.getApiKey=function(){try{return G.apiKey}catch(j){oe.Logger.error("CometChat: getApiKey",j)}},G.getMode=function(){try{return G.mode}catch(j){oe.Logger.error("CometChat: getMode",j)}},G.setMode=function(j){try{G.mode=j}catch(j){oe.Logger.error("CometChat: getMode",j)}},G.getSessionId=function(){try{return G.sessionId}catch(j){oe.Logger.error("CometChat: getSessionId",j)}},G.onStorageEvent=function(j){if(document&&!document.hasFocus()){var K=G.appId+":common_store/user";j.key===K&&null===j.newValue&&(G.authToken=void 0,G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer(),Je.WSLogout(),G.pushToLoginListener("","Logout_Success")),j.key===K&&null===j.oldValue&&le.LocalStorage.getInstance().get("user").then((function(j){j&&(G.user=new se.Me(j),G.setAuthToken(G.user.getAuthToken()),j.jwt&&(G.jwt=j.jwt),le.LocalStorage.getInstance().get("app_settings").then((function(j){if(j){if(j.hasOwnProperty(he.APP_SETTINGS.KEYS.APP_VERSION)){var K=parseInt(he.APPINFO.sdkVersion.charAt(1));j[he.APP_SETTINGS.KEYS.APP_VERSION]<K&&(G.appSettings.shouldAutoEstablishSocketConnection()||(G.shouldConnectToWS=!1),G.getInstance().internalRestart(G.user.getAuthToken()))}else G.appSettings.shouldAutoEstablishSocketConnection()||(G.shouldConnectToWS=!1),G.getInstance().internalRestart(G.user.getAuthToken());if(j[he.APP_SETTINGS.KEYS.MODE]&&(G.mode=j[he.APP_SETTINGS.KEYS.MODE]),j[he.APP_SETTINGS.KEYS.SETTINGS_HASH]&&(G.settingsHash=j[he.APP_SETTINGS.KEYS.SETTINGS_HASH]),j[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]&&(G.settingsHashReceivedAt=j[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]),G.isAnalyticsDisabled=!!j[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED],G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.getConnectionStatus()!==he.CONNECTION_STATUS.CONNECTED){var $=new se.User(G.user);G.pushToLoginListener($,"Login_Success"),G.appSettings.shouldAutoEstablishSocketConnection()&&G.WSLogin(G.user)}}})))}))}},G.beforeUnload=function(j){var K=G.getDataFromSessionStorage(he.SESSION_STORE.SESSION_ID);G.removeDataFromSessionStorage(he.SESSION_STORE.SESSION_ID),le.LocalStorage.getInstance().set(he.SESSION_STORE.SESSION_ID,K)},G.didAnalyticsPingStart=function(){try{return G.isAnalyticsPingStarted}catch(j){oe.Logger.error("CometChat: didAnalyticsPingStart",j)}},G.getDataFromSessionStorage=function(j){if(window.sessionStorage)return window.sessionStorage.getItem(j)},G.addDataToSessionStorage=function(j,K){window.sessionStorage&&window.sessionStorage.setItem(j,K)},G.removeDataFromSessionStorage=function(j){window.sessionStorage&&window.sessionStorage.removeItem(j)},G.init=function(j,K){var $=this;return void 0===j&&(j=""),new Promise((function(ee,te){try{"object"==typeof j&&(j.hasOwnProperty("appId")&&(j=j.appId),j.hasOwnProperty("appSettings")&&(K=j.appSettings)),oe.isFalsy(K)?K=(new ke.AppSettingsBuilder).setRegion(ke.AppSettings.REGION_EU).build():K.getRegion()==ke.AppSettings.REGION_PRIVATE&&(K.region=j),$.appSettings=K,oe.isFalsy(j)?te(new ie.CometChatException(Ee.INIT_ERROR.NO_APP_ID)):(window.addEventListener&&(window.addEventListener("storage",G.onStorageEvent,!1),window.addEventListener("beforeunload",G.beforeUnload,!1)),$.initialzed=!0,G.appId=j,G.getInstance(j),le.LocalStorage.getInstance().get(he.SESSION_STORE.SESSION_ID).then((function(K){null==K||null==K?(G.sessionId=he.APPINFO.platform+"-"+he.APPINFO.sdkVersionWithUnderScore+"-"+Ke()+"-"+(new Date).getTime(),G.addDataToSessionStorage(he.SESSION_STORE.SESSION_ID,G.getSessionId()),le.LocalStorage.getInstance().remove(he.SESSION_STORE.SESSION_ID)):(G.sessionId=K.toLocaleString(),le.LocalStorage.getInstance().remove(he.SESSION_STORE.SESSION_ID),G.addDataToSessionStorage(he.SESSION_STORE.SESSION_ID,G.getSessionId())),le.LocalStorage.getInstance().get(he.LOCAL_STORE.KEY_APP_ID).then((function(K){if(null==K||null==K)G.appId=j,G.getInstance(j),le.LocalStorage.getInstance().set(he.LOCAL_STORE.KEY_APP_ID,j),ee(!0);else{var te=K.toLocaleString();te===j?(G.appId=te,G.getInstance(te),le.LocalStorage.getInstance().get(he.LOCAL_STORE.KEY_USER).then((function(j){j?(G.isLoggedOut=!1,G.user=new se.Me(j),G.setAuthToken(G.user.getAuthToken()),j.jwt&&(G.jwt=j.jwt),ee(!0),le.LocalStorage.getInstance().get(he.LOCAL_STORE.KEY_APP_SETTINGS).then((function(j){if(j){if(j.hasOwnProperty(he.APP_SETTINGS.KEYS.APP_VERSION)){var K=parseInt(he.APPINFO.sdkVersion.charAt(1));j[he.APP_SETTINGS.KEYS.APP_VERSION]<K&&($.appSettings.shouldAutoEstablishSocketConnection()||(G.shouldConnectToWS=!1),G.getInstance().internalRestart(G.user.getAuthToken()))}else $.appSettings.shouldAutoEstablishSocketConnection()||(G.shouldConnectToWS=!1),G.getInstance().internalRestart(G.user.getAuthToken());j[he.APP_SETTINGS.KEYS.MODE]&&(G.mode=j[he.APP_SETTINGS.KEYS.MODE]),j[he.APP_SETTINGS.KEYS.SETTINGS_HASH]&&(G.settingsHash=j[he.APP_SETTINGS.KEYS.SETTINGS_HASH]),j[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]&&(G.settingsHashReceivedAt=j[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]),G.isAnalyticsDisabled=!!j[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED],G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!$.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),Je&&!Je.connection&&$.appSettings.shouldAutoEstablishSocketConnection()&&(G.isConnectingFromInit=!0,G.WSLogin(G.user))}}))):ee(!0)}))):$.clearCache().then((function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,Je.WSLogout(),G.appId=j,le.LocalStorage.getInstance().set(he.LOCAL_STORE.KEY_APP_ID,j),G.getInstance(j),ee(!0)}))}ye.KeyStore.getInstance().get(he.LOCAL_STORE.KEY_DEVICE_ID).then((function(K){if(null==K){var $=Ke(),ee=(new Date).getTime(),te=j+"_"+$+"_"+ee;ye.KeyStore.getInstance().set(he.LOCAL_STORE.KEY_DEVICE_ID,te)}}))}))})))}catch(j){te(new ie.CometChatException(j))}}))},G.isInitialized=function(){try{return this.initialzed}catch(j){oe.Logger.error("CometChat: isInitialized",j)}},G.getInstance=function(j){try{return this.cometChat||(this.cometChat=new G(j)),this.cometChat}catch(j){oe.Logger.error("CometChat: getInstance",j)}},G.registerTokenForPushNotification=function(j,K){var $=this;return new Promise((function(ee,te){try{G.keyStore.get(he.LOCAL_STORE.KEY_DEVICE_ID).then((function(ne){G.keyStore.get(he.LOCAL_STORE.KEY_APP_SETTINGS).then((function(re){var oe="",se=ne,le=he.APPINFO.platform,ce=he.APPINFO.sdkVersion,ue=re[he.APP_SETTINGS.KEYS.CHAT_API_VERSION];if(navigator&&(oe=navigator.userAgent),null==se){var de=Ke(),pe=(new Date).getTime();se=$.appId+"_"+de+"_"+pe,G.keyStore.set(he.LOCAL_STORE.KEY_DEVICE_ID,se)}var ge={platform:le,deviceId:se,appInfo:{version:ce,apiVersion:ue,userAgent:oe,pushNotification:{fcmDeviceToken:j,settings:K}}};ae.makeApiCall("updateMyDetails",{},ge,!1).then((function(j){ee("Token Registration successful")}),(function(j){te(new ie.CometChatException(j.error))})).catch((function(j){te(new ie.CometChatException(j))}))}))}))}catch(j){te(new ie.CometChatException(j))}}))},G.pushToLoginListener=function(j,K){Xe.loginHandlers.map((function($){try{if($._eventListener)switch(K){case"Login_Success":oe.isFalsy($._eventListener.loginSuccess)||$._eventListener.loginSuccess(j);break;case"Login_Failure":oe.isFalsy($._eventListener.loginFailure)||$._eventListener.loginFailure(j);break;case"Logout_Success":oe.isFalsy($._eventListener.logoutSuccess)||$._eventListener.logoutSuccess()}}catch($){oe.Logger.error("ConnectionHandlers: onConnected Status",$)}}))},G.login=function(){for(var j=this,K=[],$=0;$<arguments.length;$++)K[$]=arguments[$];return new Promise((function($,ee){try{if(G.loginInProgress){G.isLoggedOut=!0;var te=new ie.CometChatException(Ee.LOGIN_ERROR.REQUEST_IN_PROGRESS);return ee(te)}G.loginInProgress=!0,G.isConnectingFromInit=!1,G.localStorage.get(he.LOCAL_STORE.KEY_APP_ID).then((function(te){if(null==te||null==te){var ne=new ie.CometChatException(Ee.LOGIN_ERROR.NOT_INITIALIZED);return G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne)}var re=te.toLocaleString();if(j.getInstance(re),G.appId=re,le.LocalStorage.getInstance().set(he.LOCAL_STORE.KEY_APP_ID,re),"object"==typeof K[0]){var ae=K[0];K[0].hasOwnProperty("authToken")?K[0]=ae.authToken:K[0].hasOwnProperty("username")&&K[0].hasOwnProperty("apiKey")&&(K[0]=ae.username,K[1]=ae.apiKey)}if(2==K.length){if(oe.isFalsy(K[0])||oe.isFalsy(K[1]))return ne=new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING),G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne)}else{if(1!=K.length)return ne=new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING),G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne);if(oe.isFalsy(K[0]))return ne=new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING),G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne)}return oe.isFalsy(j.getAppId())?(ne=new ie.CometChatException(Ee.LOGIN_ERROR.NOT_INITIALIZED),G.internalRestart||G.pushToLoginListener(ne,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ne)):G.localStorage.get(he.LOCAL_STORE.KEY_USER).then((function(te){if(2==K.length){G.apiKey=K[1];var ne=K[0];if(null!=te&&te.uid!==K[0])G.localStorage.clearStore().then((function(){Je.WSLogout(),G.generateAuthToken(ne).then((function(j){G.user=new se.Me(j),G.setAuthToken(G.user.getAuthToken()),G.getLoggedInUser().then((function(j){(G.user=new se.Me(j)).setAuthToken(G.authToken),G.setAuthToken(G.user.getAuthToken());var K=G.user;K.setStatus(he.PresenceConstatnts.STATUS.ONLINE),G.localStorage.set("user",K);var ee=new se.User(K);$(ee),G.isConnectingFromInit||G.internalRestart||G.pushToLoginListener(ee,"Login_Success"),G.loginInProgress=!1,G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.isLoggedOut=!1,(G.appSettings.shouldAutoEstablishSocketConnection()||G.internalRestart)&&G.shouldConnectToWS&&G.WSLogin(G.user)}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}));else{if(!oe.isFalsy(G.authToken)){var re=new se.User(j.user);return G.internalRestart||G.pushToLoginListener(re,"Login_Success"),G.loginInProgress=!1,G.isLoggedOut=!1,$(re)}if(!oe.isFalsy(ne)){if(oe.isFalsy(G.apiKey)){var ae=new ie.CometChatException(Ee.LOGIN_ERROR.UNAUTHORISED);return G.internalRestart||G.pushToLoginListener(ae,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(ae)}j.generateAuthToken(ne).then((function(K){j.user=new se.Me(K),j.setAuthToken(G.user.getAuthToken()),j.getLoggedInUser().then((function(K){j.user=new se.Me(K),j.user.setAuthToken(G.authToken),j.setAuthToken(j.user.getAuthToken()),Je.WSLogout();var ee=j.user;ee.setStatus(he.PresenceConstatnts.STATUS.ONLINE),j.localStorage.set("user",ee);var te=new se.User(ee);$(te),G.isConnectingFromInit||G.internalRestart||G.pushToLoginListener(te,"Login_Success"),G.loginInProgress=!1,G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.isLoggedOut=!1,(G.appSettings.shouldAutoEstablishSocketConnection()||G.internalRestart)&&G.shouldConnectToWS&&j.WSLogin(j.user)}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}}}else G.authToken=K[0],j.getLoggedInUser().then((function(ne){if(ne.authToken!=K[0]){var re=j;re.localStorage.clearStore().then((function(){Je.WSLogout(),re.getLoggedInUser().then((function(j){(G.user=new se.Me(j)).setAuthToken(G.authToken),G.setAuthToken(G.user.getAuthToken());var K=G.user;K.setStatus(he.PresenceConstatnts.STATUS.ONLINE),re.localStorage.set("user",K);var ee=new se.User(K);$(ee),G.isConnectingFromInit||G.internalRestart||G.pushToLoginListener(ee,"Login_Success"),G.loginInProgress=!1,G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.isLoggedOut=!1,(G.appSettings.shouldAutoEstablishSocketConnection()||G.internalRestart)&&G.shouldConnectToWS&&G.WSLogin(new se.Me(j))}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}))}else{if(te){var oe=new se.User(ne);return G.internalRestart||G.pushToLoginListener(oe,"Login_Success"),G.loginInProgress=!1,G.isLoggedOut=!1,$(oe)}(G.user=new se.Me(ne)).setAuthToken(G.authToken),G.setAuthToken(G.user.getAuthToken());var ie=G.user;ie.setStatus(he.PresenceConstatnts.STATUS.ONLINE),G.localStorage.set("user",ie);var ae=new se.User(ie);$(ae),G.isConnectingFromInit||G.internalRestart||G.pushToLoginListener(ae,"Login_Success"),G.loginInProgress=!1,G.didAnalyticsPingStart()||G.isAnalyticsDisabled||!G.appSettings.shouldAutoEstablishSocketConnection()||(G.pingAnalytics(),G.startAnalyticsPingTimer()),G.isLoggedOut=!1,(G.appSettings.shouldAutoEstablishSocketConnection()||G.internalRestart)&&G.shouldConnectToWS&&G.WSLogin(new se.Me(ne))}}),(function(j){return G.internalRestart||G.pushToLoginListener(j,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(j)}))}))}))}catch(j){return te=new ie.CometChatException(j),G.internalRestart||G.pushToLoginListener(te,"Login_Failure"),G.loginInProgress=!1,G.isLoggedOut=!0,ee(te)}}))},G.sendMessage=function(j){var K=this;return new Promise((function($,ee){return te(K,void 0,void 0,(function(){var K,re,se,le=this;return ne(this,(function(ue){try{return j instanceof de.TextMessage||j instanceof ce.MediaMessage||j instanceof xe.CustomMessage||(j=j[he.MessageConstatnts.KEYS.ATTATCHMENT]?(K=he.MessageConstatnts.TYPE.FILE,oe.isImage(j[he.MessageConstatnts.KEYS.ATTATCHMENT])?K=he.MessageConstatnts.TYPE.IMAGE:oe.isAudio(j[he.MessageConstatnts.KEYS.ATTATCHMENT])?K=he.MessageConstatnts.TYPE.AUDIO:oe.isVideo(j[he.MessageConstatnts.KEYS.ATTATCHMENT])&&(K=he.MessageConstatnts.TYPE.VIDEO),new ce.MediaMessage(j[he.MessageConstatnts.KEYS.RECEIVER_ID],j[he.MessageConstatnts.KEYS.ATTATCHMENT],K,j[he.MessageConstatnts.KEYS.RECEIVER_TYPE])):new de.TextMessage(j[he.MessageConstatnts.KEYS.RECEIVER_ID],j[he.MessageConstatnts.KEYS.TEXT],j[he.MessageConstatnts.KEYS.RECEIVER_TYPE])),(re=oe.validateMessage(j))instanceof ie.CometChatException?(ee(re),[2]):(j.receiver=j.receiverId,delete j.receiverId,se=j.parentMessageId,[2,ae.makeApiCall(se?"sendMessageInThread":"sendMessage",se?{parentId:se}:{},j,j instanceof ce.MediaMessage).then((function(j){return te(le,void 0,void 0,(function(){var K;return ne(this,(function(ee){return K=pe.MessageController.trasformJSONMessge(j.data),Oe.MessageListnerMaping.getInstance().set("all",parseInt(K.id)),$(K),[2]}))}))}),(function(j){ee(new ie.CometChatException(j.error))}))])}catch(ue){ee(new ie.CometChatException(ue))}return[2]}))}))}))},G.sendDirectMessage=function(j){try{return Object.assign(j,{receiverType:he.MessageConstatnts.RECEIVER_TYPE.USER}),this.sendMessage(j)}catch(j){oe.Logger.error("CometChat: sendDirectMessage",j)}},G.sendGroupMessage=function(j){try{return Object.assign(j,{receiverType:he.MessageConstatnts.RECEIVER_TYPE.GROUP}),this.sendMessage(j)}catch(j){oe.Logger.error("CometChat: sendGroupMessage",j)}},G.sendMediaMessage=function(j){try{return this.sendMessage(j)}catch(j){oe.Logger.error("CometChat: sendMediaMessage",j)}},G.sendCustomMessage=function(j){try{return this.sendMessage(j)}catch(j){oe.Logger.error("CometChat: sendCustomMessage",j)}},G.getLastDeliveredMessageId=function(){return te(this,void 0,void 0,(function(){var j;return ne(this,(function(K){switch(K.label){case 0:return K.trys.push([0,2,,3]),[4,Oe.MessageListnerMaping.getInstance().get(he.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST)];case 1:return[2,K.sent()];case 2:return j=K.sent(),oe.Logger.error("CometChat: getLastDeliveredMessageId",j),[3,3];case 3:return[2]}}))}))},G.startTyping=function(j){try{if(oe.isFalsy(j))return;var K=void 0,$=this.RECEIVER_TYPE.USER,ee={};if(j instanceof we.TypingIndicator)K=j.getReceiverId(),$=j.getReceiverType(),ee=j.getMetadata();else{if(!j.hasOwnProperty(he.TYPING_NOTIFICATION.RECEIVER_ID))return;K=j[he.TYPING_NOTIFICATION.RECEIVER_ID],j.hasOwnProperty(he.TYPING_NOTIFICATION.RECEIVER_TYPE)&&($=j[he.TYPING_NOTIFICATION.RECEIVER_TYPE]),j.hasOwnProperty(he.TYPING_NOTIFICATION.META)&&(ee=j[he.TYPING_NOTIFICATION.META])}if(oe.isFalsy(K))return;if(null==De.TypingNotificationController.getTypingStartedMap(K)){var te=G.getMode();return oe.isFalsy(te)||te&&te!==he.APP_SETTINGS.KEYS.NO_TRANSIENT&&te!==he.APP_SETTINGS.KEYS.LIMITED_TRANSIENT?(Je.startTypingIndicator(K,$,ee),De.TypingNotificationController.addTypingStarted(K),void De.TypingNotificationController.removeTypingEnded(K)):void 0}}catch(j){oe.Logger.error("CometChat: startTyping",j)}},G.endTyping=function(j){try{if(oe.isFalsy(j))return;var K=void 0,$=this.RECEIVER_TYPE.USER,ee={};if(j instanceof we.TypingIndicator)K=j.getReceiverId(),$=j.getReceiverType(),ee=j.getMetadata();else{if(!j.hasOwnProperty(he.TYPING_NOTIFICATION.RECEIVER_ID))return;K=j[he.TYPING_NOTIFICATION.RECEIVER_ID],j.hasOwnProperty(he.TYPING_NOTIFICATION.RECEIVER_TYPE)&&($=j[he.TYPING_NOTIFICATION.RECEIVER_TYPE]),$=$==this.RECEIVER_TYPE.USER?he.WS.CONVERSATION.TYPE.CHAT:he.WS.CONVERSATION.TYPE.GROUP_CHAT,j.hasOwnProperty(he.TYPING_NOTIFICATION.META)&&(ee=j[he.TYPING_NOTIFICATION.META])}if(oe.isFalsy(K))return;if(null==De.TypingNotificationController.getTypingEndedMap(K)){var te=G.getMode();return oe.isFalsy(te)||te&&te!==he.APP_SETTINGS.KEYS.NO_TRANSIENT&&te!==he.APP_SETTINGS.KEYS.LIMITED_TRANSIENT?(Je.pauseTypingIndicator(K,$,ee),De.TypingNotificationController.addTypingEnded(K),void De.TypingNotificationController.removeTypingStarted(K)):void 0}}catch(j){oe.Logger.error("CometChat: endTyping",j)}},G.markAsRead=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];return new Promise((function(K,$){try{var ee=void 0,te=void 0,ne=void 0,re=void 0;if(3===j.length)return $(new ie.CometChatException(he.ReceiptErrors.MISSING_PARAMETERS));if(4===j.length){if(oe.isFalsy(j[0])||"string"!=typeof j[0])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"MESSAGE_ID","MESSAGE_ID","Message ID should be a string."))));if(ee=j[0],oe.isFalsy(j[1])||"string"!=typeof j[1])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"RECEIVER_ID","RECEIVER_ID","Receiver ID should be a string."))));if(te=j[1],oe.isFalsy(j[2])||"string"!=typeof j[2])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver type should be a string."))));if(ne=j[2],oe.isFalsy(j[3])||"string"!=typeof j[3])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"SENDER_ID","SENDER_ID","Sender ID should be a string."))));re=j[3]}else{if(1!==j.length)return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"ARGUMENTS","ARGUMENTS","markAsRead() expects either 1 or 4 arguments."))));if(oe.isFalsy(j[0])||!(j[0]instanceof ue.BaseMessage))return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"MESSAGE","MESSAGE","Invalid message object received."))));var ae=j[0];ee=ae.getId().toString(),te=(ne=ae.getReceiverType())===he.MessageConstatnts.RECEIVER_TYPE.USER?ae.getSender().getUid()===G.user.getUid()?ae.getReceiverId():ae.getSender().getUid():ae.getReceiverId(),re=ae.getSender().getUid()}var se=G.getMode();return oe.isFalsy(se)||se&&se!==he.APP_SETTINGS.KEYS.NO_TRANSIENT&&se!==he.APP_SETTINGS.KEYS.LIMITED_TRANSIENT?G.getConnectionStatus()===he.CONNECTION_STATUS.CONNECTED?(Je.markAsRead(te,ne,ee,re),K()):$(new ie.CometChatException(he.ReceiptErrors.NO_WEBSOCKET_CONNECTION)):$(new ie.CometChatException(he.ReceiptErrors.RECEIPTS_TEMPORARILY_BLOCKED))}catch(K){return oe.Logger.error("CometChat: markAsRead",K),$(new ie.CometChatException(he.ReceiptErrors.UNKNOWN_ERROR_OCCURRED))}}))},G.markAsDelivered=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];return new Promise((function(K,$){try{var ee=void 0,te=void 0,ne=void 0,re=void 0;if(3===j.length)return $(new ie.CometChatException(he.ReceiptErrors.MISSING_PARAMETERS));if(4===j.length){if(oe.isFalsy(j[0])||"string"!=typeof j[0])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"MESSAGE_ID","MESSAGE_ID","Message ID should be a string."))));if(ee=j[0],oe.isFalsy(j[1])||"string"!=typeof j[1])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"RECEIVER_ID","RECEIVER_ID","Receiver ID should be a string."))));if(te=j[1],oe.isFalsy(j[2])||"string"!=typeof j[2])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"RECEIVER_TYPE","RECEIVER_TYPE","Receiver type should be a string."))));if(ne=j[2],oe.isFalsy(j[3])||"string"!=typeof j[3])return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"SENDER_ID","SENDER_ID","Sender ID should be a string."))));re=j[3]}else{if(1!==j.length)return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"ARGUMENTS","ARGUMENTS","markAsDelivered() expects either 1 or 4 arguments."))));if(oe.isFalsy(j[0])||!(j[0]instanceof ue.BaseMessage))return $(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ReceiptErrors.INVALID_PARAMETER),"MESSAGE","MESSAGE","Invalid message object received."))));var ae=j[0];ee=ae.getId().toString(),te=(ne=ae.getReceiverType())===he.MessageConstatnts.RECEIVER_TYPE.USER?ae.getSender().getUid()===G.user.getUid()?ae.getReceiverId():ae.getSender().getUid():ae.getReceiverId(),re=ae.getSender().getUid()}var se=G.getMode();return oe.isFalsy(se)||se&&se!==he.APP_SETTINGS.KEYS.NO_TRANSIENT&&se!==he.APP_SETTINGS.KEYS.LIMITED_TRANSIENT?G.getConnectionStatus()===he.CONNECTION_STATUS.CONNECTED?(Je.markAsDelivered(te,ne,ee,re),K()):$(new ie.CometChatException(he.ReceiptErrors.NO_WEBSOCKET_CONNECTION)):$(new ie.CometChatException(he.ReceiptErrors.RECEIPTS_TEMPORARILY_BLOCKED))}catch(K){return oe.Logger.error("CometChat: markAsDelivered",K),$(new ie.CometChatException(he.ReceiptErrors.UNKNOWN_ERROR_OCCURRED))}}))},G.sendTransientMessage=function(j){try{if(oe.isFalsy(j))return;var K=void 0,$=void 0,ee={};if(!(j instanceof Qe.TransientMessage))return;if(K=j.getReceiverId(),$=j.getReceiverType(),ee=j.getData(),oe.isFalsy(K)||oe.isFalsy($))return;var te=G.getMode();return oe.isFalsy(te)||te&&te!==he.APP_SETTINGS.KEYS.NO_TRANSIENT?void Je.sendTransientMessage(K,$,ee):void 0}catch(j){oe.Logger.error("CometChat: sendTransientMessage",j)}},G.sendTestMessage=function(j){return te(this,void 0,void 0,(function(){var K,$;return ne(this,(function(ee){switch(ee.label){case 0:return ee.trys.push([0,3,,4]),(K=j)instanceof ue.BaseMessage?[3,2]:[4,Pe.CometChatHelper.processMessage(j)];case 1:K=ee.sent(),ee.label=2;case 2:return K instanceof de.TextMessage&&Ze.WSConnectionHelper.getInstance().publishMessage(K),[3,4];case 3:return $=ee.sent(),oe.Logger.error("CometChat: sendTestMessage",$),[3,4];case 4:return[2]}}))}))},G.getMessageDetails=function(j){return new Promise((function(K,$){try{oe.isFalsy(j)?$(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING)):ae.makeApiCall("getMessageDetails",{messageId:j}).then((function(j){K(pe.MessageController.trasformJSONMessge(j.data))}),(function(j){oe.Logger.error("CometChat:GetMessageDetails:",j),$(new ie.CometChatException(j.error))}))}catch(j){$(new ie.CometChatException(j))}}))},G.getMessageReceipts=function(j){return new Promise((function(K,$){try{var ee=oe.validateMsgId(j);if(ee instanceof ie.CometChatException)return void $(ee);oe.isFalsy(j)?$(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING)):ae.makeApiCall("getMessageDetails",{messageId:j}).then((function(j){pe.MessageController.getReceiptsFromJSON(j.data).then((function(j){K(j)}),(function(j){$(new ie.CometChatException(j))}))}),(function(j){oe.Logger.error("CometChat:GetMessageDetails:",j),$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getUnreadMessageCount=function(j){void 0===j&&(j=!1);var K=0;return new Promise((function($,ee){try{var te=oe.validateHideMessagesFromBlockedUsers(j);if(te instanceof ie.CometChatException)return void ee(te);j&&(K=1),ae.makeApiCall("getMessages",{},{unread:1,count:1,hideMessagesFromBlockedUsers:K}).then((function(j){var K={},ee={};j.data.map((function(j){j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_TYPE]==he.MessageConstatnts.RECEIVER_TYPE.GROUP?ee[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT]:K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT]})),$({users:K,groups:ee})}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.getUnreadMessageCountForAllUsers=function(j){void 0===j&&(j=!1);var K=0;return new Promise((function($,te){try{var ne=oe.validateHideMessagesFromBlockedUsers(j);if(ne instanceof ie.CometChatException)return void te(ne);j&&(K=1),ae.makeApiCall("getMessages",{},{hideMessagesFromBlockedUsers:K,receiverType:he.MessageConstatnts.RECEIVER_TYPE.USER,unread:1,count:1}).then((function(j){var K={};j.data.map((function(j){K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT]})),$(ee({},K))}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.getUnreadMessageCountForAllGroups=function(j){void 0===j&&(j=!1);var K=0;return new Promise((function($,te){try{var ne=oe.validateHideMessagesFromBlockedUsers(j);if(ne instanceof ie.CometChatException)return void te(ne);j&&(K=1),ae.makeApiCall("getMessages",{},{hideMessagesFromBlockedUsers:K,receiverType:he.MessageConstatnts.RECEIVER_TYPE.GROUP,unread:1,count:1}).then((function(j){var K={};j.data.map((function(j){j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_TYPE]==he.MessageConstatnts.RECEIVER_TYPE.GROUP&&(K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT])})),$(ee({},K))}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.getUnreadMessageCountForUser=function(j,K){void 0===K&&(K=!1);var $=0;return new Promise((function(te,ne){try{var re=oe.validateId(j,"user");if(re instanceof ie.CometChatException)return void ne(re);var se=oe.validateHideMessagesFromBlockedUsers(K);if(se instanceof ie.CometChatException)return void ne(se);K&&($=1),ae.makeApiCall("getUserMessages",{listId:j},{hideMessagesFromBlockedUsers:$,unread:1,count:1,uid:j}).then((function(j){var K={};j.data.map((function(j){K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT]})),te(ee({},K))}),(function(j){ne(new ie.CometChatException(j.error))}))}catch(re){ne(new ie.CometChatException(re))}}))},G.getUnreadMessageCountForGroup=function(j,K){void 0===K&&(K=!1);var $=0;return new Promise((function(te,ne){try{var re=oe.validateId(j,"group");if(re instanceof ie.CometChatException)return void ne(re);var se=oe.validateHideMessagesFromBlockedUsers(K);if(se instanceof ie.CometChatException)return void ne(se);K&&($=1),ae.makeApiCall("getGroupMessages",{listId:j},{hideMessagesFromBlockedUsers:$,unread:1,count:1,guid:j}).then((function(j){var K={};j.data.map((function(j){j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_TYPE]==he.MessageConstatnts.RECEIVER_TYPE.GROUP&&(K[j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.ENTITY_Id]]=j[he.ResponseConstants.RESPONSE_KEYS.UNREAD_UNDELIVERED_KEYS.COUNT])})),te(ee({},K))}),(function(j){ne(new ie.CometChatException(j.error))}))}catch(re){ne(new ie.CometChatException(re))}}))},G.editMessage=function(j){return new Promise((function(K,$){try{var ee=oe.validateMsgId(j.getId());if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("updateMessage",{messageId:j.getId()},j).then((function(j){K(pe.MessageController.trasformJSONMessge(j.data).getActionOn())}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.deleteMessage=function(j){return new Promise((function(K,$){try{var ee=oe.validateMsgId(j);if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("deleteMessage",{messageId:j},{id:j}).then((function(j){K(pe.MessageController.trasformJSONMessge(j.data).getActionOn())}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getOnlineUserCount=function(){return new Promise((function(j,K){try{oe.getAppSettings().then((function($){var ee=oe.format((new re.EndpointFactory).wsApi,oe.getChatHost($),oe.format(he.ONLINE_MEMBER_COUNT_API.ENDPOINTS.GET_ONLINE_MEMBER_COUNT,$[he.APP_SETTINGS.KEYS.WS_API_VERSION])),te={appId:G.appId,Authorization:G.jwt,Accept:"application/json","Content-Type":"application/json"};ae.postData(ee,"POST",{},te,!1).then((function(j){return j.json()})).then((function($){return $.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA)?j($[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA][he.ONLINE_MEMBER_COUNT_API.RESPONSE.ONLINE_USERS_COUNT]):K(new ie.CometChatException($.error))})).catch((function(){var j={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};return K(j)}))}),(function(j){return K(new ie.CometChatException(j))}))}catch(j){return K(new ie.CometChatException(j))}}))},G.getOnlineGroupMemberCount=function(j){return new Promise((function(K,$){try{if(!j||0==j.length)return $(new ie.CometChatException(he.ONLINE_MEMBER_COUNT_API.ERRORS.INVALID_GROUPLIST));oe.getAppSettings().then((function(ee){var te=oe.format((new re.EndpointFactory).wsApi,oe.getChatHost(ee),oe.format(he.ONLINE_MEMBER_COUNT_API.ENDPOINTS.GET_ONLINE_MEMBER_COUNT,ee[he.APP_SETTINGS.KEYS.WS_API_VERSION])),ne={groups:j},se={appId:G.appId,Authorization:G.jwt,Accept:"application/json","Content-Type":"application/json"};ae.postData(te,"POST",ne,se,!1).then((function(j){return j.json()})).then((function(j){return j.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA)?K(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA][he.ONLINE_MEMBER_COUNT_API.RESPONSE.GROUPS]):$(new ie.CometChatException(j.error))})).catch((function(){var j={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};return $(j)}))}),(function(j){return $(new ie.CometChatException(j))}))}catch(j){return $(new ie.CometChatException(j))}}))},G.createUser=function(j,K){return new Promise((function($,ee){try{if(oe.isFalsy(K))return void ee(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.GENERAL_ERROR.INVALID),"AUTH_KEY","AUTH_KEY","AUTH_KEY","AUTH_KEY"))));G.apiKey=K;var te=oe.validateCreateUser(j);if(te instanceof ie.CometChatException)return void ee(te);if(!(j instanceof se.User)){var ne=void 0;if(!j.hasOwnProperty(he.UserConstants.UID))return void ee(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));if(!j.hasOwnProperty(he.UserConstants.NAME))return void ee(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));ne=new se.User(j[he.UserConstants.UID],j[he.UserConstants.NAME]),j.hasOwnProperty(he.UserConstants.AVATAR)&&ne.setAvatar(j[he.UserConstants.AVATAR]),j.hasOwnProperty(he.UserConstants.ROLE)&&ne.setRole(j[he.UserConstants.ROLE]),j.hasOwnProperty(he.UserConstants.META_DATA)&&ne.setMetadata(j[he.UserConstants.META_DATA]),j.hasOwnProperty(he.UserConstants.LINK)&&ne.setLink(j[he.UserConstants.LINK]),j.hasOwnProperty(he.UserConstants.STATUS_MESSAGE)&&ne.setStatusMessage(j[he.UserConstants.STATUS_MESSAGE]),j.hasOwnProperty(he.UserConstants.TAGS)&&ne.setTags(j[he.UserConstants.TAGS]),j=ne}ae.makeApiCall("createUser",{},j).then((function(j){var K=ge.UsersController.trasformJSONUser(j.data);$(K)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.updateUser=function(j,K){var $=this;return new Promise((function(ee,te){try{if(oe.isFalsy(K))return void te(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.GENERAL_ERROR.INVALID),"AUTH_KEY","AUTH_KEY","AUTH_KEY","AUTH_KEY"))));G.apiKey=K;var ne=oe.validateUpdateUser(j);if(ne instanceof ie.CometChatException)return void te(ne);if(!(j instanceof se.User)){var re=void 0;if(!j.hasOwnProperty(he.UserConstants.UID))return void te(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));re=new se.User(j[he.UserConstants.UID]),j.hasOwnProperty(he.UserConstants.NAME)&&re.setName(j[he.UserConstants.NAME]),j.hasOwnProperty(he.UserConstants.AVATAR)&&re.setAvatar(j[he.UserConstants.AVATAR]),j.hasOwnProperty(he.UserConstants.ROLE)&&re.setRole(j[he.UserConstants.ROLE]),j.hasOwnProperty(he.UserConstants.META_DATA)&&re.setMetadata(j[he.UserConstants.META_DATA]),j.hasOwnProperty(he.UserConstants.LINK)&&re.setLink(j[he.UserConstants.LINK]),j.hasOwnProperty(he.UserConstants.STATUS_MESSAGE)&&re.setStatusMessage(j[he.UserConstants.STATUS_MESSAGE]),j.hasOwnProperty(he.UserConstants.TAGS)&&re.setTags(j[he.UserConstants.TAGS]),j=re}var ce=j.uid;ae.makeApiCall("updateUser",{uid:ce},j).then((function(j){if($.user&&ce.toLocaleLowerCase()===$.user.getUid().toLocaleLowerCase())le.LocalStorage.getInstance().get("user").then((function(K){if(K){var te=ge.UsersController.trasformJSONUser(j.data),ne=j.data;ne.wsChannel=K.wsChannel,ne.authToken=G.authToken,ne.status=he.PresenceConstatnts.STATUS.ONLINE,K.jwt&&(ne.jwt=K.jwt),G.user=new se.Me(ne),$.localStorage.set("user",G.user),ee(te)}}));else{var K=ge.UsersController.trasformJSONUser(j.data);ee(K)}}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.updateCurrentUserDetails=function(j){var K=this;return new Promise((function($,ee){try{j.uid=K.user.uid;var te=oe.validateUpdateUser(j);if(te instanceof ie.CometChatException)return void ee(te);if(!(j instanceof se.User)){var ne=void 0;j.hasOwnProperty(he.UserConstants.UID)&&(ne=new se.User(j[he.UserConstants.UID])),j.hasOwnProperty(he.UserConstants.NAME)&&ne.setName(j[he.UserConstants.NAME]),j.hasOwnProperty(he.UserConstants.AVATAR)&&ne.setAvatar(j[he.UserConstants.AVATAR]),j.hasOwnProperty(he.UserConstants.ROLE)&&ne.setRole(j[he.UserConstants.ROLE]),j.hasOwnProperty(he.UserConstants.META_DATA)&&ne.setMetadata(j[he.UserConstants.META_DATA]),j.hasOwnProperty(he.UserConstants.LINK)&&ne.setLink(j[he.UserConstants.LINK]),j.hasOwnProperty(he.UserConstants.STATUS_MESSAGE)&&ne.setStatusMessage(j[he.UserConstants.STATUS_MESSAGE]),j.hasOwnProperty(he.UserConstants.TAGS)&&ne.setTags(j[he.UserConstants.TAGS]),j=ne}ae.makeApiCall("updateMyDetails",{},j).then((function(j){var K=ge.UsersController.trasformJSONUser(j.data),ee=G.user=new se.Me(j.data);ee.setStatus(he.PresenceConstatnts.STATUS.ONLINE),G.localStorage.set("user",ee),$(K)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.getUser=function(j){return new Promise((function(K,$){try{"object"==typeof j&&j.hasOwnProperty("uid")&&(j=j.uid);var ee=oe.validateId(j,"user");if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("user",{uid:j}).then((function(j){var $=ge.UsersController.trasformJSONUser(j.data);K($)})).catch((function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getLoggedInUser=function(){var j=this;return new Promise((function(K,$){try{G.localStorage.get(he.LOCAL_STORE.KEY_USER).then((function(ee){if(ee)K(G.user=new se.Me(ee));else{var te="",ne="",re=he.APPINFO.platform,ce=he.APPINFO.sdkVersion,ue=he.APPINFO.apiVersion;G.keyStore.get(he.LOCAL_STORE.KEY_DEVICE_ID).then((function(ee){if(ne=ee,navigator&&(te=navigator.userAgent),null==ne){var de=Ke(),pe=(new Date).getTime();ne=j.appId+"_"+de+"_"+pe,G.keyStore.set(he.LOCAL_STORE.KEY_DEVICE_ID,ne)}var ge={version:ce,apiVersion:ue,userAgent:te};oe.isFalsy(j.platform)||(ge.platform=j.platform),oe.isFalsy(j.language)||(ge.language=j.language),oe.isFalsy(j.resource)||(ge.resource=j.resource);var me={platform:re,deviceId:ne,appInfo:ge};ae.makeApiCall("updateMyDetails",{},me,!1).then((function(j){j.data.jwt&&(G.jwt=j.data.jwt);var $=j.data.settings;$&&(le.LocalStorage.getInstance().set("app_settings",$),$[he.APP_SETTINGS.KEYS.MODE]&&G.setMode($[he.APP_SETTINGS.KEYS.MODE]),$[he.APP_SETTINGS.KEYS.SETTINGS_HASH]&&(G.settingsHash=$[he.APP_SETTINGS.KEYS.SETTINGS_HASH]),$[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]&&(G.settingsHashReceivedAt=$[he.APP_SETTINGS.KEYS.SETTINGS_HASH_RECEIVED_AT]),G.isAnalyticsDisabled=!!$[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED]),K(new se.Me(j.data))}),(function(j){$(new ie.CometChatException(j.error))})).catch((function(j){$(new ie.CometChatException(j))}))}))}}))}catch(j){$(new ie.CometChatException(j))}}))},G.getLoggedinUser=function(){return new Promise((function(j,K){try{G.localStorage.get(he.LOCAL_STORE.KEY_USER).then((function(K){j(K?new se.User(K):null)}),(function(K){j(null)}))}catch(j){K(new ie.CometChatException(j))}}))},G.blockUsers=function(j){return new Promise((function(K,$){try{var ee=oe.validateArray(j,"blockUsers");if(ee instanceof ie.CometChatException)return void $(ee);oe.isFalsy(j)?$(new ie.CometChatException(Ee.USERS_REQUEST_ERRORS.EMPTY_USERS_LIST)):ae.makeApiCall("blockUsers",{},{blockedUids:j}).then((function(j){K(j.data)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.unblockUsers=function(j){return new Promise((function(K,$){try{var ee=oe.validateArray(j,"unblockUsers");if(ee instanceof ie.CometChatException)return void $(ee);oe.isFalsy(j)?$(new ie.CometChatException(Ee.USERS_REQUEST_ERRORS.EMPTY_USERS_LIST)):ae.makeApiCall("unblockUsers",{},{blockedUids:j}).then((function(j){K(j.data)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getConversation=function(j,K){return new Promise((function($,ee){try{var te=oe.validateConversationType(K);if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(j,K);if(ne instanceof ie.CometChatException)return void ee(ne);K=K.toLowerCase(),j=j.toLowerCase();var re={},se="";K===he.MessageConstatnts.RECEIVER_TYPE.GROUP?(se="getGroupConversation",re.guid=j):(se="getUserConversation",re.uid=j),ae.makeApiCall(se,re).then((function(te){if(te.data){var ne=te.data;$(ze.ConversationController.trasformJSONConversation(ne.conversationId,ne.conversationType,ne.lastMessage,ne.conversationWith,parseInt(ne.unreadMessageCount),ne.tags?ne.tags:[]))}else ee(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ConversationErrors.CONVERSATION_NOT_FOUND),K,j))))}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.tagConversation=function(j,K,$){return void 0===$&&($=[]),new Promise((function(ee,te){try{var ne=oe.validateConversationType(K);if(ne instanceof ie.CometChatException)return void te(ne);var re=oe.validateId(j,K);if(re instanceof ie.CometChatException)return void te(re);K=K.toLowerCase(),j=j.toLowerCase();var se={},le="";K===he.MessageConstatnts.RECEIVER_TYPE.GROUP?(le="updateGroupConversation",se.guid=j):(le="updateUserConversation",se.uid=j),ae.makeApiCall(le,se,{tags:$}).then((function($){if($.data){var ne=$.data;ee(ze.ConversationController.trasformJSONConversation(ne.conversationId,ne.conversationType,ne.lastMessage,ne.conversationWith,parseInt(ne.unreadMessageCount),ne.tags?ne.tags:[]))}else te(new ie.CometChatException(JSON.parse(oe.format(JSON.stringify(he.ConversationErrors.CONVERSATION_NOT_FOUND),K,j))))}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.deleteConversation=function(j,K){return new Promise((function($,ee){try{var te=oe.validateConversationType(K);if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(j,K);if(ne instanceof ie.CometChatException)return void ee(ne);var re={},se="";K=K.toLowerCase(),j=j.toLowerCase(),K===he.MessageConstatnts.RECEIVER_TYPE.GROUP?(se="deleteGroupConversation",re.guid=j):(se="deleteUserConversation",re.uid=j),ae.makeApiCall(se,re).then((function(j){$("Conversation deleted successfully.")}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.createGroup=function(j){return new Promise((function(K,$){try{var ee=oe.validateCreateGroup(j);if(ee instanceof ie.CometChatException)return void $(ee);if(!(j instanceof me.Group)){var te=void 0;if(!j.hasOwnProperty(he.GroupConstants.KEYS.GUID))return void $(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));if(!j.hasOwnProperty(he.GroupConstants.KEYS.NAME))return void $(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));if(te=new me.Group(j[he.GroupConstants.KEYS.GUID],j[he.GroupConstants.KEYS.NAME],""),j.hasOwnProperty(he.GroupConstants.KEYS.TYPE))if(j[he.GroupConstants.KEYS.TYPE].toLocaleLowerCase()==he.GroupType.Password){if(!j.hasOwnProperty(he.GroupConstants.KEYS.PASSWORD))return void $(new ie.CometChatException(Ee.GROUP_CREATION_ERRORS.EMPTY_PASSWORD));te.setType(he.GROUP_TYPE.PASSWORD),te.setPassword(j[he.GroupConstants.KEYS.PASSWORD])}else te.setType(j[he.GroupConstants.KEYS.TYPE]);else te.setType(he.GROUP_TYPE.PUBLIC);j.hasOwnProperty(he.GroupConstants.KEYS.ICON)&&te.setIcon(j[he.GroupConstants.KEYS.ICON]),j.hasOwnProperty(he.GroupConstants.KEYS.DESCRIPTION)&&te.setDescription(j[he.GroupConstants.KEYS.DESCRIPTION]),j.hasOwnProperty(he.GroupConstants.KEYS.TAGS)&&te.setTags(j[he.GroupConstants.KEYS.TAGS]),j=te}ae.makeApiCall("createGroup",{},j).then((function(j){fe.GroupsController.trasformJSONGroup(j.data).setHasJoined(!0),K(fe.GroupsController.trasformJSONGroup(j.data))}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.getGroup=function(j){return new Promise((function(K,$){try{"object"==typeof j&&j.hasOwnProperty("guid")&&(j=j.guid);var ee=oe.validateId(j,"group");if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("getGroup",{guid:j}).then((function(j){K(fe.GroupsController.trasformJSONGroup(j.data))}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.joinGroup=function(j,K,$){return void 0===K&&(K=he.GroupType.Public),void 0===$&&($=""),new Promise((function(ee,te){try{var ne=oe.validateJoinGroup(j,K,$);if(ne instanceof ie.CometChatException)return void te(ne);var re=void 0;"object"==typeof j&&(j.hasOwnProperty(he.GroupConstants.KEYS.GUID)?(j.hasOwnProperty(he.GroupConstants.KEYS.TYPE)&&(K=j[he.GroupConstants.KEYS.TYPE],j[he.GroupConstants.KEYS.TYPE].toLocaleLowerCase()===he.GroupType.Password&&j.hasOwnProperty(he.GroupConstants.KEYS.PASSWORD)&&($=j[he.GroupConstants.KEYS.PASSWORD])),j=j[he.GroupConstants.KEYS.GUID]):te(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING))),re=oe.isFalsy($)?new me.Group(j,"name",K):new me.Group(j,"name",K,$),ae.makeApiCall("joinGroup",re,re).then((function(j){var K=fe.GroupsController.trasformJSONGroup(j.data[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA][he.ActionConstatnts.ACTION_KEYS.ENTITIES][he.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][he.ActionConstatnts.ACTION_KEYS.ENTITY]);K.setHasJoined(!0),ee(K)}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.updateGroup=function(j){return new Promise((function(K,$){try{var ee=oe.validateUpdateGroup(j);if(ee instanceof ie.CometChatException)return void $(ee);if(!(j instanceof me.Group)){var te=void 0;if(!j.hasOwnProperty(he.GroupConstants.KEYS.GUID))return void $(new ie.CometChatException(Ee.ERRORS.PARAMETER_MISSING));te=new me.Group(he.GroupConstants.KEYS.GUID,"",""),j.hasOwnProperty(he.GroupConstants.KEYS.TYPE)?te.setType(j[he.GroupConstants.KEYS.TYPE]):(j[he.GroupConstants.KEYS.TYPE]=he.GROUP_TYPE.PUBLIC,te.setType[he.GROUP_TYPE.PUBLIC]),j.hasOwnProperty(he.GroupConstants.KEYS.NAME)&&te.setName(j[he.GroupConstants.KEYS.NAME]),j.hasOwnProperty(he.GroupConstants.KEYS.ICON)&&te.setIcon(j[he.GroupConstants.KEYS.ICON]),j.hasOwnProperty(he.GroupConstants.KEYS.DESCRIPTION)&&te.setDescription(j[he.GroupConstants.KEYS.DESCRIPTION]),j.hasOwnProperty(he.GroupConstants.KEYS.TAGS)&&te.setTags(j[he.GroupConstants.KEYS.TAGS]),j=te}ae.makeApiCall("updateGroup",j,j).then((function(j){K(fe.GroupsController.trasformJSONGroup(j.data))}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.deleteGroup=function(j){return new Promise((function(K,$){try{var ee=oe.validateId(j,"group");if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("deleteGroup",{guid:j}).then((function(j){K(!0)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.leaveGroup=function(j){return new Promise((function(K,$){try{var ee=oe.validateId(j,"group");if(ee instanceof ie.CometChatException)return void $(ee);ae.makeApiCall("leaveGroup",{guid:j}).then((function(j){K(!0)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.kickGroupMember=function(j,K){return new Promise((function($,ee){try{var te=oe.validateId(j,"group");if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(K,"user");if(ne instanceof ie.CometChatException)return void ee(ne);ae.makeApiCall("kickGroupMembers",{guid:j,uid:K}).then((function(j){$(!0)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.updateGroupMemberScope=function(j,K,$){return new Promise((function(ee,te){try{var ne=oe.validateId(j,"group");if(ne instanceof ie.CometChatException)return void te(ne);var re=oe.validateId(K,"user");if(re instanceof ie.CometChatException)return void te(re);var se=oe.validateScope($);if(se instanceof ie.CometChatException)return void te(se);ae.makeApiCall("changeScopeOfMember",{guid:j,uid:K},{scope:$}).then((function(j){ee(!0)}),(function(j){te(new ie.CometChatException(j.error))}))}catch(ne){te(new ie.CometChatException(ne))}}))},G.banGroupMember=function(j,K){return new Promise((function($,ee){try{var te=oe.validateId(j,"group");if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(K,"user");if(ne instanceof ie.CometChatException)return void ee(ne);ae.makeApiCall("banGroupMember",{guid:j,uid:K}).then((function(j){$(!0)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.unbanGroupMember=function(j,K){return new Promise((function($,ee){try{var te=oe.validateId(j,"group");if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(K,"user");if(ne instanceof ie.CometChatException)return void ee(ne);ae.makeApiCall("unbanGroupMember",{guid:j,uid:K}).then((function(j){$(!0)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.addMembersToGroup=function(j,K,$){var te=[],ne=[],re=[],se=[];return new Promise((function(le,ce){try{var ue=oe.validateId(j,"group");if(ue instanceof ie.CometChatException)return void ce(ue);var de=oe.validateArray(K,"groupMembers");if(de instanceof ie.CometChatException)return void ce(de);if($){var pe=oe.validateArray($,"bannedMembers");if(pe instanceof ie.CometChatException)return void ce(pe)}oe.isFalsy(K)&&oe.isFalsy($)?ce(new ie.CometChatException({})):oe.isFalsy(K)||oe.isFalsy($)?oe.isFalsy(K)?$.map((function(j){se.push(j)})):(K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.ADMIN)return!0})).map((function(j){te.push(j.getUid())})),K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.MODERATOR)return!0})).map((function(j){ne.push(j.getUid())})),K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.PARTICIPANT)return!0})).map((function(j){re.push(j.getUid())}))):(K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.ADMIN)return!0})).map((function(j){te.push(j.getUid())})),K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.MODERATOR)return!0})).map((function(j){ne.push(j.getUid())})),K.filter((function(j){if(j.getScope()==he.GROUP_MEMBER_SCOPE.PARTICIPANT)return!0})).map((function(j){re.push(j.getUid())})),$.map((function(j){se.push(j)})));var ge={};oe.isFalsy(te)||(ge=ee(ee({},ge),{admins:te})),oe.isFalsy(re)||(ge=ee(ee({},ge),{participants:re})),oe.isFalsy(ne)||(ge=ee(ee({},ge),{moderators:ne})),oe.isFalsy(se)||(ge=ee(ee({},ge),{usersToBan:se})),ae.makeApiCall("addMemebersToGroup",{guid:j},ge).then((function(j){var K={};Object.keys(j.data.admins).map((function($){j.data.admins[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K[$]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K[$]=j.data.admins[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys(j.data.participants).map((function($){j.data.participants[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K[$]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K[$]=j.data.participants[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys(j.data.moderators).map((function($){j.data.moderators[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K[$]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K[$]=j.data.moderators[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys(j.data.usersToBan).map((function($){j.data.usersToBan[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K[$]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K[$]=j.data.usersToBan[$][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),le(K)}),(function(j){ce(new ie.CometChatException(j.error))}))}catch(le){ce(new ie.CometChatException(le))}}))},G.transferGroupOwnership=function(j,K){return new Promise((function($,ee){try{var te=oe.validateId(j,"group");if(te instanceof ie.CometChatException)return void ee(te);var ne=oe.validateId(K,"user");if(ne instanceof ie.CometChatException)return void ee(ne);ae.makeApiCall("transferOwnership",{guid:j},{owner:K}).then((function(ee){var te;te=ee&&ee.data&&ee.data.message?ee.data.message:"Ownership transferred to user "+K+" for the group with guid "+j+".",$(te)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.createGroupWithMembers=function(j,K,$){var te=[],ne=[],re=[],se=[];return new Promise((function(le,ce){try{var ue=oe.validateCreateGroup(j);if(ue instanceof ie.CometChatException)return void ce(ue);if(K&&0<K.length){var de=oe.validateArray(K,"groupMembers");if(de instanceof ie.CometChatException)return void ce(de);K.map((function(j){j.getScope()===he.GROUP_MEMBER_SCOPE.ADMIN&&te.push(j.getUid()),j.getScope()===he.GROUP_MEMBER_SCOPE.MODERATOR&&ne.push(j.getUid()),j.getScope()===he.GROUP_MEMBER_SCOPE.PARTICIPANT&&re.push(j.getUid())}))}if($&&0<$.length){var pe=oe.validateArray($,"bannedMembers");if(pe instanceof ie.CometChatException)return void ce(pe);$.map((function(j){se.push(j)}))}var ge={};ge=ee({},j),oe.isFalsy(te)||(ge.members=ee(ee({},ge.members),{admins:te})),oe.isFalsy(re)||(ge.members=ee(ee({},ge.members),{participants:re})),oe.isFalsy(ne)||(ge.members=ee(ee({},ge.members),{moderators:ne})),oe.isFalsy(se)||(ge.members=ee(ee({},ge.members),{usersToBan:se})),ae.makeApiCall("createGroup",{},ge).then((function(j){var K={members:{}},$=j.data.members.data?j.data.members.data:{admins:{},moderators:{},participants:{},usersToBan:{}};Object.keys($.admins).map((function(j){$.admins[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K.members[j]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K.members[j]=$.admins[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys($.participants).map((function(j){$.participants[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K.members[j]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K.members[j]=$.participants[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys($.moderators).map((function(j){$.moderators[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K.members[j]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K.members[j]=$.moderators[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),Object.keys($.usersToBan).map((function(j){$.usersToBan[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS]?K.members[j]=he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.SUCCESS:K.members[j]=$.usersToBan[j][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.ERROR][he.ResponseConstants.RESPONSE_KEYS.GROUP_MEMBERS_RESPONSE.MESSAGE]})),delete j.data.members;var te=j.data,ne=fe.GroupsController.trasformJSONGroup(te);ne.setHasJoined(!0),K=ee(ee({},K),{group:ne}),le(K)}),(function(j){ce(new ie.CometChatException(j.error))}))}catch(ue){ce(new ie.CometChatException(ue))}}))},G.initiateCall=function(j){var K=this;return new Promise((function($,ee){var te=K.getActiveCall();if(null===te)try{oe.isFalsy(JSON.parse(JSON.stringify(j)).sender)?oe.isFalsy(te)?(j.setStatus(he.CallConstants.CALL_STATUS.INITIATED),j.receiver=j.receiverId.toString(),delete j.receiverId,ae.makeApiCall("createCallSession",{},j).then((function(j){var K=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);Me.CallController.getInstance().initiateCall(K).then((function(j){$(K)})).catch((function(j){ee(new ie.CometChatException(j))}))}),(function(j){ee(new ie.CometChatException(j.error))}))):ee(new ie.CometChatException(he.CALL_ERROR.ERROR_IN_CALLING)):Me.CallController.getInstance().initiateCall(j).then((function(K){$(Object.assign(j))})).catch((function(j){ee(new ie.CometChatException(j))}))}catch(te){ee(new ie.CometChatException(te))}else ee(new ie.CometChatException(he.CALL_ERROR.CALL_ALREADY_INITIATED))}))},G.acceptCall=function(j){var K=this;return new Promise((function($,ee){if(null===K.getActiveCall())try{var te={};te[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.ONGOING,ae.makeApiCall("updateCallSession",{sessionid:j},te).then((function(j){var K=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);Me.CallController.getInstance().onCallStarted(K),$(K)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}else ee(new ie.CometChatException(he.CALL_ERROR.CANNOT_ACCEPT_CALL))}))},G.rejectCall=function(j,K){try{switch(K){case he.CallConstants.CALL_STATUS.REJECTED:return this.rejectIncomingCall(j);case he.CallConstants.CALL_STATUS.CANCELLED:return this.cancelCall(j);case he.CallConstants.CALL_STATUS.BUSY:return this.sendBusyResponse(j);default:return this.endCall(j,!0)}}catch(j){oe.Logger.error("CometChat: rejectCall",j)}},G.endCall=function(j,K){var $=this;return new Promise((function(ee,te){oe.isFalsy(K)&&(K=!1);var ne=$.getActiveCall();if(null!==ne){if(ne.getSessionId()===j)try{var re={};re[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.ENDED,ne.getJoinedAt()&&(re[he.CallConstants.CALL_KEYS.CALL_JOINED_AT]=ne.getJoinedAt()),ae.makeApiCall("updateCallSession",{sessionid:j},re).then((function(j){K||Me.CallController.getInstance().endSession();var $=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);ee($),Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onCallEnded($),Me.CallController.getInstance().endCall()}),(function(j){oe.Logger.log("calling Log",{error:j}),K||Me.CallController.getInstance().endSession(),ne.setStatus(he.CallConstants.CALL_STATUS.ENDED),ee(ne),Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onCallEnded(ne),Me.CallController.getInstance().endCall()}))}catch(re){te(new ie.CometChatException(re))}}else K||Me.CallController.getInstance().endSession(),ee(null),Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onCallEnded(null),Me.CallController.getInstance().endCall()}))},G.getActiveCall=function(){try{return Me.CallController.getInstance().getActiveCall()}catch(j){oe.Logger.error("CometChat: getActiveCall",j)}},G.startCall=function(j,K,$){var ee=this;try{var te,ne,re,ae,se,le,ce,ue,de,pe,ge=this.getActiveCall(),me=!1,fe=!0,ye=!0,be=!0,ve=!0,Ee=!0,Se=!0,Ce=!1,_e=!1,Te=he.CallConstants.CALL_MODE.DEFAULT,Ae=!1,Ie=!1,Ne=!1,Oe=!0,we=!0,De={},xe=this.user;ae=(new Ge.VirtualBackgroundBuilder).build(),se=new Ge.MainVideoContainerSetting,oe.getAppSettings().then((function(je){if(ue=je[he.APP_SETTINGS.KEYS.WEBRTC_HOST],De[he.APP_SETTINGS.KEYS.ANALYTICS_HOST]=je[he.APP_SETTINGS.KEYS.ANALYTICS_HOST],De[he.APP_SETTINGS.KEYS.ANALYTICS_VERSION]=je[he.APP_SETTINGS.KEYS.ANALYTICS_VERSION],De[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED]=je[he.APP_SETTINGS.KEYS.ANALYTICS_PING_DISABLED],De[he.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL]=je[he.APP_SETTINGS.KEYS.ANALYTICS_USE_SSL],le=je[he.APP_SETTINGS.KEYS.REGION],oe.isFalsy($)||Me.CallController.getInstance().setCallListner($),oe.isFalsy(ee.appSettings))Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.NOT_INITIALIZED));else if(le)if(xe)if((pe=new Be.RTCUser(xe.getUid())).setName(xe.getName()),pe.setAvatar(xe.getAvatar()),pe.setResource(G.getSessionId()),G.appId)if(ce=G.appId,"string"==typeof j){if(ge){var Le=ge.getType();me=Le===he.CallConstants.CALL_TYPE.AUDIO,ne=ge.getSessionId()}else{if(oe.isFalsy(j))return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.SESSION_ID_REQUIRED)));ne=("v1."+le+"."+G.getAppId()+"."+j).toLowerCase()}if(!ne)return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.SESSION_ID_REQUIRED)));Oe=!!me;var ke={uid:xe.getUid(),sessionId:ne};G.getJWT(ke).then((function(j){j.hasOwnProperty("token")?(pe.setJWT(j.token),te=(new Ge.CallSettingsBuilder).setSessionID(ne).enableDefaultLayout(fe).setIsAudioOnlyCall(me).setUser(pe).setRegion(le).setAppId(ce).setDomain(ue).showEndCallButton(ve).showMuteAudioButton(be).showPauseVideoButton(ye).showScreenShareButton(Ee).showModeButton(Se).setMode(Te).setAnalyticsSettings(De).startWithAudioMuted(Ce).startWithVideoMuted(_e).showRecordingButton(Ae).startRecordingOnCallStart(Ie).forceLegacyUI(Ne).showSwitchToVideoCallButton(Oe).setVirtualBackground(ae).showVirtualBackgroundSetting(we).setMainVideoContainerSetting(se).build(),Me.CallController.getInstance().startCall(te,K)):Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.JWT_NOT_FOUND))}),(function(j){Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(j))}))}else{if(oe.isFalsy(j))return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.CALL_SETTINGS_REQUIRED)));if(ge)Le=ge.getType(),me=Le===he.CallConstants.CALL_TYPE.AUDIO,ne=ge.getSessionId();else{if(me=j.isAudioOnlyCall(),oe.isFalsy(j.getSessionId()))return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.SESSION_ID_REQUIRED)));ne=("v1."+le+"."+G.getAppId()+"."+j.getSessionId()).toLowerCase()}if(!ne)return void(Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.SESSION_ID_REQUIRED)));fe=j.isDefaultLayoutEnabled(),ye=j.isPauseVideoButtonEnabled(),be=j.isMuteAudioButtonEnabled(),ve=j.isEndCallButtonEnabled(),Ee=j.isScreenShareButtonEnabled(),Te=j.getMode(),de=j.getLocalizedStringObject(),re=j.getCustomCSS(),Se=j.isModeButtonEnabled(),Ce=j.getStartWithAudioMuted(),_e=j.getStartWithVideoMuted(),Ae=j.isRecordingButtonEnabled(),Ie=j.shouldStartRecordingOnCallStart(),Ne=j.shouldUseLegacyUI(),Oe=!!me&&j.isAudioToVideoButtonEnabled(),ae=j.getVirtualBackground(),we=j.isVirtualBackgroundSettingEnabled(),se=j.getMainVideoContainerSetting(),ke={uid:xe.getUid(),sessionId:ne},G.getJWT(ke).then((function(j){j.hasOwnProperty("token")?(pe.setJWT(j.token),te=(new Ge.CallSettingsBuilder).setSessionID(ne).enableDefaultLayout(fe).setIsAudioOnlyCall(me).setUser(pe).setRegion(le).setAppId(ce).setDomain(ue).showEndCallButton(ve).showMuteAudioButton(be).showPauseVideoButton(ye).showScreenShareButton(Ee).showModeButton(Se).setMode(Te).setLocalizedStringObject(de).setCustomCSS(re).setAnalyticsSettings(De).startWithAudioMuted(Ce).startWithVideoMuted(_e).showRecordingButton(Ae).startRecordingOnCallStart(Ie).forceLegacyUI(Ne).showSwitchToVideoCallButton(Oe).setVirtualBackground(ae).showVirtualBackgroundSetting(we).setMainVideoContainerSetting(se).build(),Me.CallController.getInstance().startCall(te,K)):Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.JWT_NOT_FOUND))}),(function(j){Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(j))}))}else Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.NOT_INITIALIZED));else Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.NOT_LOGGED_IN));else Me.CallController.getInstance().getCallListner()&&Me.CallController.getInstance().getCallListner()._eventListener.onError(new ie.CometChatException(he.CALL_ERROR.NOT_INITIALIZED))}),(function(j){oe.Logger.error("CometChat: startCall",j)}))}catch(j){oe.Logger.error("CometChat: startCall",j)}},G.getCallParticipantCount=function(j,K){return new Promise((function($,ee){try{oe.getAppSettings().then((function(te){if(oe.isFalsy(j))return ee(new ie.CometChatException(he.ProsodyApiErrors.INVALID_SESSIONID));if(oe.isFalsy(K))return ee(new ie.CometChatException(he.ProsodyApiErrors.INVALID_TYPE));var ne=te[he.APP_SETTINGS.KEYS.REGION],se={},le=te[he.APP_SETTINGS.KEYS.WEBRTC_HOST],ce=te[he.APP_SETTINGS.KEYS.WEBRTC_API_SUBDOMAIN],ue=oe.format((new re.EndpointFactory).prosodyApi,ce,le,he.PROSODY_API.PATH.ROOM_SIZE);"direct"===K.toLowerCase()&&(j=("v1."+ne+"."+G.getAppId()+"."+j).toLowerCase()),se[he.PROSODY_API.QUERY_PARAMETERS.DOMAIN]=le,se[he.PROSODY_API.QUERY_PARAMETERS.ROOM]=j,ae.postData(ue,"GET",se,{},!1).then((function(j){return j.text()})).then((function(j){var K=j?JSON.parse(j):{};return K.hasOwnProperty(he.PROSODY_API.RESPONSE.PARTICIPANTS)?$(K[he.PROSODY_API.RESPONSE.PARTICIPANTS]):$(0)})).catch((function(){var j={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};return ee(j)}))}),(function(j){return ee(new ie.CometChatException(j))}))}catch(j){return ee(new ie.CometChatException(j))}}))},G.rejectIncomingCall=function(j){return new Promise((function(K,$){try{var ee={};ee[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.REJECTED,ae.makeApiCall("updateCallSession",{sessionid:j},ee).then((function(j){var $=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);K($)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.cancelCall=function(j){var K=this;return new Promise((function($,ee){try{var te={};te[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.CANCELLED,ae.makeApiCall("updateCallSession",{sessionid:j},te).then((function(ee){var te=pe.MessageController.trasformJSONMessge(ee[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);K.getActiveCall().getSessionId()===j&&Me.CallController.getInstance().endCallSession(),$(te)}),(function(j){ee(new ie.CometChatException(j.error))}))}catch(te){ee(new ie.CometChatException(te))}}))},G.sendBusyResponse=function(j){return new Promise((function(K,$){try{var ee={};ee[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.BUSY,ae.makeApiCall("updateCallSession",{sessionid:j},ee).then((function(j){var $=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);K($)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.sendUnansweredResponse=function(j){return new Promise((function(K,$){try{var ee={};ee[he.CallConstants.CALL_KEYS.CALL_STATUS]=he.CallConstants.CALL_STATUS.UNANSWERED,ae.makeApiCall("updateCallSession",{sessionid:j},ee).then((function(j){var $=pe.MessageController.trasformJSONMessge(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);Je.publishCallMessage($),K($)}),(function(j){$(new ie.CometChatException(j.error))}))}catch(ee){$(new ie.CometChatException(ee))}}))},G.addConnectionListener=function(j,K){try{Xe.addConnectionEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addConnectionListener",j)}},G.removeConnectionListener=function(j){try{Xe.removeConnectionEventListener(j)}catch(j){oe.Logger.error("CometChat: removeConnectionListener",j)}},G.addMessageListener=function(j,K){try{Xe.addMessageEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addMessageListener",j)}},G.removeMessageListener=function(j){try{Xe.removeMessageEventListener(j)}catch(j){oe.Logger.error("CometChat: removeMessageListener",j)}},G.addCallListener=function(j,K){try{Xe.addCallEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addCallListener",j)}},G.removeCallListener=function(j){try{Xe.removeCallEventListener(j)}catch(j){oe.Logger.error("CometChat: removeCallListener",j)}},G.addUserListener=function(j,K){try{Xe.addUserEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addUserListener",j)}},G.removeUserListener=function(j){try{Xe.removeUserEventListener(j)}catch(j){oe.Logger.error("CometChat: removeUserListener",j)}},G.addGroupListener=function(j,K){try{Xe.addGroupEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addGroupListener",j)}},G.removeGroupListener=function(j){try{Xe.removeGroupEventListener(j)}catch(j){oe.Logger.error("CometChat: removeGroupListener",j)}},G.addLoginListener=function(j,K){try{Xe.addLoginEventListener(j,K)}catch(j){oe.Logger.error("CometChat: addLoginListener",j)}},G.removeLoginListener=function(j){try{Xe.removeLoginEventListener(j)}catch(j){oe.Logger.error("CometChat: removeLoginListener",j)}},G.generateAuthToken=function(j){var K=this;return new Promise((function($,ee){try{var te={},ne="",re="",se=he.APPINFO.platform,le=he.APPINFO.sdkVersion,ce=he.APPINFO.apiVersion;navigator&&(re=navigator.userAgent),G.keyStore.get(he.LOCAL_STORE.KEY_DEVICE_ID).then((function(oe){if(null==(ne=oe)){var ue=Ke(),de=(new Date).getTime();ne=K.appId+"_"+ue+"_"+de,G.keyStore.set(he.LOCAL_STORE.KEY_DEVICE_ID,ne)}te={platform:se,deviceId:ne,appInfo:{version:le,apiVersion:ce,userAgent:re}},ae.makeApiCall("authToken",{uid:j},te).then((function(j){$(j.data)})).catch((function(j){ee(new ie.CometChatException(j.error))}))}),(function(j){oe.Logger.error("Got error while fetching data from key store",j)}))}catch(j){ee(new ie.CometChatException(j))}}))},G.tryReconnectingToWS=function(){G.WSReconnectionInProgress||G.startWSReconnectionTimer()},G.prototype.makeWSConnection=function(){G.WSLogin(G.user)},G.prototype.accidentallyDisconnected=function(){G.currentConnectionStatus=he.CONNECTION_STATUS.CONNECTING,Xe.connectionHandlers.map((function(j){try{j._eventListener&&(oe.isFalsy(j._eventListener.inConnecting)||j._eventListener.inConnecting())}catch(j){oe.Logger.error("ConnectionHandlers: inConnecting Status",j)}})),G.tryReconnectingToWS()},G.WSLogin=function(j){var K=this;Je.connection?oe.Logger.error("CometChat :: WSLogin",Je.connection):Je.WSLogin(j.getJWT(),(function(j){switch(j){case He.READY_STATE.CONNECTING:($=G.getConnectionStatus())==he.CONNECTION_STATUS.DISCONNECTED&&(K.currentConnectionStatus=he.CONNECTION_STATUS.CONNECTING,Xe.connectionHandlers.map((function(j){try{j._eventListener&&(oe.isFalsy(j._eventListener.inConnecting)||j._eventListener.inConnecting())}catch(j){oe.Logger.error("connectionHandlers: Connecting Status",j)}})));break;case He.READY_STATE.OPEN:($=G.getConnectionStatus())==he.CONNECTION_STATUS.CONNECTING&&(K.currentConnectionStatus=he.CONNECTION_STATUS.CONNECTED,Xe.connectionHandlers.map((function(j){try{j._eventListener&&(oe.isFalsy(j._eventListener.onConnected)||j._eventListener.onConnected())}catch(j){oe.Logger.error("connectionHandlers: Connected Status",j)}}))),G.WSReconnectionInProgress&&G.clearWSReconnectionTimer();break;case He.READY_STATE.CLOSING:break;case He.READY_STATE.CLOSED:var $;($=G.getConnectionStatus())!==he.CONNECTION_STATUS.DISCONNECTED&&$!==he.CONNECTION_STATUS.CONNECTING&&(K.currentConnectionStatus=he.CONNECTION_STATUS.DISCONNECTED,Xe.connectionHandlers.map((function(j){try{j._eventListener&&(oe.isFalsy(j._eventListener.onDisconnected)||j._eventListener.onDisconnected())}catch(j){oe.Logger.error("connectionHandlers: Disconnected Status",j)}}))),Je.connection&&(Je.connection=null),G.isLoggedOut||G.disconnectedByUser||K.tryReconnectingToWS()}}))},G.pingAnalytics=function(){var j=this;try{G.keyStore.get("deviceId").then((function(K){oe.getAppSettings().then((function($){var ee=null;window&&window.location&&window.location.origin&&(ee=window.location.origin);var te="",ne=K,re={version:he.SDKHeader.sdkVersion,apiVersion:$[he.APP_SETTINGS.KEYS.CHAT_API_VERSION],origin:ee,uts:(new Date).getTime()};oe.isFalsy(j.resource)||(re.resource=j.resource),oe.isFalsy(j.platform)||(re.platform=j.platform),oe.isFalsy(j.language)||(re.language=j.language),navigator&&(te=navigator.userAgent);var se={appInfo:re,uid:G.user.getUid(),userAgent:te,deviceId:ne,platform:he.SDKHeader.platform};oe.isFalsy(G.getSessionId())||(se.wsId=G.getSessionId());var le="https://"+$[he.APP_SETTINGS.KEYS.ANALYTICS_HOST]+"/"+$[he.APP_SETTINGS.KEYS.ANALYTICS_VERSION]+"/ping",ce={appId:G.appId,sdk:oe.format(he.SDKHeader.sdk,he.SDKHeader.platform,he.SDKHeader.sdkVersion),"Content-Type":"application/json"};G.settingsHash&&(ce.settingsHash=G.settingsHash),G.settingsHashReceivedAt&&(ce.settingsHashReceivedAt=G.settingsHashReceivedAt),G.jwt&&(ce.Authorization="Bearer "+G.jwt),G.authToken&&(ce.authToken=G.authToken),ae.postData(le,"POST",se,ce,!1).then((function(j){return j.json()})).then((function(K){if(K.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA))oe.Logger.log("Analytics Ping Request Data",K[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]);else if(K.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_ERROR)){var $=K[he.ResponseConstants.RESPONSE_KEYS.KEY_ERROR];oe.Logger.log("Analytics Ping Request Error",new ie.CometChatException($));var ee=$.code;if(ee===he.Errors.ERR_SETTINGS_HASH_OUTDATED){var te=G.authToken;G.getInstance().internalRestart(te)}ee===he.Errors.ERR_NO_AUTH&&j.updateJWT()}})).catch((function(j){oe.Logger.error("CometChat: pingAnalytics Fetch Error",j)}))}),(function(j){oe.Logger.error("CometChat: pingAnalytics getSettings Error",j)}))}),(function(j){oe.Logger.error("CometChat: pingAnalytics getDeviceId Error",j)}))}catch(j){oe.Logger.error("CometChat: pingAnalytics",j)}},G.updateJWT=function(){ae.makeApiCall("getMyDetails",{},{},!1).then((function(j){var K=j.data,$=K.settings,ee=new se.Me(K);if(K.hasOwnProperty("jwt")&&K.jwt&&(G.jwt=K.jwt),le.LocalStorage.getInstance().set("user",ee),$&&$[he.APP_SETTINGS.KEYS.SETTINGS_HASH]&&G.settingsHash!==$[he.APP_SETTINGS.KEYS.SETTINGS_HASH]){var te=G.getInstance().getAuthToken();G.getInstance().internalRestart(te)}oe.Logger.log("CometChat: updateJWT response",j)}),(function(j){oe.Logger.error("CometChat: updateJWT Fetch Error",j)})).catch((function(j){oe.Logger.error("CometChat: updateJWT",j)}))},G.startAnalyticsPingTimer=function(){var j=this;G.isAnalyticsPingStarted=!0,G.analyticsPingTimer=setInterval((function(){try{j.pingAnalytics()}catch(j){oe.Logger.error("CometChat: startAnalyticsPingTimer",j)}}),G.settingsInterval)},G.clearAnalyticsPingTimer=function(){try{G.isAnalyticsPingStarted=!1,clearInterval(G.analyticsPingTimer)}catch(j){oe.Logger.error("CometChat: clearAnalyticsPingTimer",j)}},G.startWSReconnectionTimer=function(){G.WSReconnectionInProgress=!0,G.WSReconnectionTimer=setInterval((function(){try{G.WSLogin(G.user)}catch(j){oe.Logger.error("CometChat: startWSReconnectionTimer",j)}}),G.WSReconnectionTimerInterval)},G.clearWSReconnectionTimer=function(){G.WSReconnectionInProgress=!1,clearInterval(G.WSReconnectionTimer)},G.getJWT=function(j){return new Promise((function(K,$){try{Ve.getEndPoint("getJWT").then((function(ee){var te={appId:G.appId,Accept:"application/json",authToken:G.authToken,resource:G.getSessionId(),sdk:oe.format(he.SDKHeader.sdk,he.SDKHeader.platform,he.SDKHeader.sdkVersion),"Content-Type":"application/json"},ne={};ne[he.JWT_API.KEYS.PASSTHROUGH]=j,ae.postData(ee.endpoint,ee.method,ne,te,!1).then((function(j){return j.json()})).then((function(j){j.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA)?K(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]):$(new ie.CometChatException(j.error))})).catch((function(j){var K={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};$(new ie.CometChatException(K))}))}),(function(j){$(new ie.CometChatException(j))}))}catch(j){$(new ie.CometChatException(j))}}))},G.getConnectionStatus=function(){return this.currentConnectionStatus},G.prototype.setConnectionStatus=function(j){G.currentConnectionStatus=j},G.isExtensionEnabled=function(j){return new Promise((function(K,$){try{if(oe.isFalsy(j))return $(new ie.CometChatException(he.ExtensionErrors.INVALID_EXTENSION));oe.getAppSettings().then((function(ee){if(ee.extensions){var te=ee.extensions;if(0<te.length){var ne=te.some((function(K){return K.id===j}));return K(ne)}return K(!1)}return $(new ie.CometChatException(he.ExtensionErrors.EXTENSION_NOT_FOUND))}),(function(j){return $(new ie.CometChatException(j))}))}catch(j){return $(new ie.CometChatException(j))}}))},G.getExtensionDetails=function(j){return new Promise((function(K,$){try{if(oe.isFalsy(j))return $(new ie.CometChatException(he.ExtensionErrors.INVALID_EXTENSION));oe.getAppSettings().then((function(ee){if(ee.extensions){var te=ee.extensions;if(0<te.length){var ne=te.filter((function(K){return K.id===j}));if(0<ne.length){var re=new We.CCExtension(ne[0]);return K(re)}return $(new ie.CometChatException(he.ExtensionErrors.EXTENSION_NOT_FOUND))}return $(new ie.CometChatException(he.ExtensionErrors.EXTENSION_NOT_FOUND))}return $(new ie.CometChatException(he.ExtensionErrors.EXTENSION_NOT_FOUND))}),(function(j){return $(new ie.CometChatException(j))}))}catch(j){return $(new ie.CometChatException(j))}}))},G.getAppSettings=function(){return new Promise((function(j,K){try{ae.makeApiCall("appSettings").then((function(K){le.LocalStorage.getInstance().set(he.LOCAL_STORE.KEY_APP_SETTINGS,K.data),j(K.data)}),(function(j){K(new ie.CometChatException(j.error))}))}catch(j){K(new ie.CometChatException(j))}}))},G.isFeatureEnabled=function(j){return new Promise((function(K,$){try{if(oe.isFalsy(j))return $(new ie.CometChatException(he.FeatureRestrictionErrors.INVALID_FEATURE));oe.getAppSettings().then((function(ee){if(ee.parameters){var te=ee.parameters;return te.hasOwnProperty(j)?K(te[j]):K(!1)}return $(new ie.CometChatException(he.FeatureRestrictionErrors.FEATURE_NOT_FOUND))}),(function(j){return $(new ie.CometChatException(j))}))}catch(j){return $(new ie.CometChatException(j))}}))},G.logout=function(){var j=this;return new Promise((function(K,$){try{G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer(),G.WSReconnectionInProgress&&G.clearWSReconnectionTimer(),G.isLoggedOut=!0,G.WSReconnectionInProgress=!1,G.isAnalyticsDisabled=!1,ae.makeApiCall("userLogout").then((function($){j.clearCache().then((function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,Je.WSLogout(),G.pushToLoginListener("","Logout_Success"),K($.data)}))}),(function(ee){j.clearCache().then((function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,Je.WSLogout(),G.pushToLoginListener("","Logout_Success"),new ie.CometChatException(ee.error).code==Ee.SERVER_ERRORS.AUTH_ERR.code?K({}):$(new ie.CometChatException(ee.error))}))}))}catch(j){$(new ie.CometChatException(j))}}))},G.callExtension=function(j,K,$,ee){return void 0===ee&&(ee={}),new Promise((function(te,ne){try{oe.getAppSettings().then((function(se){var le=oe.format((new re.EndpointFactory).extensionApi,j,se[he.APP_SETTINGS.KEYS.REGION],se[he.APP_SETTINGS.KEYS.EXTENSION_DOMAIN],$),ce={appId:G.appId,Accept:"application/json",authToken:G.authToken,resource:G.getSessionId(),sdk:oe.format(he.SDKHeader.sdk,he.SDKHeader.platform,he.SDKHeader.sdkVersion),chatApiVersion:se[he.APP_SETTINGS.KEYS.CHAT_API_VERSION],"Content-Type":"application/json"};ae.postData(le,K,ee,ce,!1).then((function(j){return j.json()})).then((function(j){j.hasOwnProperty(he.ResponseConstants.RESPONSE_KEYS.KEY_DATA)?te(j[he.ResponseConstants.RESPONSE_KEYS.KEY_DATA]):ne(new ie.CometChatException(j.error))})).catch((function(j){var K={error:Ee.FETCH_ERROR.ERROR_IN_API_CALL};ne(K)}))}),(function(j){return ne(new ie.CometChatException(j))}))}catch(j){return ne(new ie.CometChatException(j))}}))},G.setSource=function(j,K,$){oe.isFalsy(j)||(this.resource=j),oe.isFalsy(K)||(this.platform=K),oe.isFalsy($)||(this.language=$)},G.clearCache=function(){return new Promise((function(j,K){try{le.LocalStorage.getInstance().clearStore().then((function(){G.removeDataFromSessionStorage(he.SESSION_STORE.SESSION_ID),oe.Logger.info("CometChat: clearCache => All store cleared successfully","true"),j(!0)}))}catch(j){oe.Logger.error("CometChat: clearCache",j),K(j)}}))},G.connect=function(){G.user&&(Je.connection||(G.disconnectedByUser=!1,G.WSLogin(G.user)),G.didAnalyticsPingStart()||G.isAnalyticsDisabled||(G.pingAnalytics(),G.startAnalyticsPingTimer()))},G.disconnect=function(){G.user&&(G.disconnectedByUser=!0,Je.connection&&Je.WSLogout(),G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer())},G.prototype.internalRestart=function(j){G.internalRestart||G.getInstance().internalLogout(!1).then((function(){G.internalRestart=!0,G.login(j).then((function(j){G.shouldConnectToWS=!0,G.internalRestart=!1}),(function(j){oe.Logger.error("CometChat: internalRestart :: login",j),G.internalRestart=!1}))}),(function(j){oe.Logger.error("CometChat: internalRestart :: internalLogout",j)}))},G.prototype.internalLogout=function(j){return void 0===j&&(j=!0),new Promise((function(K,$){try{G.didAnalyticsPingStart()&&G.clearAnalyticsPingTimer(),G.WSReconnectionInProgress&&G.clearWSReconnectionTimer(),G.isLoggedOut=!0,G.WSReconnectionInProgress=!1,G.isAnalyticsDisabled=!1,G.clearCache().then((function(){G.apiKey=void 0,G.user=void 0,G.authToken=void 0,G.cometChat=void 0,G.mode=void 0,Je.WSLogout(),j&&G.pushToLoginListener("","Logout_Success"),K(!0)}))}catch(K){oe.Logger.error("CometChat: internalLogout",K),$(K)}}))},G.initialzed=!1,G.CometChatException=ie.CometChatException,G.TextMessage=de.TextMessage,G.MediaMessage=ce.MediaMessage,G.CustomMessage=xe.CustomMessage,G.Action=Se.Action,G.Call=ve.Call,G.TypingIndicator=we.TypingIndicator,G.TransientMessage=Qe.TransientMessage,G.Group=me.Group,G.User=se.User,G.GroupMember=je.GroupMember,G.Conversation=Re.Conversation,G.USER_STATUS={ONLINE:he.PresenceConstatnts.STATUS.ONLINE,OFFLINE:he.PresenceConstatnts.STATUS.OFFLINE},G.MessagesRequest=Ne.MessagesRequest,G.MessagesRequestBuilder=Ne.MessagesRequestBuilder,G.UsersRequest=Ae.UsersRequest,G.UsersRequestBuilder=Ae.UsersRequestBuilder,G.ConversationsRequest=Ie.ConversationsRequest,G.ConversationsRequestBuilder=Ie.ConversationsRequestBuilder,G.BlockedUsersRequest=Le.BlockedUsersRequest,G.BlockedUsersRequestBuilder=Le.BlockedUsersRequestBuilder,G.GroupsRequest=Ce.GroupsRequest,G.GroupsRequestBuilder=Ce.GroupsRequestBuilder,G.GroupMembersRequest=_e.GroupMembersRequest,G.GroupMembersRequestBuilder=_e.GroupMembersRequestBuilder,G.BannedMembersRequest=Te.BannedMembersRequest,G.BannedMembersRequestBuilder=Te.BannedMembersRequestBuilder,G.CallSettings=Ge.CallSettings,G.CallSettingsBuilder=Ge.CallSettingsBuilder,G.MainVideoContainerSetting=Ge.MainVideoContainerSetting,G.VirtualBackground=Ge.VirtualBackground,G.VirtualBackgroundBuilder=Ge.VirtualBackgroundBuilder,G.AppSettings=ke.AppSettings,G.AppSettingsBuilder=ke.AppSettingsBuilder,G.MessageListener=be.MessageListener,G.UserListener=be.UserListener,G.GroupListener=be.GroupListener,G.OngoingCallListener=be.OngoingCallListener,G.CallListener=be.CallListener,G.ConnectionListener=be.ConnectionListener,G.LoginListener=be.LoginListener,G.CallController=Me.CallController,G.CometChatHelper=Pe.CometChatHelper,G.Attachment=Ue.Attachment,G.MediaDevice=Fe.MediaDevice,G.MESSAGE_TYPE=he.MessageConstatnts.TYPE,G.CATEGORY_MESSAGE=he.MessageConstatnts.CATEGORY.MESSAGE,G.CATEGORY_ACTION=he.MessageConstatnts.CATEGORY.ACTION,G.CATEGORY_CALL=he.MessageConstatnts.CATEGORY.CALL,G.CATEGORY_CUSTOM=he.MessageConstatnts.CATEGORY.CUSTOM,G.ACTION_TYPE=he.ActionConstatnts.ACTIONS,G.CALL_TYPE=he.CallConstants.CALL_TYPE,G.RECEIVER_TYPE=he.MessageConstatnts.RECEIVER_TYPE,G.CALL_STATUS=he.CallConstants.CALL_STATUS,G.GROUP_MEMBER_SCOPE=he.GROUP_MEMBER_SCOPE,G.GROUP_TYPE=he.GROUP_TYPE,G.MESSAGE_REQUEST=he.MessageConstatnts.PAGINATION.CURSOR_FILEDS,G.CONNECTION_STATUS=he.CONNECTION_STATUS,G.CALL_MODE=he.CallConstants.CALL_MODE,G.SORT_BY=he.UserConstants.SORT_BY,G.SORT_ORDER=he.UserConstants.SORT_ORDER,G.WSReconnectionInProgress=!1,G.WSReconnectionTimerInterval=5e3,G.currentConnectionStatus=he.CONNECTION_STATUS.DISCONNECTED,G.isConnectingFromInit=!1,G.loginInProgress=!1,G.internalRestart=!1,G.settingsInterval=6e4,G.isAnalyticsPingStarted=!1,G.isLoggedOut=!0,G.isAnalyticsDisabled=!1,G.disconnectedByUser=!1,G.shouldConnectToWS=!0,G}();K.CometChat=qe},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.Me=K.User=void 0;var ne=$(2),re=$(13),oe=$(1),ie=function(){function t(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];if(this.hasBlockedMe=!1,this.blockedByMe=!1,this.deactivatedAt=0,1===j.length)typeof j[0]===oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING?this.uid=j[0]:(this.uid=j[0].uid,this.name=j[0].name,j[0].authToken&&(this.authToken=j[0].authToken),j[0].avatar&&(this.avatar=j[0].avatar),j[0].lastActiveAt&&(this.lastActiveAt=j[0].lastActiveAt),j[0].link&&(this.link=j[0].link),j[0].metadata&&(this.metadata=j[0].metadata),j[0].role&&(this.role=j[0].role),j[0].statusMessage&&(this.statusMessage=j[0].statusMessage),j[0].status&&"offline"!==j[0].status?this.status="online":this.status="offline",j[0].tags&&(this.tags=j[0].tags),j[0].deactivatedAt&&(this.deactivatedAt=j[0].deactivatedAt));else{if(2!==j.length)throw new ne.CometChatException(re.ERRORS.PARAMETER_MISSING);this.uid=j[0],this.name=j[1]}}return t.prototype.getUid=function(){return this.uid.toString()},t.prototype.setUid=function(j){this.uid=j},t.prototype.getName=function(){return this.name.toString()},t.prototype.setName=function(j){j&&(this.name=j)},t.prototype.getAuthToken=function(){return this.authToken},t.prototype.setAuthToken=function(j){this.authToken=j},t.prototype.getAvatar=function(){return this.avatar},t.prototype.setAvatar=function(j){this.avatar=j},t.prototype.getLastActiveAt=function(){return this.lastActiveAt},t.prototype.setLastActiveAt=function(j){this.lastActiveAt=j},t.prototype.getLink=function(){return this.link},t.prototype.setLink=function(j){return this.link=j},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(j){this.metadata=j},t.prototype.getRole=function(){return this.role},t.prototype.setRole=function(j){this.role=j},t.prototype.getStatus=function(){return this.status},t.prototype.setStatus=function(j){this.status=j},t.prototype.getStatusMessage=function(){return this.statusMessage},t.prototype.setStatusMessage=function(j){this.statusMessage=j},t.prototype.setBlockedByMe=function(j){this.blockedByMe=j},t.prototype.getBlockedByMe=function(){return this.blockedByMe},t.prototype.setHasBlockedMe=function(j){this.hasBlockedMe=j},t.prototype.getHasBlockedMe=function(){return this.hasBlockedMe},t.prototype.setTags=function(j){this.tags=j},t.prototype.getTags=function(){return this.tags},t.prototype.setDeactivatedAt=function(j){this.deactivatedAt=j},t.prototype.getDeactivatedAt=function(){return this.deactivatedAt},t}(),ae=function(j){function t(K){var $=j.call(this,K)||this;return $.wsChannel=K.wsChannel,K.jwt&&($.jwt=K.jwt),$}return te(t,j),t.prototype.getWsChannel=function(){return this.wsChannel},t.prototype.getJWT=function(){return this.jwt},t}(K.User=ie);K.Me=ae},function(j,K,$){"use strict";K.__esModule=!0,K.KEYS=K.AUTH=K.MESSAGE=K.PRESENCE=K.RECEIPTS=K.TRANSIENT_MESSAGE=K.TYPING_INDICATOR=K.LOGOUT_REASON=K.LOGOUT_CODE=K.READY_STATE=K.WS=void 0,K.WS={protocol:"wss://"},K.READY_STATE={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3,INVALID_JWT:4},K.LOGOUT_CODE=1e3,K.LOGOUT_REASON="User logged out",K.TYPING_INDICATOR={TYPE:"typing_indicator",ACTION:{STARTED:"started",ENDED:"ended"}},K.TRANSIENT_MESSAGE={TYPE:"transient_message"},K.RECEIPTS={TYPE:"receipts",ACTION:{READ:"read",DELIVERED:"delivered"},RECEIPT_TYPE:{READ_RECEIPT:"read",DELIVERY_RECEIPT:"delivery"}},K.PRESENCE={TYPE:"presence",ACTION:{ONLINE:"online",AVAILABLE:"available",OFFLINE:"offline"}},K.MESSAGE={TYPE:"message"},K.AUTH={TYPE:"auth"},K.KEYS={TYPE:"type",ACTION:"action",APP_ID:"appId",RECEIVER:"receiver",RECEIVER_TYPE:"receiverType",DEVICE_ID:"deviceId",BODY:"body",USER:"user",METADATA:"metadata",MESSAGE_ID:"messageId",TIMESTAMP:"timestamp",STATUS:"status",CODE:"code",SENDER:"sender",MESSAGE_SENDER:"messageSender",PRESENCE_SUBSCRIPTION:"presenceSubscription",AUTH:"auth",PING:"ping",DATA:"data",PARAMS:"params",ACK:"ack",PONG:"pong"}},function(j,K,$){"use strict";K.__esModule=!0,K.postData=K.makeAdminApiCall=K.makeApiCall=void 0;var ee=$(29),te=$(3),ne=$(0),re=$(2),oe=$(13),ie=$(1);function C(j,K,$,ee,te){var re;return void 0===j&&(j=""),void 0===K&&(K="GET"),void 0===$&&($={}),void 0===ee&&(ee={}),$=ne.isFalsy($)?void 0:("GET"==K&&(j+="?",Object.keys($).map((function(K,ee){j=ee===Object.keys($).length-1?j+K+"="+$[K]:j+K+"="+$[K]+"&"})),$=void 0),te&&(re=new FormData,Object.keys($).map((function(j){if("data"!=j){if("tags"==j)re.append(j+"[]",$[j]);else if("metadata"!=j)if("files"===j)for(var K=0;K<$[j].length;K++)re.append(j+"[]",$[j][K]);else re.append(j,$[j])}else re.append(j,JSON.stringify($[j]))}))),JSON.stringify($)),fetch(j,{method:K,mode:"cors",cache:"no-cache",headers:ee,redirect:"follow",referrer:"no-referrer",body:te?re:$})}K.makeApiCall=function(j,K,$,ae){void 0===j&&(j=""),void 0===K&&(K={}),void 0===$&&($={});var se=te.CometChat.getInstance(te.CometChat.getAppId());return new Promise((function(le,ce){try{ee.getEndPoint(j,K).then((function(K){var ee={resource:te.CometChat.getSessionId(),appId:te.CometChat.getAppId(),Accept:"application/json",sdk:ne.format(ie.SDKHeader.sdk,ie.SDKHeader.platform,ie.SDKHeader.sdkVersion)};ae||(ee["Content-Type"]="application/json"),K.hasOwnProperty("isAdminApi")&&K.isAdminApi?se.getApiKey()?ee.apiKey=se.getApiKey():ce({error:{code:"API_KEY_NOT_SET",message:"An apiKey is needed to use the "+j+" api.",name:"API_KEY_NOT_SET"}}):se.getAuthToken()?ee.authToken=se.getAuthToken():ce({error:{code:"USER_NOT_LOGED_IN",message:"An authToken is need to use the "+j+" end-point. PS- We are aware of the spelling mistake, but in order to maintain backward compatibility we cannot change it :(",name:"User not logged-in"}}),C(K.endpoint,K.method,$,ee,ae).then((function(j){return j.json()})).then((function(j){if(j.hasOwnProperty("data"))j.data.hasOwnProperty("authToken")&&te.CometChat.setAuthToken(j.data.authToken),le(j);else{if(j.hasOwnProperty("error")){var K=j.error;K.hasOwnProperty("code")&&K.code===ie.API_ERROR_CODES.AUTH_ERR_AUTH_TOKEN_NOT_FOUND&&te.CometChat.getInstance().internalLogout().then((function(){ne.Logger.log("CometChat: makeApiCall","User logged out")}))}ce(j)}})).catch((function(j){var K={error:oe.FETCH_ERROR.ERROR_IN_API_CALL};ce(K)}))})).catch((function(j){return ce}))}catch(j){ce(new re.CometChatException(j))}}))},K.makeAdminApiCall=function(j,K,$,re){void 0===j&&(j=""),void 0===K&&(K={}),void 0===$&&($={});var ae=te.CometChat.getInstance(te.CometChat.getAppId());return new Promise((function(se,le){ee.getEndPoint(j,K).then((function(K){var ee={appId:te.CometChat.getAppId(),Accept:"application/json",sdk:ne.format(ie.SDKHeader.sdk,ie.SDKHeader.platform,ie.SDKHeader.sdkVersion)};re||(ee["Content-Type"]="application/json"),K.hasOwnProperty("isAdminApi")&&K.isAdminApi?ae.getApiKey()?ee.apiKey=ae.getApiKey():le({error:"An apiKey is need to use the "+j+" api."}):ae.getAuthToken()?ee.authToken=ae.getAuthToken():le({error:"An authToken is need to use the "+j+" api."}),C(K.endpoint,K.method,$,ee,re).then((function(j){return j.json()})).then((function(j){j.hasOwnProperty("data")?(j.data.hasOwnProperty("authToken")&&te.CometChat.setAuthToken(j.data.authToken),se(j)):le(j)})).catch((function(j){var K={error:oe.FETCH_ERROR.ERROR_IN_API_CALL};le(K)}))})).catch((function(j){return le}))}))},K.postData=C},function(j,K,$){"use strict";K.__esModule=!0,K.BaseMessage=void 0;var ee=function(){function t(j,K,$,ee){this.receiverId=j,this.type=K,this.receiverType=$,this.category=ee}return t.prototype.getId=function(){return this.id},t.prototype.setId=function(j){this.id=j},t.prototype.getConversationId=function(){return this.conversationId},t.prototype.setConversationId=function(j){this.conversationId=j},t.prototype.getParentMessageId=function(){return this.parentMessageId},t.prototype.setParentMessageId=function(j){this.parentMessageId=j},t.prototype.getMuid=function(){return this.muid},t.prototype.setMuid=function(j){this.muid=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(j){this.receiver=j},t.prototype.getReceiverId=function(){return this.receiverId},t.prototype.setReceiverId=function(j){this.receiverId=j},t.prototype.getType=function(){return this.type},t.prototype.setType=function(j){this.type=j},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getSentAt=function(){return this.sentAt},t.prototype.setSentAt=function(j){this.sentAt=j},t.prototype.getStatus=function(){return this.status},t.prototype.setStatus=function(j){this.status=j},t.prototype.getDeliveredAt=function(){return this.deliveredAt},t.prototype.setDeliveredAt=function(j){this.deliveredAt=j},t.prototype.getDeliveredToMeAt=function(){return this.deliveredToMeAt},t.prototype.setDeliveredToMeAt=function(j){this.deliveredToMeAt=j},t.prototype.getReadAt=function(){return this.readAt},t.prototype.setReadAt=function(j){this.readAt=j},t.prototype.getReadByMeAt=function(){return this.readByMeAt},t.prototype.setReadByMeAt=function(j){this.readByMeAt=j},t.prototype.getCategory=function(){return this.category},t.prototype.setCategory=function(j){this.category=j},t.prototype.getEditedAt=function(){return this.editedAt},t.prototype.setEditedAt=function(j){this.editedAt=j},t.prototype.getEditedBy=function(){return this.editedBy},t.prototype.setEditedBy=function(j){this.editedBy=j},t.prototype.getDeletedAt=function(){return this.deletedAt},t.prototype.setDeletedAt=function(j){this.deletedAt=j},t.prototype.getDeletedBy=function(){return this.deletedBy},t.prototype.setDeletedBy=function(j){this.deletedBy=j},t.prototype.getReplyCount=function(){return this.replyCount},t.prototype.setReplyCount=function(j){this.replyCount=j},t.prototype.getRawMessage=function(){return this.rawMessage},t.prototype.setRawMessage=function(j){this.rawMessage=j},t}();K.BaseMessage=ee},function(j,K,$){"use strict";K.__esModule=!0,K.Group=void 0;var ee=$(1),te=function(){function t(j,K,$,ee,te,ne,re){this.hasJoined=!1,this.membersCount=0,this.guid=j,K&&(this.name=K),$&&(this.type=$),!ee&&""!==ee||"password"!=$||(this.password=ee),(te||""===te)&&(this.icon=te),(ne||""===ne)&&(this.description=ne),re&&(this.hasJoined=re)}return t.prototype.getGuid=function(){return this.guid},t.prototype.setGuid=function(j){this.guid=j},t.prototype.getName=function(){return this.name},t.prototype.setName=function(j){j&&(this.name=j)},t.prototype.getType=function(){return this.type},t.prototype.setType=function(j){this.type=j},t.prototype.getPassword=function(){return this.password},t.prototype.setPassword=function(j){this.password=j},t.prototype.getIcon=function(){return this.icon},t.prototype.setIcon=function(j){this.icon=j},t.prototype.getDescription=function(){return this.description},t.prototype.setDescription=function(j){this.description=j},t.prototype.getOwner=function(){return this.owner},t.prototype.setOwner=function(j){this.owner=j},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(j){this.metadata=j},t.prototype.getCreatedAt=function(){return this.createdAt},t.prototype.setCreatedAt=function(j){this.createdAt=j},t.prototype.getUpdatedAt=function(){return this.updatedAt},t.prototype.setUpdatedAt=function(j){this.updatedAt=j},t.prototype.getHasJoined=function(){return this.hasJoined},t.prototype.setHasJoined=function(j){this.hasJoined=j},t.prototype.getWsChannel=function(){return this.wsChannel},t.prototype.setWsChannel=function(j){this.wsChannel=j},t.prototype.setScope=function(j){this.scope=j},t.prototype.getScope=function(){return this.scope},t.prototype.getJoinedAt=function(){return this.joinedAt},t.prototype.setJoinedAt=function(j){this.joinedAt=j},t.prototype.getMembersCount=function(){return this.membersCount},t.prototype.setMembersCount=function(j){this.membersCount=j},t.prototype.setTags=function(j){this.tags=j},t.prototype.getTags=function(){return this.tags},t.TYPE=ee.GroupType,t.Type=t.TYPE,t}();K.Group=te},function(j,K,$){"use strict";K.__esModule=!0,K.CometChatEvent=void 0;var ee=$(0),te=$(5),ne=function(){function t(j,K,$,te,ne,re){ee.isFalsy(j)||(this.appId=j),ee.isFalsy(K)||(this.receiver=K),ee.isFalsy($)||(this.receiverType=$),ee.isFalsy(ne)||(this.deviceId=ne),ee.isFalsy(te)||(this.sender=te),ee.isFalsy(re)||(this.messageSender=re)}return t.prototype.getAppId=function(){return this.appId},t.prototype.setAppId=function(j){this.appId=j},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(j){this.receiver=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getType=function(){return this.type},t.prototype.setType=function(j){this.type=j},t.prototype.getDeviceId=function(){return this.deviceId},t.prototype.setDeviceId=function(j){this.deviceId=j},t.prototype.getMessageSender=function(){return this.messageSender},t.prototype.setMessageSender=function(j){this.messageSender=j},t.prototype.getCometChatEventJSON=function(){var j={};return j[te.KEYS.APP_ID]=this.getAppId(),j[te.KEYS.RECEIVER]=this.getReceiver(),j[te.KEYS.RECEIVER_TYPE]=this.getReceiverType(),j[te.KEYS.DEVICE_ID]=this.getDeviceId(),j[te.KEYS.TYPE]=this.getType(),j[te.KEYS.SENDER]=this.getSender(),ee.isFalsy(this.getMessageSender())||(j[te.KEYS.MESSAGE_SENDER]=this.getMessageSender()),j},t}();K.CometChatEvent=ne},function(j,K,$){"use strict";K.__esModule=!0,K.MessageController=void 0;var ee=$(7),te=$(16),ne=$(17),re=$(0),oe=$(1),ie=$(20),ae=$(21),se=$(22),le=$(2),ce=$(18),ue=$(19),de=$(3),pe=$(11),ge=function(){function t(){}return t.trasformJSONMessge=function(j){try{var K=null;j.hasOwnProperty("rawMessage")||(K=JSON.parse(JSON.stringify(j)));var $=void 0;switch(j[oe.MessageConstatnts.KEYS.CATEGORY]){case oe.MessageConstatnts.CATEGORY.ACTION:$=ie.Action.actionFromJSON(j);break;case oe.MessageConstatnts.CATEGORY.CALL:$=ae.Call.callFromJSON(j);break;case oe.MessageConstatnts.CATEGORY.MESSAGE:switch(j[oe.MessageConstatnts.KEYS.TYPE]){case oe.MessageConstatnts.TYPE.TEXT:$=new te.TextMessage(j[oe.MessageConstatnts.KEYS.RECEIVER],j[oe.MessageConstatnts.KEYS.DATA][oe.MessageConstatnts.KEYS.TEXT],j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;case oe.MessageConstatnts.TYPE.CUSTOM:$=new ue.CustomMessage(j[oe.MessageConstatnts.KEYS.RECEIVER],j[oe.MessageConstatnts.KEYS.DATA][oe.MessageConstatnts.KEYS.CUSTOM_DATA],j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]);break;default:if($=new ne.MediaMessage(j[oe.MessageConstatnts.KEYS.RECEIVER],j[oe.MessageConstatnts.KEYS.DATA][oe.MessageConstatnts.KEYS.URL],j[oe.MessageConstatnts.KEYS.TYPE],j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),j.hasOwnProperty(oe.MessageConstatnts.KEYS.DATA)){var le=j[oe.MessageConstatnts.KEYS.DATA];if(le.hasOwnProperty(oe.MessageConstatnts.KEYS.ATTATCHMENTS)){var de,pe=le[oe.MessageConstatnts.KEYS.ATTATCHMENTS];new Array,pe.map((function(j){de=new ce.Attachment(j)})),$.setAttachment(de)}le.hasOwnProperty(oe.MessageConstatnts.KEYS.TEXT)&&$.setCaption(le[oe.MessageConstatnts.KEYS.TEXT])}$.hasOwnProperty("file")&&delete $.file}break;case oe.MessageConstatnts.CATEGORY.CUSTOM:$=new ue.CustomMessage(j[oe.MessageConstatnts.KEYS.RECEIVER],j[oe.MessageConstatnts.KEYS.DATA][oe.MessageConstatnts.KEYS.CUSTOM_DATA],j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE],j.type)}j[oe.MessageConstatnts.KEYS.MY_RECEIPTS]&&(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS]=j[oe.MessageConstatnts.KEYS.MY_RECEIPTS],Object.keys(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS]).map((function(K){var $=new se.MessageReceipt;K==oe.DELIVERY_RECEIPTS.DELIVERED_AT&&($.setReceiptType($.RECEIPT_TYPE.DELIVERY_RECEIPT),$.setDeliveredAt(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.DELIVERY_RECEIPTS.DELIVERED_AT]),re.isFalsy(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.DELIVERY_RECEIPTS.RECIPIENT])?j[oe.DELIVERY_RECEIPTS.DELIVERED_TO_ME_AT]=j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.DELIVERY_RECEIPTS.DELIVERED_AT]:$.setSender(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.DELIVERY_RECEIPTS.RECIPIENT]),$.setReceiverType(j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),$.setReceiver(j[oe.MessageConstatnts.KEYS.RECEIVER])),j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.READ_AT]&&($.setReceiptType($.RECEIPT_TYPE.READ_RECEIPT),$.setReadAt(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.READ_AT]),re.isFalsy(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.RECIPIENT])?j[oe.READ_RECEIPTS.READ_BY_ME_AT]=j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.READ_AT]:$.setSender(j[oe.MessageConstatnts.KEYS.MY_RECEIPTS][oe.READ_RECEIPTS.RECIPIENT]),$.setReceiverType(j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),$.setReceiver(j[oe.MessageConstatnts.KEYS.RECEIVER]))})));try{if(Object.assign($,j),(j=$).parentId&&(j.parentMessageId=j.parentId,delete j.parentId),j instanceof ee.BaseMessage&&(re.isFalsy(K)||j.setRawMessage(K)),j instanceof te.TextMessage)j.setSender(j.getSender()),j.setReceiver(j.getReceiver()),j.getData()[oe.MessageConstatnts.KEYS.METADATA]&&j.setMetadata(j.getData()[oe.MessageConstatnts.KEYS.METADATA]);else if(j instanceof ne.MediaMessage)j.getData()[oe.MessageConstatnts.KEYS.METADATA]&&j.setMetadata(j.getData()[oe.MessageConstatnts.KEYS.METADATA]),j.setSender(j.getSender()),j.setReceiver(j.getReceiver());else if(j instanceof ie.Action)j.setSender(j.getSender()),j.setReceiver(j.getActionFor()),j.setActionBy(j.getActionBy()),j.setActionOn(j.getActionOn()),j.setActionFor(j.getActionFor()),j.setMessage(j.getMessage());else if(j instanceof ae.Call){try{j.setSender(j.getSender())}catch(K){re.Logger.error("MessageController: trasformJSONMessge: setSender",K)}try{j.setCallInitiator(j.getCallInitiator())}catch(K){re.Logger.error("MessageController: trasformJSONMessge: setCallInitiator",K)}try{j.setReceiver(j.getCallReceiver()),j.setCallReceiver(j.getCallReceiver())}catch(K){re.Logger.error("MessageController: trasformJSONMessge: setCallreceiver",K)}}else j instanceof ue.CustomMessage&&(j.getData()[oe.MessageConstatnts.KEYS.METADATA]&&j.setMetadata(j.getData()[oe.MessageConstatnts.KEYS.METADATA]),j.setCustomData(j.getData()[oe.MessageConstatnts.KEYS.CUSTOM_DATA]),j.setSubType(j.getData()[oe.MessageConstatnts.KEYS.CUSTOM_SUB_TYPE]),j.setSender(j.getSender()),j.setReceiver(j.getReceiver()))}catch(K){re.Logger.error("MessageController: trasformJSONMessge: Main",K),j=null}return j}catch(K){re.Logger.error("MessageController: trasformJSONMessge",K)}},t.getReceiptsFromJSON=function(j){return new Promise((function(K,$){try{var ee=[];de.CometChat.getLoggedInUser().then((function($){re.isFalsy(j.receipts)?K([]):(j.receipts.data.map((function(K){var te=new se.MessageReceipt;K[oe.DELIVERY_RECEIPTS.DELIVERED_AT]&&(te.setReceiptType(te.RECEIPT_TYPE.DELIVERY_RECEIPT),te.setDeliveredAt(K[oe.DELIVERY_RECEIPTS.DELIVERED_AT]),te.setTimestamp(K[oe.DELIVERY_RECEIPTS.DELIVERED_AT]),re.isFalsy(K[oe.DELIVERY_RECEIPTS.RECIPIENT])?te.setSender($):te.setSender(pe.UsersController.trasformJSONUser(K[oe.DELIVERY_RECEIPTS.RECIPIENT])),te.setReceiverType(j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),te.setReceiver(j[oe.MessageConstatnts.KEYS.RECEIVER])),K[oe.READ_RECEIPTS.READ_AT]&&(te.setReceiptType(te.RECEIPT_TYPE.READ_RECEIPT),te.setReadAt(K[oe.READ_RECEIPTS.READ_AT]),te.setTimestamp(K[K[oe.READ_RECEIPTS.READ_AT]]),re.isFalsy(K[oe.READ_RECEIPTS.RECIPIENT])?te.setSender($):te.setSender(pe.UsersController.trasformJSONUser(K[oe.READ_RECEIPTS.RECIPIENT])),te.setReceiverType(j[oe.MessageConstatnts.KEYS.RECEIVER_TYPE]),te.setReceiver(j[oe.MessageConstatnts.KEYS.RECEIVER])),ee.push(te)})),K(ee))}))}catch(K){$(new le.CometChatException(K))}}))},t}();K.MessageController=ge},function(j,K,$){"use strict";K.__esModule=!0,K.UsersController=void 0;var ee=$(4),te=$(0),ne=function(){function t(){}return t.trasformJSONUser=function(j){var K;try{j.uid=j.uid.toString(),j.name=j.name.toString(),j.status&&"offline"!==j.status?j.status="online":j.status="offline",K=new ee.User(j),Object.assign(K,j),j=K}catch(j){te.Logger.error("UsersController:transformJSONUser",j)}return j},t}();K.UsersController=ne},function(j,K,$){(function(K){j.exports=function s(j,K,$){function E(te,ne){if(!K[te]){if(!j[te]){if(ee)return ee(te,!0);var re=new Error("Cannot find module '"+te+"'");throw re.code="MODULE_NOT_FOUND",re}var oe=K[te]={exports:{}};j[te][0].call(oe.exports,(function(K){return E(j[te][1][K]||K)}),oe,oe.exports,s,j,K,$)}return K[te].exports}for(var ee=!1,te=0;te<$.length;te++)E($[te]);return E}({1:[function(j,$,ee){(function(j){"use strict";var K,ee,te=j.MutationObserver||j.WebKitMutationObserver;if(te){var ne=0,re=new te(c),oe=j.document.createTextNode("");re.observe(oe,{characterData:!0}),K=function(){oe.data=ne=++ne%2}}else if(j.setImmediate||void 0===j.MessageChannel)K="document"in j&&"onreadystatechange"in j.document.createElement("script")?function(){var K=j.document.createElement("script");K.onreadystatechange=function(){c(),K.onreadystatechange=null,K.parentNode.removeChild(K),K=null},j.document.documentElement.appendChild(K)}:function(){setTimeout(c,0)};else{var ie=new j.MessageChannel;ie.port1.onmessage=c,K=function(){ie.port2.postMessage(0)}}var ae=[];function c(){var j,K;ee=!0;for(var $=ae.length;$;){for(K=ae,ae=[],j=-1;++j<$;)K[j]();$=ae.length}ee=!1}$.exports=function(j){1!==ae.push(j)||ee||K()}}).call(this,void 0!==K?K:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(j,K,$){"use strict";var ee=j(1);function c(){}var te={},ne=["REJECTED"],re=["FULFILLED"],oe=["PENDING"];function o(j){if("function"!=typeof j)throw new TypeError("resolver must be a function");this.state=oe,this.queue=[],this.outcome=void 0,j!==c&&p(this,j)}function E(j,K,$){this.promise=j,"function"==typeof K&&(this.onFulfilled=K,this.callFulfilled=this.otherCallFulfilled),"function"==typeof $&&(this.onRejected=$,this.callRejected=this.otherCallRejected)}function S(j,K,$){ee((function(){var ee;try{ee=K($)}catch(ee){return te.reject(j,ee)}ee===j?te.reject(j,new TypeError("Cannot resolve promise with itself")):te.resolve(j,ee)}))}function l(j){var K=j&&j.then;if(j&&("object"==typeof j||"function"==typeof j)&&"function"==typeof K)return function(){K.apply(j,arguments)}}function p(j,K){var $=!1;function o(K){$||($=!0,te.reject(j,K))}function s(K){$||($=!0,te.resolve(j,K))}var ee=C((function(){K(s,o)}));"error"===ee.status&&o(ee.value)}function C(j,K){var $={};try{$.value=j(K),$.status="success"}catch(j){$.status="error",$.value=j}return $}(K.exports=o).prototype.catch=function(j){return this.then(null,j)},o.prototype.then=function(j,K){if("function"!=typeof j&&this.state===re||"function"!=typeof K&&this.state===ne)return this;var $=new this.constructor(c);return this.state!==oe?S($,this.state===re?j:K,this.outcome):this.queue.push(new E($,j,K)),$},E.prototype.callFulfilled=function(j){te.resolve(this.promise,j)},E.prototype.otherCallFulfilled=function(j){S(this.promise,this.onFulfilled,j)},E.prototype.callRejected=function(j){te.reject(this.promise,j)},E.prototype.otherCallRejected=function(j){S(this.promise,this.onRejected,j)},te.resolve=function(j,K){var $=C(l,K);if("error"===$.status)return te.reject(j,$.value);var ee=$.value;if(ee)p(j,ee);else{j.state=re,j.outcome=K;for(var ne=-1,oe=j.queue.length;++ne<oe;)j.queue[ne].callFulfilled(K)}return j},te.reject=function(j,K){j.state=ne,j.outcome=K;for(var $=-1,ee=j.queue.length;++$<ee;)j.queue[$].callRejected(K);return j},o.resolve=function(j){return j instanceof this?j:te.resolve(new this(c),j)},o.reject=function(j){var K=new this(c);return te.reject(K,j)},o.all=function(j){var K=this;if("[object Array]"!==Object.prototype.toString.call(j))return this.reject(new TypeError("must be an array"));var $=j.length,ee=!1;if(!$)return this.resolve([]);for(var ne=new Array($),re=0,oe=-1,ie=new this(c);++oe<$;)E(j[oe],oe);return ie;function E(j,oe){K.resolve(j).then((function(j){ne[oe]=j,++re!==$||ee||(ee=!0,te.resolve(ie,ne))}),(function(j){ee||(ee=!0,te.reject(ie,j))}))}},o.race=function(j){var K=this;if("[object Array]"!==Object.prototype.toString.call(j))return this.reject(new TypeError("must be an array"));var $=j.length,ee=!1;if(!$)return this.resolve([]);for(var ne,re=-1,oe=new this(c);++re<$;)ne=j[re],K.resolve(ne).then((function(j){ee||(ee=!0,te.resolve(oe,j))}),(function(j){ee||(ee=!0,te.reject(oe,j))}));return oe}},{1:1}],3:[function(j,$,ee){(function(K){"use strict";"function"!=typeof K.Promise&&(K.Promise=j(2))}).call(this,void 0!==K?K:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(j,K,$){"use strict";var ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(j){return typeof j}:function(j){return j&&"function"==typeof Symbol&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},te=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(j){return}}();function i(j,K){j=j||[],K=K||{};try{return new Blob(j,K)}catch(te){if("TypeError"!==te.name)throw te;for(var $=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),ee=0;ee<j.length;ee+=1)$.append(j[ee]);return $.getBlob(K.type)}}"undefined"==typeof Promise&&j(3);var ne=Promise;function l(j,K){K&&j.then((function(j){K(null,j)}),(function(j){K(j)}))}function c(j,K,$){"function"==typeof K&&j.then(K),"function"==typeof $&&j.catch($)}function u(j){return"string"!=typeof j&&(j=String(j)),j}function r(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var re="local-forage-detect-blob-support",oe=void 0,ie={},ae=Object.prototype.toString,se="readonly",le="readwrite";function _(j){return"boolean"==typeof oe?ne.resolve(oe):(K=j,new ne((function(j){var $=K.transaction(re,le),ee=i([""]);$.objectStore(re).put(ee,"key"),$.onabort=function(K){K.preventDefault(),K.stopPropagation(),j(!1)},$.oncomplete=function(){var K=navigator.userAgent.match(/Chrome\/(\d+)/),$=navigator.userAgent.match(/Edge\//);j($||!K||43<=parseInt(K[1],10))}})).catch((function(){return!1}))).then((function(j){return oe=j}));var K}function g(j){var K=ie[j.name],$={};$.promise=new ne((function(j,K){$.resolve=j,$.reject=K})),K.deferredOperations.push($),K.dbReady?K.dbReady=K.dbReady.then((function(){return $.promise})):K.dbReady=$.promise}function h(j){var K=ie[j.name].deferredOperations.pop();if(K)return K.resolve(),K.promise}function A(j,K){var $=ie[j.name].deferredOperations.pop();if($)return $.reject(K),$.promise}function R(j,K){return new ne((function($,ee){if(ie[j.name]=ie[j.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},j.db){if(!K)return $(j.db);g(j),j.db.close()}var ne=[j.name];K&&ne.push(j.version);var oe=te.open.apply(te,ne);K&&(oe.onupgradeneeded=function(K){var $=oe.result;try{$.createObjectStore(j.storeName),K.oldVersion<=1&&$.createObjectStore(re)}catch(K){if("ConstraintError"!==K.name)throw K}}),oe.onerror=function(j){j.preventDefault(),ee(oe.error)},oe.onsuccess=function(){$(oe.result),h(j)}}))}function I(j){return R(j,!1)}function f(j){return R(j,!0)}function O(j,K){if(!j.db)return!0;var $=!j.db.objectStoreNames.contains(j.storeName),ee=j.version<j.db.version,te=j.version>j.db.version;if(ee&&(j.version,j.version=j.db.version),te||$){if($){var ne=j.db.version+1;ne>j.version&&(j.version=ne)}return!0}return!1}function N(j){var K=function(j){for(var K=j.length,$=new ArrayBuffer(K),ee=new Uint8Array($),te=0;te<K;te++)ee[te]=j.charCodeAt(te);return $}(atob(j.data));return i([K],{type:j.type})}function y(j){return j&&j.__local_forage_encoded_blob}function m(j){var K=this,$=K._initReady().then((function(){var j=ie[K._dbInfo.name];if(j&&j.dbReady)return j.dbReady}));return c($,j,j),$}function L(j,K,$,ee){void 0===ee&&(ee=1);try{var te=j.db.transaction(j.storeName,K);$(null,te)}catch(te){if(0<ee&&(!j.db||"InvalidStateError"===te.name||"NotFoundError"===te.name))return ne.resolve().then((function(){if(!j.db||"NotFoundError"===te.name&&!j.db.objectStoreNames.contains(j.storeName)&&j.version<=j.db.version)return j.db&&(j.version=j.db.version+1),f(j)})).then((function(){return function(j){g(j);for(var K=ie[j.name],$=K.forages,ee=0;ee<$.length;ee++){var te=$[ee];te._dbInfo.db&&(te._dbInfo.db.close(),te._dbInfo.db=null)}return j.db=null,I(j).then((function(K){return j.db=K,O(j)?f(j):K})).then((function(ee){j.db=K.db=ee;for(var te=0;te<$.length;te++)$[te]._dbInfo.db=ee})).catch((function(K){throw A(j,K),K}))}(j).then((function(){L(j,K,$,ee-1)}))})).catch($);$(te)}}var ce={_driver:"asyncStorage",_initStorage:function(j){var K=this,$={db:null};if(j)for(var ee in j)$[ee]=j[ee];var te=ie[$.name];te||(te={forages:[],db:null,dbReady:null,deferredOperations:[]},ie[$.name]=te),te.forages.push(K),K._initReady||(K._initReady=K.ready,K.ready=m);var re=[];function i(){return ne.resolve()}for(var oe=0;oe<te.forages.length;oe++){var ae=te.forages[oe];ae!==K&&re.push(ae._initReady().catch(i))}var se=te.forages.slice(0);return ne.all(re).then((function(){return $.db=te.db,I($)})).then((function(j){return $.db=j,O($,K._defaultConfig.version)?f($):j})).then((function(j){$.db=te.db=j,K._dbInfo=$;for(var ee=0;ee<se.length;ee++){var ne=se[ee];ne!==K&&(ne._dbInfo.db=$.db,ne._dbInfo.version=$.version)}}))},_support:function(){try{if(!te)return!1;var j="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),K="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!j||K)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(j){return!1}}(),iterate:function(j,K){var $=this,ee=new ne((function(K,ee){$.ready().then((function(){L($._dbInfo,se,(function(te,ne){if(te)return ee(te);try{var re=ne.objectStore($._dbInfo.storeName).openCursor(),oe=1;re.onsuccess=function(){var $=re.result;if($){var ee=$.value;y(ee)&&(ee=N(ee));var te=j(ee,$.key,oe++);void 0!==te?K(te):$.continue()}else K()},re.onerror=function(){ee(re.error)}}catch(te){ee(te)}}))})).catch(ee)}));return l(ee,K),ee},getItem:function(j,K){var $=this;j=u(j);var ee=new ne((function(K,ee){$.ready().then((function(){L($._dbInfo,se,(function(te,ne){if(te)return ee(te);try{var re=ne.objectStore($._dbInfo.storeName).get(j);re.onsuccess=function(){var j=re.result;void 0===j&&(j=null),y(j)&&(j=N(j)),K(j)},re.onerror=function(){ee(re.error)}}catch(te){ee(te)}}))})).catch(ee)}));return l(ee,K),ee},setItem:function(j,K,$){var ee=this;j=u(j);var te=new ne((function($,te){var re;ee.ready().then((function(){return re=ee._dbInfo,"[object Blob]"===ae.call(K)?_(re.db).then((function(j){return j?K:($=K,new ne((function(j,K){var ee=new FileReader;ee.onerror=K,ee.onloadend=function(K){var ee=btoa(K.target.result||"");j({__local_forage_encoded_blob:!0,data:ee,type:$.type})},ee.readAsBinaryString($)})));var $})):K})).then((function(K){L(ee._dbInfo,le,(function(ne,re){if(ne)return te(ne);try{var oe=re.objectStore(ee._dbInfo.storeName);null===K&&(K=void 0);var ie=oe.put(K,j);re.oncomplete=function(){void 0===K&&(K=null),$(K)},re.onabort=re.onerror=function(){var j=ie.error?ie.error:ie.transaction.error;te(j)}}catch(ne){te(ne)}}))})).catch(te)}));return l(te,$),te},removeItem:function(j,K){var $=this;j=u(j);var ee=new ne((function(K,ee){$.ready().then((function(){L($._dbInfo,le,(function(te,ne){if(te)return ee(te);try{var re=ne.objectStore($._dbInfo.storeName).delete(j);ne.oncomplete=function(){K()},ne.onerror=function(){ee(re.error)},ne.onabort=function(){var j=re.error?re.error:re.transaction.error;ee(j)}}catch(te){ee(te)}}))})).catch(ee)}));return l(ee,K),ee},clear:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){L(K._dbInfo,le,(function(ee,te){if(ee)return $(ee);try{var ne=te.objectStore(K._dbInfo.storeName).clear();te.oncomplete=function(){j()},te.onabort=te.onerror=function(){var j=ne.error?ne.error:ne.transaction.error;$(j)}}catch(ee){$(ee)}}))})).catch($)}));return l($,j),$},length:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){L(K._dbInfo,se,(function(ee,te){if(ee)return $(ee);try{var ne=te.objectStore(K._dbInfo.storeName).count();ne.onsuccess=function(){j(ne.result)},ne.onerror=function(){$(ne.error)}}catch(ee){$(ee)}}))})).catch($)}));return l($,j),$},key:function(j,K){var $=this,ee=new ne((function(K,ee){j<0?K(null):$.ready().then((function(){L($._dbInfo,se,(function(te,ne){if(te)return ee(te);try{var re=ne.objectStore($._dbInfo.storeName),oe=!1,ie=re.openCursor();ie.onsuccess=function(){var $=ie.result;$?0===j||oe?K($.key):(oe=!0,$.advance(j)):K(null)},ie.onerror=function(){ee(ie.error)}}catch(te){ee(te)}}))})).catch(ee)}));return l(ee,K),ee},keys:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){L(K._dbInfo,se,(function(ee,te){if(ee)return $(ee);try{var ne=te.objectStore(K._dbInfo.storeName).openCursor(),re=[];ne.onsuccess=function(){var K=ne.result;K?(re.push(K.key),K.continue()):j(re)},ne.onerror=function(){$(ne.error)}}catch(ee){$(ee)}}))})).catch($)}));return l($,j),$},dropInstance:function(j,K){K=r.apply(this,arguments);var $,ee=this.config();if((j="function"!=typeof j&&j||{}).name||(j.name=j.name||ee.name,j.storeName=j.storeName||ee.storeName),j.name){var re=j.name===ee.name&&this._dbInfo.db?ne.resolve(this._dbInfo.db):I(j).then((function(K){var $=ie[j.name],ee=$.forages;$.db=K;for(var te=0;te<ee.length;te++)ee[te]._dbInfo.db=K;return K}));$=j.storeName?re.then((function(K){if(K.objectStoreNames.contains(j.storeName)){var $=K.version+1;g(j);var ee=ie[j.name],re=ee.forages;K.close();for(var oe=0;oe<re.length;oe++){var ae=re[oe];ae._dbInfo.db=null,ae._dbInfo.version=$}var se=new ne((function(K,ee){var ne=te.open(j.name,$);ne.onerror=function(j){ne.result.close(),ee(j)},ne.onupgradeneeded=function(){ne.result.deleteObjectStore(j.storeName)},ne.onsuccess=function(){var j=ne.result;j.close(),K(j)}}));return se.then((function(j){ee.db=j;for(var K=0;K<re.length;K++){var $=re[K];$._dbInfo.db=j,h($._dbInfo)}})).catch((function(K){throw(A(j,K)||ne.resolve()).catch((function(){})),K}))}})):re.then((function(K){g(j);var $=ie[j.name],ee=$.forages;K.close();for(var re=0;re<ee.length;re++)ee[re]._dbInfo.db=null;var oe=new ne((function(K,$){var ee=te.deleteDatabase(j.name);ee.onerror=ee.onblocked=function(j){var K=ee.result;K&&K.close(),$(j)},ee.onsuccess=function(){var j=ee.result;j&&j.close(),K(j)}}));return oe.then((function(j){$.db=j;for(var K=0;K<ee.length;K++)h(ee[K]._dbInfo)})).catch((function(K){throw(A(j,K)||ne.resolve()).catch((function(){})),K}))}))}else $=ne.reject("Invalid arguments");return l($,K),$}},ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",de=/^~~local_forage_type~([^~]+)~/,pe="__lfsc__:",ge=pe.length,he="arbf",me="blob",fe=ge+he.length,ye=Object.prototype.toString;function b(j){var K,$,ee,te,ne,re=.75*j.length,oe=j.length,ie=0;"="===j[j.length-1]&&(re--,"="===j[j.length-2]&&re--);var ae=new ArrayBuffer(re),se=new Uint8Array(ae);for(K=0;K<oe;K+=4)$=ue.indexOf(j[K]),ee=ue.indexOf(j[K+1]),te=ue.indexOf(j[K+2]),ne=ue.indexOf(j[K+3]),se[ie++]=$<<2|ee>>4,se[ie++]=(15&ee)<<4|te>>2,se[ie++]=(3&te)<<6|63≠return ae}function B(j){var K,$=new Uint8Array(j),ee="";for(K=0;K<$.length;K+=3)ee+=ue[$[K]>>2],ee+=ue[(3&$[K])<<4|$[K+1]>>4],ee+=ue[(15&$[K+1])<<2|$[K+2]>>6],ee+=ue[63&$[K+2]];return $.length%3==2?ee=ee.substring(0,ee.length-1)+"=":$.length%3==1&&(ee=ee.substring(0,ee.length-2)+"=="),ee}var be={serialize:function(j,K){var $="";if(j&&($=ye.call(j)),j&&("[object ArrayBuffer]"===$||j.buffer&&"[object ArrayBuffer]"===ye.call(j.buffer))){var ee,te=pe;j instanceof ArrayBuffer?(ee=j,te+=he):(ee=j.buffer,"[object Int8Array]"===$?te+="si08":"[object Uint8Array]"===$?te+="ui08":"[object Uint8ClampedArray]"===$?te+="uic8":"[object Int16Array]"===$?te+="si16":"[object Uint16Array]"===$?te+="ur16":"[object Int32Array]"===$?te+="si32":"[object Uint32Array]"===$?te+="ui32":"[object Float32Array]"===$?te+="fl32":"[object Float64Array]"===$?te+="fl64":K(new Error("Failed to get type for BinaryArray"))),K(te+B(ee))}else if("[object Blob]"===$){var ne=new FileReader;ne.onload=function(){var $="~~local_forage_type~"+j.type+"~"+B(this.result);K(pe+me+$)},ne.readAsArrayBuffer(j)}else try{K(JSON.stringify(j))}catch($){K(null,$)}},deserialize:function(j){if(j.substring(0,ge)!==pe)return JSON.parse(j);var K,$=j.substring(fe),ee=j.substring(ge,fe);if(ee===me&&de.test($)){var te=$.match(de);K=te[1],$=$.substring(te[0].length)}var ne=b($);switch(ee){case he:return ne;case me:return i([ne],{type:K});case"si08":return new Int8Array(ne);case"ui08":return new Uint8Array(ne);case"uic8":return new Uint8ClampedArray(ne);case"si16":return new Int16Array(ne);case"ur16":return new Uint16Array(ne);case"si32":return new Int32Array(ne);case"ui32":return new Uint32Array(ne);case"fl32":return new Float32Array(ne);case"fl64":return new Float64Array(ne);default:throw new Error("Unkown type: "+ee)}},stringToBuffer:b,bufferToString:B};function V(j,K,$,ee){j.executeSql("CREATE TABLE IF NOT EXISTS "+K.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],$,ee)}function x(j,K,$,ee,te,ne){j.executeSql($,ee,te,(function(j,re){re.code===re.SYNTAX_ERR?j.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[K.storeName],(function(j,oe){oe.rows.length?ne(j,re):V(j,K,(function(){j.executeSql($,ee,te,ne)}),ne)}),ne):ne(j,re)}),ne)}function k(j,K,$,ee){var te=this;j=u(j);var re=new ne((function(ne,re){te.ready().then((function(){void 0===K&&(K=null);var oe=K,ie=te._dbInfo;ie.serializer.serialize(K,(function(K,ae){ae?re(ae):ie.db.transaction((function($){x($,ie,"INSERT OR REPLACE INTO "+ie.storeName+" (key, value) VALUES (?, ?)",[j,K],(function(){ne(oe)}),(function(j,K){re(K)}))}),(function(K){if(K.code===K.QUOTA_ERR){if(0<ee)return void ne(k.apply(te,[j,oe,$,ee-1]));re(K)}}))}))})).catch(re)}));return l(re,$),re}var ve={_driver:"webSQLStorage",_initStorage:function(j){var K=this,$={db:null};if(j)for(var ee in j)$[ee]="string"!=typeof j[ee]?j[ee].toString():j[ee];var te=new ne((function(j,ee){try{$.db=openDatabase($.name,String($.version),$.description,$.size)}catch(j){return ee(j)}$.db.transaction((function(te){V(te,$,(function(){K._dbInfo=$,j()}),(function(j,K){ee(K)}))}),ee)}));return $.serializer=be,te},_support:"function"==typeof openDatabase,iterate:function(j,K){var $=this,ee=new ne((function(K,ee){$.ready().then((function(){var te=$._dbInfo;te.db.transaction((function($){x($,te,"SELECT * FROM "+te.storeName,[],(function($,ee){for(var ne=ee.rows,re=ne.length,oe=0;oe<re;oe++){var ie=ne.item(oe),ae=ie.value;if(ae&&(ae=te.serializer.deserialize(ae)),void 0!==(ae=j(ae,ie.key,oe+1)))return void K(ae)}K()}),(function(j,K){ee(K)}))}))})).catch(ee)}));return l(ee,K),ee},getItem:function(j,K){var $=this;j=u(j);var ee=new ne((function(K,ee){$.ready().then((function(){var te=$._dbInfo;te.db.transaction((function($){x($,te,"SELECT * FROM "+te.storeName+" WHERE key = ? LIMIT 1",[j],(function(j,$){var ee=$.rows.length?$.rows.item(0).value:null;ee&&(ee=te.serializer.deserialize(ee)),K(ee)}),(function(j,K){ee(K)}))}))})).catch(ee)}));return l(ee,K),ee},setItem:function(j,K,$){return k.apply(this,[j,K,$,1])},removeItem:function(j,K){var $=this;j=u(j);var ee=new ne((function(K,ee){$.ready().then((function(){var te=$._dbInfo;te.db.transaction((function($){x($,te,"DELETE FROM "+te.storeName+" WHERE key = ?",[j],(function(){K()}),(function(j,K){ee(K)}))}))})).catch(ee)}));return l(ee,K),ee},clear:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){var ee=K._dbInfo;ee.db.transaction((function(K){x(K,ee,"DELETE FROM "+ee.storeName,[],(function(){j()}),(function(j,K){$(K)}))}))})).catch($)}));return l($,j),$},length:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){var ee=K._dbInfo;ee.db.transaction((function(K){x(K,ee,"SELECT COUNT(key) as c FROM "+ee.storeName,[],(function(K,$){var ee=$.rows.item(0).c;j(ee)}),(function(j,K){$(K)}))}))})).catch($)}));return l($,j),$},key:function(j,K){var $=this,ee=new ne((function(K,ee){$.ready().then((function(){var te=$._dbInfo;te.db.transaction((function($){x($,te,"SELECT key FROM "+te.storeName+" WHERE id = ? LIMIT 1",[j+1],(function(j,$){var ee=$.rows.length?$.rows.item(0).key:null;K(ee)}),(function(j,K){ee(K)}))}))})).catch(ee)}));return l(ee,K),ee},keys:function(j){var K=this,$=new ne((function(j,$){K.ready().then((function(){var ee=K._dbInfo;ee.db.transaction((function(K){x(K,ee,"SELECT key FROM "+ee.storeName,[],(function(K,$){for(var ee=[],te=0;te<$.rows.length;te++)ee.push($.rows.item(te).key);j(ee)}),(function(j,K){$(K)}))}))})).catch($)}));return l($,j),$},dropInstance:function(j,K){K=r.apply(this,arguments);var $=this.config();(j="function"!=typeof j&&j||{}).name||(j.name=j.name||$.name,j.storeName=j.storeName||$.storeName);var ee,te=this;return l(ee=j.name?new ne((function(K){var ee,re;ee=j.name===$.name?te._dbInfo.db:openDatabase(j.name,"","",0),j.storeName?K({db:ee,storeNames:[j.storeName]}):K((re=ee,new ne((function(j,K){re.transaction((function($){$.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(K,$){for(var ee=[],te=0;te<$.rows.length;te++)ee.push($.rows.item(te).name);j({db:re,storeNames:ee})}),(function(j,$){K($)}))}),(function(j){K(j)}))}))))})).then((function(j){return new ne((function(K,$){j.db.transaction((function(ee){function t(j){return new ne((function(K,$){ee.executeSql("DROP TABLE IF EXISTS "+j,[],(function(){K()}),(function(j,K){$(K)}))}))}for(var te=[],re=0,oe=j.storeNames.length;re<oe;re++)te.push(t(j.storeNames[re]));ne.all(te).then((function(){K()})).catch((function(j){$(j)}))}),(function(j){$(j)}))}))})):ne.reject("Invalid arguments"),K),ee}};function H(j,K){var $=j.name+"/";return j.storeName!==K.storeName&&($+=j.storeName+"/"),$}function W(){return!function(){var j="_localforage_support_test";try{return localStorage.setItem(j,!0),localStorage.removeItem(j),!1}catch(j){return!0}}()||0<localStorage.length}var Me={_driver:"localStorageWrapper",_initStorage:function(j){var K={};if(j)for(var $ in j)K[$]=j[$];return K.keyPrefix=H(j,this._defaultConfig),W()?((this._dbInfo=K).serializer=be,ne.resolve()):ne.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(j){return!1}}(),iterate:function(j,K){var $=this,ee=$.ready().then((function(){for(var K=$._dbInfo,ee=K.keyPrefix,te=ee.length,ne=localStorage.length,re=1,oe=0;oe<ne;oe++){var ie=localStorage.key(oe);if(0===ie.indexOf(ee)){var ae=localStorage.getItem(ie);if(ae&&(ae=K.serializer.deserialize(ae)),void 0!==(ae=j(ae,ie.substring(te),re++)))return ae}}}));return l(ee,K),ee},getItem:function(j,K){var $=this;j=u(j);var ee=$.ready().then((function(){var K=$._dbInfo,ee=localStorage.getItem(K.keyPrefix+j);return ee&&(ee=K.serializer.deserialize(ee)),ee}));return l(ee,K),ee},setItem:function(j,K,$){var ee=this;j=u(j);var te=ee.ready().then((function(){void 0===K&&(K=null);var $=K;return new ne((function(te,ne){var re=ee._dbInfo;re.serializer.serialize(K,(function(K,ee){if(ee)ne(ee);else try{localStorage.setItem(re.keyPrefix+j,K),te($)}catch(K){"QuotaExceededError"!==K.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==K.name||ne(K),ne(K)}}))}))}));return l(te,$),te},removeItem:function(j,K){var $=this;j=u(j);var ee=$.ready().then((function(){var K=$._dbInfo;localStorage.removeItem(K.keyPrefix+j)}));return l(ee,K),ee},clear:function(j){var K=this,$=K.ready().then((function(){for(var j=K._dbInfo.keyPrefix,$=localStorage.length-1;0<=$;$--){var ee=localStorage.key($);0===ee.indexOf(j)&&localStorage.removeItem(ee)}}));return l($,j),$},length:function(j){var K=this.keys().then((function(j){return j.length}));return l(K,j),K},key:function(j,K){var $=this,ee=$.ready().then((function(){var K,ee=$._dbInfo;try{K=localStorage.key(j)}catch(ee){K=null}return K&&(K=K.substring(ee.keyPrefix.length)),K}));return l(ee,K),ee},keys:function(j){var K=this,$=K.ready().then((function(){for(var j=K._dbInfo,$=localStorage.length,ee=[],te=0;te<$;te++){var ne=localStorage.key(te);0===ne.indexOf(j.keyPrefix)&&ee.push(ne.substring(j.keyPrefix.length))}return ee}));return l($,j),$},dropInstance:function(j,K){if(K=r.apply(this,arguments),!(j="function"!=typeof j&&j||{}).name){var $=this.config();j.name=j.name||$.name,j.storeName=j.storeName||$.storeName}var ee,te=this;return l(ee=j.name?new ne((function(K){j.storeName?K(H(j,te._defaultConfig)):K(j.name+"/")})).then((function(j){for(var K=localStorage.length-1;0<=K;K--){var $=localStorage.key(K);0===$.indexOf(j)&&localStorage.removeItem($)}})):ne.reject("Invalid arguments"),K),ee}},X=function(j,K){for(var $=j.length,ee=0;ee<$;){if((te=j[ee])===(ne=K)||"number"==typeof te&&"number"==typeof ne&&isNaN(te)&&isNaN(ne))return!0;ee++}var te,ne;return!1},Ee=Array.isArray||function(j){return"[object Array]"===Object.prototype.toString.call(j)},Se={},Ce={},_e={INDEXEDDB:ce,WEBSQL:ve,LOCALSTORAGE:Me},Te=[_e.INDEXEDDB._driver,_e.WEBSQL._driver,_e.LOCALSTORAGE._driver],Ae=["dropInstance"],Ie=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ae),Ne={description:"",driver:Te.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ot(j,K){j[K]=function(){var $=arguments;return j.ready().then((function(){return j[K].apply(j,$)}))}}function st(){for(var j=1;j<arguments.length;j++){var K=arguments[j];if(K)for(var $ in K)K.hasOwnProperty($)&&(Ee(K[$])?arguments[0][$]=K[$].slice():arguments[0][$]=K[$])}return arguments[0]}var Oe=function(){function s(j){for(var K in function(j,K){if(!(j instanceof K))throw new TypeError("Cannot call a class as a function")}(this,s),_e)if(_e.hasOwnProperty(K)){var $=_e[K],ee=$._driver;this[K]=ee,Se[ee]||this.defineDriver($)}this._defaultConfig=st({},Ne),this._config=st({},this._defaultConfig,j),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return s.prototype.config=function(j){if("object"!==(void 0===j?"undefined":ee(j)))return"string"==typeof j?this._config[j]:this._config;if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var K in j){if("storeName"===K&&(j[K]=j[K].replace(/\W/g,"_")),"version"===K&&"number"!=typeof j[K])return new Error("Database version must be a number.");this._config[K]=j[K]}return!("driver"in j&&j.driver)||this.setDriver(this._config.driver)},s.prototype.defineDriver=function(j,K,$){var ee=new ne((function(K,$){try{var ee=j._driver,te=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!j._driver)return void $(te);for(var re=Ie.concat("_initStorage"),oe=0,ie=re.length;oe<ie;oe++){var ae=re[oe];if((!X(Ae,ae)||j[ae])&&"function"!=typeof j[ae])return void $(te)}!function(){for(var t=function(j){return function(){var K=new Error("Method "+j+" is not implemented by the current driver"),$=ne.reject(K);return l($,arguments[arguments.length-1]),$}},K=0,$=Ae.length;K<$;K++){var ee=Ae[K];j[ee]||(j[ee]=t(ee))}}();var c=function($){Se[ee],Se[ee]=j,Ce[ee]=$,K()};"_support"in j?j._support&&"function"==typeof j._support?j._support().then(c,$):c(!!j._support):c(!0)}catch(te){$(te)}}));return c(ee,K,$),ee},s.prototype.driver=function(){return this._driver||null},s.prototype.getDriver=function(j,K,$){var ee=Se[j]?ne.resolve(Se[j]):ne.reject(new Error("Driver not found."));return c(ee,K,$),ee},s.prototype.getSerializer=function(j){var K=ne.resolve(be);return c(K,j),K},s.prototype.ready=function(j){var K=this,$=K._driverSet.then((function(){return null===K._ready&&(K._ready=K._initDriver()),K._ready}));return c($,j,j),$},s.prototype.setDriver=function(j,K,$){var ee=this;Ee(j)||(j=[j]);var te=this._getSupportedDrivers(j);function i(){ee._config.driver=ee.driver()}function a(j){return ee._extend(j),i(),ee._ready=ee._initStorage(ee._config),ee._ready}var re=null!==this._driverSet?this._driverSet.catch((function(){return ne.resolve()})):ne.resolve();return this._driverSet=re.then((function(){var j=te[0];return ee._dbInfo=null,ee._ready=null,ee.getDriver(j).then((function(j){var K;ee._driver=j._driver,i(),ee._wrapLibraryMethodsWithReady(),ee._initDriver=(K=te,function(){var j=0;function o(){for(;j<K.length;){var $=K[j];return j++,ee._dbInfo=null,ee._ready=null,ee.getDriver($).then(a).catch(o)}i();var te=new Error("No available storage method found.");return ee._driverSet=ne.reject(te),ee._driverSet}return o()})}))})).catch((function(){i();var j=new Error("No available storage method found.");return ee._driverSet=ne.reject(j),ee._driverSet})),c(this._driverSet,K,$),this._driverSet},s.prototype.supports=function(j){return!!Ce[j]},s.prototype._extend=function(j){st(this,j)},s.prototype._getSupportedDrivers=function(j){for(var K=[],$=0,ee=j.length;$<ee;$++){var te=j[$];this.supports(te)&&K.push(te)}return K},s.prototype._wrapLibraryMethodsWithReady=function(){for(var j=0,K=Ie.length;j<K;j++)ot(this,Ie[j])},s.prototype.createInstance=function(j){return new s(j)},s}(),we=new Oe;K.exports=we},{3:3}]},{},[4])(4)}).call(this,$(39))},function(j,K,$){"use strict";K.__esModule=!0,K.FETCH_ERROR=K.TYPINGNOTIFICATION_CONSTANTS=K.LOGIN_ERROR=K.MESSAGE_ERRORS=K.MESSAGES_REQUEST_ERRORS=K.USERS_REQUEST_ERRORS=K.GROUP_CREATION_ERRORS=K.INIT_ERROR=K.ERRORS=K.SERVER_ERRORS=void 0,K.SERVER_ERRORS={AUTH_ERR:{code:"AUTH_ERR_AUTH_TOKEN_NOT_FOUND",message:"The auth token %s% does not exist. Please make sure you are logged in and have a valid auth token or try login again."}},K.ERRORS={PARAMETER_MISSING:{code:"MISSING_PARAMETERS",name:"Invalid or no parameter passed to the method."}},K.INIT_ERROR={NO_APP_ID:{code:K.ERRORS.PARAMETER_MISSING.code,name:K.ERRORS.PARAMETER_MISSING.name,message:"AppID cannot be empty. Please specify a valid appID.",details:{}}},K.GROUP_CREATION_ERRORS={EMPTY_PASSWORD:{code:"ERR_EMPTY_GROUP_PASS",details:void 0,message:"Password is mandatory to join a group.",name:void 0}},K.USERS_REQUEST_ERRORS={EMPTY_USERS_LIST:{code:"EMPTY_USERS_LIST",name:"EMPTY_USERS_LIST",message:"The users list needs to have atleast one UID.",details:{}}},K.MESSAGES_REQUEST_ERRORS={REQUEST_IN_PROGRESS_ERROR:{code:"REQUEST_IN_PROGRESS",name:"REQUEST_IN_PROGRESS",message:"Request in progress.",details:{}},NOT_ENOUGH_PARAMS:{code:"NOT_ENOUGH_PARAMETERS",name:"NOT_ENOUGH_PARAMETERS",message:"`Timestamp`, `MessageId` or `updatedAfter` is required to use the 'fetchNext()' method.",details:{}}},K.MESSAGE_ERRORS={INVALID_CUSTOM_DATA:{code:"-1",name:"%s_CUSTOM_DATA",message:"",details:{}}},K.LOGIN_ERROR={NOT_INITIALIZED:{code:"-1",name:"COMETCHAT_INITIALIZATION_NOT_DONE",message:"please initialize the cometchat before using login method.",details:{}},UNAUTHORISED:{code:401,name:"USER_NOT_AUTHORISED",message:"The `authToken` of the user is not authorised. Please verify again.",details:{}},WS_CONNECTION_FAIL:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. %s",details:{}},WS_CONNECTION_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FAIL",message:"WS Connection failed. Trying to connect with port: %s",details:{}},WS_CONNECTION_FALLBACK_FAIL_PORT_ERROR:{code:-1,name:"WS_CONNECTION_FALLBACK_FAIL",message:"WS Connection fallback failed. Trying to connect with port: %s",details:{}},WS_AUTH_FAIL:{code:-1,name:"WS_AUTH_FAIL",message:"WS username/password not correct.",details:{}},NO_INTERNET:{code:-1,name:"NO_INTERNET_CONNECTION",message:"You do not have internet connection.",details:{}},REQUEST_IN_PROGRESS:{code:-1,name:"LOGIN_IN_PROGRESS",message:"Please wait until the previous login request ends.",details:{}}},K.TYPINGNOTIFICATION_CONSTANTS={TOO_MANY_REQUEST:{code:"TOO_MANY_REQUEST",name:"TOO MANY REQUEST",message:"too many request, wait for `%s` seconds before sending next request.",details:{}}},K.FETCH_ERROR={ERROR_IN_API_CALL:{code:"FAILED_TO_FETCH",name:"FAILED_TO_FETCH",message:"There is an unknown issue with the API request. Please check your internet connection and verify the api call.",details:{}}}},function(j,K,$){"use strict";K.__esModule=!0,K.LocalStorage=void 0;var ee=$(0),te=$(1),ne=$(12),re=$(3),oe=$(2),ie=function(){function t(j){this.store=te.constants.DEFAULT_STORE,ee.isFalsy(j)||(this.store=j),this.localStore=ne.createInstance({name:ee.format(te.LOCAL_STORE.STORE_STRING,re.CometChat.getAppId(),te.LOCAL_STORE.COMMON_STORE)}),this.localStore.setDriver([ne.LOCALSTORAGE,ne.INDEXEDDB,ne.WEBSQL])}return t.getInstance=function(){return null==t.localStorage&&(t.localStorage=new t),t.localStorage},t.prototype.set=function(j,K){return this.localStore.setItem(j,JSON.stringify(K))},t.prototype.remove=function(j){this.localStore.removeItem(j)},t.prototype.update=function(j,K){this.remove(j),this.set(j,K)},t.prototype.get=function(j){var K=this;return new Promise((function($,ee){try{K.localStore.getItem(j).then((function(j){try{$(JSON.parse(j))}catch(K){$(j)}}),(function(j){ee(j)}))}catch(j){ee(new oe.CometChatException(j))}}))},t.prototype.clearStore=function(){var j=this;return new Promise((function(K,$){try{j.localStore.keys().then((function($){if(0<$.length)for(var ee=0;ee<$.length;ee++)"appId"!==$[ee]&&j.localStore.removeItem($[ee]),ee===$.length-1&&K(!0)}))}catch(j){$(j)}}))},t.prototype.clear=function(j){},t.prototype.selectStore=function(j){this.store=j},t.localStorage=null,t}();K.LocalStorage=ie},function(j,K,$){"use strict";K.__esModule=!0,K.GroupsController=void 0;var ee=$(8),te=$(1),ne=$(0),re=function(){function t(){}return t.trasformJSONGroup=function(j){var K;try{K=new ee.Group(j[te.GroupConstants.KEYS.GUID],j[te.GroupConstants.KEYS.NAME],j[te.GroupConstants.KEYS.TYPE]),j.wsChannel&&delete j.wsChannel,Object.assign(K,j),j=K}catch(j){ne.Logger.error("GroupsController:transformJSONGroup",j)}return j},t}();K.GroupsController=re},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.TextMessage=void 0;var re=$(7),oe=$(1),ie=$(4),ae=$(8),se=$(0),le=function(j){function t(K,$,ee){var te=j.call(this,K,"text",ee,oe.MessageCategory.MESSAGE)||this;return te.type="text",te.data={text:$},te.text=$,te}return te(t,j),t.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},t.prototype.getReceiver=function(){try{return this.getReceiverFromData()}catch(j){return this.receiver}},t.prototype.getMetadata=function(){return this.data.metadata&&(this.metadata=this.data.metadata),this.metadata},t.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},t.prototype.getData=function(){return this.data},t.prototype.setData=function(j){this.data=j},t.prototype.getText=function(){return this.text},t.prototype.setText=function(j){this.text=j,this.data.text=j},t.prototype.setProcessedText=function(j){this.processedText=j},t.prototype.getProcessedText=function(){return this.processedText},t.prototype.getTags=function(){return this.tags},t.prototype.setTags=function(j){this.tags=j},t.prototype.getSenderFromData=function(){try{var j=this.getData();if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])return new ie.User(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])}catch(j){se.Logger.error("TextMessageModel: getSenderFromData",j)}},t.prototype.getReceiverFromData=function(){try{var j=this.getData(),K=j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY];if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITYTYPE]==[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITY_TYPE.USER])return new ie.User(K);var $=new ae.Group(K[oe.GroupConstants.KEYS.GUID],K[oe.GroupConstants.KEYS.NAME],K[oe.MessageConstatnts.KEYS.TYPE]);return Object.assign($,K)}catch(j){se.Logger.error("TextMessageModel: getReceiverFromData",j)}},t.TYPE=oe.MessageConstatnts.TYPE.TEXT,t.RECEIVER_TYPE=oe.MessageConstatnts.RECEIVER_TYPE,t.CATEGORY=oe.MessageConstatnts.CATEGORY.MESSAGE,t}(re.BaseMessage);K.TextMessage=le},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.MediaMessage=void 0;var re=$(7),oe=$(1),ie=$(4),ae=$(18),se=$(8),le=$(0),ce=function(j){function t(K,$,ee,te){var ne=j.call(this,K,ee,te,oe.MessageCategory.MESSAGE)||this;return ne.data={},"object"!=typeof $?ne.data={url:$}:$&&(0<$.length?ne.files=$:ne.files=[$]),ne}return te(t,j),t.prototype.setCaption=function(j){this.caption=j,this.data[oe.MessageConstatnts.KEYS.TEXT]=j},t.prototype.getCaption=function(){return this.data[oe.MessageConstatnts.KEYS.TEXT]},t.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},t.prototype.getReceiver=function(){try{return this.getReceiverFromData()}catch(j){return this.receiver}},t.prototype.getMetadata=function(){return this.data.metadata&&(this.metadata=this.data.metadata),this.metadata},t.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},t.prototype.getData=function(){return this.data},t.prototype.setData=function(j){this.data=j},t.prototype.getAttachment=function(){return new ae.Attachment(this.data.attachments[0])},t.prototype.setAttachment=function(j){this.data.attachments=[ae.Attachment.toJSON(j)]},t.prototype.getAttachments=function(){var j=[];if(this.data.attachments&&0<this.data.attachments.length)for(var K=0;K<this.data.attachments.length;K++)j.push(new ae.Attachment(this.data.attachments[K]));return j},t.prototype.setAttachments=function(j){var K=[];if(j&&0<j.length)for(var $=0;$<j.length;$++)K.push(ae.Attachment.toJSON(j[$]));this.data.attachments=K},t.prototype.getURL=function(){try{var j=this.getData();if(j[oe.MessageConstatnts.KEYS.URL])return j[oe.MessageConstatnts.KEYS.URL]}catch(j){le.Logger.error("MediaMessageModel: getURL",j)}},t.prototype.getTags=function(){return this.tags},t.prototype.setTags=function(j){this.tags=j},t.prototype.getSenderFromData=function(){try{var j=this.getData();if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])return new ie.User(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])}catch(j){le.Logger.error("MediaMessageModel: getSenderFromData",j)}},t.prototype.getReceiverFromData=function(){try{var j=this.getData(),K=j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY];if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITYTYPE]==[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITY_TYPE.USER])return new ie.User(K);var $=new se.Group(K[oe.GroupConstants.KEYS.GUID],K[oe.GroupConstants.KEYS.NAME],K[oe.MessageConstatnts.KEYS.TYPE]);return Object.assign($,K)}catch(j){le.Logger.error("MediaMessageModel: getReceiverFromData",j)}},t.TYPE=oe.MessageConstatnts.TYPE,t.RECEIVER_TYPE=oe.MessageConstatnts.RECEIVER_TYPE,t.CATEGORY=oe.MessageConstatnts.CATEGORY,t}(re.BaseMessage);K.MediaMessage=ce},function(j,K,$){"use strict";K.__esModule=!0,K.Attachment=void 0;var ee=$(1),te=function(){function e(j){j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.EXTENSION)&&(this.extension=j[ee.ATTACHMENTS_CONSTANTS.KEYS.EXTENSION]),j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.MIME_TYPE)&&(this.mimeType=j[ee.ATTACHMENTS_CONSTANTS.KEYS.MIME_TYPE]),j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.NAME)&&(this.name=j[ee.ATTACHMENTS_CONSTANTS.KEYS.NAME]),j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.SIZE)&&(this.size=j[ee.ATTACHMENTS_CONSTANTS.KEYS.SIZE]),j.hasOwnProperty(ee.ATTACHMENTS_CONSTANTS.KEYS.URL)&&(this.url=j[ee.ATTACHMENTS_CONSTANTS.KEYS.URL])}return e.prototype.createFileFromJSON=function(j){return new e(j)},e.toJSON=function(j){return{extension:j.getExtension(),mimeType:j.getMimeType(),name:j.getName(),url:j.getUrl(),size:j.getSize()}},e.prototype.getExtension=function(){return this.extension},e.prototype.setExtension=function(j){this.extension=j},e.prototype.getMimeType=function(){return this.mimeType},e.prototype.setMimeType=function(j){this.mimeType=j},e.prototype.getName=function(){return this.name},e.prototype.setName=function(j){this.name=j},e.prototype.getSize=function(){return this.size},e.prototype.setSize=function(j){this.size=j},e.prototype.getUrl=function(){return this.url},e.prototype.setUrl=function(j){this.url=j},e}();K.Attachment=te},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.CustomMessage=void 0;var re=$(7),oe=$(1),ie=$(4),ae=$(0),se=$(8),le=function(j){function t(){for(var K=[],$=0;$<arguments.length;$++)K[$]=arguments[$];var ee=this;if(3==K.length){var te=K[0],ne=K[1],re=K[2];ee=j.call(this,te,oe.MessageConstatnts.TYPE.CUSTOM,ne,oe.MessageCategory.MESSAGE)||this,("object"!=typeof re||Array.isArray(re))&&(re={}),ee.customData=re,ae.isFalsy(ee.data)&&(ee.data={}),ee.data[oe.MessageConstatnts.KEYS.CUSTOM_DATA]=re}if(4==K.length){te=K[0],ne=K[1];var ie=K[2];re=K[3],ee=j.call(this,te,ie,ne,oe.MessageCategory.CUSTOM)||this,("object"!=typeof re||Array.isArray(re))&&(re={}),ee.customData=re,ae.isFalsy(ee.data)&&(ee.data={}),ee.data[oe.MessageConstatnts.KEYS.CUSTOM_DATA]=re}return ee}return te(t,j),t.prototype.getCustomData=function(){return this.customData},t.prototype.setCustomData=function(j){this.customData=j,this.data[oe.MessageConstatnts.KEYS.CUSTOM_DATA]=j},t.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},t.prototype.getReceiver=function(){try{return this.getReceiverFromData()}catch(j){return this.receiver}},t.prototype.getSubType=function(){return this.subType},t.prototype.setSubType=function(j){this.subType=j,this.data=ne(ne({},this.data),{subType:j})},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},t.prototype.getData=function(){return this.data},t.prototype.getTags=function(){return this.tags},t.prototype.setTags=function(j){this.tags=j},t.prototype.getSenderFromData=function(){try{var j=this.getData();if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])return new ie.User(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.SENDER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY])}catch(j){ae.Logger.error("CustomMessageModel: getSenderFromData",j)}},t.prototype.getReceiverFromData=function(){try{var j=this.getData(),K=j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITITY];if(j[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES][oe.MessageConstatnts.KEYS.RECEIVER][oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITYTYPE]==[oe.ResponseConstants.RESPONSE_KEYS.KEY_ENTITY_TYPE.USER])return new ie.User(K);var $=new se.Group(K[oe.GroupConstants.KEYS.GUID],K[oe.GroupConstants.KEYS.NAME],K[oe.MessageConstatnts.KEYS.TYPE]);return Object.assign($,K)}catch(j){ae.Logger.error("CustomMessageModel: getReceiverFromData",j)}},t}(re.BaseMessage);K.CustomMessage=le},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.Action=void 0;var re=$(7),oe=$(8),ie=$(4),ae=$(1),se=$(0),le=$(10),ce=function(j){function e(){return null!==j&&j.apply(this,arguments)||this}return te(e,j),e.actionFromJSON=function(j){var K=new this(j[ae.MessageConstatnts.KEYS.RECEIVER],j[ae.MessageConstatnts.KEYS.TYPE],j[ae.MessageConstatnts.KEYS.RECEIVER_TYPE],ae.MessageCategory.ACTION),$=j[ae.MessageConstatnts.KEYS.DATA];if(K.data=$,K.setAction($[ae.MessageConstatnts.KEYS.ACTION]),$[ae.ActionConstatnts.ACTION_KEYS.EXTRAS]){var ee=$[ae.ActionConstatnts.ACTION_KEYS.EXTRAS];if(ee[ae.ActionConstatnts.ACTION_KEYS.SCOPE]){var te=ee[ae.ActionConstatnts.ACTION_KEYS.SCOPE];te[ae.ActionConstatnts.ACTION_KEYS.NEW]&&te[ae.ActionConstatnts.ACTION_KEYS.OLD]&&(K.setOldScope(te[ae.ActionConstatnts.ACTION_KEYS.OLD]),K.setNewScope(te[ae.ActionConstatnts.ACTION_KEYS.NEW]))}}$[ae.MessageConstatnts.KEYS.METADATA]&&K.setMetadata($[ae.MessageConstatnts.KEYS.METADATA]);var ne=$[ae.ActionConstatnts.ACTION_KEYS.ENTITIES];if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY])if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.USER){var re=new ie.User(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]);Object.assign(re,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionBy=re,K.setSender(re)}else{var se=new oe.Group("","","");Object.assign(se,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionBy=se}if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR]&&(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.USER?(re=new ie.User(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),Object.assign(re,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionFor=re):(se=new oe.Group("","",""),Object.assign(se,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionFor=se)),ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON])if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.USER)re=new ie.User(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),Object.assign(re,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionOn=re;else if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.GROUP)se=new oe.Group("","",""),Object.assign(se,ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K.actionOn=se;else if(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.MESSAGE){var ce=le.MessageController.trasformJSONMessge(ne[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ae.ActionConstatnts.ACTION_KEYS.ENTITY]);K.actionOn=ce}return K.setMessage(K.getActionMessage(K)),K},e.prototype.getOldScope=function(){return this.oldScope},e.prototype.setOldScope=function(j){this.oldScope=j},e.prototype.getNewScope=function(){return this.newScope},e.prototype.setNewScope=function(j){this.newScope=j},e.prototype.getRawData=function(){return this.rawData},e.prototype.setRawData=function(j){this.rawData=j},e.prototype.getMessage=function(){return this.message},e.prototype.setMessage=function(j){this.message=j},e.prototype.getAction=function(){return this.action},e.prototype.setAction=function(j){this.action=j},e.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},e.prototype.getActionBy=function(){return this.actionBy},e.prototype.setActionBy=function(j){this.actionBy=j},e.prototype.getActionOn=function(){return this.actionOn},e.prototype.setActionOn=function(j){this.actionOn=j},e.prototype.getActionFor=function(){return this.actionFor},e.prototype.setActionFor=function(j){this.actionFor=j},e.prototype.getMetadata=function(){return this.data.metadata&&(this.metadata=this.data.metadata),this.metadata},e.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},e.prototype.getActionMessage=function(j){var K="";switch(j.getType()){case ae.ActionConstatnts.ACTION_KEYS.ACTION_TYPE_USER:case ae.ActionConstatnts.ACTION_KEYS.ACTION_TYPE_GROUP:switch(j.getAction()){case ae.ActionConstatnts.ACTION_KEYS.ACTION_CREATED:case ae.ActionConstatnts.ACTION_KEYS.ACTION_UPDATED:case ae.ActionConstatnts.ACTION_KEYS.ACTION_DELETED:}break;case ae.ActionConstatnts.ACTION_KEYS.ACTION_TYPE_GROUP_MEMBER:switch(j.getAction()){case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_JOINED:var $=j.getActionBy();K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_GROUP_JOINED_MESSAGE,$.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_LEFT:$=j.getActionBy(),K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_GROUP_LEFT_MESSAGE,$.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_KICKED:$=j.getActionBy();var ee=j.getActionOn();K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_KICKED_MESSAGE,$.getName(),ee.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_BANNED:$=j.getActionBy(),ee=j.getActionOn(),K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_BANNED_MESSAGE,$.getName(),ee.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_UNBANNED:$=j.getActionBy(),ee=j.getActionOn(),K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_UNBANNED_MESSAGE,$.getName(),ee.getName());break;case ae.ActionConstatnts.ACTION_KEYS.ACTION_SCOPE_CHANGED:$=j.getActionBy(),ee=j.getActionOn();var te=j.getNewScope();K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_SCOPE_CHANGED,$.getName(),ee.getName(),te);break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MEMBER_ADDED:$=j.getActionBy(),ee=j.getActionOn(),K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MEMBER_ADDED_TO_GROUP,$.getName(),ee.getName());break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MESSAGE_EDITED:K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MESSAGE_EDITED_MESSAGE,"");break;case ae.ActionConstatnts.ACTION_KEYS.TYPE_MESSAGE_DELETED:K=se.format(ae.ActionConstatnts.ActionMessages.ACTION_MESSAGE_DELETED_MESSAGE,"")}}return K},e.prototype.getSenderFromData=function(){var j=this.data[ae.ActionConstatnts.ACTION_KEYS.ENTITIES];if(j[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY]&&j[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY_TYPE]==ae.ActionConstatnts.ACTION_ENTITY_TYPE.USER){var K=new ie.User(j[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]);return Object.assign(K,j[ae.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ae.ActionConstatnts.ACTION_KEYS.ENTITY]),K}},e.TYPE=ae.MessageConstatnts.TYPE,e.RECEIVER_TYPE=ae.MessageConstatnts.RECEIVER_TYPE,e.CATEGORY=ae.MessageConstatnts.CATEGORY,e.ACTION_TYPE=ae.ActionConstatnts.ACTION_TYPE,e}(re.BaseMessage);K.Action=ce},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)}),ne=this&&this.__assign||function(){return(ne=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.Call=void 0;var re=$(7),oe=$(8),ie=$(1),ae=$(0),se=$(4),le=function(j){function t(K,$,ee,te){return ae.isFalsy(te)?j.call(this,K,$,ee,ie.MessageCategory.CALL)||this:j.call(this,K,$,ee,te)||this}return te(t,j),t.prototype.getCallInitiator=function(){return this.getCallInitiatedByFromData()},t.prototype.setCallInitiator=function(j){this.callInitiator=j},t.prototype.getCallReceiver=function(){return this.getCallReceivedByFromData()},t.prototype.setCallReceiver=function(j){this.callReceiver=j},t.prototype.getData=function(){return this.data},t.prototype.setData=function(j){this.data=j},t.prototype.getSessionId=function(){return this.sessionId},t.prototype.setSessionId=function(j){this.sessionId=j},t.prototype.getMetadata=function(){return this.data.metadata&&(this.metadata=this.data.metadata),this.metadata},t.prototype.setMetadata=function(j){this.metadata=j,this.data=ne(ne({},this.data),{metadata:j})},t.prototype.getSender=function(){try{return this.getSenderFromData()}catch(j){return this.sender}},t.prototype.getAction=function(){return this.action},t.prototype.setAction=function(j){this.action=j},t.prototype.getInitiatedAt=function(){return this.initiatedAt},t.prototype.setInitiatedAt=function(j){this.initiatedAt=j},t.prototype.getJoinedAt=function(){return this.joinedAt},t.prototype.setJoinedAt=function(j){this.joinedAt=j},t.prototype.getRawData=function(){return this.rawData},t.prototype.setRawData=function(j){this.rawData=j},t.callFromJSON=function(j){try{var K=new this(j[ie.MessageConstatnts.KEYS.RECEIVER],j[ie.MessageConstatnts.KEYS.TYPE],j[ie.MessageConstatnts.KEYS.RECEIVER_TYPE],ie.MessageCategory.CALL),$=j[ie.MessageConstatnts.KEYS.DATA];K.setAction($[ie.MessageConstatnts.KEYS.ACTION]),$[ie.MessageConstatnts.KEYS.METADATA]&&K.setMetadata($[ie.MessageConstatnts.KEYS.METADATA]);var ee=$[ie.ActionConstatnts.ACTION_KEYS.ENTITIES];if(ee[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY]&&ee[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY],ee[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON]){var te=ee[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON];if(te[ie.CallConstants.CALL_KEYS.CALL_ENTITY]){var ne=te[ie.CallConstants.CALL_KEYS.CALL_ENTITY];if(ne[ie.CallConstants.CALL_KEYS.CALL_SESSION_ID]&&(K.sessionId=ne[ie.CallConstants.CALL_KEYS.CALL_SESSION_ID]),ne[ie.CallConstants.CALL_KEYS.CALL_STATUS]&&(K.status=ne[ie.CallConstants.CALL_KEYS.CALL_STATUS]),ne[ie.CallConstants.CALL_KEYS.CALL_DATA]){var re=ne[ie.CallConstants.CALL_KEYS.CALL_DATA];re[ie.CallConstants.CALL_KEYS.CALL_METADATA]&&(K.metadata=re[ie.CallConstants.CALL_KEYS.CALL_METADATA]),re[ie.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES]&&re[ie.ResponseConstants.RESPONSE_KEYS.KEY_ENTITIES]}ne[ie.CallConstants.CALL_KEYS.CALL_INITIATED_AT]&&(K.initiatedAt=ne[ie.CallConstants.CALL_KEYS.CALL_INITIATED_AT]),ne[ie.CallConstants.CALL_KEYS.CALL_JOINED_AT]&&(K.joinedAt=ne[ie.CallConstants.CALL_KEYS.CALL_JOINED_AT]),ne[ie.CallConstants.CALL_KEYS.CALL_LEFT_AT]&&(K.joinedAt=ne[ie.CallConstants.CALL_KEYS.CALL_LEFT_AT])}}return K}catch(j){ae.Logger.error("CallModel: callFromJSON",j)}},t.prototype.getSenderFromData=function(){try{var j=this.getData();if((j=j[ie.ActionConstatnts.ACTION_KEYS.ENTITIES])[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ie.CallConstants.CALL_KEYS.CALL_ENTITY])return new se.User(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_BY][ie.CallConstants.CALL_KEYS.CALL_ENTITY])}catch(j){ae.Logger.error("CallModel:getSenderFromData",j)}},t.prototype.getCallInitiatedByFromData=function(){try{var j=this.getData();if((j=j[ie.ActionConstatnts.ACTION_KEYS.ENTITIES])[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.CallConstants.CALL_KEYS.CALL_DATA][ie.ActionConstatnts.ACTION_KEYS.ENTITIES][ie.CallConstants.CALL_KEYS.CALL_SENDER])return new se.User(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_ON][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.CallConstants.CALL_KEYS.CALL_DATA][ie.ActionConstatnts.ACTION_KEYS.ENTITIES][ie.CallConstants.CALL_KEYS.CALL_SENDER][ie.CallConstants.CALL_KEYS.CALL_ENTITY])}catch(j){ae.Logger.error("CallModel:getCallInitiatedByFromData",j)}},t.prototype.getCallReceivedByFromData=function(){try{var j=this.getData();if((j=j[ie.ActionConstatnts.ACTION_KEYS.ENTITIES])[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY]){if(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY_TYPE]==ie.CallConstants.CALL_KEYS.CALL_ENTITY_USER)return new se.User(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY]);var K=new oe.Group(j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.GroupConstants.KEYS.GUID],j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.GroupConstants.KEYS.NAME],j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY][ie.GroupConstants.KEYS.TYPE]);return Object.assign(K,j[ie.ActionConstatnts.ACTION_SUBJECTS.ACTION_FOR][ie.CallConstants.CALL_KEYS.CALL_ENTITY])}}catch(j){ae.Logger.error("CallModel:getCallReceivedByFromData",j)}},t.TYPE=ie.MessageConstatnts.TYPE,t.RECEIVER_TYPE=ie.MessageConstatnts.RECEIVER_TYPE,t.CATEGORY=ie.MessageConstatnts.CATEGORY,t.ACTION_TYPE=ie.ActionConstatnts.ACTION_TYPE,t}(re.BaseMessage);K.Call=le},function(j,K,$){"use strict";K.__esModule=!0,K.MessageReceipt=void 0;var ee=function(){function t(){this.RECEIPT_TYPE={READ_RECEIPT:"read",DELIVERY_RECEIPT:"delivery"},this.receiptType=this.RECEIPT_TYPE.DELIVERY_RECEIPT}return t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t.prototype.getReceiver=function(){return this.receiver},t.prototype.setReceiver=function(j){this.receiver=j},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(j){this.timestamp=j},t.prototype.setReadAt=function(j){this.readAt=j},t.prototype.getReadAt=function(){return this.readAt},t.prototype.setDeliveredAt=function(j){this.deliveredAt=j},t.prototype.getDeliveredAt=function(){return this.deliveredAt},t.prototype.getMessageId=function(){return this.messageId},t.prototype.setMessageId=function(j){this.messageId=j},t.prototype.getReceiptType=function(){return this.receiptType},t.prototype.setReceiptType=function(j){void 0===j&&(j=this.RECEIPT_TYPE.DELIVERY_RECEIPT),this.receiptType=j},t}();K.MessageReceipt=ee},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.WSConnectionListener=K.UserLoginListener=K.CallsListener=K.UserCallListener=K.GroupsListener=K.UsersListener=K.MessagesListener=K.Listener=K.ConnectionListener=K.LoginListener=K.OngoingCallListener=K.GroupListener=K.UserListener=K.CallListener=K.MessageListener=void 0;var ne=$(0),r=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];this.onTextMessageReceived=void 0,this.onMediaMessageReceived=void 0,this.onCustomMessageReceived=void 0,this.onTypingStarted=void 0,this.onTypingEnded=void 0,this.onMessagesDelivered=void 0,this.onMessagesRead=void 0,this.onMessageEdited=void 0,this.onMessageDeleted=void 0,this.onTransientMessageReceived=void 0,ne.isFalsy(j[0].onTextMessageReceived)||(this.onTextMessageReceived=j[0].onTextMessageReceived),ne.isFalsy(j[0].onMediaMessageReceived)||(this.onMediaMessageReceived=j[0].onMediaMessageReceived),ne.isFalsy(j[0].onTypingStarted)||(this.onTypingStarted=j[0].onTypingStarted),ne.isFalsy(j[0].onTypingEnded)||(this.onTypingEnded=j[0].onTypingEnded),ne.isFalsy(j[0].onMessagesDelivered)||(this.onMessagesDelivered=j[0].onMessagesDelivered),ne.isFalsy(j[0].onMessagesRead)||(this.onMessagesRead=j[0].onMessagesRead),ne.isFalsy(j[0].onCustomMessageReceived)||(this.onCustomMessageReceived=j[0].onCustomMessageReceived),ne.isFalsy(j[0].onMessageEdited)||(this.onMessageEdited=j[0].onMessageEdited),ne.isFalsy(j[0].onMessageDeleted)||(this.onMessageDeleted=j[0].onMessageDeleted),ne.isFalsy(j[0].onTransientMessageReceived)||(this.onTransientMessageReceived=j[0].onTransientMessageReceived)};K.MessageListener=r;var a=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];this.onIncomingCallReceived=void 0,this.onOutgoingCallAccepted=void 0,this.onOutgoingCallRejected=void 0,this.onIncomingCallCancelled=void 0,ne.isFalsy(j[0].onIncomingCallReceived)||(this.onIncomingCallReceived=j[0].onIncomingCallReceived),ne.isFalsy(j[0].onOutgoingCallAccepted)||(this.onOutgoingCallAccepted=j[0].onOutgoingCallAccepted),ne.isFalsy(j[0].onOutgoingCallRejected)||(this.onOutgoingCallRejected=j[0].onOutgoingCallRejected),ne.isFalsy(j[0].onIncomingCallCancelled)||(this.onIncomingCallCancelled=j[0].onIncomingCallCancelled)};K.CallListener=a;var E=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];ne.isFalsy(j[0].onUserOnline)||(this.onUserOnline=j[0].onUserOnline),ne.isFalsy(j[0].onUserOffline)||(this.onUserOffline=j[0].onUserOffline)};K.UserListener=E;var c=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];ne.isFalsy(j[0].onGroupMemberJoined)||(this.onGroupMemberJoined=j[0].onGroupMemberJoined),ne.isFalsy(j[0].onGroupMemberLeft)||(this.onGroupMemberLeft=j[0].onGroupMemberLeft),ne.isFalsy(j[0].onGroupMemberKicked)||(this.onGroupMemberKicked=j[0].onGroupMemberKicked),ne.isFalsy(j[0].onGroupMemberBanned)||(this.onGroupMemberBanned=j[0].onGroupMemberBanned),ne.isFalsy(j[0].onGroupMemberUnbanned)||(this.onGroupMemberUnbanned=j[0].onGroupMemberUnbanned),ne.isFalsy(j[0].onGroupMemberScopeChanged)||(this.onGroupMemberScopeChanged=j[0].onGroupMemberScopeChanged),ne.isFalsy(j[0].onMemberAddedToGroup)||(this.onGroupMemberAddedToGroup=j[0].onMemberAddedToGroup)};K.GroupListener=c;var u=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];ne.isFalsy(j[0].onYouLeft)||(this.onYouLeft=j[0].onYouLeft),ne.isFalsy(j[0].onYouJoined)||(this.onYouJoined=j[0].onYouJoined),ne.isFalsy(j[0].onUserJoined)||(this.onUserJoined=j[0].onUserJoined),ne.isFalsy(j[0].onUserLeft)||(this.onUserLeft=j[0].onUserLeft),ne.isFalsy(j[0].onUserListUpdated)||(this.onUserListUpdated=j[0].onUserListUpdated),ne.isFalsy(j[0].onMediaDeviceListUpdated)||(this.onMediaDeviceListUpdated=j[0].onMediaDeviceListUpdated),ne.isFalsy(j[0].onRecordingStarted)||(this.onRecordingStarted=j[0].onRecordingStarted),ne.isFalsy(j[0].onRecordingStopped)||(this.onRecordingStopped=j[0].onRecordingStopped),ne.isFalsy(j[0].onScreenShareStarted)||(this.onScreenShareStarted=j[0].onScreenShareStarted),ne.isFalsy(j[0].onScreenShareStopped)||(this.onScreenShareStopped=j[0].onScreenShareStopped),ne.isFalsy(j[0].onUserMuted)||(this.onUserMuted=j[0].onUserMuted),ne.isFalsy(j[0].onCallSwitchedToVideo)||(this.onCallSwitchedToVideo=j[0].onCallSwitchedToVideo),ne.isFalsy(j[0].onCallEnded)||(this.onCallEnded=j[0].onCallEnded),ne.isFalsy(j[0].onError)||(this.onError=j[0].onError)};K.OngoingCallListener=u;var S=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];ne.isFalsy(j[0].loginSuccess)||(this.loginSuccess=j[0].loginSuccess),ne.isFalsy(j[0].loginFailure)||(this.loginFailure=j[0].loginFailure),ne.isFalsy(j[0].logoutSuccess)||(this.logoutSuccess=j[0].logoutSuccess),ne.isFalsy(j[0].logoutFailure)||(this.logoutFailure=j[0].logoutFailure)};K.LoginListener=S;var l=function(){for(var j=[],K=0;K<arguments.length;K++)j[K]=arguments[K];this.onConnected=void 0,this.inConnecting=void 0,this.onDisconnected=void 0,this.onFeatureThrottled=void 0,ne.isFalsy(j[0].onConnected)||(this.onConnected=j[0].onConnected),ne.isFalsy(j[0].inConnecting)||(this.inConnecting=j[0].inConnecting),ne.isFalsy(j[0].onDisconnected)||(this.onDisconnected=j[0].onDisconnected),ne.isFalsy(j[0].onFeatureThrottled)||(this.onFeatureThrottled=j[0].onFeatureThrottled)};K.ConnectionListener=l;var p=function(j,K){this._name=j,this._callback=K},re=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(K.Listener=p);K.MessagesListener=re;var oe=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(p);K.UsersListener=oe;var ie=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(p);K.GroupsListener=ie;var ae=function(j){function t(K,$,ee){var te=j.call(this,"callListner",ee)||this;return te._eventListener=K,te}return te(t,j),t}(p);K.UserCallListener=ae;var se=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ne}return te(t,j),t}(p);K.CallsListener=se;var le=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(p);K.UserLoginListener=le;var ce=function(j){function t(K,$,ee,te){var ne=j.call(this,K,te)||this;return ne._eventListener=$,ee&&(ne._cursor=ee),ne}return te(t,j),t}(p);K.WSConnectionListener=ce},function(j,K,$){"use strict";K.__esModule=!0,K.ConversationController=void 0;var ee=$(35),te=$(0),ne=function(){function t(){}return t.trasformJSONConversation=function(j,K,$,ne,re,oe){var ie;try{ie=new ee.Conversation(j,K,$,ne,re,oe)}catch(j){te.Logger.error("ConversationController:transformJSONConversation",j)}return ie},t}();K.ConversationController=ne},function(j,K,$){"use strict";K.__esModule=!0,K.MessageListnerMaping=void 0;var ee=$(0),te=$(1),ne=$(12),re=$(3),oe=function(){function t(j){this.store=te.constants.DEFAULT_STORE,ee.isFalsy(j)||(this.store=j),this.settingsStore=ne.createInstance({name:ee.format(te.LOCAL_STORE.STORE_STRING,re.CometChat.getAppId(),te.LOCAL_STORE.MESSAGE_LISTENERS_LIST)}),this.settingsStore.setDriver([ne.LOCALSTORAGE,ne.INDEXEDDB,ne.WEBSQL])}return t.getInstance=function(){return null==t.settingsStore&&(t.settingsStore=new t),t.settingsStore},t.prototype.set=function(j,K){return this.settingsStore.setItem(j,K)},t.prototype.remove=function(j){this.settingsStore.removeItem(j)},t.prototype.get=function(j){return this.settingsStore.getItem(j)},t.prototype.clearStore=function(){return this.settingsStore.clear()},t.prototype.clear=function(j){},t.prototype.selectStore=function(j){this.store=j},t.settingsStore=null,t}();K.MessageListnerMaping=oe},function(j,K,$){"use strict";K.__esModule=!0,K.TypingIndicator=void 0;var ee=function(){function t(j,K,$){this.receiverId=j,this.receiverType=K,this.metadata=$}return t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getReceiverId=function(){return this.receiverId},t.prototype.setReceiverId=function(j){this.receiverId=j},t.prototype.getMetadata=function(){return this.metadata},t.prototype.setMetadata=function(j){this.metadata=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t}();K.TypingIndicator=ee},function(j,K,$){"use strict";K.__esModule=!0,K.TransientMessage=void 0;var ee=function(){function t(j,K,$){this.receiverId=j,this.receiverType=K,this.data=$||{}}return t.prototype.getReceiverId=function(){return this.receiverId},t.prototype.setReceiverId=function(j){this.receiverId=j},t.prototype.getReceiverType=function(){return this.receiverType},t.prototype.setReceiverType=function(j){this.receiverType=j},t.prototype.getData=function(){return this.data},t.prototype.setData=function(j){this.data=j},t.prototype.getSender=function(){return this.sender},t.prototype.setSender=function(j){this.sender=j},t}();K.TransientMessage=ee},function(j,K,$){"use strict";K.__esModule=!0,K.EndpointFactory=void 0;var ee=$(0),te=$(1),ne=$(14),re=$(3),oe=$(2),ie=function(){function a(){this.baseUrl="https://%s.apiclient-%s.cometchat.io/",this.apiVersion=te.APPINFO.apiVersion,this.adminApiUrl="https://%s.api-%s.cometchat.io/",this.adminApiVersion=te.APPINFO.apiVersion,this.extensionApi="https://%s-%s.%s/%s",this.prosodyApi="https://%s.%s/%s",this.wsApi="https://%s/%s",this.uriEndpoints={authToken:{endpoint:"users/{{uid}}/auth_tokens",method:"POST",data:{uid:"string|max:100"},isAdminApi:!0},appSettings:{endpoint:"settings",method:"GET"},login:{endpoint:"admin/users/auth",method:"POST",data:{uid:"string|max:100"}},logout:{endpoint:"admin/users/auth/{{authToken}}",method:"DELETE"},getMyDetails:{endpoint:"me",method:"GET"},updateMyDetails:{endpoint:"me",method:"PUT"},getJWT:{endpoint:"me/jwt",method:"POST"},users:{endpoint:"users",method:"GET"},user:{endpoint:"users/{{uid}}",method:"GET"},blockUsers:{endpoint:"blockedusers",method:"POST"},blockedUsersList:{endpoint:"blockedusers",method:"GET"},unblockUsers:{endpoint:"blockedusers",method:"DELETE"},userLogout:{endpoint:"me",method:"DELETE"},createUser:{endpoint:"users",method:"POST",isAdminApi:!0},updateUser:{endpoint:"users/{{uid}}",method:"PUT",isAdminApi:!0},sendFriendRequests:{endpoint:"user/friends",method:"POST",data:{uids:"array<string|max:100>"}},getFriends:{endpoint:"user/friends",method:"GET"},unfriend:{endpoint:"user/friends/{{uid}}/{{gid}}",method:"DELETE",data:{uids:"array<string|max:100>"}},acceptFriendRequest:{endpoint:"user/friends/{{uid}}/accept",method:"PUT",data:{uids:"array<string|max:100>"}},rejectFriendRequest:{endpoint:"user/friends/{{uid}}/reject",method:"DELETE",data:{uids:"array<string|max:100>"}},createGroup:{endpoint:"groups",method:"POST",data:{guid:"required|string|max:100",name:"required|string|max:100",type:"enum|public,protected,password",password:"filled|string|max:100"}},getGroups:{endpoint:"groups",method:"GET"},getGroup:{endpoint:"groups/{{guid}}",method:"GET"},updateGroup:{endpoint:"groups/{{guid}}",method:"PUT"},deleteGroup:{endpoint:"groups/{{guid}}",method:"DELETE"},addGroupMembers:{endpoint:"groups/{{guid}}/members",method:"POST",data:{uids:"array<string|max:100>"}},getGroupMembers:{endpoint:"groups/{{guid}}/members",method:"GET"},joinGroup:{endpoint:"groups/{{guid}}/members",method:"POST"},leaveGroup:{endpoint:"groups/{{guid}}/members",method:"DELETE"},kickGroupMembers:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"DELETE",data:{uids:"array<string|max:100>"}},changeScopeOfMember:{endpoint:"groups/{{guid}}/members/{{uid}}",method:"PUT",data:{uids:"array<string|max:100>"}},banGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"POST",data:{uids:"array<string|max:100>"}},unbanGroupMember:{endpoint:"groups/{{guid}}/bannedusers/{{uid}}",method:"DELETE",data:{uids:"array<string|max:100>"}},addMemebersToGroup:{endpoint:"groups/{{guid}}/members",method:"PUT"},getBannedGroupMembers:{endpoint:"groups/{{guid}}/bannedusers",method:"GET"},promotemoteGroupMember:{endpoint:"groups/{{guid}}/promote",method:"PUT",data:{uids:"array<string|max:100>"}},demoteGroupMember:{endpoint:"groups/{{guid}}/demote",method:"DELETE",data:{uids:"array<string|max:100>"}},transferOwnership:{endpoint:"groups/{{guid}}/owner",method:"PATCH"},sendMessage:{endpoint:"messages",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},sendMessageInThread:{endpoint:"messages/{{parentId}}/thread",method:"POST",data:{sender:"array:string:max:100>",isGroupMember:"filled|boolean|bail",data:"required|json"}},getMessages:{endpoint:"messages",method:"GET"},getMessageDetails:{endpoint:"messages/{{messageId}}",method:"GET"},getUserMessages:{endpoint:"users/{{listId}}/messages",method:"GET"},getGroupMessages:{endpoint:"groups/{{listId}}/messages",method:"GET"},getThreadMessages:{endpoint:"messages/{{listId}}/thread",method:"GET"},getMessage:{endpoint:"user/messages/{{muid}}",method:"GET"},updateMessage:{endpoint:"messages/{{messageId}}",method:"PUT"},deleteMessage:{endpoint:"messages/{{messageId}}",method:"DELETE"},createCallSession:{endpoint:"calls",method:"POST",data:{}},updateCallSession:{endpoint:"calls/{{sessionid}}",method:"put",data:{}},getConversations:{endpoint:"conversations",method:"GET"},getUserConversation:{endpoint:"users/{{uid}}/conversation",method:"GET"},getGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"GET"},deleteUserConversation:{endpoint:"users/{{uid}}/conversation",method:"DELETE"},deleteGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"DELETE"},updateUserConversation:{endpoint:"users/{{uid}}/conversation",method:"PUT"},updateGroupConversation:{endpoint:"groups/{{guid}}/conversation",method:"PUT"},updateCallType:{endpoint:"calls/{{sessionid}}/type",method:"PATCH"}}}return a.prototype.getEndpointData=function(j){return new Promise((function(K,$){try{var ie=re.CometChat.appSettings.getAdminHost(),ae=re.CometChat.appSettings.getClientHost();ne.LocalStorage.getInstance().get(te.LOCAL_STORE.KEY_APP_SETTINGS).then((function($){if(ee.isFalsy($)){var ne={};if((new a).uriEndpoints.hasOwnProperty(j))if((ne=(new a).uriEndpoints[j]).hasOwnProperty("isAdminApi"))if(ee.isFalsy(ie)){var oe=ee.format((new a).adminApiUrl,re.CometChat.getAppId(),re.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+ne.endpoint;ne.endpoint=oe}else oe="https://"+ie+"/"+ne.endpoint,ne.endpoint=oe;else ee.isFalsy(ae)?(oe=ee.format((new a).baseUrl,re.CometChat.getAppId(),re.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+ne.endpoint,ne.endpoint=oe):(oe="https://"+ae+"/"+ne.endpoint,ne.endpoint=oe);K(ne)}else ne={},(new a).uriEndpoints.hasOwnProperty(j)&&((ne=(new a).uriEndpoints[j]).hasOwnProperty("isAdminApi")?ne.endpoint="https://"+$[te.APP_SETTINGS.KEYS.ADMIN_API_HOST]+"/"+$[te.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+ne.endpoint:ne.endpoint="https://"+$[te.APP_SETTINGS.KEYS.CLIENT_API_HOST]+"/"+$[te.APP_SETTINGS.KEYS.CHAT_API_VERSION]+"/"+ne.endpoint),K(ne)}),(function($){var te;(new a).uriEndpoints.hasOwnProperty(j)&&((te=(new a).uriEndpoints[j]).hasOwnProperty(["isAdminApi"])?ee.isFalsy(ie)?te.endpoint=ee.format((new a).adminApiUrl,re.CometChat.getAppId(),re.CometChat.appSettings.getRegion())+(new a).adminApiVersion+"/"+te.endpoint:te.endpoint="https://"+ie+"/"+te.endpoint:ee.isFalsy(ae)?te.endpoint=ee.format((new a).baseUrl,re.CometChat.getAppId(),re.CometChat.appSettings.getRegion())+(new a).apiVersion+"/"+te.endpoint:te.endpoint="https://"+ae+"/"+te.endpoint),K(te)}))}catch(j){$(new oe.CometChatException(j))}}))},a}();K.EndpointFactory=ie},function(j,K,$){"use strict";K.__esModule=!0,K.getEndPoint=void 0;var ee=$(28),te=$(2);K.getEndPoint=function(j,K){void 0===j&&(j=""),void 0===K&&(K={});var $=new ee.EndpointFactory;return new Promise((function(ee,ne){try{$.getEndpointData(j).then((function(j){var $=j;if($){for(var te in K)$.endpoint=$.endpoint.replace("{{"+te+"}}",K[te]);ee($)}else ne({error:"Unknown endPoint name."})}))}catch(j){ne(new te.CometChatException(j))}}))}},function(j,K,$){"use strict";K.__esModule=!0,K.KeyStore=void 0;var ee=$(3),te=$(0),ne=$(1),re=$(12),oe=$(2),ie=function(){function t(j){this.store=ne.constants.DEFAULT_STORE,te.isFalsy(j)||(this.store=j),this.keyStore=re.createInstance({name:te.format(ne.LOCAL_STORE.STORE_STRING,ee.CometChat.getAppId(),ne.LOCAL_STORE.KEYS_STORE)}),this.keyStore.setDriver([re.LOCALSTORAGE,re.INDEXEDDB,re.WEBSQL])}return t.getInstance=function(){return null==t.KeyStore&&(t.KeyStore=new t),t.KeyStore},t.prototype.set=function(j,K){return this.keyStore.setItem(j,K)},t.prototype.remove=function(j){this.keyStore.removeItem(j)},t.prototype.get=function(j){var K=this;return new Promise((function($,ee){try{K.keyStore.getItem(j).then((function(j){try{$(JSON.parse(j))}catch(K){$(j)}}),(function(j){ee(j)}))}catch(j){ee(new oe.CometChatException(j))}}))},t.prototype.clearStore=function(){return this.keyStore.clear()},t}();K.KeyStore=ie},function(j,K,$){"use strict";K.__esModule=!0,K.CallController=void 0;var ee=$(1),te=$(0),ne=$(3),re=$(2),oe=$(23),ie=$(32),ae=$(4),se=$(6),le=function(){function g(){this.TAG="calling Log",this.CALL_NO_ANSWER_INTERVAL=45e3,this.view=void 0,this.isDev=!1}return g.prototype.getCallListner=function(){return g.callListner},g.prototype.setCallListner=function(j){g.callListner=new oe.UserCallListener(j)},g.getInstance=function(){try{return null!=this.callController&&null!=this.callController||(this.callController=new g),this.callController}catch(j){te.Logger.error("CallController: getInstance",j)}},g.prototype.getActiveCall=function(){try{return te.isFalsy(this.call)?null:this.call}catch(j){te.Logger.error("CallController: getActiveCall",j)}},g.prototype.initiateCall=function(j){var K=this;return new Promise((function($,ne){try{te.isFalsy(K.call)?null!=j&&null!=j?(K.call=j,K.startCallTimer(),$(j)):ne(new re.CometChatException(ee.CALL_ERROR.ERROR_IN_CALLING)):ne(new re.CometChatException(ee.CALL_ERROR.CALL_ALREADY_INITIATED))}catch($){ne(new re.CometChatException($))}}))},g.prototype.endCall=function(j){var K=this;try{document.getElementsByName("frame").forEach((function(j){K.view&&(K.view.removeChild(j),K.view=void 0)})),this.endCallSession()}catch(j){te.Logger.error("CallController: endCall",j)}},g.prototype.onCallStarted=function(j){var K=this;return new Promise((function($,ne){try{te.isFalsy(K.call)?null!=j&&null!=j?$(K.call=j):ne(new re.CometChatException(ee.CALL_ERROR.ERROR_IN_CALLING)):ne(new re.CometChatException(ee.CALL_ERROR.CALL_ALREADY_INITIATED))}catch($){ne(new re.CometChatException($))}}))},g.prototype.endCallSession=function(){try{this.call=void 0,g.callController=void 0,this.timer&&this.stopCallTimer(),this.view=void 0,this.removeListener(),g.callScreen=null,g.callSettings=null}catch(j){te.Logger.error("CallController:EndCallSession",{e:j})}},g.prototype.startCallTimer=function(){var j=this;try{this.timer=setTimeout((function(){j.call?ne.CometChat.sendUnansweredResponse(j.call.getSessionId()).then((function(K){j.endCallSession()}),(function(K){j.endCallSession()})):j.endCallSession()}),this.CALL_NO_ANSWER_INTERVAL)}catch(j){te.Logger.error("CallController: startCallTimer",j)}},g.prototype.stopCallTimer=function(){try{clearTimeout(this.timer)}catch(j){te.Logger.error("CallController: stopCallTimer",j)}},g.prototype.startCall=function(j,K){var $=this;try{this.timer&&this.stopCallTimer();var ee=document.createElement("iframe");this.getCallUrl().then((function(te){ee.src=te+"",ee.name="frame",ee.setAttribute("allow","camera; microphone; display-capture;"),ee.setAttribute("width","100%"),ee.setAttribute("height","100%"),g.callScreen=ee,g.callSettings=j,K&&($.view=K),K.appendChild(ee),$.addListener()}))}catch(j){te.Logger.error("CallController: startCall",j)}},g.prototype.addListener=function(){window.addEventListener("message",this.handler,!0)},g.prototype.removeListener=function(){window.removeEventListener("message",this.handler,!0)},g.prototype.handler=function(j){var K,$=this,re=g.callSettings,oe=g.callScreen,ie=g.getInstance().getActiveCall();try{if(void 0!==(K=JSON.parse(j.data))&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.HANGUP)g.deviceList=null,ie?(te.Logger.info(this.TAG,g.callListner),window.setTimeout((function(){ne.CometChat.endCall(ie.getSessionId(),!0).then((function(j){te.Logger.info($.TAG,{call:j})})).catch((function(j){te.Logger.info($.TAG,"The Call Was Already Ended")}))}),1e3)):ne.CometChat.endCall(re.getSessionId(),!0).then((function(j){te.Logger.info($.TAG,{call:j})})).catch((function(j){te.Logger.info($.TAG,"The Call Was Already Ended")}));else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.USER_JOINED){if(K.value){var le=void 0,ce=K.value;te.isFalsy(ce.uid)||te.isFalsy(ce.name)||((le=new ae.User(ce)).setStatus("online"),ne.CometChat.user.getUid().toLowerCase()!=le.getUid().toLowerCase()&&g.callListner&&(te.isFalsy(g.callListner._eventListener.onUserJoined)||g.callListner._eventListener.onUserJoined(le)))}}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.USER_LEFT)K.value&&(le=void 0,ce=K.value,te.isFalsy(ce.uid)||te.isFalsy(ce.name)||((le=new ae.User(ce)).setStatus("online"),ne.CometChat.user.getUid().toLowerCase()!=le.getUid().toLowerCase()&&g.callListner&&(te.isFalsy(g.callListner._eventListener.onUserLeft)||g.callListner._eventListener.onUserLeft(le))));else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.USER_LIST_CHANGED){var ue=[];K.value&&0<K.value.length&&(K.value.map((function(j){if(!te.isFalsy(j.uid)&&!te.isFalsy(j.name)){var K=new ae.User(j);K.setStatus("online"),ue.push(K)}})),g.callListner&&(te.isFalsy(g.callListner._eventListener.onUserListUpdated)||g.callListner._eventListener.onUserListUpdated(ue)))}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.INITIAL_DEVICE_LIST)te.Logger.info("initialDeviceList received in SDK = ",K),K.value&&(g.deviceList=K.value);else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.DEVICE_CHANGE){if(te.Logger.info("onDeviceChange received in SDK = ",K),K.value){g.deviceList=K.value;var de=g.getAvailableDeviceObject(g.deviceList);g.callListner&&(te.isFalsy(g.callListner._eventListener.onMediaDeviceListUpdated)||g.callListner._eventListener.onMediaDeviceListUpdated(de))}}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.RECORDING_TOGGLED){if(te.Logger.info("onRecordingToggled received in SDK = ",K),K.value&&(fe=K.value).hasOwnProperty("user")&&fe.hasOwnProperty("recordingStarted")&&!te.isFalsy(fe.user.uid)&&!te.isFalsy(fe.user.name)){var pe=new ae.User(fe.user);pe.setStatus("online");var ge=fe.recordingStarted;g.callListner&&(ge?te.isFalsy(g.callListner._eventListener.onRecordingStarted)||g.callListner._eventListener.onRecordingStarted(pe):te.isFalsy(g.callListner._eventListener.onRecordingStopped)||g.callListner._eventListener.onRecordingStopped(pe))}}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.USER_MUTED){if(te.Logger.info("onUserMuted received in SDK = ",K),K.value&&(fe=K.value).hasOwnProperty("muted")&&fe.hasOwnProperty("mutedBy")&&!te.isFalsy(fe.muted.uid)&&!te.isFalsy(fe.muted.name)&&!te.isFalsy(fe.mutedBy.uid)&&!te.isFalsy(fe.mutedBy.name)){var he=new ae.User(fe.muted);he.setStatus("online");var me=new ae.User(fe.mutedBy);me.setStatus("online"),g.callListner&&(te.isFalsy(g.callListner._eventListener.onUserMuted)||g.callListner._eventListener.onUserMuted(he,me))}}else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.SCREEN_SHARE_STARTED)g.callListner&&(te.isFalsy(g.callListner._eventListener.onScreenShareStarted)||g.callListner._eventListener.onScreenShareStarted(null));else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.SCREEN_SHARE_STOPPED)g.callListner&&(te.isFalsy(g.callListner._eventListener.onScreenShareStopped)||g.callListner._eventListener.onScreenShareStopped(null));else if(void 0!==K&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.SWITCHED_TO_VIDEO_CALL){if(K.value){var fe=K.value;if(te.Logger.info("onCallSwitchedToVideo received in SDK = ",fe),fe.hasOwnProperty("initiator")&&fe.hasOwnProperty("sessionId")&&!te.isFalsy(fe.initiator.uid)&&!te.isFalsy(fe.sessionId)&&fe.hasOwnProperty("accepted")&&!te.isFalsy(fe.accepted.uid)){var ye=fe.sessionId,be=new ae.User(fe.initiator);be.setStatus("online");var ve=new ae.User(fe.accepted);if(ve.setStatus("online"),g.getInstance().getCallListner()&&(te.isFalsy(g.getInstance().getCallListner()._eventListener.onCallSwitchedToVideo)||g.getInstance().getCallListner()._eventListener.onCallSwitchedToVideo(ye,be,ve)),fe.initiator.uid.toLowerCase()===ne.CometChat.user.getUid().toLowerCase()&&!fe.sessionId.includes("v1."))try{se.makeApiCall("updateCallType",{sessionid:ye},{type:"video"}).then((function(j){}),(function(j){te.Logger.error("CallController :: onSwitchedToVideo",j)}))}catch(j){te.Logger.error("CallController :: onSwitchedToVideo",j)}}}}else void 0!==K&&K.type&&K.action&&K.type==ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE&&K.action==ee.CallConstants.POST_MESSAGES.ACTIONS.LOAD&&null!=oe.contentWindow&&oe.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.COMETCHAT_RTC_SETTINGS,callsettings:JSON.stringify(re)},"*")}catch(j){K=void 0,te.Logger.error("CallController: startCall",j)}},g.prototype.getCallUrl=function(){var j=this,K=void 0;return new Promise((function($,ne){try{j.isDev?(K="https://rtc-test.cometchat.io/?v="+ee.CALLING_COMPONENT_VERSION,$(K)):te.getAppSettings().then((function(j){K="https://"+j[ee.APP_SETTINGS.KEYS.WEBRTC_WEB_FRONTEND_HOST]+"/?v="+ee.CALLING_COMPONENT_VERSION,$(K)}))}catch(j){ne(new re.CometChatException(j))}}))},g.getAvailableDeviceArray=function(j){var K=[];try{return j&&0<j.length&&j.map((function(j){K.push(new ie.MediaDevice(j.deviceId,j.label,j.active))})),K}catch(j){return te.Logger.error("CallController: getAvailableDeviceArray",j),K}},g.getAvailableDeviceObject=function(j){var K=[],$=[],ne=[];try{return te.isFalsy(j)||te.isFalsy(j[ee.CallConstants.AUDIO_INPUT_DEVICES])||(K=g.getAvailableDeviceArray(j[ee.CallConstants.AUDIO_INPUT_DEVICES])),te.isFalsy(j)||te.isFalsy(j[ee.CallConstants.AUDIO_OUTPUT_DEVICES])||($=g.getAvailableDeviceArray(j[ee.CallConstants.AUDIO_OUTPUT_DEVICES])),te.isFalsy(j)||te.isFalsy(j[ee.CallConstants.VIDEO_INPUT_DEVICES])||(ne=g.getAvailableDeviceArray(j[ee.CallConstants.VIDEO_INPUT_DEVICES])),{audioInputDevices:K,audioOutputDevices:$,videoInputDevices:ne}}catch(j){return te.Logger.error("CallController: getAvailableDeviceObject",j),{audioInputDevices:K,audioOutputDevices:$,videoInputDevices:ne}}},g.prototype.getAudioInputDevices=function(){var j=[];try{return te.isFalsy(g.deviceList)||te.isFalsy(g.deviceList[ee.CallConstants.AUDIO_INPUT_DEVICES])||(j=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.AUDIO_INPUT_DEVICES])),j}catch(K){return te.Logger.error("CallController: getAudioInputDevices",K),j}},g.prototype.getAudioOutputDevices=function(){var j=[];try{return te.isFalsy(g.deviceList)||te.isFalsy(g.deviceList[ee.CallConstants.AUDIO_OUTPUT_DEVICES])||(j=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.AUDIO_OUTPUT_DEVICES])),j}catch(K){return te.Logger.error("CallController: getAudioOutputDevices",K),j}},g.prototype.getVideoInputDevices=function(){var j=[];try{return te.isFalsy(g.deviceList)||te.isFalsy(g.deviceList[ee.CallConstants.VIDEO_INPUT_DEVICES])||(j=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.VIDEO_INPUT_DEVICES])),j}catch(K){return te.Logger.error("CallController: getVideoInputDevices",K),j}},g.prototype.setAudioInputDevice=function(j){try{if(g.callScreen&&!te.isFalsy(j)){var K=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.AUDIO_INPUT_DEVICES]).filter((function(K){return K[ee.CallConstants.MEDIA_DEVICE.ID]===j&&!K[ee.CallConstants.MEDIA_DEVICE.ACTIVE]}));K&&0<K.length&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.CHANGE_AUDIO_INPUT,value:j},"*")}}catch(K){te.Logger.error("CallController: setAudioInputDevice",K)}},g.prototype.setAudioOutputDevice=function(j){try{if(g.callScreen&&!te.isFalsy(j)){var K=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.AUDIO_OUTPUT_DEVICES]).filter((function(K){return K[ee.CallConstants.MEDIA_DEVICE.ID]===j&&!K[ee.CallConstants.MEDIA_DEVICE.ACTIVE]}));K&&0<K.length&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.CHANGE_AUDIO_OUTPUT,value:j},"*")}}catch(K){te.Logger.error("CallController: setAudioOutputDevice",K)}},g.prototype.setVideoInputDevice=function(j){try{if(g.callScreen&&!te.isFalsy(j)){var K=g.getAvailableDeviceArray(g.deviceList[ee.CallConstants.VIDEO_INPUT_DEVICES]).filter((function(K){return K[ee.CallConstants.MEDIA_DEVICE.ID]===j&&!K[ee.CallConstants.MEDIA_DEVICE.ACTIVE]}));K&&0<K.length&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.CHANGE_VIDEO_INPUT,value:j},"*")}}catch(K){te.Logger.error("CallController: setVideoInputDevice",K)}},g.prototype.muteAudio=function(j){try{g.callScreen&&(j?g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.MUTE_AUDIO},"*"):g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.UNMUTE_AUDIO},"*"))}catch(j){te.Logger.error("CallController: muteAudio",j)}},g.prototype.pauseVideo=function(j){try{g.callScreen&&(j?g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.PAUSE_VIDEO},"*"):g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.UNPAUSE_VIDEO},"*"))}catch(j){te.Logger.error("CallController: pauseVideo",j)}},g.prototype.setMode=function(j){try{g.callScreen&&!te.isFalsy(j)&&(j=j.toUpperCase(),-1<Object.values(ee.CallConstants.CALL_MODE).indexOf(j)&&j!=ee.CallConstants.CALL_MODE.SINGLE&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.SWITCH_MODE,value:j},"*"))}catch(j){te.Logger.error("CallController: setMode",j)}},g.prototype.startScreenShare=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.START_SCREENSHARE},"*")}catch(j){te.Logger.error("CallController: startScreenShare",j)}},g.prototype.stopScreenShare=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.STOP_SCREENSHARE},"*")}catch(j){te.Logger.error("CallController: stopScreenShare",j)}},g.prototype.startRecording=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.START_RECORDING},"*")}catch(j){te.Logger.error("CallController: startRecording",j)}},g.prototype.stopRecording=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.STOP_RECORDING},"*")}catch(j){te.Logger.error("CallController: stopRecording",j)}},g.prototype.switchToVideoCall=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.SWITCH_TO_VIDEO_CALL},"*")}catch(j){te.Logger.error("CallController: switchToVideoCall",j)}},g.prototype.openVirtualBackground=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.OPEN_VIRTUAL_BACKGROUND},"*")}catch(j){te.Logger.error("CallController: openVirtualBackground",j)}},g.prototype.setBackgroundBlur=function(j){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.SET_BACKGROUND_BLUR,value:j},"*")}catch(j){te.Logger.error("CallController: openVirtualBackground",j)}},g.prototype.setBackgroundImage=function(j){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.SET_BACKGROUND_IMAGE,value:j},"*")}catch(j){te.Logger.error("CallController: openVirtualBackground",j)}},g.prototype.endSession=function(){try{g.callScreen&&g.callScreen.contentWindow.postMessage({type:ee.CallConstants.POST_MESSAGES.TYPES.ACTION_MESSAGE,action:ee.CallConstants.POST_MESSAGES.ACTIONS.END_CALL},"*")}catch(j){te.Logger.error("CallController: endSession",j)}},g.callController=void 0,g.callListner=void 0,g}();K.CallController=le},function(j,K,$){"use strict";K.__esModule=!0,K.MediaDevice=void 0;var ee=$(0),te=function(){function t(j,K,$){this.id="",this.name="",this.active=!1,ee.isFalsy(j)||(this.id=j),ee.isFalsy(K)||(this.name=K),this.active=!!$}return t.prototype.getId=function(){return this.id},t.prototype.setId=function(j){this.id=j||""},t.prototype.getName=function(){return this.name},t.prototype.setName=function(j){this.name=j||""},t.prototype.getIsActive=function(){return this.active},t.prototype.setIsActive=function(j){this.active=!!j},t}();K.MediaDevice=te},function(j,K,$){"use strict";K.__esModule=!0,K.GroupMembersController=void 0;var ee=$(34),te=$(1),ne=$(0),re=function(){function t(){}return t.trasformJSONGroupMember=function(j){var K;try{return j.status&&"offline"!==j.status?j.status="online":j.status="offline",K=new ee.GroupMember(j[te.GroupMemersConstans.KEYS.UID]),Object.assign(K,j),K}catch(K){return ne.Logger.error("GroupMembersController:trasformJSONGroupMember",{e:K,groupMember:j}),j}},t}();K.GroupMembersController=re},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.GroupMember=void 0;var ne=$(4),re=$(1),oe=function(j){function t(K,$){var ee=j.call(this,K)||this;return ee.joinedAt=0,$&&(ee.scope=$),ee}return te(t,j),t.prototype.setScope=function(j){this.scope=j},t.prototype.setJoinedAt=function(j){this.joinedAt=j},t.prototype.setGuid=function(j){this.guid=j},t.prototype.getScope=function(){return this.scope},t.prototype.getJoinedAt=function(){return this.joinedAt},t.prototype.getGuid=function(){return this.guid},t.GroupMemberScope=re.GroupMemberScope,t}(ne.User);K.GroupMember=oe},function(j,K,$){"use strict";K.__esModule=!0,K.Conversation=void 0;var ee=$(10),te=$(1),ne=$(11),re=$(15),oe=function(){function t(j,K,$,oe,ie,ae){this.conversationId=j,this.conversationType=K,ae&&0<ae.length&&(this.tags=ae),void 0!==$&&void 0!==(this.lastMessage=$).id&&(this.lastMessage=ee.MessageController.trasformJSONMessge($)),this.conversationType==te.MessageConstatnts.RECEIVER_TYPE.USER?this.conversationWith=ne.UsersController.trasformJSONUser(oe):this.conversationWith=re.GroupsController.trasformJSONGroup(oe),this.unreadMessageCount=void 0!==ie?ie:0}return t.prototype.setConversationId=function(j){this.conversationId=j},t.prototype.setConversationType=function(j){this.conversationType=j},t.prototype.setLastMessage=function(j){this.lastMessage=j},t.prototype.setConversationWith=function(j){this.conversationWith=j},t.prototype.setUnreadMessageCount=function(j){this.unreadMessageCount=j},t.prototype.getConversationId=function(){return this.conversationId},t.prototype.getConversationType=function(){return this.conversationType},t.prototype.getLastMessage=function(){return this.lastMessage},t.prototype.getConversationWith=function(){return this.conversationWith},t.prototype.getUnreadMessageCount=function(){return this.unreadMessageCount},t.prototype.getTags=function(){return this.tags},t}();K.Conversation=oe},function(j,K,$){"use strict";K.__esModule=!0,K.TypingNotificationController=void 0;var ee=$(0),te=function(){function t(){}return t.addTypingStarted=function(j){this.TYPING_STARTED_MAP[j]=ee.getCurrentTime()},t.removeTypingStarted=function(j){delete this.TYPING_STARTED_MAP[j]},t.getTypingStartedMap=function(j){if(j)return this.TYPING_STARTED_MAP[j]},t.addTypingEnded=function(j){this.TYPING_ENDED_MAP[j]=ee.getCurrentTime()},t.removeTypingEnded=function(j){delete this.TYPING_ENDED_MAP[j]},t.getTypingEndedMap=function(j){if(j)return this.TYPING_ENDED_MAP[j]},t.addIncomingTypingStarted=function(j){this.INCOMING_TYPING_STARTED_MAP[j.getReceiverId()]={typingNotification:j,timestamp:ee.getCurrentTime()}},t.removeIncomingTypingStarted=function(j){delete this.INCOMING_TYPING_STARTED_MAP[j.getReceiverId()]},t.TYPING_STARTED_MAP={},t.TYPING_ENDED_MAP={},t.INCOMING_TYPING_STARTED_MAP={},t}();K.TypingNotificationController=te},function(j,K,$){"use strict";var ee=this&&this.__spreadArrays||function(){for(var j=0,K=0,$=arguments.length;K<$;K++)j+=arguments[K].length;var ee=Array(j),te=0;for(K=0;K<$;K++)for(var ne=arguments[K],re=0,oe=ne.length;re<oe;re++,te++)ee[te]=ne[re];return ee};K.__esModule=!0,K.ListenerHandlers=void 0;var te=$(0),ne=$(23),re=function(){function t(){this.connectionHandlers=[],this.loginHandlers=[],this.messageHandlers=[],this.userHandlers=[],this.groupHandlers=[],this.callHandlers=[]}return t.getInstance=function(){return null!=this.listenerHandlers&&null!=this.listenerHandlers||(this.listenerHandlers=new t),this.listenerHandlers},t.prototype.addConnectionEventListener=function(j,K){try{this.connectionHandlers=this.connectionHandlers.filter((function(K){return K._name!=j})),this.connectionHandlers=ee(this.connectionHandlers,[new ne.WSConnectionListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addWSConnectionEventListener",K)}},t.prototype.removeConnectionEventListener=function(j){try{this.connectionHandlers=this.connectionHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeWSConnectionEventListener",j)}},t.prototype.addLoginEventListener=function(j,K){try{this.loginHandlers=this.loginHandlers.filter((function(K){return K._name!=j})),this.loginHandlers=ee(this.loginHandlers,[new ne.UserLoginListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addLoginEventListener",K)}},t.prototype.removeLoginEventListener=function(j){try{this.loginHandlers=this.loginHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeLoginEventListener",j)}},t.prototype.addMessageEventListener=function(j,K){try{this.messageHandlers=this.messageHandlers.filter((function(K){return K._name!=j})),this.messageHandlers=ee(this.messageHandlers,[new ne.MessagesListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addMessageEventListener",K)}},t.prototype.removeMessageEventListener=function(j){try{this.messageHandlers=this.messageHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeMessageEventListener",j)}},t.prototype.addUserEventListener=function(j,K){try{this.userHandlers=this.userHandlers.filter((function(K){return K._name!=j})),this.userHandlers=ee(this.userHandlers,[new ne.UsersListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addUserEventListener",K)}},t.prototype.removeUserEventListener=function(j){try{this.userHandlers=this.userHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeUserEventListener",j)}},t.prototype.addGroupEventListener=function(j,K){try{this.groupHandlers=this.groupHandlers.filter((function(K){return K._name!=j})),this.groupHandlers=ee(this.groupHandlers,[new ne.GroupsListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addGroupEventListener",K)}},t.prototype.removeGroupEventListener=function(j){try{this.groupHandlers=this.groupHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeGroupEventListener",j)}},t.prototype.addCallEventListener=function(j,K){try{this.callHandlers=this.callHandlers.filter((function(K){return K._name!=j})),this.callHandlers=ee(this.callHandlers,[new ne.CallsListener(j,K)])}catch(K){te.Logger.error("ListenerHandlers: addCallEventListener",K)}},t.prototype.removeCallEventListener=function(j){try{this.callHandlers=this.callHandlers.filter((function(K){return K._name!==j}))}catch(j){te.Logger.error("ListenerHandlers: removeCallEventListener",j)}},t.listenerHandlers=new t,t}();K.ListenerHandlers=re},function(j,K,$){"use strict";K.__esModule=!0,K.CometChat=K.init=void 0;var ee=$(3);K.init=function(j){return ee.CometChat.getInstance(j)},K.CometChat=ee.CometChat},function(j,K){var $;$=function(){return this}();try{$=$||new Function("return this")()}catch(j){"object"==typeof window&&($=window)}j.exports=$},function(j,K,$){"use strict";K.__esModule=!0,K.GroupsRequestBuilder=K.GroupsRequest=void 0;var ee=$(6),te=$(0),ne=$(2),re=$(15),oe=$(1),ie=function(){function t(j){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.hasJoined=0,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},te.isFalsy(j)||(te.isFalsy(j.limit)||(this.limit=j.limit),te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.hasJoined)||(this.hasJoined=1),te.isFalsy(j.tags)||(this.tags=j.tags),te.isFalsy(j.showTags)||(this.withTags=j.showTags))}return t.prototype.validateGroupBuilder=function(){if(void 0===this.limit)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>oe.DEFAULT_VALUES.GROUPS_MAX_LIMIT)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",oe.DEFAULT_VALUES.GROUPS_MAX_LIMIT)));if(this.limit<oe.DEFAULT_VALUES.ZERO)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(void 0!==this.withTags){if(typeof this.withTags!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"WITH_TAGS","WITH_TAGS","withTags()")));1==this.withTags?this.withTags=!0:this.withTags=!1}return void 0===this.tags||Array.isArray(this.tags)?void 0:new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"TAGS","TAGS","setTags()")))},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{var te=j.validateGroupBuilder();if(te instanceof ne.CometChatException)return void $(te);ee.makeApiCall("getGroups",{},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(j,K){ee.push(re.GroupsController.trasformJSONGroup(j))})),K(ee)}K([])}),(function(j){$(new ne.CometChatException(j.error))}))}catch(te){$(new ne.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),te.isFalsy(this.hasJoined)||(j.hasJoined=1),te.isFalsy(this.tags)||(j.tags=this.tags),te.isFalsy(this.withTags)||(j.withTags=1),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t.MAX_LIMIT=100,t.DEFAULT_LIMIT=30,t}();K.GroupsRequest=ie;var ae=function(){function t(){}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.joinedOnly=function(j){return this.hasJoined=j,this},t.prototype.setTags=function(j){return this.tags=j,this},t.prototype.withTags=function(j){return this.showTags=j,this},t.prototype.build=function(){return new ie(this)},t}();K.GroupsRequestBuilder=ae},function(j,K,$){"use strict";K.__esModule=!0,K.GroupMembersRequestBuilder=K.GroupMembersRequest=void 0;var ee=$(6),te=$(0),ne=$(14),re=$(2),oe=$(33),ie=$(1),ae=function(){function t(j){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},this.store=ne.LocalStorage.getInstance(),te.isFalsy(j)||(this.limit=j.limit,this.guid=j.guid,te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.scopes)||(this.scopes=j.scopes))}return t.prototype.validateGroupMembersBuilder=function(){if(void 0===this.limit)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>ie.DEFAULT_VALUES.USERS_MAX_LIMIT)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",ie.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limit<ie.DEFAULT_VALUES.ZERO)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(void 0!==this.guid){if(typeof this.guid!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"GUID","GUID","GroupMembersRequestBuilder()")));if(te.isFalsy(this.guid))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"GUID","GUID","GUID","GUID")))}return void 0===this.scopes||Array.isArray(this.scopes)?void 0:new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_SCOPES","SET_SCOPES","setScopes()")))},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{var te=j.validateGroupMembersBuilder();if(te instanceof re.CometChatException)return void $(te);ee.makeApiCall("getGroupMembers",{guid:j.guid},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(K){K.guid=j.guid,ee.push(oe.GroupMembersController.trasformJSONGroupMember(K))})),K(ee)}else K([])}),(function(j){$(new re.CometChatException(j.error))}))}catch(te){$(new re.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),te.isFalsy(this.scopes)||(j.scopes=this.scopes),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();K.GroupMembersRequest=ae;var se=function(){function t(j){this.guid=j}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.setScopes=function(j){return this.scopes=j,this},t.prototype.build=function(){return new ae(this)},t}();K.GroupMembersRequestBuilder=se},function(j,K,$){"use strict";K.__esModule=!0,K.BannedMembersRequestBuilder=K.BannedMembersRequest=void 0;var ee=$(6),te=$(0),ne=$(2),re=$(33),oe=$(1),ie=function(){function t(j){this.cursor=-1,this.total=-1,this.next_page=1,this.last_page=-1,this.current_page=1,this.total_pages=-1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},te.isFalsy(j)||(this.limit=j.limit,this.guid=j.guid,te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.scopes)||(this.scopes=j.scopes))}return t.prototype.validateBannedMembersBuilder=function(){if(void 0===this.limit)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>oe.DEFAULT_VALUES.USERS_MAX_LIMIT)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",oe.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limit<oe.DEFAULT_VALUES.ZERO)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(void 0!==this.guid){if(typeof this.guid!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"GUID","GUID","GroupMembersRequestBuilder()")));if(te.isFalsy(this.guid))return new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.INVALID),"GUID","GUID","GUID","GUID")))}return void 0===this.scopes||Array.isArray(this.scopes)?void 0:new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_SCOPES","SET_SCOPES","setScopes()")))},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{var te=j.validateBannedMembersBuilder();if(te instanceof ne.CometChatException)return void $(te);ee.makeApiCall("getBannedGroupMembers",{guid:j.guid},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(K){K.guid=j.guid,ee.push(re.GroupMembersController.trasformJSONGroupMember(K))})),K(ee)}else K([])}),(function(j){$(new ne.CometChatException(j.error))}))}catch(te){$(new ne.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),te.isFalsy(this.scopes)||(j.scopes=this.scopes),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t}();K.BannedMembersRequest=ie;var ae=function(){function t(j){this.guid=j}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.setScopes=function(j){return this.scopes=j,this},t.prototype.build=function(){return new ie(this)},t}();K.BannedMembersRequestBuilder=ae},function(j,K,$){"use strict";K.__esModule=!0,K.UsersRequestBuilder=K.UsersRequest=void 0;var ee=$(6),te=$(0),ne=$(11),re=$(2),oe=$(44),ie=$(1),ae=function(){function e(j){this.next_page=1,this.current_page=1,this.total_pages=-1,this.hideBlockedUsers=!1,this.friendsOnly=!1,this.fetchingInProgress=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},e.userStore=oe.UserStore.getInstance(),te.isFalsy(j)||(this.limit=j.limit,te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.status)||(j.status==e.USER_STATUS.ONLINE?this.status=ie.PresenceConstatnts.STATUS.AVAILABLE:this.status=j.status),te.isFalsy(j.shouldHideBlockedUsers)||(this.hideBlockedUsers=j.shouldHideBlockedUsers),te.isFalsy(j.showFriendsOnly)||(this.friendsOnly=j.showFriendsOnly),te.isFalsy(j.showTags)||(this.withTags=j.showTags),te.isFalsy(j.role)||(this.role=j.role),te.isFalsy(j.roles)||(this.roles=j.roles),te.isFalsy(j.tags)||(this.tags=j.tags),te.isFalsy(j.UIDs)||(this.UIDs=j.UIDs),te.isFalsy(j.SortBy)||(this.sortBy=j.SortBy),te.isFalsy(j.SearchIn)||(this.searchIn=j.SearchIn),te.isFalsy(j.SortOrder)||(this.sortOrder=j.SortOrder))}return e.prototype.validateUserBuilder=function(){if(void 0===this.limit)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>ie.DEFAULT_VALUES.USERS_MAX_LIMIT)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",ie.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limit<ie.DEFAULT_VALUES.ZERO)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(this.status){if(typeof this.status!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_STATUS","SET_STATUS","setStatus()")));if("available"!=this.status.toLowerCase()&&"offline"!=this.status.toLowerCase())return new re.CometChatException(ie.UserErrors.INVALID_STATUS)}if(void 0!==this.hideBlockedUsers){if(typeof this.hideBlockedUsers!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"HIDE_BLOCKED_USERS","HIDE_BLOCKED_USERS","hideBlockedUsers()")));1==this.hideBlockedUsers?this.hideBlockedUsers=!0:this.hideBlockedUsers=!1}if(void 0!==this.friendsOnly){if(typeof this.friendsOnly!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"FRIENDS_ONLY","FRIENDS_ONLY","friendsOnly()")));1==this.friendsOnly?this.friendsOnly=!0:this.friendsOnly=!1}if(void 0!==this.withTags){if(typeof this.withTags!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.MUST_BE_A_BOOLEAN),"WITH_TAGS","WITH_TAGS","withTags()")));1==this.withTags?this.withTags=!0:this.withTags=!1}if(void 0!==this.roles&&!Array.isArray(this.roles))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"ROLES","ROLES","setRoles()")));if(void 0!==this.tags&&!Array.isArray(this.tags))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"TAGS","TAGS","setTags()")));if(void 0!==this.UIDs&&!Array.isArray(this.UIDs))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"UIDs","UIDs","setUIDs()")));if(this.sortBy){if(typeof this.sortBy!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SORT_BY","SORT_BY","sortBy()")));if(te.isFalsy(this.sortBy.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"SORT_BY","SORT_BY","sort by","sort by")));this.sortBy=this.sortBy.trim().toLowerCase()}if(this.sortOrder){if(typeof this.sortOrder!==ie.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SORT_BY_ORDER","SORT_BY_ORDER","sortByOrder()")));if(te.isFalsy(this.sortOrder.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.INVALID),"SORT_BY_ORDER","SORT_BY_ORDER","sort order","sort order")));this.sortOrder=this.sortOrder.trim().toLowerCase()}return this.searchIn&&!Array.isArray(this.searchIn)?new re.CometChatException(JSON.parse(te.format(JSON.stringify(ie.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SEARCH_IN","SEARCH_IN","searchIn()"))):void 0},e.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{if(j.fetchingInProgress)j.fetchingInProgress=!1,K([]);else{j.fetchingInProgress=!0;var te=j.validateUserBuilder();if(te instanceof re.CometChatException)return void $(te);ee.makeApiCall("users",{},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(j){ee.push(ne.UsersController.trasformJSONUser(j))})),K(ee)}else K([]);j.fetchingInProgress=!1}),(function(K){j.fetchingInProgress=!1,$(new re.CometChatException(K.error))}))}}catch(te){j.fetchingInProgress=!1,$(new re.CometChatException(te))}}))},e.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),te.isFalsy(this.status)||(j.status=this.status),te.isFalsy(this.hideBlockedUsers)||(j.hideBlockedUsers=1),te.isFalsy(this.role)||(j.roles=this.role),te.isFalsy(this.roles)||(j.roles=this.roles),te.isFalsy(this.tags)||(j.tags=this.tags),te.isFalsy(this.friendsOnly)||(j.friendsOnly=1),te.isFalsy(this.withTags)||(j.withTags=1),te.isFalsy(this.UIDs)||(j.uids=this.UIDs),te.isFalsy(this.sortBy)||(j.sortBy=this.sortBy),te.isFalsy(this.sortOrder)||(j.sortOrder=this.sortOrder),te.isFalsy(this.searchIn)||(j.searchIn=this.searchIn),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},e.USER_STATUS={ONLINE:ie.PresenceConstatnts.STATUS.ONLINE,OFFLINE:ie.PresenceConstatnts.STATUS.OFFLINE},e}();K.UsersRequest=ae;var se=function(){function t(){this.shouldHideBlockedUsers=!1}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setStatus=function(j){return this.status=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.hideBlockedUsers=function(j){return this.shouldHideBlockedUsers=j,this},t.prototype.setRole=function(j){return this.role=j,this},t.prototype.setRoles=function(j){return this.roles=j,this},t.prototype.friendsOnly=function(j){return this.showFriendsOnly=j,this},t.prototype.setTags=function(j){return this.tags=j,this},t.prototype.withTags=function(j){return this.showTags=j,this},t.prototype.setUIDs=function(j){return this.UIDs=j,this},t.prototype.sortBy=function(j){return this.SortBy=j,this},t.prototype.sortByOrder=function(j){return this.SortOrder=j,this},t.prototype.searchIn=function(j){return this.SearchIn=j,this},t.prototype.build=function(){return this.role&&this.roles&&this.roles.push(this.role),new ae(this)},t}();K.UsersRequestBuilder=se},function(j,K,$){"use strict";K.__esModule=!0,K.UserStore=void 0;var ee=$(3),te=$(0),ne=$(1),re=$(12),oe=function(){function t(j){this.store=ne.constants.DEFAULT_STORE,te.isFalsy(j)||(this.store=j),this.userStore=re.createInstance({name:te.format(ne.LOCAL_STORE.STORE_STRING,ee.CometChat.getAppId(),ne.LOCAL_STORE.USERS_STORE)}),this.userStore.setDriver([re.LOCALSTORAGE,re.INDEXEDDB,re.WEBSQL])}return t.getInstance=function(){return null==t.UserStore&&(t.UserStore=new t),t.UserStore},t.prototype.set=function(j,K){return this.userStore.setItem(j,K)},t.prototype.remove=function(j){this.userStore.removeItem(j)},t.prototype.get=function(j){return this.userStore.getItem(j)},t.prototype.clearStore=function(){var j=this;return new Promise((function(K,$){j.userStore.clear().then((function(){K(!0)})).catch((function(j){$(j)}))}))},t.prototype.clear=function(j){},t.prototype.selectStore=function(j){this.store=j},t.prototype.storeUsers=function(j){var K=this;return j.map((function(j){K.set(j.getUid(),j)})),!0},t.prototype.storeUser=function(j){return this.set(j.getUid(),j),!0},t}();K.UserStore=oe},function(j,K,$){"use strict";K.__esModule=!0,K.ConversationsRequestBuilder=K.ConversationsRequest=void 0;var ee=$(6),te=$(0),ne=$(2),re=$(24),oe=$(1),ie=function(){function t(j){this.limit=100,this.next_page=1,this.current_page=1,this.total_pages=-1,this.fetchingInProgress=!1,this.getUserAndGroupTags=!1,this.withTags=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},te.isFalsy(j)||(this.limit=j.limit,te.isFalsy(j.conversationType)||(this.conversationType=j.conversationType),te.isFalsy(j.getUserAndGroupTags)||(this.getUserAndGroupTags=j.getUserAndGroupTags),j.tags&&(this.tags=j.tags),te.isFalsy(j.WithTags)||(this.withTags=j.WithTags),j.groupTags&&(this.groupTags=j.groupTags),j.userTags&&(this.userTags=j.userTags))}return t.prototype.validateConversationBuilder=function(){return void 0===this.limit?new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))):isNaN(this.limit)?new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))):this.limit>oe.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT?new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",oe.DEFAULT_VALUES.CONVERSATION_MAX_LIMIT))):this.limit<oe.DEFAULT_VALUES.ZERO?new ne.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))):void 0},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{if(j.fetchingInProgress)j.fetchingInProgress=!1,K([]);else{j.fetchingInProgress=!0;var te=j.validateConversationBuilder();if(te instanceof ne.CometChatException)return void $(te);ee.makeApiCall("getConversations",{},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(j){ee.push(re.ConversationController.trasformJSONConversation(j.conversationId,j.conversationType,j.lastMessage,j.conversationWith,parseInt(j.unreadMessageCount),j.tags?j.tags:[]))})),K(ee)}else K([]);j.fetchingInProgress=!1}),(function(K){j.fetchingInProgress=!1,$(new ne.CometChatException(K.error))}))}}catch(te){j.fetchingInProgress=!1,$(new ne.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.conversationType)||(j.conversationType=this.conversationType),te.isFalsy(this.getUserAndGroupTags)||(j.withUserAndGroupTags=this.getUserAndGroupTags),te.isFalsy(this.tags)||(j.tags=this.tags),te.isFalsy(this.withTags)||(j.withTags=this.withTags),te.isFalsy(this.userTags)||(j.userTags=this.userTags),te.isFalsy(this.groupTags)||(j.groupTags=this.groupTags),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t}();K.ConversationsRequest=ie;var ae=function(){function t(){this.WithTags=!1}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setConversationType=function(j){return this.conversationType=j,this},t.prototype.withUserAndGroupTags=function(j){return"boolean"==typeof j&&(this.getUserAndGroupTags=j),this},t.prototype.setTags=function(j){return this.tags=j,this},t.prototype.withTags=function(j){return this.WithTags=j,this},t.prototype.setGroupTags=function(j){return this.groupTags=j,this},t.prototype.setUserTags=function(j){return this.userTags=j,this},t.prototype.build=function(){return new ie(this)},t}();K.ConversationsRequestBuilder=ae},function(j,K,$){"use strict";var ee=this&&this.__awaiter||function(j,K,$,ee){return new($||($=Promise))((function(te,ne){function o(j){try{r(ee.next(j))}catch(j){ne(j)}}function s(j){try{r(ee.throw(j))}catch(j){ne(j)}}function r(j){var K;j.done?te(j.value):(K=j.value,K instanceof $?K:new $((function(j){j(K)}))).then(o,s)}r((ee=ee.apply(j,K||[])).next())}))},te=this&&this.__generator||function(j,K){var $,ee,te,ne,re={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return ne={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(ne[Symbol.iterator]=function(){return this}),ne;function e(ne){return function(oe){return function(ne){if($)throw new TypeError("Generator is already executing.");for(;re;)try{if($=1,ee&&(te=2&ne[0]?ee.return:ne[0]?ee.throw||((te=ee.return)&&te.call(ee),0):ee.next)&&!(te=te.call(ee,ne[1])).done)return te;switch(ee=0,te&&(ne=[2&ne[0],te.value]),ne[0]){case 0:case 1:te=ne;break;case 4:return re.label++,{value:ne[1],done:!1};case 5:re.label++,ee=ne[1],ne=[0];continue;case 7:ne=re.ops.pop(),re.trys.pop();continue;default:if(!(te=0<(te=re.trys).length&&te[te.length-1])&&(6===ne[0]||2===ne[0])){re=0;continue}if(3===ne[0]&&(!te||ne[1]>te[0]&&ne[1]<te[3])){re.label=ne[1];break}if(6===ne[0]&&re.label<te[1]){re.label=te[1],te=ne;break}if(te&&re.label<te[2]){re.label=te[2],re.ops.push(ne);break}te[2]&&re.ops.pop(),re.trys.pop();continue}ne=K.call(j,re)}catch(j){ne=[6,j],ee=0}finally{$=te=0}if(5&ne[0])throw ne[1];return{value:ne[0]?ne[1]:void 0,done:!0}}([ne,oe])}}},ne=this&&this.__spreadArrays||function(){for(var j=0,K=0,$=arguments.length;K<$;K++)j+=arguments[K].length;var ee=Array(j),te=0;for(K=0;K<$;K++)for(var ne=arguments[K],re=0,oe=ne.length;re<oe;re++,te++)ee[te]=ne[re];return ee};K.__esModule=!0,K.MessagesRequestBuilder=K.MessagesRequest=void 0;var re=$(2),oe=$(6),ie=$(10),ae=$(0),se=$(47),le=$(1),ce=$(13),ue=$(25),de=function(){function t(j){this.limit=le.DEFAULT_VALUES.MSGS_LIMIT,this.timestamp=0,this.id=le.DEFAULT_VALUES.DEFAULT_MSG_ID,this.messageStore=se.MessagesStore.getInstance(),this.endpointName="getUserMessages",this.listId="",this.totalPages=0,this.unread=!1,this.inProgress=!1,this.hideMessagesFromBlockedUsers=!1,this.updatedAt=0,this.onlyUpdates=0,this.paginationMeta={},this.WithTags=!1,this.hideDeletedMessages=!1,this.limit=j.limit,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,this.uid=j.uid,this.guid=j.guid,this.parentMessageId=j.parentMessageId,this.timestamp=j.timestamp,this.timestamp&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=this.timestamp),this.id=j.id,this.id!=le.DEFAULT_VALUES.DEFAULT_MSG_ID&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.ID]=this.id),this.hideMessagesFromBlockedUsers=j.HideMessagesFromBlockedUsers,this.hideMessagesFromBlockedUsers&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_MESSAGES_FROM_BLOCKED_USER]=this.hideMessagesFromBlockedUsers),this.unread=j.unread,this.unread&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.UNREAD]=this.unread),j.searchKey&&(this.searchKey=j.searchKey,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SEARCH_KEY]=this.searchKey),j.onlyUpdate&&(this.onlyUpdates=j.onlyUpdate,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.ONLY_UPDATES]=this.onlyUpdates),j.updatedAt&&(this.updatedAt=j.updatedAt,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=this.updatedAt),j.category&&(this.category=j.category),j.categories&&(this.categories=j.categories),j.type&&(this.type=j.type),j.types&&(this.types=j.types),j.WithTags&&(this.WithTags=j.WithTags),j.tags&&(this.tags=j.tags),j.HideReplies&&(this.hideReplies=j.HideReplies,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES]=this.hideReplies),this.hideDeletedMessages=j.HideDeletedMessages,this.hideDeletedMessages&&(this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_DELETED_MESSAGES]=this.hideDeletedMessages)}return t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){return ee(j,void 0,void 0,(function(){var j,ee,ne;return te(this,(function(te){switch(te.label){case 0:if(te.trys.push([0,5,,6]),this.inProgress)return this.inProgress=!1,$(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.REQUEST_IN_PROGRESS_ERROR)),[2];if(this.inProgress=!0,this.onlyUpdates){if(0==this.updatedAt)return this.inProgress=!1,$(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS)),[2]}else if(0==this.timestamp&&0==this.id&&0==this.updatedAt)return this.inProgress=!1,$(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS)),[2];this.affix=le.MessageConstatnts.PAGINATION.AFFIX.APPEND,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,this.currentMethod=le.MessageConstatnts.PAGINATION.AFFIX.APPEND,te.label=1;case 1:return te.trys.push([1,3,,4]),[4,this.makeAPICall()];case 2:return j=te.sent(),K(j),this.inProgress=!1,[3,4];case 3:return ee=te.sent(),this.inProgress=!1,$(new re.CometChatException(ee)),[3,4];case 4:return[3,6];case 5:return ne=te.sent(),this.inProgress=!1,$(new re.CometChatException(ne)),[3,6];case 6:return[2]}}))}))}))},t.prototype.fetchPrevious=function(){var j=this;return new Promise((function(K,$){return ee(j,void 0,void 0,(function(){var j,ee,ne;return te(this,(function(te){switch(te.label){case 0:if(te.trys.push([0,5,,6]),this.inProgress)return $(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.REQUEST_IN_PROGRESS_ERROR)),this.inProgress=!1,[2];if(this.inProgress=!0,this.onlyUpdates&&0==this.updatedAt)return this.inProgress=!1,$(new re.CometChatException(ce.MESSAGES_REQUEST_ERRORS.NOT_ENOUGH_PARAMS)),[2];this.affix=le.MessageConstatnts.PAGINATION.AFFIX.PREPEND,this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,this.currentMethod=le.MessageConstatnts.PAGINATION.AFFIX.PREPEND,te.label=1;case 1:return te.trys.push([1,3,,4]),[4,this.makeAPICall()];case 2:return j=te.sent(),K(j),this.inProgress=!1,[3,4];case 3:return ee=te.sent(),this.inProgress=!1,$(new re.CometChatException(ee)),[3,4];case 4:return[3,6];case 5:return ne=te.sent(),this.inProgress=!1,$(new re.CometChatException(ne)),[3,6];case 6:return[2]}}))}))}))},t.prototype.makeAPICall=function(){var j=this;return new Promise((function(K,$){try{var ne=j.uid;if(void 0!==ne){if(typeof ne!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"UID","UID","setUID()"))));if(ae.isFalsy(ne.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"UID","UID","UID","UID"))));j.uid=ne.trim()}var se=j.guid;if(void 0!==se){if(typeof se!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"GUID","GUID","setGUID()"))));if(ae.isFalsy(se.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"GUID","GUID","GUID","GUID"))));j.guid=se.trim()}var ce=j.parentMessageId;if(void 0!==ce){if(isNaN(ce))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"PARENT_MESSAGE_ID","PARENT_MESSAGE_ID","setParentMessageId()"))));if(ce<le.DEFAULT_VALUES.ZERO)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"PARENT_MESSAGE_ID","PARENT_MESSAGE_ID","setParentMessageId()"))))}var de=j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.PER_PAGE];if(void 0===de)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit"))));if(isNaN(de))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))));if(de>le.DEFAULT_VALUES.MSGS_MAX_LIMIT)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",le.DEFAULT_VALUES.MSGS_MAX_LIMIT))));if(de<le.DEFAULT_VALUES.ZERO)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()"))));var pe=j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SEARCH_KEY];if(void 0!==pe){if(typeof pe!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()"))));if(ae.isFalsy(pe.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SEARCH_KEY]=pe.trim()}var ge=j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.ID];if(void 0!==ge){if(isNaN(ge))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"MESSAGE_ID","MESSAGE_ID","setMessageId()"))));if(ge<le.DEFAULT_VALUES.ZERO)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"MESSAGE_ID","MESSAGE_ID","setMessageId()"))))}var he=j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SENT_AT];if(void 0!==he){if(isNaN(he))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"TIMESTAMP","TIMESTAMP","setTimestamp()"))));if(he<le.DEFAULT_VALUES.ZERO)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"TIMESTAMP","TIMESTAMP","setTimestamp()"))))}var me=j.hideMessagesFromBlockedUsers;if(void 0!==me){if(typeof me!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"HIDE_MESSAGES_FROM_BLOCKED_USERS","HIDE_MESSAGES_FROM_BLOCKED_USERS","hideMessagesFromBlockedUsers()"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_MESSAGES_FROM_BLOCKED_USER]=1==me?1:0}var fe=j.unread;if(void 0!==fe){if(typeof fe!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"UNREAD","UNREAD","setUnread()"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.UNREAD]=1==fe?1:0}var ye=j.category;if(void 0!==ye){if(typeof ye!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_CATEGORY","SET_CATEGORY","setCategory()"))));if(ae.isFalsy(ye.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"SET_CATEGORY","SET_CATEGORY","category","category"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.CATEGORIES]=ye.trim()}var be=j.categories;if(void 0!==be){if(!Array.isArray(be))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_CATEGORIES","SET_CATEGORIES","setCategories()"))));0<be.length&&(j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.CATEGORIES]=be)}var ve=j.type;if(void 0!==ve){if(typeof ve!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_TYPE","SET_TYPE","setType()"))));if(ae.isFalsy(ve.trim()))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.INVALID),"SET_TYPE","SET_TYPE","type","type"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.TYPES]=ve.trim()}var Me=j.types;if(void 0!==Me){if(!Array.isArray(Me))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_TYPES","SET_TYPES","setTypes()"))));0<Me.length&&(j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.TYPES]=Me)}var Ee=j.tags;if(void 0!==Ee){if(!Array.isArray(Ee))return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_AN_ARRAY),"SET_TAGS","SET_TAGS","setTags()"))));0<Ee.length&&(j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.TAGS]=Ee)}var Se=j.WithTags;if(void 0!==Se){if(typeof Se!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"WITH_TAGS","WITH_TAGS","withTags()"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.WITH_TAGS]=1==Se?1:0}var Ce=j.hideDeletedMessages;if(void 0!==Ce){if(typeof Ce!==le.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.BOOLEAN)return void $(new re.CometChatException(JSON.parse(ae.format(JSON.stringify(le.GENERAL_ERROR.PARAMETER_MUST_BE_A_BOOLEAN),"HIDE_DELETED_MESSAGES","HIDE_DELETED_MESSAGES","hideDeletedMessages()"))));j.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_DELETED_MESSAGES]=1==Ce?1:0}if(j.createEndpoint(),j.totalPages)if(1!=j.totalPages);else if(j.lastAffix==j.affix)return void K([]);oe.makeApiCall(j.endpointName,{listId:j.listId},j.paginationMeta).then((function($){return ee(j,void 0,void 0,(function(){var j,ee=this;return te(this,(function(te){return j=[],$[le.ResponseConstants.RESPONSE_KEYS.KEY_META][le.ResponseConstants.RESPONSE_KEYS.KEY_CURSOR].hasOwnProperty(le.MessageConstatnts.PAGINATION.KEYS.ID)&&0==this.id&&(this.id=parseInt($.meta.cursor[le.MessageConstatnts.PAGINATION.KEYS.ID])),$[le.ResponseConstants.RESPONSE_KEYS.KEY_META][le.ResponseConstants.RESPONSE_KEYS.KEY_CURSOR].hasOwnProperty(le.MessageConstatnts.PAGINATION.KEYS.SENT_AT)&&0==this.timestamp&&(this.timestamp=$.meta.cursor[le.MessageConstatnts.PAGINATION.KEYS.SENT_AT]),$.meta.pagination.hasOwnProperty("total_pages")&&(this.totalPages=$.meta.pagination.total_pages),$.meta.cursor.hasOwnProperty("affix")&&(this.lastAffix=$.meta.cursor.affix),$.data[0]?(0<this.id&&(this.id=parseInt($.data[0].id)),0<this.timestamp&&(this.timestamp=$.data[0].sentAt),$.data.map((function(K){ue.MessageListnerMaping.getInstance().get(le.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST).then((function(j){parseInt(K.id)>j&&ue.MessageListnerMaping.getInstance().set(le.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(K.id))}),(function(j){ue.MessageListnerMaping.getInstance().set(le.LOCAL_STORE.KEY_MESSAGE_LISTENER_LIST,parseInt(K.id))})),ee.affix==le.MessageConstatnts.PAGINATION.AFFIX.APPEND?(ee.id<parseInt(K.id)&&0<ee.id&&(ee.id=parseInt(K.id)),ee.timestamp<K.sentAt&&0<ee.timestamp&&(ee.timestamp=K.sentAt),ee.updatedAt<K.updatedAt&&0<ee.updatedAt&&(ee.updatedAt=K.updatedAt)):(ee.id>parseInt(K.id)&&(ee.id=parseInt(K.id)),ee.timestamp>K.sentAt&&(ee.timestamp=K.sentAt),ee.updatedAt>K.updatedAt&&(ee.updatedAt=K.updatedAt)),ee.id&&(ee.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.ID]=ee.id),ee.timestamp&&(ee.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.SENT_AT]=ee.timestamp),ee.updatedAt&&(ee.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.UPDATED_AT]=ee.updatedAt),j.push(ie.MessageController.trasformJSONMessge(K))}))):j=[],K(j),[2]}))}))}),(function(j){$(new re.CometChatException(j.error))}))}catch(ne){$(new re.CometChatException(ne))}}))},t.prototype.createEndpoint=function(){this.parentMessageId?(this.endpointName="getThreadMessages",this.listId=this.parentMessageId.toString(),this.hideReplies&&(this.hideReplies=!1,delete this.paginationMeta[le.MessageConstatnts.PAGINATION.KEYS.HIDE_REPLIES])):(ae.isFalsy(this.guid)||ae.isFalsy(this.uid))&&ae.isFalsy(this.guid)?(ae.isFalsy(this.uid)?this.endpointName="getMessages":this.endpointName="getUserMessages",this.listId=this.uid):(this.endpointName="getGroupMessages",this.listId=this.guid)},t.prototype.makeData=function(){var j={};j[le.MessageConstatnts.PAGINATION.KEYS.PER_PAGE]=this.limit,j[le.MessageConstatnts.PAGINATION.KEYS.AFFIX]=this.affix,(ae.isFalsy(this.guid)||ae.isFalsy(this.uid))&&ae.isFalsy(this.guid)&&ae.isFalsy(this.uid)},t.prototype.getFilteredPreviousDataByReceiverId=function(j){return ee(this,void 0,void 0,(function(){var K,$=this;return te(this,(function(ee){switch(ee.label){case 0:switch(K=[],j){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,se.MessagesStore.getInstance().get(this.uid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 2:return ee.sent(),[3,9];case 3:return[4,se.MessagesStore.getInstance().get(this.guid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 4:ee.sent(),ee.label=5;case 5:return[4,se.MessagesStore.getInstance().get(this.guid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).filter((function(K){return j[K].sender.uid==$.uid})).map((function($){K=ne(K,[j[$]])}))}))];case 6:return ee.sent(),[3,9];case 7:return[4,se.MessagesStore.getInstance().getAllMessages().then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 8:return ee.sent(),[3,9];case 9:return[2,K]}}))}))},t.prototype.getFilteredNextDataByReceiverId=function(j){return ee(this,void 0,void 0,(function(){var K,$=this;return te(this,(function(ee){switch(ee.label){case 0:switch(K=[],j){case"user":return[3,1];case"group":return[3,3];case"both":return[3,5]}return[3,7];case 1:return[4,se.MessagesStore.getInstance().get(this.uid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 2:return ee.sent(),[3,9];case 3:return[4,se.MessagesStore.getInstance().get(this.guid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 4:ee.sent(),ee.label=5;case 5:return[4,se.MessagesStore.getInstance().get(this.guid).then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).filter((function(K){return j[K].sender.uid==$.uid})).map((function($){K=ne(K,[j[$]])}))}))];case 6:return ee.sent(),[3,9];case 7:return[4,se.MessagesStore.getInstance().getAllMessages().then((function(j){Object.keys(j).filter((function(j){return parseInt(j)>$.id})).map((function($){K=ne(K,[j[$]])}))}))];case 8:return ee.sent(),[3,9];case 9:return[2,K]}}))}))},t}();K.MessagesRequest=de;var pe=function(){function t(){this.maxLimit=le.DEFAULT_VALUES.MSGS_MAX_LIMIT,this.timestamp=0,this.id=le.DEFAULT_VALUES.DEFAULT_MSG_ID,this.unread=!1,this.HideMessagesFromBlockedUsers=!1,this.onlyUpdate=0,this.HideDeletedMessages=!1,this.WithTags=!1}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setGUID=function(j){return this.guid=j,this},t.prototype.setUID=function(j){return this.uid=j,this},t.prototype.setParentMessageId=function(j){return this.parentMessageId=j,this},t.prototype.setTimestamp=function(j){return void 0===j&&(j=ae.getCurrentTime()),this.timestamp=j,this},t.prototype.setMessageId=function(j){return void 0===j&&(j=le.DEFAULT_VALUES.DEFAULT_MSG_ID),this.id=j,this},t.prototype.setUnread=function(j){return void 0===j&&(j=!1),this.unread=j,this},t.prototype.hideMessagesFromBlockedUsers=function(j){return void 0===j&&(j=!1),this.HideMessagesFromBlockedUsers=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKey=j,this},t.prototype.setUpdatedAfter=function(j){return this.updatedAt=j,this},t.prototype.updatesOnly=function(j){return j&&(this.onlyUpdate=1),this},t.prototype.setCategory=function(j){return this.category=j,this},t.prototype.setCategories=function(j){return this.categories=j,this},t.prototype.setType=function(j){return this.type=j,this},t.prototype.setTypes=function(j){return this.types=j,this},t.prototype.hideReplies=function(j){return this.HideReplies=j,this},t.prototype.hideDeletedMessages=function(j){return this.HideDeletedMessages=j,this},t.prototype.setTags=function(j){return this.tags=j,this},t.prototype.withTags=function(j){return this.WithTags=j,this},t.prototype.build=function(){return this.category&&this.categories&&this.categories.push(this.category),this.type&&this.types&&this.types.push(this.type),new de(this)},t}();K.MessagesRequestBuilder=pe},function(j,K,$){"use strict";var ee=this&&this.__assign||function(){return(ee=Object.assign||function(j){for(var K,$=1,ee=arguments.length;$<ee;$++)for(var te in K=arguments[$])Object.prototype.hasOwnProperty.call(K,te)&&(j[te]=K[te]);return j}).apply(this,arguments)};K.__esModule=!0,K.MessagesStore=void 0;var te=$(3),ne=$(0),re=$(1),oe=$(12),ie=function(){function t(j){this.store=re.constants.DEFAULT_STORE,ne.isFalsy(j)||(this.store=j),this.messagesStore=oe.createInstance({name:ne.format(re.LOCAL_STORE.STORE_STRING,te.CometChat.getAppId(),re.LOCAL_STORE.MESSAGES_STORE)}),this.messagesStore.setDriver([oe.LOCALSTORAGE,oe.INDEXEDDB,oe.WEBSQL])}return t.getInstance=function(){return null==t.MessagesStore&&(t.MessagesStore=new t),t.MessagesStore},t.prototype.set=function(j,K){return this.messagesStore.setItem(j,K)},t.prototype.remove=function(j){this.messagesStore.removeItem(j)},t.prototype.get=function(j){return this.messagesStore.getItem(j)},t.prototype.clearStore=function(){var j=this;return new Promise((function(K,$){j.messagesStore.clear().then((function(){K(!0)})).catch((function(j){$(j)}))}))},t.prototype.getAllMessages=function(){var j=this,K={};return new Promise((function($,te){j.messagesStore.iterate((function(j,$,te){$!=re.constants.MSG_VER_POST&&$!=re.constants.MSG_VER_POST&&(K=ee(ee({},K),j))})).then((function(){$(K)}))}))},t.prototype.clear=function(j){},t.prototype.selectStore=function(j){this.store=j},t.prototype.storeMessages=function(j){var K=this;if(te.CometChat.user.getUid()){var $=te.CometChat.user.getUid(),oe={},ie=0;return this.get(re.constants.MSG_VER_POST).then((function(te){j.map((function(j){var K;if(!ne.isFalsy(j)){0==ie&&(ie=parseInt(j.getId().toString())),ie>j.getId()&&(ie=parseInt(j.getId().toString())),te<j.getId()&&(te=parseInt(j.getId().toString()));var ae=void 0;ae=j.getSender()instanceof Object?j.getSender().getUid():j.getSender(),j.getReceiverType()==re.MessageConstatnts.RECEIVER_TYPE.GROUP&&(ae=j.getReceiver()),j.getSender()instanceof Object?j.getSender().getUid()==$&&(ae=j.getReceiver()):j.getSender()==$&&(ae=j.getReceiver()),oe[ae]||(oe[ae]={}),oe[ae]=ee(ee({},oe[ae]),((K={})[j.getId()]=j,K))}})),K.get(re.constants.MSG_VER_PRE).then((function(j){(0<ie&&ie<j||null==j)&&K.set(re.constants.MSG_VER_PRE,ie)}))&&0<te&&K.set(re.constants.MSG_VER_POST,te),Object.keys(oe).map((function(j){K.get(j).then((function($){null==$&&($={}),K.set(j,ee(ee({},oe[j]),$))}))}))})),!0}},t}();K.MessagesStore=ie},function(j,K,$){"use strict";K.__esModule=!0,K.BlockedUsersRequestBuilder=K.BlockedUsersRequest=void 0;var ee=$(6),te=$(0),ne=$(11),re=$(2),oe=$(1),ie=function(){function t(j){this.next_page=1,this.current_page=1,this.total_pages=-1,this.fetchingInProgress=!1,this.pagination={total:0,count:0,per_page:0,current_page:0,total_pages:0,links:[]},te.isFalsy(j)||(this.limit=j.limit,te.isFalsy(j.searchKeyword)||(this.searchKeyword=j.searchKeyword),te.isFalsy(j.direction)||(this.direction=j.direction))}return t.prototype.validateBlockedUsersBuilder=function(){if(void 0===this.limit)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.METHOD_COMPULSORY),"SET_LIMIT","SET_LIMIT","Set Limit")));if(isNaN(this.limit))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(this.limit>oe.DEFAULT_VALUES.USERS_MAX_LIMIT)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.LIMIT_EXCEEDED),"SET_LIMIT","SET_LIMIT",oe.DEFAULT_VALUES.USERS_MAX_LIMIT)));if(this.limit<oe.DEFAULT_VALUES.ZERO)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_POSITIVE_NUMBER),"SET_LIMIT","SET_LIMIT","setLimit()")));if(void 0!==this.searchKeyword){if(typeof this.searchKeyword!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","setSearchKeyword()")));if(te.isFalsy(this.searchKeyword.trim()))return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.INVALID),"SET_SEARCH_KEYWORD","SET_SEARCH_KEYWORD","search keyword","search keyword")));this.searchKeyword=this.searchKeyword.trim()}if(void 0!==this.direction){if(typeof this.direction!==oe.COMMON_UTILITY_CONSTANTS.TYPE_CONSTANTS.STRING)return new re.CometChatException(JSON.parse(te.format(JSON.stringify(oe.GENERAL_ERROR.PARAMETER_MUST_BE_A_STRING),"SET_DIRECTION","SET_DIRECTION","setDirection()")));if(this.direction!=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BOTH&&this.direction!=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME&&this.direction!=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME)return new re.CometChatException(oe.UserErrors.INVALID_DIRECTION)}},t.prototype.fetchNext=function(){var j=this;return new Promise((function(K,$){try{if(j.fetchingInProgress)j.fetchingInProgress=!1,K([]);else{j.fetchingInProgress=!0;var te=j.validateBlockedUsersBuilder();if(te instanceof re.CometChatException)return void $(te);ee.makeApiCall("blockedUsersList",{},j.getNextData()).then((function($){if($.meta&&(j.total_pages=$.meta.pagination.total_pages),0<$.data.length){j.pagination=$.meta.pagination;var ee=[];$.data.map((function(j){ee.push(ne.UsersController.trasformJSONUser(j))})),K(ee)}else K([]);j.fetchingInProgress=!1}),(function(K){j.fetchingInProgress=!1,$(new re.CometChatException(K.error))}))}}catch(te){j.fetchingInProgress=!1,$(new re.CometChatException(te))}}))},t.prototype.getNextData=function(){var j={};if(j.per_page=this.limit,te.isFalsy(this.direction)||(j.direction=this.direction),te.isFalsy(this.searchKeyword)||(j.searchKey=this.searchKeyword),1==this.current_page)j.page=this.next_page,this.next_page++,this.current_page++;else{if(this.next_page>this.total_pages)return j.page=this.next_page,j;j.page=this.next_page++}return j},t.MAX_LIMIT=2,t.DEFAULT_LIMIT=1,t.directions=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS,t}();K.BlockedUsersRequest=ie;var ae=function(){function t(){}return t.prototype.setLimit=function(j){return this.limit=j,this},t.prototype.setSearchKeyword=function(j){return this.searchKeyword=j,this},t.prototype.setDirection=function(j){return this.direction=j,this},t.prototype.blockedByMe=function(){return this.direction=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.BLOCKED_BY_ME,this},t.prototype.hasBlockedMe=function(){return this.direction=oe.BlockedUsersConstants.REQUEST_KEYS.DIRECTIONS.HAS_BLOCKED_ME,this},t.prototype.build=function(){return new ie(this)},t}();K.BlockedUsersRequestBuilder=ae},function(j,K,$){"use strict";K.__esModule=!0,K.AppSettingsBuilder=K.AppSettings=void 0;var ee=$(1),te=function(){function e(j){this.subscriptionType=e.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=ee.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null,this.subscriptionType=j.subscriptionType,this.roles=j.roles,this.region=j.region,this.autoJoinGroup=j.autoJoinGroup,this.establishSocketConnection=j.establishSocketConnection,this.adminHost=j.adminHost,this.clientHost=j.clientHost}return e.prototype.getSubscriptionType=function(){return this.subscriptionType},e.prototype.getRoles=function(){return this.roles},e.prototype.getRegion=function(){return this.region},e.prototype.getIsAutoJoinEnabled=function(){return this.autoJoinGroup},e.prototype.shouldAutoEstablishSocketConnection=function(){return this.establishSocketConnection},e.prototype.getAdminHost=function(){return this.adminHost},e.prototype.getClientHost=function(){return this.clientHost},e.SUBSCRIPTION_TYPE_NONE="NONE",e.SUBSCRIPTION_TYPE_ALL_USERS="ALL_USERS",e.SUBSCRIPTION_TYPE_ROLES="ROLES",e.SUBSCRIPTION_TYPE_FRIENDS="FRIENDS",e.REGION_EU=ee.DEFAULT_VALUES.REGION_DEFAULT_EU,e.REGION_US=ee.DEFAULT_VALUES.REGION_DEFAULT_US,e.REGION_IN=ee.DEFAULT_VALUES.REGION_DEFAULT_IN,e.REGION_PRIVATE=ee.DEFAULT_VALUES.REGION_DEFAULT_PRIVATE,e}();K.AppSettings=te;var ne=function(){function t(){this.subscriptionType=te.SUBSCRIPTION_TYPE_NONE,this.roles=null,this.region=ee.DEFAULT_VALUES.REGION_DEFAULT,this.autoJoinGroup=!0,this.establishSocketConnection=!0,this.adminHost=null,this.clientHost=null}return t.prototype.subscribePresenceForAllUsers=function(){return this.subscriptionType=te.SUBSCRIPTION_TYPE_ALL_USERS,this},t.prototype.subscribePresenceForRoles=function(j){return this.subscriptionType=te.SUBSCRIPTION_TYPE_ROLES,this.roles=j,this},t.prototype.subscribePresenceForFriends=function(){return this.subscriptionType=te.SUBSCRIPTION_TYPE_FRIENDS,this},t.prototype.setRegion=function(j){return void 0===j&&(j=ee.DEFAULT_VALUES.REGION_DEFAULT),this.region=j.toLowerCase(),this},t.prototype.enableAutoJoinForGroups=function(j){return void 0===j&&(j=!0),this.autoJoinGroup=j,this},t.prototype.autoEstablishSocketConnection=function(j){return void 0===j&&(j=!0),this.establishSocketConnection=j,this},t.prototype.overrideAdminHost=function(j){return this.adminHost=j,this},t.prototype.overrideClientHost=function(j){return this.clientHost=j,this},t.prototype.build=function(){return new te(this)},t}();K.AppSettingsBuilder=ne},function(j,K,$){"use strict";K.__esModule=!0,K.CometChatHelper=void 0;var ee=$(10),te=$(1),ne=$(11),re=$(15),oe=$(24),ie=$(3),ae=$(2),se=$(0),le=function(){function t(){}return t.processMessage=function(j){try{return ee.MessageController.trasformJSONMessge(j)}catch(j){se.Logger.error("CometChatHelper: processMessage",j)}},t.getConversationFromMessage=function(j){return new Promise((function(K,$){try{ie.CometChat.getLoggedinUser().then((function(ie){if(null!==ie){var ae=ee.MessageController.trasformJSONMessge(j),se=ae.receiverType,le=ae.conversationId,ce=void 0,ue=ee.MessageController.trasformJSONMessge(j);if(se==te.MessageConstatnts.RECEIVER_TYPE.USER){var de=ne.UsersController.trasformJSONUser(ae[te.MessageConstatnts.KEYS.SENDER]);ce=de.getUid()==ie.getUid()?ne.UsersController.trasformJSONUser(ae[te.MessageConstatnts.KEYS.RECEIVER]):de}else ce=re.GroupsController.trasformJSONGroup(ae[te.MessageConstatnts.KEYS.RECEIVER]);var pe=oe.ConversationController.trasformJSONConversation(le,se,ue,ce,0,[]);K(pe)}else $(te.UserErrors.USER_NOT_LOGGED_IN)}),(function(j){$(new ae.CometChatException(j.error))}))}catch(j){$(new ae.CometChatException(j))}}))},t}();K.CometChatHelper=le},function(j,K,$){"use strict";K.__esModule=!0,K.MainVideoContainerSetting=K.VirtualBackgroundBuilder=K.VirtualBackground=K.CallSettingsBuilder=K.CallSettings=void 0;var ee=$(1),te=$(0),ne=function(){function t(j){this.sessionID=j.sessionID,this.defaultLayout=j.defaultLayout,this.isAudioOnly=j.isAudioOnly,this.region=j.region,this.user=j.user,this.mode=j.mode,this.domain=j.domain,this.ShowEndCallButton=j.ShowEndCallButton,this.ShowMuteAudioButton=j.ShowMuteAudioButton,this.ShowPauseVideoButton=j.ShowPauseVideoButton,this.ShowScreenShareButton=j.ShowScreenShareButton,this.ShowSwitchModeButton=j.ShowSwitchModeButton,this.StartAudioMuted=j.StartAudioMuted,this.StartVideoMuted=j.StartVideoMuted,this.localizedObject=j.localizedObject,this.analyticsSettings=j.analyticsSettings,this.appId=j.appId,this.customCSS=j.customCSS,this.ShowRecordingButton=j.ShowRecordingButton,this.StartRecordingOnCallStart=j.StartRecordingOnCallStart,this.useLegacyUI=j.useLegacyUI,this.ShowSwitchToVideoCallButton=j.ShowSwitchToVideoCallButton,this.VirtualBackground=j.virtualBackground,this.ShowVirtualBackgroundSetting=j.ShowVirtualBackgroundSetting,this.MainVideoContainerSetting=j.MainVideoContainerSetting}return t.prototype.shouldUseLegacyUI=function(){return this.useLegacyUI},t.prototype.isRecordingButtonEnabled=function(){return this.ShowRecordingButton},t.prototype.shouldStartRecordingOnCallStart=function(){return this.StartRecordingOnCallStart},t.prototype.getCustomCSS=function(){return this.customCSS},t.prototype.getSessionId=function(){return this.sessionID},t.prototype.isAudioOnlyCall=function(){return this.isAudioOnly},t.prototype.getUser=function(){return this.user},t.prototype.getRegion=function(){return this.region},t.prototype.getAppId=function(){return this.appId},t.prototype.getDomain=function(){return this.domain},t.prototype.isDefaultLayoutEnabled=function(){return this.defaultLayout},t.prototype.getMode=function(){return this.mode},t.prototype.getStartWithAudioMuted=function(){return this.StartAudioMuted},t.prototype.getStartWithVideoMuted=function(){return this.StartVideoMuted},t.prototype.isEndCallButtonEnabled=function(){return this.ShowEndCallButton},t.prototype.isMuteAudioButtonEnabled=function(){return this.ShowMuteAudioButton},t.prototype.isPauseVideoButtonEnabled=function(){return this.ShowPauseVideoButton},t.prototype.isScreenShareButtonEnabled=function(){return this.ShowScreenShareButton},t.prototype.isModeButtonEnabled=function(){return this.ShowSwitchModeButton},t.prototype.getLocalizedStringObject=function(){return this.localizedObject},t.prototype.getAnalyticsSettings=function(){return this.analyticsSettings},t.prototype.isAudioToVideoButtonEnabled=function(){return this.ShowSwitchToVideoCallButton},t.prototype.getVirtualBackground=function(){return this.VirtualBackground},t.prototype.isVirtualBackgroundSettingEnabled=function(){return this.ShowVirtualBackgroundSetting},t.prototype.getMainVideoContainerSetting=function(){return this.MainVideoContainerSetting},t.POSITION_TOP_LEFT="top-left",t.POSITION_TOP_RIGHT="top-right",t.POSITION_BOTTOM_LEFT="bottom-left",t.POSITION_BOTTOM_RIGHT="bottom-right",t.ASPECT_RATIO_DEFAULT="default",t.ASPECT_RATIO_CONTAIN="contain",t.ASPECT_RATIO_COVER="cover",t}();K.CallSettings=ne;var re=function(){function t(){this.defaultLayout=!0,this.isAudioOnly=!1,this.mode=ee.CallConstants.CALL_MODE.DEFAULT,this.ShowEndCallButton=!0,this.ShowMuteAudioButton=!0,this.ShowPauseVideoButton=!0,this.ShowScreenShareButton=!0,this.ShowSwitchModeButton=!0,this.StartAudioMuted=!1,this.StartVideoMuted=!1,this.localizedObject={},this.analyticsSettings={},this.ShowRecordingButton=!1,this.StartRecordingOnCallStart=!1,this.useLegacyUI=!1,this.ShowSwitchToVideoCallButton=!0,this.virtualBackground=(new ie).build(),this.ShowVirtualBackgroundSetting=!0,this.MainVideoContainerSetting=new ae}return t.prototype.setSessionID=function(j){return this.sessionID=j,this},t.prototype.enableDefaultLayout=function(j){return this.defaultLayout=j,this},t.prototype.setIsAudioOnlyCall=function(j){return this.isAudioOnly=j,this},t.prototype.setRegion=function(j){return this.region=j,this},t.prototype.setDomain=function(j){return this.domain=j,this},t.prototype.setUser=function(j){return this.user=j,this},t.prototype.setMode=function(j){return this.mode=j,this},t.prototype.showEndCallButton=function(j){return this.ShowEndCallButton=j,this},t.prototype.showMuteAudioButton=function(j){return this.ShowMuteAudioButton=j,this},t.prototype.showPauseVideoButton=function(j){return this.ShowPauseVideoButton=j,this},t.prototype.showScreenShareButton=function(j){return this.ShowScreenShareButton=j,this},t.prototype.showModeButton=function(j){return this.ShowSwitchModeButton=j,this},t.prototype.setLocalizedStringObject=function(j){return this.localizedObject=j,this},t.prototype.setAnalyticsSettings=function(j){return this.analyticsSettings=j,this},t.prototype.setAppId=function(j){return this.appId=j,this},t.prototype.startWithAudioMuted=function(j){return this.StartAudioMuted=j,this},t.prototype.startWithVideoMuted=function(j){return this.StartVideoMuted=j,this},t.prototype.setCustomCSS=function(j){return this.customCSS=j,this},t.prototype.showRecordingButton=function(j){return this.ShowRecordingButton=j,this},t.prototype.startRecordingOnCallStart=function(j){return this.StartRecordingOnCallStart=j,this},t.prototype.forceLegacyUI=function(j){return this.useLegacyUI=j,this},t.prototype.showSwitchToVideoCallButton=function(j){return this.ShowSwitchToVideoCallButton=j,this},t.prototype.setVirtualBackground=function(j){return this.virtualBackground=j,this},t.prototype.showVirtualBackgroundSetting=function(j){return this.ShowVirtualBackgroundSetting=j,this},t.prototype.setMainVideoContainerSetting=function(j){return this.MainVideoContainerSetting=j,this},t.prototype.build=function(){return new ne(this)},t}();K.CallSettingsBuilder=re;var oe=function(){function t(j){this.AllowBackgroundBlur=j.AllowBackgroundBlur,this.AllowUserImages=j.AllowUserImages,this.ShowDefaultImages=j.ShowDefaultImages,this.SetImages=j.SetImages,this.EnforceBackgroundBlur=j.EnforceBackgroundBlur,this.EnforceBackgroundImage=j.EnforceBackgroundImage}return t.prototype.shouldAllowBackgroundBlur=function(){return this.AllowBackgroundBlur},t.prototype.shouldAllowUserImages=function(){return this.AllowUserImages},t.prototype.shouldShowDefaultImages=function(){return this.ShowDefaultImages},t.prototype.getImages=function(){return this.SetImages},t.prototype.isBackgroundBlurEnforced=function(){return this.EnforceBackgroundBlur},t.prototype.getEnforcedBackgroundImage=function(){return this.EnforceBackgroundImage},t}();K.VirtualBackground=oe;var ie=function(){function t(){this.AllowBackgroundBlur=!0,this.AllowUserImages=!0,this.ShowDefaultImages=!0,this.SetImages=[],this.EnforceBackgroundBlur=0,this.EnforceBackgroundImage=""}return t.prototype.allowBackgroundBlur=function(j){return this.AllowBackgroundBlur=j,this},t.prototype.allowUserImages=function(j){return this.AllowUserImages=j,this},t.prototype.showDefaultImages=function(j){return this.ShowDefaultImages=j,this},t.prototype.setImages=function(j){return this.SetImages=j,this},t.prototype.enforceBackgroundBlur=function(j){return this.EnforceBackgroundBlur=j,this},t.prototype.enforceBackgroundImage=function(j){return this.EnforceBackgroundImage=j,this},t.prototype.build=function(){return new oe(this)},t}();K.VirtualBackgroundBuilder=ie;var ae=function(){function t(){this.videoFit=ne.ASPECT_RATIO_CONTAIN,this.zoomButton=ee.CallConstants.ZOOM_BUTTON_DEFAULT_PARAMS,this.nameLabel=ee.CallConstants.NAME_LABEL_DEFAULT_PARAMS,this.network=ee.CallConstants.NETWORK_LABEL_DEFAULT_PARAMS}return t.prototype.setMainVideoAspectRatio=function(j){this.videoFit=j},t.prototype.setFullScreenButtonParams=function(j,K){te.isFalsy(j)||(this.zoomButton[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=j),null!=K&&null!=K&&(this.zoomButton[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=K)},t.prototype.setNameLabelParams=function(j,K,$){te.isFalsy(j)||(this.nameLabel[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=j),null!=K&&null!=K&&(this.nameLabel[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=K),te.isFalsy($)||(this.nameLabel[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.COLOR]=$)},t.prototype.setNetworkLabelParams=function(j,K){te.isFalsy(j)||(this.network[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.POSITION]=j),null!=K&&null!=K&&(this.network[ee.CallConstants.MAIN_VIDEO_CONTAINER_SETTINGS.KEYS.VISIBILITY]=K)},t}();K.MainVideoContainerSetting=ae},function(j,K,$){"use strict";K.__esModule=!0,K.RTCUser=void 0;var ee=$(0),te=function(){function t(j){this.avatar="",ee.isFalsy(j)||(this.uid=j.toString())}return t.prototype.setUID=function(j){this.uid=j?j.toString():""},t.prototype.getUID=function(){return this.uid.toString()},t.prototype.setName=function(j){this.name=j?j.toString():""},t.prototype.getName=function(){return this.name.toString()},t.prototype.setAvatar=function(j){this.avatar=j?j.toString():""},t.prototype.getAvatar=function(){return this.avatar.toString()},t.prototype.setJWT=function(j){this.jwt=j?j.toString():""},t.prototype.getJWT=function(){return this.jwt.toString()},t.prototype.setResource=function(j){this.resource=j?j.toString():""},t.prototype.getResource=function(){return this.resource.toString()},t}();K.RTCUser=te},function(j,K,$){"use strict";var ee=this&&this.__awaiter||function(j,K,$,ee){return new($||($=Promise))((function(te,ne){function o(j){try{r(ee.next(j))}catch(j){ne(j)}}function s(j){try{r(ee.throw(j))}catch(j){ne(j)}}function r(j){var K;j.done?te(j.value):(K=j.value,K instanceof $?K:new $((function(j){j(K)}))).then(o,s)}r((ee=ee.apply(j,K||[])).next())}))},te=this&&this.__generator||function(j,K){var $,ee,te,ne,re={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return ne={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(ne[Symbol.iterator]=function(){return this}),ne;function e(ne){return function(oe){return function(ne){if($)throw new TypeError("Generator is already executing.");for(;re;)try{if($=1,ee&&(te=2&ne[0]?ee.return:ne[0]?ee.throw||((te=ee.return)&&te.call(ee),0):ee.next)&&!(te=te.call(ee,ne[1])).done)return te;switch(ee=0,te&&(ne=[2&ne[0],te.value]),ne[0]){case 0:case 1:te=ne;break;case 4:return re.label++,{value:ne[1],done:!1};case 5:re.label++,ee=ne[1],ne=[0];continue;case 7:ne=re.ops.pop(),re.trys.pop();continue;default:if(!(te=0<(te=re.trys).length&&te[te.length-1])&&(6===ne[0]||2===ne[0])){re=0;continue}if(3===ne[0]&&(!te||ne[1]>te[0]&&ne[1]<te[3])){re.label=ne[1];break}if(6===ne[0]&&re.label<te[1]){re.label=te[1],te=ne;break}if(te&&re.label<te[2]){re.label=te[2],re.ops.push(ne);break}te[2]&&re.ops.pop(),re.trys.pop();continue}ne=K.call(j,re)}catch(j){ne=[6,j],ee=0}finally{$=te=0}if(5&ne[0])throw ne[1];return{value:ne[0]?ne[1]:void 0,done:!0}}([ne,oe])}}};K.__esModule=!0,K.WSConnectionHelper=void 0;var ne=$(3),re=$(1),oe=$(31),ie=$(36),ae=$(0),se=$(37),le=$(30),ce=$(25),ue=$(20),de=$(21),pe=$(54),ge=$(55),he=$(56),me=$(57),fe=$(58),ye=$(59),be=$(60),ve=$(22),Me=$(27),Ee=$(26),Se=$(5),Ce=$(61),_e=se.ListenerHandlers.getInstance(),Te=function(){function e(){}return e.getInstance=function(){try{return null!=this.wsConnectionHelper&&null!=this.wsConnectionHelper||(this.wsConnectionHelper=new e),this.wsConnectionHelper}catch(j){ae.Logger.error("WSConnectionHelper: getInstance",j)}},e.prototype.WSLogin=function(j,K){var $=this;try{Ce.getWSURL().then((function(ee){$.connection=new WebSocket(ee),K&&$.connection&&$.connection.readyState==Se.READY_STATE.CONNECTING&&K($.connection.readyState),$.connection.onopen=function(ee){$.onOpen(ee,K),$.authenticateUser(j)},$.connection.onclose=function(j){$.onClose(j,K)},$.connection.onmessage=function(j){$.onMessage(j)}}),(function(j){ae.Logger.error("WSConnectionHelper :: WSLogin",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: WSLogin",j)}},e.prototype.onOpen=function(j,K){try{K&&this.connection&&K(this.connection.readyState)}catch(j){ae.Logger.error("WSConnectionHelper: onOpen",j)}},e.prototype.onClose=function(j,K){try{K&&this.connection&&K(this.connection.readyState)}catch(j){ae.Logger.error("WSConnectionHelper: onClose",j)}},e.prototype.onMessage=function(j){if(j.data&&"string"==typeof j.data)try{var K=JSON.parse(j.data);if(K&&K.action&&K.action===Se.KEYS.PONG)return;var $=this.getCometChatEventFromMessage(JSON.parse(j.data));if($.getDeviceId()===ne.CometChat.getSessionId()&&$.getType()!==Se.AUTH.TYPE)return;switch($.getType()){case Se.TYPING_INDICATOR.TYPE:this.publishTypingIndicator($);break;case Se.RECEIPTS.TYPE:this.publishReceipts($);break;case Se.PRESENCE.TYPE:this.publishPresence($);break;case Se.AUTH.TYPE:this.authResponseReceived($);break;case Se.MESSAGE.TYPE:this.publishMessages($);break;case Se.TRANSIENT_MESSAGE.TYPE:this.publishTransientMessage($);break;default:ae.Logger.log("WSHelper: onMessage :: unknown type",j.data)}}catch(j){ae.Logger.error("WSHelper: onMessage",j)}else ae.Logger.log("WSHelper: onMessage :: object data",j.data)},e.prototype.authenticateUser=function(j){var K=this;try{ne.CometChat.getLoggedinUser().then((function($){$?le.KeyStore.getInstance().get("deviceId").then((function(ee){ae.getAppSettings().then((function(te){var oe=null;window&&window.location&&window.location.origin&&(oe=window.location.origin);var ie="",se=ee,le={version:re.SDKHeader.sdkVersion,apiVersion:te[re.APP_SETTINGS.KEYS.CHAT_API_VERSION],origin:oe,uts:(new Date).getTime()};ae.isFalsy(ne.CometChat.resource)||(le.resource=ne.CometChat.resource),ae.isFalsy(ne.CometChat.platform)||(le.platform=ne.CometChat.platform),ae.isFalsy(ne.CometChat.language)||(le.language=ne.CometChat.language),navigator&&(ie=navigator.userAgent);var ce={appInfo:le,userAgent:ie,deviceId:se,platform:re.SDKHeader.platform},ue=new pe.CometChatAuthEvent(ne.CometChat.getAppId(),"","",$.getUid(),ne.CometChat.getSessionId());if(ue.setAuth(j),ue.setPresenceSubscription(ne.CometChat.appSettings.getSubscriptionType()),ue.setDeviceId(ne.CometChat.getSessionId()),ue.setExtraParmaeters(ce),Ce.checkConnection(K.connection)){var de=ue.getAsString();K.connection.send(de)}}))})):ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: startTypingIndicator",j)}},e.prototype.authResponseReceived=function(j){try{"200"===j.getCode()&&"OK"===j.getStatus()&&this.startPingingWS()}catch(j){ae.Logger.error("WSConnectionHelper: authResponseReceived",j)}},e.prototype.WSLogout=function(){try{this.clearPingTimer(),Ce.checkConnection(this.connection)&&this.connection.close(Se.LOGOUT_CODE,Se.LOGOUT_REASON)}catch(j){ae.Logger.error("WSConnectionHelper: WSLogout",j)}},e.prototype.startPingingWS=function(){var j=this;try{e.pingTimer||(e.pingTimer=setInterval((function(){return ee(j,void 0,void 0,(function(){var j,K;return te(this,(function($){switch($.label){case 0:return Ce.checkConnection(this.connection)?(j=new he.CometChatPingEvent("","","","",""),K=j.getAsString(),this.connection.send(K),[4,this.listenForPong()]):[3,2];case 1:$.sent()?(ae.Logger.log("WSConnectionHelper :: startPingingWS","pong success"),ne.CometChat.getConnectionStatus()!=re.CONNECTION_STATUS.CONNECTED&&(this.WSLogout(),this.connection=null,ne.CometChat.getInstance().makeWSConnection())):(ae.Logger.log("WSConnectionHelper :: startPingingWS","pong failure"),this.WSLogout(),this.connection=null,ne.CometChat.getInstance().setConnectionStatus(re.CONNECTION_STATUS.DISCONNECTED),_e.connectionHandlers.map((function(j){try{j._eventListener&&(ae.isFalsy(j._eventListener.onDisconnected)||j._eventListener.onDisconnected())}catch(j){ae.Logger.error("WSConnectionHandlers: Disconnected Status",j)}})),ne.CometChat.getInstance().accidentallyDisconnected()),$.label=2;case 2:return[2]}}))}))}),15e3))}catch(j){ae.Logger.error("WSConnectionHelper: startPingingWS",j)}},e.prototype.listenForPong=function(){var j=this;return new Promise((function(K,$){var ee=setTimeout((function(){K(!1)}),3e3);j.connection.addEventListener("message",(function(j){j&&j.data&&"string"==typeof j.data&&JSON.parse(j.data).action===Se.KEYS.PONG&&(clearTimeout(ee),K(!0))}))}))},e.prototype.clearPingTimer=function(){e.pingTimer&&(clearInterval(e.pingTimer),e.pingTimer=void 0)},e.prototype.sendOnlineEvent=function(){var j=this;try{Ce.checkConnection(this.connection)&&ne.CometChat.getLoggedinUser().then((function(K){if(K){K.authToken&&delete K.authToken;var $={appId:ne.CometChat.getAppId(),deviceId:ne.CometChat.getSessionId(),type:Se.PRESENCE.TYPE,body:{action:Se.PRESENCE.ACTION.ONLINE,timestamp:Math.floor((new Date).getTime()/1e3),user:K}};if(Ce.checkConnection(j.connection)){var ee=Ce.stringifyMessage($);j.connection.send(ee)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: sendOnlineEvent",j)}},e.prototype.sendOfflineEvent=function(){var j=this;try{Ce.checkConnection(this.connection)&&ne.CometChat.getLoggedinUser().then((function(K){if(K){K.authToken&&delete K.authToken;var $={appId:ne.CometChat.getAppId(),deviceId:ne.CometChat.getSessionId(),type:Se.PRESENCE.TYPE,body:{action:Se.PRESENCE.ACTION.OFFLINE,timestamp:Math.floor((new Date).getTime()/1e3),user:K}};if(Ce.checkConnection(j.connection)){var ee=Ce.stringifyMessage($);j.connection.send(ee)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: sendOfflineEvent",j)}},e.prototype.startTypingIndicator=function(j,K,$){var ee=this;try{ne.CometChat.getLoggedinUser().then((function(te){if(te){var re=new Ee.TypingIndicator(j,K);te.authToken&&delete te.authToken,re.setSender(te),$&&re.setMetadata($);var oe=new be.CometChatTypingEvent(ne.CometChat.getAppId(),j,K,te.getUid(),ne.CometChat.getSessionId());if(oe.setAction(Se.TYPING_INDICATOR.ACTION.STARTED),oe.setTypingIndicator(re),Ce.checkConnection(ee.connection)){var ie=oe.getAsString();ee.connection.send(ie)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: startTypingIndicator",j)}},e.prototype.pauseTypingIndicator=function(j,K,$){var ee=this;try{ne.CometChat.getLoggedinUser().then((function(te){if(te){var re=new Ee.TypingIndicator(j,K);te.authToken&&delete te.authToken,re.setSender(te),$&&re.setMetadata($);var oe=new be.CometChatTypingEvent(ne.CometChat.getAppId(),j,K,te.getUid(),ne.CometChat.getSessionId());if(oe.setAction(Se.TYPING_INDICATOR.ACTION.ENDED),oe.setTypingIndicator(re),Ce.checkConnection(ee.connection)){var ie=oe.getAsString();ee.connection.send(ie)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: pauseTypingIndicator",j)}},e.prototype.markAsRead=function(j,K,$,ee){var te=this;try{ne.CometChat.getMode(),ne.CometChat.getLoggedinUser().then((function(re){if(re){var oe=new fe.CometChatReceiptEvent(ne.CometChat.getAppId(),j,K,re.getUid(),ne.CometChat.getSessionId(),ee);oe.setAction(Se.RECEIPTS.ACTION.READ);var ie=new ve.MessageReceipt;if(re.authToken&&delete re.authToken,ie.setSender(re),ie.setReceiverType(K),ie.setReceiver(j),ie.setReceiptType(Se.RECEIPTS.RECEIPT_TYPE.READ_RECEIPT),ie.setMessageId($),ie.setTimestamp(Math.floor((new Date).getTime()/1e3).toString()),oe.setMessageReceipt(ie),Ce.checkConnection(te.connection)){var se=oe.getAsString();te.connection.send(se)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: markAsRead",j)}},e.prototype.markAsDelivered=function(j,K,$,ee){var te=this;try{ne.CometChat.getMode(),ne.CometChat.getLoggedinUser().then((function(re){if(re){var oe=new fe.CometChatReceiptEvent(ne.CometChat.getAppId(),j,K,re.getUid(),ne.CometChat.getSessionId(),ee);oe.setAction(Se.RECEIPTS.ACTION.DELIVERED);var ie=new ve.MessageReceipt;if(re.authToken&&delete re.authToken,ie.setSender(re),ie.setReceiverType(K),ie.setReceiver(j),ie.setReceiptType(Se.RECEIPTS.RECEIPT_TYPE.DELIVERY_RECEIPT),ie.setMessageId($),ie.setTimestamp(Math.floor((new Date).getTime()/1e3).toString()),oe.setMessageReceipt(ie),Ce.checkConnection(te.connection)){var se=oe.getAsString();te.connection.send(se)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: markAsDelivered",j)}},e.prototype.sendTransientMessage=function(j,K,$){var ee=this;try{ne.CometChat.getLoggedinUser().then((function(te){if(te){var re=new Me.TransientMessage(j,K,$);te.authToken&&delete te.authToken,re.setSender(te);var oe=new ye.CometChatTransientEvent(ne.CometChat.getAppId(),j,K,te.getUid(),ne.CometChat.getSessionId());if(oe.setTransientMessage(re),Ce.checkConnection(ee.connection)){var ie=oe.getAsString();ee.connection.send(ie)}}else ae.Logger.log("no logged-in user","null")}),(function(j){ae.Logger.log("error in fetching logged-in user",j)}))}catch(j){ae.Logger.error("WSConnectionHelper: sendTransientMessage",j)}},e.prototype.publishTypingIndicator=function(j){try{var K=j.getTypingIndicator();switch(j.getAction()){case Se.TYPING_INDICATOR.ACTION.STARTED:_e.messageHandlers.map((function(j){j._eventListener.onTypingStarted&&j._eventListener.onTypingStarted(K)})),ie.TypingNotificationController.addIncomingTypingStarted(K);break;case Se.TYPING_INDICATOR.ACTION.ENDED:_e.messageHandlers.map((function(j){j._eventListener.onTypingEnded&&j._eventListener.onTypingEnded(K)})),ie.TypingNotificationController.removeIncomingTypingStarted(K)}}catch(j){ae.Logger.error("WSHelper: publishTypingIndicator",j)}},e.prototype.publishReceipts=function(j){try{var K=j.getMessageReceipt();switch(j.getAction()){case Se.RECEIPTS.ACTION.DELIVERED:_e.messageHandlers.map((function(j){j._eventListener.onMessagesDelivered&&j._eventListener.onMessagesDelivered(K)}));break;case Se.RECEIPTS.ACTION.READ:_e.messageHandlers.map((function(j){j._eventListener.onMessagesRead&&j._eventListener.onMessagesRead(K)}))}}catch(j){ae.Logger.error("WSHelper: publishReceipts",j)}},e.prototype.publishPresence=function(j){try{var K=j.getUser();switch(K.setLastActiveAt(j.getTimestamp()),j.getAction()){case Se.PRESENCE.ACTION.ONLINE:case Se.PRESENCE.ACTION.AVAILABLE:K.setStatus(re.PresenceConstatnts.STATUS.ONLINE),_e.userHandlers.map((function(j){ae.isFalsy(j._eventListener.onUserOnline)||j._eventListener.onUserOnline(K)}));break;case Se.PRESENCE.ACTION.OFFLINE:K.setStatus(re.PresenceConstatnts.STATUS.OFFLINE),_e.userHandlers.map((function(j){ae.isFalsy(j._eventListener.onUserOffline)||j._eventListener.onUserOffline(K)}))}}catch(j){ae.Logger.error("WSHelper: publishPresence",j)}},e.prototype.publishMessages=function(j){try{var K=j.getMessage();K&&K.getId()&&ce.MessageListnerMaping.getInstance().set("all",K.getId()),K instanceof de.Call?this.publishCallMessage(K):K instanceof ue.Action?this.publishActionMessage(K):this.publishMessage(K)}catch(j){ae.Logger.error("WSHelper: publishMessages",j)}},e.prototype.publishMessage=function(j){try{_e.messageHandlers.map((function(K){if(K._eventListener){var $=j;switch($.getType()){case re.MessageConstatnts.TYPE.TEXT:ae.isFalsy(K._eventListener.onTextMessageReceived)||K._eventListener.onTextMessageReceived(j);break;case re.MessageConstatnts.TYPE.CUSTOM:ae.isFalsy(K._eventListener.onCustomMessageReceived)||K._eventListener.onCustomMessageReceived(j);break;default:$.getCategory()==re.MessageCategory.CUSTOM?ae.isFalsy(K._eventListener.onCustomMessageReceived)||K._eventListener.onCustomMessageReceived(j):ae.isFalsy(K._eventListener.onMediaMessageReceived)||K._eventListener.onMediaMessageReceived(j)}}}))}catch(j){ae.Logger.error("WSHelper: publishMessage",j)}},e.prototype.publishCallMessage=function(j){try{var K=oe.CallController.getInstance().getActiveCall();switch(j.getStatus()){case re.CallConstants.CALL_STATUS.INITIATED:j.getReceiverType()==re.CallConstants.RECEIVER_TYPE_GROUP?_e.callHandlers.map((function(K){j.getCallInitiator().getUid().toLocaleLowerCase()!=ne.CometChat.user.getUid().toLocaleLowerCase()&&(ae.isFalsy(K._eventListener.onIncomingCallReceived)||K._eventListener.onIncomingCallReceived(j))})):_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onIncomingCallReceived)||K._eventListener.onIncomingCallReceived(j)}));break;case re.CallConstants.CALL_STATUS.ONGOING:j.getReceiverType()==re.CallConstants.RECEIVER_TYPE_GROUP?j.getCallInitiator().getUid().toLocaleLowerCase()==ne.CometChat.user.getUid().toLocaleLowerCase()&&_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallAccepted)||K._eventListener.onOutgoingCallAccepted(j)})):_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallAccepted)||K._eventListener.onOutgoingCallAccepted(j)}));break;case re.CallConstants.CALL_STATUS.UNANSWERED:if(j.getCallInitiator().getUid().toLocaleLowerCase()==ne.CometChat.user.getUid().toLocaleLowerCase())_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallRejected)||K._eventListener.onOutgoingCallRejected(j)}));else{if(null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch(j){ae.Logger.error("CallError",j)}_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onIncomingCallCancelled)||K._eventListener.onIncomingCallCancelled(j)}))}break;case re.CallConstants.CALL_STATUS.REJECTED:if(j.getReceiverType()==re.CallConstants.RECEIVER_TYPE_GROUP)j.getCallInitiator().getUid().toLocaleLowerCase()==ne.CometChat.user.getUid().toLocaleLowerCase()&&_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallRejected)||K._eventListener.onOutgoingCallRejected(j)}));else{if(null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch(j){ae.Logger.error("CallError",j)}_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallRejected)||K._eventListener.onOutgoingCallRejected(j)}))}break;case re.CallConstants.CALL_STATUS.BUSY:j.getReceiverType()==re.CallConstants.RECEIVER_TYPE_GROUP?j.getCallInitiator().getUid().toLocaleLowerCase()==ne.CometChat.user.getUid().toLocaleLowerCase()&&_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onOutgoingCallRejected)||K._eventListener.onOutgoingCallRejected(j)})):_e.callHandlers.map((function($){if(null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch($){ae.Logger.error("CallError",$)}ae.isFalsy($._eventListener.onOutgoingCallRejected)||$._eventListener.onOutgoingCallRejected(j)}));break;case re.CallConstants.CALL_STATUS.CANCELLED:if(_e.callHandlers.map((function(K){ae.isFalsy(K._eventListener.onIncomingCallCancelled)||K._eventListener.onIncomingCallCancelled(j)})),null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch(j){ae.Logger.error("CallError",j)}break;case re.CallConstants.CALL_STATUS.ENDED:if(oe.CallController.getInstance().getCallListner()&&oe.CallController.getInstance().getCallListner()._eventListener.onCallEnded(j),null!==K&&K.getSessionId()===j.getSessionId())try{oe.CallController.getInstance().endCall()}catch(j){ae.Logger.error("CallError",j)}break;default:ae.Logger.log("WSHelper: publishCallMessage :: unknown status",j)}}catch(j){ae.Logger.error("WSHelper: publishCallMessage",j)}},e.prototype.publishActionMessage=function(j){try{switch(j.getAction()){case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_JOINED:case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_INVITED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberJoined)||K._eventListener.onGroupMemberJoined(j,j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_LEFT:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberLeft)||K._eventListener.onGroupMemberLeft(j,j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_BANNED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberBanned)||K._eventListener.onGroupMemberBanned(j,j.getActionOn(),j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_KICKED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberKicked)||K._eventListener.onGroupMemberKicked(j,j.getActionOn(),j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_UNBANNED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberUnbanned)||K._eventListener.onGroupMemberUnbanned(j,j.getActionOn(),j.getActionBy(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_SCOPE_CHANGED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberScopeChanged)||K._eventListener.onGroupMemberScopeChanged(j,j.getActionOn(),j.getNewScope(),j.getOldScope(),j.getActionFor())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MESSAGE_EDITED:_e.messageHandlers.map((function(K){ae.isFalsy(K._eventListener.onMessageEdited)||K._eventListener.onMessageEdited(j.getActionOn())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MESSAGE_DELETED:_e.messageHandlers.map((function(K){ae.isFalsy(K._eventListener.onMessageDeleted)||K._eventListener.onMessageDeleted(j.getActionOn())}));break;case re.ActionConstatnts.ACTION_TYPE.TYPE_MEMBER_ADDED:_e.groupHandlers.map((function(K){ae.isFalsy(K._eventListener.onGroupMemberAddedToGroup)||K._eventListener.onGroupMemberAddedToGroup(j,j.getActionOn(),j.getActionBy(),j.getActionFor())}));break;default:ae.Logger.log("WSHelper: publishActionMessage :: unknown action",j)}}catch(j){ae.Logger.error("WSHelper: publishActionMessage",j)}},e.prototype.publishTransientMessage=function(j){try{var K=j.getTransientMessage();_e.messageHandlers.map((function(j){j._eventListener.onTransientMessageReceived&&j._eventListener.onTransientMessageReceived(K)}))}catch(j){ae.Logger.error("WSHelper: publishTransientMessage",j)}},e.prototype.getCometChatEventFromMessage=function(j){try{if(j.hasOwnProperty(Se.KEYS.TYPE))switch(j.type){case Se.TYPING_INDICATOR.TYPE:return be.CometChatTypingEvent.getTypingEventFromJSON(j);case Se.RECEIPTS.TYPE:return fe.CometChatReceiptEvent.getReceiptEventFromJSON(j);case Se.PRESENCE.TYPE:return me.CometChatPresenceEvent.getPresenceEventFromJSON(j);case Se.MESSAGE.TYPE:return ge.CometChatMessageEvent.getMessageEventFromJSON(j);case Se.AUTH.TYPE:return pe.CometChatAuthEvent.getAuthEventFromJSON(j);case Se.TRANSIENT_MESSAGE.TYPE:return ye.CometChatTransientEvent.getTransientEventFromJSON(j)}}catch(j){ae.Logger.error("WSConnectionHelper: getCometChatEventFromMessage",j)}},e.wsConnectionHelper=new e,e}();K.WSConnectionHelper=Te},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatAuthEvent=void 0;var ne=$(5),re=function(j){function u(K,$,ee,te,re){var oe=j.call(this,K,$,ee,te,re)||this;return oe.setType(ne.AUTH.TYPE),oe}return te(u,j),u.prototype.getStatus=function(){return this.status},u.prototype.setStatus=function(j){this.status=j},u.prototype.getCode=function(){return this.code},u.prototype.setCode=function(j){this.code=j},u.prototype.setAuth=function(j){this.auth=j},u.prototype.getAuth=function(){return this.auth},u.prototype.setPresenceSubscription=function(j){this.presenceSubscription=j},u.prototype.getPresenceSubscription=function(){return this.presenceSubscription},u.prototype.setDeviceId=function(j){this.deviceId=j},u.prototype.getdeviceId=function(){return this.deviceId},u.prototype.setExtraParmaeters=function(j){this.params=j},u.prototype.getExtraParameters=function(){return this.params},u.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},u.prototype.getAsJSONObject=function(){var j=this.getCometChatEventJSON(),K={};return K[ne.KEYS.AUTH]=this.auth,K[ne.KEYS.DEVICE_ID]=this.deviceId,K[ne.KEYS.PRESENCE_SUBSCRIPTION]=this.presenceSubscription,K[ne.KEYS.PARAMS]=this.params,j[ne.KEYS.BODY]=K,j},u.getAuthEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.RECEIVER],ee=j[ne.KEYS.RECEIVER_TYPE],te=j[ne.KEYS.DEVICE_ID],re=j[ne.KEYS.SENDER],oe=j[ne.KEYS.BODY],ie=oe[ne.KEYS.STATUS],ae=oe[ne.KEYS.CODE],se=new u(K,$,ee,re,te);return se.setStatus(ie),se.setCode(ae),se},u}($(9).CometChatEvent);K.CometChatAuthEvent=re},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatMessageEvent=void 0;var ne=$(10),re=$(5),oe=function(j){function c(K,$,ee,te,ne){var oe=j.call(this,K,$,ee,te,ne)||this;return oe.setType(re.MESSAGE.TYPE),oe}return te(c,j),c.prototype.getMessage=function(){return this.message},c.prototype.setMessage=function(j){this.message=j},c.getMessageEventFromJSON=function(j){var K=j[re.KEYS.APP_ID],$=j[re.KEYS.RECEIVER],ee=j[re.KEYS.RECEIVER_TYPE],te=j[re.KEYS.DEVICE_ID],oe=j[re.KEYS.SENDER],ie=j[re.KEYS.BODY],ae=new c(K,$,ee,oe,te),se=ne.MessageController.trasformJSONMessge(ie);return ae.setMessage(se),ae},c}($(9).CometChatEvent);K.CometChatMessageEvent=oe},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatPingEvent=void 0;var ne=$(5),re=function(j){function t(K,$,ee,te,ne){return j.call(this,K,$,ee,te,ne)||this}return te(t,j),t.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},t.prototype.getAsJSONObject=function(){var j={};return j[ne.KEYS.ACTION]=ne.KEYS.PING,j[ne.KEYS.ACK]="true",j},t}($(9).CometChatEvent);K.CometChatPingEvent=re},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatPresenceEvent=void 0;var ne=$(5),re=$(9),oe=$(4),ie=function(j){function c(K,$,ee,te,re){var oe=j.call(this,K,$,ee,te,re)||this;return oe.setType(ne.PRESENCE.TYPE),oe}return te(c,j),c.prototype.getAction=function(){return this.action},c.prototype.setAction=function(j){this.action=j},c.prototype.getUser=function(){return this.user},c.prototype.setUser=function(j){this.user=j},c.prototype.getTimestamp=function(){return this.timestamp},c.prototype.setTimestamp=function(j){this.timestamp=j},c.getPresenceEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.DEVICE_ID],ee=j[ne.KEYS.SENDER],te=j[ne.KEYS.BODY],re=te[ne.KEYS.ACTION],ie=te[ne.KEYS.USER],ae=te[ne.KEYS.TIMESTAMP],se=new c(K,"","",ee,$);return se.setAction(re),se.setUser(new oe.User(ie)),se.setTimestamp(ae),se},c}(re.CometChatEvent);K.CometChatPresenceEvent=ie},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatReceiptEvent=void 0;var ne=$(5),re=$(9),oe=$(22),ie=$(4),ae=function(j){function p(K,$,ee,te,re,oe){var ie=j.call(this,K,$,ee,te,re,oe)||this;return ie.setType(ne.RECEIPTS.TYPE),ie}return te(p,j),p.prototype.getAction=function(){return this.action},p.prototype.setAction=function(j){this.action=j},p.prototype.getMessageReceipt=function(){return this.receipt},p.prototype.setMessageReceipt=function(j){this.receipt=j},p.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},p.prototype.getAsJSONObject=function(){var j=this.getCometChatEventJSON(),K={};return K[ne.KEYS.ACTION]=this.action,K[ne.KEYS.MESSAGE_ID]=this.receipt.getMessageId(),K[ne.KEYS.USER]=this.receipt.getSender(),j[ne.KEYS.BODY]=K,j},p.getReceiptEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.RECEIVER],ee=j[ne.KEYS.RECEIVER_TYPE],te=j[ne.KEYS.DEVICE_ID],re=j[ne.KEYS.SENDER],ae=j[ne.KEYS.BODY],se=ae[ne.KEYS.ACTION],le=ae[ne.KEYS.USER],ce=ae[ne.KEYS.MESSAGE_ID],ue=ae[ne.KEYS.TIMESTAMP],de=new p(K,$,ee,re,te);de.setAction(se);var pe=new oe.MessageReceipt;return pe.setSender(new ie.User(le)),pe.setReceiverType(ee),pe.setReceiver($),se===ne.RECEIPTS.ACTION.DELIVERED&&(pe.setReceiptType(ne.RECEIPTS.RECEIPT_TYPE.DELIVERY_RECEIPT),pe.setDeliveredAt(ue)),se===ne.RECEIPTS.ACTION.READ&&(pe.setReceiptType(ne.RECEIPTS.RECEIPT_TYPE.READ_RECEIPT),pe.setReadAt(ue)),pe.setMessageId(ce.toString()),pe.setTimestamp(ue),de.setMessageReceipt(pe),de},p}(re.CometChatEvent);K.CometChatReceiptEvent=ae},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatTransientEvent=void 0;var ne=$(5),re=$(9),oe=$(27),ie=$(4),ae=function(j){function S(K,$,ee,te,re){var oe=j.call(this,K,$,ee,te,re)||this;return oe.setType(ne.TRANSIENT_MESSAGE.TYPE),oe}return te(S,j),S.prototype.getTransientMessage=function(){return this.transientMessage},S.prototype.setTransientMessage=function(j){this.transientMessage=j},S.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},S.prototype.getAsJSONObject=function(){var j=this.getCometChatEventJSON(),K={};return K[ne.KEYS.USER]=this.transientMessage.getSender(),this.transientMessage.getData()&&(K[ne.KEYS.DATA]=this.transientMessage.getData()),j[ne.KEYS.BODY]=K,j},S.getTransientEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.RECEIVER],ee=j[ne.KEYS.RECEIVER_TYPE],te=j[ne.KEYS.DEVICE_ID],re=j[ne.KEYS.SENDER],ae=j[ne.KEYS.BODY],se=ae[ne.KEYS.USER],le=ae[ne.KEYS.DATA],ce=new S(K,$,ee,re,te),ue=new oe.TransientMessage($,ee,le);return ue.setSender(new ie.User(se)),ae.hasOwnProperty(ne.KEYS.DATA)&&ae[ne.KEYS.DATA]&&ue.setData(le),ce.setTransientMessage(ue),ce},S}(re.CometChatEvent);K.CometChatTransientEvent=ae},function(j,K,$){"use strict";var ee,te=this&&this.__extends||(ee=function(j,K){return(ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(j,K){j.__proto__=K}||function(j,K){for(var $ in K)K.hasOwnProperty($)&&(j[$]=K[$])})(j,K)},function(j,K){function n(){this.constructor=j}ee(j,K),j.prototype=null===K?Object.create(K):(n.prototype=K.prototype,new n)});K.__esModule=!0,K.CometChatTypingEvent=void 0;var ne=$(5),re=$(9),oe=$(26),ie=$(4),ae=function(j){function l(K,$,ee,te,re){var oe=j.call(this,K,$,ee,te,re)||this;return oe.setType(ne.TYPING_INDICATOR.TYPE),oe}return te(l,j),l.prototype.getAction=function(){return this.action},l.prototype.setAction=function(j){this.action=j},l.prototype.getTypingIndicator=function(){return this.typingIndicator},l.prototype.setTypingIndicator=function(j){this.typingIndicator=j},l.prototype.getAsString=function(){return JSON.stringify(this.getAsJSONObject())},l.prototype.getAsJSONObject=function(){var j=this.getCometChatEventJSON(),K={};return K[ne.KEYS.ACTION]=this.action,K[ne.KEYS.USER]=this.typingIndicator.getSender(),this.typingIndicator.getMetadata()&&(K[ne.KEYS.METADATA]=this.typingIndicator.getMetadata()),j[ne.KEYS.BODY]=K,j},l.getTypingEventFromJSON=function(j){var K=j[ne.KEYS.APP_ID],$=j[ne.KEYS.RECEIVER],ee=j[ne.KEYS.RECEIVER_TYPE],te=j[ne.KEYS.DEVICE_ID],re=j[ne.KEYS.SENDER],ae=j[ne.KEYS.BODY],se=ae[ne.KEYS.ACTION],le=ae[ne.KEYS.USER],ce=ae[ne.KEYS.METADATA],ue=new l(K,$,ee,re,te);ue.setAction(se);var de=new oe.TypingIndicator($,ee);return de.setSender(new ie.User(le)),ae.hasOwnProperty(ne.KEYS.METADATA)&&ae[ne.KEYS.METADATA]&&de.setMetadata(ce),ue.setTypingIndicator(de),ue},l}(re.CometChatEvent);K.CometChatTypingEvent=ae},function(j,K,$){"use strict";K.__esModule=!0,K.getWSURL=K.stringifyMessage=K.checkConnection=void 0;var ee=$(1),te=$(0),ne=$(5);K.checkConnection=function(j){return j&&j.readyState===ne.READY_STATE.OPEN},K.stringifyMessage=function(j){return JSON.stringify(j)},K.getWSURL=function(){return new Promise((function(j,K){te.getAppSettings().then((function(K){var $=ne.WS.protocol+te.getChatHost(K)+":"+K[ee.APP_SETTINGS.KEYS.CHAT_WSS_PORT];j($)}),(function(j){te.Logger.error("WSHelper :: getWSURL",j)}))}))}},function(j,K,$){"use strict";K.__esModule=!0,K.CCExtension=void 0;var ee=$(0),te=function(){function t(j){this.id="",this.name="",j&&(ee.isFalsy(j.id)||(this.id=j.id),ee.isFalsy(j.name)||(this.name=j.name))}return t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t}();K.CCExtension=te},function(j,K,$){var ee=$(64),te=$(65);j.exports=function(j,K,$){var ne=K&&$||0;"string"==typeof j&&(K="binary"===j?new Array(16):null,j=null);var re=(j=j||{}).random||(j.rng||ee)();if(re[6]=15&re[6]|64,re[8]=63&re[8]|128,K)for(var oe=0;oe<16;++oe)K[ne+oe]=re[oe];return K||te(re)}},function(j,K){var $="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if($){var ee=new Uint8Array(16);j.exports=function(){return $(ee),ee}}else{var te=new Array(16);j.exports=function(){for(var j,K=0;K<16;K++)0==(3&K)&&(j=4294967296*Math.random()),te[K]=j>>>((3&K)<<3)&255;return te}}},function(j,K){for(var $=[],ee=0;ee<256;++ee)$[ee]=(ee+256).toString(16).substr(1);j.exports=function(j,K){var ee=K||0,te=$;return[te[j[ee++]],te[j[ee++]],te[j[ee++]],te[j[ee++]],"-",te[j[ee++]],te[j[ee++]],"-",te[j[ee++]],te[j[ee++]],"-",te[j[ee++]],te[j[ee++]],"-",te[j[ee++]],te[j[ee++]],te[j[ee++]],te[j[ee++]],te[j[ee++]],te[j[ee++]]].join("")}}])},9094:(j,K,$)=>{"use strict";$.d(K,{$L:()=>ee,Ab:()=>be,Cq:()=>ce,DO:()=>Ge,EC:()=>ue,IE:()=>Ve,Ie:()=>Te,JK:()=>ae,JY:()=>Ne,Ks:()=>Ye,Mu:()=>Pe,O5:()=>fe,P5:()=>Qe,Q:()=>Ke,Qb:()=>Ue,RW:()=>de,Sg:()=>He,TU:()=>ve,UA:()=>Ie,Vm:()=>Be,W8:()=>he,Wt:()=>De,XM:()=>_e,XZ:()=>Fe,Xu:()=>ge,YI:()=>ze,Yo:()=>le,Yr:()=>me,_H:()=>Ee,dO:()=>Ce,e$:()=>$e,e0:()=>Je,gv:()=>pe,io:()=>ie,jK:()=>re,jR:()=>Ae,k2:()=>Re,m$:()=>je,mU:()=>Xe,nv:()=>xe,nw:()=>Le,o2:()=>Ze,oZ:()=>se,os:()=>ne,ot:()=>Oe,p4:()=>Se,pS:()=>qe,pm:()=>ye,pn:()=>we,r9:()=>oe,s6:()=>nt,sG:()=>et,wO:()=>We,x9:()=>Me,x_:()=>te,yw:()=>ke});var ee="schedule",te="invoke",ne="addEventListener",re=["link","css","script","img","xmlhttprequest","fetch","beacon","iframe"],oe=5e3,ie=3e5,ae=1e3,se="page-load",le="custom",ce="user-interaction",ue="http-request",de="temporary",pe="Unknown",ge="page-exit",he=[se,"route-change",ce,ue,le,de],me="success",fe="failure",ye="unknown",be=60,ve="transaction:start",Me="transaction:end",Ee="config:change",Se="queue:flush",Ce="queue:add_transaction",_e="transaction:ignore",Te="xmlhttprequest",Ae="fetch",Ie="history",Ne="eventtarget",Oe="click",we="error",De=":before",xe=":after",je="elastic_apm_config",Le="longtask",ke="paint",Pe="measure",Re="navigation",ze="resource",Ue="first-contentful-paint",Ge="largest-contentful-paint",Be="first-input",Ze="layout-shift",Ye="event",He="errors",We="transactions",Ve="ConfigService",Fe="LoggingService",Qe="TransactionService",Ke="ApmServer",Je="PerformanceMonitoring",Xe="ErrorLogging",qe=".truncated",$e=1024,et=18e5,nt=1e4},5951:function(j,K,$){var ee,te,ne;!function(re,oe){"use strict";te=[$(8742)],void 0===(ne="function"==typeof(ee=function ErrorStackParser(j){var K=/(^|@)\S+\:\d+/,$=/^\s*at .*(\S+\:\d+|\(native\))/m,ee=/^(eval@)?(\[native code\])?$/;function _map(j,K,$){if("function"==typeof Array.prototype.map)return j.map(K,$);for(var ee=new Array(j.length),te=0;te<j.length;te++)ee[te]=K.call($,j[te]);return ee}function _filter(j,K,$){if("function"==typeof Array.prototype.filter)return j.filter(K,$);for(var ee=[],te=0;te<j.length;te++)K.call($,j[te])&&ee.push(j[te]);return ee}function _indexOf(j,K){if("function"==typeof Array.prototype.indexOf)return j.indexOf(K);for(var $=0;$<j.length;$++)if(j[$]===K)return $;return-1}return{parse:function ErrorStackParser$$parse(j){if(void 0!==j.stacktrace||void 0!==j["opera#sourceloc"])return this.parseOpera(j);if(j.stack&&j.stack.match($))return this.parseV8OrIE(j);if(j.stack)return this.parseFFOrSafari(j);throw new Error("Cannot parse given Error object")},extractLocation:function ErrorStackParser$$extractLocation(j){if(-1===j.indexOf(":"))return[j];var K=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(j.replace(/[\(\)]/g,""));return[K[1],K[2]||void 0,K[3]||void 0]},parseV8OrIE:function ErrorStackParser$$parseV8OrIE(K){return _map(_filter(K.stack.split("\n"),(function(j){return!!j.match($)}),this),(function(K){K.indexOf("(eval ")>-1&&(K=K.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var $=K.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),ee=this.extractLocation($.pop()),te=$.join(" ")||void 0,ne=_indexOf(["eval","<anonymous>"],ee[0])>-1?void 0:ee[0];return new j(te,void 0,ne,ee[1],ee[2],K)}),this)},parseFFOrSafari:function ErrorStackParser$$parseFFOrSafari(K){return _map(_filter(K.stack.split("\n"),(function(j){return!j.match(ee)}),this),(function(K){if(K.indexOf(" > eval")>-1&&(K=K.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===K.indexOf("@")&&-1===K.indexOf(":"))return new j(K);var $=K.split("@"),ee=this.extractLocation($.pop()),te=$.join("@")||void 0;return new j(te,void 0,ee[0],ee[1],ee[2],K)}),this)},parseOpera:function ErrorStackParser$$parseOpera(j){return!j.stacktrace||j.message.indexOf("\n")>-1&&j.message.split("\n").length>j.stacktrace.split("\n").length?this.parseOpera9(j):j.stack?this.parseOpera11(j):this.parseOpera10(j)},parseOpera9:function ErrorStackParser$$parseOpera9(K){for(var $=/Line (\d+).*script (?:in )?(\S+)/i,ee=K.message.split("\n"),te=[],ne=2,re=ee.length;ne<re;ne+=2){var oe=$.exec(ee[ne]);oe&&te.push(new j(void 0,void 0,oe[2],oe[1],void 0,ee[ne]))}return te},parseOpera10:function ErrorStackParser$$parseOpera10(K){for(var $=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,ee=K.stacktrace.split("\n"),te=[],ne=0,re=ee.length;ne<re;ne+=2){var oe=$.exec(ee[ne]);oe&&te.push(new j(oe[3]||void 0,void 0,oe[2],oe[1],void 0,ee[ne]))}return te},parseOpera11:function ErrorStackParser$$parseOpera11($){return _map(_filter($.stack.split("\n"),(function(j){return!!j.match(K)&&!j.match(/^Error created at/)}),this),(function(K){var $,ee=K.split("@"),te=this.extractLocation(ee.pop()),ne=ee.shift()||"",re=ne.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;ne.match(/\(([^\)]*)\)/)&&($=ne.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var oe=void 0===$||"[arguments not available]"===$?void 0:$.split(",");return new j(re,oe,te[0],te[1],te[2],K)}),this)}}})?ee.apply(K,te):ee)||(j.exports=ne)}()},8742:function(j,K){var $,ee,te;!function(ne,re){"use strict";ee=[],void 0===(te="function"==typeof($=function(){function _isNumber(j){return!isNaN(parseFloat(j))&&isFinite(j)}function StackFrame(j,K,$,ee,te,ne){void 0!==j&&this.setFunctionName(j),void 0!==K&&this.setArgs(K),void 0!==$&&this.setFileName($),void 0!==ee&&this.setLineNumber(ee),void 0!==te&&this.setColumnNumber(te),void 0!==ne&&this.setSource(ne)}return StackFrame.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(j){this.functionName=String(j)},getArgs:function(){return this.args},setArgs:function(j){if("[object Array]"!==Object.prototype.toString.call(j))throw new TypeError("Args must be an Array");this.args=j},getFileName:function(){return this.fileName},setFileName:function(j){this.fileName=String(j)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(j){if(!_isNumber(j))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(j)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(j){if(!_isNumber(j))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(j)},getSource:function(){return this.source},setSource:function(j){this.source=String(j)},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(_isNumber(this.getLineNumber())?":"+this.getLineNumber():"")+(_isNumber(this.getColumnNumber())?":"+this.getColumnNumber():"")}},StackFrame})?$.apply(K,ee):$)||(j.exports=te)}()},9010:(j,K,$)=>{"use strict";function createStackTraces(j,K){var $=K.error,ee=K.filename,te=K.lineno,ne=K.colno,re=[];if($)try{re=j.parse($)}catch(j){}return function isValidStackTrace(j){return 0!==j.length&&(1!==j.length||"lineNumber"in j[0])}(re)||(re=[{fileName:ee,lineNumber:te,columnNumber:ne}]),function normalizeStackFrames(j){return j.map((function(j){return j.functionName&&(j.functionName=function normalizeFunctionName(j){var K=j.split("/");return j=K.length>1?["Object",K[K.length-1]].join("."):K[0],j=(K=(j=(j=j.replace(/.<$/gi,".<anonymous>")).replace(/^Anonymous function$/,"<anonymous>")).split(".")).length>1?K[K.length-1]:K[0]}(j.functionName)),j}))}(re).map((function(j){var K=j.fileName,$=j.lineNumber,ee=j.columnNumber,te=j.functionName,ne=void 0===te?"<anonymous>":te;if(!K&&!$)return{};if(!ee&&!$)return{};var re=function cleanFilePath(j){return void 0===j&&(j=""),"<anonymous>"===j&&(j=""),j}(K),oe=function filePathToFileName(j){var K=window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");return j.indexOf(K)>-1&&(j=j.replace(K+"/","")),j}(re);return function isFileInline(j){return!!j&&0===window.location.href.indexOf(j)}(re)&&(oe="(inline script)"),{abs_path:K,filename:oe,function:ne,lineno:$,colno:ee}}))}$.d(K,{tu:()=>vt,S1:()=>Mt});const ee=function finallyConstructor(j){var K=this.constructor;return this.then((function($){return K.resolve(j()).then((function(){return $}))}),(function($){return K.resolve(j()).then((function(){return K.reject($)}))}))};const te=function allSettled(j){return new this((function(K,$){if(!j||void 0===j.length)return $(new TypeError(typeof j+" "+j+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var ee=Array.prototype.slice.call(j);if(0===ee.length)return K([]);var te=ee.length;function res(j,$){if($&&("object"==typeof $||"function"==typeof $)){var ne=$.then;if("function"==typeof ne)return void ne.call($,(function(K){res(j,K)}),(function($){ee[j]={status:"rejected",reason:$},0==--te&&K(ee)}))}ee[j]={status:"fulfilled",value:$},0==--te&&K(ee)}for(var ne=0;ne<ee.length;ne++)res(ne,ee[ne])}))};var ne=$(5108),re=setTimeout;function isArray(j){return Boolean(j&&void 0!==j.length)}function noop(){}function Promise(j){if(!(this instanceof Promise))throw new TypeError("Promises must be constructed via new");if("function"!=typeof j)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],doResolve(j,this)}function handle(j,K){for(;3===j._state;)j=j._value;0!==j._state?(j._handled=!0,Promise._immediateFn((function(){var $=1===j._state?K.onFulfilled:K.onRejected;if(null!==$){var ee;try{ee=$(j._value)}catch(j){return void reject(K.promise,j)}resolve(K.promise,ee)}else(1===j._state?resolve:reject)(K.promise,j._value)}))):j._deferreds.push(K)}function resolve(j,K){try{if(K===j)throw new TypeError("A promise cannot be resolved with itself.");if(K&&("object"==typeof K||"function"==typeof K)){var $=K.then;if(K instanceof Promise)return j._state=3,j._value=K,void finale(j);if("function"==typeof $)return void doResolve(function bind(j,K){return function(){j.apply(K,arguments)}}($,K),j)}j._state=1,j._value=K,finale(j)}catch(K){reject(j,K)}}function reject(j,K){j._state=2,j._value=K,finale(j)}function finale(j){2===j._state&&0===j._deferreds.length&&Promise._immediateFn((function(){j._handled||Promise._unhandledRejectionFn(j._value)}));for(var K=0,$=j._deferreds.length;K<$;K++)handle(j,j._deferreds[K]);j._deferreds=null}function Handler(j,K,$){this.onFulfilled="function"==typeof j?j:null,this.onRejected="function"==typeof K?K:null,this.promise=$}function doResolve(j,K){var $=!1;try{j((function(j){$||($=!0,resolve(K,j))}),(function(j){$||($=!0,reject(K,j))}))}catch(j){if($)return;$=!0,reject(K,j)}}Promise.prototype.catch=function(j){return this.then(null,j)},Promise.prototype.then=function(j,K){var $=new this.constructor(noop);return handle(this,new Handler(j,K,$)),$},Promise.prototype.finally=ee,Promise.all=function(j){return new Promise((function(K,$){if(!isArray(j))return $(new TypeError("Promise.all accepts an array"));var ee=Array.prototype.slice.call(j);if(0===ee.length)return K([]);var te=ee.length;function res(j,ne){try{if(ne&&("object"==typeof ne||"function"==typeof ne)){var re=ne.then;if("function"==typeof re)return void re.call(ne,(function(K){res(j,K)}),$)}ee[j]=ne,0==--te&&K(ee)}catch(j){$(j)}}for(var ne=0;ne<ee.length;ne++)res(ne,ee[ne])}))},Promise.allSettled=te,Promise.resolve=function(j){return j&&"object"==typeof j&&j.constructor===Promise?j:new Promise((function(K){K(j)}))},Promise.reject=function(j){return new Promise((function(K,$){$(j)}))},Promise.race=function(j){return new Promise((function(K,$){if(!isArray(j))return $(new TypeError("Promise.race accepts an array"));for(var ee=0,te=j.length;ee<te;ee++)Promise.resolve(j[ee]).then(K,$)}))},Promise._immediateFn="function"==typeof setImmediate&&function(j){setImmediate(j)}||function(j){re(j,0)},Promise._unhandledRejectionFn=function _unhandledRejectionFn(j){void 0!==ne&&ne&&ne.warn("Possible Unhandled Promise Rejection:",j)};const oe=Promise;var ie={};le?ie=window:"undefined"!=typeof self&&(ie=self);var ae="Promise"in ie?ie.Promise:oe,se=[].slice,le="undefined"!=typeof window,ce=le&&"undefined"!=typeof performance?performance:{};for(var ue=[],de=0;de<256;++de)ue[de]=(de+256).toString(16).substr(1);var pe=new Uint8Array(16);function generateRandomId(j){return function bytesToHex(j){for(var K=[],$=0;$<j.length;$++)K.push(ue[j[$]]);return K.join("")}(function rng(){return"undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues?crypto.getRandomValues(pe):"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues?msCrypto.getRandomValues(pe):pe}()).substr(0,j)}function setRequestHeader(j,K,$){"function"==typeof j.setRequestHeader?j.setRequestHeader(K,$):j.headers&&"function"==typeof j.headers.append?j.headers.append(K,$):j[K]=$}function checkSameOrigin(j,K){var $=!1;return"string"==typeof K?$=j===K:K&&"function"==typeof K.test?$=K.test(j):Array.isArray(K)&&K.forEach((function(K){$||($=checkSameOrigin(j,K))})),$}function isPlatformSupported(){return le&&"function"==typeof Set&&"function"==typeof JSON.stringify&&ce&&"function"==typeof ce.now&&function isCORSSupported(){return"withCredentials"in new window.XMLHttpRequest}()}function setLabel(j,K,$){if($&&j){var ee=removeInvalidChars(j),te=typeof K;return null!=K&&"boolean"!==te&&"number"!==te&&(K=String(K)),$[ee]=K,$}}function stripQueryStringFromUrl(j){return j&&j.split("?")[0]}function isObject(j){return null!==j&&"object"==typeof j}function baseExtend(j,K,$){for(var ee=0,te=K.length;ee<te;++ee){var ne=K[ee];if(isObject(ne)||"function"==typeof ne)for(var re=Object.keys(ne),oe=0,ie=re.length;oe<ie;oe++){var ae=re[oe],se=ne[ae];$&&isObject(se)?(isObject(j[ae])||(j[ae]=Array.isArray(se)?[]:{}),baseExtend(j[ae],[se],!1)):j[ae]=se}}return j}function getCurrentScript(){if("undefined"!=typeof document){var j=document.currentScript;return j||function getElasticScript(){if("undefined"!=typeof document)for(var j=document.getElementsByTagName("script"),K=0,$=j.length;K<$;K++){var ee=j[K];if(ee.src.indexOf("elastic")>0)return ee}}()}}function extend(){return baseExtend(Object.create(null),se.call(arguments),!1)}function merge(){return baseExtend(Object.create(null),se.call(arguments),!0)}function isUndefined(j){return void 0===j}function utils_noop(){}function removeInvalidChars(j){return j.replace(/[.*"]/g,"_")}function getLatestSpan(j,K){for(var $=null,ee=0;ee<j.length;ee++){var te=j[ee];K&&K(te.type)&&(!$||$._end<te._end)&&($=te)}return $}function now(){return ce.now()}function getTime(j){return"number"==typeof j&&j>=0?j:now()}function getDuration(j,K){return isUndefined(K)||isUndefined(j)?null:parseInt(K-j)}function scheduleMicroTask(j){ae.resolve().then(j)}function isPerfTimelineSupported(){return"function"==typeof ce.getEntriesByType}function isPerfTypeSupported(j){return"undefined"!=typeof PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.indexOf(j)>=0}function isPerfInteractionCountSupported(){return"interactionCount"in performance}function isRedirectInfoAvailable(j){return j.redirectStart>0}var ge=[["#","hash"],["?","query"],["/","path"],["@","auth",1],[NaN,"host",void 0,1]],he=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,me=function(){function Url(j){var K,$=this.extractProtocol(j||""),ee=$.protocol,te=$.address,ne=$.slashes,re=!ee&&!ne,oe=this.getLocation(),ie=ge.slice();te=te.replace("\\","/"),ne||(ie[2]=[NaN,"path"]);for(var ae=0;ae<ie.length;ae++){var se=ie[ae],le=se[0],ce=se[1];if("string"==typeof le){if(~(K=te.indexOf(le))){var ue=se[2];if(ue){var de=te.lastIndexOf(le);K=Math.max(K,de),this[ce]=te.slice(0,K),te=te.slice(K+ue)}else this[ce]=te.slice(K),te=te.slice(0,K)}}else this[ce]=te,te="";this[ce]=this[ce]||re&&se[3]&&oe[ce]||"",se[3]&&(this[ce]=this[ce].toLowerCase())}if(re&&"/"!==this.path.charAt(0)&&(this.path="/"+this.path),this.relative=re,this.protocol=ee||oe.protocol,this.hostname=this.host,this.port="",/:\d+$/.test(this.host)){var pe=this.host.split(":"),he=pe.pop(),me=pe.join(":");!function isDefaultPort(j,K){switch(K){case"http:":return"80"===j;case"https:":return"443"===j}return!0}(he,this.protocol)?this.port=he:this.host=me,this.hostname=me}this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null",this.href=this.toString()}var j=Url.prototype;return j.toString=function toString(){var j=this.protocol;if(j+="//",this.auth){var K="[REDACTED]",$=this.auth.split(":");j+=($[0]?K:"")+($[1]?":"+K:"")+"@"}return j+=this.host,j+=this.path,j+=this.query,j+=this.hash},j.getLocation=function getLocation(){var j={};return le&&(j=window),j.location},j.extractProtocol=function extractProtocol(j){var K=he.exec(j);return{protocol:K[1]?K[1].toLowerCase():"",slashes:!!K[2],address:K[3]}},Url}();var fe=$(9094),ye=["tags"];function getResponseContext(j){var K={transfer_size:j.transferSize,encoded_body_size:j.encodedBodySize,decoded_body_size:j.decodedBodySize},$=function getServerTimingInfo(j){void 0===j&&(j=[]);for(var K=[],$=0;$<j.length;$++){var ee=j[$],te=ee.name,ne=ee.duration,re=ee.description,oe=te;re&&(oe+=";desc="+re),ne&&(oe+=";dur="+ne),K.push(oe)}return K.join(", ")}(j.serverTiming);return $&&(K.headers={"server-timing":$}),K}function getDestination(j){var K=j.port,$=j.protocol,ee=j.hostname,te=function getPortNumber(j,K){return""===j&&(j="http:"===K?"80":"https:"===K?"443":""),j}(K,$),ne=91===ee.charCodeAt(0)&&93===ee.charCodeAt(ee.length-1),re=ee;return ne&&(re=ee.slice(1,-1)),{service:{resource:ee+":"+te,name:"",type:""},address:re,port:Number(te)}}function getPageContext(){return{page:{referer:document.referrer,url:location.href}}}function addSpanContext(j,K){if(K){var $;switch(j.type){case"external":$=function getExternalContext(j){var K,$=j.url,ee=j.method,te=j.target,ne=j.response,re=new me($),oe=getDestination(re),ie={http:{method:ee,url:re.href},destination:oe};return te&&void 0!==te.status?K=te.status:ne&&(K=ne.status),ie.http.status_code=K,ie}(K);break;case"resource":$=function getResourceContext(j){var K=j.entry,$=j.url,ee=getDestination(new me($));return{http:{url:$,response:getResponseContext(K)},destination:ee}}(K);break;case"hard-navigation":$=function getNavigationContext(j){var K=j.url;return{destination:getDestination(new me(K))}}(K)}j.addContext($)}}function addTransactionContext(j,K){var $=void 0===K?{}:K,ee=($.tags,function _objectWithoutPropertiesLoose(j,K){if(null==j)return{};var $,ee,te={},ne=Object.keys(j);for(ee=0;ee<ne.length;ee++)$=ne[ee],K.indexOf($)>=0||(te[$]=j[$]);return te}($,ye)),te=getPageContext(),ne={};if(j.type===fe.Xu)j.ensureContext(),j.context.page&&j.context.page.url&&(te.page.url=j.context.page.url);else if(j.type===fe.oZ&&isPerfTimelineSupported()){var re=ce.getEntriesByType(fe.k2);re&&re.length>0&&(ne={response:getResponseContext(re[0])})}j.addContext(te,ne,ee)}var be={service:{name:[fe.e$,!0],version:!0,agent:{version:[fe.e$,!0]},environment:!0},labels:{"*":!0}},ve={"*":!0,headers:{"*":!0}},Me={user:{id:!0,email:!0,username:!0},tags:{"*":!0},http:{response:ve},destination:{address:[fe.e$],service:{"*":[fe.e$,!0]}},response:ve},Ee={name:[fe.e$,!0],type:[fe.e$,!0],id:[fe.e$,!0],trace_id:[fe.e$,!0],parent_id:[fe.e$,!0],transaction_id:[fe.e$,!0],subtype:!0,action:!0,context:Me},Se={name:!0,parent_id:!0,type:[fe.e$,!0],id:[fe.e$,!0],trace_id:[fe.e$,!0],span_count:{started:[fe.e$,!0]},context:Me},Ce={id:[fe.e$,!0],trace_id:!0,transaction_id:!0,parent_id:!0,culprit:!0,exception:{type:!0},transaction:{type:!0},context:Me};function isEmpty(j){return null==j||""===j||void 0===j}function replaceValue(j,K,$){var ee=function truncate(j,K,$,ee){return void 0===K&&(K=fe.e$),void 0===$&&($=!1),void 0===ee&&(ee="N/A"),$&&isEmpty(j)&&(j=ee),"string"==typeof j?j.substring(0,K):j}(j[K],$[0],$[1]);isEmpty(ee)?delete j[K]:j[K]=ee}function truncateModel(j,K,$){void 0===j&&(j={}),void 0===$&&($=K);for(var ee=Object.keys(j),te=[],ne=function _loop(ne){var re=ee[ne],oe=!0===j[re]?te:j[re];Array.isArray(oe)?"*"===re?Object.keys($).forEach((function(j){return replaceValue($,j,oe)})):replaceValue($,re,oe):truncateModel(oe,K,$[re])},re=0;re<ee.length;re++)ne(re);return K}var _e=$(5951),Te=$.n(_e),Ae=["tags"];var Ie=["stack","message"],Ne="Unhandled promise rejection: ";var Oe=function(){function ErrorLogging(j,K,$){this._apmServer=j,this._configService=K,this._transactionService=$}var j=ErrorLogging.prototype;return j.createErrorDataModel=function createErrorDataModel(j,K){var $=function filterInvalidFrames(j){return j.filter((function(j){var K=j.filename,$=j.lineno;return void 0!==K&&void 0!==$}))}(createStackTraces(Te(),j)),ee="(inline script)",te=$[$.length-1];te&&te.filename&&(ee=te.filename);var ne=j.message,re=j.error,oe=ne,ie="",ae={};if(re&&"object"==typeof re){oe=oe||re.message,ie=re.name;var se=function getErrorProperties(j){var K=!1,$={};if(Object.keys(j).forEach((function(ee){if(!(Ie.indexOf(ee)>=0)){var te=j[ee];if(null!=te&&"function"!=typeof te){if("object"==typeof te){if("function"!=typeof te.toISOString)return;te=te.toISOString()}$[ee]=te,K=!0}}})),K)return $}(re);se&&(ae.custom=se)}if(K&&K.labels){var le=Object.keys(K.labels);ae.tags={},le.forEach((function(j){return setLabel(j,K.labels[j],ae.tags)}))}ie||oe&&oe.indexOf(":")>-1&&(ie=oe.split(":")[0]);var ce=this._transactionService.getCurrentTransaction(),ue=ce?ce.context:{},de=this._configService.get("context"),pe=(de.tags,function error_logging_objectWithoutPropertiesLoose(j,K){if(null==j)return{};var $,ee,te={},ne=Object.keys(j);for(ee=0;ee<ne.length;ee++)$=ne[ee],K.indexOf($)>=0||(te[$]=j[$]);return te}(de,Ae)),ge=merge({},getPageContext(),ue,pe,ae),he={id:generateRandomId(),culprit:ee,exception:{message:oe,stacktrace:$,type:ie},context:ge};return ce&&(he=extend(he,{trace_id:ce.traceId,parent_id:ce.id,transaction_id:ce.id,transaction:{type:ce.type,sampled:ce.sampled}})),truncateModel(Ce,he)},j.logErrorEvent=function logErrorEvent(j,K){if(void 0!==j){var $=this.createErrorDataModel(j,K);void 0!==$.exception.message&&this._apmServer.addError($)}},j.registerListeners=function registerListeners(){var j=this;window.addEventListener("error",(function(K){return j.logErrorEvent(K)})),window.addEventListener("unhandledrejection",(function(K){return j.logPromiseEvent(K)}))},j.logPromiseEvent=function logPromiseEvent(j){var K,$=j.reason;if(null==$&&($="<no reason specified>"),"string"==typeof $.message){var ee=$.name?$.name+": ":"";K={error:$,message:Ne+ee+$.message}}else K=this._parseRejectReason($);this.logErrorEvent(K)},j.logError=function logError(j,K){var $={};return"string"==typeof j?$.message=j:$.error=j,this.logErrorEvent($,K)},j._parseRejectReason=function _parseRejectReason(j){var K={message:Ne};if(Array.isArray(j))K.message+="<object>";else if("object"==typeof j)try{K.message+=JSON.stringify(j),K.error=j}catch(j){K.message+="<object>"}else K.message+="function"==typeof j?"<function>":j;return K},ErrorLogging}();const we=Oe;const De=function(){function Queue(j,K){void 0===K&&(K={}),this.onFlush=j,this.items=[],this.queueLimit=K.queueLimit||-1,this.flushInterval=K.flushInterval||0,this.timeoutId=void 0}var j=Queue.prototype;return j._setTimer=function _setTimer(){var j=this;this.timeoutId=setTimeout((function(){return j.flush()}),this.flushInterval)},j._clear=function _clear(){void 0!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.items=[]},j.flush=function flush(){this.onFlush(this.items),this._clear()},j.add=function add(j){this.items.push(j),-1!==this.queueLimit&&this.items.length>=this.queueLimit?this.flush():void 0===this.timeoutId&&this._setTimer()},Queue}();const xe=function(){function NDJSON(){}return NDJSON.stringify=function stringify(j){return JSON.stringify(j)+"\n"},NDJSON}();var je=["fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"],Le=["fs","ls","le","cs","ce","qs","rs","re","dl","di","ds","de","dc","es","ee"];function getPageLoadMarks(j){var K=function getNavigationTimingMarks(j){var K=j.redirectStart,$=j.fetchStart,ee=j.navigationStart,te=j.responseStart,ne=j.responseEnd;if($>=ee&&te>=$&&ne>=te){var re={};return je.forEach((function(ee){var te=j[ee];te&&te>=$&&(isRedirectInfoAvailable(j)?re[ee]=parseInt(te-K):re[ee]=parseInt(te-$))})),re}return null}(j);return null==K?null:{navigationTiming:K,agent:{timeToFirstByte:K.responseStart,domInteractive:K.domInteractive,domComplete:K.domComplete}}}function compressResponse(j){return{ts:j.transfer_size,ebs:j.encoded_body_size,dbs:j.decoded_body_size}}function compressContext(j){if(!j)return null;var K={},$=j.page,ee=j.http,te=j.response,ne=j.destination,re=j.user,oe=j.custom;if($&&(K.p={rf:$.referer,url:$.url}),ee&&(K.h=function compressHTTP(j){var K={},$=j.method,ee=j.status_code,te=j.url,ne=j.response;return K.url=te,$&&(K.mt=$),ee&&(K.sc=ee),ne&&(K.r=compressResponse(ne)),K}(ee)),te&&(K.r=compressResponse(te)),ne){var ie=ne.service;K.dt={se:{n:ie.name,t:ie.type,rc:ie.resource},ad:ne.address,po:ne.port}}return re&&(K.u={id:re.id,un:re.username,em:re.email}),oe&&(K.cu=oe),K}function compressMarks(j){if(!j)return null;var K=function compressNavigationTimingMarks(j){if(!j)return null;var K={};return Le.forEach((function($,ee){var te=je[ee];K[$]=j[te]})),K}(j.navigationTiming);return{nt:K,a:compressAgentMarks(K,j.agent)}}function compressAgentMarks(j,K){var $={};if(j&&($={fb:j.rs,di:j.di,dc:j.dc}),K){var ee=K.firstContentfulPaint,te=K.largestContentfulPaint;ee&&($.fp=ee),te&&($.lp=te)}return 0===Object.keys($).length?null:$}function compressPayload(j,K){void 0===K&&(K="gzip");var $="function"==typeof CompressionStream;return new ae((function(ee){if(!$)return ee(j);if(function isBeaconInspectionEnabled(){var j="_elastic_inspect_beacon_";if(null!=sessionStorage.getItem(j))return!0;if(!window.URL||!window.URLSearchParams)return!1;try{var K=new URL(window.location.href).searchParams.has(j);return K&&sessionStorage.setItem(j,!0),K}catch(j){}return!1}())return ee(j);var te=j.payload,ne=j.headers,re=j.beforeSend,oe=new Blob([te]).stream().pipeThrough(new CompressionStream(K));return new Response(oe).blob().then((function(j){return ne["Content-Encoding"]=K,ee({payload:j,headers:ne,beforeSend:re})}))}))}var ke=!1,Pe={bootstrapTime:null,lastHiddenStart:Number.MIN_SAFE_INTEGER};function isResponseSuccessful(j){return!(0===j||j>399&&j<600)}function _extends(){return _extends=Object.assign||function(j){for(var K=1;K<arguments.length;K++){var $=arguments[K];for(var ee in $)Object.prototype.hasOwnProperty.call($,ee)&&(j[ee]=$[ee])}return j},_extends.apply(this,arguments)}function shouldUseFetchWithKeepAlive(j,K){if(!isFetchSupported())return!1;if(!("keepalive"in new Request("")))return!1;var $=function calculateSize(j){if(!j)return 0;if(j instanceof Blob)return j.size;return new Blob([j]).size}(K);return"POST"===j&&$<6e4}function isFetchSupported(){return"function"==typeof window.fetch&&"function"==typeof window.Request}var Re={fetchInProgress:!1};function apmSymbol(j){return"__apm_symbol__"+j}function patchMethod(j,K,$){for(var ee=j;ee&&!ee.hasOwnProperty(K);)ee=Object.getPrototypeOf(ee);!ee&&j[K]&&(ee=j);var te,ne=apmSymbol(K);if(ee&&!(te=ee[ne])&&(te=ee[ne]=ee[K],function isPropertyWritable(j){return!j||!1!==j.writable&&!("function"==typeof j.get&&void 0===j.set)}(ee&&Object.getOwnPropertyDescriptor(ee,K)))){var re=$(te,ne,K);ee[K]=function(){return re(this,arguments)},function attachOriginToPatched(j,K){j[apmSymbol("OriginalDelegate")]=K}(ee[K],te)}return te}var ze=apmSymbol("xhrIgnore"),Ue=apmSymbol("xhrSync"),Ge=apmSymbol("xhrURL"),Be=apmSymbol("xhrMethod");function sendXHR(j,K,$){var ee=$.timeout,te=void 0===ee?HTTP_REQUEST_TIMEOUT:ee,ne=$.payload,re=$.headers,oe=$.beforeSend,ie=$.sendCredentials;return new ae((function($,ee){var ae=new window.XMLHttpRequest;if(ae[ze]=!0,ae.open(j,K,!0),ae.timeout=te,ae.withCredentials=ie,re)for(var se in re)re.hasOwnProperty(se)&&ae.setRequestHeader(se,re[se]);ae.onreadystatechange=function(){if(4===ae.readyState){var j=ae.status,te=ae.responseText;isResponseSuccessful(j)?$(ae):ee({url:K,status:j,responseText:te})}},ae.onerror=function(){var j=ae.status,$=ae.responseText;ee({url:K,status:j,responseText:$})};var le=!0;"function"==typeof oe&&(le=oe({url:K,method:j,headers:re,payload:ne,xhr:ae})),le?ae.send(ne):ee({url:K,status:0,responseText:"Request rejected by user configuration."})}))}var Ze=function(){function ApmServer(j,K){this._configService=j,this._loggingService=K,this.queue=void 0,this.throttleEvents=utils_noop}var j=ApmServer.prototype;return j.init=function init(){var j=this,K=this._configService.get("queueLimit"),$=this._configService.get("flushInterval"),ee=this._configService.get("eventsLimit");this.queue=new De((function onFlush(K){var $=j.sendEvents(K);$&&$.catch((function(K){j._loggingService.warn("Failed sending events!",j._constructError(K))}))}),{queueLimit:K,flushInterval:$}),this.throttleEvents=function throttle(j,K,$){var ee,te=this,ne=$.limit,re=$.interval,oe=0;return function(){return oe++,void 0===ee&&(ee=setTimeout((function(){oe=0,ee=void 0}),re)),oe>ne&&"function"==typeof K?K.apply(te,arguments):j.apply(te,arguments)}}(this.queue.add.bind(this.queue),(function(){return j._loggingService.warn("Dropped events due to throttling!")}),{limit:ee,interval:6e4}),this._configService.observeEvent(fe.p4,(function(){j.queue.flush()}))},j._postJson=function _postJson(j,K){var $=this,ee={payload:K,headers:{"Content-Type":"application/x-ndjson"},beforeSend:this._configService.get("apmRequest")};return compressPayload(ee).catch((function(j){return ee})).then((function(K){return $._makeHttpRequest("POST",j,K)})).then((function(j){return j.responseText}))},j._constructError=function _constructError(j){var K=j.url,$=j.status;j.responseText;if(void 0===$)return j;var ee=K+" HTTP status: "+$;return new Error(ee)},j._makeHttpRequest=function _makeHttpRequest(j,K,$){var ee=void 0===$?{}:$,te=ee.timeout,ne=void 0===te?fe.s6:te,re=ee.payload,oe=ee.headers,ie=ee.beforeSend,ae=this._configService.get("sendCredentials");return!ie&&shouldUseFetchWithKeepAlive(j,re)?function sendFetchRequest(j,K,$){var ee,te=$.keepalive,ne=void 0!==te&&te,re=$.timeout,oe=void 0===re?fe.s6:re,ie=$.payload,ae=$.headers,se=$.sendCredentials,le={};if("function"==typeof AbortController){var ce=new AbortController;le.signal=ce.signal,setTimeout((function(){return ce.abort()}),oe)}return window.fetch(K,_extends({body:ie,headers:ae,method:j,keepalive:ne,credentials:se?"include":"omit"},le)).then((function(j){return(ee=j).text()})).then((function(j){var $={url:K,status:ee.status,responseText:j};if(!isResponseSuccessful(ee.status))throw $;return $}))}(j,K,{keepalive:!0,timeout:ne,payload:re,headers:oe,sendCredentials:ae}).catch((function($){if($ instanceof TypeError)return sendXHR(j,K,{timeout:ne,payload:re,headers:oe,beforeSend:ie,sendCredentials:ae});throw $})):sendXHR(j,K,{timeout:ne,payload:re,headers:oe,beforeSend:ie,sendCredentials:ae})},j.fetchConfig=function fetchConfig(j,K){var $=this,ee=this.getEndpoints().configEndpoint;if(!j)return ae.reject("serviceName is required for fetching central config.");ee+="?service.name="+j,K&&(ee+="&service.environment="+K);var te=this._configService.getLocalConfig();te&&(ee+="&ifnonematch="+te.etag);var ne=this._configService.get("apmRequest");return this._makeHttpRequest("GET",ee,{timeout:5e3,beforeSend:ne}).then((function(j){var K=j.status,ee=j.responseText;if(304===K)return te;var ne=JSON.parse(ee),re=j.getResponseHeader("etag");return re&&(ne.etag=re.replace(/["]/g,""),$._configService.setLocalConfig(ne,!0)),ne})).catch((function(j){var K=$._constructError(j);return ae.reject(K)}))},j.createMetaData=function createMetaData(){var j=this._configService,K={service:{name:j.get("serviceName"),version:j.get("serviceVersion"),agent:{name:"rum-js",version:j.version},language:{name:"javascript"},environment:j.get("environment")},labels:j.get("context.tags")};return truncateModel(be,K)},j.addError=function addError(j){var K;this.throttleEvents(((K={})[fe.Sg]=j,K))},j.addTransaction=function addTransaction(j){var K;this.throttleEvents(((K={})[fe.wO]=j,K))},j.ndjsonErrors=function ndjsonErrors(j,K){var $=K?"e":"error";return j.map((function(j){var ee;return xe.stringify(((ee={})[$]=K?function compressError(j){var K,$=j.exception,ee={id:j.id,cl:j.culprit,ex:{mg:$.message,st:(K=$.stacktrace,K.map((function(j){return{ap:j.abs_path,f:j.filename,fn:j.function,li:j.lineno,co:j.colno}}))),t:j.type},c:compressContext(j.context)},te=j.transaction;return te&&(ee.tid=j.trace_id,ee.pid=j.parent_id,ee.xid=j.transaction_id,ee.x={t:te.type,sm:te.sampled}),ee}(j):j,ee))}))},j.ndjsonMetricsets=function ndjsonMetricsets(j){return j.map((function(j){return xe.stringify({metricset:j})})).join("")},j.ndjsonTransactions=function ndjsonTransactions(j,K){var $=this,ee=K?"x":"transaction";return j.map((function(j){var te,ne="",re="";return K||(j.spans&&(ne=j.spans.map((function(j){return xe.stringify({span:j})})).join(""),delete j.spans),j.breakdown&&(re=$.ndjsonMetricsets(j.breakdown),delete j.breakdown)),xe.stringify(((te={})[ee]=K?function compressTransaction(j){var K,$=j.spans.map((function(K){var $={id:K.id,n:K.name,t:K.type,s:K.start,d:K.duration,c:compressContext(K.context),o:K.outcome,sr:K.sample_rate};return K.parent_id!==j.id&&($.pid=K.parent_id),!0===K.sync&&($.sy=!0),K.subtype&&($.su=K.subtype),K.action&&($.ac=K.action),$})),ee={id:j.id,pid:j.parent_id,tid:j.trace_id,n:j.name,t:j.type,d:j.duration,c:compressContext(j.context),k:compressMarks(j.marks),me:(K=j.breakdown,K.map((function(j){var K=j.span,$=j.samples;return{y:{t:K.type},sa:{ysc:{v:$["span.self_time.count"].value},yss:{v:$["span.self_time.sum.us"].value}}}}))),y:$,yc:{sd:$.length},sm:j.sampled,sr:j.sample_rate,o:j.outcome};if(j.experience){var te=j.experience,ne=te.cls,re=te.fid,oe=te.tbt,ie=te.longtask;ee.exp={cls:ne,fid:re,tbt:oe,lt:ie}}if(j.session){var ae=j.session,se=ae.id,le=ae.sequence;ee.ses={id:se,seq:le}}return ee}(j):j,te))+ne+re}))},j.sendEvents=function sendEvents(j){var K,$;if(0!==j.length){for(var ee=[],te=[],ne=0;ne<j.length;ne++){var re=j[ne];re[fe.wO]&&ee.push(re[fe.wO]),re[fe.Sg]&&te.push(re[fe.Sg])}if(0!==ee.length||0!==te.length){var oe=this._configService,ie=((K={})[fe.wO]=ee,K[fe.Sg]=te,K),ae=oe.applyFilters(ie);if(ae){var se=oe.get("apiVersion")>2,le=[],ce=this.createMetaData(),ue=se?"m":"metadata";le.push(xe.stringify((($={})[ue]=se?function compressMetadata(j){var K=j.service,$=j.labels,ee=K.agent,te=K.language;return{se:{n:K.name,ve:K.version,a:{n:ee.name,ve:ee.version},la:{n:te.name},en:K.environment},l:$}}(ce):ce,$)));var de=(le=le.concat(this.ndjsonErrors(ae[fe.Sg],se),this.ndjsonTransactions(ae[fe.wO],se))).join(""),pe=this.getEndpoints().intakeEndpoint;return this._postJson(pe,de)}this._loggingService.warn("Dropped payload due to filtering!")}}},j.getEndpoints=function getEndpoints(){var j=this._configService.get("serverUrl"),K=this._configService.get("apiVersion");return{intakeEndpoint:j+(this._configService.get("serverUrlPrefix")||"/intake/v"+K+"/rum/events"),configEndpoint:j+"/config/v1/rum/agents"}},ApmServer}();const Ye=Ze;var He=$(5108);const We=function(){function EventHandler(){this.observers={}}var j=EventHandler.prototype;return j.observe=function observe(j,K){var $=this;if("function"==typeof K)return this.observers[j]||(this.observers[j]=[]),this.observers[j].push(K),function(){var ee=$.observers[j].indexOf(K);ee>-1&&$.observers[j].splice(ee,1)}},j.sendOnly=function sendOnly(j,K){var $=this.observers[j];$&&$.forEach((function(j){try{j.apply(void 0,K)}catch(j){He.log(j,j.stack)}}))},j.send=function send(j,K){this.sendOnly(j+fe.Wt,K),this.sendOnly(j,K),this.sendOnly(j+fe.nv,K)},EventHandler}();function config_service_extends(){return config_service_extends=Object.assign||function(j){for(var K=1;K<arguments.length;K++){var $=arguments[K];for(var ee in $)Object.prototype.hasOwnProperty.call($,ee)&&(j[ee]=$[ee])}return j},config_service_extends.apply(this,arguments)}var Ve=function(){function Config(){this.config={serviceName:"",serviceVersion:"",environment:"",serverUrl:"http://localhost:8200",serverUrlPrefix:"",active:!0,instrument:!0,disableInstrumentations:[],logLevel:"warn",breakdownMetrics:!1,ignoreTransactions:[],eventsLimit:80,queueLimit:-1,flushInterval:500,distributedTracing:!0,distributedTracingOrigins:[],distributedTracingHeaderName:"traceparent",pageLoadTraceId:"",pageLoadSpanId:"",pageLoadSampled:!1,pageLoadParentId:"",pageLoadTransactionName:"",propagateTracestate:!1,transactionSampleRate:1,centralConfig:!1,monitorLongtasks:!0,apiVersion:2,context:{},session:!1,apmRequest:null,sendCredentials:!1},this.events=new We,this.filters=[],this.version=""}var j=Config.prototype;return j.init=function init(){var j=function getConfigFromScript(){var j=function getDataAttributesFromNode(j){if(!j)return{};for(var K={},$=/^data-([\w-]+)$/,ee=j.attributes,te=0;te<ee.length;te++){var ne=ee[te];$.test(ne.nodeName)&&(K[ne.nodeName.match($)[1].split("-").map((function(j,K){return K>0?j.charAt(0).toUpperCase()+j.substring(1):j})).join("")]=ne.value||ne.nodeValue)}return K}(getCurrentScript());return j}();this.setConfig(j)},j.setVersion=function setVersion(j){this.version=j},j.addFilter=function addFilter(j){if("function"!=typeof j)throw new Error("Argument to must be function");this.filters.push(j)},j.applyFilters=function applyFilters(j){for(var K=0;K<this.filters.length;K++)if(!(j=this.filters[K](j)))return;return j},j.get=function get(j){return j.split(".").reduce((function(j,K){return j&&j[K]}),this.config)},j.setUserContext=function setUserContext(j){void 0===j&&(j={});var K={},$=j,ee=$.id,te=$.username,ne=$.email;"number"!=typeof ee&&"string"!=typeof ee||(K.id=ee),"string"==typeof te&&(K.username=te),"string"==typeof ne&&(K.email=ne),this.config.context.user=extend(this.config.context.user||{},K)},j.setCustomContext=function setCustomContext(j){void 0===j&&(j={}),this.config.context.custom=extend(this.config.context.custom||{},j)},j.addLabels=function addLabels(j){var K=this;this.config.context.tags||(this.config.context.tags={}),Object.keys(j).forEach((function($){return setLabel($,j[$],K.config.context.tags)}))},j.setConfig=function setConfig(j){void 0===j&&(j={});var K=j,$=K.transactionSampleRate,ee=K.serverUrl;ee&&(j.serverUrl=ee.replace(/\/+$/,"")),isUndefined($)||($<1e-4&&$>0&&($=1e-4),j.transactionSampleRate=Math.round(1e4*$)/1e4),this.config=merge(this.config,j),this.events.send(fe._H,[this.config])},j.validate=function validate(j){void 0===j&&(j={});var K=["serviceName","serverUrl"],$=Object.keys(this.config),ee={missing:[],invalid:[],unknown:[]};Object.keys(j).forEach((function(te){-1===K.indexOf(te)||j[te]||ee.missing.push(te),-1===$.indexOf(te)&&ee.unknown.push(te)})),j.serviceName&&!/^[a-zA-Z0-9 _-]+$/.test(j.serviceName)&&ee.invalid.push({key:"serviceName",value:j.serviceName,allowed:"a-z, A-Z, 0-9, _, -, <space>"});var te=j.transactionSampleRate;return void 0!==te&&("number"!=typeof te||isNaN(te)||te<0||te>1)&&ee.invalid.push({key:"transactionSampleRate",value:te,allowed:"Number between 0 and 1"}),ee},j.getLocalConfig=function getLocalConfig(){var j=sessionStorage;this.config.session&&(j=localStorage);var K=j.getItem(fe.m$);if(K)return JSON.parse(K)},j.setLocalConfig=function setLocalConfig(j,K){if(j){if(K)j=config_service_extends({},this.getLocalConfig(),j);var $=sessionStorage;this.config.session&&($=localStorage),$.setItem(fe.m$,JSON.stringify(j))}},j.dispatchEvent=function dispatchEvent(j,K){this.events.send(j,K)},j.observeEvent=function observeEvent(j,K){return this.events.observe(j,K)},Config}();const Fe=Ve;var Qe=$(5108);const Ke=function(){function LoggingService(j){void 0===j&&(j={}),this.levels=["trace","debug","info","warn","error"],this.level=j.level||"warn",this.prefix=j.prefix||"",this.resetLogMethods()}var j=LoggingService.prototype;return j.shouldLog=function shouldLog(j){return this.levels.indexOf(j)>=this.levels.indexOf(this.level)},j.setLevel=function setLevel(j){j!==this.level&&(this.level=j,this.resetLogMethods())},j.resetLogMethods=function resetLogMethods(){var j=this;this.levels.forEach((function(K){j[K]=j.shouldLog(K)?function log(){var j=K;"trace"!==K&&"debug"!==K||(j="info");var $=arguments;if($[0]=this.prefix+$[0],Qe){var ee=Qe[j]||Qe.log;"function"==typeof ee&&ee.apply(Qe,$)}}:utils_noop}))},LoggingService}();$(5108);var Je,Xe=((Je={})[fe.IE]=function(){return new Fe},Je[fe.XZ]=function(){return new Ke({prefix:"[Elastic APM] "})},Je[fe.Q]=function(j){var K=j.getService([fe.IE,fe.XZ]),$=K[0],ee=K[1];return new Ye($,ee)},Je),qe=function(){function ServiceFactory(){this.instances={},this.initialized=!1}var j=ServiceFactory.prototype;return j.init=function init(){if(!this.initialized){this.initialized=!0;var j=this.getService(fe.IE);j.init();var K=this.getService([fe.XZ,fe.Q]),$=K[0],ee=K[1];j.events.observe(fe._H,(function(){var K=j.get("logLevel");$.setLevel(K)})),ee.init()}},j.getService=function getService(j){var K=this;return"string"==typeof j?(this.instances[j]||"function"==typeof Xe[j]&&(this.instances[j]=Xe[j](this)),this.instances[j]):Array.isArray(j)?j.map((function(j){return K.getService(j)})):void 0},ServiceFactory}();function patchXMLHttpRequest(j){var K=XMLHttpRequest.prototype;if(K&&K[fe.os])var $="readystatechange",ee="load",te="error",ne=patchMethod(K,"open",(function(){return function(j,K){return j[ze]||(j[Be]=K[0],j[Ge]=K[1],j[Ue]=!1===K[2]),ne.apply(j,K)}})),re=patchMethod(K,"send",(function(){return function(K,ne){if(K[ze])return re.apply(K,ne);var oe={source:fe.Ie,state:"",type:"macroTask",data:{target:K,method:K[Be],sync:K[Ue],url:K[Ge],status:""}};try{return function scheduleTask(K){if(K.state!==fe.$L){K.state=fe.$L,j(fe.$L,K);var ne=K.data.target;addListener($),addListener(ee),addListener("timeout"),addListener(te),addListener("abort")}function addListener(j){ne[fe.os](j,(function(j){var te=j.type;te===$?4===ne.readyState&&0!==ne.status&&invokeTask(K,"success"):invokeTask(K,te===ee?"success":te)}))}}(oe),re.apply(K,ne)}catch(j){throw invokeTask(oe,te),j}}}));function invokeTask(K,$){K.state!==fe.x_&&(K.state=fe.x_,K.data.status=$,j(fe.x_,K))}}var $e=new We,et=!1;function patchAll(){return et||(et=!0,patchXMLHttpRequest((function(j,K){$e.send(fe.Ie,[j,K])})),function patchFetch(j){if(isFetchSupported()){var K=window.fetch;window.fetch=function(j,$){var ee,te,ne=this,re=arguments,oe=j instanceof URL;if("string"==typeof j||oe)ee=new Request(j,$),te=oe?ee.url:j;else{if(!j)return K.apply(ne,re);te=(ee=j).url}var ie={source:fe.jR,state:"",type:"macroTask",data:{target:ee,method:ee.method,url:te,aborted:!1}};return new ae((function(j,$){var te;Re.fetchInProgress=!0,scheduleTask(ie);try{te=K.apply(ne,[ee])}catch(j){return $(j),ie.data.error=j,invokeTask(ie),void(Re.fetchInProgress=!1)}te.then((function(K){var $=K.clone?K.clone():{};j(K),scheduleMicroTask((function(){ie.data.response=K;var j=$.body;j?readStream(j,ie):invokeTask(ie)}))}),(function(j){$(j),scheduleMicroTask((function(){handleResponseError(ie,j)}))})),Re.fetchInProgress=!1}))}}function scheduleTask(K){K.state=fe.$L,j(fe.$L,K)}function invokeTask(K){K.state=fe.x_,j(fe.x_,K)}function handleResponseError(j,K){j.data.aborted=function isAbortError(j){return j&&"AbortError"===j.name}(K),j.data.error=K,invokeTask(j)}function readStream(j,K){var $=j.getReader();!function read(){$.read().then((function(j){j.done?invokeTask(K):read()}),(function(j){handleResponseError(K,j)}))}()}}((function(j,K){$e.send(fe.jR,[j,K])})),function patchHistory(j){if(window.history){var K=history.pushState;"function"==typeof K&&(history.pushState=function($,ee,te){var ne={source:fe.UA,data:{state:$,title:ee,url:te}};j(fe.x_,ne),K.apply(this,arguments)})}}((function(j,K){$e.send(fe.UA,[j,K])}))),$e}var nt=function(){function PerformanceMonitoring(j,K,$,ee){this._apmServer=j,this._configService=K,this._logginService=$,this._transactionService=ee}var j=PerformanceMonitoring.prototype;return j.init=function init(j){var K=this;void 0===j&&(j={}),this._configService.events.observe(fe.x9+fe.nv,(function(j){var $=K.createTransactionPayload(j);$&&(K._apmServer.addTransaction($),K._configService.dispatchEvent(fe.dO))})),j[fe.UA]&&$e.observe(fe.UA,this.getHistorySub()),j[fe.Ie]&&$e.observe(fe.Ie,this.getXHRSub()),j[fe.jR]&&$e.observe(fe.jR,this.getFetchSub())},j.getHistorySub=function getHistorySub(){var j=this._transactionService;return function(K,$){$.source===fe.UA&&K===fe.x_&&j.startTransaction($.data.title,"route-change",{managed:!0,canReuse:!0})}},j.getXHRSub=function getXHRSub(){var j=this;return function(K,$){$.source!==fe.Ie||Re.fetchInProgress||j.processAPICalls(K,$)}},j.getFetchSub=function getFetchSub(){var j=this;return function(K,$){$.source===fe.jR&&j.processAPICalls(K,$)}},j.processAPICalls=function processAPICalls(j,K){var $=this._configService,ee=this._transactionService;if(K.data&&K.data.url){var te=this._apmServer.getEndpoints();if(Object.keys(te).some((function(j){return-1!==K.data.url.indexOf(te[j])})))return}if(j===fe.$L&&K.data){var ne=K.data,re=new me(ne.url),oe=ne.method+" "+(re.relative?re.path:stripQueryStringFromUrl(re.href));ee.getCurrentTransaction()||ee.startTransaction(oe,fe.EC,{managed:!0});var ie=ee.startSpan(oe,"external.http",{blocking:!0});if(!ie)return;var ae=$.get("distributedTracing"),se=$.get("distributedTracingOrigins"),le=new me(window.location.href),ce=checkSameOrigin(re.origin,le.origin)||checkSameOrigin(re.origin,se),ue=ne.target;if(ae&&ce&&ue)this.injectDtHeader(ie,ue),$.get("propagateTracestate")&&this.injectTSHeader(ie,ue);else ke;ne.sync&&(ie.sync=ne.sync),ne.span=ie}else if(j===fe.x_){var de=K.data;if(de&&de.span){var pe,ge,he=de.span,ye=de.response,be=de.target;pe=ye?ye.status:be.status,ge="abort"==de.status||de.aborted?fe.pm:pe>=400||0==pe?fe.O5:fe.Yr,he.outcome=ge;var ve=ee.getCurrentTransaction();ve&&ve.type===fe.EC&&(ve.outcome=ge),ee.endSpan(he,de)}}},j.injectDtHeader=function injectDtHeader(j,K){var $=this._configService.get("distributedTracingHeaderName"),ee=function getDtHeaderValue(j){if(j&&j.traceId&&j.id&&j.parentId){var K=j.sampled?"01":"00",$=j.sampled?j.id:j.parentId;return"00-"+j.traceId+"-"+$+"-"+K}}(j);(function isDtHeaderValid(j){return/^[\da-f]{2}-[\da-f]{32}-[\da-f]{16}-[\da-f]{2}$/.test(j)&&"00000000000000000000000000000000"!==j.slice(3,35)&&"0000000000000000"!==j.slice(36,52)})(ee)&&ee&&$&&setRequestHeader(K,$,ee)},j.injectTSHeader=function injectTSHeader(j,K){var $=function getTSHeaderValue(j){var K=j.sampleRate;if(!("number"!=typeof K||String(K).length>256))return"es=s:"+K}(j);$&&setRequestHeader(K,"tracestate",$)},j.extractDtHeader=function extractDtHeader(j){var K=this._configService.get("distributedTracingHeaderName");if(j)return function parseDtHeaderValue(j){var K=/^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})$/.exec(j);if(K){var $="00"!==K[4];return{traceId:K[2],id:K[3],sampled:$}}}(j[K])},j.filterTransaction=function filterTransaction(j){var K=j.duration();if(!K)return!1;if(j.isManaged()){if(K>6e4)return!1;if(j.sampled&&0===j.spans.length)return!1}return!0},j.createTransactionDataModel=function createTransactionDataModel(j){var K=j._start,$=j.spans.map((function($){var ee={id:$.id,transaction_id:j.id,parent_id:$.parentId||j.id,trace_id:j.traceId,name:$.name,type:$.type,subtype:$.subtype,action:$.action,sync:$.sync,start:parseInt($._start-K),duration:$.duration(),context:$.context,outcome:$.outcome,sample_rate:$.sampleRate};return truncateModel(Ee,ee)})),ee={id:j.id,parent_id:j.parentId,trace_id:j.traceId,session:j.session,name:j.name,type:j.type,duration:j.duration(),spans:$,context:j.context,marks:j.marks,breakdown:j.breakdownTimings,span_count:{started:$.length},sampled:j.sampled,sample_rate:j.sampleRate,experience:j.experience,outcome:j.outcome};return truncateModel(Se,ee)},j.createTransactionPayload=function createTransactionPayload(j){var K=function adjustTransaction(j){if(j.sampled){var K=j.spans.filter((function(K){return K.duration()>0&&K._start>=j._start&&K._end<=j._end}));if(j.isManaged()){var $=function groupSmallContinuouslySimilarSpans(j,K,$){j.sort((function(j,K){return j._start-K._start}));var ee=[],te=1;return j.forEach((function(ne,re){if(0===ee.length)ee.push(ne);else{var oe=ee[ee.length-1],ie=oe.type===ne.type&&oe.subtype===ne.subtype&&oe.action===ne.action&&oe.name===ne.name&&ne.duration()/K<$&&(ne._start-oe._end)/K<$,ae=j.length===re+1;ie&&(te++,oe._end=ne._end),te>1&&(!ie||ae)&&(oe.name=te+"x "+oe.name,te=1),ie||ee.push(ne)}})),ee}(K,j.duration(),.05);j.spans=$}else j.spans=K}else j.resetFields();return j}(j);if(this.filterTransaction(K))return this.createTransactionDataModel(j);this._configService.dispatchEvent(fe.XM)},PerformanceMonitoring}();const rt=function(){function SpanBase(j,K,$){void 0===$&&($={}),j||(j=fe.gv),K||(K=fe.Yo),this.name=j,this.type=K,this.options=$,this.id=$.id||generateRandomId(16),this.traceId=$.traceId,this.sampled=$.sampled,this.sampleRate=$.sampleRate,this.timestamp=$.timestamp,this._start=getTime($.startTime),this._end=void 0,this.ended=!1,this.outcome=void 0,this.onEnd=$.onEnd}var j=SpanBase.prototype;return j.ensureContext=function ensureContext(){this.context||(this.context={})},j.addLabels=function addLabels(j){this.ensureContext();var K=this.context;K.tags||(K.tags={}),Object.keys(j).forEach((function($){return setLabel($,j[$],K.tags)}))},j.addContext=function addContext(){for(var j=arguments.length,K=new Array(j),$=0;$<j;$++)K[$]=arguments[$];0!==K.length&&(this.ensureContext(),this.context=merge.apply(void 0,[this.context].concat(K)))},j.end=function end(j){this.ended||(this.ended=!0,this._end=getTime(j),this.callOnEnd())},j.callOnEnd=function callOnEnd(){"function"==typeof this.onEnd&&this.onEnd(this)},j.duration=function duration(){return getDuration(this._start,this._end)},SpanBase}();function _setPrototypeOf(j,K){return _setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(j,K){return j.__proto__=K,j},_setPrototypeOf(j,K)}const it=function(j){function Span(K,$,ee){var te;if((te=j.call(this,K,$,ee)||this).parentId=te.options.parentId,te.subtype=void 0,te.action=void 0,-1!==te.type.indexOf(".")){var ne=te.type.split(".",3);te.type=ne[0],te.subtype=ne[1],te.action=ne[2]}return te.sync=te.options.sync,te}return function _inheritsLoose(j,K){j.prototype=Object.create(K.prototype),j.prototype.constructor=j,_setPrototypeOf(j,K)}(Span,j),Span.prototype.end=function end(K,$){j.prototype.end.call(this,K),addSpanContext(this,$)},Span}(rt);var at=[["domainLookupStart","domainLookupEnd","DNS"],["connectStart","connectEnd","TCP"],["requestStart","responseStart","Request"],["responseStart","responseEnd","Response"],["domLoading","domComplete","Processing"],["loadEventStart","loadEventEnd","Load"]];function getValue(j){return{value:j}}function getSpanBreakdown(j,K){var $=K.details,ee=K.count,te=void 0===ee?1:ee,ne=K.duration;return{transaction:j,span:$,samples:{"span.self_time.count":getValue(te),"span.self_time.sum.us":getValue(1e3*ne)}}}function breakdown_captureBreakdown(j,K){void 0===K&&(K=ce.timing);var $=[],ee=j.name,te=j.type,ne=j.sampled,re={name:ee,type:te};if(!ne)return $;if(te===fe.oZ&&K)for(var oe=0;oe<at.length;oe++){var ie=at[oe],ae=getDuration(K[ie[0]],K[ie[1]]);0!==ae&&null!=ae&&$.push(getSpanBreakdown(re,{details:{type:ie[2]},duration:ae}))}else{var se=function groupSpans(j){var K={},$=function calculateSelfTime(j){var K=j.spans,$=j._start,ee=j._end;if(0===K.length)return j.duration();K.sort((function(j,K){return j._start-K._start}));for(var te=K[0],ne=te._end,re=te._start,oe=ne,ie=re-$,ae=1;ae<K.length;ae++)re=(te=K[ae])._start,ne=te._end,re>oe?(ie+=re-oe,oe=ne):ne>oe&&(oe=ne);return oe<ee&&(ie+=ee-oe),ie}(j);K.app={count:1,duration:$};for(var ee=j.spans,te=0;te<ee.length;te++){var ne=ee[te],re=ne.duration();if(0!==re&&null!=re){var oe=ne.type,ie=ne.subtype,ae=oe.replace(fe.pS,"");ie&&(ae+="."+ie),K[ae]||(K[ae]={duration:0,count:0}),K[ae].count++,K[ae].duration+=re}}return K}(j);Object.keys(se).forEach((function(j){var K=j.split("."),ee=K[0],te=K[1],ne=se[j],oe=ne.duration,ie=ne.count;$.push(getSpanBreakdown(re,{details:{type:ee,subtype:te},duration:oe,count:ie}))}))}return $}function transaction_setPrototypeOf(j,K){return transaction_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(j,K){return j.__proto__=K,j},transaction_setPrototypeOf(j,K)}const lt=function(j){function Transaction(K,$,ee){var te;return(te=j.call(this,K,$,ee)||this).traceId=generateRandomId(),te.marks=void 0,te.spans=[],te._activeSpans={},te._activeTasks=new Set,te.blocked=!1,te.captureTimings=!1,te.breakdownTimings=[],te.sampleRate=te.options.transactionSampleRate,te.sampled=Math.random()<=te.sampleRate,te}!function transaction_inheritsLoose(j,K){j.prototype=Object.create(K.prototype),j.prototype.constructor=j,transaction_setPrototypeOf(j,K)}(Transaction,j);var K=Transaction.prototype;return K.addMarks=function addMarks(j){this.marks=merge(this.marks||{},j)},K.mark=function mark(j){var K=removeInvalidChars(j),$=now()-this._start,ee={};ee[K]=$,this.addMarks({custom:ee})},K.canReuse=function canReuse(){var j=this.options.reuseThreshold||fe.r9;return!!this.options.canReuse&&!this.ended&&now()-this._start<j},K.redefine=function redefine(j,K,$){j&&(this.name=j),K&&(this.type=K),$&&(this.options.reuseThreshold=$.reuseThreshold,this.options=extend(this.options,$))},K.startSpan=function startSpan(j,K,$){var ee=this;if(!this.ended){var te=extend({},$);te.onEnd=function(j){ee._onSpanEnd(j)},te.traceId=this.traceId,te.sampled=this.sampled,te.sampleRate=this.sampleRate,te.parentId||(te.parentId=this.id);var ne=new it(j,K,te);return this._activeSpans[ne.id]=ne,te.blocking&&this.addTask(ne.id),ne}},K.isFinished=function isFinished(){return!this.blocked&&0===this._activeTasks.size},K.detectFinish=function detectFinish(){this.isFinished()&&this.end()},K.end=function end(j){if(!this.ended){for(var K in this.ended=!0,this._end=getTime(j),this._activeSpans){var $=this._activeSpans[K];$.type=$.type+fe.pS,$.end(j)}this.callOnEnd()}},K.captureBreakdown=function captureBreakdown(){this.breakdownTimings=breakdown_captureBreakdown(this)},K.block=function block(j){this.blocked=j,this.blocked||this.detectFinish()},K.addTask=function addTask(j){return j||(j="task-"+generateRandomId(16)),this._activeTasks.add(j),j},K.removeTask=function removeTask(j){this._activeTasks.delete(j)&&this.detectFinish()},K.resetFields=function resetFields(){this.spans=[],this.sampleRate=0},K._onSpanEnd=function _onSpanEnd(j){this.spans.push(j),delete this._activeSpans[j.id],this.removeTask(j.id)},K.isManaged=function isManaged(){return!!this.options.managed},Transaction}(rt);function metrics_extends(){return metrics_extends=Object.assign||function(j){for(var K=1;K<arguments.length;K++){var $=arguments[K];for(var ee in $)Object.prototype.hasOwnProperty.call($,ee)&&(j[ee]=$[ee])}return j},metrics_extends.apply(this,arguments)}var ct={fid:0,fcp:0,tbt:{start:1/0,duration:0},cls:{score:0,firstEntryTime:Number.NEGATIVE_INFINITY,prevEntryTime:Number.NEGATIVE_INFINITY,currentSessionScore:0},longtask:{count:0,duration:0,max:0}};function captureObserverEntries(j,K){var $=K.isHardNavigation,ee=K.trStart,te=j.getEntriesByType(fe.nw).filter((function(j){return j.startTime>=ee})),ne=function createLongTaskSpans(j,K){for(var $=[],ee=0;ee<j.length;ee++){var te=j[ee],ne=te.name,re=te.startTime,oe=te.duration,ie=te.attribution,ae=re+oe,se=new it("Longtask("+ne+")",fe.nw,{startTime:re});if(K.count++,K.duration+=oe,K.max=Math.max(oe,K.max),ie.length>0){var le=ie[0],ce=le.name,ue=le.containerType,de=le.containerName,pe=le.containerId,ge={attribution:ce,type:ue};de&&(ge.name=de),pe&&(ge.id=pe),se.addContext({custom:ge})}se.end(ae),$.push(se)}return $}(te,ct.longtask),re={spans:ne,marks:{}};if(!$)return re;var oe=j.getEntriesByType(fe.DO),ie=oe[oe.length-1];if(ie){var ae=parseInt(ie.startTime);ct.lcp=ae,re.marks.largestContentfulPaint=ae}var se=ce.timing,le=se.fetchStart-se.navigationStart;isRedirectInfoAvailable(se)&&(le=0);var ue=j.getEntriesByName(fe.Qb)[0];if(ue){var de=parseInt(le>=0?ue.startTime-le:ue.startTime);ct.fcp=de,re.marks.firstContentfulPaint=de}var pe=function createFirstInputDelaySpan(j){var K=j[0];if(K){var $=K.startTime,ee=K.processingStart,te=new it("First Input Delay",fe.Vm,{startTime:$});return te.end(ee),te}}(j.getEntriesByType(fe.Vm));return pe&&(ct.fid=pe.duration(),re.spans.push(pe)),function calculateTotalBlockingTime(j){j.forEach((function(j){var K=j.name,$=j.startTime,ee=j.duration;if(!($<ct.fcp||"self"!==K&&-1===K.indexOf("same-origin"))){ct.tbt.start=Math.min(ct.tbt.start,$);var te=ee-50;te>0&&(ct.tbt.duration+=te)}}))}(te),function calculateCumulativeLayoutShift(j){j.forEach((function(j){!j.hadRecentInput&&j.value&&((j.startTime-ct.cls.firstEntryTime>5e3||j.startTime-ct.cls.prevEntryTime>1e3)&&(ct.cls.firstEntryTime=j.startTime,ct.cls.currentSessionScore=0),ct.cls.prevEntryTime=j.startTime,ct.cls.currentSessionScore+=j.value,ct.cls.score=Math.max(ct.cls.score,ct.cls.currentSessionScore))}))}(j.getEntriesByType(fe.o2)),re}var ut=function(){function PerfEntryRecorder(j){this.po={observe:utils_noop,disconnect:utils_noop},window.PerformanceObserver&&(this.po=new PerformanceObserver(j))}var j=PerfEntryRecorder.prototype;return j.start=function start(j,K){void 0===K&&(K={buffered:!0});try{if(!isPerfTypeSupported(j))return;this.po.observe(metrics_extends({type:j},K))}catch(j){}},j.stop=function stop(){this.po.disconnect()},PerfEntryRecorder}();function shouldCreateSpan(j,K,$,ee,te){return void 0===te&&(te=0),"number"==typeof j&&"number"==typeof K&&j>=te&&K>j&&j-te>=$&&K-te<=ee&&K-j<fe.io&&j-te<fe.io&&K-te<fe.io}var dt=[["redirectStart","redirectEnd","Redirect"],["domainLookupStart","domainLookupEnd","Domain lookup"],["connectStart","connectEnd","Making a connection to the server"],["requestStart","responseEnd","Requesting and receiving the document"],["domLoading","domInteractive","Parsing the document, executing sync. scripts"],["domContentLoadedEventStart","domContentLoadedEventEnd",'Fire "DOMContentLoaded" event'],["loadEventStart","loadEventEnd",'Fire "load" event']];function createResourceTimingSpan(j){var K=j.name,$=j.initiatorType,ee=j.startTime,te=j.responseEnd,ne="resource";$&&(ne+="."+$);var re=stripQueryStringFromUrl(K),oe=new it(re,ne);return oe._start=ee,oe.end(te,{url:K,entry:j}),oe}function isCapturedByPatching(j,K){return null!=K&&j>K}function captureNavigation(j){if(j.captureTimings){var K=j._end;if(j.type===fe.oZ){if(j.marks&&j.marks.custom){var $=j.marks.custom;Object.keys($).forEach((function(K){$[K]+=j._start}))}j._start=0;var ee=ce.timing;(function createNavigationTimingSpans(j,K,$,ee){for(var te=[],ne=0;ne<dt.length;ne++){var re=j[dt[ne][0]],oe=j[dt[ne][1]];if(shouldCreateSpan(re,oe,$,ee,K)){var ie=new it(dt[ne][2],"hard-navigation.browser-timing"),ae=null;"requestStart"===dt[ne][0]&&(ie.pageResponse=!0,ae={url:location.origin}),ie._start=re-K,ie.end(oe-K,ae),te.push(ie)}}return te})(ee,isRedirectInfoAvailable(ee)?ee.redirectStart:ee.fetchStart,0,K).forEach((function(K){K.traceId=j.traceId,K.sampled=j.sampled,K.pageResponse&&j.options.pageLoadSpanId&&(K.id=j.options.pageLoadSpanId),j.spans.push(K)})),j.options.pageLoadParentId&&(j.parentId=j.options.pageLoadParentId),j.addMarks(getPageLoadMarks(ee))}if(isPerfTimelineSupported()){var te=j._start;(function createResourceTimingSpans(j,K,$,ee){for(var te=[],ne=0;ne<j.length;ne++){var re=j[ne],oe=re.initiatorType,ie=re.name,ae=re.startTime,se=re.responseEnd;-1!==fe.jK.indexOf(oe)&&null!=ie&&(("xmlhttprequest"===oe||"fetch"===oe)&&(/intake\/v\d+\/rum\/events/.test(ie)||isCapturedByPatching(ae,K))||shouldCreateSpan(ae,se,$,ee)&&te.push(createResourceTimingSpan(j[ne])))}return te})(ce.getEntriesByType(fe.YI),Pe.bootstrapTime,te,K).forEach((function(K){return j.spans.push(K)})),function createUserTimingSpans(j,K,$){for(var ee=[],te=0;te<j.length;te++){var ne=j[te],re=ne.name,oe=ne.startTime,ie=ne.duration,ae=oe+ie;if(!(ie<=fe.Ab)&&shouldCreateSpan(oe,ae,K,$)){var se=new it(re,"app");se._start=oe,se.end(ae),ee.push(se)}}return ee}(ce.getEntriesByType(fe.Mu),te,K).forEach((function(K){return j.spans.push(K)}))}}else j.type===fe.oZ&&(j._start=0)}var pt=function(){function TransactionService(j,K){var $=this;this._config=K,this._logger=j,this.currentTransaction=void 0,this.respIntervalId=void 0,this.recorder=new ut((function(j){var K=$.getCurrentTransaction();if(K&&K.captureTimings){var ee,te=K.type===fe.oZ,ne=captureObserverEntries(j,{isHardNavigation:te,trStart:te?0:K._start}),re=ne.spans,oe=ne.marks;(ee=K.spans).push.apply(ee,re),K.addMarks({agent:oe})}}))}var j=TransactionService.prototype;return j.createCurrentTransaction=function createCurrentTransaction(j,K,$){var ee=new lt(j,K,$);return this.currentTransaction=ee,ee},j.getCurrentTransaction=function getCurrentTransaction(){if(this.currentTransaction&&!this.currentTransaction.ended)return this.currentTransaction},j.createOptions=function createOptions(j){var K=this._config.config,$=extend({transactionSampleRate:K.transactionSampleRate},j);return $.managed&&($=extend({pageLoadTraceId:K.pageLoadTraceId,pageLoadSampled:K.pageLoadSampled,pageLoadSpanId:K.pageLoadSpanId,pageLoadTransactionName:K.pageLoadTransactionName,pageLoadParentId:K.pageLoadParentId},$)),$},j.startManagedTransaction=function startManagedTransaction(j,K,$){var ee=this.getCurrentTransaction(),te=!1;if(ee)if(ee.canReuse()&&$.canReuse){var ne=ee.type,re=fe.W8.indexOf(ee.type),oe=fe.W8.indexOf(K);re>=0&&oe<re&&(ne=K),ee.redefine(j,ne,$),te=!0}else ee.end(),ee=this.createCurrentTransaction(j,K,$);else ee=this.createCurrentTransaction(j,K,$);return ee.type===fe.oZ&&(te||(this.recorder.start(fe.DO),this.recorder.start(fe.yw),this.recorder.start(fe.Vm),this.recorder.start(fe.o2)),$.pageLoadTraceId&&(ee.traceId=$.pageLoadTraceId),$.pageLoadSampled&&(ee.sampled=$.pageLoadSampled),ee.name===fe.gv&&$.pageLoadTransactionName&&(ee.name=$.pageLoadTransactionName)),!te&&this._config.get("monitorLongtasks")&&this.recorder.start(fe.nw),ee.sampled&&(ee.captureTimings=!0),ee},j.startTransaction=function startTransaction(j,K,$){var ee,te=this,ne=this.createOptions($),re=!0;ne.managed?this.currentTransaction===(ee=this.startManagedTransaction(j,K,ne))&&(re=!1):ee=new lt(j,K,ne);return ee.onEnd=function(){return te.handleTransactionEnd(ee)},re&&this._config.events.send(fe.TU,[ee]),ee},j.handleTransactionEnd=function handleTransactionEnd(j){var K=this;this.recorder.stop();var $=window.location.href;return ae.resolve().then((function(){var ee=j.name,te=j.type;if(Pe.lastHiddenStart>=j._start)K._config.dispatchEvent(fe.XM);else if(K.shouldIgnoreTransaction(ee)||te===fe.RW)K._config.dispatchEvent(fe.XM);else{if(te===fe.oZ){var ne=K._config.get("pageLoadTransactionName");if(ee===fe.gv&&ne&&(j.name=ne),j.captureTimings){var re=ct.cls,oe=ct.fid,ie=ct.tbt,ae=ct.longtask;ie.duration>0&&j.spans.push(function createTotalBlockingTimeSpan(j){var K=j.start,$=j.duration,ee=new it("Total Blocking Time",fe.nw,{startTime:K});return ee.end(K+$),ee}(ie)),j.experience={},isPerfTypeSupported(fe.nw)&&(j.experience.tbt=ie.duration),isPerfTypeSupported(fe.o2)&&(j.experience.cls=re.score),oe>0&&(j.experience.fid=oe),ae.count>0&&(j.experience.longtask={count:ae.count,sum:ae.duration,max:ae.max})}K.setSession(j)}j.name===fe.gv&&(j.name=function slugifyUrl(j,K){void 0===K&&(K=2);for(var $=new me(j),ee=$.query,te=$.path.substring(1).split("/"),ne=":id",re=/\W|_/g,oe=/[0-9]/g,ie=/[a-z]/g,ae=/[A-Z]/g,se=[],le=!1,ce=0;ce<te.length;ce++){var ue=te[ce];if(le||ce>K-1){ue&&se.push("*");break}if((ue.match(re)||[]).length>=2)se.push(ne),le=!0;else{var de=(ue.match(oe)||[]).length;if(de>3||ue.length>3&&de/ue.length>=.3)se.push(ne),le=!0;else{var pe=(ue.match(ae)||[]).length,ge=(ue.match(ie)||[]).length/ue.length,he=pe/ue.length;ue.length>5&&(he>.3&&he<.6||ge>.3&&ge<.6)?(se.push(ne),le=!0):ue&&se.push(ue)}}}return"/"+(se.length>=2?se.join("/"):se.join(""))+(ee?"?{query}":"")}($)),captureNavigation(j),K.adjustTransactionTime(j),K._config.get("breakdownMetrics")&&j.captureBreakdown();var se=K._config.get("context");addTransactionContext(j,se),K._config.events.send(fe.x9,[j])}}),(function(j){ke}))},j.setSession=function setSession(j){var K=this._config.get("session");if(K){"boolean"==typeof K||K.timestamp&&Date.now()-K.timestamp>fe.sG?j.session={id:generateRandomId(16),sequence:1}:j.session={id:K.id,sequence:K.sequence?K.sequence+1:1};var $={session:{id:j.session.id,sequence:j.session.sequence,timestamp:Date.now()}};this._config.setConfig($),this._config.setLocalConfig($,!0)}},j.adjustTransactionTime=function adjustTransactionTime(j){var K=j.spans,$=function getEarliestSpan(j){for(var K=j[0],$=1;$<j.length;$++){var ee=j[$];K._start>ee._start&&(K=ee)}return K}(K);$&&$._start<j._start&&(j._start=$._start);var ee=function getLatestNonXHRSpan(j){return getLatestSpan(j,(function(j){return-1===String(j).indexOf("external")}))}(K)||{},te=ee._end||0;if(j.type===fe.oZ){var ne=j._end-fe.JK,re=ct.lcp||0,oe=function getLatestXHRSpan(j){return getLatestSpan(j,(function(j){return-1!==String(j).indexOf("external")}))}(K)||{},ie=oe._end||0;j._end=Math.max(te,ie,re,ne)}else te>j._end&&(j._end=te);this.truncateSpans(K,j._end)},j.truncateSpans=function truncateSpans(j,K){for(var $=0;$<j.length;$++){var ee=j[$];ee._end>K&&(ee._end=K,ee.type+=fe.pS),ee._start>K&&(ee._start=K)}},j.shouldIgnoreTransaction=function shouldIgnoreTransaction(j){var K=this._config.get("ignoreTransactions");if(K&&K.length)for(var $=0;$<K.length;$++){var ee=K[$];if("function"==typeof ee.test){if(ee.test(j))return!0}else if(ee===j)return!0}return!1},j.startSpan=function startSpan(j,K,$){var ee=this.getCurrentTransaction();ee||(ee=this.createCurrentTransaction(void 0,fe.RW,this.createOptions({canReuse:!0,managed:!0})));var te=ee.startSpan(j,K,$);return te},j.endSpan=function endSpan(j,K){j&&j.end(null,K)},TransactionService}();const gt=pt;function createServiceFactory(){return function performance_monitoring_registerServices(){Xe[fe.P5]=function(j){var K=j.getService([fe.XZ,fe.IE]),$=K[0],ee=K[1];return new gt($,ee)},Xe[fe.e0]=function(j){var K=j.getService([fe.Q,fe.IE,fe.XZ,fe.P5]),$=K[0],ee=K[1],te=K[2],ne=K[3];return new nt($,ee,te,ne)}}(),function registerServices(){Xe[fe.mU]=function(j){var K=j.getService([fe.Q,fe.IE,fe.P5]),$=K[0],ee=K[1],te=K[2];return new we($,ee,te)}}(),new qe}var ht=$(5108),mt=!1;function bootstrap(){return isPlatformSupported()?(patchAll(),Pe.bootstrapTime=now(),mt=!0):le&&ht.log("[Elastic APM] platform is not supported!"),mt}var ft={minInteractionId:1/0,maxInteractionId:0,interactionCount:0,longestInteractions:[]};function processUserInteractions(j){j.getEntries().forEach((function(j){j.interactionId&&(!function updateInteractionCount(j){if(isPerfInteractionCountSupported())return;ft.minInteractionId=Math.min(ft.minInteractionId,j.interactionId),ft.maxInteractionId=Math.max(ft.maxInteractionId,j.interactionId),ft.interactionCount=(ft.maxInteractionId-ft.minInteractionId)/7+1}(j),j.duration<40||function storeUserInteraction(j){var K=ft.longestInteractions[ft.longestInteractions.length-1];if(void 0!==K&&j.duration<=K.duration&&j.interactionId!=K.id)return;var $=ft.longestInteractions.filter((function(K){return K.id===j.interactionId}));if($.length>0){var ee=$[0];ee.duration=Math.max(ee.duration,j.duration)}else ft.longestInteractions.push({id:j.interactionId,duration:j.duration});ft.longestInteractions.sort((function(j,K){return K.duration-j.duration})),ft.longestInteractions.splice(10)}(j))}))}function interactionCount(){return performance.interactionCount||ft.interactionCount}function reportInp(j){var K=function calculateInp(){if(0===ft.longestInteractions.length)return interactionCount()>0?0:void 0;var j=Math.min(ft.longestInteractions.length-1,Math.floor(interactionCount()/50));return ft.longestInteractions[j].duration}();if(K>=0){var $=now(),ee=j.startTransaction(fe.Xu,fe.Xu,{startTime:$}),te=performance.getEntriesByType("navigation");if(te.length>0){var ne=te[0].name;ee.addContext({page:{url:ne}})}ee.addLabels({inp_value:K});var re=$+K+1;return ee.end(re),function restoreINPState(){ft.minInteractionId=1/0,ft.maxInteractionId=0,ft.interactionCount=0,ft.longestInteractions=[]}(),ee}}function onPageHidden(j,K){if(reportInp(K))var $=j.observeEvent(fe.dO,(function(){endManagedTransaction(j,K),$()}));else endManagedTransaction(j,K)}function endManagedTransaction(j,K){var $=K.getCurrentTransaction();if($){var ee=j.observeEvent(fe.XM,(function(){Pe.lastHiddenStart=now(),ee(),te()})),te=j.observeEvent(fe.dO,(function(){j.dispatchEvent(fe.p4),Pe.lastHiddenStart=now(),te(),ee()}));$.end()}else j.dispatchEvent(fe.p4),Pe.lastHiddenStart=now()}var yt="a[data-transaction-name], button[data-transaction-name]";function observePageClicks(j){var K=function clickHandler(K){K.target instanceof Element&&function createUserInteractionTransaction(j,K){var $=function getTransactionMetadata(j){var K={transactionName:null,context:null};K.transactionName=function buildTransactionName(j){var K=function findCustomTransactionName(j){var K="data-transaction-name",$=j.getAttribute(K);if(j.closest){var ee=j.closest(yt);return ee?ee.getAttribute(K):$}return $}(j);if(K)return K;var $=j.tagName.toLowerCase(),ee=j.getAttribute("name");if(ee)return $+'["'+ee+'"]';return $}(j);var $=j.getAttribute("class");$&&(K.context={custom:{classes:$}});return K}(K),ee=$.transactionName,te=$.context,ne=j.startTransaction("Click - "+ee,fe.Cq,{managed:!0,canReuse:!0,reuseThreshold:300});ne&&te&&ne.addContext(te)}(j,K.target)},$="click";return window.addEventListener($,K,true),function(){window.removeEventListener($,K,true)}}var bt=function(){function ApmBase(j,K){this._disable=K,this.serviceFactory=j,this._initialized=!1}var j=ApmBase.prototype;return j.isEnabled=function isEnabled(){return!this._disable},j.isActive=function isActive(){var j=this.serviceFactory.getService(fe.IE);return this.isEnabled()&&this._initialized&&j.get("active")},j.init=function init(j){var K=this;if(this.isEnabled()&&!this._initialized){this._initialized=!0;var $=this.serviceFactory.getService([fe.IE,fe.XZ,fe.P5]),ee=$[0],te=$[1],ne=$[2];ee.setVersion("5.17.0"),this.config(j);var re=ee.get("logLevel");if(te.setLevel(re),ee.get("active")){this.serviceFactory.init();var oe=function getInstrumentationFlags(j,K){var $,ee=(($={})[fe.Ie]=!1,$[fe.jR]=!1,$[fe.UA]=!1,$[fe.oZ]=!1,$[fe.pn]=!1,$[fe.JY]=!1,$[fe.ot]=!1,$);return j?(Object.keys(ee).forEach((function(j){-1===K.indexOf(j)&&(ee[j]=!0)})),ee):ee}(ee.get("instrument"),ee.get("disableInstrumentations"));if(this.serviceFactory.getService(fe.e0).init(oe),oe[fe.pn])this.serviceFactory.getService(fe.mU).registerListeners();if(ee.get("session")){var ie=ee.getLocalConfig();ie&&ie.session&&ee.setConfig({session:ie.session})}var ae=function sendPageLoad(){return oe[fe.oZ]&&K._sendPageLoadMetrics()};ee.get("centralConfig")?this.fetchCentralConfig().then(ae):ae(),function observePageVisibility(j,K){"hidden"===document.visibilityState&&(Pe.lastHiddenStart=0);var $=function visibilityChangeHandler(){"hidden"===document.visibilityState&&onPageHidden(j,K)},ee=function pageHideHandler(){return onPageHidden(j,K)},te=!0;return window.addEventListener("visibilitychange",$,te),window.addEventListener("pagehide",ee,te),function(){window.removeEventListener("visibilitychange",$,te),window.removeEventListener("pagehide",ee,te)}}(ee,ne),oe[fe.JY]&&oe[fe.ot]&&observePageClicks(ne),function observeUserInteractions(j){void 0===j&&(j=new ut(processUserInteractions));var K=isPerfInteractionCountSupported(),$=K?40:16;j.start(fe.Ks,{buffered:!0,durationThreshold:$}),K||j.start(fe.Vm)}()}else this._disable=!0,te.warn("RUM agent is inactive")}return this},j.fetchCentralConfig=function fetchCentralConfig(){var j=this.serviceFactory.getService([fe.Q,fe.XZ,fe.IE]),K=j[0],$=j[1],ee=j[2];return K.fetchConfig(ee.get("serviceName"),ee.get("environment")).then((function(j){var K=j.transaction_sample_rate;if(K){var te={transactionSampleRate:K=Number(K)},ne=ee.validate(te).invalid;if(0===ne.length)ee.setConfig(te);else{var re=ne[0],oe=re.key,ie=re.value,ae=re.allowed;$.warn('invalid value "'+ie+'" for '+oe+". Allowed: "+ae+".")}}return j})).catch((function(j){$.warn("failed fetching config:",j)}))},j._sendPageLoadMetrics=function _sendPageLoadMetrics(){var j=this.startTransaction(void 0,fe.oZ,{managed:!0,canReuse:!0});if(j){j.addTask(fe.oZ);var K=function sendPageLoadMetrics(){setTimeout((function(){return j.removeTask(fe.oZ)}),fe.JK)};"complete"===document.readyState?K():window.addEventListener("load",K)}},j.observe=function observe(j,K){this.serviceFactory.getService(fe.IE).events.observe(j,K)},j.config=function config(j){var K=this.serviceFactory.getService([fe.IE,fe.XZ]),$=K[0],ee=K[1],te=$.validate(j),ne=te.missing,re=te.invalid,oe=te.unknown;if(oe.length>0){var ie="Unknown config options are specified for RUM agent: "+oe.join(", ");ee.warn(ie)}if(0===ne.length&&0===re.length)$.setConfig(j);else{var ae=", ",se="RUM agent isn't correctly configured. ";ne.length>0&&(se+=ne.join(ae)+" is missing",re.length>0&&(se+=ae)),re.forEach((function(j,K){var $=j.key,ee=j.value,te=j.allowed;se+=$+' "'+ee+'" contains invalid characters! (allowed: '+te+")"+(K!==re.length-1?ae:"")})),ee.error(se),$.setConfig({active:!1})}},j.setUserContext=function setUserContext(j){this.serviceFactory.getService(fe.IE).setUserContext(j)},j.setCustomContext=function setCustomContext(j){this.serviceFactory.getService(fe.IE).setCustomContext(j)},j.addLabels=function addLabels(j){this.serviceFactory.getService(fe.IE).addLabels(j)},j.setInitialPageLoadName=function setInitialPageLoadName(j){this.serviceFactory.getService(fe.IE).setConfig({pageLoadTransactionName:j})},j.startTransaction=function startTransaction(j,K,$){if(this.isEnabled())return this.serviceFactory.getService(fe.P5).startTransaction(j,K,$)},j.startSpan=function startSpan(j,K,$){if(this.isEnabled())return this.serviceFactory.getService(fe.P5).startSpan(j,K,$)},j.getCurrentTransaction=function getCurrentTransaction(){if(this.isEnabled())return this.serviceFactory.getService(fe.P5).getCurrentTransaction()},j.captureError=function captureError(j,K){if(this.isEnabled())return this.serviceFactory.getService(fe.mU).logError(j,K)},j.addFilter=function addFilter(j){this.serviceFactory.getService(fe.IE).addFilter(j)},ApmBase}();var vt=function getApmBase(){if(le&&window.elasticApm)return window.elasticApm;var j=bootstrap(),K=createServiceFactory(),$=new bt(K,!j);return le&&(window.elasticApm=$),$}(),Mt=vt.init.bind(vt)},9521:(j,K,$)=>{"use strict";$.d(K,{Z:()=>Ce});var ee=$(6375),te=Math.abs,ne=String.fromCharCode,re=Object.assign;function trim(j){return j.trim()}function Utility_replace(j,K,$){return j.replace(K,$)}function indexof(j,K){return j.indexOf(K)}function Utility_charat(j,K){return 0|j.charCodeAt(K)}function Utility_substr(j,K,$){return j.slice(K,$)}function Utility_strlen(j){return j.length}function Utility_sizeof(j){return j.length}function Utility_append(j,K){return K.push(j),j}var oe=1,ie=1,ae=0,se=0,le=0,ce="";function node(j,K,$,ee,te,ne,re){return{value:j,root:K,parent:$,type:ee,props:te,children:ne,line:oe,column:ie,length:re,return:""}}function Tokenizer_copy(j,K){return re(node("",null,null,"",null,null,0),j,{length:-j.length},K)}function prev(){return le=se>0?Utility_charat(ce,--se):0,ie--,10===le&&(ie=1,oe--),le}function next(){return le=se<ae?Utility_charat(ce,se++):0,ie++,10===le&&(ie=1,oe++),le}function peek(){return Utility_charat(ce,se)}function caret(){return se}function slice(j,K){return Utility_substr(ce,j,K)}function token(j){switch(j){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function alloc(j){return oe=ie=1,ae=Utility_strlen(ce=j),se=0,[]}function dealloc(j){return ce="",j}function delimit(j){return trim(slice(se-1,delimiter(91===j?j+2:40===j?j+1:j)))}function whitespace(j){for(;(le=peek())&&le<33;)next();return token(j)>2||token(le)>3?"":" "}function escaping(j,K){for(;--K&&next()&&!(le<48||le>102||le>57&&le<65||le>70&&le<97););return slice(j,caret()+(K<6&&32==peek()&&32==next()))}function delimiter(j){for(;next();)switch(le){case j:return se;case 34:case 39:34!==j&&39!==j&&delimiter(le);break;case 40:41===j&&delimiter(j);break;case 92:next()}return se}function commenter(j,K){for(;next()&&j+le!==57&&(j+le!==84||47!==peek()););return"/*"+slice(K,se-1)+"*"+ne(47===j?j:next())}function identifier(j){for(;!token(peek());)next();return slice(j,se)}var ue="-ms-",de="-moz-",pe="-webkit-",ge="comm",he="rule",me="decl",fe="@keyframes";function Serializer_serialize(j,K){for(var $="",ee=Utility_sizeof(j),te=0;te<ee;te++)$+=K(j[te],te,j,K)||"";return $}function stringify(j,K,$,ee){switch(j.type){case"@layer":if(j.children.length)break;case"@import":case me:return j.return=j.return||j.value;case ge:return"";case fe:return j.return=j.value+"{"+Serializer_serialize(j.children,ee)+"}";case he:j.value=j.props.join(",")}return Utility_strlen($=Serializer_serialize(j.children,ee))?j.return=j.value+"{"+$+"}":""}function compile(j){return dealloc(parse("",null,null,null,[""],j=alloc(j),0,[0],j))}function parse(j,K,$,ee,te,re,oe,ie,ae){for(var se=0,le=0,ce=oe,ue=0,de=0,pe=0,ge=1,he=1,me=1,fe=0,ye="",be=te,ve=re,Me=ee,Ee=ye;he;)switch(pe=fe,fe=next()){case 40:if(108!=pe&&58==Utility_charat(Ee,ce-1)){-1!=indexof(Ee+=Utility_replace(delimit(fe),"&","&\f"),"&\f")&&(me=-1);break}case 34:case 39:case 91:Ee+=delimit(fe);break;case 9:case 10:case 13:case 32:Ee+=whitespace(pe);break;case 92:Ee+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:Utility_append(comment(commenter(next(),caret()),K,$),ae);break;default:Ee+="/"}break;case 123*ge:ie[se++]=Utility_strlen(Ee)*me;case 125*ge:case 59:case 0:switch(fe){case 0:case 125:he=0;case 59+le:-1==me&&(Ee=Utility_replace(Ee,/\f/g,"")),de>0&&Utility_strlen(Ee)-ce&&Utility_append(de>32?declaration(Ee+";",ee,$,ce-1):declaration(Utility_replace(Ee," ","")+";",ee,$,ce-2),ae);break;case 59:Ee+=";";default:if(Utility_append(Me=ruleset(Ee,K,$,se,le,te,ie,ye,be=[],ve=[],ce),re),123===fe)if(0===le)parse(Ee,K,Me,Me,be,re,ce,ie,ve);else switch(99===ue&&110===Utility_charat(Ee,3)?100:ue){case 100:case 108:case 109:case 115:parse(j,Me,Me,ee&&Utility_append(ruleset(j,Me,Me,0,0,te,ie,ye,te,be=[],ce),ve),te,ve,ce,ie,ee?be:ve);break;default:parse(Ee,Me,Me,Me,[""],ve,0,ie,ve)}}se=le=de=0,ge=me=1,ye=Ee="",ce=oe;break;case 58:ce=1+Utility_strlen(Ee),de=pe;default:if(ge<1)if(123==fe)--ge;else if(125==fe&&0==ge++&&125==prev())continue;switch(Ee+=ne(fe),fe*ge){case 38:me=le>0?1:(Ee+="\f",-1);break;case 44:ie[se++]=(Utility_strlen(Ee)-1)*me,me=1;break;case 64:45===peek()&&(Ee+=delimit(next())),ue=peek(),le=ce=Utility_strlen(ye=Ee+=identifier(caret())),fe++;break;case 45:45===pe&&2==Utility_strlen(Ee)&&(ge=0)}}return re}function ruleset(j,K,$,ee,ne,re,oe,ie,ae,se,le){for(var ce=ne-1,ue=0===ne?re:[""],de=Utility_sizeof(ue),pe=0,ge=0,me=0;pe<ee;++pe)for(var fe=0,ye=Utility_substr(j,ce+1,ce=te(ge=oe[pe])),be=j;fe<de;++fe)(be=trim(ge>0?ue[fe]+" "+ye:Utility_replace(ye,/&\f/g,ue[fe])))&&(ae[me++]=be);return node(j,K,$,0===ne?he:ie,ae,se,le)}function comment(j,K,$){return node(j,K,$,ge,ne(function Tokenizer_char(){return le}()),Utility_substr(j,2,-2),0)}function declaration(j,K,$,ee){return node(j,K,$,me,Utility_substr(j,0,ee),Utility_substr(j,ee+1,-1),ee)}var ye=function identifierWithPointTracking(j,K,$){for(var ee=0,te=0;ee=te,te=peek(),38===ee&&12===te&&(K[$]=1),!token(te);)next();return slice(j,se)},be=function getRules(j,K){return dealloc(function toRules(j,K){var $=-1,ee=44;do{switch(token(ee)){case 0:38===ee&&12===peek()&&(K[$]=1),j[$]+=ye(se-1,K,$);break;case 2:j[$]+=delimit(ee);break;case 4:if(44===ee){j[++$]=58===peek()?"&\f":"",K[$]=j[$].length;break}default:j[$]+=ne(ee)}}while(ee=next());return j}(alloc(j),K))},ve=new WeakMap,Me=function compat(j){if("rule"===j.type&&j.parent&&!(j.length<1)){for(var K=j.value,$=j.parent,ee=j.column===$.column&&j.line===$.line;"rule"!==$.type;)if(!($=$.parent))return;if((1!==j.props.length||58===K.charCodeAt(0)||ve.get($))&&!ee){ve.set(j,!0);for(var te=[],ne=be(K,te),re=$.props,oe=0,ie=0;oe<ne.length;oe++)for(var ae=0;ae<re.length;ae++,ie++)j.props[ie]=te[oe]?ne[oe].replace(/&\f/g,re[ae]):re[ae]+" "+ne[oe]}}},Ee=function removeLabel(j){if("decl"===j.type){var K=j.value;108===K.charCodeAt(0)&&98===K.charCodeAt(2)&&(j.return="",j.value="")}};function emotion_cache_browser_esm_prefix(j,K){switch(function hash(j,K){return 45^Utility_charat(j,0)?(((K<<2^Utility_charat(j,0))<<2^Utility_charat(j,1))<<2^Utility_charat(j,2))<<2^Utility_charat(j,3):0}(j,K)){case 5103:return"-webkit-print-"+j+j;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return pe+j+j;case 5349:case 4246:case 4810:case 6968:case 2756:return pe+j+de+j+ue+j+j;case 6828:case 4268:return pe+j+ue+j+j;case 6165:return pe+j+ue+"flex-"+j+j;case 5187:return pe+j+Utility_replace(j,/(\w+).+(:[^]+)/,"-webkit-box-$1$2-ms-flex-$1$2")+j;case 5443:return pe+j+ue+"flex-item-"+Utility_replace(j,/flex-|-self/,"")+j;case 4675:return pe+j+ue+"flex-line-pack"+Utility_replace(j,/align-content|flex-|-self/,"")+j;case 5548:return pe+j+ue+Utility_replace(j,"shrink","negative")+j;case 5292:return pe+j+ue+Utility_replace(j,"basis","preferred-size")+j;case 6060:return"-webkit-box-"+Utility_replace(j,"-grow","")+pe+j+ue+Utility_replace(j,"grow","positive")+j;case 4554:return pe+Utility_replace(j,/([^-])(transform)/g,"$1-webkit-$2")+j;case 6187:return Utility_replace(Utility_replace(Utility_replace(j,/(zoom-|grab)/,"-webkit-$1"),/(image-set)/,"-webkit-$1"),j,"")+j;case 5495:case 3959:return Utility_replace(j,/(image-set\([^]*)/,"-webkit-$1$`$1");case 4968:return Utility_replace(Utility_replace(j,/(.+:)(flex-)?(.*)/,"-webkit-box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+pe+j+j;case 4095:case 3583:case 4068:case 2532:return Utility_replace(j,/(.+)-inline(.+)/,"-webkit-$1$2")+j;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Utility_strlen(j)-1-K>6)switch(Utility_charat(j,K+1)){case 109:if(45!==Utility_charat(j,K+4))break;case 102:return Utility_replace(j,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1-moz-"+(108==Utility_charat(j,K+3)?"$3":"$2-$3"))+j;case 115:return~indexof(j,"stretch")?emotion_cache_browser_esm_prefix(Utility_replace(j,"stretch","fill-available"),K)+j:j}break;case 4949:if(115!==Utility_charat(j,K+1))break;case 6444:switch(Utility_charat(j,Utility_strlen(j)-3-(~indexof(j,"!important")&&10))){case 107:return Utility_replace(j,":",":-webkit-")+j;case 101:return Utility_replace(j,/(.+:)([^;!]+)(;|!.+)?/,"$1-webkit-"+(45===Utility_charat(j,14)?"inline-":"")+"box$3$1"+"-webkit-$2$3$1"+"-ms-$2box$3")+j}break;case 5936:switch(Utility_charat(j,K+11)){case 114:return pe+j+ue+Utility_replace(j,/[svh]\w+-[tblr]{2}/,"tb")+j;case 108:return pe+j+ue+Utility_replace(j,/[svh]\w+-[tblr]{2}/,"tb-rl")+j;case 45:return pe+j+ue+Utility_replace(j,/[svh]\w+-[tblr]{2}/,"lr")+j}return pe+j+ue+j+j}return j}var Se=[function prefixer(j,K,$,ee){if(j.length>-1&&!j.return)switch(j.type){case me:j.return=emotion_cache_browser_esm_prefix(j.value,j.length);break;case fe:return Serializer_serialize([Tokenizer_copy(j,{value:Utility_replace(j.value,"@","@-webkit-")})],ee);case he:if(j.length)return function Utility_combine(j,K){return j.map(K).join("")}(j.props,(function(K){switch(function Utility_match(j,K){return(j=K.exec(j))?j[0]:j}(K,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Serializer_serialize([Tokenizer_copy(j,{props:[Utility_replace(K,/:(read-\w+)/,":-moz-$1")]})],ee);case"::placeholder":return Serializer_serialize([Tokenizer_copy(j,{props:[Utility_replace(K,/:(plac\w+)/,":-webkit-input-$1")]}),Tokenizer_copy(j,{props:[Utility_replace(K,/:(plac\w+)/,":-moz-$1")]}),Tokenizer_copy(j,{props:[Utility_replace(K,/:(plac\w+)/,"-ms-input-$1")]})],ee)}return""}))}}],Ce=function createCache(j){var K=j.key;if("css"===K){var $=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call($,(function(j){-1!==j.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(j),j.setAttribute("data-s",""))}))}var te,ne,re=j.stylisPlugins||Se,oe={},ie=[];te=j.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+K+' "]'),(function(j){for(var K=j.getAttribute("data-emotion").split(" "),$=1;$<K.length;$++)oe[K[$]]=!0;ie.push(j)}));var ae,se,le=[stringify,(se=function(j){ae.insert(j)},function(j){j.root||(j=j.return)&&se(j)})],ce=function middleware(j){var K=Utility_sizeof(j);return function($,ee,te,ne){for(var re="",oe=0;oe<K;oe++)re+=j[oe]($,ee,te,ne)||"";return re}}([Me,Ee].concat(re,le));ne=function insert(j,K,$,ee){ae=$,function stylis(j){Serializer_serialize(compile(j),ce)}(j?j+"{"+K.styles+"}":K.styles),ee&&(ue.inserted[K.name]=!0)};var ue={key:K,sheet:new ee.m({key:K,container:te,nonce:j.nonce,speedy:j.speedy,prepend:j.prepend,insertionPoint:j.insertionPoint}),nonce:j.nonce,inserted:oe,registered:{},insert:ne};return ue.sheet.hydrate(ie),ue}},546:(j,K,$)=>{"use strict";function memoize(j){var K=Object.create(null);return function($){return void 0===K[$]&&(K[$]=j($)),K[$]}}$.d(K,{Z:()=>memoize})},5037:(j,K,$)=>{"use strict";$.d(K,{C:()=>ae,E:()=>ge,T:()=>le,c:()=>de,h:()=>ce,w:()=>se});var ee=$(7363),te=$(9521),ne=$(5469),re=$(7267),oe=$(5251),ie=ee.createContext("undefined"!=typeof HTMLElement?(0,te.Z)({key:"css"}):null),ae=ie.Provider,se=function withEmotionCache(j){return(0,ee.forwardRef)((function(K,$){var te=(0,ee.useContext)(ie);return j(K,te,$)}))},le=ee.createContext({});var ce={}.hasOwnProperty,ue="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",de=function createEmotionProps(j,K){var $={};for(var ee in K)ce.call(K,ee)&&($[ee]=K[ee]);return $[ue]=j,$},pe=function Insertion(j){var K=j.cache,$=j.serialized,ee=j.isStringTag;return(0,ne.hC)(K,$,ee),(0,oe.L)((function(){return(0,ne.My)(K,$,ee)})),null},ge=se((function(j,K,$){var te=j.css;"string"==typeof te&&void 0!==K.registered[te]&&(te=K.registered[te]);var oe=j[ue],ie=[te],ae="";"string"==typeof j.className?ae=(0,ne.fp)(K.registered,ie,j.className):null!=j.className&&(ae=j.className+" ");var se=(0,re.O)(ie,void 0,ee.useContext(le));ae+=K.key+"-"+se.name;var de={};for(var ge in j)ce.call(j,ge)&&"css"!==ge&&ge!==ue&&(de[ge]=j[ge]);return de.className=ae,$&&(de.ref=$),ee.createElement(ee.Fragment,null,ee.createElement(pe,{cache:K,serialized:se,isStringTag:"string"==typeof oe}),ee.createElement(oe,de))}))},6502:(j,K,$)=>{"use strict";$.d(K,{F4:()=>keyframes,iv:()=>css,tZ:()=>ie,xB:()=>ae});var ee=$(5037),te=$(7363),ne=$(5469),re=$(5251),oe=$(7267),ie=($(9521),$(3790),function jsx(j,K){var $=arguments;if(null==K||!ee.h.call(K,"css"))return te.createElement.apply(void 0,$);var ne=$.length,re=new Array(ne);re[0]=ee.E,re[1]=(0,ee.c)(j,K);for(var oe=2;oe<ne;oe++)re[oe]=$[oe];return te.createElement.apply(null,re)});!function(j){var K;K||(K=j.JSX||(j.JSX={}))}(ie||(ie={}));var ae=(0,ee.w)((function(j,K){var $=j.styles,ie=(0,oe.O)([$],void 0,te.useContext(ee.T)),ae=te.useRef();return(0,re.j)((function(){var j=K.key+"-global",$=new K.sheet.constructor({key:j,nonce:K.sheet.nonce,container:K.sheet.container,speedy:K.sheet.isSpeedy}),ee=!1,te=document.querySelector('style[data-emotion="'+j+" "+ie.name+'"]');return K.sheet.tags.length&&($.before=K.sheet.tags[0]),null!==te&&(ee=!0,te.setAttribute("data-emotion",j),$.hydrate([te])),ae.current=[$,ee],function(){$.flush()}}),[K]),(0,re.j)((function(){var j=ae.current,$=j[0];if(j[1])j[1]=!1;else{if(void 0!==ie.next&&(0,ne.My)(K,ie.next,!0),$.tags.length){var ee=$.tags[$.tags.length-1].nextElementSibling;$.before=ee,$.flush()}K.insert("",ie,$,!1)}}),[K,ie.name]),null}));function css(){for(var j=arguments.length,K=new Array(j),$=0;$<j;$++)K[$]=arguments[$];return(0,oe.O)(K)}function keyframes(){var j=css.apply(void 0,arguments),K="animation-"+j.name;return{name:K,styles:"@keyframes "+K+"{"+j.styles+"}",anim:1,toString:function toString(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}},7267:(j,K,$)=>{"use strict";$.d(K,{O:()=>serializeStyles});var ee={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},te=$(546),ne=/[A-Z]|^ms/g,re=/_EMO_([^_]+?)_([^]*?)_EMO_/g,oe=function isCustomProperty(j){return 45===j.charCodeAt(1)},ie=function isProcessableValue(j){return null!=j&&"boolean"!=typeof j},ae=(0,te.Z)((function(j){return oe(j)?j:j.replace(ne,"-$&").toLowerCase()})),se=function processStyleValue(j,K){switch(j){case"animation":case"animationName":if("string"==typeof K)return K.replace(re,(function(j,K,$){return le={name:K,styles:$,next:le},K}))}return 1===ee[j]||oe(j)||"number"!=typeof K||0===K?K:K+"px"};function handleInterpolation(j,K,$){if(null==$)return"";var ee=$;if(void 0!==ee.__emotion_styles)return ee;switch(typeof $){case"boolean":return"";case"object":var te=$;if(1===te.anim)return le={name:te.name,styles:te.styles,next:le},te.name;var ne=$;if(void 0!==ne.styles){var re=ne.next;if(void 0!==re)for(;void 0!==re;)le={name:re.name,styles:re.styles,next:le},re=re.next;return ne.styles+";"}return function createStringFromObject(j,K,$){var ee="";if(Array.isArray($))for(var te=0;te<$.length;te++)ee+=handleInterpolation(j,K,$[te])+";";else for(var ne in $){var re=$[ne];if("object"!=typeof re){var oe=re;null!=K&&void 0!==K[oe]?ee+=ne+"{"+K[oe]+"}":ie(oe)&&(ee+=ae(ne)+":"+se(ne,oe)+";")}else if(!Array.isArray(re)||"string"!=typeof re[0]||null!=K&&void 0!==K[re[0]]){var le=handleInterpolation(j,K,re);switch(ne){case"animation":case"animationName":ee+=ae(ne)+":"+le+";";break;default:ee+=ne+"{"+le+"}"}}else for(var ce=0;ce<re.length;ce++)ie(re[ce])&&(ee+=ae(ne)+":"+se(ne,re[ce])+";")}return ee}(j,K,$);case"function":if(void 0!==j){var oe=le,ce=$(j);return le=oe,handleInterpolation(j,K,ce)}}var ue=$;if(null==K)return ue;var de=K[ue];return void 0!==de?de:ue}var le,ce=/label:\s*([^\s;{]+)\s*(;|$)/g;function serializeStyles(j,K,$){if(1===j.length&&"object"==typeof j[0]&&null!==j[0]&&void 0!==j[0].styles)return j[0];var ee=!0,te="";le=void 0;var ne=j[0];null==ne||void 0===ne.raw?(ee=!1,te+=handleInterpolation($,K,ne)):te+=ne[0];for(var re=1;re<j.length;re++){if(te+=handleInterpolation($,K,j[re]),ee)te+=ne[re]}ce.lastIndex=0;for(var oe,ie="";null!==(oe=ce.exec(te));)ie+="-"+oe[1];var ae=function murmur2(j){for(var K,$=0,ee=0,te=j.length;te>=4;++ee,te-=4)K=1540483477*(65535&(K=255&j.charCodeAt(ee)|(255&j.charCodeAt(++ee))<<8|(255&j.charCodeAt(++ee))<<16|(255&j.charCodeAt(++ee))<<24))+(59797*(K>>>16)<<16),$=1540483477*(65535&(K^=K>>>24))+(59797*(K>>>16)<<16)^1540483477*(65535&$)+(59797*($>>>16)<<16);switch(te){case 3:$^=(255&j.charCodeAt(ee+2))<<16;case 2:$^=(255&j.charCodeAt(ee+1))<<8;case 1:$=1540483477*(65535&($^=255&j.charCodeAt(ee)))+(59797*($>>>16)<<16)}return((($=1540483477*(65535&($^=$>>>13))+(59797*($>>>16)<<16))^$>>>15)>>>0).toString(36)}(te)+ie;return{name:ae,styles:te,next:le}}},6375:(j,K,$)=>{"use strict";$.d(K,{m:()=>ee});var ee=function(){function StyleSheet(j){var K=this;this._insertTag=function(j){var $;$=0===K.tags.length?K.insertionPoint?K.insertionPoint.nextSibling:K.prepend?K.container.firstChild:K.before:K.tags[K.tags.length-1].nextSibling,K.container.insertBefore(j,$),K.tags.push(j)},this.isSpeedy=void 0===j.speedy||j.speedy,this.tags=[],this.ctr=0,this.nonce=j.nonce,this.key=j.key,this.container=j.container,this.prepend=j.prepend,this.insertionPoint=j.insertionPoint,this.before=null}var j=StyleSheet.prototype;return j.hydrate=function hydrate(j){j.forEach(this._insertTag)},j.insert=function insert(j){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function createStyleElement(j){var K=document.createElement("style");return K.setAttribute("data-emotion",j.key),void 0!==j.nonce&&K.setAttribute("nonce",j.nonce),K.appendChild(document.createTextNode("")),K.setAttribute("data-s",""),K}(this));var K=this.tags[this.tags.length-1];if(this.isSpeedy){var $=function sheetForTag(j){if(j.sheet)return j.sheet;for(var K=0;K<document.styleSheets.length;K++)if(document.styleSheets[K].ownerNode===j)return document.styleSheets[K]}(K);try{$.insertRule(j,$.cssRules.length)}catch(j){}}else K.appendChild(document.createTextNode(j));this.ctr++},j.flush=function flush(){this.tags.forEach((function(j){var K;return null==(K=j.parentNode)?void 0:K.removeChild(j)})),this.tags=[],this.ctr=0},StyleSheet}()},5251:(j,K,$)=>{"use strict";$.d(K,{L:()=>ne,j:()=>re});var ee=$(7363),te=!!ee.useInsertionEffect&&ee.useInsertionEffect,ne=te||function syncFallback(j){return j()},re=te||ee.useLayoutEffect},5469:(j,K,$)=>{"use strict";$.d(K,{My:()=>te,fp:()=>getRegisteredStyles,hC:()=>ee});function getRegisteredStyles(j,K,$){var ee="";return $.split(" ").forEach((function($){void 0!==j[$]?K.push(j[$]+";"):$&&(ee+=$+" ")})),ee}var ee=function registerStyles(j,K,$){var ee=j.key+"-"+K.name;!1===$&&void 0===j.registered[ee]&&(j.registered[ee]=K.styles)},te=function insertStyles(j,K,$){ee(j,K,$);var te=j.key+"-"+K.name;if(void 0===j.inserted[K.name]){var ne=K;do{j.insert(K===ne?"."+te:"",ne,j.sheet,!0),ne=ne.next}while(void 0!==ne)}}},6437:(j,K,$)=>{"use strict";$.d(K,{Z:()=>ne});var ee=$(6177),te=$(7514);const ne=(0,ee.Z)((0,te.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack")},1682:(j,K,$)=>{"use strict";$.d(K,{Z:()=>ne});var ee=$(6177),te=$(7514);const ne=(0,ee.Z)((0,te.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},6005:(j,K,$)=>{"use strict";$.d(K,{Z:()=>de});var ee=$(7363),te=$(7726),ne=$(9916),re=$(7843),oe=$(2893),ie=$(7562),ae=$(7321),se=$(4685),le=$(9503);function getBackdropUtilityClass(j){return(0,le.ZP)("MuiBackdrop",j)}(0,se.Z)("MuiBackdrop",["root","invisible"]);var ce=$(7514);const ue=(0,re.ZP)("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(j,K)=>{const{ownerState:$}=j;return[K.root,$.invisible&&K.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),de=ee.forwardRef((function Backdrop(j,K){const $=(0,oe.i)({props:j,name:"MuiBackdrop"}),{children:ee,className:re,component:se="div",invisible:le=!1,open:de,components:pe={},componentsProps:ge={},slotProps:he={},slots:me={},TransitionComponent:fe,transitionDuration:ye,...be}=$,ve={...$,component:se,invisible:le},Me=(j=>{const{classes:K,invisible:$}=j,ee={root:["root",$&&"invisible"]};return(0,ne.Z)(ee,getBackdropUtilityClass,K)})(ve),Ee={slots:{transition:fe,root:pe.Root,...me},slotProps:{...ge,...he}},[Se,Ce]=(0,ie.Z)("root",{elementType:ue,externalForwardedProps:Ee,className:(0,te.Z)(Me.root,re),ownerState:ve}),[_e,Te]=(0,ie.Z)("transition",{elementType:ae.Z,externalForwardedProps:Ee,ownerState:ve});return(0,ce.jsx)(_e,{in:de,timeout:ye,...be,...Te,children:(0,ce.jsx)(Se,{"aria-hidden":!0,...Ce,classes:Me,ref:K,children:ee})})}))},3335:(j,K,$)=>{"use strict";$.d(K,{Z:()=>Te});var ee=$(7363),te=$(7726);function resolveProps(j,K){const $={...K};for(const ee in j)if(Object.prototype.hasOwnProperty.call(j,ee)){const te=ee;if("components"===te||"slots"===te)$[te]={...j[te],...$[te]};else if("componentsProps"===te||"slotProps"===te){const ee=j[te],ne=K[te];if(ne)if(ee){$[te]={...ne};for(const j in ee)if(Object.prototype.hasOwnProperty.call(ee,j)){const K=j;$[te][K]=resolveProps(ee[K],ne[K])}}else $[te]=ne;else $[te]=ee||{}}else void 0===$[te]&&($[te]=j[te])}return $}var ne=$(9916),re=$(5689),oe=$(4532),ie=$(4039),ae=$(7843),se=$(518),le=$(2893),ce=$(9495),ue=$(3830),de=$(2791),pe=$(8981),ge=$(4685),he=$(9503);function getButtonUtilityClass(j){return(0,he.ZP)("MuiButton",j)}const me=(0,ge.Z)("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]);const fe=ee.createContext({});const ye=ee.createContext(void 0);var be=$(7514);const ve=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Me=(0,ae.ZP)(ce.Z,{shouldForwardProp:j=>(0,ie.Z)(j)||"classes"===j,name:"MuiButton",slot:"Root",overridesResolver:(j,K)=>{const{ownerState:$}=j;return[K.root,K[$.variant],K[`${$.variant}${(0,de.Z)($.color)}`],K[`size${(0,de.Z)($.size)}`],K[`${$.variant}Size${(0,de.Z)($.size)}`],"inherit"===$.color&&K.colorInherit,$.disableElevation&&K.disableElevation,$.fullWidth&&K.fullWidth,$.loading&&K.loading]}})((0,se.Z)((({theme:j})=>{const K="light"===j.palette.mode?j.palette.grey[300]:j.palette.grey[800],$="light"===j.palette.mode?j.palette.grey.A100:j.palette.grey[700];return{...j.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(j.vars||j).shape.borderRadius,transition:j.transitions.create(["background-color","box-shadow","border-color","color"],{duration:j.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${me.disabled}`]:{color:(j.vars||j).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(j.vars||j).shadows[2],"&:hover":{boxShadow:(j.vars||j).shadows[4],"@media (hover: none)":{boxShadow:(j.vars||j).shadows[2]}},"&:active":{boxShadow:(j.vars||j).shadows[8]},[`&.${me.focusVisible}`]:{boxShadow:(j.vars||j).shadows[6]},[`&.${me.disabled}`]:{color:(j.vars||j).palette.action.disabled,boxShadow:(j.vars||j).shadows[0],backgroundColor:(j.vars||j).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${me.disabled}`]:{border:`1px solid ${(j.vars||j).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(j.palette).filter((0,pe.Z)()).map((([K])=>({props:{color:K},style:{"--variant-textColor":(j.vars||j).palette[K].main,"--variant-outlinedColor":(j.vars||j).palette[K].main,"--variant-outlinedBorder":j.vars?`rgba(${j.vars.palette[K].mainChannel} / 0.5)`:(0,re.Fq)(j.palette[K].main,.5),"--variant-containedColor":(j.vars||j).palette[K].contrastText,"--variant-containedBg":(j.vars||j).palette[K].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(j.vars||j).palette[K].dark,"--variant-textBg":j.vars?`rgba(${j.vars.palette[K].mainChannel} / ${j.vars.palette.action.hoverOpacity})`:(0,re.Fq)(j.palette[K].main,j.palette.action.hoverOpacity),"--variant-outlinedBorder":(j.vars||j).palette[K].main,"--variant-outlinedBg":j.vars?`rgba(${j.vars.palette[K].mainChannel} / ${j.vars.palette.action.hoverOpacity})`:(0,re.Fq)(j.palette[K].main,j.palette.action.hoverOpacity)}}}}))),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":j.vars?j.vars.palette.Button.inheritContainedBg:K,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":j.vars?j.vars.palette.Button.inheritContainedHoverBg:$,"--variant-textBg":j.vars?`rgba(${j.vars.palette.text.primaryChannel} / ${j.vars.palette.action.hoverOpacity})`:(0,re.Fq)(j.palette.text.primary,j.palette.action.hoverOpacity),"--variant-outlinedBg":j.vars?`rgba(${j.vars.palette.text.primaryChannel} / ${j.vars.palette.action.hoverOpacity})`:(0,re.Fq)(j.palette.text.primary,j.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:j.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:j.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:j.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:j.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:j.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:j.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${me.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${me.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:j.transitions.create(["background-color","box-shadow","border-color"],{duration:j.transitions.duration.short}),[`&.${me.loading}`]:{color:"transparent"}}}]}}))),Ee=(0,ae.ZP)("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(j,K)=>{const{ownerState:$}=j;return[K.startIcon,$.loading&&K.startIconLoadingStart,K[`iconSize${(0,de.Z)($.size)}`]]}})((({theme:j})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:j.transitions.create(["opacity"],{duration:j.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...ve]}))),Se=(0,ae.ZP)("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(j,K)=>{const{ownerState:$}=j;return[K.endIcon,$.loading&&K.endIconLoadingEnd,K[`iconSize${(0,de.Z)($.size)}`]]}})((({theme:j})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:j.transitions.create(["opacity"],{duration:j.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...ve]}))),Ce=(0,ae.ZP)("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(j,K)=>K.loadingIndicator})((({theme:j})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(j.vars||j).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]}))),_e=(0,ae.ZP)("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(j,K)=>K.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),Te=ee.forwardRef((function Button(j,K){const $=ee.useContext(fe),re=ee.useContext(ye),ie=resolveProps($,j),ae=(0,le.i)({props:ie,name:"MuiButton"}),{children:se,color:ce="primary",component:pe="button",className:ge,disabled:he=!1,disableElevation:me=!1,disableFocusRipple:ve=!1,endIcon:Te,focusVisibleClassName:Ae,fullWidth:Ie=!1,id:Ne,loading:Oe=null,loadingIndicator:we,loadingPosition:De="center",size:xe="medium",startIcon:je,type:Le,variant:ke="text",...Pe}=ae,Re=(0,oe.Z)(Ne),ze=we??(0,be.jsx)(ue.Z,{"aria-labelledby":Re,color:"inherit",size:16}),Ue={...ae,color:ce,component:pe,disabled:he,disableElevation:me,disableFocusRipple:ve,fullWidth:Ie,loading:Oe,loadingIndicator:ze,loadingPosition:De,size:xe,type:Le,variant:ke},Ge=(j=>{const{color:K,disableElevation:$,fullWidth:ee,size:te,variant:re,loading:oe,loadingPosition:ie,classes:ae}=j,se={root:["root",oe&&"loading",re,`${re}${(0,de.Z)(K)}`,`size${(0,de.Z)(te)}`,`${re}Size${(0,de.Z)(te)}`,`color${(0,de.Z)(K)}`,$&&"disableElevation",ee&&"fullWidth",oe&&`loadingPosition${(0,de.Z)(ie)}`],startIcon:["icon","startIcon",`iconSize${(0,de.Z)(te)}`],endIcon:["icon","endIcon",`iconSize${(0,de.Z)(te)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},le=(0,ne.Z)(se,getButtonUtilityClass,ae);return{...ae,...le}})(Ue),Be=(je||Oe&&"start"===De)&&(0,be.jsx)(Ee,{className:Ge.startIcon,ownerState:Ue,children:je||(0,be.jsx)(_e,{className:Ge.loadingIconPlaceholder,ownerState:Ue})}),Ze=(Te||Oe&&"end"===De)&&(0,be.jsx)(Se,{className:Ge.endIcon,ownerState:Ue,children:Te||(0,be.jsx)(_e,{className:Ge.loadingIconPlaceholder,ownerState:Ue})}),Ye=re||"",He="boolean"==typeof Oe?(0,be.jsx)("span",{className:Ge.loadingWrapper,style:{display:"contents"},children:Oe&&(0,be.jsx)(Ce,{className:Ge.loadingIndicator,ownerState:Ue,children:ze})}):null;return(0,be.jsxs)(Me,{ownerState:Ue,className:(0,te.Z)($.className,Ge.root,ge,Ye),component:pe,disabled:he||Oe,focusRipple:!ve,focusVisibleClassName:(0,te.Z)(Ge.focusVisible,Ae),ref:K,type:Le,id:Oe?Re:Ne,...Pe,classes:Ge,children:[Be,"end"!==De&&He,se,"end"===De&&He,Ze]})}))},9495:(j,K,$)=>{"use strict";$.d(K,{Z:()=>we});var ee=$(7363),te=$.n(ee),ne=$(7726),re=$(9916);function isFocusVisible(j){try{return j.matches(":focus-visible")}catch(j){0}return!1}var oe=$(7843),ie=$(2893),ae=$(8080),se=$(8376),le=$(2035);class LazyRipple{static create(){return new LazyRipple}static use(){const j=(0,le.Z)(LazyRipple.create).current,[K,$]=ee.useState(!1);return j.shouldMount=K,j.setShouldMount=$,ee.useEffect(j.mountEffect,[K]),j}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=function createControlledPromise(){let j,K;const $=new Promise((($,ee)=>{j=$,K=ee}));return $.resolve=j,$.reject=K,$}(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&null!==this.ref.current&&(this.didMount=!0,this.mounted.resolve())};start(...j){this.mount().then((()=>this.ref.current?.start(...j)))}stop(...j){this.mount().then((()=>this.ref.current?.stop(...j)))}pulsate(...j){this.mount().then((()=>this.ref.current?.pulsate(...j)))}}var ce=$(9451);function _extends(){return _extends=Object.assign?Object.assign.bind():function(j){for(var K=1;K<arguments.length;K++){var $=arguments[K];for(var ee in $)({}).hasOwnProperty.call($,ee)&&(j[ee]=$[ee])}return j},_extends.apply(null,arguments)}var ue=$(1936),de=$(5175);function getChildMapping(j,K){var $=Object.create(null);return j&&ee.Children.map(j,(function(j){return j})).forEach((function(j){$[j.key]=function mapper(j){return K&&(0,ee.isValidElement)(j)?K(j):j}(j)})),$}function getProp(j,K,$){return null!=$[K]?$[K]:j.props[K]}function getNextChildMapping(j,K,$){var te=getChildMapping(j.children),ne=function mergeChildMappings(j,K){function getValueForKey($){return $ in K?K[$]:j[$]}j=j||{},K=K||{};var $,ee=Object.create(null),te=[];for(var ne in j)ne in K?te.length&&(ee[ne]=te,te=[]):te.push(ne);var re={};for(var oe in K){if(ee[oe])for($=0;$<ee[oe].length;$++){var ie=ee[oe][$];re[ee[oe][$]]=getValueForKey(ie)}re[oe]=getValueForKey(oe)}for($=0;$<te.length;$++)re[te[$]]=getValueForKey(te[$]);return re}(K,te);return Object.keys(ne).forEach((function(re){var oe=ne[re];if((0,ee.isValidElement)(oe)){var ie=re in K,ae=re in te,se=K[re],le=(0,ee.isValidElement)(se)&&!se.props.in;!ae||ie&&!le?ae||!ie||le?ae&&ie&&(0,ee.isValidElement)(se)&&(ne[re]=(0,ee.cloneElement)(oe,{onExited:$.bind(null,oe),in:se.props.in,exit:getProp(oe,"exit",j),enter:getProp(oe,"enter",j)})):ne[re]=(0,ee.cloneElement)(oe,{in:!1}):ne[re]=(0,ee.cloneElement)(oe,{onExited:$.bind(null,oe),in:!0,exit:getProp(oe,"exit",j),enter:getProp(oe,"enter",j)})}})),ne}var pe=Object.values||function(j){return Object.keys(j).map((function(K){return j[K]}))},ge=function(j){function TransitionGroup(K,$){var ee,te=(ee=j.call(this,K,$)||this).handleExited.bind(function _assertThisInitialized(j){if(void 0===j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}(ee));return ee.state={contextValue:{isMounting:!0},handleExited:te,firstRender:!0},ee}(0,ue.Z)(TransitionGroup,j);var K=TransitionGroup.prototype;return K.componentDidMount=function componentDidMount(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},K.componentWillUnmount=function componentWillUnmount(){this.mounted=!1},TransitionGroup.getDerivedStateFromProps=function getDerivedStateFromProps(j,K){var $,te,ne=K.children,re=K.handleExited;return{children:K.firstRender?($=j,te=re,getChildMapping($.children,(function(j){return(0,ee.cloneElement)(j,{onExited:te.bind(null,j),in:!0,appear:getProp(j,"appear",$),enter:getProp(j,"enter",$),exit:getProp(j,"exit",$)})}))):getNextChildMapping(j,ne,re),firstRender:!1}},K.handleExited=function handleExited(j,K){var $=getChildMapping(this.props.children);j.key in $||(j.props.onExited&&j.props.onExited(K),this.mounted&&this.setState((function(K){var $=_extends({},K.children);return delete $[j.key],{children:$}})))},K.render=function render(){var j=this.props,K=j.component,$=j.childFactory,ee=(0,ce.Z)(j,["component","childFactory"]),ne=this.state.contextValue,re=pe(this.state.children).map($);return delete ee.appear,delete ee.enter,delete ee.exit,null===K?te().createElement(de.Z.Provider,{value:ne},re):te().createElement(de.Z.Provider,{value:ne},te().createElement(K,ee,re))},TransitionGroup}(te().Component);ge.propTypes={},ge.defaultProps={component:"div",childFactory:function childFactory(j){return j}};const he=ge;var me=$(3968),fe=$(6502),ye=$(7514);const be=function Ripple(j){const{className:K,classes:$,pulsate:te=!1,rippleX:re,rippleY:oe,rippleSize:ie,in:ae,onExited:se,timeout:le}=j,[ce,ue]=ee.useState(!1),de=(0,ne.Z)(K,$.ripple,$.rippleVisible,te&&$.ripplePulsate),pe={width:ie,height:ie,top:-ie/2+oe,left:-ie/2+re},ge=(0,ne.Z)($.child,ce&&$.childLeaving,te&&$.childPulsate);return ae||ce||ue(!0),ee.useEffect((()=>{if(!ae&&null!=se){const j=setTimeout(se,le);return()=>{clearTimeout(j)}}}),[se,ae,le]),(0,ye.jsx)("span",{className:de,style:pe,children:(0,ye.jsx)("span",{className:ge})})};var ve=$(4685);const Me=(0,ve.Z)("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Ee=fe.F4`
|
|
3
3
|
0% {
|
|
4
4
|
transform: scale(0);
|
|
5
5
|
opacity: 0.1;
|