Your IP : 172.69.7.234


Current Path : /var/www/element/data/www/revenuestory.ru/bitrix/js/ui/tutor/dist/
Upload File :
Current File : /var/www/element/data/www/revenuestory.ru/bitrix/js/ui/tutor/dist/tutor.bundle.min.js

this.BX=this.BX||{};this.BX.UI=this.BX.UI||{};(function(t,e,i,s){"use strict";var n=function(t){babelHelpers.inherits(i,t);function i(t){var s;babelHelpers.classCallCheck(this,i);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this));s.setEventNamespace("BX.UI.Tutor.Step");t=e.Type.isPlainObject(t)?t:{};s.id=t.id||null;s.title=t.title||null;s.description=t.description||null;s.url=t.url||"";s.isCompleted=t.isCompleted||false;s.video=t.video||null;s.helpLink=t.helpLink||null;s.highlight=t.highlight||null;s.isActive=t.isActive===true;s.isShownForSlider=t.isShownForSlider||false;s.initOptions=t;s.videoObj=null;return s}babelHelpers.createClass(i,[{key:"getTitle",value:function t(){return this.title}},{key:"getVideoObj",value:function t(){return this.videoObj}},{key:"getHighlightOptions",value:function t(){return this.highlight}},{key:"getDescription",value:function t(){return this.description}},{key:"getUrl",value:function t(){return this.url}},{key:"getCompleted",value:function t(){return this.isCompleted}},{key:"getVideo",value:function t(){return this.video}},{key:"getHelpLink",value:function t(){return this.helpLink}},{key:"getId",value:function t(){return this.id}},{key:"getInitOptions",value:function t(){return this.initOptions}},{key:"activate",value:function t(){this.isActive=true}},{key:"getShownForSlider",value:function t(){return this.isShownForSlider}},{key:"deactivate",value:function t(){this.isActive=false}}],[{key:"getFullEventName",value:function t(e){return e}}]);return i}(e.Event.EventEmitter);var o,r,l,a,u,p,h,c,d,f,g;var m=function(t){babelHelpers.inherits(m,t);function m(){var t;babelHelpers.classCallCheck(this,m);t=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(m).call(this));t.setEventNamespace("BX.UI.Tutor.Manager");return t}babelHelpers.createClass(m,[{key:"setOptions",value:function t(i,s,n){i=i||{};this.tutorialData=i.tutorialData||{};this.eventService=i.eventService||{};this.lastCheckTime=i.lastCheckTime||0;this.domain=i.domain||"";this.feedbackFormId=i.feedbackFormId||"";if(e.Type.isString(s)&&s.length>0){this.domain=s}if(e.Type.isString(n)&&n.length>0){this.feedbackFormId=n}}},{key:"showFeedbackForm",value:function t(){if(this.feedbackFormId){this.feedBackForm=BX.UI.Feedback.Form.getById(this.feedbackFormId);if(this.feedBackForm){this.feedBackForm.openPanel()}}}},{key:"getDomain",value:function t(){return this.domain}},{key:"getCurrentTutorialData",value:function t(){return this.tutorialData}},{key:"getCurrentEventService",value:function t(){return this.eventService}},{key:"getCurrentLastCheckTime",value:function t(){return this.lastCheckTime}}],[{key:"getInstance",value:function t(){return this.instance}},{key:"getScenarioInstance",value:function t(){return this.scenarioInstance}},{key:"init",value:function t(e,i,s){var n=this.getInstance();if(!(n instanceof m)){this.instance=new m;n=this.getInstance();this.emit("onInitManager")}else{n=this.getInstance()}n.setOptions(e,i,s);return n}},{key:"initScenario",value:function t(e){var i=this.getScenarioInstance();if(!(i instanceof Y)){this.scenarioInstance=new Y;i=this.getScenarioInstance();this.emit("onInitScenario")}else{i=this.getScenarioInstance()}i.setOptions(e);return i}},{key:"showButton",value:function t(e){return this.getImButton(e)}},{key:"getRootImButton",value:function t(){return document.getElementById("ui-tutor-btn-wrap")}},{key:"hasImButton",value:function t(){return!!this.getRootImButton()}},{key:"getImButton",value:function t(i){var s=this;if(!this.layout.imButton){var n=this.getRootImButton();if(n){var r=e.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-btn"></div>\n\t\t\t\t'])));if(i){e.Dom.addClass(n,"ui-tutor-btn-wrap-animate")}e.Dom.append(r,n);e.Dom.addClass(n,"ui-tutor-btn-wrap-show");this.layout.imButton=n;e.Event.bind(this.layout.imButton,"click",function(){s.emit("clickImButton")});var l=document.querySelector(".bx-im-users-wrap");if(document.querySelector("#bx-im-btn-call")){l.style.bottom="175px"}else{l.style.bottom="120px"}}}return this.layout.imButton}},{key:"showSmallPopup",value:function t(i){this.smallPopupText=i;this.getSmallPopup().style.display="block";this.smallPopupText="";if(e.Dom.hasClass(this.getSmallPopup(),"ui-tutor-popup-welcome-hide")){e.Dom.removeClass(this.getSmallPopup(),"ui-tutor-popup-welcome-hide")}}},{key:"hideSmallPopup",value:function t(i){i=i===true;var s=function(){e.Dom.remove(this.getSmallPopup());if(this.hasOwnProperty("smallPopup")){delete this.smallPopup}this.emit("onCompleteHideSmallPopup")}.bind(this);e.Dom.removeClass(this.getSmallPopup(),"ui-tutor-popup-welcome-show");e.Dom.addClass(this.getSmallPopup(),"ui-tutor-popup-welcome-hide");if(i){s()}else{setTimeout(s,300)}}},{key:"showWelcomePopup",value:function t(e){this.emit("onShowWelcomePopup");this.showSmallPopup(e)}},{key:"hideWelcomePopup",value:function t(){this.emit("onBeforeHideWelcomePopup");this.hideSmallPopup();this.emit("onAfterHideWelcomePopup")}},{key:"showNoticePopup",value:function t(e){this.emit("onShowNoticePopup");this.showSmallPopup(e)}},{key:"hideNoticePopup",value:function t(){this.emit("onBeforeHideNoticePopup");this.hideSmallPopup();this.emit("onAfterHideNoticePopup")}},{key:"getSmallPopup",value:function t(){var i=this;var s=function t(){i.emit("onClickSmallPopupBtn")};if(!this.smallPopup){this.smallPopup=e.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup" onclick="','">\n\t\t\t\t\t\t<div class="ui-tutor-popup-header">\n\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-icon"></span>\n\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-title-wrap">\n\t\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-title">','</span> \n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-content">\n\t\t\t\t\t\t\t<div class="ui-tutor-popup-text">','</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-icon-angle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t'])),s.bind(this),e.Loc.getMessage("JS_UI_TUTOR_TITLE"),this.smallPopupText);this.emit("onCreateSmallPopupNode");e.Dom.addClass(this.smallPopup,"ui-tutor-popup-welcome-show");this.emit("onBeforeAppendSmallPopupNode");e.Dom.append(this.smallPopup,document.body);this.emit("onAfterAppendSmallPopupNode")}return this.smallPopup}},{key:"showStartPopup",value:function t(i,s){this.emit("onShowStartPopup");this.startTitle=i;this.startText=s;e.Dom.addClass(this.getStartPopup(),"ui-tutor-popup-show");this.startPopup.style.display="flex";this.startTitle="";this.startText=""}},{key:"closeStartPopup",value:function t(){e.Dom.remove(this.getStartPopup());delete this.startPopup}},{key:"getStartPopup",value:function t(){if(!this.startPopup){this.startPopup=e.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup ui-tutor-popup-start">\n\t\t\t\t\t\t<div class="ui-tutor-popup-header">\n\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-icon"></span>\n\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-title-wrap">\n\t\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-title">','</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-content">\n\t\t\t\t\t\t\t<div class="ui-tutor-popup-title">','</div>\n\t\t\t\t\t\t\t<div class="ui-tutor-popup-text">','</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-footer">\n\t\t\t\t\t\t\t<div class="ui-tutor-popup-btn">\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t",'\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-icon-angle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t'])),e.Loc.getMessage("JS_UI_TUTOR_TITLE"),this.startTitle,this.startText,this.getBeginBtn(),this.getDeferBtn());this.emit("onCreateStartPopupNode");e.Dom.append(this.startPopup,document.body);this.emit("onAfterAppendStartPopupNode")}return this.startPopup}},{key:"getBeginBtn",value:function t(){var i=this;if(!this.beginBtn){this.beginBtn=e.Tag.render(a||(a=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<button class="ui-btn ui-btn-primary ui-btn-round">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</button>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_BTN_BEGIN"));e.Event.bind(this.beginBtn,"click",function(){i.emit("clickBeginBtn")})}return this.beginBtn}},{key:"getDeferBtn",value:function t(){var i=this;if(!this.deferBtn){this.deferBtn=e.Tag.render(u||(u=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<button class="ui-btn ui-btn-link">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</button>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_CLOSE_POPUP_BTN"));e.Event.bind(this.deferBtn,"click",function(){i.emit("clickDeferBtn")})}return this.deferBtn}},{key:"getFullEventName",value:function t(e){return e}},{key:"getInformer",value:function t(){if(!this.informer){this.informer=e.Tag.render(p||(p=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-informer" id="ui-tutor-informer"></div>\n\t\t\t\t'])));var i=this.getImButton();if(this.isCollapsedShow){i=this.getCollapseBlock()}if(i){e.Dom.append(this.informer,i)}}return this.informer}},{key:"setCount",value:function t(e){this.emit("onBeforeSetCount");if(e<1){this.removeInformer();delete this.informer;this.isInformerShow=false}else{this.getInformer().textContent=e;this.isInformerShow=true}this.emit("onAfterSetCount")}},{key:"removeInformer",value:function t(){if(this.isInformerShow){e.Dom.remove(this.getInformer())}}},{key:"showCollapsedBlock",value:function t(i,s,o){s=s!==false;o=o!==false;this.emit("onBeforeShowCollapsedBlock");if(!this.isCollapsedShow){this.emit("onStartShowCollapsedBlock");if(!(i instanceof n)){i=new n(i)}this.collapsedStep=i;var r=this.getCollapseBlock();var l=function t(){r.style.display="flex"};if(o){setTimeout(l.bind(this),300)}else{l.call(this)}this.getCollapseTitle().innerHTML=i.getTitle();if(this.isInformerShow){e.Dom.append(this.getInformer(),r)}this.isCollapsedShow=true;this.emit("onShowCollapsedBlock")}if(s){this.showGuide()}else{this.checkButtonsState()}}},{key:"setCollapsedInvisible",value:function t(){this.hideNode(this.getCollapseBlock())}},{key:"setCollapsedVisible",value:function t(){this.showNode(this.getCollapseBlock())}},{key:"checkButtonsState",value:function t(){this.emit("onCheckButtonsState");var e=this.collapsedStep;if(!e){return}if(e.getCompleted()){if(this.activeGuide){this.hideNode(this.getRepeatBtn())}else{this.showNode(this.getRepeatBtn())}this.hideNode(this.getCompletedBtn());this.hideNode(this.getStartBtn())}else if(e.isActive){this.showNode(this.getCompletedBtn());if(this.activeGuide||!this.isShowRepeatWithCompleted){this.hideNode(this.getRepeatBtn())}else{this.showNode(this.getRepeatBtn())}this.hideNode(this.getStartBtn())}else{this.showNode(this.getStartBtn());this.hideNode(this.getRepeatBtn());this.hideNode(this.getCompletedBtn())}}},{key:"showGuide",value:function t(){this.emit("onBeforeShowGuide");var s=this.collapsedStep;if(!this.activeGuide&&s){this.emit("onStartShowGuide");this.activeGuide=new i.Guide({simpleMode:true,steps:[s.getHighlightOptions()]});this.activeGuide.subscribe(i.Guide.getFullEventName("onFinish"),this.finishGuide.bind(this));this.activeGuide.start();e.Dom.remove(this.activeGuide.getPopup().closeIcon);this.emit("showCollapseWithGuide");this.checkButtonsState()}}},{key:"closeGuide",value:function t(){if(this.activeGuide instanceof i.Guide){this.activeGuide.close();this.emit("onAfterGuide")}}},{key:"getCollapseBlock",value:function t(){if(!this.layout.collapseBlock){this.layout.collapseBlock=e.Tag.render(h||(h=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup ui-tutor-popup-collapse" onclick="','">\n\t\t\t\t\t\t<div class="ui-tutor-popup-content">\n\t\t\t\t\t\t\t<div class="ui-tutor-popup-step-subject">',"</div>\n\t\t\t\t\t\t\t",'\n\t\t\t\t\t\t\t<div class="ui-tutor-popup-collapse-btn">\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t"])),this.clickCollapseBlockHandler.bind(this),e.Loc.getMessage("JS_UI_TUTOR_STEP_TITLE"),this.getCollapseTitle(),this.getStartBtn(),this.getRepeatBtn(),this.getCompletedBtn());this.emit("onCreateCollapsedBlockNode");e.Dom.append(this.layout.collapseBlock,document.body);this.emit("onAfterAppendCollapsedBlockNode")}return this.layout.collapseBlock}},{key:"getStartBtn",value:function t(){var i=this;if(!this.startBtn){this.startBtn=e.Tag.render(c||(c=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<button class="ui-btn ui-btn-primary ui-btn-round ui-btn-xs">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</button>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_BTN_START"));e.Event.bind(this.startBtn,"click",function(t){t.stopPropagation();i.emit("clickStartBtn")})}return this.startBtn}},{key:"getRepeatBtn",value:function t(){var i=this;if(!this.repeatBtn){this.repeatBtn=e.Tag.render(d||(d=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<button class="ui-btn ui-btn-primary ui-btn-round ui-btn-xs">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</button>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_BTN_REPEAT"));e.Event.bind(this.repeatBtn,"click",function(t){t.stopPropagation();i.emit("clickRepeatBtn")})}return this.repeatBtn}},{key:"getCompletedBtn",value:function t(){var i=this;if(!this.completedBtn){this.completedBtn=e.Tag.render(f||(f=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<button class="ui-btn ui-btn-success ui-btn-round ui-btn-xs">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</button>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_BTN_COMPLETED_SHORT"));e.Event.bind(this.completedBtn,"click",function(t){t.stopPropagation();i.emit("clickCompletedBtn")})}return this.completedBtn}},{key:"getCollapseTitle",value:function t(){if(!this.layout.collapseTitle){this.layout.collapseTitle=e.Tag.render(g||(g=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-step-title"></div>\n\t\t\t\t'])))}return this.layout.collapseTitle}},{key:"closeCollapsePopup",value:function t(e){this.closeCollapseEntity();this.emit("clickCloseCollapseBlock")}},{key:"clickCollapseBlockHandler",value:function t(){this.emit("clickCollapseBlock")}},{key:"finishGuide",value:function t(){delete this.activeGuide;this.checkButtonsState();this.emit("completeCloseGuide")}},{key:"closeCollapseEntity",value:function t(){this.emit("onBeforeHideCollapsedBlock");this.getCollapseBlock().style.display="none";this.getImButton().style.display="block";if(this.activeGuide instanceof i.Guide){this.activeGuide.close()}if(this.isInformerShow){e.Dom.append(this.getInformer(),this.getImButton())}delete this.collapsedStep;this.isCollapsedShow=false;this.emit("onHideCollapsedBlock")}},{key:"showLoader",value:function t(){this.emit("onBeforeShowLoader");this.startTitle="";this.startText="";this.layout.loader=new s.Loader({target:this.getStartPopup(),size:85});this.layout.loader.show();this.getStartPopup().style.display="flex";e.Dom.addClass(this.getStartPopup(),"ui-tutor-popup-load");this.emit("onAfterShowLoader")}},{key:"hideLoader",value:function t(){if(this.layout.loader){this.layout.loader.destroy();this.getStartPopup().style.display="none"}}},{key:"showCollapsedLoader",value:function t(){this.emit("onBeforeShowCollapsedLoader");this.layout.collapseLoader=new s.Loader({target:this.getCollapseBlock(),size:34});this.layout.collapseLoader.show();this.getCollapseBlock().style.display="flex";e.Dom.addClass(this.getCollapseBlock(),"ui-tutor-popup-collapse-load");this.emit("onAfterShowCollapsedLoader")}},{key:"hideCollapsedLoader",value:function t(){this.emit("onBeforeHideCollapsedLoader");if(this.layout.collapseLoader){this.layout.collapseLoader.destroy();e.Dom.removeClass(this.getCollapseBlock(),"ui-tutor-popup-collapse-load");this.getCollapseBlock().style.display="none"}this.emit("onAfterHideCollapsedLoader")}},{key:"showNode",value:function t(e){e.style.display="block"}},{key:"hideNode",value:function t(e){e.style.display="none"}},{key:"checkFollowLink",value:function t(i,s){this.emit("onStartCheckFollowLink");i=i||this.collapsedStep;if(i instanceof n){s=s||{};if(!(window.location.pathname===i.getUrl())){var o="onBeforeRedirectToActionPage";if(s instanceof Y){e.Dom.addClass(s.getStartBtn(),"ui-btn-wait");s.fireCurrentStepEvent(o)}else{e.Dom.addClass(this.getStartBtn(),"ui-btn-wait");this.emit(o,{step:i})}window.location=i.getUrl()}else{if(s instanceof Y){s.showCollapseBlock(i)}else{i.activate();this.showCollapsedBlock(i)}}}this.emit("onFinishCheckFollowLink")}},{key:"fireEvent",value:function t(e){this.emit(e)}}]);return m}(e.Event.EventEmitter);m.instance=null;m.scenarioInstance=null;m.activeGuide=null;m.isShowRepeatWithCompleted=true;m.layout={imButton:null,collapseBlock:null,collapseTitle:null};var v,k,y,S,b,B,C,T,w,L,I,D,P,E,N,_,A,H,x,O,U,R,F,M,W,V,G,J,X;var Y=function(t){babelHelpers.inherits(i,t);function i(){var t;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,i);t=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this));t.setEventNamespace("BX.UI.Tutor.Scenario");t.stepPopup=null;t.arrowTimer=null;t.guide=null;t.loader=null;t.arrowWrap=null;t.prevArrow=null;t.nextArrow=null;t.currentStepIndex=0;t.currentStep=null;t.isAddedSteps=false;t.hasArrows=false;t.isLoading=true;t.setOptions(e);t.btn=document.getElementById("ui-tutor-btn-wrap");t.informer=document.getElementById("ui-tutor-informer");t.layout={stepBlock:null,progress:null,counter:null,counterContainer:null,title:null,description:null,collapseBlock:null,collapseTitle:null,collapseDescription:null,content:null,contentInner:null,contentBlock:null,url:null,target:null,startBtn:null,nextBtn:null,repeatBtn:null,deferBtn:null,help:null,completedBtn:null,completedBlock:null,finishedBlock:null,supportLink:null};t.sections=["settings","scenario","work"];t.loadYoutubeApiScript();t.subscribe("onYouTubeReady",function(){t.setVideoItems()});return t}babelHelpers.createClass(i,[{key:"loadYoutubeApiScript",value:function t(){var i=function(){this.emit("onYouTubeReady",{scenario:this})}.bind(this);if(!window.YT){var s=true;var n=document.createElement("script");n.src="https://www.youtube.com/iframe_api";var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(n,o);var r=setInterval(function(){if(s){if(window.YT&&e.Type.isFunction(window.YT.Player)){clearInterval(r);i()}}},200);setTimeout(function(){clearInterval(r);s=false},2e3)}else{setTimeout(function(){i()}.bind(this),100)}}},{key:"setOptions",value:function t(i){var s=this;this.fireCurrentStepEvent("onBeforeSetOptions",false);i=e.Type.isPlainObject(i)?i:{};var o=this.getCurrentStep();this.steps=[];if(Array.isArray(i.steps)){i.steps.forEach(function(t){s.steps.push(new n(t))})}if(o instanceof n){var r=this.findStepById(o.getId());if(r){o=r}}else if(e.Type.isString(i.currentStepId)&&i.currentStepId.length>0){var l=this.findStepById(i.currentStepId);if(l){o=l;if(i.currentStepIsActive===true){o.activate()}}}if(!o){var a=this.getFirstUncompletedStep();if(a){o=a}}if(!o&&this.steps&&this.steps[0]){o=this.steps[0]}this.setCurrentStep(o);if(i){this.isLoading=false}this.title=i.title||"";this.supportLink=i.supportLink||"";this.isFinished=i.isFinished||false;this.fireCurrentStepEvent("onAfterSetOptions",false)}},{key:"setCurrentStep",value:function t(i){if(i instanceof n){this.currentStep=i;var s=this.steps;if(e.Type.isArray(s)){this.currentStepIndex=s.indexOf(i)}this.fireCurrentStepEvent("onStartStep")}}},{key:"start",value:function t(e){this.emit("onStart",{scenario:this});if(e){this.complexAnimation=true}this.showPopup(this.getStepPopup());this.toggleCompletedState();this.toggleNavBtn();this.setPopupData();if(this.isAddedSteps){this.hideFinalState()}if(!this.hasArrows){this.initArrows()}this.complexAnimation=false;this.fireCurrentStepEvent("onShowComplete")}},{key:"findStepById",value:function t(e){for(var i=0;i<this.steps.length;i++){var s=this.steps[i];if(s.getId()===e){return s}}return null}},{key:"getStepPopup",value:function t(){var i=this;var s=function t(){i.emit("onClickOnCloseIcon",{scenario:i})};if(!this.stepPopup){this.stepPopup=e.Tag.render(v||(v=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup ui-tutor-popup-step">\n\t\t\t\t\t\t<div class="ui-tutor-popup-header">\n\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-icon"></span>\n\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-title">\n\t\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-counter">\n\t\t\t\t\t\t\t\t\t',".\n\t\t\t\t\t\t\t\t\t",'\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class="ui-tutor-popup-header-subtitle">',"</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t",'\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-content">\n\t\t\t\t\t\t\t','\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-step-wrap">\n\t\t\t\t\t\t\t<div class="ui-tutor-popup-step-inner">\n\t\t\t\t\t\t\t\t<div class="ui-tutor-popup-arrow-wrap"></div>\n\t\t\t\t\t\t\t\t<div class="ui-tutor-popup-step-list-wrap">\n\t\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-icon-close" onclick="','"></div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-icon-angle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t'])),e.Loc.getMessage("JS_UI_TUTOR_TITLE"),this.getCounterContainer(),this.title,this.getDeferLink(),this.getContentBlock(),this.getStepBlock(),s.bind(this));this.fireCurrentStepEvent("onCreateStepPopupNode");e.Dom.append(this.stepPopup,document.body);this.fireCurrentStepEvent("onAfterAppendStepPopupNode")}return this.stepPopup}},{key:"getContentBlock",value:function t(){if(!this.layout.contentBlock){this.layout.contentBlock=e.Tag.render(k||(k=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-content-block">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t</div>\n\t\t\t\t"])),this.getContentInner(),this.getFooter())}return this.layout.contentBlock}},{key:"getFooter",value:function t(){if(!this.layout.footer){this.layout.footer=e.Tag.render(y||(y=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-footer">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t</div>\n\t\t\t\t"])),this.getNavigation(),this.getBtnContainer());if(m.getInstance().feedbackFormId){e.Dom.append(this.getSupportLink(),this.layout.footer)}}return this.layout.footer}},{key:"getContentInner",value:function t(){if(!this.layout.contentInner){this.layout.contentInner=e.Tag.render(S||(S=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-content-inner">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t</div>\n\t\t\t\t"])),this.getTitle(),this.getDescription(),this.getHelpBlock())}return this.layout.contentInner}},{key:"getBtnContainer",value:function t(){if(!this.layout.btnContainer){this.layout.btnContainer=e.Tag.render(b||(b=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-btn">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t","\n\t\t\t\t\t\t","\n\t\t\t\t\t</div>\n\t\t\t\t"])),this.getStartBtn(),this.getRepeatBtn(),this.getCompletedBtn())}return this.layout.btnContainer}},{key:"getNavigation",value:function t(){if(!this.layout.navigation){this.layout.navigation=e.Tag.render(B||(B=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-nav"></div>\n\t\t\t\t'])));this.layout.backBtn=e.Tag.render(C||(C=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="ui-tutor-popup-nav-item ui-tutor-popup-nav-item-prev" onclick="','"></span>\n\t\t\t\t'])),this.clickOnBackBtn.bind(this));this.layout.nextBtn=e.Tag.render(T||(T=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="ui-tutor-popup-nav-item ui-tutor-popup-nav-item-next" onclick="','"></span>\n\t\t\t\t'])),this.clickOnNextBtn.bind(this));e.Dom.append(this.layout.backBtn,this.layout.navigation);e.Dom.append(this.layout.nextBtn,this.layout.navigation)}return this.layout.navigation}},{key:"setInformer",value:function t(e){this.setInformerCount(this.steps.length-this.getCompletedSteps())}},{key:"setInformerExternal",value:function t(e){this.setInformerCount(e)}},{key:"setInformerCount",value:function t(e){m.setCount(e)}},{key:"closeStepPopup",value:function t(e,i){if(!this.stepPopup){return}if(e){e.stopPropagation()}this.fireCurrentStepEvent("onCloseStepPopup");if(i){this.complexAnimation=true}this.fadeAnimation(this.getStepPopup());setTimeout(function(){this.hideNode(this.getStepPopup())}.bind(this),310);this.complexAnimation=false}},{key:"getCompletedSteps",value:function t(){var e=0;for(var i=0;i<this.steps.length;i+=1){if(this.steps[i].isCompleted){e+=1}}return e}},{key:"setStepCounter",value:function t(){this.getCounter().textContent=e.Loc.getMessage("JS_UI_TUTOR_COUNTER_NUMBER").replace("#NUMBER#",this.steps.indexOf(this.getCurrentStep())+1).replace("#NUMBER_TOTAL#",this.steps.length)}},{key:"getCounterContainer",value:function t(){if(!this.layout.counterContainer){this.layout.counterContainer=e.Tag.render(w||(w=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="ui-tutor-popup-header-counter-step">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</span>\n\t\t\t\t"])),this.getCounter())}return this.layout.counterContainer}},{key:"getCounter",value:function t(){if(!this.layout.counter){this.layout.counter=e.Tag.render(L||(L=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="ui-tutor-popup-header-counter-number"></span>\n\t\t\t\t'])))}return this.layout.counter}},{key:"getDeferLink",value:function t(){if(!this.layout.deferLink){this.layout.deferLink=e.Tag.render(I||(I=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="ui-tutor-popup-defer-link">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</span>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_BTN_DEFER"));var i=new BX.PopupMenuWindow({angle:true,offsetLeft:15,className:"ui-tutor-popup-defer-menu",bindElement:this.layout.deferLink,items:[{text:e.Loc.getMessage("JS_UI_TUTOR_DEFER_MENU_HOUR"),onclick:function(){this.emit("onDeferOneHour",{scenario:this});i.close()}.bind(this)},{text:e.Loc.getMessage("JS_UI_TUTOR_DEFER_MENU_TOMORROW"),onclick:function(){this.emit("onDeferTomorrow",{scenario:this});i.close()}.bind(this)},{text:e.Loc.getMessage("JS_UI_TUTOR_DEFER_MENU_WEEK"),onclick:function(){this.emit("onDeferWeek",{scenario:this});i.close()}.bind(this)},{text:e.Loc.getMessage("JS_UI_TUTOR_DEFER_MENU_FOREVER"),onclick:function(){this.emit("onDeferForever",{scenario:this});i.close()}.bind(this)}]});e.Event.bind(this.layout.deferLink,"click",function(){i.show()})}return this.layout.deferLink}},{key:"getStartBtn",value:function t(){if(!this.layout.startBtn){this.layout.startBtn=e.Tag.render(D||(D=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<button class="ui-btn ui-btn-primary ui-btn-round" onclick="','">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</button>\n\t\t\t\t"])),this.clickStartHandler.bind(this),e.Loc.getMessage("JS_UI_TUTOR_BTN_START"))}return this.layout.startBtn}},{key:"getCompletedBtn",value:function t(){if(!this.layout.completedBtn){this.layout.completedBtn=e.Tag.render(P||(P=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<button class="ui-btn ui-btn-success ui-btn-round" onclick="','">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</button>\n\t\t\t\t"])),this.showSuccessState.bind(this),e.Loc.getMessage("JS_UI_TUTOR_BTN_COMPLETED"))}return this.layout.completedBtn}},{key:"getRepeatBtn",value:function t(){if(!this.layout.repeatBtn){this.layout.repeatBtn=e.Tag.render(E||(E=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<button class="ui-btn ui-btn-primary ui-btn-round" onclick="','">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</button>\n\t\t\t\t"])),this.repeatStep.bind(this),e.Loc.getMessage("JS_UI_TUTOR_BTN_REPEAT"))}return this.layout.repeatBtn}},{key:"getDeferBtn",value:function t(){if(!this.layout.deferBtn){this.layout.deferBtn=e.Tag.render(N||(N=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<button class="ui-btn ui-btn-link ui-btn-round" onclick="','">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</button>\n\t\t\t\t"])),this.closeStepPopup.bind(this),e.Loc.getMessage("JS_UI_TUTOR_BTN_DEFER"))}return this.layout.deferBtn}},{key:"getCompletedBLock",value:function t(){if(!this.layout.completedBlock){this.layout.completedBlock=e.Tag.render(_||(_=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-completed">\n\t\t\t\t\t\t<div class="ui-tutor-popup-completed-icon"></div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-completed-text">',"</div>\n\t\t\t\t\t</div>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_STEP_COMPLETED"))}return this.layout.completedBlock}},{key:"getTitle",value:function t(){if(!this.layout.title){this.layout.title=e.Tag.render(A||(A=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-step-title"></div>\n\t\t\t\t'])))}return this.layout.title}},{key:"getDescription",value:function t(){if(!this.layout.description){this.layout.description=e.Tag.render(H||(H=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-step-decs"></div>\n\t\t\t\t'])))}return this.layout.description}},{key:"getSupportLink",value:function t(){if(!this.layout.supportLink){this.layout.supportLink=e.Tag.render(x||(x=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<a class="ui-tutor-popup-support-link" onclick="','">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</a>\n\t\t\t\t"])),this.supportLinkHandler.bind(this),e.Loc.getMessage("JS_UI_TUTOR_BTN_SUPPORT"))}return this.layout.supportLink}},{key:"setInvisible",value:function t(){this.hideNode(this.getStepPopup())}},{key:"setVisible",value:function t(){this.showNode(this.getStepPopup())}},{key:"supportLinkHandler",value:function t(){this.emit("supportLinkClick");m.getInstance().showFeedbackForm()}},{key:"getStepBlock",value:function t(){if(!this.layout.stepBlock){this.layout.stepBlock=e.Tag.render(O||(O=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-step-list"></div>\n\t\t\t\t'])));this.layout.stepItems=[];for(var i=0;i<this.steps.length;i+=1){var s=e.Tag.render(U||(U=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t\t<span class="ui-tutor-popup-step-item" data-step=',' onclick="','">\n\t\t\t\t\t\t\t<span class="ui-tutor-popup-step-item-number">',"</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t"])),i,this.switchStep.bind(this),i+1);this.layout.stepItems.push(s);e.Dom.append(s,this.layout.stepBlock)}this.setStepItems()}return this.layout.stepBlock}},{key:"setStepItems",value:function t(){if(this.layout&&this.layout.stepItems){for(var i=0;i<this.steps.length;i+=1){if(this.layout.stepItems[i]){e.Dom.removeClass(this.layout.stepItems[i],"ui-tutor-popup-step-item-current");if(i===this.currentStepIndex){e.Dom.addClass(this.layout.stepItems[i],"ui-tutor-popup-step-item-current")}if(this.steps[i].isCompleted){e.Dom.addClass(this.layout.stepItems[i],"ui-tutor-popup-step-item-completed")}}}}}},{key:"getHelpBlock",value:function t(){if(!this.layout.help){this.layout.help=e.Tag.render(R||(R=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-help">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</div>\n\t\t\t\t"])),this.getHelpLink())}return this.layout.help}},{key:"setVideoItems",value:function t(){for(var i=0;i<this.steps.length;i+=1){var s=e.Tag.render(F||(F=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-video" data-step=',"></div>\n\t\t\t\t"])),i);e.Dom.prepend(s,this.getHelpBlock());if(window.YT&&e.Type.isObject(window.YT)&&e.Type.isFunction(window.YT.Player)&&this.steps[i].video!==null){var n={videoId:this.steps[i].video,events:{onReady:function(t){t.target.mute();t.target.pauseVideo();t.target.setPlaybackQuality("hd720");if(+t.target.getIframe().getAttribute("data-step")===this.currentStepIndex){e.Dom.addClass(t.target.getIframe(),"ui-tutor-popup-video-show");t.target.playVideo()}}.bind(this)},playerVars:{cc_load_policy:1,cc_lang_pref:"ru",rel:0}};this.fireCurrentStepEvent("onBeforeCreateVideo",true,{playerData:n});this.steps[i].videoObj=new YT.Player(s,n);this.fireCurrentStepEvent("onAfterCreateVideo")}}}},{key:"pauseCurrentVideo",value:function t(){var i=this.getCurrentStep();if(window.YT&&i instanceof n){var s=i.getVideoObj();if(e.Type.isObject(s)&&s.pauseVideo){s.pauseVideo()}}}},{key:"playCurrentVideo",value:function t(){var i=this.getCurrentStep();if(window.YT&&i instanceof n){var s=i.getVideoObj();if(e.Type.isObject(s)&&s.playVideo){s.playVideo()}}}},{key:"getHelpLink",value:function t(){if(!this.layout.link){this.layout.link=e.Tag.render(M||(M=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<span class="ui-tutor-popup-help-link" onclick="','">\n\t\t\t\t\t\t<span class="ui-tutor-popup-help-link-text">',"</span>\n\t\t\t\t\t</span>\n\t\t\t\t"])),this.handleClickLinkHandler.bind(this),e.Loc.getMessage("JS_UI_TUTOR_ARTICLE_HELP_TOPIC"))}return this.layout.link}},{key:"handleClickLinkHandler",value:function t(){this.emit("helpLinkClick")}},{key:"showPopup",value:function t(e){this.showAnimation(e);e.style.display="block"}},{key:"showNode",value:function t(e){e.style.display="block"}},{key:"hideNode",value:function t(e){e.style.display="none"}},{key:"removePopup",value:function t(i){e.Dom.remove(i)}},{key:"clickOnNextBtn",value:function t(){this.fireCurrentStepEvent("onBeforeClickNavNextBtn");if(this.getCompletedSteps()===this.steps.length&&!this.isFinished){this.isAddedSteps=false;e.Dom.remove(this.getNewStepsSection());e.Dom.removeClass(this.getFinishedBlock(),"ui-tutor-popup-finished-new");this.showFinalState();return}if(this.getCompletedSteps()===this.steps.length&&this.currentStepIndex+1===this.steps.length){this.currentStepIndex=-1}e.Dom.removeClass(this.getStartBtn(),"ui-btn-wait");this.increaseCurrentIndex();this.showStep();this.toggleNavBtn();this.fireCurrentStepEvent("onAfterClickNavNextBtn")}},{key:"clickOnBackBtn",value:function t(){this.fireCurrentStepEvent("onBeforeClickNavBackBtn");this.reduceCurrentIndex();this.toggleNavBtn();this.showStep();this.fireCurrentStepEvent("onAfterClickNavBackBtn")}},{key:"toggleNavBtn",value:function t(){e.Dom.removeClass(this.layout.backBtn,"ui-tutor-popup-nav-item-disabled");e.Dom.removeClass(this.layout.nextBtn,"ui-tutor-popup-nav-item-disabled");if(this.currentStepIndex===0){e.Dom.addClass(this.layout.backBtn,"ui-tutor-popup-nav-item-disabled")}if(this.currentStepIndex+1===this.steps.length){e.Dom.addClass(this.layout.nextBtn,"ui-tutor-popup-nav-item-disabled")}}},{key:"showStep",value:function t(){if(this.clickOnCompletedBtn&&this.currentStepIndex===this.steps.length){var e=this.getFirstUncompletedStep();if(e){this.setCurrentStep(e)}}this.scrollToStep();this.toggleCompletedState();this.setPopupData();this.clickOnCompletedBtn=false;this.fireCurrentStepEvent("onAfterShowStep")}},{key:"switchStep",value:function t(){this.fireCurrentStepEvent("onBeforeSwitchStep");this.setCurrentStep(this.steps[+window.event.target.getAttribute("data-step")]);this.fireCurrentStepEvent("onAfterSwitchStep");if(this.layout.finishedBlock){this.hideFinalState()}this.showStep();this.toggleNavBtn();this.fireCurrentStepEvent("onEndSwitchStep")}},{key:"getFirstUncompletedStep",value:function t(){for(var e=0;e<this.steps.length;e+=1){if(!this.steps[e].isCompleted){return this.steps[e]}}return null}},{key:"toggleCompletedState",value:function t(){var e=this.getCurrentStep();if(e){if(e.getCompleted()){this.showNode(this.getRepeatBtn());this.hideNode(this.getStartBtn());this.hideNode(this.getCompletedBtn())}else if(e.isActive){this.showNode(this.getCompletedBtn());this.hideNode(this.getStartBtn());this.showNode(this.getRepeatBtn())}else{this.showNode(this.getStartBtn());this.hideNode(this.getCompletedBtn());this.hideNode(this.getRepeatBtn())}}}},{key:"setPopupData",value:function t(){this.fireCurrentStepEvent("onBeforeSetPopupData");var e=this.getCurrentStep();if(e){this.getTitle().innerHTML=e.getTitle();this.getDescription().innerHTML=e.getDescription();m.getCollapseTitle().innerHTML=e.getTitle();if(this.getCurrentStep().getVideo()&&window.YT){this.setCurrentVideo()}this.setStepCounter();this.setStepItems()}this.fireCurrentStepEvent("onAfterSetPopupData")}},{key:"setCurrentVideo",value:function t(){this.fireCurrentStepEvent("onSetCurrentVideo");for(var i=0;i<this.steps.length;i+=1){var s=this.steps[i].getVideoObj();if(window.YT&&i===this.currentStepIndex&&s&&s.playVideo){e.Dom.addClass(s.getIframe(),"ui-tutor-popup-video-show");s.playVideo()}else{if(s){e.Dom.removeClass(s.getIframe(),"ui-tutor-popup-video-show");if(s.pauseVideo){s.pauseVideo()}}}}}},{key:"getCurrentStep",value:function t(){return this.currentStep}},{key:"increaseCurrentIndex",value:function t(){if(this.currentStepIndex===this.steps.length){return}this.currentStepIndex+=1;this.setCurrentStep(this.steps[this.currentStepIndex])}},{key:"reduceCurrentIndex",value:function t(){if(this.currentStepIndex===0){return}this.currentStepIndex-=1;this.setCurrentStep(this.steps[this.currentStepIndex])}},{key:"showCollapseBlock",value:function t(e,i){i=i!==false;this.closeStepPopup(null,true);m.showCollapsedBlock(e,i)}},{key:"minimize",value:function t(){this.pauseCurrentVideo();this.fireCurrentStepEvent("onMinimize");this.showCollapseBlock(this.getCurrentStep(),false)}},{key:"repeatStep",value:function t(){this.followLink()}},{key:"clickStartHandler",value:function t(){this.followLink()}},{key:"followLink",value:function t(e){var i=this.getCurrentStep();if(e instanceof n){i=e}this.pauseCurrentVideo();this.setActiveStep(i);m.checkFollowLink(i,this)}},{key:"setActiveStep",value:function t(e){this.fireCurrentStepEvent("onBeforeSetActiveStep");if(this.currentActiveStep instanceof n){this.currentActiveStep.deactivate()}e.activate();this.currentActiveStep=e;this.fireCurrentStepEvent("onAfterSetActiveStep")}},{key:"showSuccessState",value:function t(){var i=this.getCurrentStep();this.clickOnCompletedBtn=true;i.isCompleted=true;this.fireCurrentStepEvent("onFinishStep");if(i.getCompleted()){e.Dom.addClass(this.layout.stepItems[this.currentStepIndex],"ui-tutor-popup-step-item-completed")}e.Dom.addClass(this.getContentBlock(),"ui-tutor-popup-content-block-animate");setTimeout(function(){e.Dom.replace(this.getHelpBlock(),this.getCompletedBLock());this.getFooter().style.display="none";this.getDescription().style.display="none";this.getTitle().style.display="none"}.bind(this),300);setTimeout(function(){e.Dom.addClass(this.getCompletedBLock(),"ui-tutor-popup-completed-animate")}.bind(this),800);setTimeout(function(){e.Dom.replace(this.getCompletedBLock(),this.getHelpBlock());this.getTitle().style.display="block";this.getDescription().style.display="block";this.getFooter().style.display="flex";this.clickOnNextBtn()}.bind(this),1500);setTimeout(function(){e.Dom.removeClass(this.getCompletedBLock(),"ui-tutor-popup-completed-animate");e.Dom.removeClass(this.getContentBlock(),"ui-tutor-popup-content-block-animate");var t=this.stepPopup.querySelector(".ui-tutor-popup-header-counter-number");t.innerHTML=e.Loc.getMessage("JS_UI_TUTOR_COUNTER_NUMBER").replace("#NUMBER#",this.steps.indexOf(this.getCurrentStep())+1).replace("#NUMBER_TOTAL#",this.steps.length);this.fireCurrentStepEvent("onAfterShowSuccessState")}.bind(this),1700)}},{key:"fireCurrentStepEvent",value:function t(e,i,s){i=i!==false;var n=this.getCurrentStep();var o={step:n,scenario:this};if(s){o.extra=s}if(n&&i){n.emit(e,o)}this.emit(e,o)}},{key:"showFinalState",value:function t(){this.fireCurrentStepEvent("onFinalState");if(this.layout.stepItems){e.Dom.removeClass(this.layout.stepItems[this.currentStepIndex],"ui-tutor-popup-step-item-current")}e.Dom.append(this.getFinishedBlock(),this.getContentInner());e.Dom.replace(this.getStartBtn(),this.getFinishedNotice());e.Dom.remove(this.getCompletedBtn());e.Dom.remove(this.getSupportLink());e.Dom.remove(this.getNavigation());e.Dom.remove(this.getHelpBlock());e.Dom.remove(this.getRepeatBtn());e.Dom.remove(this.getTitle());e.Dom.remove(this.getDescription());e.Dom.remove(this.getDeferLink());this.isFinished=true;this.fireCurrentStepEvent("onAfterFinalState")}},{key:"hideFinalState",value:function t(){this.fireCurrentStepEvent("onBeforeHideFinalState");if(this.getCurrentStep().getCompleted()){e.Dom.replace(this.getFinishedNotice(),this.getRepeatBtn())}else{e.Dom.replace(this.getFinishedNotice(),this.getStartBtn())}e.Dom.replace(this.getFinishedBlock(),this.getHelpBlock());if(m.getInstance().feedbackFormId){e.Dom.append(this.getSupportLink(),this.getFooter())}e.Dom.prepend(this.getNavigation(),this.getFooter());e.Dom.prepend(this.getDescription(),this.getContentInner());e.Dom.prepend(this.getTitle(),this.getContentInner());if(this.layout.deferBtn){e.Dom.remove(this.getDeferBtn());e.Dom.prepend(this.getStartBtn(),this.getBtnContainer())}var i=this.getStepPopup().querySelector(".ui-tutor-popup-header");e.Dom.append(this.getDeferLink(),i);this.fireCurrentStepEvent("onAfterHideFinalState")}},{key:"getFinishedBlock",value:function t(){if(!this.layout.finishedBlock){this.layout.finishedBlock=e.Tag.render(W||(W=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-finished">\n\t\t\t\t\t\t<div class="ui-tutor-popup-finished-title">','</div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-finished-icon"></div>\n\t\t\t\t\t\t<div class="ui-tutor-popup-finished-text">',"</div>\n\t\t\t\t\t</div>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_FINAL_CONGRATULATIONS"),e.Loc.getMessage("JS_UI_TUTOR_FINAL_TEXT"))}return this.layout.finishedBlock}},{key:"getFinishedNotice",value:function t(){if(!this.layout.finishedNotice){this.layout.finishedNotice=e.Tag.render(V||(V=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-finished-notice">',"</div>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_FINAL_NOTICE"))}return this.layout.finishedNotice}},{key:"getNewStepsSection",value:function t(){if(!this.layout.newStepsSection){this.layout.newStepsSection=e.Tag.render(G||(G=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-new-text">',"</div>\n\t\t\t\t"])),e.Loc.getMessage("JS_UI_TUTOR_STEP_NEW"))}return this.layout.newStepsSection}},{key:"showNewSteps",value:function t(){e.Dom.addClass(this.getFinishedBlock(),"ui-tutor-popup-finished-new");this.showPopup(this.getStepPopup());this.showFinalState();e.Dom.append(this.getNewStepsSection(),this.getFinishedBlock());e.Dom.replace(this.getFinishedNotice(),m.getBeginBtn());e.Dom.append(this.getDeferBtn(),this.getBtnContainer());this.setStepCounter();this.initArrows();this.scrollToStep();this.isAddedSteps=true;this.isFinished=false}},{key:"initArrows",value:function t(){this.stepListWrap=document.querySelector(".ui-tutor-popup-step-list-wrap");this.arrowWrap=document.querySelector(".ui-tutor-popup-arrow-wrap");if(this.stepListWrap&&this.stepListWrap.scrollWidth>this.stepListWrap.offsetWidth){e.Dom.append(this.getPrevArrow(),this.arrowWrap);e.Dom.append(this.getNextArrow(),this.arrowWrap);this.stepListWrap.addEventListener("scroll",this.toggleArrows.bind(this));this.prevArrow.addEventListener("mouseenter",this.scrollToLeft.bind(this));this.prevArrow.addEventListener("mouseleave",this.stopAutoScroll.bind(this));this.nextArrow.addEventListener("mouseenter",this.scrollToRight.bind(this));this.nextArrow.addEventListener("mouseleave",this.stopAutoScroll.bind(this));this.toggleNextArrow();this.getStepBlock().classList.add("ui-tutor-popup-step-list-wide");this.hasArrows=true}}},{key:"getPrevArrow",value:function t(){if(!this.prevArrow){this.prevArrow=e.Tag.render(J||(J=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-arrow ui-tutor-popup-arrow-prev"></div>\n\t\t\t\t'])))}return this.prevArrow}},{key:"getNextArrow",value:function t(){if(!this.nextArrow){this.nextArrow=e.Tag.render(X||(X=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t<div class="ui-tutor-popup-arrow ui-tutor-popup-arrow-next"></div>\n\t\t\t\t'])))}return this.nextArrow}},{key:"scrollToLeft",value:function t(){this.arrowTimer=setInterval(function(){this.stepListWrap.scrollLeft-=5}.bind(this),20)}},{key:"scrollToRight",value:function t(){this.arrowTimer=setInterval(function(){this.stepListWrap.scrollLeft+=5}.bind(this),20)}},{key:"stopAutoScroll",value:function t(){clearInterval(this.arrowTimer)}},{key:"toggleArrows",value:function t(){this.togglePrevArrow();this.toggleNextArrow()}},{key:"toggleNextArrow",value:function t(){if(this.stepListWrap.scrollWidth>this.stepListWrap.offsetWidth&&this.stepListWrap.offsetWidth+this.stepListWrap.scrollLeft<this.stepListWrap.scrollWidth){e.Dom.addClass(this.nextArrow,"ui-tutor-popup-arrow-show")}else{e.Dom.removeClass(this.nextArrow,"ui-tutor-popup-arrow-show")}}},{key:"togglePrevArrow",value:function t(){if(this.stepListWrap.scrollLeft>0){e.Dom.addClass(this.prevArrow,"ui-tutor-popup-arrow-show")}else{e.Dom.removeClass(this.prevArrow,"ui-tutor-popup-arrow-show")}}},{key:"showAnimation",value:function t(i){e.Dom.removeClass(i,"ui-tutor-popup-hide-complex");e.Dom.removeClass(i,"ui-tutor-popup-hide");if(this.complexAnimation){e.Dom.addClass(i,"ui-tutor-popup-show-complex")}else{e.Dom.addClass(i,"ui-tutor-popup-show")}}},{key:"fadeAnimation",value:function t(i){e.Dom.removeClass(i,"ui-tutor-popup-show-complex");e.Dom.removeClass(i,"ui-tutor-popup-show");if(this.complexAnimation){e.Dom.addClass(i,"ui-tutor-popup-hide-complex")}else{e.Dom.addClass(i,"ui-tutor-popup-hide")}}},{key:"scrollToStep",value:function t(){var i=null;var s=null;if(this.stepListWrap){i=e.Dom.getPosition(this.stepListWrap);s=e.Dom.getPosition(this.stepListWrap.querySelector('[data-step="'+this.currentStepIndex+'"]'))}var n=7;if(!e.Type.isNull(s)&&s.left+s.width>i.left+i.width){this.stepListWrap.scrollLeft+=s.left-(i.left+i.width)+s.width+n}if(!e.Type.isNull(s)&&s.left<i.left){this.stepListWrap.scrollLeft-=i.left-s.left+n}}}],[{key:"getFullEventName",value:function t(e){return e}},{key:"getInstance",value:function t(){return m.getScenarioInstance()}},{key:"init",value:function t(e){return m.initScenario(e)}}]);return i}(e.Event.EventEmitter);t.Scenario=Y;t.Manager=m;t.Step=n})(this.BX.UI.Tutor=this.BX.UI.Tutor||{},BX,BX.UI.Tour,BX);
//# sourceMappingURL=tutor.bundle.map.js