File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/js/im/component/notifications/dist/notifications.bundle.min.js
Back
this.BX=this.BX||{};(function(t,e,i,n,s,o,a,r,c,l,u,d,f,h,p,m,g){"use strict";var v={props:["listItem"],data:function t(){return{quickAnswerText:"",quickAnswerResultMessage:"",showQuickAnswer:false,isSendingQuickAnswer:false,successSentQuickAnswer:false}},methods:{toggleQuickAnswer:function t(){var e=this;if(this.successSentQuickAnswer){this.showQuickAnswer=true;this.successSentQuickAnswer=false;this.quickAnswerResultMessage=""}else{this.showQuickAnswer=!this.showQuickAnswer}if(this.showQuickAnswer){this.$nextTick((function(){e.$refs["input"].focus()}))}},sendQuickAnswer:function t(e){var i=this;if(this.quickAnswerText.trim()===""){return}this.isSendingQuickAnswer=true;var n=e.item.id;this.$Bitrix.RestClient.get().callMethod("im.notify.answer",{notify_id:n,answer_text:this.quickAnswerText}).then((function(t){i.quickAnswerResultMessage=t.data().result_message[0];i.successSentQuickAnswer=true;i.quickAnswerText="";i.isSendingQuickAnswer=false}))["catch"]((function(t){console.error(t);i.quickAnswerResultMessage=result.data().result_message[0];i.isSendingQuickAnswer=false}))}},template:'\n\t\t<div class="bx-notifier-item-text-vue">\n\t\t\t<div class="bx-notifier-answer-link-vue">\n\t\t\t\t<span class="bx-notifier-answer-reply bx-messenger-ajax" @click="toggleQuickAnswer()" @dblclick.stop>\n\t\t\t\t\t{{ $Bitrix.Loc.getMessage(\'IM_NOTIFICATIONS_QUICK_ANSWER_BUTTON\') }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<transition name="quick-answer-slide">\n\t\t\t\t<div v-if="showQuickAnswer && !successSentQuickAnswer" class="bx-notifier-answer-box-vue">\n\t\t\t\t\t<span v-if="isSendingQuickAnswer" class="bx-notifier-answer-progress-vue bx-messenger-content-load-img"></span>\n\t\t\t\t\t<span class="bx-notifier-answer-input">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype="text"\n\t\t\t\t\t\t\tref="input"\n\t\t\t\t\t\t\tautofocus\n\t\t\t\t\t\t\tclass="bx-messenger-input"\n\t\t\t\t\t\t\tv-model="quickAnswerText"\n\t\t\t\t\t\t\t:disabled="isSendingQuickAnswer"\n\t\t\t\t\t\t\t@keyup.enter="sendQuickAnswer({item: listItem, event: $event})"\n\t\t\t\t\t\t>\n\t\t\t\t\t</span>\n\t\t\t\t\t<div class="bx-notifier-answer-button" @click="sendQuickAnswer({item: listItem, event: $event})"></div>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t\t<div v-if="successSentQuickAnswer" class="bx-notifier-answer-text-vue">\n\t\t\t\t{{ quickAnswerResultMessage }}\n\t\t\t</div>\n\t\t</div>\n\t'};var I={props:{listItem:{type:Object,required:true},isExtranet:{type:Boolean,default:false}},computed:{moreUsers:function t(){var e=this.$Bitrix.Loc.getMessage("IM_NOTIFICATIONS_MORE_USERS").split("#COUNT#");return{start:e[0],end:this.listItem.params.USERS.length+e[1]}},isMoreUsers:function t(){return this.listItem.params.hasOwnProperty("USERS")&&this.listItem.params.USERS.length>0},isAbleToDelete:function t(){return this.listItem.sectionCode===p.NotificationTypesCodes.simple}},methods:{onDeleteClick:function t(e){if(e.item.sectionCode===p.NotificationTypesCodes.simple){this.$emit("deleteClick",e)}},onMoreUsersClick:function t(e){if(e.users){this.$emit("moreUsersClick",{event:e.event,content:{type:"USERS",value:e.users}})}},onUserTitleClick:function t(e){if(window.top["BXIM"]&&e.userId>0){window.top["BXIM"].openMessenger(e.userId)}}},template:'\n\t\t<div class="bx-im-notifications-item-content-header">\n\t\t\t<div v-if="listItem.title" class="bx-im-notifications-item-header-title">\n\t\t\t\t<span\n\t\t\t\t\tv-if="!listItem.systemType"\n\t\t\t\t\t@click.prevent="onUserTitleClick({userId: listItem.authorId, event: $event})"\n\t\t\t\t\tclass="bx-im-notifications-item-header-title-text-link"\n\t\t\t\t\t:class="[isExtranet ? \'--extranet\' : \'\']"\n\t\t\t\t>\n\t\t\t\t\t{{ listItem.title.value }}\n\t\t\t\t</span>\n\t\t\t\t<span v-else class="bx-im-notifications-item-header-title-text">{{ listItem.title.value }}</span>\n\t\t\t\t<span\n\t\t\t\t\tv-if="isMoreUsers && !listItem.systemType"\n\t\t\t\t\tclass="bx-im-notifications-item-header-more-users"\n\t\t\t\t>\n\t\t\t\t\t{{ moreUsers.start }}\n\t\t\t\t\t<span class="bx-messenger-ajax" @click="onMoreUsersClick({users: listItem.params.USERS, event: $event})">\n\t\t\t\t\t\t{{ moreUsers.end }}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div class="bx-im-notifications-item-content-header-right">\n\t\t\t\t<div class="bx-im-notifications-item-header-date">\n\t\t\t\t\t{{ listItem.date.value }}\n\t\t\t\t</div>\n\t\t\t\t<span\n\t\t\t\t\tv-if="isAbleToDelete"\n\t\t\t\t\tclass="bx-im-notifications-item-header-delete"\n\t\t\t\t\t@click="onDeleteClick({item: listItem, event: $event})">\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t'};var b={template:'\n\t\t<div style="display: flex; width: 100%;">\n\t\t\t<div class="bx-im-notifications-item-image-wrap">\n\t\t\t\t<div class="bx-im-notifications-item-image bx-im-notifications-item-placeholder-image"></div>\n\t\t\t</div>\n\t\t\t<div class="bx-im-notifications-item-content bx-im-notifications-skeleton">\n\t\t\t\t<div class="bx-im-notifications-item-content-header">\n\t\t\t\t\t<div class="bx-im-notifications-item-placeholder-title"></div>\n\t\t\t\t</div>\n\t\t\t\t<div class="bx-im-notifications-item-content-middle">\n\t\t\t\t\t<div class="bx-im-notifications-item-bottom-subtitle">\n\t\t\t\t\t\t<div class="bx-im-notifications-item-placeholder-subtitle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="bx-im-notifications-item-content-bottom">\n\t\t\t\t\t<div class="bx-im-notifications-item-bottom-subtitle">\n\t\t\t\t\t\t<div class="bx-im-notifications-item-placeholder-subtitle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t'};var y={components:{NotificationQuickAnswer:v,NotificationItemHeader:I,NotificationPlaceholder:b},props:["rawListItem","searchMode"],data:function t(){return{menuId:"popup-window-content-bx-messenger-popup-notify"}},computed:{NotificationTypesCodes:function t(){return p.NotificationTypesCodes},listItem:function t(){return{id:this.rawListItem.id,type:this.rawListItem.type,sectionCode:this.rawListItem.sectionCode,authorId:this.rawListItem.authorId,systemType:this.rawListItem.type===4||this.rawListItem.authorId===0&&this.avatar==="",title:{value:this.userTitle},subtitle:{value:this.rawListItem.textConverted},avatar:{url:this.avatar,color:this.defaultAvatarColor},params:this.rawListItem.params||{},notifyButtons:this.rawListItem.notifyButtons||undefined,unread:this.rawListItem.unread,settingName:this.rawListItem.settingName,date:{value:h.Utils.date.format(this.rawListItem.date,null,this.$Bitrix.Loc.getMessages())}}},isRealItem:function t(){return this.rawListItem.sectionCode!==p.NotificationTypesCodes.placeholder},isNeedQuickAnswer:function t(){return this.listItem.params.CAN_ANSWER&&this.listItem.params.CAN_ANSWER==="Y"},userTitle:function t(){if(this.isRealItem&&this.rawListItem.authorId>0){return this.userData.name}else if(this.isRealItem&&this.rawListItem.authorId===0){return this.rawListItem.title}else{return""}},avatar:function t(){var t="";if(this.isRealItem&&this.rawListItem.authorId>0){t=this.userData.avatar}else if(this.isRealItem&&this.rawListItem.authorId===0){return""}return t},defaultAvatarColor:function t(){if(this.rawListItem.authorId<=0){return""}return this.userData.color},userData:function t(){return this.$store.getters["users/get"](this.rawListItem.authorId,true)},isExtranet:function t(){return this.userData.extranet},avatarStyles:function t(){return{backgroundImage:'url("'+this.listItem.avatar.url+'")'}}},methods:{onDoubleClick:function t(e){if(!this.searchMode&&e.item.sectionCode===p.NotificationTypesCodes.simple){this.$emit("dblclick",e)}},onButtonsClick:function t(e){if(e.action==="COMMAND"){this.$emit("buttonsClick",e)}},onDeleteClick:function t(e){this.$emit("deleteClick",e)},onMoreUsersClick:function t(e){this.$emit("contentClick",e)},onContentClick:function t(e){if(a.Vue.testNode(e.target,{className:"bx-im-mention"})){this.$emit("contentClick",{event:e,content:{type:e.target.dataset.type,value:e.target.dataset.value}})}},onRightClick:function t(e){var i=this;if(h.Utils.platform.isBitrixDesktop()&&e.target.tagName==="A"&&(!e.target.href.startsWith("/desktop_app/")||e.target.href.startsWith("/desktop_app/show.file.php"))){var n=e.target.href;if(!n){return}if(this.menuPopup){this.menuPopup.destroy();this.menuPopup=null}var s=f.PopupManager.getPopupById(this.menuId);if(s){s.destroy()}var o=r.Dom.create("span",{attrs:{className:"bx-messenger-popup-menu-item-text bx-messenger-popup-menu-item"},events:{click:function t(e){BX.desktop.clipboardCopy(n);i.menuPopup.destroy();i.menuPopup=null}},text:this.$Bitrix.Loc.getMessage("IM_NOTIFICATIONS_CONTEXT_COPY_LINK")});this.menuPopup=f.PopupManager.create({id:this.menuId,targetContainer:document.body,className:BX.MessengerTheme.isDark()?"bx-im-notifications-popup-window-dark":"",darkMode:BX.MessengerTheme.isDark(),bindElement:e,offsetLeft:13,autoHide:true,closeByEsc:true,events:{onPopupClose:function t(){return i.menuPopup.destroy()},onPopupDestroy:function t(){return i.menuPopup=null}},content:o});if(!BX.MessengerTheme.isDark()){this.menuPopup.setAngle({})}this.menuPopup.show()}}},template:'\n\t\t<div \n\t\t\tclass="bx-im-notifications-item"\n\t\t\t:class="[listItem.unread && !searchMode ? \'bx-im-notifications-item-unread\' : \'\']"\n\t\t\t@dblclick="onDoubleClick({item: listItem, event: $event})"\n\t\t\t@contextmenu="onRightClick"\n\t\t>\n\t\t\t<template v-if="listItem.sectionCode !== NotificationTypesCodes.placeholder">\n\t\t\t\t<div v-if="listItem.avatar" class="bx-im-notifications-item-image-wrap">\n\t\t\t\t\t<div \n\t\t\t\t\t\tv-if="listItem.avatar.url" \n\t\t\t\t\t\tclass="bx-im-notifications-item-image"\n\t\t\t\t\t\t:style="avatarStyles"\n\t\t\t\t\t></div>\n\t\t\t\t\t<div v-else-if="listItem.systemType" class="bx-im-notifications-item-image bx-im-notifications-image-system"></div>\n\t\t\t\t\t<div \n\t\t\t\t\t\tv-else-if="!listItem.avatar.url" \n\t\t\t\t\t\tclass="bx-im-notifications-item-image bx-im-notifications-item-image-default"\n\t\t\t\t\t\t:style="{backgroundColor: listItem.avatar.color}"\n\t\t\t\t\t\t>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="bx-im-notifications-item-content" @click="onContentClick">\n\t\t\t\t\t<NotificationItemHeader \n\t\t\t\t\t\t:listItem="listItem"\n\t\t\t\t\t\t:isExtranet="isExtranet"\n\t\t\t\t\t\t@deleteClick="onDeleteClick"\n\t\t\t\t\t\t@moreUsersClick="onMoreUsersClick"\n\t\t\t\t\t/>\n\t\t\t\t\t<div v-if="listItem.subtitle.value.length > 0" class="bx-im-notifications-item-content-bottom">\n\t\t\t\t\t\t<div class="bx-im-notifications-item-bottom-subtitle">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t:class="[!listItem.title.value ? \'bx-im-notifications-item-bottom-subtitle-text\' : \'bx-im-notifications-item-bottom-no-subtitle-text\']"\n\t\t\t\t\t\t\t\tv-html="listItem.subtitle.value"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<NotificationQuickAnswer v-if="isNeedQuickAnswer" :listItem="listItem"/>\n\t\t\t\t\t<div v-if="listItem.params[\'ATTACH\']" class="bx-im-notifications-item-content-additional">\n\t\t\t\t\t\t<div v-for="attach in listItem.params[\'ATTACH\']">\n\t\t\t\t\t\t\t<bx-im-view-element-attach :config="attach"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div v-if="listItem.notifyButtons">\n\t\t\t\t\t\t<bx-im-view-element-keyboard @click="onButtonsClick" :buttons="listItem.notifyButtons"/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</template>\n\t\t\t<NotificationPlaceholder v-else-if="listItem.sectionCode === NotificationTypesCodes.placeholder"/>\n\t\t</div>\n\t'};var w={data:function t(){return{placeholderCount:0}},methods:{isReadyToLoadNewPage:function t(e){var i=e.target.scrollHeight-e.target.scrollTop-e.target.clientHeight;return i<200},getLastItemId:function t(e){return e[e.length-1].id},generatePlaceholders:function t(e){var i=[];for(var n=0;n<e;n++){i.push({id:"placeholder".concat(this.placeholderCount),type:p.NotificationTypesCodes.placeholder});this.placeholderCount++}return i},getRestClient:function t(){return this.$Bitrix.RestClient.get()},onContentClick:function t(e){var i=this;this.contentPopupType=e.content.type.toLowerCase();this.contentPopupValue=e.content.value;if(this.popupInstance!=null){this.popupInstance.destroy();this.popupInstance=null}if(this.contentPopupType==="user"||this.contentPopupType==="chat"){var n=!this.isDarkTheme;BXIM.messenger.openPopupExternalData(e.event.target,this.contentPopupType,n,{ID:this.contentPopupValue})}else if(this.contentPopupType==="openlines"){BX.MessengerCommon.linesGetSessionHistory(this.contentPopupValue)}else{var s=f.PopupManager.create({id:"bx-messenger-popup-external-data",targetContainer:document.body,className:this.isDarkTheme?"bx-im-notifications-popup-window-dark":"",bindElement:e.event.target,lightShadow:true,offsetTop:0,offsetLeft:10,autoHide:true,closeByEsc:true,bindOptions:{position:"top"},events:{onPopupClose:function t(){return i.popupInstance.destroy()},onPopupDestroy:function t(){return i.popupInstance=null}}});if(!this.isDarkTheme){s.setAngle({})}this.popupIdSelector="#".concat(s.getContentContainer().id);this.$nextTick((function(){return i.popupInstance=s}))}}},computed:{isDarkTheme:function t(){if(this.darkTheme===undefined){return BX.MessengerTheme.isDark()}return this.darkTheme}}};function T(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function C(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?T(Object(i),!0).forEach((function(e){babelHelpers.defineProperty(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):T(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var N={components:{NotificationItem:y,MountingPortal:u.MountingPortal,Popup:d.Popup},mixins:[w],props:["searchQuery","searchType","searchDate"],data:function t(){return{pageLimit:50,lastId:0,initialDataReceived:false,isLoadingNewPage:false,contentPopupType:"",contentPopupValue:"",popupInstance:null,popupIdSelector:"",searchResultsTotal:0,searchPageLoaded:0,searchPagesRequested:0}},computed:C({remainingPages:function t(){return Math.ceil((this.searchResultsTotal-this.searchResults.length)/this.pageLimit)}},c.Vuex.mapState({notification:function t(e){return e.notifications.collection},searchResults:function t(e){return e.notifications.searchCollection}})),watch:{searchQuery:function t(e){if(e.length>=3||e===""){this.search()}},searchType:function t(){this.search()},searchDate:function t(e){if(BX.parseDate(e)instanceof Date||e===""){this.search()}}},created:function t(){this.searchServerDelayed=h.Utils.debounce(this.getSearchResultsFromServer,1500,this);this.search()},beforeDestroy:function t(){this.$store.dispatch("notifications/deleteSearchResults")},methods:{search:function t(){var e=this;this.resetSearchState();var i=this.notification.filter((function(t){var i=false;if(e.searchQuery.length>=3){i=t.textConverted.toLowerCase().includes(e.searchQuery.toLowerCase());if(!i){return i}}if(e.searchType!==""){i=t.settingName===e.searchType;if(!i){return i}}if(e.searchDate!==""){var n=BX.parseDate(e.searchDate);if(n instanceof Date){var s=new Date(t.date.getTime()).setHours(0,0,0,0);var o=n.setHours(0,0,0,0);i=s===o}}return i}));if(i.length>0){this.$store.dispatch("notifications/setSearchResults",{notification:i,type:"local"})}var n=this.pageLimit-i.length>0;if(n>0){this.drawPlaceholders(this.pageLimit).then((function(){e.searchServerDelayed()}))}else{this.searchServerDelayed()}},getSearchResultsFromServer:function t(){var e=this;var i=this.getSearchRequestParams();this.getRestClient().callMethod("im.notify.history.search",i).then((function(t){l.Logger.warn("im.notify.history.search: first page results",t.data());e.processHistoryData(t.data());e.initialDataReceived=true;e.isLoadingNewPage=false;e.searchPageLoaded++}))["catch"]((function(t){l.Logger.warn("History request error",t)}))},processHistoryData:function t(e){this.$store.dispatch("notifications/clearPlaceholders");if(e.notifications.length<=0){return false}this.lastId=this.getLastItemId(e.notifications);this.searchResultsTotal=e.total_results;this.$store.dispatch("notifications/setSearchResults",{notification:e.notifications});this.$store.dispatch("users/set",e.users);this.isLoadingNewPage=false},loadNextPage:function t(){var e=this;l.Logger.warn("Loading more search results!");var i=this.getSearchRequestParams();this.getRestClient().callMethod("im.notify.history.search",i).then((function(t){l.Logger.warn("im.notify.history.search: new page results",t.data());var i=t.data().users;var n=t.data().notifications;if(!n||n.length===0){e.$store.dispatch("notifications/clearPlaceholders");e.searchResultsTotal=e.searchResults.length;return false}e.lastId=e.getLastItemId(n);e.$store.dispatch("users/set",i);return e.$store.dispatch("notifications/updatePlaceholders",{searchCollection:true,items:n,firstItem:e.searchPageLoaded*e.pageLimit})})).then((function(){e.searchPageLoaded++;return e.onAfterLoadNextPageRequest()}))["catch"]((function(t){e.$store.dispatch("notifications/clearPlaceholders");l.Logger.warn("History request error",t)}))},onAfterLoadNextPageRequest:function t(){l.Logger.warn("onAfterLoadNextPageRequest");if(this.searchPagesRequested>0){l.Logger.warn("We have delayed requests -",this.searchPagesRequested);this.searchPagesRequested--;return this.loadNextPage()}else{l.Logger.warn("No more delayed requests, clearing placeholders");this.$store.dispatch("notifications/clearPlaceholders");this.isLoadingNewPage=false;return true}},getSearchRequestParams:function t(){var e={SEARCH_TEXT:this.searchQuery,SEARCH_TYPE:this.searchType,LIMIT:this.pageLimit,CONVERT_TEXT:"Y"};if(BX.parseDate(this.searchDate)instanceof Date){e["SEARCH_DATE"]=BX.parseDate(this.searchDate).toISOString()}if(this.lastId>0){e["LAST_ID"]=this.lastId}return e},resetSearchState:function t(){this.$store.dispatch("notifications/deleteSearchResults");this.initialDataReceived=false;this.lastId=0;this.isLoadingNewPage=true;this.placeholderCount=0;this.searchPageLoaded=0},drawPlaceholders:function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var i=this.generatePlaceholders(e);return this.$store.dispatch("notifications/setSearchResults",{notification:i})},onScroll:function t(e){var i=this;if(!this.isReadyToLoadNewPage(e)||!this.initialDataReceived||this.remainingPages<=0){return}if(this.isLoadingNewPage){this.drawPlaceholders(this.pageLimit).then((function(){i.searchPagesRequested++;l.Logger.warn("Already loading! Draw placeholders and add request, total - ",i.pagesRequested)}))}else{l.Logger.warn("Starting new request");this.isLoadingNewPage=true;this.drawPlaceholders(this.pageLimit).then((function(){i.loadNextPage()}))}},onButtonsClick:function t(e){var i=this;var n=this.getConfirmRequestParams(e);var s=+n.NOTIFY_ID;var o=this.$store.getters["notifications/getById"](s);this.getRestClient().callMethod("im.notify.confirm",n).then((function(){i.$store.dispatch("notifications/delete",{id:s});if(o.unread){i.$store.dispatch("notifications/setCounter",{unreadTotal:i.unreadCounter-1})}}))["catch"]((function(){i.$store.dispatch("notifications/update",{id:s,fields:{display:true}})}));this.$store.dispatch("notifications/update",{id:s,fields:{display:false}})},onDeleteClick:function t(e){var i=this;var n=+e.item.id;var s=this.$store.getters["notifications/getSearchItemById"](n);this.getRestClient().callMethod("im.notify.delete",{id:n}).then((function(){i.$store.dispatch("notifications/delete",{id:n,searchMode:true});if(!i.isLoadingNewPage&&i.remainingPages>0&&i.searchResults.length<15){i.isLoadingNewPage=true;i.drawPlaceholders(i.pageLimit).then((function(){i.loadNextPage()}))}if(s.unread){i.$store.dispatch("notifications/setCounter",{unreadTotal:i.unreadCounter-1})}}))["catch"]((function(t){console.error(t);i.$store.dispatch("notifications/update",{id:n,fields:{display:true},searchMode:true})}));this.$store.dispatch("notifications/update",{id:n,fields:{display:false},searchMode:true})}},template:'\n\t\t<div class="bx-messenger-notifications-search-results-wrap" @scroll.passive="onScroll">\n\t\t\t<notification-item\n\t\t\t\tv-for="listItem in searchResults"\n\t\t\t\tv-if="listItem.display"\n\t\t\t\t:key="listItem.id"\n\t\t\t\t:data-id="listItem.id"\n\t\t\t\t:rawListItem="listItem"\n\t\t\t\tsearchMode="true"\n\t\t\t\t@buttonsClick="onButtonsClick"\n\t\t\t\t@contentClick="onContentClick"\n\t\t\t\t@deleteClick="onDeleteClick"\n\t\t\t/>\n\t\t\t<mounting-portal :mount-to="popupIdSelector" append v-if="popupInstance">\n\t\t\t\t<popup :type="contentPopupType" :value="contentPopupValue" :popupInstance="popupInstance"/>\n\t\t\t</mounting-portal>\n\t\t\t<div \n\t\t\t\tv-if="searchResults.length <= 0" \n\t\t\t\tstyle="padding-top: 210px; margin-bottom: 20px;"\n\t\t\t\tclass="bx-messenger-box-empty bx-notifier-content-empty" \n\t\t\t>\n\t\t\t\t{{ $Bitrix.Loc.getMessage(\'IM_NOTIFICATIONS_SEARCH_RESULTS_NOT_FOUND\') }}\n\t\t\t</div>\n\t\t</div>\n\t'};function x(t,e){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=P(t))||e&&t&&typeof t.length==="number"){if(i)t=i;var n=0;var s=function t(){};return{s:s,n:function e(){if(n>=t.length)return{done:true};return{done:false,value:t[n++]}},e:function t(e){throw e},f:s}}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 o=true,a=false,r;return{s:function e(){i=i.call(t)},n:function t(){var e=i.next();o=e.done;return e},e:function t(e){a=true;r=e},f:function t(){try{if(!o&&i["return"]!=null)i["return"]()}finally{if(a)throw r}}}}function P(t,e){if(!t)return;if(typeof t==="string")return S(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return S(t,e)}function S(t,e){if(e==null||e>t.length)e=t.length;for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function L(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function R(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?L(Object(i),!0).forEach((function(e){babelHelpers.defineProperty(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var O=Object.freeze({read:"read",none:"none"});a.BitrixVue.component("bx-im-component-notifications",{components:{NotificationItem:y,MountingPortal:u.MountingPortal,Popup:d.Popup,NotificationSearchResult:N},directives:{"bx-im-directive-notifications-observer":{inserted:function t(e,i,n){if(i.value===O.none){return false}if(!n.context.observers[i.value]){n.context.observers[i.value]=n.context.getObserver({type:i.value})}n.context.observers[i.value].observe(e);return true},unbind:function t(e,i,n){if(i.value===O.none){return true}if(n.context.observers[i.value]){n.context.observers[i.value].unobserve(e)}return true}}},mixins:[w],props:{darkTheme:{default:undefined}},data:function t(){return{initialDataReceived:false,perPage:50,isLoadingInitialData:false,isLoadingNewPage:false,pagesRequested:0,pagesLoaded:0,lastId:0,lastType:p.NotificationTypesCodes.confirm,ObserverType:O,notificationsOnScreen:[],notificationsToRead:[],notificationsToDelete:[],changeReadStatusBlockTimeout:{},firstUnreadNotificationOnInit:null,contentPopupType:"",contentPopupValue:"",popupInstance:null,popupIdSelector:"",contextPopupInstance:null,searchQuery:"",searchType:"",searchDate:"",showSearch:false,callViewState:false}},computed:R({NotificationTypesCodes:function t(){return p.NotificationTypesCodes},remainingPages:function t(){return Math.ceil((this.total-this.notification.length)/this.perPage)},localize:function t(){return a.BitrixVue.getFilteredPhrases("IM_NOTIFICATIONS_",this)},visibleNotifications:function t(){return this.notification.filter((function(t){return t.display}))},highestNotificationId:function t(){return this.notification.reduce((function(t,e){return e.id>t?e.id:t}),0)},isNeedToReadAll:function t(){var e=this.notification.filter((function(t){return t.sectionCode===p.NotificationTypesCodes.confirm})).length;return e<this.unreadCounter},panelStyles:function t(){if(this.callViewState===BX.Call.Controller.ViewState.Folded&&!this.showSearch){return{paddingBottom:"60px"}}return{}},filterBoxStyles:function t(){if(this.callViewState===BX.Call.Controller.ViewState.Folded&&this.showSearch){return{paddingTop:"70px"}}return{}},firstUnreadNotification:function t(){var e=null;var i=this.notification.length-1;for(var n=0;n<=i;n++){if(this.notification[n].unread&&this.notification[n].sectionCode!==p.NotificationTypesCodes.placeholder){e=this.notification[n];break}}return e},firstUnreadNotificationBelowVisible:function t(){var e=Math.max.apply(Math,babelHelpers.toConsumableArray(this.notificationsOnScreen));var i=null;var n=this.notification.length-1;for(var s=0;s<=n;s++){if(this.notification[s].unread&&e>this.notification[s].id&&this.notification[s].sectionCode===p.NotificationTypesCodes.simple){i=this.notification[s].id;break}}return i},isUnreadNotificationVisible:function t(){var e=this;var i=Array.from(this.notificationsOnScreen).filter((function(t){var i=e.$store.getters["notifications/getById"](t);return i?i.unread:false}));return i.length>0},showScrollButton:function t(){if(!this.initialDataReceived){return false}if(this.unreadCounter<=0||!BXIM.settings.notifyAutoRead){return false}if(this.notificationsOnScreen.length===0){return false}if(this.isUnreadNotificationVisible){return false}return true},hasUnreadBelowVisible:function t(){var e=0;for(var i=0;i<=this.notification.length-1;i++){if(this.notification[i].unread&&this.notification[i].sectionCode!==p.NotificationTypesCodes.placeholder){++e}if(this.notificationsOnScreen.includes(this.notification[i].id)&&this.unreadCounter===e){return false}}return true},arrowButtonClass:function t(){var e=!this.hasUnreadBelowVisible;return{"bx-im-notifications-scroll-button-arrow-down":!e,"bx-im-notifications-scroll-button-arrow-up":e,"bx-im-notifications-scroll-button-arrow":true}},filterTypes:function t(){var e=Object.assign({},this.schema);var i=["timeman","mail","disk","bizproc","voximplant","sender","blog","vote","socialnetwork","imopenlines","photogallery","intranet","forum"];i.forEach((function(t){if(e.hasOwnProperty(t)){delete e[t].LIST}}));if(e.hasOwnProperty("calendar")){e["calendar"].NAME=this.localize["IM_NOTIFICATIONS_SEARCH_FILTER_TYPE_CALENDAR"]}if(e.hasOwnProperty("sender")){e["sender"].NAME=this.localize["IM_NOTIFICATIONS_SEARCH_FILTER_TYPE_SENDER"]}if(e.hasOwnProperty("blog")){e["blog"].NAME=this.localize["IM_NOTIFICATIONS_SEARCH_FILTER_TYPE_BLOG"]}if(e.hasOwnProperty("socialnetwork")){e["socialnetwork"].NAME=this.localize["IM_NOTIFICATIONS_SEARCH_FILTER_TYPE_SOCIALNETWORK"]}if(e.hasOwnProperty("intranet")){e["intranet"].NAME=this.localize["IM_NOTIFICATIONS_SEARCH_FILTER_TYPE_INTRANET"]}var n=["tasks","calendar","crm","timeman","mail","disk","bizproc","voximplant","sender","blog","vote","socialnetwork","imopenlines","photogallery","intranet","forum"];var s=[];n.forEach((function(t){if(e.hasOwnProperty(t)){s.push(e[t])}}));return s}},c.Vuex.mapState({notification:function t(e){return e.notifications.collection},total:function t(e){return e.notifications.total},unreadCounter:function t(e){return e.notifications.unreadCounter},schema:function t(e){return e.notifications.schema}})),created:function t(){var e=this;this.drawPlaceholders().then((function(){e.getInitialData()}));g.EventEmitter.subscribe(p.EventType.notification.updateState,this.onUpdateState);window.addEventListener("focus",this.onWindowFocus);window.addEventListener("blur",this.onWindowBlur);if(BXIM&&BX.Call){this.callViewState=BXIM.callController.callViewState;BXIM.callController.subscribe(BX.Call.Controller.Events.onViewStateChanged,this.onCallViewStateChange)}this.timer=new m.Timer;this.readNotificationsQueue=new Set;this.readNotificationsNodes={};this.observers={};this.readVisibleNotificationsDelayed=h.Utils.debounce(this.readVisibleNotifications,50,this)},mounted:function t(){this.windowFocused=document.hasFocus()},beforeDestroy:function t(){this.observers={};window.removeEventListener("focus",this.onWindowFocus);window.removeEventListener("blur",this.onWindowBlur);g.EventEmitter.unsubscribe(p.EventType.notification.updateState,this.onUpdateState);if(BXIM&&BX.Call){BXIM.callController.unsubscribe(BX.Call.Controller.Events.onViewStateChanged,this.onCallViewStateChange)}},methods:{getFirstUnreadNotificationOnInit:function t(){if(this.unreadCounter<=0){return null}var e=null;var i=this.notification.length-1;for(var n=0;n<=i;n++){if(this.notification[n].unread){e=this.notification[n].id;break}}return e},onCallViewStateChange:function t(e){var i=e.data;this.callViewState=i.callViewState},onUpdateState:function t(e){var i=e.data.lastId;if(!this.isLoadingInitialData&&this.highestNotificationId>0&&i!==this.highestNotificationId){this.getInitialData()}},readVisibleNotifications:function t(){var e=this;if(!this.windowFocused||!BXIM.settings.notifyAutoRead){l.Logger.warn("reading is disabled!");return false}this.readNotificationsQueue.forEach((function(t){if(e.readNotificationsNodes[t]){delete e.readNotificationsNodes[t]}e.readNotifications(parseInt(t,10))}));this.readNotificationsQueue.clear()},getInitialData:function t(){var e,i=this;this.isLoadingInitialData=true;var n=(e={},babelHelpers.defineProperty(e,p.RestMethodHandler.imNotifyGet,[p.RestMethod.imNotifyGet,{LIMIT:this.perPage,CONVERT_TEXT:"Y"}]),babelHelpers.defineProperty(e,p.RestMethodHandler.imNotifySchemaGet,[p.RestMethod.imNotifySchemaGet,{}]),e);this.getRestClient().callBatch(n,(function(t){l.Logger.warn("im.notify.get: initial result",t[p.RestMethodHandler.imNotifyGet].data());i.processInitialData(t[p.RestMethodHandler.imNotifyGet].data());i.processSchemaData(t[p.RestMethodHandler.imNotifySchemaGet].data());i.pagesLoaded++;i.isLoadingInitialData=false;i.firstUnreadNotificationOnInit=i.getFirstUnreadNotificationOnInit()}),false,false)},processInitialData:function t(e){if(!e.notifications||e.notifications.length===0){this.$store.dispatch("notifications/clearPlaceholders");this.$store.dispatch("notifications/setTotal",{total:this.notification.length});return false}this.lastId=this.getLastItemId(e.notifications);this.lastType=this.getLastItemType(e.notifications);this.$store.dispatch("notifications/clearPlaceholders");this.$store.dispatch("notifications/setCounter",{unreadTotal:e.total_unread_count});this.$store.dispatch("notifications/set",{notification:e.notifications,total:e.total_count});this.$store.dispatch("users/set",e.users);this.updateRecentList(e.total_unread_count,true);this.initialDataReceived=true},processSchemaData:function t(e){this.$store.dispatch("notifications/setSchema",{data:e})},drawPlaceholders:function t(){var e=this.generatePlaceholders(this.perPage);return this.$store.dispatch("notifications/set",{notification:e})},loadNextPage:function t(){var e=this;l.Logger.warn("Loading more notifications!");var i={LIMIT:this.perPage,LAST_ID:this.lastId,LAST_TYPE:this.lastType,CONVERT_TEXT:"Y"};this.getRestClient().callMethod("im.notify.get",i).then((function(t){l.Logger.warn("im.notify.get: new page results",t.data());var i=t.data().users;var n=t.data().notifications;if(!n||n.length===0){e.$store.dispatch("notifications/clearPlaceholders");e.$store.dispatch("notifications/setTotal",{total:e.notification.length});return false}e.lastId=e.getLastItemId(n);e.lastType=e.getLastItemType(n);e.$store.dispatch("users/set",i);return e.$store.dispatch("notifications/updatePlaceholders",{items:n,firstItem:e.pagesLoaded*e.perPage})})).then((function(){e.pagesLoaded++;l.Logger.warn("Page loaded. Total loaded - ",e.pagesLoaded);return e.onAfterLoadNextPageRequest()}))["catch"]((function(t){l.Logger.warn("Request history error",t)}))},onAfterLoadNextPageRequest:function t(){l.Logger.warn("onAfterLoadNextPageRequest");if(this.pagesRequested>0){l.Logger.warn("We have delayed requests -",this.pagesRequested);this.pagesRequested--;return this.loadNextPage()}else{l.Logger.warn("No more delayed requests, clearing placeholders");this.$store.dispatch("notifications/clearPlaceholders");this.isLoadingNewPage=false;return true}},changeReadStatus:function t(e){var i=this;this.$store.dispatch("notifications/read",{ids:[e.id],action:e.unread});var n=this.unreadCounter;var s=e.unread?this.unreadCounter-1:this.unreadCounter+1;this.updateRecentList(s);this.$store.dispatch("notifications/setCounter",{unreadTotal:s});clearTimeout(this.changeReadStatusBlockTimeout[e.id]);this.changeReadStatusBlockTimeout[e.id]=setTimeout((function(){i.getRestClient().callMethod("im.notify.read",{id:e.id,action:e.unread?"Y":"N",only_current:"Y"}).then((function(){l.Logger.warn("Notification ".concat(e.id," unread status set to ").concat(!e.unread))}))["catch"]((function(t){console.error(t);i.$store.dispatch("notifications/read",{ids:[e.id],action:!e.unread});i.updateRecentList(n);i.$store.dispatch("notifications/setCounter",{unreadTotal:n})}))}),1500)},delete:function t(e){var i=this;var n=+e.id;this.notificationsToDelete.push(n);var s=this.$store.getters["notifications/getById"](n);this.$store.dispatch("notifications/update",{id:n,fields:{display:false}});var o=this.unreadCounter;var a=s.unread?this.unreadCounter-1:this.unreadCounter;this.updateRecentList(a,true);this.$store.dispatch("notifications/setCounter",{unreadTotal:a});this.timer.stop("deleteNotificationServer","notifications",true);this.timer.start("deleteNotificationServer","notifications",.5,(function(){var t=i.notificationsToDelete;i.notificationsToDelete=[];i.getRestClient().callMethod("im.notify.delete",{id:t}).then((function(){t.forEach((function(t){i.$store.dispatch("notifications/delete",{id:t})}))}))["catch"]((function(e){console.error(e);t.forEach((function(t){i.$store.dispatch("notifications/update",{id:t,fields:{display:true}})}));i.updateRecentList(o,true);i.$store.dispatch("notifications/setCounter",{unreadTotal:o})}))}))},getObserver:function t(e){var i=this;if(typeof window.IntersectionObserver==="undefined"||e.type===O.none){return{observe:function t(){},unobserve:function t(){}}}var n=function t(e){e.forEach((function(t){var e=false;var n=parseInt(t.target.dataset.id,10);if(t.isIntersecting){if(t.intersectionRatio>=.99){e=true;i.notificationsOnScreen.push(n)}else if(t.intersectionRatio>0&&t.intersectionRect.height>t.rootBounds.height/2){e=true;i.notificationsOnScreen.push(n)}else{i.notificationsOnScreen=i.notificationsOnScreen.filter((function(t){return t!==n}))}}else{i.notificationsOnScreen=i.notificationsOnScreen.filter((function(t){return t!==n}))}if(e){i.readNotificationsQueue.add(n);i.readNotificationsNodes[n]=t.target}else{i.readNotificationsQueue["delete"](n);delete i.readNotificationsNodes[n]}i.readVisibleNotificationsDelayed()}))};var s={root:this.$refs["listNotifications"],threshold:new Array(101).fill(0).map((function(t,e){return e*.01}))};return new IntersectionObserver(n,s)},onScroll:function t(e){var i=this;if(!this.isReadyToLoadNewPage(e)){return}if(this.remainingPages===0||!this.initialDataReceived){return}if(this.isLoadingNewPage){this.drawPlaceholders().then((function(){i.pagesRequested++;l.Logger.warn("Already loading! Draw placeholders and add request, total - ",i.pagesRequested)}))}else{l.Logger.warn("Starting new request");this.isLoadingNewPage=true;this.drawPlaceholders().then((function(){i.loadNextPage()}))}},onWindowFocus:function t(){this.windowFocused=true;this.readVisibleNotifications()},onWindowBlur:function t(){this.windowFocused=false},onDoubleClick:function t(e){this.changeReadStatus(e.item)},onButtonsClick:function t(e){var i=this;var n=this.getConfirmRequestParams(e);var s=+n.NOTIFY_ID;this.$store.dispatch("notifications/update",{id:s,fields:{display:false}});var o=this.unreadCounter;var a=this.unreadCounter-1;this.updateRecentList(a,true);this.$store.dispatch("notifications/setCounter",{unreadTotal:a});this.getRestClient().callMethod("im.notify.confirm",n).then((function(){i.$store.dispatch("notifications/delete",{id:s})}))["catch"]((function(){i.$store.dispatch("notifications/update",{id:s,fields:{display:true}});i.updateRecentList(o,true);i.$store.dispatch("notifications/setCounter",{unreadTotal:o})}))},onDeleteClick:function t(e){var i=this;this["delete"](e.item);if(!this.isLoadingNewPage&&this.remainingPages>0&&this.notification.length===this.perPage-1){this.isLoadingNewPage=true;this.drawPlaceholders().then((function(){i.loadNextPage()}))}},onRightClick:function t(e){var i=this;if(this.contextPopupInstance!==null){this.closeContextMenuPopup()}var n=this.getContextMenu(e.item);this.contextPopupInstance=f.MenuManager.create({id:"bx-messenger-context-popup-external-data",bindElement:e.event,items:n,events:{onPopupClose:function t(){return i.contextPopupInstance.destroy()},onPopupDestroy:function t(){return i.contextPopupInstance=null}}});this.contextPopupInstance.show()},onDateFilterClick:function t(e){var i=this;if(typeof BX!=="undefined"&&BX.calendar&&BX.calendar.get().popup){BX.calendar.get().popup.close()}BX.calendar({node:e.target,field:e.target,bTime:false,callback_after:function t(){i.searchDate=e.target.value}});return false},getContextMenu:function t(e){var i=this;var n=e.unread?this.localize["IM_NOTIFICATIONS_CONTEXT_POPUP_SET_READ"]:this.localize["IM_NOTIFICATIONS_CONTEXT_POPUP_SET_UNREAD"];var s=r.Type.isUndefined(BXIM.settingsNotifyBlocked[e.settingName])?this.localize["IM_NOTIFICATIONS_CONTEXT_POPUP_DONT_NOTIFY"]:this.localize["IM_NOTIFICATIONS_CONTEXT_POPUP_NOTIFY"];return[{text:n,onclick:function t(n,s){i.changeReadStatus(e);i.closeContextMenuPopup()}},{text:this.localize["IM_NOTIFICATIONS_CONTEXT_POPUP_DELETE_NOTIFICATION"],onclick:function t(n,s){i["delete"](e);i.closeContextMenuPopup()}},{text:s,onclick:function t(n,s){console.log(e);i.closeContextMenuPopup()}}]},closeContextMenuPopup:function t(){this.contextPopupInstance.destroy();this.contextPopupInstance=null},getConfirmRequestParams:function t(e){if(e.params){var i=e.params.params.split("|");return{NOTIFY_ID:i[0],NOTIFY_VALUE:i[1]}}return null},readNotifications:function t(e){var i=this;var n=this.$store.getters["notifications/getById"](e);if(n.unread===false||n.sectionCode===p.NotificationTypesCodes.confirm){return false}this.notificationsToRead.push(e);this.$store.dispatch("notifications/read",{ids:[e],action:true});var s=this.unreadCounter;var o=this.unreadCounter-1;this.$store.dispatch("notifications/setCounter",{unreadTotal:o});this.updateRecentList(o);this.timer.stop("readNotificationServer","notifications",true);this.timer.start("readNotificationServer","notifications",.5,(function(){var t=i.notificationsToRead;i.notificationsToRead=[];var e=false;if(i.firstUnreadNotificationOnInit!==null){e=Math.max.apply(Math,babelHelpers.toConsumableArray(t))<=i.firstUnreadNotificationOnInit}var n="im.notify.read.list";var o={ids:t,action:"Y"};if(e){var a=Math.min.apply(Math,babelHelpers.toConsumableArray(t));n="im.notify.read";o={id:a,action:"Y"}}i.getRestClient().callMethod(n,o).then((function(){l.Logger.warn("I have read the notifications",o)}))["catch"]((function(){i.$store.dispatch("notifications/read",{ids:t,action:false});i.$store.dispatch("notifications/setCounter",{unreadTotal:s});i.updateRecentList(s)}))}))},getLastItemType:function t(e){return this.getItemType(e[e.length-1])},getItemType:function t(e){if(e.notify_type===p.NotificationTypesCodes.confirm){return p.NotificationTypesCodes.confirm}else{return p.NotificationTypesCodes.simple}},getLatest:function t(){var e={id:0};var i=x(this.notification),n;try{for(i.s();!(n=i.n()).done;){var s=n.value;if(s.id>e.id){e=s}}}catch(t){i.e(t)}finally{i.f()}return e},showConfirmPopupOnReadAll:function t(){var e=this.readAll.bind(this);BXIM.openConfirm(this.localize["IM_NOTIFICATIONS_READ_ALL_WARNING_POPUP"],[new BX.PopupWindowButton({text:this.localize["IM_NOTIFICATIONS_READ_ALL_WARNING_POPUP_YES"],className:"popup-window-button-accept",events:{click:function t(){e();this.popupWindow.close()}}}),new BX.PopupWindowButton({text:this.localize["IM_NOTIFICATIONS_READ_ALL_WARNING_POPUP_CANCEL"],className:"popup-window-button",events:{click:function t(){this.popupWindow.close()}}})])},readAll:function t(){var e=this;if(this.notification.lastId<=0){return}if(!this.isNeedToReadAll){return false}this.$store.dispatch("notifications/readAll");var i=this.notification.filter((function(t){return t.sectionCode===p.NotificationTypesCodes.confirm}));this.$store.dispatch("notifications/setCounter",{unreadTotal:i.length});this.updateRecentList(i.length);this.getRestClient().callMethod("im.notify.read",{id:0,action:"Y"})["catch"]((function(t){e.getInitialData();console.error(t)}))},updateRecentList:function t(e){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var n={counter:e};if(i){var s=this.getLatest();n.message={id:s.id,text:s.text,date:s.date}}this.$store.dispatch("recent/update",{id:"notify",fields:n})},onScrollButtonClick:function t(e){if(this.isLoadingNewPage||!this.initialDataReceived){return false}var i=null;if(this.firstUnreadNotificationBelowVisible!==null){i=this.firstUnreadNotificationBelowVisible}else if(!this.hasUnreadBelowVisible){i=this.firstUnreadNotification.id}var n=null;if(i!==null){var s='.bx-im-notifications-item[data-id="'.concat(i,'"]');n=document.querySelector(s)}if(n){this.animatedScrollToPosition({start:this.$refs["listNotifications"].scrollTop,end:n.offsetTop})}else{var o=this.notification[this.notification.length-1];var a='.bx-im-notifications-item[data-id="'.concat(o.id,'"]');var r=document.querySelector(a);this.animatedScrollToPosition({start:this.$refs["listNotifications"].scrollTop,end:r.offsetTop})}},animatedScrollToPosition:function t(){var i=this;var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(this.animateScrollId){e.Animation.cancel(this.animateScrollId);this.scrollAnimating=false}if(typeof n==="function"){n={callback:n}}var s=this.$refs.listNotifications;var o=n,a=o.start,r=a===void 0?s.scrollTop:a,c=o.end,l=c===void 0?s.scrollHeight-s.clientHeight:c,u=o.increment,d=u===void 0?20:u,f=o.callback,h=o.duration,p=h===void 0?500:h;if(s&&l-r>s.offsetHeight*3){r=l-s.offsetHeight*3}this.scrollAnimating=true;this.animateScrollId=e.Animation.start({start:r,end:l,increment:d,duration:p,element:s,elementProperty:"scrollTop",callback:function t(){i.animateScrollId=null;i.scrollAnimating=false;if(f&&typeof f==="function"){f()}}})}},template:'\n\t\t<div class="bx-messenger-next-notify">\n\t\t\t<div class="bx-messenger-panel-next-wrapper" :style="panelStyles">\n\t\t\t\t<div class="bx-messenger-panel-next">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<span \n\t\t\t\t\t\t\tclass="bx-messenger-panel-avatar bx-im-notifications-image-system bx-im-notifications-header-image"\n\t\t\t\t\t\t></span>\n\t\t\t\t\t\t<span class="bx-messenger-panel-title bx-messenger-panel-title-middle" style="flex-shrink: 0;">\n\t\t\t\t\t\t\t{{ $Bitrix.Loc.getMessage(\'IM_NOTIFICATIONS_HEADER\') }}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div v-if="notification.length > 0" class="bx-im-notifications-header-buttons">\n\t\t\t\t\t\t<transition name="notifications-read-all-fade">\n\t\t\t\t\t\t\t<div v-if="isNeedToReadAll" class="bx-im-notifications-header-read-all">\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\'bx-messenger-panel-button bx-im-notifications-header-read-all-icon\'\n\t\t\t\t\t\t\t\t\t@click="showConfirmPopupOnReadAll"\n\t\t\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage(\'IM_NOTIFICATIONS_READ_ALL_BUTTON\')"\n\t\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</transition>\n\t\t\t\t\t\t<div class="bx-im-notifications-header-filter">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t:class="[\'bx-messenger-panel-button bx-messenger-panel-history bx-im-notifications-header-filter-icon\', (showSearch? \'bx-im-notifications-header-filter-active\': \'\')]"\n\t\t\t\t\t\t\t\t@click="showSearch = !showSearch"\n\t\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage(\'IM_NOTIFICATIONS_SEARCH_FILTER_OPEN_BUTTON\')"\n\t\t\t\t\t\t\t></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div v-if="showSearch" class="bx-im-notifications-header-filter-box" :style="filterBoxStyles">\n\t\t\t\t\t<div class="ui-ctl ui-ctl-after-icon ui-ctl-dropdown ui-ctl-xs ui-ctl-w25">\n\t\t\t\t\t\t<div class="ui-ctl-after ui-ctl-icon-angle"></div>\n\t\t\t\t\t\t<select class="ui-ctl-element" v-model="searchType">\n\t\t\t\t\t\t\t<option value="">\n\t\t\t\t\t\t\t\t{{ $Bitrix.Loc.getMessage(\'IM_NOTIFICATIONS_SEARCH_FILTER_TYPE_PLACEHOLDER\') }}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t<template v-for="group in filterTypes">\n\t\t\t\t\t\t\t\t<template v-if="group.LIST">\n\t\t\t\t\t\t\t\t\t<optgroup :label="group.NAME">\n\t\t\t\t\t\t\t\t\t\t<option v-for="option in group.LIST" :value="option.ID">\n\t\t\t\t\t\t\t\t\t\t\t{{ option.NAME }}\n\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t</optgroup>\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\t<template v-else> \n\t\t\t\t\t\t\t\t\t<option :value="group.MODULE_ID">\n\t\t\t\t\t\t\t\t\t\t{{ group.NAME }}\n\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ui-ctl ui-ctl-textbox ui-ctl-after-icon ui-ctl-xs ui-ctl-w50"> \n\t\t\t\t\t\t<button class="ui-ctl-after ui-ctl-icon-clear" @click.prevent="searchQuery=\'\'"></button>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tautofocus\n\t\t\t\t\t\t\ttype="text" \n\t\t\t\t\t\t\tclass="ui-ctl-element" \n\t\t\t\t\t\t\tv-model="searchQuery" \n\t\t\t\t\t\t\t:placeholder="$Bitrix.Loc.getMessage(\'IM_NOTIFICATIONS_SEARCH_FILTER_TEXT_PLACEHOLDER\')"\n\t\t\t\t\t\t>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ui-ctl ui-ctl-after-icon ui-ctl-before-icon ui-ctl-xs ui-ctl-w25">\n\t\t\t\t\t\t<div class="ui-ctl-before ui-ctl-icon-calendar"></div>\n\t\t\t\t\t\t<input \n\t\t\t\t\t\t\ttype="text" \n\t\t\t\t\t\t\tclass="ui-ctl-element ui-ctl-textbox" \n\t\t\t\t\t\t\tv-model="searchDate"\n\t\t\t\t\t\t\t@focus.prevent.stop="onDateFilterClick"\n\t\t\t\t\t\t\t@click.prevent.stop="onDateFilterClick"\n\t\t\t\t\t\t\t:placeholder="$Bitrix.Loc.getMessage(\'IM_NOTIFICATIONS_SEARCH_FILTER_DATE_PLACEHOLDER\')"\n\t\t\t\t\t\t\treadonly\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<button class="ui-ctl-after ui-ctl-icon-clear" @click.prevent="searchDate=\'\'"></button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div \n\t\t\t\tv-if="showSearch && (searchQuery.length >= 3 || searchType !== \'\' || searchDate !== \'\')" \n\t\t\t\tclass="bx-messenger-list-notifications-wrap"\n\t\t\t>\n\t\t\t\t<NotificationSearchResult :searchQuery="searchQuery" :searchType="searchType" :searchDate="searchDate"/>\n\t\t\t</div>\n\t\t\t<div v-else class="bx-messenger-list-notifications-wrap">\n\t\t\t\t<div :class="[ darkTheme ? \'bx-messenger-dark\' : \'\', \'bx-messenger-list-notifications\']" @scroll.passive="onScroll" ref="listNotifications">\n\t\t\t\t\t<notification-item\n\t\t\t\t\t\tv-for="listItem in visibleNotifications"\n\t\t\t\t\t\t:key="listItem.id"\n\t\t\t\t\t\t:data-id="listItem.id"\n\t\t\t\t\t\t:rawListItem="listItem"\n\t\t\t\t\t\t@dblclick="onDoubleClick"\n\t\t\t\t\t\t@buttonsClick="onButtonsClick"\n\t\t\t\t\t\t@deleteClick="onDeleteClick"\n\t\t\t\t\t\t@contentClick="onContentClick"\n\t\t\t\t\t\tv-bx-im-directive-notifications-observer="\n\t\t\t\t\t\t\tlistItem.sectionCode !== NotificationTypesCodes.placeholder\n\t\t\t\t\t\t\t? ObserverType.read \n\t\t\t\t\t\t\t: ObserverType.none\n\t\t\t\t\t\t"\n\t\t\t\t\t/>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if="notification.length <= 0"\n\t\t\t\t\t\tstyle="padding-top: 210px; margin-bottom: 20px;"\n\t\t\t\t\t\tclass="bx-messenger-box-empty bx-notifier-content-empty"\n\t\t\t\t\t>\n\t\t\t\t\t\t{{ $Bitrix.Loc.getMessage(\'IM_NOTIFICATIONS_NO_ITEMS\') }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\x3c!-- Scroll button --\x3e\n\t\t\t\t<transition name="bx-im-notifications-scroll-button">\n\t\t\t\t\t<div v-show="showScrollButton" class="bx-im-notifications-scroll-button-box" @click="onScrollButtonClick">\n\t\t\t\t\t\t<div class="bx-im-notifications-scroll-button">\n\t\t\t\t\t\t\t<div class="bx-im-notifications-scroll-button-counter">\n\t\t\t\t\t\t\t\t<div class="bx-im-notifications-scroll-button-counter-digit">{{ unreadCounter }}</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div :class="arrowButtonClass"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</transition>\n\t\t\t\t\n\t\t\t\t<mounting-portal :mount-to="popupIdSelector" append v-if="popupInstance">\n\t\t\t\t\t<popup :type="contentPopupType" :value="contentPopupValue" :popupInstance="popupInstance"/>\n\t\t\t\t</mounting-portal>\n\t\t\t</div>\n\t\t</div>\n\t'})})(this.BX.Messenger=this.BX.Messenger||{},BX.Messenger.Lib,BX,BX,window,window,BX,BX,BX,BX.Messenger.Lib,BX.Vue,BX.Messenger.View,BX.Main,BX.Messenger.Lib,BX.Messenger.Const,BX.Messenger.Lib,BX.Event); //# sourceMappingURL=notifications.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.27 |
proxy
|
phpinfo
|
Settings