text: (function(e){BX.namespace("BX.Sender");if(BX.Sender.Page){return}function i(){}i.prototype.initButtonPanel=function(){var e="sender-ui-button-panel-";var i=BX(e+"save");var n=BX(e+"cancel");BX.bind(i,"click",function(){BX.addClass(i,"ui-btn-wait");setTimeout(function(){i.disabled=true},100)});if(this.slider.isInSlider()){var t=this;BX.bind(n,"click",function(e){t.slider.close();e.preventDefault();e.stopPropagation()})}};i.prototype.initButtons=function(){var e=BX("SENDER_BUTTON_ADD");if(e){this.slider.bindOpen(e)}this.initButtonPanel()};i.prototype.reloadGrid=function(e){if(!BX.Main||!BX.Main.gridManager){return}if(!e&&BX.Main.gridManager.data){var i=BX.Main.gridManager.data;e=i.length>0?i[0].id:null}if(!e){return}var n=BX.Main.gridManager.getById(e);if(!n){return}n.instance.reload()};i.prototype.changeGridLoaderShowing=function(e,i){var n=BX.Main.gridManager.getById(e);if(!n||!n.instance){return}i?n.instance.tableFade():n.instance.tableUnfade()};i.prototype.open=function(e,i,n){this.slider.open(e,i,n)};i.prototype.slider={init:function(e){if(!this.isSupported()){return}BX.Bitrix24.PageSlider.bindAnchors({rules:[{condition:e.condition,loader:e.loader,stopParameters:[]}]})},getSlider:function(){if(!this.isSupported()){return null}return BX.SidePanel.Instance},isInSlider:function(){return top!==e&&top.BX&&this.isSupported()},isSupported:function(){return BX.SidePanel&&BX.SidePanel.Instance||this.isInSlider()},bindOpen:function(e){if(!this.isSupported()){return}BX.bind(e,"click",this.openHref.bind(this,e))},openHref:function(e,i){if(!this.isSupported()){return}i.preventDefault();i.stopPropagation();var n=e.getAttribute("href");if(!n){return}this.open(n)},open:function(i,n,t){if(!this.isSupported()){e.location.href=i;return}t=t||{};if(!BX.type.isBoolean(t.cacheable)){t.cacheable=false}this.getSlider().open(i,t);if(n){if(!this.getSlider().iframe){return}BX.addCustomEvent(this.getSlider().iframe.contentWindow,"BX.Bitrix24.PageSlider:onClose",function(){if(BX.type.isBoolean(n)){e.location.reload()}else if(BX.type.isFunction(n)){n()}})}else{BX.addCustomEvent(BX.SidePanel.Instance.getTopSlider(),"SidePanel.Slider:onReload",function(){BX.Sender.Page.reloadGrid()})}},close:function(){if(!this.isSupported()){return null}this.getSlider().close()}};BX.Sender.Page=new i})(window);