PageSourceSearch

https://aeroscreen.ru/bitrix/js/main/sidepanel/dist/side-panel.bundle.min.js?178186049793478

js aeroscreen.ru collected 2026-10-08 23:48:27 UTC 93,478 bytes, 91 lines download raw bytes

1this.BX=this.BX||{};(function(e,t,i,n,s,o,l,a,r){"use strict";function u(e,t,i){h(e,t),t.set(e,i)}function h(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function c(e,t){return e.get(f(e,t))}function d(e,t,i){return e.set(f(e,t),i),i}function f(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var m=new WeakMap;let g=function(){function e(i){babelHelpers.classCallCheck(this,e);u(this,m,null);if(!t.Type.isPlainObject(i)){throw new TypeError("The argument must be a plain object.")}d(m,this,i)}return babelHelpers.createClass(e,[{key:"set",value:function e(i,n){if(!t.Type.isStringFilled(i)){throw new Error("The 'key' must be a string.")}c(m,this)[i]=n}},{key:"get",value:function e(t){return c(m,this)[t]}},{key:"delete",value:function e(t){delete c(m,this)[t]}},{key:"has",value:function e(t){return t in c(m,this)}},{key:"clear",value:function e(){d(m,this,{})}},{key:"entries",value:function e(){return c(m,this)}}])}();function p(e,t){y(e,t),t.add(e)}function y(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function v(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var b=new WeakSet;let C=function(){function e(i,n){babelHelpers.classCallCheck(this,e);p(this,b);babelHelpers.defineProperty(this,"slider",null);babelHelpers.defineProperty(this,"color",null);babelHelpers.defineProperty(this,"bgColor",null);babelHelpers.defineProperty(this,"className","");babelHelpers.defineProperty(this,"iconClass","");babelHelpers.defineProperty(this,"iconTitle","");babelHelpers.defineProperty(this,"onclick",null);babelHelpers.defineProperty(this,"text",null);babelHelpers.defineProperty(this,"hidden",false);babelHelpers.defineProperty(this,"visible",true);babelHelpers.defineProperty(this,"cache",new t.Cache.MemoryCache);this.slider=i;const s=t.Type.isPlainObject(n)?n:{};this.hidden=t.Type.isBoolean(s.hidden)?s.hidden:this.hidden;this.visible=t.Type.isBoolean(s.visible)?s.visible:this.visible;this.setColor(s.color);this.setBgColor(s.bgColor);this.setText(s.text);this.setClassName(s.className);this.setIconClass(s.iconClass);this.setIconTitle(s.iconTitle);this.setOnclick(s.onclick)}return babelHelpers.createClass(e,[{key:"getContainer",value:function e(){return this.cache.remember("container",(()=>{const e=["side-panel-label"];if(this.getClassName()){e.push(this.getClassName())}if(this.isHidden()){e.push("--hidden")}if(this.isVisible()){e.push("--visible")}return t.Dom.create("button",{props:{className:e.join(" ")},attrs:{type:"button",tabIndex:this.isHidden()?"-1":"0"},children:[this.getIconBox(),this.getTextContainer()],events:{click:v(b,this,S).bind(this)}})}))}},{key:"adjustLayout",value:function e(){const i=this.getSlider().getOverlay().getBoundingClientRect();const n=this.getSlider().getContainer().getBoundingClientRect();const s=n.left-i.left;if(s<=this.getSlider().getMinLeftBoundary()){this.hideText()}else{this.showText()}t.Dom.style(this.getContainer(),"max-width",`${s-this.constructor.MIN_LEFT_OFFSET}px`)}},{key:"getIconBox",value:function e(){return this.cache.remember("icon-box",(()=>t.Dom.create("div",{props:{className:"side-panel-label-icon-box"},children:[this.getIconContainer()]})))}},{key:"getIconContainer",value:function e(){return this.cache.remember("icon-container",(()=>t.Dom.create("div",{props:{className:`side-panel-label-icon ${this.getIconClass()}`}})))}},{key:"showIcon",value:function e(){t.Dom.removeClass(this.getContainer(),"side-panel-label-icon--hide")}},{key:"hideIcon",value:function e(){t.Dom.addClass(this.getContainer(),"side-panel-label-icon--hide")}},{key:"darkenIcon",value:function e(){t.Dom.addClass(this.getContainer(),"side-panel-label-icon--darken")}},{key:"lightenIcon",value:function e(){t.Dom.removeClass(this.getContainer(),"side-panel-label-icon--darken")}},{key:"hideText",value:function e(){t.Dom.addClass(this.getTextContainer(),"side-panel-label-text-hidden")}},{key:"showText",value:function e(){t.Dom.removeClass(this.getTextContainer(),"side-panel-label-text-hidden")}},{key:"isTextHidden",value:function e(){return t.Dom.hasClass(this.getTextContainer(),"side-panel-label-text-hidden")}},{key:"getTextContainer",value:function e(){return this.cache.remember("text-container",(()=>t.Dom.create("span",{props:{className:"side-panel-label-text"}})))}},{key:"setColor",value:function e(i){if(t.Type.isStringFilled(i)||i===null){this.color=i;t.Dom.style(this.getTextContainer(),"color",this.color);t.Dom.style(this.getIconContainer(),"--ui-icon-set__icon-color",this.color)}}},{key:"getColor",value:function e(){return this.color}},{key:"setBgColor",value:function e(i,n){let s=t.Type.isArray(i)?i[0]:i;let o=t.Type.isArray(i)?i[1]:n;if(t.Type.isStringFilled(s)){const e=s.match(/^#([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/);if(e){let i=e[1];if(i.length===3){i=i.replaceAll(/([\da-f])/gi,"$1$1")}o=t.Type.isNumber(o)&&o>=0&&o<=100?o:95;const n=`0${Math.round(255*(o/100)).toString(16)}`.slice(-2).toUpperCase();s=`#${i}${n}`}this.bgColor=s;t.Dom.style(this.getContainer(),"--ui-color",s);if(this.getColor()===null){t.Dom.style(this.getIconContainer(),"--ui-icon-set__icon-color","#fff")}}else if(s===null){this.bgColor=null;t.Dom.style(this.getContainer(),"--ui-color",null);t.Dom.style(this.getIconContainer(),"--ui-icon-set__icon-color",null)}}},{key:"getBgColor",value:function e(){return this.bgColor}},{key:"setText",value:function e(i){if(t.Type.isStringFilled(i)){this.text=i;this.getTextContainer().textContent=i}else if(i===null){this.text=i;this.getTextContainer().textContent=""}}},{key:"getText",value:function e(){return this.text}},{key:"setClassName",value:function e(i){if(t.Type.isStringFilled(i)){t.Dom.removeClass(this.getContainer(),this.className);this.className=i;t.Dom.addClass(this.getContainer(),this.className)}else if(i===null){t.Dom.removeClass(this.getContainer(),this.className);this.className=i}}},{key:"getClassName",value:function e(){return this.className}},{key:"setIconClass",value:function e(i){if(t.Type.isStringFilled(i)){t.Dom.removeClass(this.getIconContainer(),this.iconClass);this.iconClass=i;t.Dom.addClass(this.getIconContainer(),this.iconClass)}else if(i===null){t.Dom.removeClass(this.getIconContainer(),this.iconClass);this.iconClass=i}}},{key:"getIconClass",value:function e(){return this.iconClass}},{key:"setIconTitle",value:function e(i){if(t.Type.isStringFilled(i)||i===null){t.Dom.attr(this.getIconBox(),"title",i);t.Dom.attr(this.getContainer(),"aria-label",i);this.iconTitle=i}}},{key:"getIconTitle",value:function e(){return this.iconTitle}},{key:"isHidden",value:function e(){return this.hidden}},{key:"hide",value:function e(){this.hidden=true;t.Dom.addClass(this.getContainer(),"--hidden");t.Dom.attr(this.getContainer(),"tabIndex","-1")}},{key:"show",value:function e(){this.hidden=false;t.Dom.removeClass(this.getContainer(),"--hidden");t.Dom.attr(this.getContainer(),"tabIndex","0")}},{key:"isVisible",value:function e(){return this.visible}},{key:"setVisible",value:function e(i=true){t.Dom.toggleClass(this.getContainer(),"--visible",i)}},{key:"setOnclick",value:function e(i){if(t.Type.isFunction(i)||i===null){this.onclick=i}}},{key:"getOnclick",value:function e(){return this.onclick}},{key:"getSlider",value:function e(){return this.slider}},{key:"moveAt",value:function e(i){if(t.Type.isNumber(i)&&i>=0){t.Dom.style(this.getSlider().getLabelsContainer(),"top",`${this.constructor.MIN_TOP_OFFSET+i*this.constructor.INTERVAL_TOP_OFFSET}px`)}}}])}();function S(e){e.stopPropagation();const t=this.getOnclick();
1if(t){t(this,this.getSlider())}}babelHelpers.defineProperty(C,"MIN_LEFT_OFFSET",25);babelHelpers.defineProperty(C,"MIN_TOP_OFFSET",17);babelHelpers.defineProperty(C,"INTERVAL_TOP_OFFSET",50);let k=function(){function e(){babelHelpers.classCallCheck(this,e);this.slider=null;this.action=true;this.name=null}return babelHelpers.createClass(e,[{key:"allowAction",value:function e(){this.action=true}},{key:"denyAction",value:function e(){this.action=false}},{key:"isActionAllowed",value:function e(){return this.action}},{key:"getSliderPage",value:function e(){return this.slider}},{key:"getSlider",value:function e(){return this.slider}},{key:"setSlider",value:function e(t){if(t instanceof q){this.slider=t}}},{key:"getName",value:function e(){return this.name}},{key:"setName",value:function e(i){if(t.Type.isStringFilled(i)){this.name=i}}},{key:"getFullName",value:function e(){return q.getEventFullName(this.getName())}}])}();function T(e,t,i){return t=babelHelpers.getPrototypeOf(t),babelHelpers.possibleConstructorReturn(e,w()?Reflect.construct(t,[],babelHelpers.getPrototypeOf(e).constructor):t.apply(e,i))}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(w=function(){return!!e})()}let E=function(e){function i(e){var n;babelHelpers.classCallCheck(this,i);n=T(this,i);const s=t.Type.isPlainObject(e)?e:{};if(!(s.sender instanceof q)){throw new TypeError("'sender' is not an instance of BX.SidePanel.Slider")}n.setName("onMessage");n.setSlider(s.slider);n.sender=s.sender;n.data="data"in s?s.data:null;n.eventId=t.Type.isStringFilled(s.eventId)?s.eventId:null;return n}babelHelpers.inherits(i,e);return babelHelpers.createClass(i,[{key:"getSlider",value:function e(){return this.slider}},{key:"getSender",value:function e(){return this.sender}},{key:"getData",value:function e(){return this.data}},{key:"getEventId",value:function e(){return this.eventId}}])}(k);var A;function O(e,t){P(e,t),t.add(e)}function F(e,t,i){P(e,t),t.set(e,i)}function P(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function B(e,t){return e.get(M(e,t))}function L(e,t,i){return e.set(M(e,t),i),i}function M(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}var D=new WeakMap;var I=new WeakMap;var x=new WeakMap;var N=new WeakMap;var R=new WeakMap;var W=new WeakMap;var z=new WeakMap;var H=new WeakMap;var U=new WeakMap;var $=new WeakMap;var j=new WeakMap;var _=new WeakMap;var X=new WeakMap;var V=new WeakSet;let q=function(){function e(i,s){babelHelpers.classCallCheck(this,e);O(this,V);F(this,D,new n.MemoryCache);F(this,I,{});F(this,x,"right");F(this,N,null);F(this,R,null);F(this,W,null);F(this,z,{});F(this,H,false);F(this,U,"--ui-context-content-light");F(this,$,null);F(this,j,true);F(this,_,null);F(this,X,null);const o=t.Type.isPlainObject(s)?s:{};L(I,this,o);this.contentCallback=t.Type.isFunction(o.contentCallback)?o.contentCallback:null;this.contentCallbackInvoved=false;this.contentClassName=t.Type.isStringFilled(o.contentClassName)?o.contentClassName:null;this.containerClassName=t.Type.isStringFilled(o.containerClassName)?o.containerClassName:null;this.overlayClassName=t.Type.isStringFilled(o.overlayClassName)?o.overlayClassName:null;this.url=this.contentCallback?i:this.refineUrl(i);this.offset=null;this.hideControls=o.hideControls===true;this.width=t.Type.isNumber(o.width)?o.width:null;this.cacheable=o.cacheable!==false;this.autoFocus=o.autoFocus!==false;this.printable=o.printable===true;this.allowChangeHistory=t.Type.isBoolean(o.allowChangeHistory)?o.allowChangeHistory:null;this.allowChangeTitle=t.Type.isBoolean(o.allowChangeTitle)?o.allowChangeTitle:null;this.allowCrossOrigin=o.allowCrossOrigin===true;this.data=new g(t.Type.isPlainObject(o.data)?o.data:{});this.customLeftBoundary=null;this.customRightBoundary=null;this.setCustomLeftBoundary(o.customLeftBoundary);this.setCustomRightBoundary(o.customRightBoundary);this.title=null;this.setTitle(o.title);this.iframe=null;this.iframeSrc=null;this.iframeId=null;this.requestMethod=t.Type.isStringFilled(o.requestMethod)&&o.requestMethod.toLowerCase()==="post"?"post":"get";
1this.requestParams=t.Type.isPlainObject(o.requestParams)?o.requestParams:{};this.opened=false;this.hidden=false;this.destroyed=false;this.loaded=false;this.loadedCnt=0;this.minimizing=false;this.maximizing=false;this.handleFrameKeyDown=this.handleFrameKeyDown.bind(this);this.handleFrameFocus=this.handleFrameFocus.bind(this);this.handleFrameUnload=this.handleFrameUnload.bind(this);this.handlePopupInit=this.handlePopupInit.bind(this);this.handleCrossOriginWindowMessage=this.handleCrossOriginWindowMessage.bind(this);this.layout={overlay:null,container:null,loader:null,content:null};this.skeleton=o.skeleton;this.loader=t.Type.isStringFilled(o.loader)||t.Type.isElementNode(o.loader)?o.loader:t.Type.isStringFilled(o.typeLoader)?o.typeLoader:"default-loader";this.animation=null;this.animationDuration=t.Type.isNumber(o.animationDuration)?o.animationDuration:200;this.overlayBgColor=t.Type.isStringFilled(o.overlayBgColor)&&/^#[\dA-Za-f]{6}$/.test(o.overlayBgColor)?o.overlayBgColor:"#000000";this.overlayOpacity=t.Type.isNumber(o.overlayOpacity)?Math.min(Math.max(o.overlayOpacity,0),100):40;this.overlayBgCallback=t.Type.isFunction(o.overlayBgCallback)?o.overlayBgCallback:null;L(x,this,["right","bottom","top"].includes(o.startPosition)?o.startPosition:B(x,this));L(z,this,t.Type.isPlainObject(o.outerBoundary)?o.outerBoundary:{});L(N,this,M(V,this,Y).call(this,"start"));L(R,this,M(V,this,Y).call(this,"end"));L(W,this,null);this.overlayAnimation=false;this.animationName="sliding";this.animationOptions={};this.minimizeOptions=null;this.setMinimizeOptions(o.minimizeOptions);this.setToolbarOnOpen(o.hideToolbarOnOpen);this.setDesignSystemContext(o.designSystemContext);this.setAutoOffset(o.autoOffset);this.label=new C(this,{className:"--close-label --ui-hoverable",iconClass:"side-panel-label-icon-close ui-icon-set --cross-l",iconTitle:t.Loc.getMessage("MAIN_SIDEPANEL_CLOSE"),onclick(e,t){t.close()}});const l=t.Type.isPlainObject(o.label)?o.label:{};this.label.setText(l.text);this.label.setColor(l.color);this.label.setBgColor(l.bgColor,l.opacity);this.minimizeLabel=new C(this,{className:"--ui-hoverable",iconClass:"side-panel-label-icon-minimize ui-icon-set --o-minimize",iconTitle:t.Loc.getMessage("MAIN_SIDEPANEL_MINIMIZE"),onclick:(e,t)=>{if(this.isLoaded()){this.minimize()}},visible:this.areMinimizeOptionsValid(this.minimizeOptions)});this.newWindowLabel=null;this.copyLinkLabel=null;this.printLabel=null;if(o.newWindowLabel===true&&(this.canChangeHistory()||t.Type.isStringFilled(o.newWindowUrl))){this.newWindowLabel=new C(this,{className:"--ui-hoverable",iconClass:"side-panel-label-icon-new-window ui-icon-set --go-to-l",iconTitle:t.Loc.getMessage("MAIN_SIDEPANEL_NEW_WINDOW"),onclick(e,i){const n=t.Type.isStringFilled(o.newWindowUrl)?o.newWindowUrl:i.getUrl();Object.assign(document.createElement("a"),{target:"_blank",href:n}).click()}})}if(o.copyLinkLabel===true&&(this.canChangeHistory()||t.Type.isStringFilled(o.newWindowUrl))){this.copyLinkLabel=new C(this,{className:"--ui-hoverable",iconClass:"side-panel-label-icon-copy-link ui-icon-set --o-link",iconTitle:t.Loc.getMessage("MAIN_SIDEPANEL_COPY_LINK")});BX.clipboard.bindCopyClick(this.copyLinkLabel.getContainer(),{text:()=>{const e=document.createElement("a");e.href=t.Type.isStringFilled(o.newWindowUrl)?o.newWindowUrl:this.getUrl();return e.href}})}this.printLabel=new C(this,{hidden:!this.isPrintable(),className:"--side-panel-label-print --ui-hoverable",iconClass:"side-panel-label-icon-print ui-icon-set --o-printer",iconTitle:t.Loc.getMessage("MAIN_SIDEPANEL_PRINT"),onclick:this.handlePrintBtnClick.bind(this)});if(t.Type.isStringFilled(o.targetContainer)||t.Type.isElementNode(o.targetContainer)){L(X,this,o.targetContainer)}[o.events].flat().forEach((e=>M(V,this,K).call(this,e)))}return babelHelpers.createClass(e,[{key:"open",value:function e(){if(this.isOpen()){return false}if(!this.canOpen()){return false}if(this.isDestroyed()){return false}if(this.maximizing){this.fireEvent("onMaximizeStart")}this.createLayout();t.Dom.removeClass(this.getOverlay(),"--closing");t.Dom.addClass(this.getOverlay(),"--opening");this.adjustLayout();B($,this).getStack().bringToFront(this.getOverlay());this.opened=true;this.fireEvent("onOpenStart");if(this.isLoaded()){this.getFocusTrap().activate()}else{this.getFocusTrap().activate({initialFocus:false});this.getFocusTrap().focusContainer({preventScroll:true})}this.animateOpening();return true}}
1,{key:"close",value:function e(i,n){if(!this.isOpen()){return false}if(!this.canClose()){return false}if(this.minimizing){this.fireEvent("onMinimizeStart")}this.fireEvent("onCloseStart");this.opened=false;if(this.isDestroyed()){return false}if(this.animation){this.animation.stop()}t.Dom.removeClass(this.getOverlay(),"--opening");t.Dom.addClass(this.getOverlay(),"--closing");this.fireEvent("onClosing");if(i===true||t.Browser.isMobile()){L(W,this,B(N,this));this.completeAnimation(n)}else{this.animation=new t.Easing({duration:this.animationDuration,start:B(W,this),finish:B(N,this),step:e=>{L(W,this,e);this.animateStep(e)},complete:()=>{this.completeAnimation(n)}});t.Dom.style(this.getContainer(),"opacity",.96);if(this.animationName==="scale"&&t.Type.isStringFilled(this.animationOptions.origin)){t.Dom.style(this.getContainer(),"transform-origin",this.animationOptions.origin)}this.animation.animate()}return true}},{key:"minimize",value:function e(t,i){this.minimizing=true;const n=this.close(t,i);if(!n){this.minimizing=false}return n}},{key:"isMinimizing",value:function e(){return this.minimizing}},{key:"maximize",value:function e(){this.maximizing=true;const t=this.open();if(!t){this.maximizing=false}return t}},{key:"isMaximizing",value:function e(){return this.maximizing}},{key:"setAnimation",value:function e(i,n){this.animationName=i==="scale"?i:"sliding";this.animationOptions=t.Type.isPlainObject(n)?n:{}}},{key:"setMinimizeOptions",value:function e(t){const i=this.areMinimizeOptionsValid(t);this.minimizeOptions=t;this.minimizeLabel?.setVisible(i)}},{key:"areMinimizeOptionsValid",value:function e(i){return t.Type.isPlainObject(i)&&t.Type.isStringFilled(i.entityType)&&(t.Type.isStringFilled(i.entityId)||t.Type.isNumber(i.entity
1Id))&&t.Type.isStringFilled(i.url)}},{key:"getMinimizeOptions",value:function e(){return this.minimizeOptions}},{key:"setToolbarOnOpen",value:function e(i){if(t.Type.isBoolean(i)){L(H,this,i)}}},{key:"shouldHideToolbarOnOpen",value:function e(){return B(H,this)}},{key:"getDesignSystemContext",value:function e(){return B(U,this)}},{key:"setDesignSystemContext",value:function e(i){if(t.Type.isString(i)){if(this.layout.container!==null){t.Dom.removeClass(this.layout.container,B(U,this));t.Dom.addClass(this.layout.container,i)}L(U,this,i)}}},{key:"getUrl",value:function e(){return this.url}},{key:"setUrl",value:function e(i){if(t.Type.isStringFilled(i)){this.url=i}}},{key:"focus",value:function e(){this.getWindow().focus()}},{key:"isOpen",value:function e(){return this.opened}},{key:"getStartPosition",value:function e(){return B(x,this)}},{key:"setZindex",value:function e(t){}},{key:"getZindex",value:function e(){return this.getZIndexComponent().getZIndex()}},{key:"getZIndexComponent",value:function e(){return B($,this)}},{key:"setOffset",value:function e(i){if(t.Type.isNumber(i)||i===null){this.offset=i}}},{key:"getOffset",value:function e(){return this.offset}},{key:"setAutoOffset",value:function e(i){if(t.Type.isBoolean(i)){L(j,this,i)}}},{key:"shouldUseAutoOffset",value:function e(){return B(j,this)}},{key:"setWidth",value:function e(i){if(t.Type.isNumber(i)){this.width=i}}},{key:"getWidth",value:function e(){return this.width}},{key:"setTitle",value:function e(i){if(t.Type.isStringFilled(i)){this.title=i}}},{key:"getTitle",value:function e(){return this.title}},{key:"getData",value:function e(){return this.data}},{key:"isSelfContained",value:function e(){return this.contentCallback!==null}},{key:"isPostMethod",value:function e(){return this.requestMethod==="post"}}
1,{key:"getRequestParams",value:function e(){return this.requestParams}},{key:"getFrameId",value:function e(){if(this.iframeId===null){this.iframeId=`iframe_${t.Text.getRandom(10).toLowerCase()}`}return this.iframeId}},{key:"getWindow",value:function e(){return this.iframe?this.iframe.contentWindow:window}},{key:"getFrameWindow",value:function e(){return this.iframe?this.iframe.contentWindow:null}},{key:"isHidden",value:function e(){return this.hidden}},{key:"isCacheable",value:function e(){return this.cacheable}},{key:"isFocusable",value:function e(){return this.autoFocus}},{key:"isPrintable",value:function e(){return this.printable}},{key:"isDestroyed",value:function e(){return this.destroyed}},{key:"isLoaded",value:function e(){return this.loaded}},{key:"canChangeHistory",value:function e(){if(this.allowCrossOrigin||/^\/bitrix\/(components|tools)\//i.test(this.getUrl())){return false}if(this.allowChangeHistory===null){return!this.isSelfContained()}return this.allowChangeHistory}},{key:"canChangeTitle",value:function e(){if(this.allowChangeTitle===null){if(this.getTitle()!==null){return true}return this.canChangeHistory()}return this.allowChangeTitle}},{key:"setCacheable",value:function e(t=true){this.cacheable=t!==false}},{key:"setAutoFocus",value:function e(t=true){this.autoFocus=t!==false}},{key:"setPrintable",value:function e(t=true){this.printable=t!==false;if(this.printable){this.showPrintBtn()}else{this.hidePrintBtn()}}},{key:"getLoader",value:function e(){return this.loader}},{key:"showLoader",value:function e(){if(!this.layout.loader){this.createLoader(this.loader,this.skeleton)}t.Dom.style(this.layout.loader,{opacity:1,display:"block"})}},{key:"closeLoader",value:function e(){if(this.layout.loader){t.Dom.style(this.layout.loader,{opacity:0,display:"none"})}}},{key:"showCloseBtn",value:function e(){this.getLabel().show()}},{key:"hideCloseBtn",value:function e(){this.getLabel().hide()}},{key:"showOrLightenCloseBtn",value:function e(){if(t.Type.isStringFilled(this.getLabel().getText())){this.getLabel().showIcon()}else{this.getLabel().lightenIcon()}}},{key:"hideOrDarkenCloseBtn",value:function e(){if(t.Type.isStringFilled(this.getLabel().getText())){this.getLabel().hideIcon()}else{this.getLabel().darkenIcon()}}},{key:"showPrintBtn",value:function e(){if(this.printLabel!==null){this.printLabel.show()}}},{key:"hidePrintBtn",value:function e(){if(this.printLabel!==null){this.printLabel.hide()}}},{key:"showExtraLabels",value:function e(){t.Dom.removeClass(this.getExtraLabelsContainer(),"--hidden")}},{key:"hideExtraLabels",value:function e(){t.Dom.addClass(this.getExtraLabelsContainer(),"--hidden")}},{key:"setContentClass",value:function e(i){if(t.Type.isStringFilled(i)){this.removeContentClass();this.contentClassName=i;t.Dom.addClass(this.getContentContainer(),i)}}},{key:"removeContentClass",value:function e(){if(this.contentClassName!==null){t.Dom.removeClass(this.getContentContainer(),this.contentClassName);this.contentClassName=null}}},{key:"setContainerClass",value:function e(i){if(t.Type.isStringFilled(i)){this.removeContainerClass();this.containerClassName=i;t.Dom.addClass(this.getContainer(),i)}}},{key:"removeContainerClass",value:function e(){if(this.containerClassName!==null){t.Dom.removeClass(this.getContainer(),this.containerClassName);this.containerClassName=null}}},{key:"setOverlayClass",value:function e(i){if(t.Type.isStringFilled(i)){this.removeOverlayClass();this.overlayClassName=i;t.Dom.addClass(this.getOverlay(),i)}}},{key:"removeOverlayClass",value:function e(){if(this.overlayClassName!==null){t.Dom.removeClass(this.getOverlay(),this.overlayClassName);this.overlayClassName=null}}},{key:"applyHacks",value:function e(){}},{key:"applyPostHacks",value:function e(){}},{key:"resetHacks",value:function e(){}},{key:"resetPostHacks",value:function e(){}},{key:"getTopBoundary",value:function e(){return 0}},{key:"calculateLeftBoundary",value:function e(){const t=this.getCustomLeftBoundary();if(t!==null){return t}return this.getLeftBoundary()}},{key:"getLeftBoundary",value:function e(){const i=t.Browser.isMobile()?window.innerWidth:document.documentElement.clientWidth;return i<1160?this.getMinLeftBoundary():300}},{key:"getMinLeftBoundary",value:function e(){return this.hideControls&&this.getCustomLeftBoundary()!==null?0:65}},{key:"getLeftBoundaryOffset",value:function e(){const t=this.getOffset()===null?0:this.getOffset();return Math.max(this.calculateLeftBoundary(),this.getMinLeftBoundary())+t}},{key:"setCustomLeftBoundary",value:function e(i){if(t.Type.isNumber(i)||i===null){this.customLeftBoundary=i}}},{key:"getCustomLeftBoundary",value:function e(){return this.customLeftBoundary}},{key:"setCustomRightBoundary",value:function e(i){if(t.Type.isNumber(i)||i===null){this.customRightBoundary=i}}},{key:"getCustomRightBoundary",value:function e(){return this.customRightBoundary}},{key:"calculateRightBoundary",value:function e(){const t=this.getCustomRightBoundary();if(t!==null){return-window.pageXOffset+t}return this.getRightBoundary()}},{key:"getRightBoundary",value:function e(){return-window.pageXOffset}},{key:"getOuterBoundary",value:function e(){return B(z,this)}},{key:"calculateOuterBoundary",value:function e(){}},{key:"destroy",value:function e(){if(this.isDestroyed()){return false}this.firePageEvent("onDestroy");this.fireFrameEvent("onDestroy");const n=this.getFrameWindow();if(n&&!this.allowCrossOrigin){t.Event.unbind(n,"keydown",this.handleFrameKeyDown);t.Event.unbind(n,"focus",this.handleFrameFocus);t.Event.unbind(n,"unload",this.handleFrameUnload)}else if(this.allowCrossOrigin){t.Event.unbind(window,"message",this.handleCrossOriginWindowMessage)}i.EventEmitter.unsubscribe("BX.Main.Popup:onInit",this.handlePopupInit);s.ZIndexManager.unregister(this.layout.overlay);L($,this,null);o.FocusMonitor.Instance.detachIframe(this.getFrame());if(B(_,this)!==null){B(_,this).destroy()}L(_,this,null);t.Dom.remove(this.layout.overlay);this.layout.container=null;this.layout.overlay=null;this.layout.content=null;this.layout.closeBtn=null;this.layout.loader=null;L(D,this,null);this.iframe=null;this.destroyed=true;i.EventEmitter.unsubscribeAll(this);this.firePageEvent("onDestroyComplete");return true}},{key:"hide",value:function e(){this.hidden=true;t.Dom.style(this.getContainer(),"display","none");t.Dom.style(this.getOverlay(),"display","none")}},{key:"unhide",value:function e(){this.hidden=false;t.Dom.style(this.getContainer(),"display",null);t.Dom.style(this.getOverlay(),"display",null)}},{key:"reload",value:function e(){this.loaded=false;if(this.isSelfContained()){this.contentCallbackInvoved=false;this.showLoader();this.setContent()}else{this.showLoader();this.getFrameWindow().location.reload()}}}
1,{key:"adjustLayout",value:function e(){const i=window.pageYOffset||document.documentElement.scrollTop;const n=t.Browser.isMobile()?window.innerHeight:document.documentElement.clientHeight;let s=this.getTopBoundary();const o=s-i>0;s=o?s:i;const l=o>0?n-s+i:n;const a=this.getLeftBoundaryOffset();const r=this.calculateRightBoundary();t.Dom.style(this.getOverlay(),{left:`${window.pageXOffset}px`,top:`${s}px`,right:`${r}px`,height:`${l}px`});const{right:u=null,top:h=null,bottom:c=null}=M(V,this,Z).call(this);t.Dom.style(this.getContainer(),{width:`calc(100% - ${a+(u===null?0:u)}px)`,maxWidth:this.getWidth()===null?null:`${this.getWidth()}px`,right:u===null?null:`${u}px`,top:h===null?null:`${h}px`,bottom:c===null?null:`${c}px`});this.getLabel().adjustLayout();this.fireEvent("onLayout")}},{key:"createLayout",value:function e(){if(this.layout.overlay!==null&&this.layout.overlay.parentNode){return}this.getContainer().ariaModal=this.getFocusTrap().isLooped();if(this.getTitle()!==null){this.getContainer().ariaLabel=this.getTitle()}if(this.isSelfContained()){t.Dom.addClass(this.getOverlay(),"--self-contained");t.Dom.append(this.getOverlay(),this.getTargetContainer());this.setContent();i.EventEmitter.subscribe("BX.Main.Popup:onInit",this.handlePopupInit)}else{t.Dom.append(this.getFrame(),this.getContentContainer());t.Dom.append(this.getOverlay(),this.getTargetContainer());this.setFrameSrc()}const n=s.ZIndexManager.getOrAddStack(document.body);L($,this,n.register(this.getOverlay()))}},{key:"getTargetContainer",value:function e(){if(B(X,this)===null){return document.body}if(t.Type.isElementNode(B(X,this))){return B(X,this)}const i=document.querySelector(B(X,this));if(t.Type.isElementNode(i)){return i}return document.body}},{key:"getFrame",value:function e(){if(this.iframe!==null){return this.iframe}this.iframe=t.Dom.create("iframe",{attrs:{referrerpolicy:this.allowCrossOrigin?"strict-origin":false,src:"about:blank",frameborder:"0"},props:{className:"side-panel-iframe",name:this.getFrameId(),id:this.getFrameId()},events:{load:this.handleFrameLoad.bind(this)}});return this.iframe}},{key:"getOverlay",value:function e(){if(this.layout.overlay!==null){return this.layout.overlay}const i=this.overlayClassName===null?"":` ${this.overlayClassName}`;this.layout.overlay=t.Dom.create("div",{props:{className:`side-panel side-panel-overlay${i}`},events:{mousedown:this.handleOverlayClick.bind(this)},children:[this.getContainer()]});return this.layout.overlay}},{key:"unhideOverlay",value:function e(){t.Dom.removeClass(this.getOverlay(),"--hidden")}},{key:"hideOverlay",value:function e(){t.Dom.addClass(this.getOverlay(),"--hidden")}},{key:"hideShadow",value:function e(){t.Dom.removeClass(this.getContainer(),"side-panel-show-shadow")}},{key:"showShadow",value:function e(){t.Dom.addClass(this.getContainer(),"side-panel-show-shadow")}},{key:"setOverlayBackground",value:function e(){if(this.overlayBgCallback===null){const e=parseInt(this.overlayOpacity/100*255,10).toString(16).padStart(2,0);t.Dom.style(this.getOverlay(),"background-color",`${this.overlayBgColor}${e}`)}else{const e=M(V,this,Y).call(this,"end");t.Dom.style(this.getOverlay(),"background",this.overlayBgCallback(e,this))}}},{key:"setOverlayAnimation",value:function e(i){if(t.Type.isBoolean(i)){this.overlayAnimation=i}}},{key:"getOverlayAnimation",value:function e(){return this.overlayAnimation}},{key:"getOverlayBgColor",value:function e(){return this.overlayBgColor}},{key:"getOverlayOpacity",value:function e(){return this.overlayOpacity}},{key:"getContainer",value:function e(){if(this.layout.container!==null){return this.layout.container}const i=t.Tag.render`
2			<div class="side-panel-content-wrapper">${this.getContentContainer()}</div>
3		`;this.layout.container=t.Tag.render`
4			<div class="side-panel side-panel-container" role="dialog" aria-busy="true">
5				${this.hideControls?i:[i,this.getLabelsContainer()]}
6			</div>
7		`;t.Dom.addClass(this.layout.container,this.getDesignSystemContext());t.Dom.addClass(this.layout.container,this.containerClassName);return this.layout.container}},{key:"getContentContainer",value:function e(){if(this.layout.content!==null){return this.layout.content}const i=this.contentClassName===null?"":` ${this.contentClassName}`;this.layout.content=t.Dom.create("div",{props:{className:`side-panel-content-container${i}`}});return this.layout.content}},{key:"getLabelsContainer",value:function e(){return B(D,this).remember("labels-container",(()=>t.Dom.create("div",{props:{className:"side-panel-labels"},children:[this.getLabel().getContainer(),this.getExtraLabelsContainer()]})))}},{key:"getExtraLabelsContainer",value:function e(){return B(D,this).remember("icon-labels",(()=>t.Dom.create("div",{props:{className:"side-panel-extra-labels"},children:[this.copyLinkLabel?this.copyLinkLabel.getContainer():null,this.minimizeLabel.getContainer(),this.newWindowLabel?this.newWindowLabel.getContainer():null,this.printLabel?this.printLabel.getContainer():null]})))}},{key:"getCloseBtn",value:function e(){return this.getLabel().getIconBox()}},{key:"getLabel",value:function e(){return this.label}},{key:"getNewWindowLabel",value:function e(){return this.newWindowLabel}},{key:"getCopyLinkLabel",value:function e(){return this.copyLinkLabel}},{key:"getMinimizeLabel",value:function e(){return this.minimizeLabel}},{key:"getPrintLabel",value:function e(){return this.printLabel}},{key:"setContent",value:function e(){if(this.contentCallbackInvoved){return}this.contentCallbackInvoved=true;t.Dom.clean(this.getContentContainer());let i=this.contentCallback(this);const n=i&&(Object.prototype.toString.call(i)==="[object Promise]"||i.toString()==="[object BX.Promise]");
7if(!n){i=Promise.resolve(i)}i.then((e=>{if(this.isDestroyed()){return}const i=()=>{this.getContainer().ariaLabel=this.getTitle()||"";this.getContainer().ariaBusy=false;this.getFocusTrap().applyInitialFocus();this.removeLoader();this.loaded=true;this.firePageEvent("onLoad")};if(t.Type.isPlainObject(e)&&t.Type.isStringFilled(e.html)){t.Runtime.html(this.getContentContainer(),e.html).then(i).catch((e=>{this.removeLoader();this.getContentContainer().innerHTML=e}))}else{if(t.Type.isDomNode(e)){t.Dom.append(e,this.getContentContainer())}else if(t.Type.isStringFilled(e)){this.getContentContainer().innerHTML=e}i()}})).catch((e=>{this.removeLoader();this.getContentContainer().innerHTML=e}))}},{key:"setFrameSrc",value:function e(){if(this.iframeSrc===this.getUrl()){return}const i=t.Uri.addParam(this.getUrl(),{IFRAME:"Y",IFRAME_TYPE:"SIDE_SLIDER"});if(this.isPostMethod()){const e=document.createElement("form");e.method="POST";e.action=i;e.target=this.getFrameId();t.Dom.style(e,"display","none");BX.util.addObjectToForm(this.getRequestParam
7s(),e);t.Dom.append(e,document.body);e.submit();t.Dom.remove(e)}else{this.iframeSrc=this.getUrl();this.iframe.src=i}this.loaded=false;this.listenIframeLoading()}},{key:"createLoader",value:function e(i,n){t.Dom.remove(this.layout.loader);const s=t.Type.isStringFilled(i)||t.Type.isElementNode(i)?i:"default-loader";const o=["task-new-loader","task-edit-loader","task-view-loader","crm-entity-details-loader","crm-button-view-loader","crm-webform-view-loader","create-mail-loader","view-mail-loader"];if(t.Type.isStringFilled(n)){this.layout.loader=t.Tag.render`<div style="height: 100%;"></div>`;void l.renderSkeleton(n,this.layout.loader)}else if(t.Type.isElementNode(s)){this.layout.loader=this.createHTMLLoader(s)}else if(o.includes(s)&&this.loaderExists(s)){this.layout.loader=this.createOldLoader(s)}else if(s.charAt(0)==="/"){this.layout.loader=this.createSvgLoader(s)}else{const e=s.match(/^([\w.-]+):([\w.-]+)$/i);if(e){const t=e[1];const i=e[2];const n=`/bitrix/images/${t}/slider/${i}.svg`;this.layout.loader=this.createSvgLoader(n)}else{this.layout.loader=this.createDefaultLoader()}}t.Dom.append(this.layout.loader,this.getContainer())}},{key:"createSvgLoader",value:function e(i){return t.Dom.create("div",{props:{className:"side-panel-loader"},children:[t.Dom.create("div",{props:{className:"side-panel-loader-container"},style:{backgroundImage:`url("${i}")`}})]})}},{key:"createDefaultLoader",value:function e(){return t.Dom.create("div",{props:{className:"side-panel-loader"},children:[t.Dom.create("div",{props:{className:"side-panel-default-loader-container"},html:'<svg class="side-panel-default-loader-circular" viewBox="25 25 50 50">'+"<circle "+'class="side-panel-default-loader-path" '+'cx="50" cy="50" r="20" fill="none" stroke-miterlimit="10"'+"/>"+"</svg>"})]})}},{key:"createOldLoader",value:function e(i){if(i==="crm-entity-details-loader"){return t.Dom.create("div",{props:{className:`side-panel-loader ${i}`},children:[t.Dom.create("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAA1BMVEX"+"///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask top"}}),t.Dom.create("div",{props:{className:"side-panel-loader-bg left"},children:[t.Dom.create("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAA1B"+"MVEX///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask left"}})]}),t.Dom.create("div",{props:{className:"side-panel-loader-bg right"},children:[t.Dom.create("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAA1BM"+"VEX///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask right"}})]})]})}return t.Dom.create("div",{props:{className:`side-panel-loader ${i}`},children:[t.Dom.create("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAA1BMVEX"+"///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask left"}}),t.Dom.create("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAA"+"1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAAAtJREFUeAFjGMQAAACcAAG25ruvAAAAAElFTkSuQmCC"},props:{className:"side-panel-loader-mask right"}})]})}},{key:"createHTMLLoader",value:function e(i){return t.Dom.create("div",{children:[i]})}},{key:"loaderExists",value:function e(i){if(!t.Type.isStringFilled(i)){return false}for(let e=0;e<document.styleSheets.length;e++){const n=document.styleSheets[e];if(!t.Type.isStringFilled(n.href)||!n.href.includes("sidepanel")){continue}let s=null;try{s=n.rules||n.cssRules}catch{try{s=n.cssRules}catch{s=[]}}for(const e of s){if(t.Type.isStringFilled(e.selectorText)&&e.selectorText.includes(i)){return true}}}return false}},{key:"removeLoader",value:function e(){t.Dom.remove(this.layout.loader);this.layout.loader=null}},{key:"getFocusTrap",value:function e(){if(B(_,this)===null){const e={isolateOutside:true,initialFocus:["[data-autofocus]","container"]};const i=t.Type.isPlainObject(B(I,this).focusTrap)?B(I,this).focusTrap:{};L(_,this,new o.FocusTrap(this.getContainer(),t.Runtime.merge(e,i)))}return B(_,this)}},{key:"animateOpening",value:function e(){if(this.animation){this.animation.stop()}this.fireEvent("onOpening");if(t.Browser.isMobile()){L(W,this,B(R,this));this.animateStep(B(W,this));this.completeAnimation();return}L(W,this,B(W,this)===null?B(N,this):B(W,this));if(this.skeleton){this.showLoader()}this.animation=new t.Easing({duration:this.animationDuration,start:B(W,this),finish:B(R,this),step:e=>{L(W,this,e);this.animateStep(e)},complete:()=>{this.completeAnimation()}});if(this.animationName==="scale"&&t.Type.isStringFilled(this.animationOptions.origin)){t.Dom.style(this.getContainer(),"transform-origin",this.animationOptions.origin)}this.animation.animate()}},{key:"animateStep",value:function e(i){if(this.animationName==="scale"){t.Dom.style(this.getContainer(),"transform",`scale(${i.scale/100})`)}else{t.Dom.style(this.getContainer(),"transform",`translate(${i.translateX}%, ${i.translateY}%)`)}
7if(this.getOverlayAnimation()){if(this.overlayBgCallback===null){const e=parseInt(i.opacity/100*255,10).toString(16).padStart(2,0);t.Dom.style(this.getOverlay(),"background-color",`${this.overlayBgColor}${e}`)}else{t.Dom.style(this.getOverlay(),"background",this.overlayBgCallback(i,this))}}}},{key:"completeAnimation",value:function e(i){this.animation=null;if(this.isOpen()){L(W,this,B(R,this));this.maximizing=false;t.Dom.removeClass(this.getOverlay(),"--opening");t.Dom.addClass(this.getOverlay(),"--open");if(this.animationName==="scale"){const e=M(V,this,Y).call(this,"end");t.Dom.style(this.getContainer(),{"transform-origin":null,transform:`translate(${e.translateX}%, ${e.translateY}%)`})}this.firePageEvent("onBeforeOpenComplete");this.fireFrameEvent("onBeforeOpenComplete");this.firePageEvent("onOpenComplete");this.fireFrameEvent("onOpenComplete");if(!this.isLoaded()){this.showLoader()}}else{L(W,this,B(N,this));this.minimizing=false;t.Dom.removeClass(this.getOverlay(),"--open --opening --closing");if(this.animationName==="scale"){const e=M(V,this,Y).call(this,"start");t.Dom.style(this.getContainer(),{"transform-origin":null,transform:`translate(${e.translateX}%, ${e.translateY}%)`})}t.Dom.style(this.getContainer(),{width:null,right:null,opacity:null,"max-width":null,"min-width":null});t.Dom.style(this.getCloseBtn(),"opacity",null);this.firePageEvent("onBeforeCloseComplete");this.fireFrameEvent("onBeforeCloseComplete");this.firePageEvent("onCloseComplete");this.fireFrameEvent("onCloseComplete");if(t.Type.isFunction(i)){i(this)}if(!this.isDestroyed()){this.getFocusTrap().deactivate()}if(!this.isCacheable()){this.destroy()}}}},{key:"firePageEvent",value:function e(t){const n=this.getEvent(t);if(n===null){throw new Error("'eventName' is invalid.")}i.EventEmitter.emit(this,n.getFullName().toLowerCase(),new i.BaseEvent({data:[n],compatData:[n]}));if(["onClose","onOpen"].includes(t)){i.EventEmitter.emit(`BX.Bitrix24.PageSlider:${t}`,new i.BaseEvent({data:[this],compatData:[this]}));i.EventEmitter.emit(`Bitrix24.Slider:${t}`,new i.BaseEvent({data:[this],compatData:[this]}))}return n}},{key:"fireFrameEvent",value:function e(t){const i=this.getEvent(t);if(i===null){throw new Error("'eventName' is invalid.")}if(this.allowCrossOrigin){return null}const n=this.getFrameWindow();if(n&&n.BX&&n.BX.onCustomEvent){n.BX.onCustomEvent(this,i.getFullName(),[i]);if(["onClose","onOpen"].includes(t)){n.BX.onCustomEvent(`BX.Bitrix24.PageSlider:${t}`,[this]);n.BX.onCustomEvent(`Bitrix24.Slider:${t}`,[this])}}return i}},{key:"fireEvent",value:function e(t){this.firePageEvent(t);this.fireFrameEvent(t)}},{key:"getEvent",value:function e(i){let n=null;if(t.Type.isStringFilled(i)){n=new k;n.setSlider(this);n.setName(i)}else if(i instanceof k){n=i}return n}},{key:"canOpen",value:function e(){return this.canAction("open")}},{key:"canClose",value:function e(){return this.canAction("close")}},{key:"canCloseByEsc",value:function e(){return this.canAction("closeByEsc")}},{key:"canAction",value:function e(i){if(!t.Type.isStringFilled(i)){return false}const n=`on${i.charAt(0).toUpperCase()}${i.slice(1)}`;const s=this.firePageEvent(n);const o=this.fireFrameEvent(n);return s.isActionAllowed()&&(!o||o.isActionAllowed())}},{key:"handleCrossOriginWindowMessage",value:function e(i){const n=new URL(this.url);const s=new URL(i.origin);if(s.origin!==n.origin){return}const o={type:"",data:undefined};if(t.Type.isString(i.data)){o.type=i.data}else if(t.Type.isPlainObject(i.data)){o.type=i.data.type;o.data=i.data.data}switch(o.type){case"BX:SidePanel:close":{this.close();break}case"BX:SidePanel:load:force":{if(!this.isLoaded()&&!this.isDestroyed()){this.handleFrameLoad()}break}case"BX:SidePanel:data:send":{const e=new E({sender:this,data:o.data});e.setName("onXDomainMessage");this.firePageEvent(e);break}}}},{key:"handleFrameLoad",value:function e(i){if(this.loaded){return}const n=this.iframe.contentWindow;const s=n.location;if(this.allowCrossOrigin){t.Event.bind(window,"message",this.handleCrossOriginWindowMessage)}try{if(s.toString()==="about:blank"){return}}catch(e){if(this.allowCrossOrigin){this.loaded=true;this.closeLoader();return}console.warn('SidePanel: Try to use "allowCrossOrigin: true" option.');throw e}t.Event.bind(n,"keydown",this.handleFrameKeyDown);t.Event.bind(n,"focus",this.handleFrameFocus);t.Event.bind(n,"unload",this.handleFrameUnload);if(t.Browser.isMobile()){n.document.body.style.paddingBottom=`${window.innerHeight*2/3}px`}const l=s.pathname+s.search+s.hash;this.iframeSrc=this.refineUrl(l);this.url=this.iframeSrc;if(this.isPrintable()){this.injectPrintStyles()}this.loaded=true;this.loadedCnt++;o.FocusMonitor.Instance.detachIframe(this.getFrame());o.FocusMonitor.Instance.attachIframe(this.getFrame());if(this.getTitle()===null){const e=this.getFrameWindow()?this.getFrameWindow()?.document?.title:null;if(t.Type.isStringFilled(e)){this.getContainer().ariaLabel=t.Type.isStringFilled(e)?e:""}}this.getContainer().ariaBusy=false;this.getFocusTrap().applyInitialFocus();if(this.loadedCnt>1){this.firePageEvent("onLoad");this.fireFrameEvent("onLoad");this.firePageEvent("onReload");this.fireFrameEvent("onReload")}else{this.firePageEvent("onLoad");this.fireFrameEvent("onLoad")}this.closeLoader()}},{key:"listenIframeLoading",value:function e(){if(this.allowCrossOrigin){return}const t=setInterval((()=>
7{if(this.isLoaded()||this.isDestroyed()){clearInterval(t);return}if(this.iframe.contentWindow.location.toString()==="about:blank"){return}if(this.iframe.contentWindow.document.readyState==="complete"||this.iframe.contentWindow.document.readyState==="interactive"){clearInterval(t);this.handleFrameLoad()}}),200)}},{key:"handleFrameUnload",value:function e(t){this.loaded=false;this.listenIframeLoading()}},{key:"handleFrameKeyDown",value:function e(i){if(i.keyCode!==27){return}const n=this.getWindow().BX?.Main?.PopupManager;if(n){const e=n.getPopups();for(const t of e){if(t.isShown()){return}}}const s=this.getWindow().document.documentElement.clientWidth/2;const o=this.getWindow().document.documentElement.clientHeight/2;const l=this.getWindow().document.elementFromPoint(s,o);if(t.Dom.hasClass(l,"bx-core-dialog-overlay")||t.Dom.hasClass(l,"bx-core-window")){return}if(l.closest(".bx-core-window")){return}this.firePageEvent("onEscapePress");this.fireFrameEvent("onEscapePress")}},{key:"isOnTopOfPopup",value:function e(t){const i=this.getZIndexComponent().getStack()===t.getZIndexComponent().getStack();const n=i&&t.getZindex()>this.getZindex();let s=this.getContainer().contains(t.getPopupContainer());if(this.getFrameWindow()&&!this.allowCrossOrigin){s=this.getFrameWindow().document.contains(t.getPopupContainer())}return!(t.isShown()&&(n||s))}},{key:"handlePopupInit",value:function e(i){const n=i.getCompatData();const s=n[1];const o=n[2];if(!t.Type.isElementNode(o.targetContainer)&&t.Type.isElementNode(s)&&this.getContentContainer().contains(s)){o.targetContainer=this.getContentContainer()}}},{key:"handleFrameFocus",value:function e(t){this.firePageEvent("onFrameFocus")}},{key:"handleOverlayClick",value:function e(t){if(t.target===this.getOverlay()){if(this.animation===null){this.close();t.stopPropagation()}else{t.preventDefault()}}}},{key:"handlePrintBtnClick",value:function e(i){if(this.isSelfContained()){const e=document.createElement("iframe");e.src="about:blank";e.name="sidepanel-print-frame";t.Dom.style(e,"display","none");t.Dom.append(e,document.body);const i=e.contentWindow;const n=i.document;n.open();n.write("<html><head>");let s="";const o=document.head.querySelectorAll("link, style");for(const e of o){s+=e.outerHTML}s+="<style>html, body { background: #fff !important; height: 100%; }</style>";n.write(s);n.write("</head><body>");n.write(this.getContentContainer().innerHTML);n.write("</body></html>");n.close();i.focus();i.print();setTimeout((()=>{t.Dom.remove(e);window.focus()}),1e3)}else{this.focus();this.getFrameWindow().print()}}},{key:"injectPrintStyles",value:function e(){const t=this.getFrameWindow().document;let i="";const n=t.body.classList;for(const e of n){i+=`.${e}`}const s=`@media print { body${i} { `+"background: #fff !important; "+"-webkit-print-color-adjust: exact;"+"color-adjust: exact; "+"} }";const o=t.createElement("style");o.type="text/css";if(o.styleSheet){o.styleSheet.cssText=s}else{o.appendChild(t.createTextNode(s))}t.head.appendChild(o)}},{key:"refineUrl",value:function e(i){if(t.Type.isStringFilled(i)&&/IFRAME/.test(i)){return t.Uri.removeParam(i,["IFRAME","IFRAME_TYPE"])}return i}}],[{key:"getEventFullName",value:function e(t){return`SidePanel.Slider:${t}`}}])}();A=q;function K(e){if(t.Type.isPlainObject(e)){for(const[n,s]of Object.entries(e)){if(t.Type.isFunction(s)){i.EventEmitter.subscribe(this,A.getEventFullName(n),s,{compatMode:true})}}}}function Y(e){const t={right:{start:{translateX:100,translateY:0,opacity:0,scale:0,progress:0,intensity:0},end:{translateX:0,translateY:0,opacity:this.overlayOpacity,scale:100,progress:100,intensity:255}},bottom:{start:{translateX:0,translateY:100,opacity:0,scale:0,progress:0,intensity:0},end:{translateX:0,translateY:0,opacity:this.overlayOpacity,scale:100,progress:100,intensity:255}},top:{start:{translateX:0,translateY:-100,opacity:0,scale:0,progress:0,intensity:0},end:{translateX:0,translateY:0,opacity:this.overlayOpacity,scale:100,progress:100,intensity:255}}};return t[B(x,this)][e]}function Z(){const e=this.calculateOuterBoundary();return t.Runtime.merge(t.Type.isPlainObject(e)?e:{},this.getOuterBoundary())}function G(e,t,i){return t=babelHelpers.getPrototypeOf(t),babelHelpers.possibleConstructorReturn(e,Q()?Reflect.construct(t,[],babelHelpers.getPrototypeOf(e).constructor):t.apply(e,i))}function Q(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Q=function(){return!!e})()}let J=function(e){function i(e){var n;babelHelpers.classCallCheck(this,i);n=G(this,i);n.setEventNamespace("BX.Main.SidePanel.ToolbarItem");const s=t.Type.isPlainObject(e)?e:{};n.id=t.Type.isStringFilled(s.id)?s.id:`toolbar-item-${t.Text.getRandom().toLowerCase()}`;n.title="";n.url="";n.entityType="";n.entityId="0";n.entityName="";n.refs=new t.Cache.MemoryCache;n.rendered=false;n.setTitle(s.title);n.setUrl(s.url);n.setEntityType(s.entityType);
7n.setEntityId(s.entityId);return n}babelHelpers.inherits(i,e);return babelHelpers.createClass(i,[{key:"getId",value:function e(){return this.id}},{key:"getUrl",value:function e(){return this.url}},{key:"setUrl",value:function e(i){if(t.Type.isStringFilled(i)){this.url=i;if(this.rendered){this.getContainer().href=i}}}},{key:"getTitle",value:function e(){return this.title}},{key:"setTitle",value:function e(i){if(t.Type.isStringFilled(i)){this.title=i;if(this.rendered){this.getTitleContainer().textContent=i}}}},{key:"getEntityType",value:function e(){return this.entityType}},{key:"setEntityType",value:function e(i){if(t.Type.isStringFilled(i)){this.entityType=i}}},{key:"getEntityId",value:function e(){return this.entityId}},{key:"setEntityId",value:function e(i){if(t.Type.isNumber(i)||t.Type.isStringFilled(i)){this.entityId=String(i)}}},{key:"getEntityName",value:function e(){return this.entityName}},{key:"setEntityName",value:function e(i){if(t.Type.isStringFilled(i)){this.entityName=i}}},{key:"getContainer",value:function e(){return this.refs.remember("container",(()=>t.Tag.render`
8				<div 
9					class="side-panel-toolbar-item"
10					onmouseenter="${this.handleMouseEnter.bind(this)}"
11					onmouseleave="${this.handleMouseLeave.bind(this)}"
12				>
13					${this.getTitleContainer()}
14					<button
15						type="button"
16						tabindex="0"
17						class="side-panel-toolbar-item-remove-btn" 
18						onclick="${this.handleRemoveBtnClick.bind(this)}"
19						title="${t.Loc.getMessage("MAIN_SIDEPANEL_TOOLBAR_REMOVE_ITEM")}"
20						aria-label="${t.Loc.getMessage("MAIN_SIDEPANEL_TOOLBAR_REMOVE_ITEM")}"
21						aria-describedby="${this.getTitleContainer().id}"
22					>
23						<span class="ui-icon-set --cross-20" style="--ui-icon-set__icon-size: 100%;"></span>
24					</button>
25				</div>
26			`))}},{key:"isRendered",value:function e(){return this.rendered}},{key:"getTitleContainer",value:function e(){return this.refs.remember("title",(()=>t.Tag.render`
27				<a 
28					id="${t.Text.getRandom().toLowerCase()}"
29					class="side-panel-toolbar-item-title"
30					href="${encodeURI(this.getUrl())}"
31					tabindex="0"
32					data-slider-maximize="true"
33				>${t.Text.encode(this.getTitle())}</a>
34			`))}},{key:"prependTo",value:function e(i){if(t.Type.isDomNode(i)){t.Dom.prepend(this.getContainer(),i);this.rendered=true}}},{key:"appendTo",value:function e(i){if(t.Type.isDomNode(i)){t.Dom.append(this.getContainer(),i);this.rendered=true}}},{key:"insertBefore",value:function e(i){if(t.Type.isDomNode(i)){t.Dom.insertBefore(this.getContainer(),i);this.rendered=true}}},{key:"insertAfter",value:function e(i){if(t.Type.isDomNode(i)){t.Dom.insertAfter(this.getContainer(),i);this.rendered=true}}},{key:"remove",value:function e(){t.Dom.remove(this.getContainer());this.rendered=false}},{key:"showTooltip",value:function e(){const i=this.getContainer();const n=i.getBoundingClientRect();const s=n.width;const o=Math.min(Math.max(100,this.getTitleContainer().scrollWidth+20),300);const l=r.PopupManager.create({id:"sidepanel-toolbar-item-hint",cacheable:false,bindElement:n,bindOptions:{forceBindPosition:true,forceTop:true,position:"top"},focusTrap:false,width:o,content:t.Tag.render`
35				<div class="sidepanel-toolbar-item-hint">
36					<div class="sidepanel-toolbar-item-hint-title">${t.Text.encode(this.getEntityName())}</div>
37					<div class="sidepanel-toolbar-item-hint-content">${t.Text.encode(this.getTitle())}</div>
38				</div>
39			`,darkMode:true,fixed:true,offsetTop:0,events:{onShow:e=>{const t=e.getTarget();const i=s/2-o/2;const n=r.Popup.getOption("angleLeftOffset")-r.Popup.getOption("angleMinTop");t.setAngle({offset:o/2-n});t.setOffset({offsetLeft:i+r.Popup.getOption("angleLeftOffset")})}}});l.show();l.adjustPosition()}},{key:"hideTooltip",value:function e(){const t=r.PopupManager.getPopupById("sidepanel-toolbar-item-hint");if(t){t.close()}}},{key:"handleMouseEnter",value:function e(){this.showTooltip()}},{key:"handleMouseLeave",value:function e(){this.hideTooltip()}},{key:"handleRemoveBtnClick",value:function e(t){t.stopPropagation();this.emit("onRemove")}},{key:"toJSON",value:function e(){return{title:this.getTitle(),url:this.getUrl(),entityType:this.getEntityType(),entityId:this.getEntityId()}}}])}(i.EventEmitter);let ee=null;function te(){const e=t.Page.getRootWindow();if(e!==window){return e.BX.SidePanel.Instance}if(ee===null){ee=new fe}return ee}function ie(e,t,i){return t=babelHelpers.getPrototypeOf(t),babelHelpers.possibleConstructorReturn(e,ne()?Reflect.construct(t,[],babelHelpers.getPrototypeOf(e).constructor):t.apply(e,i))}function ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ne=function(){return!!e})()}let se=function(e){function n(e){var i;babelHelpers.classCallCheck(this,n);i=ie(this,n);i.setEventNamespace("BX.Main.SidePanel.Toolbar");const s=t.Type.isPlainObject(e)?e:{};if(!t.Type.isStringFilled(s.context)){throw new Error('BX.Main.SidePanel.Toolbar: "context" parameter is required.')}i.context=s.context;i.items=[];i.rendered=false;i.refs=new t.Cache.MemoryCache;i.container=null;i.lsKey="bx.sidepanel.toolbar.item";
39i.initialPosition={right:"5px",bottom:"20px"};i.shiftedPosition={right:"5px",bottom:"20px"};if(t.Type.isPlainObject(s.position)){i.initialPosition=s.position}if(t.Type.isPlainObject(s.shiftedPosition)){i.shiftedPosition=s.shiftedPosition}i.collapsed=s.collapsed!==false;i.muted=false;i.shifted=false;i.maxVisibleItems=t.Type.isNumber(s.maxVisibleItems)?Math.max(s.maxVisibleItems,1):5;i.addItems(s.items);const o=i.restoreItemFromLocalStorage();if(o!==null){const{entityType:e,entityId:t}=o;if(i.getItem(e,t)){i.clearLocalStorage()}else{i.minimizeItem(o)}}return i}babelHelpers.inherits(n,e);return babelHelpers.createClass(n,[{key:"show",value:function e(){t.Dom.addClass(this.getContainer(),"--show");t.Dom.style(document.body,"--side-panel-toolbar-shown",1)}},{key:"isShown",value:function e(){return t.Dom.hasClass(this.getContainer(),"--show")}},{key:"hide",value:function e(){t.Dom.removeClass(this.getContainer(),"--show");t.Dom.style(document.body,"--side-panel-toolbar-shown",null)}},{key:"mute",value:function e(){if(this.muted){return false}this.muted=true;t.Dom.addClass(this.getContainer(),"--muted");return true}},{key:"unmute",value:function e(){if(!this.muted){return false}this.muted=false;t.Dom.removeClass(this.getContainer(),"--muted");return true}},{key:"isMuted",value:function e(){return this.muted}},{key:"toggleMuteness",value:function e(){if(this.canShowOnTop()){return this.unmute()}return this.mute()}},{key:"shift",value:function e(){if(this.shifted){return false}this.shifted=true;t.Dom.addClass(this.getContainer(),"--shifted");t.Dom.style(document.body,"--side-panel-toolbar-shifted",1);this.setPosition(this.getContainer(),this.shiftedPosition);return true}},{key:"unshift",value:function e(){if(!this.shifted){return false}this.shifted=false;t.Dom.removeClass(this.getContainer(),"--shifted");t.Dom.style(document.body,"--side-panel-toolbar-shifted",null);this.setPosition(this.getContainer(),this.initialPosition);return true}},{key:"isShifted",value:function e(){return this.shifted}},{key:"toggleShift",value:function e(){const t=te().getOpenSliders();if(t.length===0||t.length===1&&!t[0].isOpen()){return this.unshift()}return this.shift()}},{key:"setPosition",value:function e(i,n){for(const e of["top","right","bottom","left"]){t.Dom.style(i,e,
39null);if(t.Type.isStringFilled(n[e])){t.Dom.style(i,e,n[e])}}}},{key:"collapse",value:function e(i=false){if(this.collapsed){return}const n=()=>{t.Dom.addClass(this.getContainer(),"--collapsed");t.Dom.style(this.getContentContainer(),"width",null);t.Dom.attr(this.getToggleButton(),"aria-expanded","false")};if(i===true){n()}else{const e=this.getContentContainer().scrollWidth;t.Dom.style(this.getContentContainer(),"width",`${e}px`);t.Event.unbindAll(this.getContentContainer(),"transitionend");requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.Dom.style(this.getContentContainer(),"width",0);t.Event.bindOnce(this.getContentContainer(),"transitionend",(()=>{n()}))}))}))}this.collapsed=true}},{key:"expand",value:function e(i=false){if(!this.collapsed){return}if(i===true){t.Dom.removeClass(this.getContainer(),"--collapsed");t.Dom.attr(this.getToggleButton(),"aria-expanded","true");t.Dom.style(this.getContentContainer(),"width",null)}else{t.Dom.removeClass(this.getContainer(),"--collapsed");t.Dom.attr(this.getToggleButton(),"aria-expanded","true");const e=this.getContentContainer().scrollWidth;t.Dom.style(this.getContentContainer(),"width",0);t.Event.unbindAll(this.getContentContainer(),"transitionend");requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.Dom.style(this.getContentContainer(),"width",`${e}px`);t.Event.bindOnce(this.getContentContainer(),"transitionend",(()=>{t.Dom.style(this.getContentContainer(),"width",null)}))}))}))}this.collapsed=false}},{key:"toggle",value:function e(){if(this.collapsed){this.request("expand");this.expand()}else{this.request("collapse");this.collapse()}}},{key:"isCollapsed",value:function e(){return this.collapsed}},{key:"getItems",value:function e(){return this.items}},{key:"getItemsCount",value:function e(){return this.items.length}},{key:"addItems",value:function e(i){if(t.Type.isArrayFilled(i)){i.forEach((e=>{this.addItem(e)}))}}},{key:"addItem",value:function e(t){const i=this.createItem(t);if(i===null){return null}this.items.push(i);if(this.rendered){this.redraw()}return i}},{key:"prependItem",value:function e(t){const i=this.createItem(t);if(i===null){return null}this.items.unshift(i);if(this.rendered){this.redraw()}return i}},{key:"createItem",value:function e(i){const n=t.Type.isPlainObject(i)?i:{};if(!t.Type.isStringFilled(n.entityType)||!(t.Type.isStringFilled(n.entityId)||t.Type.isNumber(n.entityId))||!t.Type.isStringFilled(n.title)||!t.Type.isStringFilled(n.url)){return null}const s=new J(n);if(!t.Type.isStringFilled(s.getEntityName())){const e=te().getMinimizeOptions(s.getUrl());if(t.Type.isPlainObject(e)&&t.Type.isStringFilled(e.entityName)){s.setEntityName(e.entityName)}}s.subscribe("onRemove",this.handleItemRemove.bind(this));return s}},{key:"minimizeItem",value:function e(t){const{entityType:i,entityId:n}=t;let s=this.getItem(i,n);const o=s!==null;if(!o){s=this.prependItem(t)}if(s!==null){if(!o){this.saveItemToLocalStorage(s)}this.request("minimize",s).then((e=>{if(e.status==="success"){this.clearLocalStorage()}})).catch((()=>{this.clearLocalStorage();this.removeItem(s)}))}return s}},{key:"saveItemToLocalStorage",value:function e(t){const i={item:t,ttl:Date.now()};localStorage.setItem(this.lsKey,JSON.stringify(i))}},{key:"restoreItemFromLocalStorage",value:function e(){const i=localStorage.getItem(this.lsKey);if(t.Type.isStringFilled(i)){const{item:e,ttl:n}=JSON.parse(i);if(Date.now()-n>1e4){this.clearLocalStorage();return null}if(t.Type.isPlainObject(e)){return e}}return null}},{key:"clearLocalStorage",value:function e(){localStorage.removeItem(this.lsKey)}},{key:"getContext",value:function e(){return this.context}},{key:"request",value:function e(i,n,s){const o=t.Type.isPlainObject(s)?s:{};return t.ajax.runAction(`main.api.sidepanel.toolbar.${i}`,{json:{toolbar:{context:this.getContext()},item:n?n.toJSON():null,...o}})}},{key:"handleItemRemove",value:function e(t){const i=t.getTarget();i.hideTooltip();this.removeItem(i)}},{key:"handleMenuItemRemove",value:function e(t){t.preventDefault();t.stopPropagation();const i=t.currentTarget.dataset.menuItemId;const n=this.getItemById(i);if(n){this.removeItem(n)}const s=this.getMenu();if(s){s.removeMenuItem(i);const e=this.getItems().reduce(((e,t)=>t.isRendered()?e:e+1),0);if(e>
390){s.getPopupWindow().adjustPosition()}else{s.close()}}}},{key:"removeItem",value:function e(i){i.remove();this.items=this.items.filter((e=>e!==i));const n=this.restoreItemFromLocalStorage();if(n!==null){const{entityType:e,entityId:t}=n;if(i.getEntityType()===e&&i.getEntityId()===t){this.clearLocalStorage()}}if(this.rendered){this.redraw();this.request("remove",i);if(this.getItemsCount()===0){this.hide()}else{this.items[0].getTitleContainer().focus({preventScroll:true})}o.LiveAnnouncer.announce(t.Loc.getMessage("MAIN_SIDEPANEL_TOOLBAR_REMOVED_ARIA"))}}},{key:"redraw",value:function e(){let t=0;for(let e=0;e<this.getItems().length;e++){const i=this.getItems()[e];if(t>=this.maxVisibleItems){if(i.isRendered()){i.remove()}}else{if(!i.isRendered()){const t=this.getItems()[e-1]||null;const n=this.getItems()[e+1]||null;if(t){i.insertAfter(t.getContainer())}else if(n){i.insertBefore(n.getContainer())}else{i.appendTo(this.getItemsContainer())}}t++}}}},{key:"removeAll",value:function e(){this.getItemsContainer().innerHTML="";this.items=[];this.clearLocalStorage()}},{key:"getItem",value:function e(t,i){return this.items.find((e=>e.getEntityType()===t&&e.getEntityId()===String(i)))||null}},{key:"getItemByUrl",value:function e(t){return this.items.find((e=>e.getUrl()===t))||null}},{key:"getItemById",value:function e(t){return this.items.find((e=>e.getId()===t))||null}},{key:"getContainer",value:function e(){return this.refs.remember("container",(()=>{const e=[];if(this.collapsed){e.push("--collapsed")}const n=t.Tag.render`
40				<div class="side-panel-toolbar ${e.join(" ")}">
41					${this.getToggleButton()}
42					${this.getContentContainer()}
43				</div>
44			`;this.setPosition(n,this.initialPosition);t.Dom.append(n,document.body);t.ZIndexManager.register(n,{alwaysOnTop:true});this.rendered=true;const s=t.Runtime.debounce(this.toggleMuteness,50,this);i.EventEmitter.subscribe("BX.Main.Popup:onShow",s);i.EventEmitter.subscribe("BX.Main.Popup:onClose",s);i.EventEmitter.subscribe("BX.Main.Popup:onDestroy",s);i.EventEmitter.subscribe("onWindowClose",s);i.EventEmitter.subscribe("onWindowRegister",s);let o=false;const l=()=>{this.toggleMuteness();if(this.isMuted()){return}this.toggleShift();if(!this.isShifted()&&o){o=false;this.expand()}};i.EventEmitter.subscribe("SidePanel.Slider:onClosing",l);i.EventEmitter.subscribe("SidePanel.Slider:onCloseComplete",l);i.EventEmitter.subscribe("SidePanel.Slider:onDestroyComplete",l);i.EventEmitter.subscribe("SidePanel.Slider:onOpening",(()=>{this.toggleMuteness();if(this.isMuted()){return}if(!this.isCollapsed()){o=true;this.collapse()}this.toggleShift()}));i.EventEmitter.subscribe("BX.UI.Viewer.Controller:onBeforeShow",s);i.EventEmitter.subscribe("BX.UI.Viewer.Controller:onClose",t.Runtime.debounce(this.toggleMuteness,500,this));t.Event.bind(window,"resize",t.Runtime.throttle((()=>{const e=this.getMenu();if(e!==null){e.close()}}),300));return n}))}},{key:"getToggleButton",value:function e(){return this.refs.remember("toggle-button",(()=>t.Tag.render`
45				<button 
46					type="button" 
47					tabindex="0" 
48					class="side-panel-toolbar-toggle"
49					aria-label="${t.Loc.getMessage("MAIN_SIDEPANEL_TOOLBAR_TITLE")}"
50					aria-expanded="${!this.collapsed}"
51					onclick="${this.handleToggleClick.bind(this)}"
52				></button>
53			`))}},{key:"getContentContainer",value:function e(){return this.refs.remember("content-container",(()=>t.Tag.render`
54				<div class="side-panel-toolbar-content">
55					<button
56						type="button"
57						tabindex="0"
58						class="side-panel-toolbar-collapse-btn"
59						aria-label="${t.Loc.getMessage("MAIN_SIDEPANEL_TOOLBAR_COLLAPSE")}"
60						onclick="${this.handleToggleClick.bind(this)}"
61					>
62						<span class="ui-icon-set --chevron-right"></span>
63					</button>
64					${this.getItemsContainer()}
65					${this.getMoreButton()}
66				</div>
67			`))}},{key:"getItemsContainer",value:function e(){return this.refs.remember("items-container",(()=>{const e=t.Tag.render`<div class="side-panel-toolbar-items"></div>`;[...this.items].slice(0,this.maxVisibleItems).forEach((t=>{t.appendTo(e)}));return e}))}},{key:"getMoreButton",value:function e(){return this.refs.remember("more-button",(()=>t.Tag.render`
68				<button 
69					class="side-panel-toolbar-more-btn" 
70					onclick="${this.handleMoreBtnClick.bind(this)}"
71					type="button"
72					tabindex="0"
73					aria-label="${t.Loc.getMessage("MAIN_SIDEPANEL_TOOLBAR_MORE_ARIA")}"
74				>
75					<span class="ui-icon-set --more"></span>
76				</button>
77			`))}},{key:"handleMoreBtnClick",value:function e(i){const n=this.getMoreButton();const s=n.getBoundingClientRect();const o=s.width;const l=[...this.items].filter((e=>!e.isRendered())).map((e=>{const i=t.Type.isStringFilled(e.getEntityName())?`${e.getEntityName()}\n${e.getTitle()}`:e.getTitle();return{id:e.getId(),html:this.createMenuItemText(e),title:i,href:e.getUrl(),onclick:()=>{a.close()}}}));if(l.length>0){l.push({delimiter:true})}l.push({text:t.Loc.getMessage("MAIN_SIDEPANEL_REMOVE_ALL"),onclick:()=>{this.removeAll();this.hide();a.close();this.request("removeAll")}});const a=r.MenuManager.create({id:"sidepanel-toolbar-more-btn",cacheable:false,bindElement:s,bindOptions:{forceBindPosition:true,forceTop:true,position:"top"},maxWidth:260,fixed:true,offsetTop:0,maxHeight:305,items:l,focusTrap:true,events:{onShow:e=>{const t=e.getTarget();const i=t.getPopupContainer().offsetWidth;const n=o/2-i/2;const s=r.Popup.getOption("angleLeftOffset")-r.Popup.getOption("angleMinTop");t.setAngle({offset:i/2-s});t.setOffset({offsetLeft:n+r.Popup.getOption("angleLeftOffset")})}}});a.show()}},{key:"canShowOnTop",value:function e(){const i=r.PopupManager.getPopups();for(const e of i){if(!e.isShown()){continue}if(e.getId().startsWith("timeman_weekly_report_popup_")||e.getId().startsWith("timeman_daily_report_popup_")||t.Dom.hasClass(e.getPopupContainer(),"b24-whatsnew__popup")){return false}}if(t.Reflection.getClass("BX.UI.Viewer.Instance")&&BX.UI.Viewer.Instance.isOpen()){return false}const n=te().getOpenSliders();for(const e of n){const t=e.getUrl().toString();if(e.shouldHideToolbarOnOpen()||t.startsWith("im:slider")||t.startsWith("release-slider")||t.startsWith("main:helper")||t.startsWith("ui:info_helper")){return false}}const s=t.ZIndexManager.getStack(document.body);const o=s===null?[]:s.getComponents();for(const e of o){if(e.getOverlay()!==null&&e.getOverlay().offsetWidth>0){return false}}return true}},{key:"getMenu",value:function e(){return r.MenuManager.getMenuById("sidepanel-toolbar-more-btn")}},{key:"createMenuItemText",value:function e(i){return t.Tag.render`
78			<span class="side-panel-toolbar-menu-item">${[t.Tag.render`
79					<span class="side-panel-toolbar-menu-item-title">${t.Text.encode(i.getTitle())}</span>
80				`,t.Tag.render`
81					<span
82						class="side-panel-toolbar-menu-item-remove"
83						data-slider-ignore-autobinding="true"
84						data-menu-item-id="${i.getId()}"
85						onclick="${this.handleMenuItemRemove.bind(this)}"
86					>
87						<span class="ui-icon-set --cross-20" data-slider-ignore-autobinding="true"></span>
88					</span>
89				`]}</span>
90		`}},{key:"handleToggleClick",value:function e(){this.toggle();this.getToggleButton().focus({preventScroll:true})}}])}(i.EventEmitter);var oe;function le(e,t){ae(e,t),t.add(e)}function ae(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function re(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw new TypeError("Private element is not present on this object")}let ue=null;let he=null;let ce=null;var de=new WeakSet;let fe=function(){function e(){babelHelpers.classCallCheck(this,e);le(this,de);this.anchorRules=[];this.anchorBinding=true;this.openSliders=[];this.lastOpenSlider=null;this.opened=false;this.hidden=false;this.hacksApplied=false;this.pageUrl=this.getCurrentUrl();this.pageTitle=this.getCurrentTitle();this.titleChanged=false;this.toolbar=null;this.fullScreenSlider=null;this.handleAnchorClick=this.handleAnchorClick.bind(this);this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this);this.handleWindowResize=t.Runtime.throttle(this.handleWindowResize,300,this);this.handleWindowScroll=this.handleWindowScroll.bind(this);this.handleTouchMove=this.handleTouchMove.bind(this);this.handleSliderOpenStart=this.handleSliderOpenStart.bind(this);this.handleSliderOpenComplete=this.handleSliderOpenComplete.bind(this);this.handleSliderMaximizeStart=this.handleSliderMaximizeStart.bind(this);this.handleSliderCloseStart=this.handleSliderCloseStart.bind(this);this.handleSliderCloseComplete=this.handleSliderCloseComplete.bind(this);this.handleSliderMinimizeStart=this.handleSliderMinimizeStart.bind(this);this.handleSliderLoad=this.handleSliderLoad.bind(this);this.handleSliderDestroy=this.handleSliderDestroy.bind(this);this.handleEscapePress=this.handleEscapePress.bind(this);this.handleFullScreenChange=this.handleFullScreenChange.bind(this);i.EventEmitter.subscribe("SidePanel:open",this.open.bind(this),{compatMode:true});i.EventEmitter.subscribe("SidePanel:close",this.close.bind(this),{compatMode:true});i.EventEmitter.subscribe("SidePanel:closeAll",this.closeAll.bind(this),{compatMode:true});i.EventEmitter.subscribe("SidePanel:destroy",this.destroy.bind(this),{compatMode:true});i.EventEmitter.subscribe("SidePanel:hide",this.hide.bind(this),{compatMode:true});i.EventEmitter.subscribe("SidePanel:unhide",this.unhide.bind(this),{compatMode:true});i.EventEmitter.subscribe("SidePanel:postMessage",this.postMessage.bind(this),{compatMode:true});i.EventEmitter.subscribe("SidePanel:postMessageAll",this.postMessageAll.bind(this),{compatMode:true});i.EventEmitter.subscribe("SidePanel:postMessageTop",this.postMessageTop.bind(this),{compatMode:true});i.EventEmitter.subscribe("BX.Bitrix24.PageSlider:close",this.close.bind(this),{compatMode:true});i.EventEmitter.subscribe("Bitrix24.Slider:postMessage",this.handlePostMessageCompatible.bind(this),{compatMode:true})}return babelHelpers.createClass(e,[{key:"open",value:function e(t,i){const n=re(de,this,me).call(this,t,i);if(n===null){return false}return this.tryApplyHacks(n,(()=>n.open()))}},{key:"getMinimizeOptions",value:function e(i){const n=this.getUrlRule(i);const s=n!==null&&t.Type.isPlainObject(n.options)?n.options:{};return t.Type.isPlainObject(s.minimizeOptions)?s.minimizeOptions:null}},{key:"maximize",value:function e(t,i){const n=re(de,this,me).call(this,t,i);if(n===null){return false}return this.tryApplyHacks(n,(()=>n.maximize()))}},{key:"tryApplyHacks",value:function e(t,i){if(!this.isOpen()){this.applyHacks(t)}const n=i();if(!n){this.resetHacks(t)}return n}},{key:"isOpen",value:function e(){return this.opened}},{key:"close",value:function e(t,i){const n=this.getTopSlider();if(n){n.close(t,i)}}},{key:"closeAll",value:function e(t){const i=this.getOpenSliders();for(let e=i.length-1;e>=0;e--){const n=i[e];const s=n.close(t);if(!s){break}}}},{key:"minimize",value:function e(t,i){const n=this.getTopSlider();if(n){n.minimize(t,i)}}},{key:"hide",value:function e(){if(this.hidden){return false}const t=this.getTopSlider();
90this.getOpenSliders().forEach((e=>{e.hide()}));this.hidden=true;this.resetHacks(t);return true}},{key:"unhide",value:function e(){if(!this.hidden){return false}this.getOpenSliders().forEach((e=>{e.unhide()}));this.hidden=false;setTimeout((()=>{this.applyHacks(this.getTopSlider())}),0);return true}},{key:"isHidden",value:function e(){return this.hidden}},{key:"destroy",value:function e(i){if(!t.Type.isStringFilled(i)){return}const n=this.refineUrl(i);const s=this.getSlider(n);if(this.getLastOpenSlider()&&(s||this.getLastOpenSlider().getUrl()===n)){this.getLastOpenSlider().destroy()}if(s!==null){const e=this.getOpenSliders();for(let t=e.length-1;t>=0;t--){const i=e[t];i.destroy();if(i===s){break}}}}},{key:"reload",value:function e(){const t=this.getTopSlider();if(t){t.reload()}}},{key:"getTopSlider",value:function e(){const t=this.openSliders.length;return this.openSliders[t-1]||null}},{key:"getPreviousSlider",value:function e(t){let i=null;const n=this.getOpenSliders();t=t||this.getTopSlider();for(let e=n.length-1;e>=0;e--){const s=n[e];if(s===t){i=n[e-1]||null;break}}return i}},{key:"getSlider",value:function e(t){const i=this.refineUrl(t);const n=this.getOpenSliders();for(const e of n){if(e.getUrl()===i){return e}}return null}},{key:"getSliderByWindow",value:function e(t){const i=this.getOpenSliders();for(const e of i){if(e.getFrameWindow()===t){return e}}return null}},{key:"getOpenSliders",value:function e(){return this.openSliders}},{key:"getOpenSlidersCount",value:function e(){return this.openSliders.length}},{key:"getLastOpenSlider",value:function e(){return this.lastOpenSlider}},{key:"adjustLayout",value:function e(){this.getOpenSliders().forEach((e=>{e.adjustLayout()}))}},{key:"createToolbar",value:function e(t){if(this.toolbar===null){this.toolbar=new se(t)}return this.toolbar}},{key:"getToolbar",value:function e(){return this.toolbar}},{key:"refineUrl",value:function e(i){if(t.Type.isStringFilled(i)&&/IFRAME/.test(i)){return t.Uri.removeParam(i,["IFRAME","IFRAME_TYPE"])}return i}},{key:"getPageUrl",value:function e(){return this.pageUrl}},{key:"getCurrentUrl",value:function e(){return window.location.pathname+window.location.search+window.location.hash}},{key:"getPageTitle",value:function e(){return this.pageTitle}},{key:"getCurrentTitle",value:function e(){let i=document.title;if(!t.Type.isUndefined(window.BXIM)){i=i.replace(/^\(\d+\) /,"")}return i}},{key:"enterFullScreen",value:function e(){if(!this.getTopSlider()||this.getFullScreenSlider()){return}const i=document.body;if(i.requestFullscreen){t.Event.bind(document,"fullscreenchange",this.handleFullScreenChange);i.requestFullscreen()}else if(i.webkitRequestFullScreen){t.Event.bind(document,"webkitfullscreenchange",this.handleFullScreenChange);i.webkitRequestFullScreen()}else if(i.msRequestFullscreen){t.Event.bind(document,"MSFullscreenChange",this.handleFullScreenChange);i.msRequestFullscreen()}else if(i.mozRequestFullScreen){t.Event.bind(document,"mozfullscreenchange",this.handleFullScreenChange);i.mozRequestFullScreen()}else{console.log("Slider: Full Screen mode is not supported.")}}},{key:"exitFullScreen",value:function e(){if(!this.getFullScreenSlider()){return}if(document.exitFullscreen){document.exitFullscreen()}else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}else if(document.msExitFullscreen){document.msExitFullscreen()}else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}}},{key:"getFullScreenElement",value:function e(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||null}},{key:"getFullScreenSlider",value:function e(){return this.fullScreenSlider}},{key:"handleFullScreenChange",value:function e(i){if(this.getFullScreenElement()){this.fullScreenSlider=this.getTopSlider();t.Dom.addClass(this.fullScreenSlider.getOverlay(),"side-panel-fullscreen");this.fullScreenSlider.fireEvent("onFullScreenEnter")}else{if(this.getFullScreenSlider()){t.Dom.removeClass(this.getFullScreenSlider().getOverlay(),"side-panel-fullscreen");this.fullScreenSlider.fireEvent("onFullScreenExit");this.fullScreenSlider=null}t.Event.unbind(document,i.type,this.handleFullScreenChange);window.scrollTo(0,this.pageScrollTop);setTimeout((()=>{this.adjustLayout();const e=document.createEvent("Event");e.initEvent("resize",true,true);
90window.dispatchEvent(e)}),1e3)}}},{key:"postMessage",value:function e(t,n,s){const o=this.getSliderFromSource(t);if(!o){return}let l=null;const a=this.getOpenSliders();for(let e=a.length-1;e>=0;e--){const t=a[e];if(t===o){l=a[e-1]||null;break}}const r=l?l.getWindow():window;r.BX.onCustomEvent("Bitrix24.Slider:onMessage",[o,s]);const u=new E({sender:o,slider:l||null,data:s,eventId:n});if(l){l.firePageEvent(u);l.fireFrameEvent(u)}else{i.EventEmitter.emit(u.getFullName().toLowerCase(),new i.BaseEvent({data:[u],compatData:[u]}))}}},{key:"postMessageAll",value:function e(t,n,s){const o=this.getSliderFromSource(t);if(!o){return}let l=null;const a=this.getOpenSliders();for(let e=a.length-1;e>=0;e--){const t=a[e];if(t===o){continue}l=new E({sender:o,slider:t,data:s,eventId:n});t.firePageEvent(l);t.fireFrameEvent(l)}l=new E({sender:o,slider:null,data:s,eventId:n});i.EventEmitter.emit(l.getFullName().toLowerCase(),new i.BaseEvent({data:[l],compatData:[l]}))}},{key:"postMessageTop",value:function e(t,n,s){const o=this.getSliderFromSource(t);if(!o){return}const l=new E({sender:o,slider:null,data:s,eventId:n});i.EventEmitter.emit(l.getFullName().toLowerCase(),new i.BaseEvent({data:[l],compatData:[l]}))}},{key:"bindAnchors",value:function e(i){if(!t.Type.isPlainObject(i)||!t.Type.isArray(i.rules)||i.rules.length===0){return}if(this.anchorRules.length===0){this.registerAnchorListener(window.document)}if(!(i.rules instanceof Object)){console.error("BX.SitePanel: anchor rules were created in a different context. "+"This might be a reason for a memory leak.");console.trace()}
90i.rules.forEach((e=>{if(t.Type.isArray(e.condition)){for(let i=0;i<e.condition.length;i++){if(t.Type.isString(e.condition[i])){e.condition[i]=new RegExp(e.condition[i],"i")}}}e.options??={};this.anchorRules.push(e)}))}},{key:"isAnchorBinding",value:function e(){return this.anchorBinding}},{key:"enableAnchorBinding",value:function e(){this.anchorBinding=true}},{key:"disableAnchorBinding",value:function e(){this.anchorBinding=false}},{key:"registerAnchorListener",value:function e(i){t.Event.bind(i,"click",this.handleAnchorClick,true)}},{key:"unregisterAnchorListener",value:function e(i){t.Event.unbind(i,"click",this.handleAnchorClick,true)}},{key:"handleSliderOpenStart",value:function e(t){if(!t.isActionAllowed()){return}const i=t.getSlider();if(i.isDestroyed()){return}if(this.getTopSlider()){this.exitFullScreen();this.getTopSlider().hideOverlay();i.setOverlayBackground();const e=this.getTopSlider().getOffset()===i.getOffset()&&this.getTopSlider().getWidth()===i.getWidth()&&this.getTopSlider().getCustomLeftBoundary()===i.getCustomLeftBoundary();if(!e){this.getTopSlider().showShadow()}this.getTopSlider().hideCloseBtn();this.getTopSlider().hideExtraLabels()}else{i.setOverlayAnimation(true)}re(de,this,ge).call(this,i);if(!this.opened){this.pageUrl=this.getCurrentUrl();this.pageTitle=this.getCurrentTitle()}this.opened=true;re(de,this,ve).call(this)}},{key:"handleSliderOpenComplete",value:function e(i){this.setBrowserHistory(i.getSlider());this.updateBrowserTitle();i.getSlider().setAnimation("sliding");const n=this.getOpenSliders();const s=i.getSlider();for(let e=n.length-1;e>=0;e--){const i=n[e];if(s===i){continue}if(s.getContainer().offsetLeft<=i.getContainer().offsetLeft){t.Dom.addClass(i.getOverlay(),"--invisible")}else{break}}}},{key:"handleSliderCloseStart",value:function e(i){if(!i.isActionAllowed()){return}if(i.getSlider()&&i.getSlider().isDestroyed()){return}const n=this.getPreviousSlider();const s=this.getTopSlider();this.exitFullScreen();let o=null;const l=this.getOpenSliders();for(let e=l.length-1;e>=0;e--){const n=l[e];if(i.getSlider()===n){continue}if(o===null||n.getContainer().offsetLeft<o.getContainer().offsetLeft){t.Dom.removeClass(n.getOverlay(),"--invisible");o=n}}if(n){n.unhideOverlay();n.hideShadow();n.showCloseBtn();n.showExtraLabels();if(s){s.hideOverlay();s.hideShadow()}}}},{key:"handleSliderMaximizeStart",value:function e(t){if(!t.isActionAllowed()||this.getToolbar()===null){return}const i=t.getSlider();if(i&&i.isDestroyed()){return}const{entityType:n,entityId:s}=i.getMinimizeOptions()||{};const o=this.getToolbar().getItem(n,s);this.getToolbar().request("maximize",o);const l=re(de,this,ke).call(this,i,o);i.setAnimation("scale",{origin:l})}},{key:"handleSliderMinimizeStart",value:function e(i){if(!i.isActionAllowed()||this.getToolbar()===null){return}const n=i.getSlider();if(n&&n.isDestroyed()){return}if(!this.getToolbar().isShown()){this.getToolbar().show()}let s=n.getTitle();if(!s){s=n.getFrameWindow()?n.getFrameWindow().document.title:null}this.getToolbar().expand(true);const o=this.getMinimizeOptions(n.getUrl());const{entityType:l,entityId:a,url:r}=n.getMinimizeOptions()||o||{};const u=this.getToolbar().minimizeItem({title:s,url:t.Type.isStringFilled(r)?r:n.getUrl(),entityType:l,entityId:a});const h=re(de,this,ke).call(this,n,u);n.setAnimation("scale",{origin:h})}},{key:"handleSliderCloseComplete",value:function e(t){const i=t.getSlider();if(i===this.getTopSlider()){re(de,this,ye).call(this,i)}t.getSlider().setAnimation("sliding");this.cleanUpClosedSlider(i)}},{key:"handleSliderDestroy",value:function e(t){const n=t.getSlider();i.EventEmitter.unsubscribe(n,"SidePanel.Slider:onOpenStart",this.handleSliderOpenStart);i.EventEmitter.unsubscribe(n,"SidePanel.Slider:onBeforeOpenComplete",this.handleSliderOpenComplete);i.EventEmitter.unsubscribe(n,"SidePanel.Slider:onMaximizeStart",this.handleSliderMaximizeStart);i.EventEmitter.unsubscribe(n,"SidePanel.Slider:onCloseStart",this.handleSliderCloseStart);i.EventEmitter.unsubscribe(n,"SidePanel.Slider:onBeforeCloseComplete",this.handleSliderCloseComplete);i.EventEmitter.unsubscribe(n,"SidePanel.Slider:onMinimizeStart",this.handleSliderMinimizeStart);i.EventEmitter.unsubscribe(n,"SidePanel.Slider:onLoad",this.handleSliderLoad);i.EventEmitter.unsubscribe(n,"SidePanel.Slider:onDestroy",this.handleSliderDestroy);i.EventEmitter.unsubscribe(n,"SidePanel.Slider:onEscapePress",this.handleEscapePress);const s=t.getSlider().getFrameWindow();if(s&&!t.getSlider().allowCrossOrigin){this.unregisterAnchorListener(s.document)}if(n===this.getLastOpenSlider()){this.lastOpenSlider=null}this.cleanUpClosedSlider(n)}},{key:"handleEscapePress",value:function e(t){const i=this.getTopSlider();if(i?.canCloseByEsc()&&this.isOnTop(i)){i.close()}}},{key:"cleanUpClosedSlider",value:function e(t){re(de,this,pe).call(this,t);t.unhideOverlay();
90t.hideShadow();if(this.getTopSlider()){this.getTopSlider().unhideOverlay();this.getTopSlider().hideShadow();this.getTopSlider().showCloseBtn();this.getTopSlider().showExtraLabels();this.getTopSlider().focus()}else{window.focus()}if(!this.getOpenSlidersCount()){this.resetHacks(t);this.opened=false}this.resetBrowserHistory();this.updateBrowserTitle()}},{key:"handleSliderLoad",value:function e(t){const i=t.getSlider().getFrameWindow();if(i){this.registerAnchorListener(i.document)}this.setBrowserHistory(t.getSlider());this.updateBrowserTitle()}},{key:"handlePostMessageCompatible",value:function e(t,i){this.postMessage(t,"",i)}},{key:"getSliderFromSource",value:function e(i){if(i instanceof q){return i}if(t.Type.isStringFilled(i)){return this.getSlider(i)}if(i!==null&&i===i.window&&window!==i){return this.getSliderByWindow(i)}return null}},{key:"applyHacks",value:function e(t){if(this.hacksApplied){return false}if(t){t.applyHacks()}this.disablePageScrollbar();this.bindEvents();if(t){t.applyPostHacks()}this.hacksApplied=true;return true}},{key:"resetHacks",value:function e(t){if(!this.hacksApplied){return false}if(t){t.resetPostHacks()}this.enablePageScrollbar();this.unbindEvents();if(t){t.resetHacks()}this.hacksApplied=false;return true}},{key:"bindEvents",value:function e(){t.Event.bind(document,"keydown",this.handleDocumentKeyDown);t.Event.bind(window,"resize",this.handleWindowResize);t.Event.bind(window,"scroll",this.handleWindowScroll);if(t.Browser.isMobile()){t.Event.bind(document.body,"touchmove",this.handleTouchMove)}}},{key:"unbindEvents",value:function e(){t.Event.unbind(document,"keydown",this.handleDocumentKeyDown);t.Event.unbind(window,"resize",this.handleWindowResize);t.Event.unbind(window,"scroll",this.handleWindowScroll);if(t.Browser.isMobile()){t.Event.unbind(document.body,"touchmove",this.handleTouchMove)}}},{key:"disablePageScrollbar",value:function e(){const i=window.innerWidth-document.documentElement.clientWidth;document.body.style.paddingRight=i+"px";t.Dom.style(document.body,"--scroll-shift-width",`${i}px`);t.Dom.addClass(document.body,"side-panel-disable-scrollbar");this.pageScrollTop=window.pageYOffset||document.documentElement.scrollTop}},{key:"enablePageScrollbar",value:function e(){document.body.style.removeProperty("padding-right");t.Dom.style(document.body,"--scroll-shift-width",null);t.Dom.removeClass(document.body,"side-panel-disable-scrollbar")}},{key:"losePageFocus",value:function e(){if(t.Type.isDomNode(document.activeElement)){document.activeElement.blur()}}},{key:"handleDocumentKeyDown",value:function e(t){if(t.keyCode!==27){return}t.preventDefault();this.handleEscapePress()}},{key:"handleWindowResize",value:function e(){this.adjustLayout()}},{key:"handleWindowScroll",value:function e(){window.scrollTo(0,this.pageScrollTop);this.adjustLayout()}},{key:"handleTouchMove",value:function e(t){t.preventDefault()}},{key:"isOnTop",value:function e(i){if(i){const e=r.PopupManager.getPopups();const t=e.every((e=>i.isOnTopOfPopup(e)));if(!t){return false}}const n=document.documentElement.clientWidth/2;const s=document.documentElement.clientHeight/2;const o=document.elementFromPoint(n,s);return t.Dom.hasClass(o,"side-panel")||o.closest(".side-panel")!==null}},{key:"extractLinkFromEvent",value:function e(i){const n=i.target;if(i.which!==1||!t.Type.isDomNode(n)||i.ctrlKey||i.metaKey){return null}let s=n;if(n.nodeName!=="A"&&t.Type.isElementNode(n)){s=n.closest("a")}if(!t.Type.isDomNode(s)){return null}const o=s.getAttribute("href");if(o){return{url:o,anchor:s,target:s.getAttribute("target")}}return null}},{key:"handleAnchorClick",value:function e(i){const n=this.extractLinkFromEvent(i);if(!n){return}const s=this.getUrlRule(n.url,n);if(!this.isAnchorBinding()&&!s?.forceAnchorBinding){return}if(t.Dom.attr(n.anchor,"data-slider-ignore-autobinding")!==null){return}if(t.Dom.attr(i.target,"data-slider-ignore-autobinding")!==null){return}if(!this.isValidLink(s,n)){return}if(n.anchor!==i.target){try{n.anchor.focus({preventScroll:true,focusVisible:false})}catch{}}if(t.Type.isFunction(s.handler)){s.handler(i,n)}else{i.preventDefault();
90if(t.Dom.attr(i.target,"data-slider-maximize")===null){this.open(n.url,s.options)}else{this.maximize(n.url,s.options)}}}},{key:"emulateAnchorClick",value:function e(i){const n={url:i,anchor:null,target:null};const s=this.getUrlRule(i,n);if(!this.isValidLink(s,n)){BX.reload(i)}else if(t.Type.isFunction(s.handler)){s.handler(new MouseEvent("slider",{bubbles:false,cancelable:true}),n)}else{this.open(n.url,s.options)}}},{key:"getUrlRule",value:function e(i,n){if(!t.Type.isStringFilled(i)){return null}if(!t.Type.isPlainObject(n)){const e=document.createElement("a");e.href=i;n={url:i,anchor:e,target:""}}for(let e=0;e<this.anchorRules.length;e++){const s=this.anchorRules[e];if(!t.Type.isArray(s.condition)){continue}for(let e=0;e<s.condition.length;e++){const o=i.match(s.condition[e]);if(o&&!this.hasStopParams(i,s.stopParameters)){n.matches=o;let e=t.Type.isFunction(s.options)?s.options(n):s.options;const i=t.Type.isFunction(s.minimizeOptions)?s.minimizeOptions(n):null;if(t.Type.isPlainObject(i)){if(t.Type.isPlainObject(e)){e.minimizeOptions=i}else{e={minimizeOptions:i}}}if(t.Type.isStringFilled(s.loader)&&!t.Type.isStringFilled(e.loader)){e.loader=s.loader;delete s.loader}return{...s,options:e}}}}return null}},{key:"isValidLink",value:function e(i,n){if(!i){return false}if(i.allowCrossDomain!==true&&t.ajax.isCrossDomain(n.url)){return false}if(i.mobileFriendly!==true&&t.Browser.isMobile()){return false}return!t.Type.isFunction(i.validate)||i.validate(n)}},{key:"setBrowserHistory",value:function e(t){if(!(t instanceof q)){return}if(t.canChangeHistory()&&t.isOpen()&&t.isLoaded()){window.history.replaceState({},"",t.getUrl())}}},{key:"resetBrowserHistory",value:function e(){let t=null;const i=this.getOpenSliders();for(let e=i.length-1;e>=0;e--){const n=i[e];if(n.canChangeHistory()&&n.isOpen()&&n.isLoaded()){t=n;break}}const n=t?t.getUrl():this.getPageUrl();if(n){window.history.replaceState({},"",n)}}},{key:"updateBrowserTitle",value:function e(){let i=null;const n=this.getOpenSliders();for(let e=n.length-1;e>=0;e--){i=this.getBrowserTitle(n[e]);if(t.Type.isStringFilled(i)){break}}if(t.Type.isStringFilled(i)){document.title=i;this.titleChanged=true}else if(this.titleChanged){document.title=this.getPageTitle();this.titleChanged=false}}},{key:"getBrowserTitle",value:function e(i){if(!i||!i.canChangeTitle()||!i.isOpen()||!i.isLoaded()){return null}let n=i.getTitle();if(!n&&!i.isSelfContained()){n=i.getFrameWindow()?i.getFrameWindow().document.title:null}return t.Type.isStringFilled(n)?n:null}},{key:"hasStopParams",value:function e(i,n){if(!n||!t.Type.isArray(n)||!t.Type.isStringFilled(i)){return false}const s=i.indexOf("?");if(s===-1){return false}const o=i.slice(Math.max(0,s));for(const e of n){if(new RegExp(`[?&]${e}=`,"i").test(o)){return true}}return false}},{key:"getLastOpenPage",value:function e(){return this.getLastOpenSlider()}},{key:"getCurrentPage",value:function e(){return this.getTopSlider()}}],[{key:"registerSliderClass",value:function e(i,n=null,s=null){if(t.Type.isStringFilled(i)){ue=i}if(t.Type.isPlainObject(n)){he=n}if(t.Type.isPlainObject(s)){ce=s}}},{key:"getSliderClass",value:function e(){const i=ue===null?null:t.Reflection.getClass(ue);return i===null?q:i}},{key:"getSliderDefaultOptions",value:function e(){return he===null?{}:he}},{key:"getSliderPriorityOptions",value:function e(){return ce===null?{}:ce}}])}();oe=fe;function me(e,n){if(!t.Type.isStringFilled(e)){return null}const s=this.refineUrl(e);if(this.isHidden()){this.unhide()}const o=this.getTopSlider();if(o&&o.isOpen()&&o.getUrl()===s){return null}if(this.getLastOpenSlider()&&this.getLastOpenSlider().getUrl()===s){return this.getLastOpenSlider()}const l=this.getUrlRule(s);const a=l!==null&&t.Type.isPlainObject(l.options)?l.options:{};const r=n?.useGlobalOptions??a.useGlobalOptions??true;const u=n!==a&&r;const h={...u?a:{},...n,events:[u&&a.events,n?.events]};const c=oe.getSliderDefaultOptions();const d=oe.getSliderPriorityOptions();const f=oe.getSliderClass();const m=new f(s,t.Runtime.merge(c,h,d));let g=null;if(m.shouldUseAutoOffset()&&m.getWidth()===null&&m.getCustomLeftBoundary()===null){g=0;const e=re(de,this,be).call(this);if(o&&e!==null){g=Math.min(e+re(de,this,Ce).call(this),re(de,this,Se).call(this))}}m.setOffset(g);if(o&&o.getCustomRightBoundary()!==null){const e=m.calculateRightBoundary();if(e>o.getCustomRightBoundary()){m.setCustomRightBoundary(o.getCustomRightBoundary())}}i.EventEmitter.subscribe(m,"SidePanel.Slider:onOpenStart",this.handleSliderOpenStart,{compatMode:true});i.EventEmitter.subscribe(m,"SidePanel.Slider:onBeforeOpenComplete",this.handleSliderOpenComplete,{compatMode:true});i.EventEmitter.subscribe(m,"SidePanel.Slider:onMaximizeStart",this.handleSliderMaximizeStart,{compatMode:true});i.EventEmitter.subscribe(m,"SidePanel.Slider:onCloseStart",this.handleSliderCloseStart,{compatMode:true});i.EventEmitter.subscribe(m,"SidePanel.Slider:onBeforeCloseComplete",this.handleSliderCloseComplete,{compatMode:true});i.EventEmitter.subscribe(m,"SidePanel.Slider:onMinimizeStart",this.handleSliderMinimizeStart,{compatMode:true});i.EventEmitter.subscribe(m,"SidePanel.Slider:onLoad",this.handleSliderLoad,{compatMode:true});i.EventEmitter.subscribe(m,"SidePanel.Slider:onDestroy",this.handleSliderDestroy,{compatMode:true});i.EventEmitter.subscribe(m,"SidePanel.Slider:onEscapePress",this.handleEscapePress,{compatMode:true});return m}function ge(e){if(!(e instanceof q)){throw new TypeError("Slider is not an instance of BX.SidePanel.Slider")}this.openSliders.push(e)}function pe(e){const t=[...this.getOpenSliders()];for(const[i,n]of t.entries()){if(n===e){this.openSliders.splice(i,1);return true}}return false}function ye(e){if(this.lastOpenSlider!==e){if(this.lastOpenSlider){this.lastOpenSlider.destroy()}this.lastOpenSlider=e}}
90function ve(){if(this.lastOpenSlider&&this.getTopSlider()!==this.lastOpenSlider){this.lastOpenSlider.destroy()}this.lastOpenSlider=null}function be(){const e=this.getOpenSliders();for(let t=e.length-1;t>=0;t--){const i=e[t];if(i.getOffset()!==null){return i.getOffset()}}return null}function Ce(){return 63}function Se(){return re(de,this,Ce).call(this)*3}function ke(e,t){if(t&&t.getContainer().offsetWidth>0){const i=t.getContainer().getBoundingClientRect();const n=e.getContainer().getBoundingClientRect().left;const s=i.left-n+i.width/2;return`${s}px ${i.top}px`}return"50% 100%"}const Te={};Object.defineProperty(Te,"Instance",{enumerable:false,get:te});const we=t.Reflection.namespace("BX.SidePanel");Object.defineProperty(we,"Instance",{enumerable:false,get:te});e.Dictionary=g;e.Event=k;e.Label=C;e.Manager=fe;e.MessageEvent=E;e.SidePanel=Te;e.Slider=q;e.SliderEvent=k;e.SliderManager=fe;e.Toolbar=se;e.ToolbarItem=J})(this.BX.SidePanel=this.BX.SidePanel||{},BX,BX.Event,BX.Cache,BX,BX.UI.Accessibility,BX.UI.System,BX,BX.Main);
91//# sourceMappingURL=side-panel.bundle.map.js

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.