text: window["%hammerhead%"].utils.removeInjectedScript(),function Re(We){var Oe=We.document;!function(s,o,t){var e="default"in s?s.default:s,i="default"in o?o.default:o;t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var r={uiRoot:null,element:function(){return this.uiRoot||(this.uiRoot=Oe.createElement("div"),s.shadowUI.getRoot().appendChild(this.uiRoot)),this.uiRoot},hide:function(){this.uiRoot&&(this.uiRoot.style.visibility="hidden")},show:function(){this.uiRoot&&(this.uiRoot.style.visibility="")},remove:function(){var t=s.shadowUI.getRoot();s.nativeMethods.nodeParentNodeGetter.call(t).removeChild(t)}},c=e.shadowUI,u=e.utils.browser,a=e.utils.featureDetection,d=e.nativeMethods,h=e.eventSandbox.eventSimulator,l=e.eventSandbox.listeners,p=i.positionUtils,m=i.domUtils,g=i.styleUtils,f=i.eventUtils,v=i.arrayUtils,y="tcOptionList",E="tcOptionGroup",C="tcOption",_="disabled",w=u.isIE?30:20,S=null,x=null,I=[],b=[];function T(t){var e=d.eventTargetGetter.call(t);(e||t.srcElement)===S||m.containsElement(S,e)||m.containsElement(x,e)||M()}function B(t,e,i){var n,s=d.eventTargetGetter.call(t),o=v.indexOf(b,s);o<0||(i(),(n=-1<s.className.indexOf(_))&&u.isWebKit||function(t,e){var i=S.selectedIndex,n=S.getElementsByTagName("option")[t],s=!e&&t!==i;s&&!u.isIE&&(S.selectedIndex=t),u.isFirefox||u.isIE||!s||(h.input(S),h.change(S)),(u.isFirefox||u.isIE)&&h.mousedown(u.isFirefox?n:S),a.isTouchDevice||h.mouseup(u.isFirefox?n:S),(u.isFirefox||u.isIE)&&s&&(u.isIE&&(S.selectedIndex=t),u.isIE||h.input(S),h.change(S)),a.isTouchDevice||h.click(u.isFirefox||u.isIE?n:S),e||M()}(o,n))}function U(t,e){for(var i,n,s,o,a,r,l,u=m.getChildrenLength(t),h=0;h<u;h++)m.isOptionElement(t[h])?(o=t[h],a=e,l=r=void 0,r=Oe.createElement("div"),l=o.disabled||"optgroup"===m.getTagName(o.parentElement)&&o.parentElement.disabled,d.nodeTextContentSetter.call(r,o.text),a.appendChild(r),c.addClass(r,C),l&&(c.addClass(r,_),g.set(r,"color",g.get(o,"color"))),b.push(r)):"optgroup"===m.getTagName(t[h])&&(i=t[h],n=e,s=void 0,s=Oe.createElement("div"),d.nodeTextContentSetter.call(s,i.label||" "),n.appendChild(s),c.addClass(s,E),s.disabled&&(c.addClass(s,_),g.set(s,"color",g.get(i,"color"))),U(i.children,s),I.push(s))}function M(){m.remove(x),f.unbind(Oe,"mousedown",T),S=x=null,b=[],I=[]}function A(t){return t?t===S:!!S}var n=Object.freeze({__proto__:null,expandOptionList:function(t){var e=t.children;if(e.length&&!t.disabled){if(S){var i=t===S;if(M(),i)return}S=t,x=Oe.createElement("div"),r.element().appendChild(x),c.addClass(x,y),U(e,x),l.addInternalEventBeforeListener(We,["click"],B),d.setTimeout.call(We,function(){f.bind(Oe,"mousedown",T)},0),g.set(x,{position:"absolute",fontSize:g.get(S,"fontSize"),fontFamily:g.get(S,"fontFamily"),minWidth:g.getWidth(S)+"px",left:p.getOffsetPosition(S).left+"px",height:m.getSelectVisibleChildren(t).length>w?g.getOptionHeight(t)*w:""});var n,s=p.getOffsetPosition(S).top,o=g.getHeight(x),a=s+g.getHeight(S)+2;a+o>g.getScrollTop(We)+g.getHeight(We)&&(n=s-3-o)>=g.getScrollTop(We)&&(a=n),g.set(x,"top",a+"px")}},collapseOptionList:M,isOptionListExpanded:A,getEmulatedChildElement:function(t){var e="optgroup"===m.getTagName(t),i=m.getElementIndexInParent(S,t);return e?I[i]:b[i]},scrollOptionListByChild:function(t){var e,i,n,s,o,a,r=m.getSelectParent(t);r&&(e=g.getSelectElementSize(r),i=g.getOptionHeight(r),n=0,o=(s=Math.max(g.getScrollTop(r)/i,0))+e-1,(a=m.getChildVisibleIndex(r,t))<s?(n=i*(s-a),g.setScrollTop(r,Math.max(g.getScrollTop(r)-n,0))):o<a&&(n=i*(a-o),g.setScrollTop(r,g.getScrollTop(r)+n)))},getSelectChildCenter:function(t){var e=m.getSelectParent(t);if(!e)return{x:0,y:0};var i=g.getOptionHeight(e),n=p.getElementRectangle(t);return{x:Math.round(n.left+n.width/2),y:Math.round(n.top+i/2)}},switchOptionsByKeys:function(t,e){var i=g.getSelectElementSize(t),n=!g.hasDimensions(c.select("."+y)[0]);if(/down|up/.test(e)||!u.isIE&&(i<=1||u.isFirefox)&&(n||u.isFirefox)&&/left|right/.test(e)){for(var s=t.querySelectorAll("option"),o=[],a=0;a<s.length;a++){var r=s[a].parentElement;s[a].disabled||"optgroup"===m.getTagName(r)&&r.disabled||o.push(s[a])}var l=v.indexOf(o,s[t.selectedIndex])+(/down|right/.test(e)?1:-1);0<=l&&l<o.length&&(t.selectedIndex=v.indexOf(s,o[l]),u.isIE||h.input(t),h.change(t))}},isOptionElementVisible:function(t){var e=m.getSelectParent(t);if(!e)return!0;var i=A(e),n=g.getSelectElementSize(e);return i||1<n}}),V="Loading page...",D="modal-background",P="loading-text",k="loading-icon",R=null,W=null,O=null,N=!1;function F(){function t(){var t=o.styleUtils.getHeight(We),e=o.styleUtils.getWidth(We);o.styleUtils.set(R,"width",e+"px"),o.styleUtils.set(R,"height",t+"px"),o.styleUtils.set(O,{left:Math.round((e-o.styleUtils.getWidth(O))/2)+"px",top:Math.round((t-o.styleUtils.getHeight(O))/2)+"px"})}t(),o.eventUtils.bind(We,"resize",t)}function L(){var t,e,i,n;t=r.element(),R=Oe.createElement("div"),t.appendChild(R),s.shadowUI.addClass(R,D),W=Oe.createElement("div"),s.nativeMethods.nodeTextContentSetter.call(W,V),t.appendChild(W),s.shadowUI.addClass(W,P),O=Oe.createElement("div"),o.styleUtils.set(O,"visibility","hidden"),t.appendChild(O),s.shadowUI.addClass(O,k),F(),e=o.styleUtils.getHeight(We),i=o.styleUtils.getWidth(We),(n=!o.styleUtils.hasDimensions(W))&&(o.styleUtils.set(W,"visibility","hidden"),o.styleUtils.set(W,"display","block")),o.styleUtils.set(W,{left:Math.max((i-o.styleUtils.getWidth(W))/2,0)+"px",top:Math.max((e-o.styleUtils.getHeight(W))/2,0)+"px"}),n&&(o.styleUtils.set(W,"display","none"),o.styleUtils.set(W,"visibility","")),N=!0}var H=Object.freeze({__proto__:null,initAndShowLoadingText:function(){function t(){L(),o.styleUtils.set(R,"opacity",.8),o.styleUtils.set(R,"display","block"),o.styleUtils.set(W,"display","block"),e=!0}var e=!1,i=function(){e||(Oe.body?t():s.nativeMethods.setTimeout.call(We,i,0))};i(),o.eventUtils.documentReady().then(function(){e||t()})},show:function(t){N||L(),o.styleUtils.set(R,"opacity",t?0:.7),o.styleUtils.set(R,"display","block")},hide:function(){N&&(o.styleUtils.set(W,"display","none"),o.styleUtils.set(R,"display","none"))},showLoadingIcon:function(){o.styleUtils.set(O,"visibility","visible")},hideLoadingIcon:function(){o.styleUtils.set(O,"visibility","hidden")}}),q=e.shadowUI,z=i.styleUtils,G="success",j=(K.prototype.setValue=function(t){t="number"!=typeof t?0:Math.min(Math.max(t,0),100),z.set(this.valueElement,"width",t+"%")},K.prototype.setSuccess=function(t){t?q.addClass(this.containerElement,G):q.removeClass(this.containerElement,G)},K);function K(t){this.containerElement=Oe.createElement("div"),this.valueElement=Oe.createElement("div"),t.appendChild(this.containerElement),this.containerElement.appendChild(this.valueElement),q.addClass(this.containerElement,"progress-bar"),q.addClass(this.valueElement,"value")}var Y=e.shadowUI,X=e.nativeMethods,J=i.eventUtils,Q=i.styleUtils,Z="progress-panel",$="title",tt="content",et=(it._getInvisibleElementProperty=function(t,e){var i="none"===Q.get(t,"display");i&&Q.set(t,"display","block");var n=t[e];return i&&Q.set(t,"display","none"),n},it._showAtWindowCenter=function(t){var e=it._getInvisibleElementProperty(t,"offsetHeight"),i=it._getInvisibleElementProperty(t,"offsetWidth"),n=Math.round(Q.getHeight(We)/2-e/2),s=Math.round(Q.getWidth(We)/2-i/2);Q.set(t,{left:s+"px",top:n+"px"})},it.prototype._setCurrentProgress=function(){var t=Math.round((X.dateNow()-this.startTime)/this.maxTimeout*100);this.progressBar.setValue(t)},it.prototype._setSuccess=function(t){this.progressBar.setSuccess(t)},it.prototype._stopAnimation=function(){X.clearInterval.call(We,this.animationInterval)},it.prototype._animate=function(t,e,i,n){var s,o,a,r=this,l=X.dateNow(),u=i?0:1;i&&(Q.set(t,"opacity",u),Q.set(t,"display","block")),this._stopAnimation(),this.animationInterval=X.setInterval.call(We,function(){s=X.dateNow()-l,o=Math.min(s/e,1),a=.5-Math.cos(o*Math.PI)/2,Q.set(t,"opacity",u+(i?a:-a)),1===o&&(r._stopAnimation(),n&&n())},10)},it.prototype._showPanel=function(){J.bind(We,"resize",this.disposePanel),this._animate(this.panelDiv,200,!0)},it.prototype._hidePanel=function(t){var e=this;this.startTime=null,J.unbind(We,"resize",this.disposePanel),this._animate(this.panelDiv,t?0:600,!1,function(){return Q.set(e.panelDiv,"display","none")})},it.prototype.show=function(t,e){var i=this;this.startTime=X.dateNow(),this.maxTimeout=e,X.nodeTextContentSetter.call(this.titleDiv,t),this._setSuccess(!1),this.openingTimeout=X.setTimeout.call(We,function(){i.openingTimeout=null,i._setCurrentProgress(),i._showPanel(),i.updateInterval=X.setInterval.call(We,function(){return i._setCurrentProgress()},100)},300)},it.prototype.close=function(t){var e=this;t&&this._setSuccess(!0),this.openingTimeout&&(X.clearTimeout.call(We,this.openingTimeout),this.openingTimeout=null),this.updateInterval&&(X.clearInterval.call(We,this.updateInterval),this.updateInterval=null),t?this.startTime&&X.dateNow()-this.startTime<1e3?X.setTimeout.call(We,function(){X.setTimeout.call(We,function(){return e._hidePanel(!1)},200)},100):X.setTimeout.call(We,function(){return e._hidePanel(!1)},200):this._hidePanel(!0)},it);function it(){var t=this;this.startTime=null,this.openingTimeout=null,this.updateInterval=null,this.animationInterval=null,this.panelDiv=Oe.createElement("div"),r.element().appendChild(this.panelDiv),this.titleDiv=Oe.createElement("div"),this.panelDiv.appendChild(this.titleDiv),this.contentDiv=Oe.createElement("div"),this.panelDiv.appendChild(this.contentDiv),Y.addClass(this.panelDiv,Z),Y.addClass(this.titleDiv,$),Y.addClass(this.contentDiv,tt),it._showAtWindowCenter(this.panelDiv),this.progressBar=new j(this.contentDiv),this.disposePanel=function(){return it._showAtWindowCenter(t.panelDiv)}}var nt=function(t,e){return(nt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function st(t,e){function i(){this.constructor=t}nt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ot=e.shadowUI,at=e.nativeMethods,rt=i.styleUtils,lt="determinate",ut=(ht.prototype._setCurrentProgress=function(){var t=(at.dateNow()-this.startTime)/this.maxTimeout,e=Math.min(Math.max(t,0),1),i=rt.getWidth(this.progressBar),n=Math.round(i*e);rt.set(this.firstValueElement,"width",n+"px")},ht.prototype.start=function(t,e){var i=this;ot.addClass(this.progressBar,lt),this.maxTimeout=t,this.startTime=e||at.dateNow(),this._setCurrentProgress(),this.animationInterval=at.setInterval.call(We,function(){return i._setCurrentProgress()},10)},ht.prototype.stop=function(){this.animationInterval&&(at.clearInterval.call(We,this.animationInterval),this.animationInterval=null)},ht.prototype.reset=function(){rt.set(this.firstValueElement,"width",0),ot.removeClass(this.progressBar,lt)},ht);function ht(t,e){this.progressBar=t,this.firstValueElement=e,this.maxTimeout=null,this.startTime=null,this.animationInterval=null}function ct(t,e,i){if(e.x===t.x)return 0;var n=(e.y-t.y)/(e.x-t.x),s=t.x*(t.y-e.y)/(e.x-t.x)+t.y;return Math.round(n*i+s)}var dt=e.shadowUI,pt=e.nativeMethods,mt=i.styleUtils,gt={time:2800,points:[.815,.395],positionByCompletePercent:{0:{left:-35,right:100},.6:{left:100,right:-90},1:{left:100,right:-90}}},ft={time:3e3,points:[.84,1],positionByCompletePercent:{0:{left:-200,right:100},.6:{left:107,right:-8},1:{left:107,right:-8}}},vt=0,yt=.6,Et=1,Ct="indeterminate",_t=(wt._updateValueAnimation=function(t,e,i){var n,s,o,a,r,l,u,h,c,d,p=i.time,m=i.points,g=i.positionByCompletePercent,f=pt.dateNow()-t,v=(n=f/p,s=m[0],o=m[1],3*Math.pow(1-n,2)*n*s+3*(1-n)*n*n*o+n*n*n),y=(h=(l=(a=v)<yt)?yt:Et,c=(r=g)[u=l?vt:yt],d=r[h],{left:ct({x:u,y:c.left},{x:h,y:d.left},a),right:ct({x:u,y:c.right},{x:h,y:d.right},a)}),E=y.left,C=y.right;mt.set(e,"left",Math.round(E)+"%"),mt.set(e,"right",Math.round(C)+"%")},wt.prototype._clearFirstValueAnimation=function(){this.animationInterval&&(pt.clearInterval.call(We,this.animationInterval),this.animationInterval=null),mt.set(this.firstValue,"left","-35%"),mt.set(this.firstValue,"right","100%")},wt.prototype._clearSecondValueAnimation=function(){this.secondValueAnimationInterval&&(pt.clearInterval.call(We,this.secondValueAnimationInterval),this.secondValueAnimationInterval=null),mt.set(this.secondValue,"left","-200%"),mt.set(this.secondValue,"right","100%")},wt.prototype._startFirstValueAnimation=function(){var t=this;this._clearFirstValueAnimation();var e=pt.dateNow();this.animationInterval=pt.setInterval.call(We,function(){wt._updateValueAnimation(e,t.firstValue,gt)},10)},wt.prototype._startSecondValueAnimation=function(){var t=this;this._clearSecondValueAnimation();var e=pt.dateNow();this.secondValueAnimationInterval=pt.setInterval.call(We,function(){wt._updateValueAnimation(e,t.secondValue,ft)},10)},wt.prototype._startAnimation=function(){var t=this;this._startFirstValueAnimation(),this.secondValueAnimationTimeout=pt.setTimeout.call(We,function(){return t._startSecondValueAnimation()},1e3),this.restartAnimationTimeout=pt.setTimeout.call(We,function(){return t._startAnimation()},1950)},wt.prototype._stopAnimation=function(){this._clearFirstValueAnimation(),this._clearSecondValueAnimation(),this.secondValueAnimationTimeout&&(pt.clearInterval.call(We,this.secondValueAnimationTimeout),this.secondValueAnimationTimeout=null),this.restartAnimationTimeout&&(pt.clearInterval.call(We,this.restartAnimationTimeout),this.restartAnimationTimeout=null)},wt.prototype.start=function(){dt.addClass(this.progressBar,Ct),this._startAnimation()},wt.prototype.stop=function(){dt.removeClass(this.progressBar,Ct),this._stopAnimation()},wt);function wt(t,e,i){this.progressBar=t,this.firstValue=e,this.secondValue=i,this.animationInterval=null,this.secondValueAnimationInterval=null,this.secondValueAnimationTimeout=null,this.restartAnimationTimeout=null}var St=e.shadowUI,xt=i.styleUtils,It=(bt.prototype._create=function(t){this.progressBar=Oe.createElement("div"),St.addClass(this.progressBar,"progress-bar"),t.appendChild(this.progressBar);var e=Oe.createElement("div");St.addClass(e,"value-container"),this.progressBar.appendChild(e),this.firstValueElement=Oe.createElement("div"),St.addClass(this.firstValueElement,"value"),e.appendChild(this.firstValueElement),this.secondValueElement=Oe.createElement("div"),St.addClass(this.secondValueElement,"value"),e.appendChild(this.secondValueElement)},bt.prototype.show=function(){xt.set(this.progressBar,"visibility","visible")},bt.prototype.hide=function(){xt.set(this.progressBar,"visibility","hidden")},bt);function bt(t){this.progressBar=null,this.firstValueElement=null,this.secondValueElement=null,this._create(t),this.determinateIndicator=new ut(this.progressBar,this.firstValueElement),this.indeterminateIndicator=new _t(this.progressBar,this.firstValueElement,this.secondValueElement)}var Tt,Bt="start-waiting-element",Ut="end-waiting-element-request",Mt="end-waiting-element-response",At="start-waiting-assertion-retries",Vt="end-waiting-assertion-retries-request",Dt="end-waiting-assertion-retries-response",Pt="step",kt="resume",Rt=e.Promise,Wt=e.shadowUI,Ot=e.nativeMethods,Nt=e.eventSandbox.message,Ft=e.utils.browser,Lt=e.utils.featureDetection,Ht=e.eventSandbox.listeners,qt=i.styleUtils,zt=i.eventUtils,Gt=i.domUtils,jt=i.serviceUtils,Kt=i.arrayUtils,Yt="waiting-element-failed",Xt="waiting-element-success",Jt="%testCafeStatusPrefix%",Qt=(st(Zt,Tt=jt.EventEmitter),Zt.prototype._createButton=function(t,e){var i=Oe.createElement("div"),n=Oe.createElement("div"),s=Oe.createElement("span");return Ot.nodeTextContentSetter.call(s,t),Wt.addClass(i,"button"),Wt.addClass(i,e),Wt.addClass(n,"button-icon"),Ft.isSafari&&(s.style.position="relative",s.style.top="1px"),i.appendChild(n),i.appendChild(s),i},Zt.prototype._createIconArea=function(){this.icon=Oe.createElement("div"),Wt.addClass(this.icon,"icon"),this.statusBar.appendChild(this.icon)},Zt.prototype._createInformationArea=function(){this.infoContainer=Oe.createElement("div"),Wt.addClass(this.infoContainer,"info-container"),this.statusBar.appendChild(this.infoContainer);var t=Oe.createElement("div");Wt.addClass(t,"info-text-container"),this.infoContainer.appendChild(t);var e=Oe.createElement("div");Wt.addClass(e,"status-container"),t.appendChild(e),this.statusDiv=Oe.createElement("div"),this.statusDiv=Oe.createElement("div"),Ot.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText("Loading Web Page...")),Wt.addClass(this.statusDiv,"status"),Wt.addClass(this.statusDiv,"info"),e.appendChild(this.statusDiv);var i=Oe.createElement("div");Ot.nodeTextContentSetter.call(i,this.fixtureName+" - "+this.testName),Wt.addClass(i,"fixture"),Wt.addClass(i,"info"),e.appendChild(i);var n=Oe.createElement("div");Ot.nodeTextContentSetter.call(n,this.userAgent),Wt.addClass(n,"user-agent"),t.appendChild(n)},Zt.prototype._createActionsArea=function(){var t=this;this.actionsContainer=Oe.createElement("div"),Wt.addClass(this.actionsContainer,"actions-container"),this.statusBar.appendChild(this.actionsContainer),this.buttons=Oe.createElement("div"),Wt.addClass(this.buttons,"buttons"),this.actionsContainer.appendChild(this.buttons),this.unlockButton=this._createButton("Unlock Page","locked"),this.resumeButton=this._createButton("Resume","resume"),this.nextButton=this._createButton("Next Action","step"),this.finishButton=this._createButton("Finish","finish"),this.buttons.appendChild(this.unlockButton),this.buttons.appendChild(this.resumeButton),this.buttons.appendChild(this.nextButton),this.actionsContainer.style.display="none",this._bindClickOnce([this.unlockButton],function(){Wt.removeClass(t.unlockButton,"locked"),Wt.addClass(t.unlockButton,"unlocked"),Ot.nodeTextContentSetter.call(t.unlockButton.querySelector("span"),"Page unlocked"),t.state.locked=!1,t.emit(t.UNLOCK_PAGE_BTN_CLICK,{})}),this.unlockButton.style.display="none"},Zt.prototype._create=function(){this.statusBar=Oe.createElement("div"),Wt.addClass(this.statusBar,"status-bar"),this._createIconArea(),this._createInformationArea(),this._createActionsArea(),this.progressBar=new It(this.infoContainer),this.progressBar.indeterminateIndicator.start(),this.progressBar.show(),r.element().appendChild(this.statusBar),this._bindHandlers(),this.state.created=!0},Zt.prototype._createBeforeReady=function(){var t,e=this;this.state.created||(t=We).top!==t||(Oe.body?this._create():Ot.setTimeout.call(We,function(){return e._createBeforeReady()},0))},Zt.prototype._animate=function(t){var e,i,n,s=this,o=Ot.dateNow(),a=parseInt(qt.get(this.statusBar,"opacity"),10)||0;this._stopAnimation(),t&&(qt.set(this.statusBar,"visibility",""),this.state.hidden=!1),this.animationInterval=Ot.setInterval.call(We,function(){e=Ot.dateNow()-o,i=Math.min(e/500,1),n=.5-Math.cos(i*Math.PI)/2,qt.set(s.statusBar,"opacity",a+(t?n:-n)),1===i&&(s._stopAnimation(),t||(qt.set(s.statusBar,"visibility","hidden"),s.state.hidden=!0),s.state.showing=!1,s.state.hiding=!1)},10)},Zt.prototype._stopAnimation=function(){this.animationInterval&&(Ot.clearInterval.call(We,this.animationInterval),this.animationInterval=null)},Zt.prototype._fadeOut=function(){this.state.hiding||this.state.debugging||(this.state.showing=!1,this.state.hiding=!0,this._animate())},Zt.prototype._fadeIn=function(){this.state.showing||this.state.debugging||(this.state.hiding=!1,this.state.showing=!0,this._animate(!0))},Zt.prototype._bindHandlers=function(){var e=this;Ht.initElementListening(We,["resize"]),Ht.addInternalEventBeforeListener(We,["resize"],function(){e.windowHeight=We.innerHeight});var i=qt.getHeight(this.statusBar);Ht.addFirstInternalEventBeforeListener(We,["mousemove","mouseout","touchmove"],function(t){"mouseout"!==t.type||t.relatedTarget?"mousemove"!==t.type&&"touchmove"!==t.type||(t.clientY>e.windowHeight-i?e._fadeOut(t):e.state.hidden&&e._fadeIn(t)):e._fadeIn(t)})},Zt.prototype._bindClickOnce=function(i,n){var s=this,o=Lt.isTouchDevice?"touchstart":"mousedown",a=function(t){var e=Ot.eventTargetGetter.call(t);Kt.find(i,function(t){return Gt.containsElement(t,e)})?(zt.preventDefault(t),Ht.removeInternalEventBeforeListener(We,[o],a),n(t)):Gt.containsElement(s.statusBar,e)&&zt.preventDefault(t)};Ht.addInternalEventBeforeListener(We,[o],a)},Zt.prototype._initChildListening=function(){var i=this;Nt.on(Nt.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;e.cmd===Bt?i.showWaitingElementStatus(e.timeout):e.cmd===Ut?i.hideWaitingElementStatus(e.waitingSuccess).then(function(){return Nt.sendServiceMsg({cmd:Mt},t.source)}):e.cmd===At?i.showWaitingAssertionRetriesStatus(e.timeout):e.cmd===Vt&&i.hideWaitingAssertionRetriesStatus(e.waitingSuccess).then(function(){return Nt.sendServiceMsg({cmd:Dt},t.source)})})},Zt.prototype._resetState=function(){this.state.debugging=!1,this.actionsContainer.style.display="none",this.unlockButton.style.display="none",Ot.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText("")),this.progressBar.hide()},Zt.prototype._getFullStatusText=function(t){var e=this.contextStorage.getItem(Jt)||"";return e+(e&&t?". ":"")+t},Zt.prototype._showWaitingStatus=function(){var t=this.state.assertionRetries?"Waiting for assertion execution...":"Waiting for element to appear...";Ot.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText(t)),this.progressBar.show()},Zt.prototype._hideWaitingStatus=function(e){var i=this;return new Rt(function(t){Ot.setTimeout.call(We,function(){i.state.waiting||i.state.debugging||(Wt.removeClass(i.statusBar,Xt),Wt.removeClass(i.statusBar,Yt),i.progressBar.determinateIndicator.reset(),i._resetState()),t()},e?0:500)})},Zt.prototype._showDebuggingStatus=function(t){var s=this;return new Rt(function(n){s.state.debugging=!0,s.state.locked=!0,t?(s.buttons.removeChild(s.nextButton),s.buttons.removeChild(s.resumeButton),s.buttons.appendChild(s.finishButton),Ot.nodeTextContentSetter.call(s.statusDiv,s._getFullStatusText("Test failed")),Wt.removeClass(s.statusBar,Xt),Wt.addClass(s.statusBar,Yt)):Ot.nodeTextContentSetter.call(s.statusDiv,s._getFullStatusText("Debugging test...")),s.actionsContainer.style.display="",s.unlockButton.style.display="",s._bindClickOnce([s.resumeButton,s.nextButton,s.finishButton],function(t){var e=Ot.eventTargetGetter.call(t),i=Gt.containsElement(s.nextButton,e);s._resetState(),n(i?Pt:kt)})})},Zt.prototype._setWaitingStatus=function(t,e){var i=this;this.state.waiting=!0,this.progressBar.determinateIndicator.start(t,e),this.showingTimeout=Ot.setTimeout.call(We,function(){i.showingTimeout=null,i._showWaitingStatus()},300)},Zt.prototype._resetWaitingStatus=function(t){this.state.waiting=!1,this.progressBar.determinateIndicator.stop(),t?Wt.addClass(this.statusBar,Xt):Wt.addClass(this.statusBar,Yt);var e=this.showingTimeout&&t;return this.showingTimeout&&(Ot.clearTimeout.call(We,this.showingTimeout),this.showingTimeout=null,t||this._showWaitingStatus()),this._hideWaitingStatus(e)},Zt.prototype.hidePageLoadingStatus=function(){this.state.created||this._create(),this.progressBar.indeterminateIndicator.stop(),this._resetState()},Zt.prototype.showDebuggingStatus=function(t){return this._stopAnimation(),qt.set(this.statusBar,"opacity",1),qt.set(this.statusBar,"visibility",""),this.state.hiden=!1,this._showDebuggingStatus(t)},Zt.prototype.showWaitingElementStatus=function(t){this.state.assertionRetries||this._setWaitingStatus(t)},Zt.prototype.hideWaitingElementStatus=function(t){return this.state.assertionRetries?Rt.resolve():this._resetWaitingStatus(t)},Zt.prototype.showWaitingAssertionRetriesStatus=function(t,e){this.state.assertionRetries=!0,this._setWaitingStatus(t,e)},Zt.prototype.hideWaitingAssertionRetriesStatus=function(t){var e=this;return this._resetWaitingStatus(t).then(function(){e.state.assertionRetries=!1})},Zt.prototype.setStatusPrefix=function(t){this.contextStorage.setItem(Jt,t),Ot.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText(""))},Zt);function Zt(t,e,i,n){var s=Tt.call(this)||this;return s.UNLOCK_PAGE_BTN_CLICK="testcafe|ui|status-bar|unlock-page-btn-click",s.userAgent=t,s.fixtureName=e,s.testName=i,s.contextStorage=n,s.statusBar=null,s.infoContainer=null,s.actionsContainer=null,s.icon=null,s.resumeButton=null,s.finishButton=null,s.nextButton=null,s.statusDiv=null,s.buttons=null,s.progressBar=null,s.animationInterval=null,s.showingTimeout=null,s.windowHeight=Oe.documentElement?qt.getHeight(We):We.innerHeight,s.state={created:!1,showing:!1,hiding:!1,debugging:!1,waiting:!1,assertionRetries:!1,hidden:!1},s.currentView=null,s._createBeforeReady(),s._initChildListening(),s}var $t,te=i.sendRequestToFrame,ee=e.eventSandbox.message,ie=(st(ne,$t=Qt),ne.prototype.showWaitingElementStatus=function(t){ee.sendServiceMsg({cmd:Bt,timeout:t},We.top)},ne.prototype.hideWaitingElementStatus=function(t){return te({cmd:Ut,waitingSuccess:t},Mt,We.top)},ne.prototype.showWaitingAssertionRetriesStatus=function(t){ee.sendServiceMsg({cmd:At,timeout:t},We.top)},ne.prototype.hideWaitingAssertionRetriesStatus=function(t){return te({cmd:Vt,waitingSuccess:t},Dt,We.top)},ne);function ne(){return $t.call(this)||this}var se="ui|cursor|move|request",oe="ui|cursor|leftbuttondown|request",ae="ui|cursor|rightbuttondown|request",re="ui|cursor|buttonup|request",le="ui|cursor|move|response",ue="ui|cursor|leftbuttondown|response",he="ui|cursor|rightbuttondown|response",ce="ui|cursor|buttonup|response",de=e.Promise,pe=e.shadowUI,me=e.utils.browser,ge=e.utils.featureDetection,fe=e.eventSandbox.message,ve=i.styleUtils,ye=i.positionUtils,Ee="l-mouse-down",Ce="r-mouse-down",_e=[Ee,Ce].join(" ");fe.on(fe.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;switch(e.cmd){case se:we.move(ye.getIframePointRelativeToParentFrame({x:e.x,y:e.y},t.source)).then(function(){return fe.sendServiceMsg({cmd:le},t.source)});break;case oe:we.leftButtonDown().then(function(){return fe.sendServiceMsg({cmd:ue},t.source)});break;case ae:we.rightButtonDown().then(function(){return fe.sendServiceMsg({cmd:he},t.source)});break;case re:we.buttonUp().then(function(){return fe.sendServiceMsg({cmd:ce},t.source)})}});var we={cursorElement:null,x:50,y:50,pointerOffsetX:0,pointerOffsetY:0,_createElement:function(){this.cursorElement=Oe.createElement("div"),pe.addClass(this.cursorElement,"cursor"),ge.isTouchDevice&&!me.isIE&&(pe.addClass(this.cursorElement,"touch"),this.pointerOffsetX=Math.ceil(ve.getWidth(this.cursorElement)/2),this.pointerOffsetY=Math.ceil(ve.getHeight(this.cursorElement)/2)),r.element().appendChild(this.cursorElement)},isVisible:function(){return this.cursorElement&&"hidden"!==ve.get(this.cursorElement,"visibility")},hide:function(){this.cursorElement||this._createElement(),this.isVisible()&&ve.set(this.cursorElement,"visibility","hidden")},show:function(){this.cursorElement||this._createElement(),ve.set(this.cursorElement,"visibility","")},move:function(t){return this.x=t.x,this.y=t.y,this.cursorElement||this._createElement(),ve.set(this.cursorElement,{left:this.x-this.pointerOffsetX+"px",top:this.y-this.pointerOffsetY+"px"}),de.resolve()},leftButtonDown:function(){return this.cursorElement||this._createElement(),pe.removeClass(this.cursorElement,_e),pe.addClass(this.cursorElement,Ee),de.resolve()},rightButtonDown:function(){return this.cursorElement||this._createElement(),pe.removeClass(this.cursorElement,_e),pe.addClass(this.cursorElement,Ce),de.resolve()},buttonUp:function(){return this.cursorElement||this._createElement(),pe.removeClass(this.cursorElement,_e),de.resolve()}},Se=e.utils.browser.isIE?1:0,xe={move:function(t){var e={cmd:se,x:t.x+Se,y:t.y+Se};return o.sendRequestToFrame(e,le,We.parent)},leftButtonDown:function(){return o.sendRequestToFrame({cmd:oe},ue,We.parent)},rightButtonDown:function(){return o.sendRequestToFrame({cmd:ae},he,We.parent)},buttonUp:function(){return o.sendRequestToFrame({cmd:re},ce,We.parent)}},Ie={screenshotMark:null,_createMark:function(){this.screenshotMark=Oe.createElement("img"),s.shadowUI.addClass(this.screenshotMark,"screenshot-mark"),this.screenshotMark.style.right=10/We.devicePixelRatio+"px",this.screenshotMark.style.width=32/We.devicePixelRatio+"px",this.screenshotMark.style.height=10/We.devicePixelRatio+"px",this.hide(),s.shadowUI.getRoot().appendChild(this.screenshotMark)},hide:function(){this.screenshotMark&&(this.screenshotMark.style.visibility="hidden")},show:function(t){this.screenshotMark||this._createMark(),s.nativeMethods.imageSrcSetter.call(this.screenshotMark,t),this.screenshotMark.style.visibility=""}},be=e.Promise,Te=e.eventSandbox.message,Be=i.sendRequestToFrame,Ue="ui|hide|request",Me="ui|hide|response",Ae="ui|show|request",Ve="ui|show|response";Te.on(Te.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===Ue?(r.hide(),Te.sendServiceMsg({cmd:Me},t.source)):t.message.cmd===Ae&&(r.show(),Te.sendServiceMsg({cmd:Ve},t.source))});var De={};De.uiRoot=r,De.cursorUI=we,De.iframeCursorUI=xe,De.selectElement=n,De.modalBackground=H,De.ProgressPanel=et,De.StatusBar=Qt,De.IframeStatusBar=ie,De.hide=function(t){return t?Be({cmd:Ue},Me,We.top):(r.hide(),be.resolve())},De.show=function(t){return t?Be({cmd:Ae},Ve,We.top):(r.show(),be.resolve())},De.showScreenshotMark=function(t){return Ie.show(t)},De.hideScreenshotMark=function(){return Ie.hide()};var Pe=e.nativeMethods,ke=e.EVENTS.evalIframeScript;Pe.objectDefineProperty(We,"%testCafeUI%",{configurable:!0,value:De}),e.on(ke,function(t){return Re(Pe.contentWindowGetter.call(t.iframe))})}(We["%hammerhead%"],We["%testCafeCore%"],We["%hammerhead%"].Promise)}(window);