@browserstack/testcafe
Version:
Automated browser testing for the modern web development stack.
1 lines • 88.2 kB
JavaScript
!function Ou(Yu){var Fu=Yu.document;!function(t,m,o){var h="default"in t?t.default:t,E="default"in m?m.default:m;o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var a=h.Promise,l=h.eventSandbox.message,u="automation|scroll|request",c="automation|scroll|response";l.on(l.SERVICE_MSG_RECEIVED_EVENT,function(t){var e,n,i,o,r,s;t.message.cmd===u&&(n=(e=t.message).offsetX,i=e.offsetY,o=e.maxScrollMargin,r=m.domUtils.findIframeByWindow(t.source),(s=new f(r,{offsetX:n,offsetY:i})).maxScrollMargin=o,s.run().then(function(){return l.sendServiceMsg({cmd:c},t.source)}))});var f=(d.prototype._isScrollValuesChanged=function(t,e){return m.styleUtils.getScrollLeft(t)!==e.left||m.styleUtils.getScrollTop(t)!==e.top},d.prototype._setScroll=function(t,e){var n=this,i=e.left,o=e.top,r=m.domUtils.isHtmlElement(t)?m.domUtils.findDocument(t):t,s={left:m.styleUtils.getScrollLeft(r),top:m.styleUtils.getScrollTop(r)},i=Math.max(i,0),o=Math.max(o,0),l=m.scrollController.waitForScroll(r);return m.styleUtils.setScrollLeft(r,i),m.styleUtils.setScrollTop(r,o),this._isScrollValuesChanged(r,s)?l=l.then(function(){n.scrollWasPerformed=n.scrollWasPerformed||n._isScrollValuesChanged(r,s)}):(l.cancel(),a.resolve())},d.prototype._getScrollToPoint=function(t,e,n){var i=e.x,o=e.y,r=Math.floor(t.width/2),s=Math.floor(Math.floor(t.height/2)),l=this.scrollToCenter?r:Math.min(n.left,r),a=this.scrollToCenter?s:Math.min(n.top,s),u=i>=t.scroll.left+t.width-l,c=i<=t.scroll.left+l,h=o>=t.scroll.top+t.height-a,f=o<=t.scroll.top+a,d=t.scroll.left,m=t.scroll.top;return u?d=i-t.width+l:c&&(d=i-l),h?m=o-t.height+a:f&&(m=o-a),{left:d,top:m}},d.prototype._getScrollToFullChildView=function(t,e,n){var i,o,r,s,l=null,a=null,u=t.width>=e.width,c=t.height>=e.height,h=m.positionUtils.calcRelativePosition(e,t);return u&&(i=t.width-e.width,o=Math.min(n.left,i),this.scrollToCenter&&(o=i/2),h.left<o?l=Math.round(t.scroll.left+h.left-o):h.right<o&&(l=Math.round(t.scroll.left+Math.min(h.left,-h.right)+o))),c&&(r=t.height-e.height,s=Math.min(n.top,r),this.scrollToCenter&&(s=r/2),h.top<s?a=Math.round(t.scroll.top+h.top-s):h.bottom<s&&(a=Math.round(t.scroll.top+Math.min(h.top,-h.bottom)+s))),{left:l,top:a}},d._getChildPoint=function(t,e,n){return{x:e.left-t.left+t.scroll.left+e.border.left+n.x,y:e.top-t.top+t.scroll.top+e.border.top+n.y}},d.prototype._getScrollPosition=function(t,e,n,i){var o=d._getChildPoint(t,e,n),r=this._getScrollToPoint(t,o,i),s=this._getScrollToFullChildView(t,e,i);return{left:Math.max(null===s.left?r.left:s.left,0),top:Math.max(null===s.top?r.top:s.top,0)}},d._getChildPointAfterScroll=function(t,e,n,i){return{x:Math.round(e.left+t.scroll.left-n.left+i.x),y:Math.round(e.top+t.scroll.top-n.top+i.y)}},d.prototype._isChildFullyVisible=function(t,e,n){var i=d._getChildPointAfterScroll(t,e,t.scroll,n),o=i.x,r=i.y,s=this._getScrollPosition(t,e,n,{left:0,top:0}),l=s.left,a=s.top;return!this._isTargetElementObscuredInPoint(o,r)&&l===t.scroll.left&&a===t.scroll.top},d.prototype._scrollToChild=function(t,e,n){for(var i=m.positionUtils.getClientDimensions(t),o=m.positionUtils.getClientDimensions(e),r=m.styleUtils.getInnerWidth(Yu),s=m.styleUtils.getInnerHeight(Yu),l=i.scroll,a=!this._isChildFullyVisible(i,o,n);a;){l=this._getScrollPosition(i,o,n,this.maxScrollMargin);var u=d._getChildPointAfterScroll(i,o,l,n),c=u.x,h=u.y,f=this._isTargetElementObscuredInPoint(c,h);this.maxScrollMargin.left+=20,this.maxScrollMargin.left>=r&&(this.maxScrollMargin.left=50,this.maxScrollMargin.top+=20),a=f&&this.maxScrollMargin.top<s}return this.maxScrollMargin={left:50,top:50},this._setScroll(t,l)},d.prototype._scrollElement=function(){if(!m.styleUtils.hasScroll(this.element))return a.resolve();var t=m.positionUtils.getClientDimensions(this.element),e=this._getScrollToPoint(t,{x:this.offsetX,y:this.offsetY},this.maxScrollMargin);return this._setScroll(this.element,e)},d.prototype._scrollParents=function(){var e=this,n=m.styleUtils.getScrollableParents(this.element),i=this.element,o=this.offsetX-Math.round(m.styleUtils.getScrollLeft(i)),r=this.offsetY-Math.round(m.styleUtils.getScrollTop(i)),s=null,l=null;return m.promiseUtils.times(n.length,function(t){return e._scrollToChild(n[t],i,{x:o,y:r}).then(function(){s=m.positionUtils.getClientDimensions(i),l=m.positionUtils.getClientDimensions(n[t]),o+=s.left-l.left+l.border.left,r+=s.top-l.top+l.border.top,i=n[t]})}).then(function(){return Yu.top===Yu||e.skipParentFrames?a.resolve():m.sendRequestToFrame({cmd:u,offsetX:o,offsetY:r,maxScrollMargin:e.maxScrollMargin},c,Yu.parent)})},d._getFixedAncestorOrSelf=function(t){return m.domUtils.findParent(t,!0,m.styleUtils.isFixedElement)},d.prototype._isTargetElementObscuredInPoint=function(t,e){var n=m.positionUtils.getElementFromPoint(t,e);if(!n)return!1;var i=d._getFixedAncestorOrSelf(n);return i&&!i.contains(this.element)},d.prototype.run=function(){var t=this;return this._scrollElement().then(function(){return t._scrollParents()}).then(function(){return t.scrollWasPerformed})},d);function d(t,e){this.element=t,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.scrollToCenter=e.scrollToCenter,this.skipParentFrames=e.skipParentFrames,this.raiseEvents=e.raiseEvents,this.maxScrollMargin={left:50,top:50},this.scrollWasPerformed=!1}var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function e(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=h.utils.browser;function s(t,e,n){var i=r.isFirefox?Math.ceil:Math.round,o=m.positionUtils.getOffsetPosition(t,i);return{x:(t===Fu.documentElement?0:o.left)+e,y:(t===Fu.documentElement?0:o.top)+n}}function p(t){if(!t)return null;var e=Yu.screenLeft||Yu.screenX,n=Yu.screenTop||Yu.screenY;return{x:e+t.x,y:n+t.y}}function n(t){var e=t/2;return e<1?0:Math.round(e)}function v(t){var e=m.positionUtils.getElementRectangle(t);return{offsetX:n(e.width),offsetY:n(e.height)}}function g(t,e,n){var i=v(t);if(e="number"==typeof e?Math.round(e):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<e&&0<n)return{offsetX:e,offsetY:n};var o=m.positionUtils.getClientDimensions(t),r=Math.round(Math.max(t.scrollWidth,o.width)),s=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+r,a=o.scrollbar.bottom+o.border.top+o.border.bottom+s;return{offsetX:e<0?l+e:e,offsetY:n<0?a+n:n}}var y=E.domUtils,S=Yu.top===Yu?o.cursorUI:o.iframeCursorUI,b={x:-1,y:-1,currentActiveWindow:Yu.top,_ensureActiveWindow:function(){var t;this.currentActiveWindow!==Yu&&this.currentActiveWindow!==Yu.parent&&((t=y.findIframeByWindow(this.currentActiveWindow))&&y.isElementInDocument(t)||(this.currentActiveWindow=Yu))},get active(){return this._ensureActiveWindow(),this.currentActiveWindow===Yu},set activeWindow(t){this.currentActiveWindow=t},get activeWindow(){return this._ensureActiveWindow(),this.currentActiveWindow},get position(){return{x:this.x,y:this.y}},get visible(){return Yu.top===Yu&&S.isVisible()},move:function(t,e){return this.x=t,this.y=e,S.move(this.x,this.y)},hide:function(){this.visible&&S.hide()},show:function(){Yu.top===Yu&&S.show()},leftButtonDown:function(){return S.leftButtonDown()},rightButtonDown:function(){return S.rightButtonDown()},buttonUp:function(){return S.buttonUp()}},P=h.utils.browser,x=h.Promise,_=h.nativeMethods,A=E.positionUtils,C=E.domUtils;function w(t,e,n){var i=null;return o.hide(n).then(function(){return i=A.getElementFromPoint(t,e),o.show(n)}).then(function(){return i})}function T(t,e,n){var i=A.getElementFromPoint(t,e),o=C.containsElement(n,i)&&_.nodeTextContentGetter.call(i).length;return i&&i===n||o?i:null}function M(t,e){if(!e||!C.isDomElement(e)||!t||t===e)return t;if("tref"===C.getTagName(e))return e;var n,i,o,r="area"===C.getTagName(e)&&C.isImgElement(t);if(P.isFirefox&&r)return n=t,i=e,(o=C.closest(i,"map"))&&o.name===n.useMap.substring(1)?i:n;var s=C.isAnchorElement(e)||C.getParents(e,"a").length,l=s&&C.containsElement(e,t)&&_.nodeTextContentGetter.call(t).length;if(!s||l||!_.nodeTextContentGetter.call(e).length)return t;var a=e.getBoundingClientRect();return T(a.right-1,a.top+1,e)||T(a.left+1,a.bottom-1,e)||t}function U(n,i,o){var r=Yu!==Yu.top,s=null;return w(n,i).then(function(t){s=t;var e=x.resolve(t);return!s&&r&&0<n&&0<i&&(e=e.then(function(){return w(n,i,!0)}).then(function(t){return s=t})),e.then(function(t){return M(t,o)}).then(function(t){return{element:t,corrected:t!==s}})})}function D(){var t=b.position;return U(t.x,t.y).then(function(t){return t.element})}var I={elementIsInvisibleError:"elementIsInvisibleError",foundElementIsNotTarget:"foundElementIsNotTarget"},k=(Object.defineProperty(B.prototype,"mouseActionStepDelay",{get:function(){return 1===this.speedFactor?10:400*(1-this.speedFactor)},enumerable:!0,configurable:!0}),Object.defineProperty(B.prototype,"keyActionStepDelay",{get:function(){return 1===this.speedFactor?10:200*(1-this.speedFactor)},enumerable:!0,configurable:!0}),Object.defineProperty(B.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this.speedFactor)/4},enumerable:!0,configurable:!0}),Object.defineProperty(B.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this.speedFactor)/4},enumerable:!0,configurable:!0}),B);function B(t){this.speedFactor=t||1}var N=(O.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},O.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t)for(var i=this._getAssignableProperties(),o=0;o<i.length;o++){for(var r,s=i[o],l=s.name,a=s.type,u=s.required,c=s.init,h=s.defaultValue,f=l.split("."),d=f.length-1,m=f[d],p=t,v=this,g=0;g<d&&p&&v;g++)p=p[f[g]],v=v[f[g]];v&&"defaultValue"in i[o]&&(v[l]=h),p&&v&&(void 0===(r=p[m])&&!u||(e&&a&&a(l,r),v[m]=c?c(l,r,n):r))}},O);function O(){}function Y(i){return function(t,e){var n=typeof e;if("number"!=n)throw new i(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new i(t,e)}}function F(t){this.code=t,this.isTestCafeError=!0,this.callsite=null}var L,K="E1",X="E2",V="E3",R="E4",W="E5",H="E6",G="E7",z="E8",q="E9",j="E10",$="E11",Z="E12",J="E14",Q="E15",tt="E16",et="E17",nt="E18",it="E19",ot="E20",rt="E21",st="E22",lt="E23",at="E24",ut="E26",ct="E27",ht="E28",ft="E29",dt="E30",mt="E31",pt="E32",vt="E33",gt="E34",Et="E35",yt="E36",St="E37",bt="E38",Pt="E39",xt="E40",_t="E41",At="E42",Ct="E43",wt="E44",Tt="E45",Mt="E46",Ut="E47",Dt="E48",It="E49",kt="E50",Bt="E51",Nt="E52",Ot="E53",Yt="E54",Ft="E55",Lt="E56",Kt="E57",Xt="E58",Vt="E59",Rt="E60",Wt="E61",Ht="E62",Gt="E63",zt="E64",qt="E65",jt="E66",$t="E67",Zt="E68",Jt="E69",Qt="E70",te="E71",ee="E72",ne=(e(ie,L=F),ie);function ie(t,e,n){var i=L.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}var oe,re,se,le,ae=(e(ue,oe=F),ue);function ue(t,e,n){var i=oe.call(this,t)||this;return i.argumentName=e,i.actualValue=n,i}function ce(t){var e=re.call(this,z)||this;return e.callsite=t,e}function he(t){var e=se.call(this,It)||this;return e.instantiationCallsiteName=t,e}function fe(t){var e=le.call(this,kt)||this;return e.instantiationCallsiteName=t,e}e(ce,re=F),e(he,se=F),e(fe,le=F);var de,me,pe,ve,ge,Ee,ye,Se,be,Pe,xe,_e,Ae,Ce,we,Te,Me,Ue=(e(De,de=F),De);function De(t,e){var n=e.apiFnChain,i=e.apiFnIndex,o=de.call(this,t)||this;return o.apiFnChain=n,o.apiFnIndex=i,o}function Ie(){return me.call(this,Bt)||this}function ke(t,e){var n=pe.call(this,Nt,e)||this;return n.callsite=t,n}function Be(t,e){var n=ve.call(this,Yt)||this;return n.url=e,n.errMsg=t,n}function Ne(t,e){var n=ge.call(this,K)||this;return n.errStack=t,n.pageDestUrl=e,n}function Oe(t,e){var n=Ee.call(this,X)||this;return n.errMsg=String(t.rawMessage||t),n.callsite=t.callsite||e,n.originError=t,n}function Ye(t){var e=ye.call(this,V)||this;return e.objType=typeof t,e.objStr=String(t),e}function Fe(t,e){var n=Se.call(this,R)||this;return n.errMsg=String(e),n.instantiationCallsiteName=t,n}function Le(t,e,n){var i=be.call(this,W,e,n)||this;return i.errMsg=String(e),i.property=n,i.instantiationCallsiteName=t,i}function Ke(t){var e=Pe.call(this,H)||this;return e.errMsg=String(t),e}function Xe(t){var e=xe.call(this,G)||this;return e.errMsg=String(t),e}function Ve(t){var e=_e.call(this,zt)||this;return e.errMsg=String(t),e}function Re(t,e){var n=Ae.call(this,qt)||this;return n.errMsg=String(t),n.moduleName=e,n}function We(t,e){var n=Ce.call(this,Ot)||this;return n.errMsg=String(t),n.callsite=e,n}function He(t,e,n,i){var o=we.call(this,Vt,t,e)||this;return o.errMsg=i?n.rawMessage:n.message,o.originError=n,o}function Ge(t){var e=Te.call(this,Rt)||this;return e.callsite=t,e}function ze(t){var e=Me.call(this,Wt)||this;return e.callsite=t,e}e(Ie,me=F),e(ke,pe=Ue),e(Be,ve=F),e(Ne,ge=F),e(Oe,Ee=F),e(Ye,ye=F),e(Fe,Se=F),e(Le,be=F),e(Ke,Pe=F),e(Xe,xe=F),e(Ve,_e=F),e(Re,Ae=F),e(We,Ce=F),e(He,we=ae),e(Ge,Te=F),e(ze,Me=F);var qe,je=(e($e,qe=ne),$e);function $e(t,e){return qe.call(this,q,t,e)||this}var Ze,Je=(e(Qe,Ze=ne),Qe);function Qe(t,e){return Ze.call(this,j,t,e)||this}var tn,en,nn=(e(on,tn=ne),on);function on(t,e){return tn.call(this,$,t,e)||this}function rn(t,e){return en.call(this,Q,t,e)||this}e(rn,en=ae);var sn,ln,an,un,cn,hn,fn,dn,mn,pn,vn,gn,En,yn,Sn,bn,Pn,xn,_n,An,Cn,wn,Tn,Mn,Un,Dn,In,kn,Bn,Nn,On,Yn,Fn,Ln,Kn,Xn,Vn,Rn,Wn,Hn,Gn,zn,qn,jn,$n,Zn,Jn,Qn=(e(ti,sn=ne),ti);function ti(t,e){return sn.call(this,Z,t,e)||this}function ei(t){var e=ln.call(this,J)||this;return e.actualType=t,e}function ni(t,e){return an.call(this,tt,t,e)||this}function ii(t,e){return un.call(this,et,t,e)||this}function oi(t,e){return cn.call(this,ot,t,e)||this}function ri(t,e){return hn.call(this,rt,t,e)||this}function si(t,e){return fn.call(this,st,t,e)||this}function li(t,e){return dn.call(this,nt,t,e)||this}function ai(t,e,n){var i=mn.call(this,it,t,e)||this;return i.elementIndex=n,i}function ui(t,e){return pn.call(this,Ut,t,e)||this}function ci(t,e){return vn.call(this,bt,t,e)||this}function hi(t,e,n){var i=gn.call(this,lt)||this;return i.selectorName=t,i.errMsg=n?e.rawMessage:e.message,i.originError=e,i}function fi(t){return En.call(this,at,t)||this}function di(){return yn.call(this,ut)||this}function mi(t){var e=Sn.call(this,ct)||this;return e.nodeDescription=t,e}function pi(t,e){var n=bn.call(this,ht,e)||this;return n.argumentName=t,n}function vi(t){var e=Pn.call(this,ft)||this;return e.argumentName=t,e}function gi(t,e){var n=xn.call(this,dt)||this;return n.argumentName=t,n.nodeDescription=e,n}function Ei(){return _n.call(this,mt)||this}function yi(){return An.call(this,pt)||this}function Si(t){var e=Cn.call(this,vt)||this;return e.argumentName=t,e}function bi(){return wn.call(this,Et)||this}function Pi(t){var e=Tn.call(this,yt)||this;return e.argumentName=t,e}function xi(t,e){var n=Mn.call(this,St)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function _i(){return Un.call(this,gt)||this}function Ai(t,e){var n=Dn.call(this,_t)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function Ci(t,e,n,i,o){var r=In.call(this,jt)||this;return r.callsite=o,r.expression=e,r.line=n,r.column=i,r.originError=t,r.errMsg=t.message||String(t),r}function wi(t,e,n,i,o){var r=kn.call(this,$t)||this;return r.callsite=o,r.expression=e,r.line=n,r.column=i,r.originError=t,r.errCallsite=t.callsite,r}function Ti(t){var e=Bn.call(this,Ft)||this;return e.callsite=t,e}function Mi(t,e){var n=Nn.call(this,Kt)||this;return t<=0?e<=0?(n.verb="are",n.dimensions="width and height"):(n.verb="is",n.dimensions="width"):(n.verb="is",n.dimensions="height"),n}function Ui(t,e){var n=On.call(this,Lt)||this;return n.screenshotPath=t,n.forbiddenCharsList=e,n}function Di(t){var e=Yn.call(this,Xt)||this;return e.callsite=t,e}function Ii(){return Fn.call(this,xt)||this}function ki(){return Ln.call(this,Pt)||this}function Bi(){return Kn.call(this,At)||this}function Ni(){return Xn.call(this,Jt)||this}function Oi(){return Vn.call(this,Zt)||this}function Yi(){return Rn.call(this,Qt)||this}function Fi(){return Wn.call(this,te)||this}function Li(){return Hn.call(this,Ct)||this}function Ki(){return Gn.call(this,wt)||this}function Xi(t,e){var n=zn.call(this,Tt)||this;return n.dialogType=t,n.pageUrl=e,n}function Vi(t,e,n){var i=qn.call(this,Mt)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}function Ri(t){var e=jn.call(this,Dt)||this;return e.actualType=t,e}function Wi(t,e,n){var i=$n.call(this,Gt)||this;return i.errMsg=String(t),i.hookClassName=e,i.methodName=n,i}function Hi(t,e){var n=Zn.call(this,Ht)||this;return n.methodName=t,n.hookClassName=e,n}function Gi(){return Jn.call(this,ee)||this}e(ei,ln=F),e(ni,an=ae),e(ii,un=ae),e(oi,cn=ae),e(ri,hn=ae),e(si,fn=ae),e(li,dn=ae),e(ai,mn=ae),e(ui,pn=ae),e(ci,vn=ae),e(hi,gn=F),e(fi,En=Ue),e(di,yn=F),e(mi,Sn=F),e(pi,bn=Ue),e(vi,Pn=F),e(gi,xn=F),e(Ei,_n=F),e(yi,An=F),e(Si,Cn=F),e(bi,wn=F),e(Pi,Tn=F),e(xi,Mn=F),e(_i,Un=F),e(Ai,Dn=F),e(Ci,In=F),e(wi,kn=F),e(Ti,Bn=F),e(Mi,Nn=F),e(Ui,On=F),e(Di,Yn=F),e(Ii,Fn=F),e(ki,Ln=F),e(Bi,Kn=F),e(Ni,Xn=F),e(Oi,Vn=F),e(Yi,Rn=F),e(Fi,Wn=F),e(Li,Hn=F),e(Ki,Gn=F),e(Xi,zn=F),e(Vi,qn=F),e(Ri,jn=F),e(Wi,$n=F),e(Hi,Zn=F),e(Gi,Jn=F);var zi,qi,ji,$i,Zi,Ji=Y(je),Qi=(qi=Y(zi=Je),function(t,e){if(qi(t,e),e<0)throw new zi(t,e)}),to=(ji=nn,function(t,e){var n=typeof e;if("boolean"!=n)throw new ji(t,n)}),eo=($i=Qn,function(t,e){var n=typeof e;if("number"!=n)throw new $i(t,n);if(isNaN(e)||e<.01||1<e)throw new $i(t,e)}),no=(e(io,Zi=N),io.prototype._getAssignableProperties=function(){return[{name:"speed",type:eo}]},io);function io(t,e){var n=Zi.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var oo,ro=(e(so,oo=no),so.prototype._getAssignableProperties=function(){return oo.prototype._getAssignableProperties.call(this).concat([{name:"offsetX",type:Ji},{name:"offsetY",type:Ji}])},so);function so(t,e){var n=oo.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var lo,ao,uo=(e(co,lo=ro),co.prototype._getAssignableProperties=function(){return lo.prototype._getAssignableProperties.call(this).concat([{name:"scrollToCenter",type:to},{name:"skipParentFrames",type:to}])},co);function co(t,e){var n=lo.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}function ho(t,e){var n=ao.call(this)||this;return n.scrollTargetX=null,n.scrollTargetY=null,n.includeMargins=!1,n.includeBorders=!0,n.includePaddings=!0,n.crop={left:null,right:null,top:null,bottom:null},n._assignFrom(t,e),n}e(ho,ao=no),ho.prototype._getAssignableProperties=function(){return ao.prototype._getAssignableProperties.call(this).concat([{name:"scrollTargetX",type:Ji},{name:"scrollTargetY",type:Ji},{name:"crop.left",type:Ji},{name:"crop.right",type:Ji},{name:"crop.top",type:Ji},{name:"crop.bottom",type:Ji},{name:"includeMargins",type:to},{name:"includeBorders",type:to},{name:"includePaddings",type:to}])};var fo,mo=(e(po,fo=ro),po.prototype._getAssignableProperties=function(){return fo.prototype._getAssignableProperties.call(this).concat([{name:"modifiers.ctrl",type:to},{name:"modifiers.alt",type:to},{name:"modifiers.shift",type:to},{name:"modifiers.meta",type:to}])},po);function po(t,e){var n=fo.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var vo,go=(e(Eo,vo=mo),Eo.prototype._getAssignableProperties=function(){return vo.prototype._getAssignableProperties.call(this).concat([{name:"caretPos",type:Qi}])},Eo);function Eo(t,e){var n=vo.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var yo,So=(e(bo,yo=mo),bo.prototype._getAssignableProperties=function(){return yo.prototype._getAssignableProperties.call(this).concat([{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:to},{name:"skipDefaultDragBehavior",type:to}])},bo);function bo(t,e){var n=yo.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}var Po,xo,_o,Ao,Co=(e(wo,Po=go),wo.prototype._getAssignableProperties=function(){return Po.prototype._getAssignableProperties.call(this).concat([{name:"replace",type:to},{name:"paste",type:to}])},wo);function wo(t,e){var n=Po.call(this)||this;return n.replace=!1,n.paste=!1,n._assignFrom(t,e),n}function To(t,e){var n=xo.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function Mo(t,e){var n=_o.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function Uo(t,e){var n=Ao.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function Do(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Io(t,e,n){for(var i=[],o=null,r=[{x1:n.left,y1:n.top,x2:n.left,y2:n.bottom,isHorizontal:!1},{x1:n.right,y1:n.top,x2:n.right,y2:n.bottom,isHorizontal:!1},{x1:n.left,y1:n.top,x2:n.right,y2:n.top,isHorizontal:!0},{x1:n.left,y1:n.bottom,x2:n.right,y2:n.bottom,isHorizontal:!0}],s=0;s<r.length;s++)(o=function(t,e,n){var i=null;if(n.isHorizontal)return(i=m.positionUtils.getLineXByYCoord(t,e,n.y1))&&i>=n.x1&&i<=n.x2?{x:i,y:n.y1}:null;var o=m.positionUtils.getLineYByXCoord(t,e,n.x1);return o&&o>=n.y1&&o<=n.y2?{x:n.x1,y:o}:null}(t,e,r[s]))&&i.push(o);return i.length?1===i.length||Do(t,i[0])<Do(t,i[1])?i[0]:i[1]:null}e(To,xo=mo),To.prototype._getAssignableProperties=function(){return xo.prototype._getAssignableProperties.call(this).concat([{name:"destinationOffsetX",type:Ji},{name:"destinationOffsetY",type:Ji}])},e(Mo,_o=N),Mo.prototype._getAssignableProperties=function(){return[{name:"portraitOrientation",type:to}]},e(Uo,Ao=N),Uo.prototype._getAssignableProperties=function(){return[{name:"timeout",type:Qi},{name:"allowUnawaitedPromise",type:to}]};var ko=h.Promise,Bo=h.nativeMethods;function No(){return new ko(function(t){return Bo.setTimeout.call(Yu,t,0)})}var Oo=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},Yo=h.utils.browser,Fo=(Lo.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},Lo.prototype.leaveElement=function(){},Lo.prototype.move=function(){},Lo.prototype.enterElement=function(){},Lo.prototype.dragAndDrop=function(){},Lo.prototype.teardown=function(){},Lo.prototype.run=function(t,e,n,i,o){var r=e&&m.domUtils.isElementInDocument(e),s=e&&m.domUtils.isElementInIframe(e)&&!m.domUtils.getIframeByElement(e);r&&!s||(e=null);var l=t!==e,a=l?m.domUtils.getCommonAncestor(t,e):null;this.setup(),l&&e&&this.leaveElement(t,e,a,n),Yo.isIE&&this.move(t,n),l&&m.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),Yo.isIE||this.move(t,n),this.dragAndDrop(i,t,e,n,o),this.teardown(t,n,e);var u=this.dragAndDropMode,c=this.dropAllowed;return this.dragAndDropMode=!1,this.dropAllowed=!1,{dragAndDropMode:u,dropAllowed:c}},Lo);function Lo(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var Ko=h.eventSandbox.eventSimulator,Xo=h.utils.extend,Vo=h.nativeMethods,Ro=(Wo.leaveElement=function(t,e,n,i){Ko.mouseout(e,Xo({relatedTarget:t},i));for(var o=e;o&&o!==n;)Ko.mouseleave(o,Xo({relatedTarget:t},i)),o=Vo.nodeParentNodeGetter.call(o)},Wo.enterElement=function(t,e,n,i){Ko.mouseover(t,Xo({relatedTarget:e},i));for(var o=t,r=[];o&&o!==n;)r.push(o),o=Vo.nodeParentNodeGetter.call(o);r.reverse();for(var s=0;s<r.length;s++)Ko.mouseenter(r[s],Xo({relatedTarget:e},i))},Wo.move=function(t,e,n){Ko[t](e,n)},Wo);function Wo(){}var Ho=(Go.dragAndDrop=function(t,e,n,i){return Ko.drag(t,i),e!==n&&(m.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,Ko.dragenter(e,i)),n&&(i.relatedTarget=e,Ko.dragleave(n,i))),!Ko.dragover(e,i)},Go);function Go(){}var zo,qo=h.eventSandbox.eventSimulator,jo=(e($o,zo=Fo),$o.prototype.leaveElement=function(t,e,n,i){Ro.leaveElement(t,e,n,i)},$o.prototype.enterElement=function(t,e,n,i){Ro.enterElement(t,e,n,i)},$o.prototype.move=function(t,e){this._needEmulateMoveEvent()&&Ro.move(this.moveEvent,t,e)},$o.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&m.domUtils.isElementInDocument(t)&&t!==n&&qo[this.moveEvent](t,e)},$o.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},$o);function $o(t){var e=zo.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var Zo,Jo=(e(Qo,Zo=Fo),Qo.prototype.setup=function(){Zo.prototype.setup.call(this),this.dragAndDropMode=!0},Qo.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=Ho.dragAndDrop(t,e,n,i)},Qo);function Qo(){return null!==Zo&&Zo.apply(this,arguments)||this}var tr,er=h.eventSandbox.eventSimulator,nr=(e(ir,tr=Fo),ir.prototype.setup=function(){tr.prototype.setup.call(this),this.dragAndDropMode=!0},ir.prototype.leaveElement=function(t,e,n,i){Ro.leaveElement(t,e,n,i)},ir.prototype.move=function(t,e){Ro.move(this.moveEvent,t,e)},ir.prototype.enterElement=function(t,e,n,i){Ro.enterElement(t,e,n,i)},ir.prototype.dragAndDrop=function(t,e,n,i,o){var r=er.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=Ho.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},ir.prototype.run=function(t,e,n,i,o){return tr.prototype.run.call(this,t,null,n,i,o)},ir);function ir(){return null!==tr&&tr.apply(this,arguments)||this}var or=null,rr=function(){return or},sr=function(t){or=t},lr=h.Promise,ar=h.nativeMethods,ur=h.utils.featureDetection,cr=h.utils.html,hr=h.utils.url,fr=h.eventSandbox.eventSimulator,dr=h.eventSandbox.message,mr=h.eventSandbox.DataTransfer,pr=h.eventSandbox.DragDataStore,vr=E.positionUtils,gr=E.domUtils,Er=E.styleUtils,yr=E.eventUtils,Sr=E.promiseUtils,br=E.sendRequestToFrame,Pr="automation|move|request",xr="automation|move|response";dr.on(dr.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===Pr&&(t.source.parent===Yu?_r.onMoveToIframeRequest(t):(h.on(h.EVENTS.beforeUnload,function(){return dr.sendServiceMsg({cmd:xr},t.source)}),_r.onMoveOutRequest(t)))});var _r=(Ar.getTarget=function(t,e,n){var i=!vr.containsOffset(t,e,n),o=i?s(t,e,n):{x:e,y:n};return{element:i?Fu.documentElement:t,offsetX:o.x,offsetY:o.y}},Ar.onMoveToIframeRequest=function(t){var e={x:t.message.endX,y:t.message.endY},n=t.source,i=gr.findIframeByWindow(n),o=Er.getBordersWidth(i),r=Er.getElementPadding(i),s=vr.getIframeClientCoordinates(i),l=vr.getIframePointRelativeToParentFrame(e,n),a=b.position,u=vr.isInRectangle(a,s)?a:Io(a,l,s),c={x:u.x-s.left,y:u.y-s.top},h=new Ar(i,new So({modifiers:t.message.modifiers,offsetX:c.x+o.left+r.left,offsetY:c.y+o.top+r.top,speed:t.message.speed,skipScrolling:!0},!1)),f={cmd:xr,x:c.x,y:c.y};b.activeWindow!==n?h.run().then(function(){b.activeWindow=n,dr.sendServiceMsg(f,n)}):dr.sendServiceMsg(f,n)},Ar.onMoveOutRequest=function(t){var e=t.source,n={left:t.message.left,right:t.message.right,top:t.message.top,bottom:t.message.bottom};if(!t.message.iframeUnderCursor){var i=t.message,o=i.startX,r=i.startY,s=o-n.left,l=r-n.top,a=rr();return a&&(fr.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),fr.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),void dr.sendServiceMsg({cmd:xr},e)}var u,c=b.position,h=Io({x:n.left+c.x,y:n.top+c.y},{x:t.message.endX,y:t.message.endY},n);h?(u=new So({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),new Ar(Fu.documentElement,u).run().then(function(){var t={cmd:xr,x:h.x,y:h.y};b.activeWindow=e,dr.sendServiceMsg(t,e)})):dr.sendServiceMsg({cmd:xr,x:n.left,y:n.top},e)},Ar.prototype._getTargetClientPoint=function(){var t=Er.getElementScroll(this.element);if(gr.isHtmlElement(this.element))return{x:Math.floor(this.offsetX-t.left),y:Math.floor(this.offsetY-t.top)};var e=vr.getClientPosition(this.element),n=this.element.tagName&&gr.isBodyElement(this.element);return{x:Math.floor(n?e.x+this.offsetX:e.x+this.offsetX-t.left),y:Math.floor(n?e.y+this.offsetY:e.y+this.offsetY-t.top)}},Ar.prototype._emulateEvents=function(t){var e,n,i=this.holdLeftButton?yr.BUTTONS_PARAMETER.leftButton:yr.BUTTONS_PARAMETER.noButton,o=p({x:this.x,y:this.y}),r={clientX:this.x,clientY:this.y,screenX:o.x,screenY:o.y,buttons:i,ctrl:this.modifiers.ctrl,alt:this.modifiers.alt,shift:this.modifiers.shift,meta:this.modifiers.meta,dataTransfer:this.dragAndDropState.dataTransfer},s={moveEvent:this.moveEvent,holdLeftButton:this.holdLeftButton},l=(e=this.dragAndDropState.enabled,n=this.firstMovingStepOccured,new(e?n?Jo:nr:jo)(s).run(t,rr(),r,this.dragElement,this.dragAndDropState.dataStore)),a=l.dragAndDropMode,u=l.dropAllowed;this.firstMovingStepOccured=!0,this.dragAndDropState.enabled=a,this.dragAndDropState.dropAllowed=u,sr(t)},Ar.prototype._movingStep=function(){var t,n=this;return this.touchMode&&!this.holdLeftButton?(this.x=this.endPoint.x,this.y=this.endPoint.y):this.startTime?(t=(Math.min(ar.dateNow(),this.endTime)-this.startTime)/(this.endTime-this.startTime),this.x=Math.floor(this.startPoint.x+this.distanceX*t),this.y=Math.floor(this.startPoint.y+this.distanceY*t)):(this.startTime=ar.dateNow(),this.endTime=this.startTime+this.movingTime,this.x+=0<this.distanceX?1:-1,this.y+=0<this.distanceY?1:-1),b.move(this.x,this.y).then(D).then(function(t){var e=n.holdLeftButton&&n.touchMode?n.dragElement:t;return e?n._emulateEvents(e):null}).then(No)},Ar.prototype._isMovingFinished=function(){return this.x===this.endPoint.x&&this.y===this.endPoint.y},Ar.prototype._move=function(){var t=this;return this.startPoint=b.position,this.x=this.startPoint.x,this.y=this.startPoint.y,this.distanceX=this.endPoint.x-this.startPoint.x,this.distanceY=this.endPoint.y-this.startPoint.y,this.movingTime=Math.max(Math.abs(this.distanceX),Math.abs(this.distanceY))/this.cursorSpeed,this.minMovingTime&&(this.movingTime=Math.max(this.movingTime,this.minMovingTime)),Sr.whilst(function(){return!t._isMovingFinished()},function(){return t._movingStep()})},Ar.prototype._scroll=function(){if(this.skipScrolling)return lr.resolve();var t=new uo({offsetX:this.offsetX,offsetY:this.offsetY},!1);return new f(this.element,t).run()},Ar.prototype._moveToCurrentFrame=function(){if(b.active)return lr.resolve();var t=b.position,e=t.x,n=t.y,i=b.activeWindow,o=null,r=null,s=null,l={cmd:Pr,startX:e,startY:n,endX:this.endPoint.x,endY:this.endPoint.y,modifiers:this.modifiers,speed:this.speed};return i.parent===Yu&&(o=gr.findIframeByWindow(i),s=vr.getIframeClientCoordinates(o),l.left=s.left,l.top=s.top,l.right=s.right,l.bottom=s.bottom),D().then(function(t){return r=t===o,i.parent===Yu&&(l.iframeUnderCursor=r),br(l,xr,i)}).then(function(t){return b.activeWindow=Yu,r||Yu.top!==Yu?b.move(t.x,t.y):null})},Ar.prototype.run=function(){var l=this;return D().then(function(t){l.dragElement=l.holdLeftButton?t:null;var e,n,i,o,r,s=function(t){for(var e=t;e;){if(e.draggable)return e;e=ar.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&ur.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new pr,l.dragAndDropState.dataTransfer=new mr(l.dragAndDropState.dataStore),((e=gr.isAnchorElement(l.dragElement))||gr.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=hr.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=cr.cleanUpHtml(ar.elementOuterHTMLGetter.call(l.dragElement)),l.dragAndDropState.dataTransfer.setData("text/plain",o),l.dragAndDropState.dataTransfer.setData("text/uri-list",o),l.dragAndDropState.dataTransfer.setData("text/html",r))),l._scroll()}).then(function(){var t=l._getTargetClientPoint(),e=t.x,n=t.y,i=Er.getWidth(Yu),o=Er.getHeight(Yu);return 0<=e&&e<=i&&0<=n&&n<=o?(l.endPoint={x:e,y:n},l._moveToCurrentFrame().then(function(){return l._move()})):null}).then(function(){return l.dragAndDropState})},Ar);function Ar(t,e){this.touchMode=ur.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.holdLeftButton=e.holdLeftButton,this.dragElement=null,this.dragAndDropState=new Oo,this.automationSettings=new k(e.speed);var n=Ar.getTarget(t,e.offsetX,e.offsetY);this.element=n.element,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=e.speed,this.cursorSpeed=this.holdLeftButton?this.automationSettings.draggingSpeed:this.automationSettings.cursorSpeed,this.minMovingTime=e.minMovingTime||null,this.modifiers=e.modifiers||{},this.skipScrolling=e.skipScrolling,this.skipDefaultDragBehavior=e.skipDefaultDragBehavior,this.endPoint=null,this.movingTime=null,this.x=null,this.y=null,this.startTime=null,this.endTime=null,this.distanceX=null,this.distanceY=null,this.firstMovingStepOccured=!1}var Cr,wr=h.utils.extend,Tr=function(t){var e=t.element,n=void 0===e?null:e,i=t.clientPoint,o=void 0===i?null:i,r=t.screenPoint,s=void 0===r?null:r,l=t.isTarget,a=void 0!==l&&l,u=t.inMoving,c=void 0!==u&&u;this.element=n,this.clientPoint=o,this.screenPoint=s,this.isTarget=a,this.inMoving=c,this.devicePoint=p(o)},Mr=(e(Ur,Cr=m.serviceUtils.EventEmitter),Ur.prototype._getElementForEvent=function(t){var e=t.point;return U(e.x,e.y,m.positionUtils.containsOffset(this.element,this.options.offsetX,this.options.offsetY)?this.element:null).then(function(t){return t.element})},Ur.prototype._moveToElement=function(){var t=this,e=new So(wr({skipScrolling:!0},this.options),!1);return new _r(this.element,e).run().then(function(){return m.delay(t.automationSettings.mouseActionStepDelay)})},Ur.prototype._scrollToElement=function(){var s=this,t=new uo(this.options),e=new f(this.element,t),l=!1;return e.run().then(function(t){return l=t,m.delay(s.automationSettings.mouseActionStepDelay)}).then(D).then(function(t){if(!t||!m.domUtils.contains(s.element,t)||!l)return null;var e=rr(),n=m.domUtils.getCommonAncestor(t,e),i=m.positionUtils.getClientPosition(t),o=p({x:i.x,y:i.y}),r={clientX:i.x,clientY:i.y,screenX:o.x,screenY:o.y,ctrl:!1,alt:!1,shift:!1,meta:!1,buttons:m.eventUtils.BUTTONS_PARAMETER.leftButton};return Ro.leaveElement(t,e,n,r),Ro.enterElement(t,e,n,r),sr(t),l})},Ur.prototype._getElementOffset=function(){var t=g(this.element),e=this.options,n=e.offsetX,i=e.offsetY;return{offsetX:n=n||0===n?n:t.offsetX,offsetY:i=i||0===i?i:t.offsetY}},Ur.prototype._wrapAction=function(t){var h=this,e=this._getElementOffset(),i=e.offsetX,o=e.offsetY,f=s(this.element,i,o),d=m.positionUtils.getClientPosition(this.element);return t().then(function(){var t,e,n,l=s(h.element,i,o),a=m.positionUtils.getClientPosition(h.element),u=(t=h.element,e=l,n=m.styleUtils.getElementScroll(t),!/html/i.test(t.tagName)&&m.styleUtils.hasScroll(t)&&(e.x-=n.left,e.y-=n.top),m.positionUtils.offsetToClientCoords(e)),c=m.positionUtils.containsOffset(h.element,i,o)?h.element:null;return U(u.x,u.y,c).then(function(t){var e=t.element,n=t.corrected,i=e;if(!i)return new Tr({});var o=(o=!c||n||i===h.element)||-1<m.arrayUtils.indexOf(m.domUtils.getParents(i),h.element),r=f.x!==l.x||f.y!==l.y,s=d.x!==a.x||d.y!==a.y;return new Tr({element:e,clientPoint:u,screenPoint:l,isTarget:o,inMoving:r&&s})})})},Ur._checkElementState=function(t,e){if(!t.element)throw new Error(I.elementIsInvisibleError);if(e&&(!t.isTarget||t.inMoving))throw new Error(I.foundElementIsNotTarget)},Ur.prototype._ensureElement=function(e,n){var i=this;return this._wrapAction(function(){return i._scrollToElement()}).then(function(t){return Ur._checkElementState(t,e)}).then(function(){return i._wrapAction(function(){return i._moveToElement()})}).then(function(t){return n||Ur._checkElementState(t,e),t}).then(function(t){return i.emit(i.TARGET_ELEMENT_FOUND_EVENT,{element:t.element}),{element:t.element,clientPoint:t.clientPoint,screenPoint:t.screenPoint,devicePoint:t.devicePoint}})},Ur);function Ur(t,e){var n=Cr.call(this)||this;return n.TARGET_ELEMENT_FOUND_EVENT="automation|target-element-found-event",n.element=t,n.options=e,n.automationSettings=new k(e.speed),n}var Dr=h.Promise,Ir=h.nativeMethods,kr=h.utils.browser,Br=h.eventSandbox.focusBlur,Nr=E.contentEditable,Or=E.textSelection,Yr=E.domUtils,Fr=E.styleUtils;function Lr(p,v,g){return new Dr(function(s){var t,l=Yr.getActiveElement(),e=Yr.isTextEditableElement(p),n=Yr.closest(p,"label[for]"),i=Yr.isElementFocusable(p),o=!i&&n,a=Yr.isContentEditableElement(p),r=a?Nr.findContentEditableParent(p):p;if(v&&kr.isWebKit&&e&&Or.select(p,0,0),o)return v&&(t=n,Yr.isElementFocusable(t)?Br.focus(t,E.noop,!1,!0):Xr(t)),void s();var u=!v,c=!1;if(!i&&!a){var h=Yr.findDocument(r),f=Ir.documentActiveElementGetter.call(h),d=Yr.isBodyElement(f),m=Yr.isBodyElement(r)?r:Yr.getFocusableParent(r);if(f&&!d&&Yr.containsElement(f,r)||d&&Yr.isBodyElement(m))return void s();r=m||h.body,c=!0}Br.focus(r,function(){var t,e,n,i,o,r;!v||a||p===Yr.getActiveElement()?(t=p,e=g,o=Yr.isTextEditableElement(t),r=Yr.isContentEditableElement(t),o||r?r&&isNaN(parseInt(e,10))?Or.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?Yr.getElementValue(t).length:e,Or.select(t,n,n)):(i=Nr.findContentEditableParent(t))&&Or.setCursorToLastVisiblePosition(Nr.findContentEditableParent(i)),v||Yr.getActiveElement()===l?s():Br.focus(l,s,!0,!0)):s()},u,!0,!1,c)})}function Kr(t){var e=Yr.closest(t,"label[for]"),n=e&&(e.control||Fu.getElementById(e.htmlFor));return n&&Fr.isElementVisible(n)?n:null}function Xr(t){var e=Kr(t);e&&Yr.getActiveElement()!==e&&Br.focus(e,E.noop,!1,!0)}var Vr=h.utils.browser,Rr=h.eventSandbox.eventSimulator,Wr=h.eventSandbox.listeners,Hr=E.domUtils,Gr=E.styleUtils,zr=o.selectElement,qr=(jr.prototype.run=function(){this.eventState.clickElement&&Rr.click(this.eventState.clickElement,this.eventArgs.options),Hr.isElementFocusable(this.eventArgs.element)||Xr(this.eventArgs.element)},jr);function jr(t,e){this.eventState=t,this.eventArgs=e}var $r,Zr=(e(Jr,$r=qr),Jr.prototype.run=function(){function t(t){n=t.target===e.input}var e=this,n=!1;Wr.addInternalEventListener(Yu,["focus"],t),$r.prototype.run.call(this),Wr.removeInternalEventListener(Yu,["focus"],t),Hr.isElementFocusable(this.label)&&!n&&this._ensureBoundElementFocusRaised()},Jr.prototype._ensureBoundElementFocusRaised=function(){Rr.focus(this.input)},Jr);function Jr(t,e){var n=$r.call(this,t,e)||this;return n.label=n.eventArgs.element,n.input=Kr(n.eventArgs.element),n}var Qr,ts=(e(es,Qr=qr),es.prototype.run=function(){Qr.prototype.run.call(this),this._toggleSelectOptionList()},es.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===Gr.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(zr.isOptionListExpanded(t)?zr.collapseOptionList():zr.expandOptionList(t))},es);function es(t,e){return Qr.call(this,t,e)||this}var ns,is=(e(os,ns=qr),os.prototype.run=function(){return this.eventArgs.element},os);function os(t,e){return ns.call(this,t,e)||this}var rs,ss=(e(ls,rs=Zr),ls.prototype.run=function(){function t(){e=!0}var e=!1;Wr.addInternalEventListener(Yu,["change"],t),rs.prototype.run.call(this),Wr.removeInternalEventListener(Yu,["change"],t),Vr.isChrome&&!e&&this._ensureCheckboxStateChanged()},ls.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,Rr.change(this.checkbox)},ls);function ls(t,e){var n=rs.call(this,t,e)||this;return n.checkbox=n.input,n}var as,us=h.Promise,cs=h.utils.extend,hs=h.utils.browser,fs=h.utils.featureDetection,ds=h.eventSandbox.eventSimulator,ms=h.eventSandbox.listeners,ps=E.domUtils,vs=E.eventUtils,gs=E.arrayUtils,Es=E.delay,ys=(e(Ss,as=Mr),Ss.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,vs.preventDefault(t),vs.unbind(e.element,"mousedown",n)};vs.bind(this.element,"mousedown",n)},Ss.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,vs.unbind(t,"blur",n,!0)};vs.bind(t,"blur",n,!0)},Ss.prototype._raiseTouchEvents=function(t){fs.isTouchDevice&&(ds.touchstart(t.element,t.options),ds.touchend(t.element,t.options))},Ss.prototype._mousedown=function(n){var i=this;return this.targetElementParentNodes=ps.getParents(n.element),this.mouseDownElement=n.element,b.leftButtonDown().then(function(){i._raiseTouchEvents(n);var t=ps.getActiveElement();i.activeElementBeforeMouseDown=t;var e=(hs.isWebKit||hs.isIE)&&ps.isSelectElement(i.mouseDownElement);return e&&i._bindMousedownHandler(),i._bindBlurHandler(t),i.eventState.simulateDefaultBehavior=ds.mousedown(n.element,n.options),!1===i.eventState.simulateDefaultBehavior&&(i.eventState.simulateDefaultBehavior=e&&!i.eventState.mousedownPrevented),i._ensureActiveElementBlur(t)}).then(function(){return i._focus(n)})},Ss.prototype._ensureActiveElementBlur=function(e){var n=this;return new us(function(t){ps.getActiveElement()===e||n.eventState.blurRaised?t():hs.isIE&&hs.version<12?No().then(function(){n.eventState.blurRaised||ds.blur(e),t()}):(ds.blur(e),t())})},Ss.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?us.resolve():Lr(ps.isContentEditableElement(this.element)?this.element:t.element,!hs.isIE||this.activeElementBeforeMouseDown===ps.getActiveElement(),this.caretPos)},Ss._getElementForClick=function(t,e,n){var i=ps.getParents(e),o=ps.isTheSameNode(e,t);return hs.isFirefox?o?t:null:o?gs.equals(n,i)?t:null:t.contains(e)&&!ps.isEditableFormElement(e)?t:e.contains(t)?e:gs.getCommonElement(i,n)},Ss.prototype._mouseup=function(i){var o=this;return b.buttonUp().then(function(){return o._getElementForEvent(i)}).then(function(t){i.element=t,o.eventState.clickElement=Ss._getElementForClick(o.mouseDownElement,t,o.targetElementParentNodes);var e={},n=function(t){e=t.timeStamp,ms.removeInternalEventListener(Yu,["mouseup"],n)};return hs.isIE||ms.addInternalEventListener(Yu,["mouseup"],n),ds.mouseup(t,i.options),{timeStamp:e}})},Ss.prototype._click=function(t){var e,n,i,o,r,s,l;return e=this.eventState,i=Kr((n=t).element),o=Hr.isSelectElement(n.element),r=Hr.isOptionElement(n.element),s=Hr.isLabelElement(n.element)&&i,l=i&&Hr.isCheckboxElement(i),new(o?ts:r?is:l?ss:s?Zr:qr)(e,n).run(),t},Ss.prototype.run=function(t){var r=this,s=null;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.screenPoint,o=t.devicePoint;return s={point:n,screenPoint:i,element:e,options:cs({clientX:n.x,clientY:n.y,screenX:o.x,screenY:o.y},r.modifiers)},us.all([Es(r.automationSettings.mouseActionStepDelay),r._mousedown(s)])}).then(function(){return r._mouseup(s)}).then(function(t){var e=t.timeStamp;return s.options.timeStamp=e,r._click(s)})},Ss);function Ss(t,e){var n=as.call(this,t,e)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.targetElementParentNodes=[],n.activeElementBeforeMouseDown=null,n.mouseDownElement=null,n.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null},n}var bs=h.Promise,Ps=h.utils.browser,xs=h.utils.featureDetection,_s=h.eventSandbox.eventSimulator,As=h.eventSandbox.focusBlur,Cs=h.nativeMethods,ws=E.domUtils,Ts=E.styleUtils,Ms=E.delay,Us=o.selectElement,Ds=xs.isTouchDevice?0:160,Is=(ks.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?Us.getEmulatedChildElement(this.element):this.element,e=1<Ts.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Ps.isIE&&e?this.parentSelect:t}},ks.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=v(n=Us.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=Fu.documentElement,i=(e=Us.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},ks.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new So({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return new _r(n,s).run().then(function(){return Ms(e.automationSettings.mouseActionStepDelay)})},ks.prototype._mousedown=function(){var t=this;return Ps.isFirefox?(_s.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Ps.isIE?(_s.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Ms(Ds)}).then(function(){_s.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},ks.prototype._focus=function(){var e=this;return new bs(function(t){As.focus(e.parentSelect,t,!1,!0)})},ks.prototype._mouseup=function(){var t=Ps.isIE?this.parentSelect:this.eventsArgs.element;_s.mouseup(t,this.eventsArgs.options),Ps.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=Ps.isFirefox||Ps.isSafari||Ps.isChrome&&53<=Ps.version,n=e||Ps.isIE;return e&&this.clickCausesChange&&_s.input(this.parentSelect),n&&this.clickCausesChange&&_s.change(this.parentSelect),bs.resolve()},ks.prototype._click=function(){_s.click(this.eventsArgs.element,this.eventsArgs.options)},ks.prototype.run=function(){var t=this;if(!this.parentSelect)return _s.click(this.eventsArgs.element,this.eventsArgs.options),bs.resolve();this.optionListExpanded||Us.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Ts.getSelectElementSize(this.parentSelect)<=1?this._move(e).then(function(){return t._click()}):this._move(e).then(function(){return t._mousedown()}).then(function(){return t._mouseup()}).then(function(){return t._click()})},ks);function ks(t,e){var n,i,o,r,s;this.element=t,this.modifiers=e.modifiers,this.caretPos=e.caretPos,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.speed=e.speed,this.automationSettings=new k(e.speed),this.parentSelect=ws.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&Us.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=ws.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=ws.getElementIndexInParent(this.parentSelect,this.element),o=Cs.nodeParentNodeGetter.call(this.element),r=ws.isOptionGroupElement(o)?o:null,s=this.element.disabled||r&&r.disabled,this.clickCausesChange=n&&!s&&this.childIndex!==i),this.eventsArgs={options:this.modifiers,element:this.element}}var Bs,Ns=h.utils.featureDetection,Os=h.utils.browser,Ys=h.eventSandbox.eventSimulator,Fs=E.eventUtils,Ls=E.delay,Ks=Ns.isTouchDevice?0:160,Xs=(e(Vs,Bs=Mr),Vs.prototype._firstClick=function(t){var e=this,n=new go(this.options);n.speed=1;var i=new ys(this.element,n);return i.on(i.TARGET_ELEMENT_FOUND_EVENT,function(t){return e.emit(e.TARGET_ELEMENT_FOUND_EVENT,t)}),i.run(t).then(function(t){return Ls(Ks).then(function(){return t})})},Vs.prototype._secondClick=function(t){var e=this;Os.isIE&&Fs.bind(Fu,"focus",Fs.preventDefault,!0);var n=new go({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new ys(Fu.documentElement,n);return i.run().then(function(t){return e.eventState.dblClickElement=i.eventState.clickElement,Os.isIE&&Fs.unbind(Fu,"focus",Fs.preventDefault,!0),t})},Vs.prototype._dblClick=function(t){this.eventState.dblClickElement&&Ys.dblclick(this.eventState.dblClickElement,t.options)},Vs.prototype.run=function(t){var e=this;return this._firstClick(t).then(function(t){return e._secondClick(t)}).then(function(t){return e._dblClick(t)})},Vs);function Vs(t,e){var n=Bs.call(this,t,e)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new k(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var Rs,Ws=h.Promise,Hs=h.utils.extend,Gs=h.utils.featureDetection,zs=h.eventSandbox.eventSimulator,qs=h.eventSandbox.focusBlur,js=(e($s,Rs=Mr),$s.prototype._getEndPoint=function(){throw new Error("Not implemented")},$s.prototype._mousedown=function(t){var e=this;return b.leftButtonDown().then(function(){return e.simulateDefaultBehavior=zs[e.downEvent](t.element,t.options),e._focus(t)})},$s.prototype._focus=function(n){var i=this;return new Ws(function(t){var e=m.domUtils.isContentEditableElement(i.element)?m.contentEditable.findContentEditableParent(i.element):n.element;qs.focus(e,t,!1,!0)})},$s.prototype._getDestination=function(){throw new Error("Not implemented")},$s.prototype._drag=function(){var e=this,t=this._getDestination(),n=t.element,i=t.offsets,o=t.endPoint;this.endPoint=o;var r=new So({offsetX:i.offsetX,offsetY:i.offsetY,modifiers:this.modifiers,speed:this.speed,minMovingTime:25,holdLeftButton:!0,skipDefaultDragBehavior:!1===this.simulateDefaultBehavior},!1);return new _r(n,r).run().then(function(t){return e.dragAndDropState=t,m.delay(e.automationSettings.mouseActionStepDelay)})},$s.prototype._mouseup=function(){var r=this;return b.buttonUp().then(function(){var n=m.positionUtils.offsetToClientCoords(r.endPoint),i=null,o=Hs({clientX:n.x,clientY:n.y},r.modifiers);return U(n.x,n.y).then(function(t){var e=t.element;return(i=e)?(r.dragAndDropState.enabled?(o.dataTransfer=r.dragAndDropState.dataTransfer,r.dragAndDropState.dropAllowed&&zs.drop(i,o),zs.dragend(r.dragAndDropState.element,o),r.dragAndDropState.dataStore.setProtectedMode()):zs[r.upEvent](i,o),U(n.x,n.y)):i}).then(function(t){var e=t.element;i&&e===i&&!r.dragAndDropState.enabled&&zs.click(i,o)})})},$s.prototype.run=function(t){var i=this,o=null;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint;return o={point:n,element:e,options:Hs({clientX:n.x,clientY:n.y},i.modifiers)},Ws.all([m.delay(i.automationSettings.mouseActionStepDelay),i._mousedown(o)])}).then(function(){return i._drag()}).then(function(){return i._mouseup()})},$s);function $s(t,e){var n=Rs.call(this,t,e)||this;return n.modifiers=e.modifiers,n.speed=e.speed,n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=Gs.isTouchDevice?"touchstart":"mousedown",n.upEvent=Gs.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var Zs,Js=E.styleUtils,Qs=(e(tl,Zs=js),tl.prototype._getDestination=function(){var t=s(this.element,this.offsetX,this.offsetY),e=Js.getWidth(Fu),n=Js.getHeight(Fu),i={x:t.x+this.dragOffsetX,y:t.y+this.dragOffsetY},i={x:Math.min(Math.max(0,i.x),e),y:Math.min(Math.max(0,i.y),n)};retu