File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/im/install/js/im/provider/pull/dist/registry.bundle.min.js
Back
this.BX=this.BX||{};this.BX.Messenger=this.BX.Messenger||{};this.BX.Messenger.Provider=this.BX.Messenger.Provider||{};(function(e,t,s,a,i,r){"use strict";function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,a)}return s}function o(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?n(Object(s),!0).forEach((function(t){babelHelpers.defineProperty(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var d=function(){babelHelpers.createClass(e,null,[{key:"create",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new this(t)}}]);function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,e);if(babelHelpers["typeof"](t.controller)==="object"&&t.controller){this.controller=t.controller}if(babelHelpers["typeof"](t.store)==="object"&&t.store){this.store=t.store}this.option=babelHelpers["typeof"](t.store)==="object"&&t.store?t.store:{};if(!(babelHelpers["typeof"](this.option.handlingDialog)==="object"&&this.option.handlingDialog&&this.option.handlingDialog.chatId&&this.option.handlingDialog.dialogId)){this.option.handlingDialog=false}}babelHelpers.createClass(e,[{key:"getModuleId",value:function e(){return"im"}},{key:"getSubscriptionType",value:function e(){return r.PullClient.SubscriptionType.Server}},{key:"skipExecute",value:function e(t){var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(!s.optionImportant){if(this.option.skip){a.Logger.info("Pull: command skipped while loading messages",t);return true}if(!this.option.handlingDialog){return false}}if(typeof t.chatId!=="undefined"||typeof t.dialogId!=="undefined"){if(typeof t.chatId!=="undefined"&&parseInt(t.chatId)===parseInt(this.option.handlingDialog.chatId)){return false}if(typeof t.dialogId!=="undefined"&&t.dialogId.toString()===this.option.handlingDialog.dialogId.toString()){return false}return true}return false}},{key:"handleMessage",value:function e(t,s){this.handleMessageAdd(t,s)}},{key:"handleMessageChat",value:function e(t,s){this.handleMessageAdd(t,s)}},{key:"handleMessageAdd",value:function e(r,n){var d=this;a.Logger.warn("handleMessageAdd",r);if(this.skipExecute(r,n)){return false}var l=this.store.state.messages.collection[r.chatId];if(!l){l=[]}var c=l.find((function(e){if(r.message.templateId&&e.id===r.message.templateId){return true}return e.id===r.message.id}));if(c&&r.message.push){return false}if(r.chat&&r.chat[r.chatId]){var u=this.store.getters["dialogues/getByChatId"](r.chatId);if(!u){var h=Object.assign({},r.chat[r.chatId],{dialogId:r.dialogId});this.store.dispatch("dialogues/set",h)}else{this.store.dispatch("dialogues/update",{dialogId:r.dialogId,fields:r.chat[r.chatId]})}}var f=this.store.getters["recent/get"](r.dialogId);if(!f){var p=this.prepareRecentItem(r);this.store.dispatch("recent/set",[p])}else{this.store.dispatch("recent/update",{id:r.dialogId,fields:{lines:r.lines||{id:0},message:{id:r.message.id,text:r.message.textOriginal,date:r.message.date,senderId:r.message.senderId,withFile:typeof r.message.params["FILE_ID"]!=="undefined",withAttach:typeof r.message.params["ATTACH"]!=="undefined"},counter:r.counter}})}if(r.users){this.store.dispatch("users/set",t.VuexBuilderModel.convertToArray(r.users))}if(r.files){var g=this.controller.application.prepareFilesBeforeSave(t.VuexBuilderModel.convertToArray(r.files));g.forEach((function(e){if(g.length===1&&r.message.templateFileId&&d.store.state.files.index[r.chatId]&&d.store.state.files.index[r.chatId][r.message.templateFileId]){d.store.dispatch("files/update",{id:r.message.templateFileId,chatId:r.chatId,fields:e}).then((function(){i.EventEmitter.emit(s.EventType.dialog.scrollToBottom,{chatId:r.chatId,cancelIfScrollChange:true})}))}else{d.store.dispatch("files/set",e)}}))}if(c){a.Logger.warn("New message pull handler: we already have this message",r.message);this.store.dispatch("messages/update",{id:c.id,chatId:c.chatId,fields:o(o({},r.message),{},{sending:false,error:false})}).then((function(){if(!r.message.push){i.EventEmitter.emit(s.EventType.dialog.scrollToBottom,{chatId:c.chatId,cancelIfScrollChange:r.message.senderId!==d.controller.application.getUserId()})}}))}else if(this.controller.application.isUnreadMessagesLoaded()){a.Logger.warn("New message pull handler: we dont have this message",r.message);this.store.dispatch("messages/setAfter",o(o({},r.message),{},{unread:true})).then((function(){if(!r.message.push){i.EventEmitter.emit(s.EventType.dialog.newMessage,{chatId:r.message.chatId,messageId:r.message.id})}}))}this.controller.application.stopOpponentWriting({dialogId:r.dialogId,userId:r.message.senderId});if(r.message.senderId===this.controller.application.getUserId()&&this.controller.application.isUnreadMessagesLoaded()){if(this.store.state.dialogues.collection[r.dialogId]&&this.store.state.dialogues.collection[r.dialogId].counter!==0){this.controller.restClient.callMethod("im.dialog.read",{dialog_id:r.dialogId}).then((function(){d.store.dispatch("messages/readMessages",{chatId:r.chatId}).then((function(e){i.EventEmitter.emit(s.EventType.dialog.scrollToBottom,{chatId:r.chatId,cancelIfScrollChange:false});d.store.dispatch("dialogues/update",{dialogId:r.dialogId,fields:{counter:0}})}))}))}}else if(r.message.senderId!==this.controller.application.getUserId()){this.store.dispatch("dialogues/increaseCounter",{dialogId:r.dialogId,count:1})}this.store.dispatch("dialogues/update",{dialogId:r.dialogId,fields:{lastMessageId:r.message.id}});this.store.dispatch("dialogues/increaseMessageCounter",{dialogId:r.dialogId,count:1})}},{key:"handleMessageUpdate",value:function e(t,s,a){this.execMessageUpdateOrDelete(t,s,a)}},{key:"handleMessageDelete",value:function e(t,s,a){this.execMessageUpdateOrDelete(t,s,a)}},{key:"execMessageUpdateOrDelete",value:function e(t,a,r){if(this.skipExecute(t,a)){return false}this.controller.application.stopOpponentWriting({dialogId:t.dialogId,userId:t.senderId});this.store.dispatch("messages/update",{id:t.id,chatId:t.chatId,fields:{text:r==="messageUpdate"?t.text:"",textOriginal:r==="messageUpdate"?t.textOriginal:"",params:t.params,blink:true}}).then((function(){i.EventEmitter.emit(s.EventType.dialog.scrollToBottom,{chatId:t.chatId,cancelIfScrollChange:true})}));var n=this.store.getters["recent/get"](t.dialogId);if(r==="messageUpdate"&&n.element&&n.element.message.id===t.id){this.store.dispatch("recent/update",{id:t.dialogId,fields:{message:{id:t.id,text:t.text,date:n.element.message.date}}})}if(r==="messageDelete"&&n.element&&n.element.message.id===t.id){this.store.dispatch("recent/update",{id:t.dialogId,fields:{message:{id:t.id,text:"Message deleted",date:n.element.message.date}}})}}},{key:"handleMessageDeleteComplete",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.store.dispatch("messages/delete",{id:t.id,chatId:t.chatId});this.controller.application.stopOpponentWriting({dialogId:t.dialogId,userId:t.senderId,action:false})}},{key:"handleMessageLike",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.store.dispatch("messages/update",{id:t.id,chatId:t.chatId,fields:{params:{LIKE:t.users}}})}},{key:"handleChatOwner",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.store.dispatch("dialogues/update",{dialogId:t.dialogId,fields:{ownerId:t.userId}})}},{key:"handleChatManagers",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.store.dispatch("dialogues/update",{dialogId:t.dialogId,fields:{managerList:t.list}})}},{key:"handleChatUpdateParams",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.store.dispatch("dialogues/update",{dialogId:t.dialogId,fields:t.params})}},{key:"handleChatUserAdd",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.store.dispatch("dialogues/update",{dialogId:t.dialogId,fields:{userCounter:t.userCount}})}},{key:"handleChatUserLeave",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.store.dispatch("dialogues/update",{dialogId:t.dialogId,fields:{userCounter:t.userCount}})}},{key:"handleMessageParamsUpdate",value:function e(t,a){if(this.skipExecute(t,a)){return false}this.store.dispatch("messages/update",{id:t.id,chatId:t.chatId,fields:{params:t.params}}).then((function(){i.EventEmitter.emit(s.EventType.dialog.scrollToBottom,{chatId:t.chatId,cancelIfScrollChange:true})}))}},{key:"handleStartWriting",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.controller.application.startOpponentWriting(t)}},{key:"handleReadMessage",value:function e(t,s){var a=this;if(this.skipExecute(t,s)){return false}this.store.dispatch("messages/readMessages",{chatId:t.chatId,readId:t.lastId}).then((function(e){a.store.dispatch("dialogues/update",{dialogId:t.dialogId,fields:{counter:t.counter}})}));this.store.dispatch("recent/update",{id:t.dialogId,fields:{counter:t.counter}})}},{key:"handleReadMessageChat",value:function e(t,s){this.handleReadMessage(t,s)}},{key:"handleReadMessageOpponent",value:function e(t,s){this.execReadMessageOpponent(t,s)}},{key:"handleReadMessageChatOpponent",value:function e(t,s){this.execReadMessageOpponent(t,s)}},{key:"execReadMessageOpponent",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.store.dispatch("dialogues/updateReaded",{dialogId:t.dialogId,userId:t.userId,userName:t.userName,messageId:t.lastId,date:t.date,action:true});var a=this.store.getters["recent/get"](t.dialogId);if(a){var i=a.element.message;this.store.dispatch("recent/update",{id:t.dialogId,fields:{counter:t.counter,message:o(o({},i),{},{status:"delivered"})}})}}},{key:"handleUnreadMessageOpponent",value:function e(t,s){this.execUnreadMessageOpponent(t,s)}},{key:"handleUnreadMessageChatOpponent",value:function e(t,s){this.execUnreadMessageOpponent(t,s)}},{key:"execUnreadMessageOpponent",value:function e(t,s){if(this.skipExecute(t,s)){return false}this.store.dispatch("dialogues/updateReaded",{dialogId:t.dialogId,userId:t.userId,action:false})}},{key:"handleFileUpload",value:function e(a,r){if(this.skipExecute(a,r)){return false}this.store.dispatch("files/set",this.controller.application.prepareFilesBeforeSave(t.VuexBuilderModel.convertToArray({file:a.fileParams}))).then((function(){i.EventEmitter.emit(s.EventType.dialog.scrollToBottom,{cancelIfScrollChange:true})}))}},{key:"handleChatPin",value:function e(t,s){this.store.dispatch("recent/pin",{id:t.dialogId,action:t.active})}},{key:"handleChatHide",value:function e(t,s){this.store.dispatch("recent/delete",{id:t.dialogId})}},{key:"handleChatMuteNotify",value:function e(t,s){var a=this.store.getters["dialogues/get"](t.dialogId);if(!a){return false}var i=a.muteList;var r=[];var n=this.store.state.application.common.userId;if(t.mute){r=[].concat(babelHelpers.toConsumableArray(i),[n])}else{r=i.filter((function(e){return e!==n}))}this.store.dispatch("dialogues/update",{dialogId:t.dialogId,fields:{muteList:r}})}},{key:"handleReadNotifyList",value:function e(t,s){this.store.dispatch("recent/update",{id:"notify",fields:{counter:t.counter}})}},{key:"handleUserInvite",value:function e(t,s){if(!t.invited){this.store.dispatch("users/update",{id:t.userId,fields:t.user})}}},{key:"prepareRecentItem",value:function e(t){var s="user";if(t.dialogId.toString().startsWith("chat")){s="chat"}t.dialogId.toString().startsWith("chat");var a=s==="chat"?t.chat[t.chatId].name:t.users[t.dialogId].name;var i=t.chat[t.chatId]?t.chat[t.chatId]:{};if(!t.users){t.users={}}var r=t.users[t.dialogId]?t.users[t.dialogId]:{};var n=s==="user"?t.dialogId:0;return{id:t.dialogId,type:s,title:a,counter:t.counter,chatId:t.chatId,chat:i,user:r,userId:n,message:{id:t.message.id,text:t.message.textOriginal,date:t.message.date,senderId:t.message.senderId,withFile:typeof t.message.params["FILE_ID"]!=="undefined",withAttach:typeof t.message.params["ATTACH"]!=="undefined"}}}}]);return e}();function l(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,a)}return s}function c(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?l(Object(s),!0).forEach((function(t){babelHelpers.defineProperty(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):l(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var u=function(){babelHelpers.createClass(e,null,[{key:"create",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new this(t)}}]);function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,e);if(babelHelpers["typeof"](t.application)==="object"&&t.application){this.application=t.application}if(babelHelpers["typeof"](t.controller)==="object"&&t.controller){this.controller=t.controller}if(babelHelpers["typeof"](t.store)==="object"&&t.store){this.store=t.store}this.option=babelHelpers["typeof"](t.store)==="object"&&t.store?t.store:{}}babelHelpers.createClass(e,[{key:"getModuleId",value:function e(){return"im"}},{key:"getSubscriptionType",value:function e(){return r.PullClient.SubscriptionType.Server}},{key:"handleChatUserAdd",value:function e(t){if(t.dialogId!==this.store.state.application.dialog.dialogId){return false}var s=Object.values(t.users).map((function(e){return c(c({},e),{},{lastActivityDate:new Date})}));this.store.commit("conference/common",{userCount:t.userCount});this.store.dispatch("users/set",s);this.store.dispatch("conference/setUsers",{users:s.map((function(e){return e.id}))})}},{key:"handleChatUserLeave",value:function e(t){if(t.dialogId!==this.store.state.application.dialog.dialogId){return false}if(t.userId===this.controller.getUserId()){this.application.kickFromCall()}this.store.commit("conference/common",{userCount:t.userCount});this.store.dispatch("conference/removeUsers",{users:[t.userId]})}},{key:"handleCallUserNameUpdate",value:function e(t){var s=this.store.getters["users/get"](t.userId);if(!s){this.store.dispatch("users/set",{id:t.userId,lastActivityDate:new Date})}this.store.dispatch("users/update",{id:t.userId,fields:{name:t.name,lastActivityDate:new Date}})}},{key:"handleVideoconfShareUpdate",value:function e(t){if(t.dialogId===this.store.state.application.dialog.dialogId){this.store.dispatch("dialogues/update",{dialogId:t.dialogId,fields:{public:{code:t.newCode,link:t.newLink}}});this.application.changeVideoconfUrl(t.newLink)}}},{key:"handleMessageChat",value:function e(t){this.application.sendNewMessageNotify(t)}},{key:"handleChatRename",value:function e(t){if(t.chatId!==this.application.getChatId()){return false}this.store.dispatch("conference/setConferenceTitle",{conferenceTitle:t.name})}},{key:"handleConferenceUpdate",value:function e(t){if(t.chatId!==this.application.getChatId()){return false}if(t.isBroadcast!==""){this.store.dispatch("conference/setBroadcastMode",{broadcastMode:t.isBroadcast})}if(t.presenters.length>0){this.store.dispatch("conference/setPresenters",{presenters:t.presenters,replace:true})}}}]);return e}();function h(e,t){var s=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!s){if(Array.isArray(e)||(s=f(e))||t&&e&&typeof e.length==="number"){if(s)e=s;var a=0;var i=function e(){};return{s:i,n:function t(){if(a>=e.length)return{done:true};return{done:false,value:e[a++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r=true,n=false,o;return{s:function t(){s=s.call(e)},n:function e(){var t=s.next();r=t.done;return t},e:function e(t){n=true;o=t},f:function e(){try{if(!r&&s["return"]!=null)s["return"]()}finally{if(n)throw o}}}}function f(e,t){if(!e)return;if(typeof e==="string")return p(e,t);var s=Object.prototype.toString.call(e).slice(8,-1);if(s==="Object"&&e.constructor)s=e.constructor.name;if(s==="Map"||s==="Set")return Array.from(e);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return p(e,t)}function p(e,t){if(t==null||t>e.length)t=e.length;for(var s=0,a=new Array(t);s<t;s++){a[s]=e[s]}return a}var g=function(){babelHelpers.createClass(e,null,[{key:"create",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new this(t)}}]);function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,e);if(babelHelpers["typeof"](t.application)==="object"&&t.application){this.application=t.application}if(babelHelpers["typeof"](t.controller)==="object"&&t.controller){this.controller=t.controller}if(babelHelpers["typeof"](t.store)==="object"&&t.store){this.store=t.store}this.option=babelHelpers["typeof"](t.store)==="object"&&t.store?t.store:{}}babelHelpers.createClass(e,[{key:"getModuleId",value:function e(){return"im"}},{key:"getSubscriptionType",value:function e(){return r.PullClient.SubscriptionType.Server}},{key:"handleNotifyAdd",value:function e(t,s){if(s.server_time_ago>30||t.onlyFlash===true){return false}var a=this.store.getters["users/get"](t.userId);if(!a){var i=[];i.push({id:t.userId,avatar:t.userAvatar,color:t.userColor,name:t.userName});this.store.dispatch("users/set",i)}this.store.dispatch("notifications/add",{data:t});this.store.dispatch("notifications/setCounter",{unreadTotal:t.counter});this.store.dispatch("recent/update",{id:"notify",fields:{message:{id:t.id,text:t.text,date:t.date},counter:t.counter}})}},{key:"handleNotifyConfirm",value:function e(t,s){if(s.server_time_ago>30){return false}this.store.dispatch("notifications/delete",{id:t.id});this.store.dispatch("notifications/setCounter",{unreadTotal:t.counter});this.updateRecentListOnDelete(t.counter)}},{key:"handleNotifyRead",value:function e(t,s){var a=this;if(s.server_time_ago>30){return false}t.list.forEach((function(e){a.store.dispatch("notifications/read",{ids:[e],action:true})}));this.store.dispatch("notifications/setCounter",{unreadTotal:t.counter});this.store.dispatch("recent/update",{id:"notify",fields:{counter:t.counter}})}},{key:"handleNotifyUnread",value:function e(t,s){var a=this;if(s.server_time_ago>30){return false}t.list.forEach((function(e){a.store.dispatch("notifications/read",{ids:[e],action:false})}));this.store.dispatch("notifications/setCounter",{unreadTotal:t.counter});this.store.dispatch("recent/update",{id:"notify",fields:{counter:t.counter}})}},{key:"handleNotifyDelete",value:function e(t,s){var a=this;if(s.server_time_ago>30){return false}var i=Object.keys(t.id).map((function(e){return parseInt(e,10)}));i.forEach((function(e){a.store.dispatch("notifications/delete",{id:e})}));this.updateRecentListOnDelete(t.counter);this.store.dispatch("notifications/setCounter",{unreadTotal:t.counter})}},{key:"updateRecentListOnDelete",value:function e(t){var s;var a=this.getLatest();if(a!==null){s={id:a.id,text:a.text,date:a.date}}else{var i=this.store.getters["recent/get"]("notify");if(i===false){return}s=i.element.message;s.text=this.controller.localize["IM_NOTIFICATIONS_DELETED_ITEM_STUB"]}this.store.dispatch("recent/update",{id:"notify",fields:{message:s,counter:t}})}},{key:"getLatest",value:function e(){var t={id:0};var s=h(this.store.state.notifications.collection),a;try{for(s.s();!(a=s.n()).done;){var i=a.value;if(i.id>t.id){t=i}}}catch(e){s.e(e)}finally{s.f()}if(t.id===0){return null}return t}}]);return e}();e.ImBasePullHandler=d;e.ImCallPullHandler=u;e.ImNotificationsPullHandler=g})(this.BX.Messenger.Provider.Pull=this.BX.Messenger.Provider.Pull||{},BX,BX.Messenger.Const,BX.Messenger.Lib,BX.Event,BX); //# sourceMappingURL=registry.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings