403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/socialnetwork/livefeed/dist/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/socialnetwork/livefeed/dist/livefeed.bundle.min.js
this.BX=this.BX||{};(function(e,t,n,a,i,s,o){"use strict";var l=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"setStyle",value:function e(t,n){Object.entries(n).forEach((function(e){var n=babelHelpers.slicedToArray(e,2),a=n[0],i=n[1];t.style[a]=i}))}}]);return e}();var r;function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){babelHelpers.defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(){function e(){var t=this;babelHelpers.classCallCheck(this,e);this["class"]={pin:"feed-post-pin",post:"feed-item-wrap",postHide:"feed-item-wrap-hide",postComments:"feed-comments-block",postPinned:"feed-post-block-pinned",postPinnedHide:"feed-post-block-pinned-hide",postPinActive:"feed-post-block-pin-active",postUnfollowed:"feed-post-block-unfollowed",postExpanding:"feed-post-block-expand",panelCollapsed:"feed-pinned-panel-collapsed",panelNonEmpty:"feed-pinned-panel-nonempty",panelPosts:"feed-pinned-panel-posts",collapsedPanel:"feed-post-collapsed-panel",collapsedPanelExpand:"feed-post-collapsed-panel-right",collapsedPanelCounterPostsValue:"feed-post-collapsed-panel-count-posts",collapsedPanelCounterComments:"feed-post-collapsed-panel-box-comments",collapsedPanelCounterCommentsValue:"feed-post-collapsed-panel-count-comments-value",collapsedPanelCounterCommentsShown:"feed-post-collapsed-panel-box-shown",collapsedPanelCounterCommentsValueNew:"feed-inform-comments-pinned-new",collapsedPanelCounterCommentsValueNewValue:"feed-inform-comments-pinned-new-value",collapsedPanelCounterCommentsValueNewActive:"feed-inform-comments-pinned-new-active",collapsedPanelCounterCommentsValueOld:"feed-inform-comments-pinned-old",collapsedPanelCounterCommentsValueAll:"feed-inform-comments-pinned-all",collapsedPanelShow:"feed-post-collapsed-panel--show",collapsedPanelHide:"feed-post-collapsed-panel--hide",cancelPanel:"feed-post-cancel-pinned-panel",cancelPanelButton:"feed-post-cancel-pinned-btn",cancelPanelLabel:"feed-post-cancel-pinned-label"};this.panelInitialized=false;this.postsInitialized=false;this.handlePostClick=this.handlePostClick.bind(this);this.options={};i.Event.ready((function(){t.initPosts()}))}babelHelpers.createClass(e,[{key:"resetFlags",value:function e(){this.panelInitialized=false;this.postsInitialized=false}},{key:"init",value:function e(){this.initPanel();this.initPosts();this.initEvents()}},{key:"setOptions",value:function e(t){this.options=d(d({},this.options),t)}},{key:"getOption",value:function e(t){return this.options[t]}},{key:"initPanel",value:function e(){var t=this;if(this.panelInitialized){return}var n=this.getPanelNode();if(!n){return}this.panelInitialized=true;this.adjustCollapsedPostsPanel();i.Event.bind(this.getCollapsedPanelNode(),"click",(function(){var e=t.getPanelNode();if(!e){return}var n=e.offsetHeight;l.setStyle(e,{height:n+"px",transition:"height .5s"});setTimeout((function(){e.style=""}),550);t.hideCollapsedPanel()}));i.Event.bind(n,"click",(function(e){var n=e.target.classList.contains("feed-inform-ilike")||e.target.closest(".feed-inform-ilike")!==null;var o=e.target.classList.contains("feed-inform-follow")||e.target.closest(".feed-inform-follow")!==null;var l=e.target.classList.contains("feed-post-more-link")||e.target.closest(".feed-post-more-link")!==null||e.target.classList.contains("feed-post-right-top-menu");var r=e.target.classList.contains("feed-inform-contentview")||e.target.closest(".feed-inform-contentview")!==null;var c=e.target.classList.contains("".concat(t["class"].pin))||e.target.closest(".".concat(t["class"].pin))!==null;var d=e.target.classList.contains("feed-post-pinned-link-collapse");var u=e.target.classList.contains("feed-inform-comments-pinned")||e.target.closest(".feed-inform-comments-pinned")!==null;var p=null;if(e.target.classList.contains("feed-post-block")){p=e.target}else{p=e.target.closest(".feed-post-block")}if(!p){return}if(p.classList.contains("".concat(t["class"].postPinned))){if(!n&&!o&&!l&&!r&&!c){p.classList.remove("".concat(t["class"].postPinned));var f=p.getAttribute("data-menu-id");if(f){a.MenuManager.destroy(f)}var m=new s.BaseEvent({compatData:[{rootNode:p}],data:{rootNode:p}});s.EventEmitter.emit("BX.Livefeed:recalculateComments",m)}if(u){var g=p.querySelector(".".concat(t["class"].postComments," a[name=comments]"));if(g){var h=i.Dom.getPosition(g);window.scrollTo(0,h.top-200)}}e.stopPropagation();e.preventDefault()}else if(d){p.classList.add("".concat(t["class"].postPinned));e.stopPropagation();e.preventDefault()}}))}},{key:"initPosts",value:function e(){var t=this;if(this.postsInitialized){return}var n=document.querySelectorAll("[data-livefeed-post-pinned]");if(n.length>0){this.postsInitialized=true}Array.from(n).forEach((function(e){i.Event.unbind(e,"click",t.handlePostClick);i.Event.bind(e,"click",t.handlePostClick)}))}},{key:"handlePostClick",value:function e(t){if(!t.target.classList.contains("".concat(this["class"].pin))){return}var n=t.target.closest("[data-livefeed-id]");if(!n){return}var a=n.getAttribute("data-livefeed-post-pinned")==="Y"?"N":"Y";var i=parseInt(n.getAttribute("data-livefeed-id"));if(i<=0){return}this.changePinned({logId:i,newState:a,event:t}).then((function(){}))}},{key:"initEvents",value:function e(){var t=this;s.EventEmitter.subscribe("OnUCCommentWasRead",(function(e){var n=e.getData(),a=babelHelpers.slicedToArray(n,3),s=a[0],o=a[1],l=a[2];var r=t.getCommentsData(s),c=r.oldValue,d=r.newValue;if(!!l["new"]){t.setCommentsData(s,{newValue:i.Type.isInteger(d)?d-1:0,oldValue:i.Type.isInteger(c)?c+1:1})}}));s.EventEmitter.incrementMaxListeners("OnUCCommentWasPulled");s.EventEmitter.subscribe("OnUCCommentWasPulled",(function(e){var n=e.getData(),a=babelHelpers.slicedToArray(n,3),s=a[0],o=a[1],l=a[2];var r=babelHelpers.slicedToArray(s,2),c=r[0],d=r[1];var u=t.getCommentsData(c),p=u.newValue,f=u.oldValue,m=u.allValue,g=u.follow;var h={allValue:i.Type.isInteger(m)?m+1:1};if(parseInt(l.AUTHOR.ID)!==parseInt(BX.message("USER_ID"))){h.newValue=i.Type.isInteger(p)?p+1:1}else{h.oldValue=i.Type.isInteger(f)?f+1:1}t.setCommentsData(c,h)}));s.EventEmitter.subscribe("OnUCommentWasDeleted",(function(e){var n=e.getData(),a=babelHelpers.slicedToArray(n,3),s=a[0],o=a[1],l=a[2];var r=t.getCommentsData(s),c=r.oldValue,d=r.allValue;t.setCommentsData(s,{allValue:i.Type.isInteger(d)?d-1:0,oldValue:i.Type.isInteger(c)?c-1:0})}))}},{key:"changePinned",value:function e(t){var n=this;var a=t.logId?parseInt(t.logId):0;var s=t.event?t.event:null;var o=t.node?t.node:null;var l=t.newState?t.newState:null;var r=this.getPanelNode();if(!o&&!s&&a>0&&r){o=r.querySelector(".".concat(this["class"].post,' > [data-livefeed-id="').concat(a,'"]'))}if(!o&&s){o=s.target}return new Promise((function(e,t){if(!!n.getOption("pinBlocked")||!o||!l){return e()}n.setPostState({node:o,state:l});var s=l==="Y"?"socialnetwork.api.livefeed.logentry.pin":"socialnetwork.api.livefeed.logentry.unpin";i.ajax.runAction(s,{data:{params:{logId:a}},analyticsLabel:{b24statAction:l==="Y"?"pinLivefeedEntry":"unpinLivefeedEntry"}}).then((function(t){if(!t.data.success){n.setPostState({node:o,state:l==="Y"?"N":"Y"});return e()}else{n.movePost({node:o,state:l}).then((function(){return e()}))}}),(function(t){n.setPostState({node:o,state:l==="Y"?"N":"Y"});return e()}))}))}},{key:"setPostState",value:function e(t){var n=t.state?t.state:null;var a=t.node?t.node:null;if(!a||!["Y","N"].includes(n)){return}var s=a.closest("[data-livefeed-post-pinned]");if(!s){return}s.setAttribute("data-livefeed-post-pinned",n);if(n==="Y"){s.classList.add("".concat(this["class"].postPinActive))}else{s.classList.remove("".concat(this["class"].postPinActive))}var o=s.querySelector(".".concat(this["class"].pin));if(o){o.setAttribute("title",i.Loc.getMessage("SONET_EXT_LIVEFEED_PIN_TITLE_".concat(n)))}}},{key:"getPanelNode",value:function e(){return document.querySelector("[data-livefeed-pinned-panel]")}},{key:"getPinnedData",value:function e(t){var n=t.logId?parseInt(t.logId):0;if(n<=0){return Promise.reject()}return new Promise((function(e,a){i.ajax.runAction("socialnetwork.api.livefeed.logentry.getPinData",{data:{params:{logId:n}},headers:[{name:i.Loc.getMessage("SONET_EXT_LIVEFEED_AJAX_ENTITY_HEADER_NAME"),value:t.entityValue||""},{name:i.Loc.getMessage("SONET_EXT_LIVEFEED_AJAX_TOKEN_HEADER_NAME"),value:t.tokenValue||""}]}).then((function(t){return e(t.data)}),(function(e){return a()}))}))}},{key:"movePost",value:function e(t){var n=this;var a=t.state?t.state:null;var s=t.node?t.node:null;return new Promise((function(e,t){if(!s||!["Y","N"].includes(a)){return e()}var o=s.closest("[data-livefeed-post-pinned]");if(!o){return e()}var r=parseInt(o.getAttribute("data-livefeed-id"));if(!r){return e()}var c=n.getPanelNode();if(!c){return e()}var d=o.parentNode.classList.contains("".concat(n["class"].post))?o.parentNode:o;var u=o.getAttribute("data-security-entity-pin");var p=o.getAttribute("data-security-token-pin");if(a==="Y"){var f=d.offsetHeight;d.setAttribute("bx-data-height",f);n.getPinnedData({logId:r,entityValue:u,tokenValue:p}).then((function(t){var a=o.querySelector(".feed-post-pinned-title");var s=o.querySelector(".feed-post-pinned-desc");var u=o.querySelector(".".concat(n["class"].pin));if(a){a.innerHTML=t.TITLE}if(s){s.innerHTML=t.DESCRIPTION}if(u){u.title=i.Loc.getMessage("SONET_EXT_LIVEFEED_PIN_TITLE_Y")}o.classList.add("".concat(n["class"].postPinnedHide));var p=n.getCancelPinnedPanel({logId:r});var m=d.nextSibling;m.parentNode.insertBefore(p,m);n.centerCancelPinnedPanelElements({cancelPinnedPanel:p});p.setAttribute("bx-data-height",f);var g=p.getAttribute("bx-data-height");l.setStyle(p,{height:g+"px"});l.setStyle(d,{position:"absolute",width:"100%",height:f+"px",backgroundColor:"transparent",opacity:0});var h=n.getPanelNode();if(h){n.setOptions({panelHeight:h.offsetHeight})}setTimeout((function(){d.classList.add("".concat(n["class"].postHide));l.setStyle(p,{height:"53px"});l.setStyle(d,{height:0,opacity:0});n.setOptions({pinBlocked:true})}),100);i.Event.unbindAll(d,"transitionend");i.Event.bind(d,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"height")){return}i.Event.unbindAll(d,"transitionend");var t=c.querySelector(".".concat(n["class"].panelPosts));t.insertBefore(d,t.firstChild);n.adjustCollapsedPostsPanel();d.classList.remove("".concat(n["class"].postHide));o.classList.remove("".concat(n["class"].postPinnedHide));n.adjustPanel();n.showCollapsedPostsPanel();setTimeout((function(){o.classList.add("".concat(n["class"].postPinned));l.setStyle(d,{position:"",width:"",height:"80px",backgroundColor:"",opacity:1});n.setOptions({pinBlocked:false});setTimeout((function(){d.classList.remove("".concat(n["class"].postHide));l.setStyle(d,{position:"",width:"",height:"",backgroundColor:"",opacity:""})}),600)}),300)}));return e()}))}else{var m=d.getAttribute("bx-data-height");var g=d.scrollHeight;l.setStyle(d,{transition:""});var h=document.querySelector(".".concat(n["class"].cancelPanel,'[bx-data-log-id="').concat(r,'"]'));if(i.Type.isDomNode(h)){l.setStyle(d,{height:g+"px"});requestAnimationFrame((function(){d.classList.add("".concat(n["class"].postExpanding));h.classList.add("".concat(n["class"].postExpanding));l.setStyle(d,{opacity:0,height:0});l.setStyle(h,{opacity:0,height:0})}));var v=c.classList.contains("".concat(n["class"].panelCollapsed));if(v){h.parentNode.insertBefore(d,h.nextSibling);n.adjustCollapsedPostsPanel();n.adjustPanel()}var y=n.getCollapsedPanelNode().classList.contains("".concat(n["class"].collapsedPanelShow));if(y){n.hideCollapsedPostsPanel();i.Event.unbindAll(h,"transitionend");i.Event.bind(h,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"height")){return}l.setStyle(d,{transform:"",display:"block"});n.animateCancel({post:o,postToMove:d,cancelPinnedPanel:h,height:m})}))}i.Event.unbindAll(d,"transitionend");i.Event.bind(d,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"opacity")){return}if(!v){h.parentNode.insertBefore(d,h.nextSibling);n.adjustCollapsedPostsPanel();n.adjustPanel()}n.animateCancel({post:o,postToMove:d,cancelPinnedPanel:h,height:m})}))}else{o.classList.remove("".concat(n["class"].postPinned));c.parentNode.insertBefore(d,c.nextSibling);n.adjustPanel();var E=d.scrollHeight;d.setAttribute("bx-data-height",E);l.setStyle(d,{opacity:0,height:"80px"});setTimeout((function(){l.setStyle(d,{opacity:1,height:E+"px"})}),100);i.Event.unbindAll(d,"transitionend");i.Event.bind(d,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"height")){return}l.setStyle(d,{height:""})}))}return e()}}))}},{key:"animateCancel",value:function e(t){var n=this;var a=t.post,s=t.postToMove,o=t.cancelPinnedPanel,r=t.height;a.classList.remove("".concat(this["class"].postPinned));setTimeout((function(){l.setStyle(s,{opacity:1,height:r+"px"});l.setStyle(o,{height:0});setTimeout((function(){o.remove()}),100)}),100);i.Event.unbindAll(s,"transitionend");i.Event.bind(s,"transitionend",(function(e){if(!n.checkTransitionProperty(e,"height")){return}a.classList.remove("".concat(n["class"].postPinnedHide));l.setStyle(s,{marginBottom:"",height:""});l.setStyle(o,{marginBottom:"",height:""});s.classList.remove("".concat(n["class"].postExpanding));o.classList.remove("".concat(n["class"].postExpanding))}))}},{key:"getCancelPinnedPanel",value:function e(t){var n=this;var a=t.logId?parseInt(t.logId):0;if(a<=0){return null}var s=document.querySelector(".".concat(this["class"].cancelPanel,'[bx-data-log-id="').concat(a,'"]'));if(!i.Type.isDomNode(s)){s=i.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="','" bx-data-log-id="','">\n\t\t\t\t\t<div class="feed-post-cancel-pinned-panel-inner">\n\t\t\t\t\t\t<div class="feed-post-cancel-pinned-content">\n\t\t\t\t\t\t\t<span class="','">','</span>\n\t\t\t\t\t\t\t<span class="feed-post-cancel-pinned-text">','</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button class="ui-btn ui-btn-light-border ui-btn-round ui-btn-sm ','">',"</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\t\n\t\t\t\t"])),this["class"].cancelPanel,a,this["class"].cancelPanelLabel,i.Loc.getMessage("SONET_EXT_LIVEFEED_PINNED_CANCEL_TITLE"),i.Loc.getMessage("SONET_EXT_LIVEFEED_PINNED_CANCEL_DESCRIPTION"),this["class"].cancelPanelButton,i.Loc.getMessage("SONET_EXT_LIVEFEED_PINNED_CANCEL_BUTTON"));i.Event.bind(s.querySelector(".".concat(this["class"].cancelPanelButton)),"click",(function(){n.changePinned({logId:a,newState:"N"}).then((function(){l.setStyle(s,{opacity:0,height:0})}))}))}return s}},{key:"centerCancelPinnedPanelElements",value:function e(t){var n=t.cancelPinnedPanel;if(!i.Type.isDomNode(n)){return}setTimeout((function(){l.setStyle(n,{opacity:1})}),100);l.setStyle(n.querySelector(".".concat(this["class"].cancelPanelLabel)),{marginLeft:n.querySelector(".".concat(this["class"].cancelPanelButton)).getBoundingClientRect().width+"px"})}},{key:"getPostsCount",value:function e(){var t=this.getPanelNode();return t?Array.from(t.getElementsByClassName("".concat(this["class"].post))).length:0}},{key:"hidePinnedItems",value:function e(){var t=this;var n=this.getPanelNode();if(!n){return}l.setStyle(n,{height:parseInt(this.getOption("panelHeight"))+"px"});Array.from(n.getElementsByClassName("".concat(this["class"].post))).reduce((function(e,a){e+=a.offsetHeight;l.setStyle(a,{transition:"opacity .1s linear, transform .2s .1s linear, height .5s linear"});l.setStyle(n,{transition:"height .5s .1s linear"});requestAnimationFrame((function(){l.setStyle(a,{opacity:"0!important",transform:"translateY(-".concat(e,"px)")});l.setStyle(n,{height:"58px"})}));i.Event.unbindAll(a,"transitionend");i.Event.bind(a,"transitionend",(function(e){if(!t.checkTransitionProperty(e,"transform")){return}l.setStyle(a,{display:"none",opacity:"",transform:"",transition:""});l.setStyle(n,{transition:""})}));return e}),0)}},{key:"showPinnedItems",value:function e(){var t=this;var n=this.getPanelNode();if(!n){return}Array.from(n.getElementsByClassName("".concat(this["class"].post))).map((function(e,a,s){l.setStyle(e,{display:"block",opacity:0});requestAnimationFrame((function(){l.setStyle(n,{height:84*(a+1)-4+"px"});l.setStyle(e,{transform:"translateY(".concat(0,"px)"),opacity:1})}));i.Event.unbindAll(e,"transitionend");i.Event.bind(e,"transitionend",(function(i){if(!t.checkTransitionProperty(i,"transform")){return}l.setStyle(e,{display:"block",height:"",transform:""});l.setStyle(n,{height:""});if(a+1===s.length){l.setStyle(n,{transition:"",height:""})}}))}))}},{key:"animateCollapsedPanel",value:function e(){var t=this;requestAnimationFrame((function(){var e=t.getCollapsedPanelNode();l.setStyle(e,{position:"absolute",top:0,width:"100%",opacity:0});e.classList.remove("".concat(t["class"].collapsedPanelHide));e.classList.add("".concat(t["class"].collapsedPanelShow));requestAnimationFrame((function(){l.setStyle(e,{position:"relative",opacity:1})}))}))}},{key:"adjustCollapsedPostsPanel",value:function e(){var t=this;var n=this.getPostsCount();var a=this.getCollapsedPanelNode().querySelector(".".concat(this["class"].collapsedPanelCounterPostsValue));if(a){a.innerHTML=parseInt(n)}var i=this.getCollapsedPanelNode().querySelector(".".concat(this["class"].collapsedPanelCounterComments));var s=this.getCollapsedPanelNode().querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValue));var o=this.getPanelNode();if(i&&s&&o){var l=Array.from(o.querySelectorAll(".".concat(this["class"].collapsedPanelCounterCommentsValueNewValue))).reduce((function(e,n){return e+(n.closest(".".concat(t["class"].postUnfollowed))?0:parseInt(n.innerHTML))}),0);s.innerHTML=l;if(l>0){i.classList.add("".concat(this["class"].collapsedPanelCounterCommentsShown))}else{i.classList.remove("".concat(this["class"].collapsedPanelCounterCommentsShown))}}}},{key:"adjustPanel",value:function e(){var t=this;var n=this.getPanelNode();if(!n){return}setTimeout((function(){if(t.getPostsCount()>0){n.classList.add("".concat(t["class"].panelNonEmpty))}else{n.classList.remove("".concat(t["class"].panelNonEmpty))}}),0)}},{key:"showCollapsedPostsPanel",value:function e(){if(this.getPostsCount()>=i.Loc.getMessage("SONET_EXT_LIVEFEED_COLLAPSED_PINNED_PANEL_ITEMS_LIMIT")){this.showCollapsedPanel();this.hidePinnedItems()}}},{key:"hideCollapsedPostsPanel",value:function e(){if(this.getPostsCount()<i.Loc.getMessage("SONET_EXT_LIVEFEED_COLLAPSED_PINNED_PANEL_ITEMS_LIMIT")){this.getPanelNode().classList.remove("".concat(this["class"].panelCollapsed));this.removeCollapsedPanel();this.showPinnedItems()}}},{key:"showCollapsedPanel",value:function e(){this.getPanelNode().classList.add("".concat(this["class"].panelCollapsed));this.animateCollapsedPanel()}},{key:"hideCollapsedPanel",value:function e(){this.getPanelNode().classList.remove("".concat(this["class"].panelCollapsed));this.showPinnedItems();this.removeCollapsedPanel()}},{key:"removeCollapsedPanel",value:function e(){var t=this.getCollapsedPanelNode();l.setStyle(t,{position:"absolute",top:0,width:"100%"});t.classList.remove("".concat(this["class"].collapsedPanelShow));t.classList.add("".concat(this["class"].collapsedPanelHide))}},{key:"getCommentsNodes",value:function e(t){var n={follow:true,newNode:null,newValueNode:null,oldNode:null,allNode:null};if(!i.Type.isStringFilled(t)){return n}var a=document.querySelector(".".concat(this["class"].postComments,'[data-bx-comments-entity-xml-id="').concat(t,'"]'));if(!a){return n}var s=a.closest(".".concat(this["class"].postPinActive));if(!s){return n}var o=s.querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValueNew));var l=s.querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValueNewValue));var r=s.querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValueOld));var c=s.querySelector(".".concat(this["class"].collapsedPanelCounterCommentsValueAll));if(!o||!l||!r||!c){return n}n.newNode=o;n.newValueNode=l;n.oldNode=r;n.allNode=c;n.follow=a.getAttribute("data-bx-follow")!=="N";return n}},{key:"getCommentsData",value:function e(t){var n={newValue:null,oldValue:null,allValue:null};if(!i.Type.isStringFilled(t)){return n}var a=this.getCommentsNodes(t),s=a.newValueNode,o=a.oldNode,l=a.allNode,r=a.follow;n.follow=r;if(!i.Type.isDomNode(s)||!i.Type.isDomNode(o)){return n}var c=0;var d=0;var u=0;var p=s.innerHTML.match(/(\d+)/);if(p){c=parseInt(p[1])}p=o.innerHTML.match(/(\d+)/);if(p){d=parseInt(p[1])}p=l.innerHTML.match(/(\d+)/);if(p){u=parseInt(p[1])}n.oldValue=d;n.newValue=c;n.allValue=u;return n}},{key:"setCommentsData",value:function e(t,n){if(!i.Type.isStringFilled(t)){return}var a=this.getCommentsNodes(t),s=a.newNode,o=a.newValueNode,l=a.oldNode,r=a.allNode;if(!i.Type.isDomNode(s)||!i.Type.isDomNode(o)||!i.Type.isDomNode(l)||!i.Type.isDomNode(r)){return}if(i.Type.isInteger(n.newValue)){o.innerHTML="".concat(n.newValue);if(n.newValue>0&&!s.classList.contains("".concat(this["class"].collapsedPanelCounterCommentsValueNewActive))){s.classList.add("".concat(this["class"].collapsedPanelCounterCommentsValueNewActive))}else if(n.newValue<=0&&s.classList.contains("".concat(this["class"].collapsedPanelCounterCommentsValueNewActive))){s.classList.remove("".concat(this["class"].collapsedPanelCounterCommentsValueNewActive))}}if(i.Type.isInteger(n.oldValue)){l.innerHTML=n.oldValue}if(i.Type.isInteger(n.allValue)){r.innerHTML=n.allValue}this.adjustCollapsedPostsPanel()}},{key:"getCollapsedPanelNode",value:function e(){return this.getPanelNode().querySelector(".".concat(this["class"].collapsedPanel))}},{key:"checkTransitionProperty",value:function e(t,n){return t.propertyName===n}}]);return e}();var p,f,m;var g=function(){function e(){babelHelpers.classCallCheck(this,e);this.initEvents()}babelHelpers.createClass(e,[{key:"initEvents",value:function t(){s.EventEmitter.subscribe("tasksTaskEvent",(function(t){var n=t.getCompatData(),a=babelHelpers.slicedToArray(n,2),s=a[0],o=a[1];if(s!=="ADD"||!i.Type.isPlainObject(o.options)||!i.Type.isBoolean(o.options.STAY_AT_PAGE)||o.options.STAY_AT_PAGE){return}e.signedFiles=null}));s.EventEmitter.subscribe("SidePanel.Slider:onCloseComplete",(function(t){var n=t.getTarget();if(!n){return}var a=n.getUrl();if(!i.Type.isStringFilled(a)||a!==e.sliderUrl||!i.Type.isStringFilled(e.signedFiles)){return}i.ajax.runAction("intranet.controlbutton.clearNewTaskFiles",{data:{signedFiles:e.signedFiles}}).then((function(){e.signedFiles=null}))}))}}],[{key:"create",value:function e(t){var n=this;if(i.Loc.getMessage("SONET_EXT_LIVEFEED_INTRANET_INSTALLED")==="Y"){i.ajax.runAction("intranet.controlbutton.getTaskLink",{data:{entityType:t.entityType,entityId:t.entityId,postEntityType:i.Type.isStringFilled(t.postEntityType)?t.postEntityType:t.entityType,entityData:{}}}).then((function(e){if(!i.Type.isStringFilled(e.data.SUFFIX)){e.data.SUFFIX=""}var a=e.data;a.DESCRIPTION=n.formatTaskDescription(a.DESCRIPTION,a.URL,t.entityType,a.SUFFIX);if(parseInt(t.parentTaskId)>0){a.PARENT_ID=parseInt(t.parentTaskId)}if(i.Type.isStringFilled(a.UF_TASK_WEBDAV_FILES_SIGN)){n.signedFiles=a.UF_TASK_WEBDAV_FILES_SIGN}n.sliderUrl=e.data.link;var s=n.getLinkWithAnalytics(e.data.link,t);BX.SidePanel.Instance.open(s,{requestMethod:"post",requestParams:a,cacheable:false})}))}else{this.createTaskPopup=new a.Popup("BXCTP",null,{autoHide:false,zIndex:0,offsetLeft:0,offsetTop:0,overlay:false,lightShadow:true,closeIcon:{right:"12px",top:"10px"},draggable:{restrict:true},closeByEsc:false,contentColor:"white",contentNoPaddings:true,buttons:[],content:i.Tag.render(p||(p=babelHelpers.taggedTemplateLiteral(['<div id="BXCTP_content" class="','"></div>'])),this.cssClass.popupContent),events:{onAfterPopupShow:function e(){n.createTaskSetContent(i.Tag.render(f||(f=babelHelpers.taggedTemplateLiteral(['<div class="','">',"</div>"])),n.cssClass.popupTitle,i.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_WAIT")));i.ajax.runAction("socialnetwork.api.livefeed.getRawEntryData",{data:{params:{entityType:t.entityType,entityId:t.entityId,logId:i.Type.isNumber(t.logId)?t.logId:null,additionalParams:{getSonetGroupAvailable:"Y",getLivefeedUrl:"Y",checkPermissions:{feature:"tasks",operation:"create_tasks"}}}}}).then((function(e){var a=i.Type.isStringFilled(e.data.TITLE)?e.data.TITLE:"";var s=i.Type.isStringFilled(e.data.DESCRIPTION)?e.data.DESCRIPTION:"";var o=i.Type.isPlainObject(e.data.DISK_OBJECTS)?e.data.DISK_OBJECTS:[];var l=i.Type.isStringFilled(e.data.LIVEFEED_URL)?e.data.LIVEFEED_URL:"";var r=i.Type.isStringFilled(e.data.SUFFIX)?e.data.SUFFIX:"";var c=i.Type.isPlainObject(e.data.GROUPS_AVAILABLE)?e.data.GROUPS_AVAILABLE:[];var d=!i.Type.isUndefined(e.data.LOG_ID)?parseInt(e.data.LOG_ID):0;if((i.Type.isStringFilled(a)||i.Type.isStringFilled(s))&&i.Type.isStringFilled(l)){var u=n.formatTaskDescription(s,l,t.entityType,r);var p={TITLE:a,DESCRIPTION:u,RESPONSIBLE_ID:i.Loc.getMessage("USER_ID"),CREATED_BY:i.Loc.getMessage("USER_ID"),UF_TASK_WEBDAV_FILES:o};var f=[];for(var m=0,g=Object.entries(c);m<g.length;m++){var h=babelHelpers.slicedToArray(g[m],2),v=h[0],y=h[1];f.push(y)}if(f.length==1){p.GROUP_ID=parseInt(f[0])}if(parseInt(t.entityType)>0){p.PARENT_ID=parseInt(t.entityType)}i.ajax.runComponentAction("bitrix:tasks.task","legacyAdd",{mode:"class",data:{data:p}}).then((function(e){var a=e.data;n.createTaskSetContentSuccess(a.DATA.ID);i.ajax.runAction("socialnetwork.api.livefeed.createEntityComment",{data:{params:{postEntityType:i.Type.isStringFilled(t.postEntityType)?t.postEntityType:t.entityType,sourceEntityType:t.entityType,sourceEntityId:t.entityId,entityType:"TASK",entityId:a.DATA.ID,logId:i.Type.isNumber(t.logId)?t.logId:d>0?d:null}}}).then((function(){}),(function(){}))}),(function(e){if(e.errors&&e.errors.length){var t=[];e.errors.forEach((function(e){t.push(e.message)}));n.createTaskSetContentFailure(t)}}))}else{n.createTaskSetContentFailure([i.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_ERROR_GET_DATA")])}}),(function(){n.createTaskSetContentFailure([i.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_ERROR_GET_DATA")])}))},onPopupClose:function e(){n.createTaskPopup.destroy()}}});this.createTaskPopup.show()}}},{key:"getLinkWithAnalytics",value:function e(t,n){var a=i.Type.isStringFilled(n.postEntityType)?n.postEntityType:n.entityType;var s=i.Type.isNil(n.postEntityType)?"context_menu":"comment_context_menu";var o;switch(a){case"TASK":o="tasks";break;case"CALENDAR_EVENT":o="calendar";break;default:o="feed";break}return BX.Uri.addParam(t,{ta_sec:o,ta_el:s})}},{key:"createTaskSetContentSuccess",value:function e(t){var n=i.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_PATH").replace("#user_id#",i.Loc.getMessage("USER_ID")).replace("#task_id#",t);this.createTaskPopup.destroy();window.top.BX.UI.Notification.Center.notify({content:i.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_SUCCESS_TITLE"),actions:[{title:i.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_VIEW"),events:{click:function e(t,a,i){a.close();window.top.BX.SidePanel.Instance.open(n)}}}]})}},{key:"createTaskSetContentFailure",value:function e(t){this.createTaskSetContent(i.Tag.render(m||(m=babelHelpers.taggedTemplateLiteral(['<div>\n\t\t\t<div class="','">','</div>\n\t\t\t<div class="','">',"</div>\n\t\t</div>"])),this.cssClass.popupTitle,i.Loc.getMessage("SONET_EXT_LIVEFEED_CREATE_TASK_FAILURE_TITLE"),this.cssClass.popupDescription,t.join("<br>")))}},{key:"createTaskSetContent",value:function e(t){var n=document.getElementById("BXCTP_content");if(!n){return}i.Dom.clean(n);n.appendChild(t)}},{key:"formatTaskDescription",value:function e(t,n,a,s){var o=t;s=i.Type.isStringFilled(s)?"_".concat(s):"";if(!!n&&!!a&&n.length>0){o+="\n\n"+i.Loc.getMessage("SONET_EXT_COMMENTAUX_CREATE_TASK_".concat(a).concat(s)).replace("#A_BEGIN#","[URL=".concat(n,"]")).replace("#A_END#","[/URL]")}return o}}]);return e}();babelHelpers.defineProperty(g,"createTaskPopup",null);babelHelpers.defineProperty(g,"cssClass",{popupContent:"feed-create-task-popup-content",popupTitle:"feed-create-task-popup-title",popupDescription:"feed-create-task-popup-description"});babelHelpers.defineProperty(g,"signedFiles",null);babelHelpers.defineProperty(g,"sliderUrl","");var h;var v=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"showBackgroundWarning",value:function e(n){var s=n.urlToEdit,o=n.menuPopupWindow;var l=i.Tag.render(h||(h=babelHelpers.taggedTemplateLiteral(["<div>","</div>"])),i.Loc.getMessage("SONET_EXT_LIVEFEED_POST_BACKGROUND_EDIT_WARNING_DESCRIPTION"));var r=new a.Popup("backgroundWarning",null,{autoHide:true,closeByEsc:true,offsetLeft:0,offsetTop:0,draggable:true,bindOnResize:false,titleBar:i.Loc.getMessage("SONET_EXT_LIVEFEED_POST_BACKGROUND_EDIT_WARNING_TITLE"),closeIcon:true,className:"sonet-livefeed-popup-warning",content:l,events:{},cacheable:false,buttons:[new t.Button({text:i.Loc.getMessage("SONET_EXT_LIVEFEED_POST_BACKGROUND_EDIT_WARNING_BUTTON_SUBMIT"),className:"ui-btn ui-btn-primary",events:{click:function e(){window.location=s;r.close();if(o){o.close()}}}}),new t.Button({text:i.Loc.getMessage("SONET_EXT_LIVEFEED_POST_BACKGROUND_EDIT_WARNING_BUTTON_CANCEL"),className:"ui-btn ui-btn-light",events:{click:function e(){r.close();if(o){o.close()}}}})]});r.show();return false}},{key:"showMenu",value:function e(t){var n=this;if(!i.Type.isPlainObject(t)){t={}}var s=t.menuElement;var o=t.ind;var l=this.getMenuId(o);a.MenuManager.destroy(l);var r=!i.Type.isUndefined(t.log_id)?parseInt(t.log_id):0;if(r<=0){r=parseInt(s.getAttribute("data-log-entry-log-id"))}if(r<=0){return false}var c=t.bFavorites;if(i.Type.isUndefined(c)){c=s.getAttribute("data-log-entry-favorites")==="Y"}var d=t.arMenuItemsAdditional;if(i.Type.isUndefined(d)){d=s.getAttribute("data-bx-items");try{d=JSON.parse(d);if(!i.Type.isPlainObject(d)){d={}}}catch(e){d={}}}var u=t.bindElement;var p=null;var f=u.closest("[data-livefeed-post-pinned]");if(f){var m=f.getAttribute("data-livefeed-post-pinned")==="Y";p={text:m?i.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_PINNED_Y"):i.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_PINNED_N"),className:"menu-popup-no-icon",onclick:function e(t){x.changePinned({logId:r,newState:m?"N":"Y",event:t,node:u});a.MenuManager.getMenuById(n.getMenuId(o)).popupWindow.close();t.preventDefault()}}}var h=i.Loc.getMessage("sonetLbUseFavorites")!=="N"?{text:c?i.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_Y"):i.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_N"),className:"menu-popup-no-icon",onclick:function e(t){__logChangeFavorites(r,"log_entry_favorites_".concat(r),c?"N":"Y",true,t);t.preventDefault();t.stopPropagation()}}:null;var v=[p,h,i.Type.isStringFilled(s.getAttribute("data-log-entry-url"))?{html:'<span id="'.concat(l,'-href-text">').concat(i.Loc.getMessage("sonetLMenuHref"),"</span>"),className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-href",href:s.getAttribute("data-log-entry-url")}:null,i.Type.isStringFilled(s.getAttribute("data-log-entry-url"))?{html:'<span id="'.concat(l,'-link-text">').concat(i.Loc.getMessage("sonetLMenuLink"),"</span>")+'<span id="'.concat(l,'-link-icon-animate" class="post-menu-link-icon-wrap">')+'<span class="post-menu-link-icon" id="'.concat(l,'-link-icon-done" style="display: none;">')+"</span>"+"</span>",className:"menu-popup-no-icon feed-entry-popup-menu feed-entry-popup-menu-link",onclick:function e(t){var n=document.getElementById("".concat(l,"-link-text"));var a=document.getElementById("".concat(l,"-link-icon-done"));if(BX.clipboard.isCopySupported()){if(n&&n.getAttribute("data-block-click")==="Y"){return}BX.clipboard.copy(s.getAttribute("data-log-entry-url"));if(n&&a){a.style.display="inline-block";document.getElementById("".concat(l,"-link-icon-animate")).classList.remove("post-menu-link-icon-animate");i.Dom.adjust(document.getElementById("".concat(l,"-link-text")),{attrs:{"data-block-click":"Y"}});setTimeout((function(){document.getElementById("".concat(l,"-link-icon-animate")).classList.add("post-menu-link-icon-animate")}),1);setTimeout((function(){i.Dom.adjust(document.getElementById("".concat(l,"-link-text")),{attrs:{"data-block-click":"N"}})}),500)}return}var o=t.currentTarget;var r=parseInt(!!o.getAttribute("bx-height")?o.getAttribute("bx-height"):o.offsetHeight);if(o.getAttribute("bx-status")!=="shown"){o.setAttribute("bx-status","shown");var c=document.getElementById("".concat(l,"-link-text"));if(!document.getElementById("".concat(l,"-link"))&&!!c){var d=BX.pos(c);var u=BX.pos(c.parentNode);var p=BX.pos(c.closest(".menu-popup-item"));d.height=u.height-1;i.Dom.adjust(o,{attrs:{"bx-height":o.offsetHeight},style:{overflow:"hidden",display:"block"},children:[i.Dom.create("BR"),i.Dom.create("DIV",{attrs:{id:"".concat(l,"-link")},children:[i.Dom.create("SPAN",{attrs:{className:"menu-popup-item-left"}}),i.Dom.create("SPAN",{attrs:{className:"menu-popup-item-icon"}}),i.Dom.create("SPAN",{attrs:{className:"menu-popup-item-text"},children:[i.Dom.create("INPUT",{attrs:{id:"".concat(l,"-link-input"),type:"text",value:s.getAttribute("data-log-entry-url")},style:{height:"".concat(d.height,"px"),width:"".concat(p.width-21,"px")},events:{click:function e(t){t.currentTarget.select();t.stopPropagation();t.preventDefault()}}})]})]}),i.Dom.create("SPAN",{attrs:{className:"menu-popup-item-right"}})]});Event.bind(document.getElementById("".concat(l,"-link-input")),"click",(function(e){e.currentTarget.select();e.preventDefault();e.stopPropagation()}))}new BX.fx({time:.2,step:.05,type:"linear",start:r,finish:r*2,callback:function(e){this.style.height="".concat(e,"px")}.bind(o)}).start();BX.fx.show(document.getElementById("".concat(l,"-link")),.2);document.getElementById("".concat(l,"-link-input")).select()}else{o.setAttribute("bx-status","hidden");new BX.fx({time:.2,step:.05,type:"linear",start:o.offsetHeight,finish:r,callback:function(e){this.style.height="".concat(e,"px")}.bind(o)}).start();BX.fx.hide(document.getElementById("".concat(l,"-link")),.2)}}}:null,i.Loc.getMessage("sonetLCanDelete")==="Y"?{text:i.Loc.getMessage("sonetLMenuDelete"),className:"menu-popup-no-icon",onclick:function e(t){if(confirm(i.Loc.getMessage("sonetLMenuDeleteConfirm"))){M["delete"]({logId:r,nodeId:"log-entry-".concat(r),ind:o})}t.stopPropagation();t.preventDefault()}}:null,s.getAttribute("data-log-entry-createtask")==="Y"?{text:i.Loc.getMessage("sonetLMenuCreateTask"),className:"menu-popup-no-icon",onclick:function e(t){g.create({entryEntityType:s.getAttribute("data-log-entry-entity-type"),entityType:s.getAttribute("data-log-entry-entity-type"),entityId:s.getAttribute("data-log-entry-entity-id"),logId:parseInt(s.getAttribute("data-log-entry-log-id"))});a.MenuManager.getMenuById(n.getMenuId(o)).popupWindow.close();return t.preventDefault()}}:null,s.getAttribute("data-log-entry-createtask")==="Y"&&s.getAttribute("data-log-entry-entity-type")==="TASK"?{text:i.Loc.getMessage("sonetLMenuCreateSubTask"),className:"menu-popup-no-icon",onclick:function e(t){g.create({entryEntityType:s.getAttribute("data-log-entry-entity-type"),entityType:s.getAttribute("data-log-entry-entity-type"),entityId:s.getAttribute("data-log-entry-entity-id"),logId:parseInt(s.getAttribute("data-log-entry-log-id")),parentTaskId:parseInt(s.getAttribute("data-log-entry-entity-id"))});a.MenuManager.getMenuById(n.getMenuId(o)).popupWindow.close();return t.preventDefault()}}:null];if(!!d&&i.Type.isArray(d)){d.forEach((function(e){if(i.Type.isUndefined(e.className)){e.className="menu-popup-no-icon"}}));v=v.concat(d)}var y={offsetLeft:-14,offsetTop:4,lightShadow:false,angle:{position:"top",offset:50},events:{onPopupShow:function e(t){if(document.getElementById("log_entry_favorites_".concat(r))){var n=null;var a=t.contentContainer.querySelectorAll(".menu-popup-item-text");a.forEach((function(e){if(e.innerHTML===i.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_Y")||e.innerHTML===i.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_N")){n=e}}));if(i.Type.isDomNode(n)){n.innerHTML=document.getElementById("log_entry_favorites_".concat(r)).classList.contains("feed-post-important-switch-active")?i.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_Y"):i.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_N")}}if(document.getElementById("".concat(l,"-link"))){var s=t.popupContainer.querySelector(".feed-entry-popup-menu-link");if(s){var o=parseInt(!!s.getAttribute("bx-height")?s.getAttribute("bx-height"):0);if(o>0){document.getElementById("".concat(l,"-link")).style.display="none";s.setAttribute("bx-status","hidden");s.style.height="".concat(o,"px")}}}}}};a.MenuManager.show(this.getMenuId(o),u,v,y)}},{key:"getMenuId",value:function e(t){return"post-menu-".concat(t)}},{key:"editSpacesPost",value:function e(t,a){var i=new n.PostForm({postId:t,groupId:a});i.show()}}]);return e}();var y=function(){function e(){babelHelpers.classCallCheck(this,e);this.container=null;this.wrap=null;this.plus=null;this.value=null;this.currentSiteId=null;this.currentCounterType=null;this.counterDecrementStack=0;this.counterValue=0;this.lockCounterAnimation=null;this.isSpaceFeatureEnabled=null;this.currentUserId=null;this.currentSpaceId=null;this["class"]={informerFixed:"feed-new-message-informer-fixed",informerAnimation:"feed-new-message-informer-anim",informerFixedAnimation:"feed-new-message-informer-fix-anim",counterText:"feed-new-message-inf-text",counterContainer:"feed-new-message-inf-text-counter",reloadContainer:"feed-new-message-inf-text-reload",icon:"feed-new-message-icon",iconRotating:"new-message-balloon-icon-rotating",plusHidden:"feed-new-message-informer-counter-plus-hidden"}}babelHelpers.createClass(e,[{key:"init",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var n={isSpaceFeatureEnabled:false,userId:null,spaceId:null};var a=t||n,i=a.isSpaceFeatureEnabled,s=a.userId,o=a.spaceId;this.isSpaceFeatureEnabled=i;this.currentUserId=s;this.currentSpaceId=o;this.initNodes();this.initEvents()}},{key:"initNodes",value:function e(){this.currentCounterType=i.Loc.hasMessage("sonetLCounterType")?i.Loc.getMessage("sonetLCounterType"):"**";this.currentSiteId=i.Loc.getMessage("SITE_ID");this.container=document.getElementById("sonet_log_counter_2_container");if(this.container){this.container.addEventListener("click",this.showReloadAnimation.bind(this))}this.wrap=document.getElementById("sonet_log_counter_2_wrap");this.plus=document.getElementById("sonet_log_counter_2_plus");this.value=document.getElementById("sonet_log_counter_2")}},{key:"initEvents",value:function e(){var t=this;s.EventEmitter.subscribe("onGoUp",(function(e){t.unfixWrap()}));this.isSpaceFeatureEnabled?this.subscribeOnSpaceCounters():this.subscribeOnLiveFeedCounters();s.EventEmitter.subscribe("onImUpdateCounter",(function(e){var n=e.getCompatData(),a=babelHelpers.slicedToArray(n,1),s=a[0];if(t.isSpaceFeatureEnabled||!i.Type.isObjectLike(s)||i.Type.isUndefined(s[t.currentCounterType])){return}t.changeCounter(s[t.currentCounterType])}));s.EventEmitter.subscribe("OnUCCommentWasRead",(function(e){if(t.isSpaceFeatureEnabled){return}var n=e.getData(),a=babelHelpers.slicedToArray(n,3),o=a[0],l=a[1],r=a[2];if(!i.Type.isObjectLike(r)||!r.live||!r["new"]){return}s.EventEmitter.emit("onCounterDecrement",new s.BaseEvent({compatData:[1]}));t.decrementCounter(1)}))}},{key:"subscribeOnSpaceCounters",value:function e(){var t=this;s.EventEmitter.subscribe("onPullEvent-socialnetwork",(function(e){var n,a;var i=e.getData(),s=babelHelpers.slicedToArray(i,2),o=s[0],l=s[1];var r=(n=l.userId)!==null&&n!==void 0?n:null;var c=(a=l.spaces)!==null&&a!==void 0?a:[];if(o!=="user_spaces_counter"||parseInt(t.currentUserId)!==parseInt(r)){return}var d=c.find((function(e){return e.id===parseInt(t.currentSpaceId)}));var u=d&&d.metrics&&d.metrics.countersLiveFeedTotal?d.metrics.countersLiveFeedTotal:0;t.changeCounter(u)}))}},{key:"subscribeOnLiveFeedCounters",value:function e(){var t=this;s.EventEmitter.subscribe("onPullEvent-main",(function(e){var n=e.getData(),a=babelHelpers.slicedToArray(n,2),s=a[0],o=a[1];if(s!=="user_counter"||!o[t.currentSiteId]||!o[t.currentSiteId][t.currentCounterType]){return}t.changeCounter(i.Runtime.clone(o[t.currentSiteId][t.currentCounterType]))}))}},{key:"changeCounter",value:function e(t){this.counterValue=parseInt(t);if(this.counterValue<=0){this.counterDecrementStack=0}var n=this.counterValue-this.counterDecrementStack;this.changeAnimate({show:n>0,counter:n,zeroCounterFromDb:n<=0})}},{key:"changeAnimate",value:function e(t){var n=this;var a=!!t.show;var i=parseInt(t.counter);var s=!!t.zeroCounterFromDb;if(!this.container){return}var o=this.container.querySelector("span.".concat(this["class"].counterText));var l=this.container.querySelector("span.".concat(this["class"].reloadContainer));if(this.lockCounterAnimation){setTimeout((function(){n.changeAnimate({show:a,counter:i})}),200);return false}if(a){if(this.value){this.value.innerHTML=i}this.showWrapAnimation();if(this.plus&&l&&!l.classList.contains("--hidden")&&o){l.classList.add("--hidden");o.classList.remove("--hidden");this.plus.classList.remove("".concat(this["class"].plusHidden))}}else if(this.wrap){if(s&&this.wrap.classList.contains("".concat(this["class"].informerAnimation))){if(o&&l){o.classList.add("--hidden");l.classList.remove("--hidden");this.hideReloadAnimation()}}else{setTimeout((function(){n.hideWrapAnimation()}),400)}}}},{key:"showWrapAnimation",value:function e(){if(!this.wrap){return}this.wrap.style.visibility="visible";this.wrap.classList.add("".concat(this["class"].informerAnimation))}},{key:"hideWrapAnimation",value:function e(){if(!this.wrap){return}this.wrap.classList.remove("".concat(this["class"].informerAnimation));this.wrap.style.visibility="hidden"}},{key:"showReloadAnimation",value:function e(){if(!this.container){return}var t=this.container.querySelector("span.".concat(this["class"].icon));if(t){t.classList.add(this["class"].iconRotating)}}},{key:"hideReloadAnimation",value:function e(){if(!this.container){return}var t=this.container.querySelector("span.".concat(this["class"].icon));if(t){t.classList.remove(this["class"].iconRotating)}}},{key:"onFeedScroll",value:function e(){if(!this.container||!this.wrap){return}var t=this.wrap.parentNode.getBoundingClientRect().top;if(t<=53){this.fixWrap()}else{this.unfixWrap()}}},{key:"fixWrap",value:function e(){if(!this.wrap){return}this.wrap.classList.add("".concat(this["class"].informerFixed),"".concat(this["class"].informerFixedAnimation))}},{key:"unfixWrap",value:function e(){if(!this.wrap){return}this.wrap.classList.remove("".concat(this["class"].informerFixed),"".concat(this["class"].informerFixedAnimation))}},{key:"recover",value:function e(){if(!this.container){return}var t=this.container.querySelector("span.".concat(this["class"].counterContainer));if(!t){return}t.classList.remove("--hidden");this.hideReloadNode();if(this.plus){this.plus.classList.add("".concat(this["class"].plusHidden))}}},{key:"hideReloadNode",value:function e(){if(!this.container){return}var t=this.container.querySelector("span.".concat(this["class"].reloadContainer));if(!t){return}t.classList.add("--hidden")}},{key:"decrementCounter",value:function e(t){this.counterDecrementStack+=parseInt(t);if(!this.value){return}var n=this.counterValue-this.counterDecrementStack;if(n>0){this.value.innerHTML=n}else{this.changeAnimate({show:false,counter:0})}}},{key:"getWrap",value:function e(){return this.wrap}}]);return e}();var E=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"showRefreshFade",value:function e(){var t=this;var n=document.getElementById("log_internal_container");if(n){n.classList.add(this.cssClass.feedMask);n.classList.remove(this.cssClass.feedNoMask)}var a=document.getElementById("feed-loader-container");if(a){a.style.display="block";a.classList.remove(this.cssClass.hideLoader);setTimeout((function(){a.classList.add(t.cssClass.showLoader)}),0)}}},{key:"hideRefreshFade",value:function e(){var t=document.getElementById("log_internal_container");if(t){t.classList.remove(this.cssClass.feedMask);t.classList.add(this.cssClass.feedNoMask)}var n=document.getElementById("feed-loader-container");if(n){n.classList.remove(this.cssClass.showLoader);n.classList.add(this.cssClass.hideLoader)}}}]);return e}();babelHelpers.defineProperty(E,"cssClass",{feedMask:"log-internal-mask",feedNoMask:"log-internal-nomask",showLoader:"livefeed-show-loader",hideLoader:"livefeed-hide-loader"});babelHelpers.defineProperty(E,"onAnimationEnd",(function(e){if("animationName"in e&&e.animationName&&e.animationName==="hideLoader"){var t=document.getElementById("feed-loader-container");if(!t){return}t.classList.remove(E.cssClass.showLoader);t.classList.remove(E.cssClass.hideLoader);t.style.display=""}}));var T=function(){function e(){babelHelpers.classCallCheck(this,e);s.EventEmitter.subscribe("BX.Livefeed:recalculateComments",this.onRecalculateLivefeedComments.bind(this))}babelHelpers.createClass(e,[{key:"onRecalculateLivefeedComments",value:function t(n){var a=n.getCompatData(),s=babelHelpers.slicedToArray(a,1),o=s[0];if(!i.Type.isDomNode(o.rootNode)){return}var l=o.rootNode;var r=l.querySelector(".".concat(e.cssClass.more));if(r){l.classList.remove(e.cssClass.postSeparator)}e.recalcPost({arPos:{height:o.rootNode.offsetHeight+o.rootNode.offsetTop},informerBlock:l})}}],[{key:"recalcPost",value:function e(t){if(!i.Type.isDomNode(t.informerBlock)){return}var n=!i.Type.isUndefined(t.arPos)?t.arPos.height:t.bodyBlock.offsetHeight;var a=t.informerBlock.closest(".".concat(this.cssClass.post));if(!a){return}if(n<=284){a.classList.add(this.cssClass.postShort);a.classList.add(this.cssClass.postSeparator)}else{a.classList.remove(this.cssClass.postShort)}}},{key:"recalcPostsList",value:function e(){var t=this;var n=M.getMoreButtons();n.forEach((function(e,a){if(!i.Type.isPlainObject(e)||!i.Type.isStringFilled(e.bodyBlockID)){return}var s=document.getElementById(e.bodyBlockID);if(!s){return}if(i.Type.isStringFilled(e.outerBlockID)){var o=document.getElementById(e.outerBlockID);if(o){if(o.offsetWidth<s.offsetWidth){var l=o.querySelector("div.".concat(t.cssClass.postTextInner));l.style.overflowX="scroll"}var r=o.querySelector(".".concat(t.cssClass.more));if(r){i.Event.unbindAll(r,"click");i.Event.bind(r,"click",(function(e){BX.UI.Animations.expand({moreButtonNode:e.currentTarget,type:"post",classBlock:t.cssClass.postText,classOuter:t.cssClass.postTextInner,classInner:t.cssClass.postTextInnerInner,heightLimit:300,callback:function e(n){t.expand(n)}})}));r.hasClickListener=true}}}t.recalcPost({arPos:{height:s.offsetHeight+s.offsetTop},informerBlock:i.Type.isStringFilled(e.informerBlockID)?document.getElementById(e.informerBlockID):null});n["delete"](a)}));M.setMoreButtons(n);var a=document.getElementById("log_internal_container");if(!a){return}var s=a.querySelectorAll('[data-bx-onload="Y"]');s.forEach((function(e){e.addEventListener("load",(function(e){var n=e.currentTarget.closest(".".concat(t.cssClass.comment));if(!n){n=e.currentTarget.closest(".".concat(t.cssClass.post));if(n){var a=n.querySelector(".".concat(t.cssClass.postTextInnerInner));if(a){t.recalcPost({bodyBlock:a,informerBlock:n.querySelector(".".concat(t.cssClass.more))})}}}e.currentTarget.setAttribute("data-bx-onload","N")}))}))}},{key:"recalcCommentsList",value:function e(){s.EventEmitter.emit("OnUCMoreButtonListRecalc",new s.BaseEvent({compatData:[]}))}},{key:"clearCommentsList",value:function e(){s.EventEmitter.emit("OnUCMoreButtonListClear",new s.BaseEvent({compatData:[]}))}},{key:"expand",value:function e(t){if(!i.Type.isDomNode(t)){return}var n=t.closest(".".concat(this.cssClass.post));if(!n){return}n.classList.add(this.cssClass.postShort);n.classList.add(this.cssClass.postSeparator)}},{key:"lazyLoadCheckVisibility",value:function e(t){if(!i.Type.isPlainObject(t)||!i.Type.isDomNode(t.node)){return true}var n=t.node;var a="comment";var s=n.closest(".".concat(this.cssClass.comment));if(!s){a="post";s=n.closest(".".concat(this.cssClass.postText))}if(!s){return true}var o=s.querySelector("div.".concat(this.cssClass.more));if(!o||o.style.display==="none"){return true}return n.parentNode.parentNode.offsetTop<(a==="comment"?220:270)}}]);return e}();babelHelpers.defineProperty(T,"cssClass",{post:"feed-post-block",postShort:"feed-post-block-short",postSeparator:"feed-post-block-separator",postText:"feed-post-text-block",postTextInner:"feed-post-text-block-inner",postTextInnerInner:"feed-post-text-block-inner-inner",more:"feed-post-text-more",comment:"feed-com-text"});var I=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"processSpoilerToggle",value:function e(t){var n=t.getCompatData(),a=babelHelpers.slicedToArray(n,1),s=a[0];if(!i.Type.isPlainObject(s)){s={}}if(!i.Type.isDomNode(s.node)){return}var o=s.node.closest(".feed-post-block");if(!o){return}var l=o.querySelector(".feed-post-text-block-inner-inner");if(!l){return}var r=o.querySelector(".feed-post-text-more");T.recalcPost({bodyBlock:l,informerBlock:r})}}]);return e}();babelHelpers.defineProperty(I,"cssClass",{});var b=function(){function e(){babelHelpers.classCallCheck(this,e);this.filterId="";this.filterApi=null}babelHelpers.createClass(e,[{key:"init",value:function e(t){if(!i.Type.isPlainObject(t)){t={}}if(i.Type.isStringFilled(t.filterId)&&!i.Type.isUndefined(BX.Main)&&!i.Type.isUndefined(BX.Main.filterManager)){var n=BX.Main.filterManager.getById(t.filterId);this.filterId=t.filterId;if(n){this.filterApi=n.getApi()}}this.initEvents()}},{key:"initEvents",value:function e(){s.EventEmitter.subscribe("BX.Livefeed.Filter:beforeApply",(function(e){E.showRefreshFade()}));s.EventEmitter.subscribe("BX.Livefeed.Filter:apply",(function(e){var t=e.getCompatData(),n=babelHelpers.slicedToArray(t,3),a=n[0],i=n[1],s=n[2];if(typeof s!="undefined"){s.autoResolve=false}U.refresh({useBXMainFilter:"Y"},i)}));s.EventEmitter.subscribe("BX.Livefeed.Filter:searchInput",(function(e){var t=e.getCompatData(),n=babelHelpers.slicedToArray(t,1),a=n[0];if(i.Type.isStringFilled(a)){E.showRefreshFade()}else{E.hideRefreshFade()}}))}},{key:"initEventsCrm",value:function e(){s.EventEmitter.subscribe("BX.Livefeed.Filter:searchInput",(function(){U.refresh()}))}},{key:"clickTag",value:function e(t){if(!i.Type.isStringFilled(t)||!this.filterApi){return false}this.filterApi.setFields({TAG:t});this.filterApi.apply();if(i.Type.isStringFilled(this.filterId)&&!i.Type.isUndefined(BX.Main)&&!i.Type.isUndefined(BX.Main.filterManager)){var n=document.getElementById("".concat(this.filterId,"_filter_container"));if(n&&BX.Main.filterManager.getById(this.filterId)&&(BX.Main.filterManager.getById(this.filterId).getSearch().getSquares().length>0||BX.Main.filterManager.getById(this.filterId).getSearch().getSearchString().length>0)){var a=n.closest(".pagetitle-wrap");if(a){a.classList.add("pagetitle-wrap-filter-opened")}}}new BX.easing({duration:500,start:{scroll:window.pageYOffset},finish:{scroll:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function e(t){window.scrollTo(0,t.scroll)},complete:function e(){}}).animate();return true}}]);return e}();var _=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"registerAreaList",value:function e(){var t=BX("log_internal_container"),n=null;if(t){var a=BX.findChildren(t,{tag:"div",className:"feed-post-contentview"},true);for(var i=0,s=a.length;i<s;i++){if(a[i].id.length>0){n=BX.findChild(a[i],{tag:"div",className:"feed-post-text-block-inner-inner"});BX.UserContentView.registerViewArea(a[i].id,n?n:null)}}}}}]);return e}();var S,L;var C=function(){function e(){var t=this;babelHelpers.classCallCheck(this,e);this.loadStarted=null;this.stopTrackNextPage=null;this.requestMode=null;this.nextPageFirst=null;this.nextPageUrl=null;this.scrollInitialized=null;this.firstPageLastTS=0;this.firstPageLastId=0;this.useBXMainFilter="N";this.commentFormUID="";this.blogCommentFormUID="";this.signedParameters="";this.componentName="";this.context="";this["class"]={};i.Event.ready((function(){t.init()}))}babelHelpers.createClass(e,[{key:"init",value:function e(){this.loadStarted=false;this.stopTrackNextPage=false;this.requestMode=false;this.nextPageFirst=true;this.nextPageUrl=false;this.scrollInitialized=false}},{key:"refresh",value:function e(t,n){var a=this;if(this.loadStarted){return}this.setRequestModeNew();t=i.Type.isPlainObject(t)?t:{};t.siteTemplateId=i.Loc.getMessage("SONET_EXT_LIVEFEED_SITE_TEMPLATE_ID");t.assetsCheckSum=i.Loc.getMessage("sonetLAssetsCheckSum");t.context=i.Type.isStringFilled(t.context)?t.context:this.context;this.loadStarted=true;E.showRefreshFade();T.clearCommentsList();M.clearMoreButtons();if(i.Type.isStringFilled(this.commentFormUID)){t.commentFormUID=this.commentFormUID}if(!i.Type.isStringFilled(t.useBXMainFilter)||t.useBXMainFilter!=="Y"){s.EventEmitter.emit("BX.Livefeed:refresh",new s.BaseEvent({compatData:[]}))}O.hideReloadNode();O.lockCounterAnimation=true;this.loadStarted=false;i.ajax.runAction("socialnetwork.api.livefeed.refresh",{signedParameters:this.getSignedParameters(),data:{c:this.getComponentName(),logajax:"Y",RELOAD:"Y",params:t}}).then((function(e){var t=i.Type.isPlainObject(e.data)?e.data:{};a.loadStarted=false;E.hideRefreshFade();if(n){n.fulfill()}var o=i.Type.isPlainObject(t.componentResult)&&i.Type.isStringFilled(t.componentResult.EMPTY)?t.componentResult.EMPTY:"N";var l=i.Type.isPlainObject(t.componentResult)&&i.Type.isStringFilled(t.componentResult.FORCE_PAGE_REFRESH)?t.componentResult.FORCE_PAGE_REFRESH:"N";var r=i.Type.isPlainObject(t.componentResult)&&i.Type.isStringFilled(t.componentResult.FILTER_USED)&&t.componentResult.FILTER_USED==="Y";if(l==="Y"){top.window.location.reload();return}var c=document.getElementById("feed-loader-container");O.lockCounterAnimation=false;var d=document.getElementById("log_internal_container");if(!d){return}i.Dom.clean(d);var u=document.getElementById("feed-empty-wrap");if(u){if(o==="Y"){u.style.display="block";var p=u.querySelector(".feed-wrap-empty");if(p){p.innerHTML=r?i.Loc.getMessage("SONET_C30_T_EMPTY_SEARCH"):i.Loc.getMessage("SONET_C30_T_EMPTY")}}else{u.style.display="none"}}if(c){d.appendChild(c)}if(t.html.length>0){a.clearContainerExternal();BX.LazyLoad.clearImages();var f=i.Tag.render(S||(S=babelHelpers.taggedTemplateLiteral(['<div id="content_block_','" class="feed-wrap" style="display: block;"></div>'])),Math.floor(Math.random()*1e3));d.appendChild(f);i.Runtime.html(f,t.html).then((function(){T.recalcPostsList();T.recalcCommentsList();_.registerAreaList();x.resetFlags();x.initPanel();x.initPosts()}));a.stopTrackNextPage=false;T.clearCommentsList();var m=O.getWrap();if(m&&m.classList.contains(O["class"].informerFixed)){new BX.easing({duration:500,start:{scroll:window.pageYOffset},finish:{scroll:0},transition:BX.easing.makeEaseOut(BX.easing.transitions.quart),step:function e(t){window.scrollTo(0,t.scroll)},complete:function e(){s.EventEmitter.emit("onGoUp",[])}}).animate()}}}),(function(){a.loadStarted=false;if(n){n.reject()}E.hideRefreshFade();a.showRefreshError()}));return false}},{key:"getNextPage",value:function e(){var t=this;var n=document.getElementById("feed-new-message-inf-wrap");var a=document.getElementById("feed-new-message-inf-wrap-first");if(this.loadStarted){return false}this.setRequestModeMore();this.loadStarted=true;O.lockCounterAnimation=true;M.clearMoreButtons();if(!this.nextPageFirst&&n){n.style.display="block"}else if(this.nextPageFirst&&a){a.classList.add("feed-new-message-inf-wrap-first-visible")}var o=new i.Uri(this.getNextPageUrl()).getQueryParams();var l=1;var r="";var c=0;var d="N";Object.entries(o).forEach((function(e){var t=babelHelpers.slicedToArray(e,2),n=t[0],a=t[1];if(n.match(/^PAGEN_(\d+)$/i)){l=parseInt(a)}else if(n==="pplogid"){r=decodeURI(a)}else if(n==="ts"){c=a}else if(n==="noblog"){d=a}}));var u={PAGE_NUMBER:l,LAST_LOG_TIMESTAMP:c,PREV_PAGE_LOG_ID:r,siteTemplateId:i.Loc.getMessage("SONET_EXT_LIVEFEED_SITE_TEMPLATE_ID"),useBXMainFilter:this.useBXMainFilter,preset_filter_top_id:i.Type.isStringFilled(o.preset_filter_top_id)&&o.preset_filter_top_id!=="0"?o.preset_filter_top_id:"",preset_filter_id:i.Type.isStringFilled(o.preset_filter_id)&&o.preset_filter_id!=="0"?o.preset_filter_id:""};if(i.Type.isStringFilled(this.commentFormUID)){u.commentFormUID=this.commentFormUID}if(i.Type.isStringFilled(this.blogCommentFormUID)){u.blogCommentFormUID=this.blogCommentFormUID}u.context=this.context;var p={c:this.getComponentName(),logajax:"Y",noblog:d,params:u};if(!i.Type.isUndefined(o.CREATED_BY_ID)){p.flt_created_by_id=parseInt(o.CREATED_BY_ID)}if(!i.Type.isUndefined(o.flt_date_datesel)){p.flt_date_datesel=o.flt_date_datesel}if(!i.Type.isUndefined(o.flt_date_from)){p.flt_date_from=decodeURIComponent(o.flt_date_from)}if(!i.Type.isUndefined(o.flt_date_to)){p.flt_date_to=decodeURIComponent(o.flt_date_to)}i.ajax.runAction("socialnetwork.api.livefeed.getNextPage",{signedParameters:this.getSignedParameters(),data:p}).then((function(e){var n=i.Type.isPlainObject(e.data)?e.data:{};t.loadStarted=false;var o=document.getElementById("feed-new-message-inf-wrap");if(o){i.Dom.clean(o);i.Dom.remove(o)}O.lockCounterAnimation=false;var r=i.Type.isPlainObject(n.componentResult)&&!i.Type.isUndefined(n.componentResult.LAST_TS)?parseInt(n.componentResult.LAST_TS):0;var c=i.Type.isPlainObject(n.componentResult)&&!i.Type.isUndefined(n.componentResult.LAST_ID)?parseInt(n.componentResult.LAST_ID):null;if(n.html.length>0&&r>0&&(parseInt(t.firstPageLastTS)<=0||r<parseInt(t.firstPageLastTS)||r==parseInt(t.firstPageLastTS)&&!i.Type.isNull(c)&&c<parseInt(t.firstPageLastId))){T.clearCommentsList();var d="content_block_".concat(Math.floor(Math.random()*1e3));var u=i.Tag.render(L||(L=babelHelpers.taggedTemplateLiteral(['<div id="','" class="feed-wrap" style="display:',';"></div>'])),d,t.nextPageFirst?"none":"block");var p=document.getElementById("log_internal_container");if(!p){return}p.appendChild(u);i.Runtime.html(u,n.html).then((function(){if(l>2){t.stopTrackNextPage=false;T.recalcPostsList();_.registerAreaList();T.recalcCommentsList();x.resetFlags();x.initPosts()}}));t.clearContainerExternal();if(l===2){document.getElementById("feed-new-message-inf-text-first").style.display="block";document.getElementById("feed-new-message-inf-loader-first").style.display="none";a.classList.add("feed-new-message-inf-wrap-first-active");var f=function e(){t.stopTrackNextPage=false;if(u){u.style.display="block"}i.Event.unbind(document.getElementById("sonet_log_more_container_first"),"click",e);a.style.display="none";T.recalcPostsList();_.registerAreaList();T.recalcCommentsList();s.EventEmitter.emit("BX.Livefeed:recalculateComments",new s.BaseEvent({compatData:[{rootNode:u}]}));x.resetFlags();x.initPosts()};i.Event.bind(document.getElementById("sonet_log_more_container_first"),"click",f)}else{if(u){u.style.display="block"}}t.nextPageFirst=false}else if(document.getElementById("feed-new-message-inf-wrap-first")){document.getElementById("feed-new-message-inf-wrap-first").style.display="none"}}),(function(){t.loadStarted=false;t.stopTrackNextPage=false;var e=document.getElementById("feed-new-message-inf-wrap");if(e){e.style.display="none"}O.lockCounterAnimation=false;t.clearContainerExternal()}));return false}},{key:"clearContainerExternal",value:function e(){if(this.requestMode==="new"){O.hideWrapAnimation();O.recover()}O.hideReloadAnimation();var t=document.getElementById("sonet_log_counter_preset");if(t&&this.requestMode==="new"){t.style.display="none"}}},{key:"setRequestModeNew",value:function e(){this.requestMode="new"}},{key:"setRequestModeMore",value:function e(){this.requestMode="more"}},{key:"showRefreshError",value:function e(){O.lockCounterAnimation=false;this.clearContainerExternal()}},{key:"setSignedParameters",value:function e(t){this.signedParameters=t}},{key:"setContext",value:function e(t){this.context=t}},{key:"getSignedParameters",value:function e(){return this.signedParameters}},{key:"setComponentName",value:function e(t){this.componentName=t}},{key:"getComponentName",value:function e(){return this.componentName}},{key:"setNextPageUrl",value:function e(t){this.nextPageUrl=t}},{key:"getNextPageUrl",value:function e(){return this.nextPageUrl}},{key:"initScroll",value:function e(){if(this.scrollInitialized){return}this.scrollInitialized=true;document.addEventListener("scroll",this.onFeedScroll.bind(this),true)}},{key:"onFeedScroll",value:function e(){if(!this.stopTrackNextPage){var t=document.documentElement.scrollHeight-window.innerHeight-500;if(window.pageYOffset>=t&&this.getNextPageUrl()){this.stopTrackNextPage=true;this.getNextPage()}}O.onFeedScroll()}}]);return e}();var k;var P=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"appendResultFieldTaskIds",value:function e(t){if(!i.Type.isArray(t)){return}t=t.map((function(e){return parseInt(e)}));this.resultFieldTaskIdList=[].concat(babelHelpers.toConsumableArray(this.resultFieldTaskIdList),babelHelpers.toConsumableArray(t))}},{key:"appendTaskResultComments",value:function e(t){if(i.Type.isUndefined(o.ResultManager)){return}this.taskResultCommentsData=Object.assign(this.taskResultCommentsData,t);Object.entries(this.taskResultCommentsData).forEach((function(e){var t=babelHelpers.slicedToArray(e,2),n=t[0],a=t[1];o.ResultManager.getInstance().initResult({context:"task",taskId:parseInt(n),comments:a})}))}},{key:"onAfterShow",value:function e(t,n,a){if(!i.Type.isPlainObject(a)){a={}}s.EventEmitter.emit("OnBeforeSocialnetworkCommentShowedUp",new s.BaseEvent({compatData:["socialnetwork"]}));var o={ENTITY_XML_ID:t.currentEntity.ENTITY_XML_ID,ENTITY_TYPE:t.currentEntity.ENTITY_XML_ID.split("_")[0],ENTITY_ID:t.currentEntity.ENTITY_XML_ID.split("_")[1],parentId:t.id[1],comment_post_id:t.currentEntity.ENTITY_XML_ID.split("_")[1],edit_id:t.id[1],act:t.id[1]>0?"edit":"add"};Object.entries(o).forEach((function(e){var n=babelHelpers.slicedToArray(e,2),a=n[0],s=n[1];if(!t.form[a]){t.form.appendChild(i.Tag.render(k||(k=babelHelpers.taggedTemplateLiteral(['<input type="hidden" name="','">'])),a))}t.form[a].value=s}));this.onLightEditorShow(n,a);if(!BX.Type.isUndefined(BX.Tasks)){var l=t.currentEntity.ENTITY_XML_ID.match(/^TASK_(\d+)$/i);if(l&&this.resultFieldTaskIdList.includes(parseInt(l[1]))){BX.Tasks.ResultManager.showField()}else{BX.Tasks.ResultManager.hideField()}}}},{key:"onLightEditorShow",value:function e(t,n){if(!i.Type.isPlainObject(n)){n={}}var a={};if(i.Type.isPlainObject(n.UF)){a=n.UF}else{if(n.arFiles){var s={};n.arFiles.forEach((function(e,t){var n=document.getElementById("wdif-doc-".concat(e));var a=n.querySelector(".feed-com-file-name");var i=n.querySelector(".feed-con-file-size");s["F".concat(t)]={FILE_ID:e,FILE_NAME:a?a.innerHTML:"noname",FILE_SIZE:i?i.innerHTML:"unknown",CONTENT_TYPE:"notimage/xyz"}}));a.UF_SONET_COM_DOC={USER_TYPE_ID:"file",FIELD_NAME:"UF_SONET_COM_FILE[]",VALUE:s}}if(n.arDocs){a.UF_SONET_COM_FILE={USER_TYPE_ID:"webdav_element",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:i.Runtime.clone(n.arDocs)}}if(n.arDFiles){a.UF_SONET_COM_FILE={USER_TYPE_ID:"disk_file",FIELD_NAME:"UF_SONET_COM_DOC[]",VALUE:i.Runtime.clone(n.arDFiles)}}}LHEPostForm.reinitData(window.SLEC.editorId,t,a)}}]);return e}();babelHelpers.defineProperty(P,"resultFieldTaskIdList",[]);babelHelpers.defineProperty(P,"taskResultCommentsData",{});var N,A;function w(e,t){var n=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=D(e))||t&&e&&typeof e.length==="number"){if(n)e=n;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 s=true,o=false,l;return{s:function t(){n=n.call(e)},n:function e(){var t=n.next();s=t.done;return t},e:function e(t){o=true;l=t},f:function e(){try{if(!s&&n["return"]!=null)n["return"]()}finally{if(o)throw l}}}}function D(e,t){if(!e)return;if(typeof e==="string")return F(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return F(e,t)}function F(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}var B=function(){function e(){babelHelpers.classCallCheck(this,e);this.entryData={};this.feedInitialized=false;this.moreButtonDataList=new Map;this.currentScrollPosition=0}babelHelpers.createClass(e,[{key:"initOnce",value:function e(t){var n=document.getElementById("feed-loader-container");if(!i.Type.isPlainObject(t)){t={}}if(i.Type.isStringFilled(t.signedParameters)){U.setSignedParameters(t.signedParameters)}if(i.Type.isStringFilled(t.context)){U.setContext(t.context)}if(i.Type.isStringFilled(t.componentName)){U.setComponentName(t.componentName)}if(i.Type.isStringFilled(t.commentFormUID)){U.commentFormUID=t.commentFormUID}if(n){i.Event.bind(n,"animationend",E.onAnimationEnd);i.Event.bind(n,"webkitAnimationEnd",E.onAnimationEnd);i.Event.bind(n,"oanimationend",E.onAnimationEnd);i.Event.bind(n,"MSAnimationEnd",E.onAnimationEnd)}s.EventEmitter.subscribe("BX.Forum.Spoiler:toggle",I.processSpoilerToggle);R.init({filterId:t.filterId});O.init({isSpaceFeatureEnabled:t.isSpaceEnabled,userId:t.userId,spaceId:t.spaceId});if(i.Type.isStringFilled(t.crmEntityTypeName)&&!i.Type.isUndefined(t.crmEntityId)&&parseInt(t.crmEntityId)>0){R.initEventsCrm()}BX.UserContentView.init();document.getElementById("log_internal_container").addEventListener("click",(function(e){var t=e.target.getAttribute("bx-tag-value");if(!i.Type.isStringFilled(t)){return}if(R.clickTag(t)){e.preventDefault();e.stopPropagation()}}),true);var a=document.getElementById("feed-notification-notasks-close-btn");var o=document.getElementById("feed-notification-notasks-read-btn");if(a){i.Event.bind(a,"click",this.setNoTasksNotificationRead.bind(this))}if(o){i.Event.bind(o,"click",this.setNoTasksNotificationRead.bind(this))}i.Event.bind(document,"fullscreenchange",this.handleFullScreenChange.bind(this));i.Event.bind(document,"scroll",this.handleScrollChange.bind(this))}},{key:"handleFullScreenChange",value:function e(){if(!this.getFullScreenElement()){window.scrollTo(0,this.currentScrollPosition)}}},{key:"handleScrollChange",value:function e(){if(!this.getFullScreenElement()){this.currentScrollPosition=window.scrollY}}},{key:"getFullScreenElement",value:function e(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||null}},{key:"init",value:function e(){if(this.feedInitialized){return}x.init();this.feedInitialized=true}},{key:"changeFollow",value:function e(t){var n=this;var a=t.logId?parseInt(t.logId):0;if(!a){return false}var s=document.getElementById("log_entry_follow_"+a);var o=s&&s.getAttribute("data-follow")==="Y"?"Y":"N";var l=o==="Y"?"N":"Y";this.renderFollow({logId:a,value:l});i.ajax.runAction("socialnetwork.api.livefeed.changeFollow",{data:{logId:a,value:l},analyticsLabel:{b24statAction:l==="Y"?"setFollow":"setUnfollow"}}).then((function(e){if(!e.data.success){n.renderFollow({logId:a,value:o})}}),(function(){n.renderFollow({logId:a,value:o})}));return false}},{key:"renderFollow",value:function e(t){var n=t.logId?parseInt(t.logId):0;if(!n){return}var a=document.getElementById("log_entry_follow_"+n);var s=t.value&&t.value==="Y"?"Y":"N";if(a){a.setAttribute("data-follow",s)}var o=a?a.querySelector("a"):null;if(o){o.innerHTML=i.Loc.getMessage("SONET_EXT_LIVEFEED_FOLLOW_TITLE_"+s)}var l=a?a.closest(".feed-post-block"):null;if(l){if(s==="N"){l.classList.add("feed-post-block-unfollowed")}else if(s==="Y"){l.classList.remove("feed-post-block-unfollowed")}}}},{key:"changeFavorites",value:function e(t){var n=this;var a=t.logId?parseInt(t.logId):0;var s=t.event?t.event:null;var o=t.node?t.node:null;var l=t.newState?t.newState:null;if(i.Type.isStringFilled(o)){o=document.getElementById(o)}if(!a){return}var r=null;if(s){r=s.target;if(!r.classList.contains("menu-popup-item-text")){r=r.querySelector(".menu-popup-item-text")}}var c=null;if(i.Type.isDomNode(o)){c=o.classList.contains("feed-post-important-switch")?o:o.querySelector(".feed-post-important-switch")}if(typeof this.entryData[a]=="undefined"){this.entryData[a]={}}if(typeof this.entryData[a].favorites!="undefined"){l=this.entryData[a].favorites?"N":"Y";this.entryData[a].favorites=!this.entryData[a].favorites}else if(c){l=c.classList.contains("feed-post-important-switch-active")?"N":"Y";this.entryData[a].favorites=l=="Y"}if(!l){return}this.adjustFavoritesControlItem(c,l);this.adjustFavoritesMenuItem(r,l);i.ajax.runAction("socialnetwork.api.livefeed.changeFavorites",{data:{logId:a,value:l},analyticsLabel:{b24statAction:l=="Y"?"addFavorites":"removeFavorites"}}).then((function(e){if(i.Type.isStringFilled(e.data.newValue)&&["Y","N"].includes(e.data.newValue)){n.entryData[a].favorites=e.data.newValue=="Y"}n.adjustFavoritesControlItem(c,e.data.newValue);n.adjustFavoritesMenuItem(r,e.data.newValue)}),(function(){n.entryData[a].favorites=!n.entryData[a].favorites}))}},{key:"adjustFavoritesMenuItem",value:function e(t,n){if(!i.Type.isDomNode(t)||!["Y","N"].includes(n)){return}t.innerHTML=this.getMenuTitle(n==="Y")}},{key:"adjustFavoritesControlItem",value:function e(t,n){if(!i.Type.isDomNode(t)||!["Y","N"].includes(n)){return}t.title=this.getMenuTitle(n==="Y");if(n=="Y"){t.classList.add("feed-post-important-switch-active")}else{t.classList.remove("feed-post-important-switch-active")}}},{key:"getMenuTitle",value:function e(t){return i.Loc.getMessage("SONET_EXT_LIVEFEED_MENU_TITLE_FAVORITES_".concat(t?"Y":"N"))}},{key:"delete",value:function e(t){var n=this;var s=t.logId?parseInt(t.logId):0;var o=i.Type.isStringFilled(t.nodeId)?document.getElementById(t.nodeId):null;var l=t.ind?t.ind:"";if(s<=0||!o){return}i.ajax.runAction("socialnetwork.api.livefeed.deleteEntry",{data:{logId:s},analyticsLabel:{b24statAction:"deleteLogEntry"}}).then((function(e){if(e.data.success){if(!i.Type.isUndefined(l)){a.MenuManager.destroy(v.getMenuId(l))}n.deleteSuccess(o)}else{n.deleteFailure(o)}}),(function(){n.deleteFailure(o)}))}},{key:"deleteSuccess",value:function e(t){if(!i.Type.isDomNode(t)){return}new BX.fx({time:.5,step:.05,type:"linear",start:t.offsetHeight,finish:56,callback:function e(n){t.style.height="".concat(n,"px")},callback_start:function e(){t.style.overflow="hidden";t.style.minHeight=0},callback_complete:function e(){t.style.marginBottom=0;i.Dom.clean(t);t.classList.add("feed-post-block-deleted");t.appendChild(i.Tag.render(N||(N=babelHelpers.taggedTemplateLiteral(['<div class="feed-add-successfully"><span class="feed-add-info-text"><span class="feed-add-info-icon"></span><span>',"</span></span></span></div>"])),i.Loc.getMessage("SONET_EXT_LIVEFEED_DELETE_SUCCESS")))}}).start()}},{key:"deleteFailure",value:function e(t){if(!i.Type.isDomNode(t)){return}t.insertBefore(i.Tag.render(A||(A=babelHelpers.taggedTemplateLiteral(['<div class="feed-add-error" style="margin: 18px 37px 4px 84px;"><span class="feed-add-info-text"><span class="feed-add-info-icon"></span><span>',"</span></span></div>"])),i.Loc.getMessage("sonetLMenuDeleteFailure")),t.firstChild)}},{key:"setMoreButtons",value:function e(t){this.moreButtonDataList=t}},{key:"getMoreButtons",value:function e(){return this.moreButtonDataList}},{key:"clearMoreButtons",value:function e(){var t=w(this.moreButtonDataList),n;try{for(t.s();!(n=t.n()).done;){var a;var i=n.value;var s=(a=document.getElementById(i.outerBlockID))===null||a===void 0?void 0:a.querySelector(".".concat(T.cssClass.more));if(!(s!==null&&s!==void 0&&s.hasClickListener)){return}}}catch(e){t.e(e)}finally{t.f()}this.moreButtonDataList.clear()}},{key:"addMoreButton",value:function e(t,n){this.moreButtonDataList.set(t,n)}},{key:"setNoTasksNotificationRead",value:function e(t){var n=t.currentTarget.closest(".feed-notification-container");if(!n){return}i.ajax.runAction("socialnetwork.api.livefeed.readNoTasksNotification",{data:{}}).then((function(e){if(!e.data.success){return}n.style.height=n.offsetHeight+"px";setTimeout((function(){n.classList.add("feed-notification-container-collapsed")}),10);setTimeout((function(){n.parentNode.removeChild(n)}),250)}),(function(){}))}}]);return e}();var M=new B;var x=new u;var O=new y;var R=new b;var U=new C;var H=new T;new g;e.FeedInstance=M;e.PinnedPanelInstance=x;e.InformerInstance=O;e.FilterInstance=R;e.PageInstance=U;e.MoreButtonInstance=H;e.Post=v;e.TaskCreator=g;e.Loader=E;e.MoreButton=T;e.ContentView=_;e.CommentForm=P})(this.BX.Livefeed=this.BX.Livefeed||{},BX.UI,BX.Socialnetwork,BX.Main,BX,BX.Event,BX.Tasks);
//# sourceMappingURL=livefeed.bundle.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit