UNPKG

@browserstack/testcafe

Version:

Automated browser testing for the modern web development stack.

1 lines 50.3 kB
!function Mi(Ai,Vi){var Oi=Ai.document;!function(c){var d="default"in c?c.default:c,e=d.utils.browser,t={alt:18,ctrl:17,meta:91,shift:16},n={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=","{":"[","}":"]",":":";",'"':"'","|":"\\","<":",",">":".","?":"/","±":"§"},o={backspace:8,capslock:20,delete:46,down:40,end:35,enter:13,esc:27,home:36,ins:45,left:37,pagedown:34,pageup:33,right:39,space:32,tab:9,up:38},r={left:e.isIE?"Left":"ArrowLeft",down:e.isIE?"Down":"ArrowDown",right:e.isIE?"Right":"ArrowRight",up:e.isIE?"Up":"ArrowUp",backspace:"Backspace",capslock:"CapsLock",delete:"Delete",end:"End",enter:"Enter",esc:"Escape",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:e.isIE?"Spacebar":" ",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"};function i(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}var l={modifiers:t,shiftMap:n,specialKeys:o,keyProperty:r,modifiersMap:{option:"alt"},symbolCharCodeToKeyCode:{96:192,91:219,93:221,92:220,59:186,39:222,44:188,45:e.isFirefox?173:189,46:190,47:191},symbolKeysCharCodes:{109:45,173:45,186:59,187:61,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39,110:46,96:48,97:49,98:50,99:51,100:52,101:53,102:54,103:55,104:56,105:57,107:43,106:42,111:47},reversedModifiers:i(t),reversedShiftMap:i(n),reversedSpecialKeys:i(o),reversedKeyProperty:i(r)},a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function s(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=d.Promise,f=d.nativeMethods;function h(t){return new u(function(e){return f.setTimeout.call(Ai,e,t)})}var m=Array.prototype.indexOf,p=Array.prototype.forEach,g=Array.prototype.some,v=Array.prototype.map,E=Array.prototype.filter,y=Array.prototype.reverse,b=Array.prototype.reduce,w=Array.prototype.splice;function S(e,t){for(var n=e.length,o=0;o<n;o++)if(t(e[o],o,e))return e[o];return null}function T(e,t){return m.call(e,t)}function C(e,t){return g.call(e,t)}function x(e,t){return v.call(e,t)}function I(e,t){return E.call(e,t)}function _(e,t,n){return b.call(e,t,n)}function N(e,t){var n=T(e,t);-1<n&&w.call(e,n,1)}var P=Object.freeze({__proto__:null,toArray:function(e){for(var t=[],n=e.length,o=0;o<n;o++)t.push(e[o]);return t},reverse:function(e){return y.call(e)},isArray:function(e){return"[object Array]"===d.nativeMethods.objectToString.call(e)},find:S,indexOf:T,forEach:function(e,t){p.call(e,t)},some:C,map:x,filter:I,reduce:_,remove:N,equals:function(e,t){if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!1;return!0},getCommonElement:function(e,t){for(var n=0;n<e.length;n++)for(var o=0;o<t.length;o++)if(e[n]===t[o])return e[n];return null}});function R(){this.eventsListeners=[]}R.prototype.emit=function(e){var t=this.eventsListeners[e];if(t)for(var n=0;n<t.length;n++)try{t[n]&&t[n].apply(this,Array.prototype.slice.apply(arguments,[1]))}catch(e){if(!(e.message&&-1<e.message.indexOf("freed script")))throw e;t[n]=null}},R.prototype.off=function(e,t){var n=this.eventsListeners[e];n&&(this.eventsListeners[e]=I(n,function(e){return e!==t}))},R.prototype.on=function(e,t){this.eventsListeners[e]||(this.eventsListeners[e]=[]),this.eventsListeners[e].push(t)},R.prototype.once=function(n,o){var r=this;this.on(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.off(n,o),o.apply(void 0,e)})};var M,A=Object.freeze({__proto__:null,inherit:function(e,t){function n(){}n.prototype=t.prototype,d.utils.extend(e.prototype,new n),(e.prototype.constructor=e).base=t.prototype},EventEmitter:R}),V=d.Promise,O=d.nativeMethods,L="requests-finished",F=(s(q,M=R),q.prototype._init=function(){function e(e){return r._onXhrSend(e.xhr)}function t(e){return r._onRequestCompleted(e.xhr)}function n(e){return r._onRequestError(e.xhr,e.err)}function o(e){return r._onFetchSend(e)}var r=this;d.on(d.EVENTS.beforeXhrSend,e),d.on(d.EVENTS.xhrCompleted,t),d.on(d.EVENTS.xhrError,n),d.on(d.EVENTS.fetchSent,o),this._unbindHandlers=function(){d.off(d.EVENTS.beforeXhrSend,e),d.off(d.EVENTS.xhrCompleted,t),d.off(d.EVENTS.xhrError,n),d.off(d.EVENTS.fetchSent,o)}},q.prototype._onXhrSend=function(e){this.collectingReqs&&this.requests.push(e)},q.prototype._onRequestCompleted=function(e){var t=this;h(this.delays.additionalRequestsCollection).then(function(){return t._onRequestFinished(e)})},q.prototype._onRequestError=function(e){this._onRequestFinished(e)},q.prototype._onRequestFinished=function(e){-1<T(this.requests,e)&&(N(this.requests,e),this.collectingReqs||this.requests.length||this.emit(L))},q.prototype._onFetchSend=function(e){var t=this;this.collectingReqs&&(this.requests.push(e),e.then(function(){return t._onRequestCompleted(e)}).catch(function(){return t._onRequestError(e)}))},q.prototype.wait=function(e){var n=this;return new V(function(t){h(e?n.delays.pageInitialRequestsCollection:n.delays.requestsCollection).then(function(){function e(){n.watchdog&&O.clearTimeout.call(Ai,n.watchdog),n._unbindHandlers(),t()}n.collectingReqs=!1,n.requests.length?(n.watchdog=O.setTimeout.call(Ai,e,n.BARRIER_TIMEOUT),n.on(L,e)):e()})})},q);function q(e){void 0===e&&(e={});var t=M.call(this)||this;return t.BARRIER_TIMEOUT=3e3,t.delays={requestsCollection:void 0===e.requestsCollection?50:e.requestsCollection,additionalRequestsCollection:void 0===e.additionalRequestsCollection?50:e.additionalRequestsCollection,pageInitialRequestsCollection:void 0===e.pageInitialRequestsCollection?50:e.pageInitialRequestsCollection},t.collectingReqs=!0,t.requests=[],t.watchdog=null,t._unbindHandlers=null,t._init(),t}F.GLOBAL_REQUEST_BARRIER_FIELD="testcafe|request-barrier",Ai[F.GLOBAL_REQUEST_BARRIER_FIELD]=F;var H=d.utils.browser,k=d.nativeMethods,W=d.utils.style.get,B=d.utils.dom.getActiveElement,D=d.utils.dom.findDocument,G=d.utils.dom.isElementInDocument,U=d.utils.dom.isElementInIframe,j=d.utils.dom.getIframeByElement,z=d.utils.dom.isCrossDomainWindows,K=d.utils.dom.getSelectParent,Y=d.utils.dom.getChildVisibleIndex,X=d.utils.dom.getSelectVisibleChildren,$=d.utils.dom.isElementNode,J=d.utils.dom.isTextNode,Q=d.utils.dom.isRenderedNode,Z=d.utils.dom.isIframeElement,ee=d.utils.dom.isInputElement,te=d.utils.dom.isButtonElement,ne=d.utils.dom.isFileInput,oe=d.utils.dom.isTextAreaElement,re=d.utils.dom.isAnchorElement,ie=d.utils.dom.isImgElement,le=d.utils.dom.isFormElement,ae=d.utils.dom.isLabelElement,se=d.utils.dom.isSelectElement,ue=d.utils.dom.isRadioButtonElement,ce=d.utils.dom.isColorInputElement,de=d.utils.dom.isCheckboxElement,fe=d.utils.dom.isOptionElement,he=d.utils.dom.isSVGElement,me=d.utils.dom.isMapElement,pe=d.utils.dom.isBodyElement,ge=d.utils.dom.isHtmlElement,ve=d.utils.dom.isDocument,Ee=d.utils.dom.isWindow,ye=d.utils.dom.isTextEditableInput,be=d.utils.dom.isTextEditableElement,we=d.utils.dom.isTextEditableElementAndEditingAllowed,Se=d.utils.dom.isContentEditableElement,Te=d.utils.dom.isDomElement,Ce=d.utils.dom.isShadowUIElement,xe=d.utils.dom.isElementFocusable,Ie=d.utils.dom.isHammerheadAttr,_e=d.utils.dom.isElementReadOnly,Ne=d.utils.dom.getScrollbarSize,Pe=d.utils.dom.getMapContainer,Re=d.utils.dom.getTagName,Me=d.utils.dom.closest,Ae=d.utils.dom.getParents,Ve=d.utils.dom.findParent,Oe=d.utils.dom.getTopSameDomainWindow;function Le(e){return I(e,function(e){return 0<e.tabIndex})}function Fe(e){return I(e,function(e){return e.tabIndex<=0})}function qe(e){if(!e||!e.length)return[];var t=Le(e),n=I(e,function(e){return Z(e)});if(!t.length)return n.length&&(e=He(e,n)),e;t=t.sort(ke("tabIndex"));var o=Fe(e);return n.length?He(t,n).concat(He(o,n)):t.concat(o)}function He(e,t){for(var n,o,r,i,l,a=(o=Le(n=t)).length?o.sort(ke("tabIndex")).concat(Fe(n)):n,s=[],u=[],c=[],d=0,d=0;d<a.length;d++){try{c=We(k.contentDocumentGetter.call(a[d]))}catch(e){c=[]}u.push(qe(c))}for(d=0;d<e.length;d++)s.push(e[d]),Z(e[d])&&(s=H.isIE?(s.pop(),l=Le(r=u[T(t,e[d])]),i=Fe(r),l=l.sort(ke("tabIndex")),(s=s.concat(l)).push(e[d]),s.concat(i)):(H.isWebKit&&u[T(t,e[d])].length&&s.pop(),s.concat(u[T(t,e[d])])));return s}function ke(n){return function(e,t){return e[n]<t[n]?-1:e[n]>t[n]?1:0}}function We(e,t){void 0===t&&(t=!1);for(var n=e.querySelectorAll("*"),o=function(e){for(var t=[],n=0;n<e.length;n++)"none"===W(e[n],"display")&&t.push(e[n]);return t}(n),r=/^(input|button|select|textarea)$/,i=[],l=null,a=null,s=null,u=!1,c=0;c<n.length;c++){var d,l=n[c],a=Re(l),s=function(e){var t=e.getAttribute("tabIndex");return null!==t&&(t=parseInt(t,10),t=isNaN(t)?null:t),t}(l),u=!1;l.disabled||"none"!==W(l,"display")&&"hidden"!==W(l,"visibility")&&((H.isIE||H.isAndroid)&&fe(l)||null!==s&&s<0||(r.test(a)?u=!0:H.isIE&&Z(l)?i.push(l):re(l)&&l.hasAttribute("href")&&(u=""!==l.getAttribute("href")||!H.isIE||null!==s),""!==(d=l.getAttribute("contenteditable"))&&"true"!==d||(u=!0),null!==s&&(u=!0),u&&i.push(l)))}var f=I(i,function(e){return!Be(o,e)});return t&&(f=qe(f)),f}function Be(e,t){return e.contains?e.contains(t):C(e,function(e){return e.contains(t)})}function De(e,t){if(Ge(t,e))return!0;for(var n=k.nodeChildNodesGetter.call(e),o=Ke(n),r=0;r<o;r++){var i=n[r];if(!Ce(i)&&De(i,t))return!0}return!1}function Ge(e,t){return e&&t&&e.isSameNode?e.isSameNode(t):e===t}function Ue(t){if(!t.setTimeout)return!1;var e=null;try{e=t.frameElement}catch(e){return!!t.top}return!(!H.isFirefox&&!H.isWebKit||t.top===t||e)||!(!e||!k.contentDocumentGetter.call(e))}function je(e){try{return e.top===e}catch(e){return!1}}function ze(e,t){for(var n=(t||Ai).document.getElementsByTagName("iframe"),o=0;o<n.length;o++)if(k.contentWindowGetter.call(n[o])===e)return n[o];return null}function Ke(e){return k.nodeListLengthGetter.call(e)}function Ye(e){return k.inputValueGetter.call(e)}function Xe(e){return k.textAreaValueGetter.call(e)}function $e(e,t){return k.inputValueSetter.call(e,t)}function Je(e,t){return k.textAreaValueSetter.call(e,t)}function Qe(e){return ee(e)?Ye(e):oe(e)?Xe(e):e.value}function Ze(e){return e&&e.getRootNode&&D(e)!==e.getRootNode()}var et=Object.freeze({__proto__:null,getActiveElement:B,findDocument:D,isElementInDocument:G,isElementInIframe:U,getIframeByElement:j,isCrossDomainWindows:z,getSelectParent:K,getChildVisibleIndex:Y,getSelectVisibleChildren:X,isElementNode:$,isTextNode:J,isRenderedNode:Q,isIframeElement:Z,isInputElement:ee,isButtonElement:te,isFileInput:ne,isTextAreaElement:oe,isAnchorElement:re,isImgElement:ie,isFormElement:le,isLabelElement:ae,isSelectElement:se,isRadioButtonElement:ue,isColorInputElement:ce,isCheckboxElement:de,isOptionElement:fe,isSVGElement:he,isMapElement:me,isBodyElement:pe,isHtmlElement:ge,isDocument:ve,isWindow:Ee,isTextEditableInput:ye,isTextEditableElement:be,isTextEditableElementAndEditingAllowed:we,isContentEditableElement:Se,isDomElement:Te,isShadowUIElement:Ce,isElementFocusable:xe,isHammerheadAttr:Ie,isElementReadOnly:_e,getScrollbarSize:Ne,getMapContainer:Pe,getTagName:Re,closest:Me,getParents:Ae,findParent:Ve,getTopSameDomainWindow:Oe,getFocusableElements:We,containsElement:Be,getTextareaIndentInLine:function(e,t){var n=Xe(e);if(!n)return 0;var o=n.substring(0,t);return t-(-1===o.lastIndexOf("\n")?0:o.lastIndexOf("\n")+1)},getTextareaLineNumberByPosition:function(e,t){for(var n=Xe(e).split("\n"),o=0,r=0,i=0;o<=t;i++){if(t<=o+n[i].length){r=i;break}o+=n[i].length+1}return r},getTextareaPositionByLineAndOffset:function(e,t,n){for(var o=Xe(e).split("\n"),r=0,i=0;i<t;i++)r+=o[i].length+1;return r+n},blocksImplicitSubmission:function(e){return(H.isSafari?/^(text|password|color|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:H.isFirefox?/^(text|password|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:H.isIE?/^(text|password|color|date|time|datetime|datetime-local|email|file|month|number|search|tel|url|week|image)$/i:/^(text|password|datetime|email|number|search|tel|url|image)$/i).test(e.type)},isEditableElement:function(e,t){return t?we(e)||Se(e):be(e)||Se(e)},isElementContainsNode:De,isOptionGroupElement:function(e){return"[object HTMLOptGroupElement]"===d.utils.dom.instanceToString(e)},getElementIndexInParent:function(e,t){return T(e.querySelectorAll(Re(t)),t)},isTheSameNode:Ge,getElementDescription:function(e){var t,n={id:"id",name:"name",class:"className"},o=[];for(var r in o.push("<"),o.push(Re(e)),n)!n.hasOwnProperty(r)||(t=e[n[r]])&&o.push(" "+r+'="'+t+'"');return o.push(">"),o.join("")},getFocusableParent:function(e){for(var t=Ae(e),n=0;n<t.length;n++)if(xe(t[n]))return t[n];return null},remove:function(e){e&&e.parentElement&&e.parentElement.removeChild(e)},isIFrameWindowInDOM:Ue,isTopWindow:je,findIframeByWindow:ze,isEditableFormElement:function(e){return be(e)||se(e)},getCommonAncestor:function(e,t){if(Ge(e,t))return e;for(var n=[e].concat(Ae(e)),o=t;o;){if(-1<T(n,o))return o;o=k.nodeParentNodeGetter.call(o)}return o},getChildrenLength:function(e){return k.htmlCollectionLengthGetter.call(e)},getChildNodesLength:Ke,getInputValue:Ye,getTextAreaValue:Xe,setInputValue:$e,setTextAreaValue:Je,getElementValue:Qe,setElementValue:function(e,t){return ee(e)?$e(e,t):oe(e)?Je(e,t):e.value=t},isShadowElement:Ze,contains:function(t,e){return!(!t||!e)&&(t.contains?t.contains(e):!!Ve(e,!0,function(e){return e===t}))}}),tt=d.Promise,nt=d.nativeMethods,ot=d.eventSandbox.listeners,rt=d.utils.browser,it=d.utils.event.BUTTON,lt=d.utils.event.BUTTONS_PARAMETER,at=d.utils.event.DOM_EVENTS,st=d.utils.event.WHICH_PARAMETER,ut=d.utils.event.preventDefault;function ct(e,t,n,o){rt.isIE11&&Ee(e)?nt.windowAddEventListener.call(e,t,n,o):nt.addEventListener.call(e,t,n,o)}function dt(e,t,n,o){rt.isIE11&&Ee(e)?nt.windowRemoveEventListener.call(e,t,n,o):nt.removeEventListener.call(e,t,n,o)}function ft(){var n=[],e=!1;function t(){e||(Oi.body?(e=!0,n.forEach(function(e){return e()})):nt.setTimeout.call(Ai,t,1))}function o(){(Ue(Ai)||je(Ai))&&(dt(Oi,"DOMContentLoaded",o),t())}return"complete"===Oi.readyState?nt.setTimeout.call(Ai,o,1):ct(Oi,"DOMContentLoaded",o),{then:function(e){return t=e,new tt(function(e){return n.push(function(){return e(t())})});var t}}}var ht=Object.freeze({__proto__:null,BUTTON:it,BUTTONS_PARAMETER:lt,DOM_EVENTS:at,WHICH_PARAMETER:st,preventDefault:ut,bind:ct,unbind:dt,documentReady:function(e){return void 0===e&&(e=0),ft().then(function(){return ot.getEventListeners(Ai,"load").length?tt.race([new tt(function(e){return ct(Ai,"load",e)}),h(e)]):null})}}),mt={ready:"ready",readyForBrowserManipulation:"ready-for-browser-manipulation",waitForFileDownload:"wait-for-file-download"},pt=d.Promise,gt=d.utils.browser,vt=d.nativeMethods,Et=d.transport,yt=30,bt=500,wt=!1,St=null,Tt=[],Ct=!1,xt=null,It=!1;function _t(){gt.isIE?(function(e){St&&vt.clearTimeout.call(Ai,St),wt=!0,St=vt.setTimeout.call(Ai,function(){St=null,wt=!1,Tt.forEach(function(e){return e()}),Tt=[]},e)}(yt),h(0).then(function(){var e;"loading"===Oi.readyState&&((e=vt.documentActiveElementGetter.call(Oi))&&re(e)&&e.hasAttribute("download")||(Ct=!0))})):Ct=!0}var Nt=Object.freeze({__proto__:null,init:function(){d.on(d.EVENTS.beforeUnload,_t),ct(Ai,"unload",function(){Ct=!0})},watchForPageNavigationTriggers:function(){xt=function(){It=!0},d.on(d.EVENTS.pageNavigationTriggered,xt)},wait:function(t){var e=new pt(function(e){void 0===t&&(t=!xt||It?400:0),xt&&(d.off(d.EVENTS.pageNavigationTriggered,xt),xt=null),h(t).then(function(){Ct?new pt(function(t){vt.setTimeout.call(Ai,function(){Et.queuedAsyncServiceMsg({cmd:mt.waitForFileDownload}).then(function(e){e&&t()})},bt)}).then(function(){Ct=!1,e()}):wt?Tt.push(e):e()})}),n=h(15e3).then(function(){Ct=!1});return pt.race([e,n])}}),Pt=c.eventSandbox.listeners;function Rt(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new R}var Mt=(Rt.prototype._internalListener=function(e,t,n,o,r){this.events.emit("scroll",e),this.stopPropagationFlag&&(o(),r())},Rt.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,Pt.initElementListening(Ai,["scroll"]),Pt.addFirstInternalHandler(Ai,["scroll"],function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n._internalListener.apply(n,e)}))},Rt.prototype.waitForScroll=function(e){var t=this,n=null,o=new c.Promise(function(e){n=e});return o.cancel=function(){return t.events.off("scroll",n)},this.initialized?this.handleScrollEvents(e,n):n(),o},Rt.prototype.handleScrollEvents=function(n,e){var o=this;this.events.once("scroll",e),Ze(n)&&(Pt.initElementListening(n,["scroll"]),Pt.addFirstInternalHandler(n,["scroll"],function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o._internalListener.apply(o,e),Pt.cancelElementListening(n)}))},Rt.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},Rt.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new Rt),At=d.utils.style,Vt=d.utils.browser,Ot=d.utils.style.getBordersWidth,Lt=d.utils.style.getComputedStyle,Ft=d.utils.style.getElementMargin,qt=d.utils.style.getElementPadding,Ht=d.utils.style.getElementScroll,kt=d.utils.style.getOptionHeight,Wt=d.utils.style.getSelectElementSize,Bt=d.utils.style.isElementVisible,Dt=d.utils.style.isVisibleChild,Gt=d.utils.style.getWidth,Ut=d.utils.style.getHeight,jt=d.utils.style.getInnerWidth,zt=d.utils.style.getInnerHeight,Kt=d.utils.style.getScrollLeft,Yt=d.utils.style.getScrollTop,Xt=d.utils.style.setScrollLeft,$t=d.utils.style.setScrollTop,Jt=d.utils.style.get,Qt=/auto|scroll/i,Zt="visible",en=function(e){var t=Jt(e,"overflowX"),n=Jt(e,"overflowY"),o=Qt.test(t),r=Qt.test(n);return Vt.isIE&&(o=o||r&&t===Zt,r=r||o&&n===Zt),{scrollableHorizontally:o,scrollableVertically:r}},tn=function(e){return!!(e=Ve(e,!0,function(e){return $(e)&&"hidden"===Jt(e,"visibility")}))},nn=function(e){return!!(e=Ve(e,!0,function(e){return $(e)&&"none"===Jt(e,"display")}))};function on(e){return!Q(e)||nn(e)||tn(e)}function rn(e){var t,n=Jt(e,"overflowX"),o=Jt(e,"overflowY"),r=Qt.test(n),i=Qt.test(o),l=D(e).documentElement,a=e.scrollHeight;return(Vt.isChrome||Vt.isFirefox)&&(t=e.getBoundingClientRect().top,a=a-l.getBoundingClientRect().top+t),(r||i)&&a>l.scrollHeight}function ln(e){var t=en(e),n=t.scrollableHorizontally,o=t.scrollableVertically;if(pe(e))return rn(e);if(ge(e))return function(e){var t=Jt(e,"overflowX"),n=Jt(e,"overflowY"),o=e.getElementsByTagName("body")[0];if("hidden"===t&&"hidden"===n)return!1;var r=e.scrollHeight>e.clientHeight,i=e.scrollWidth>e.clientWidth;if(r||i)return!0;if(o){if(rn(o))return!1;var l=Math.min(e.clientWidth,o.clientWidth),a=Math.min(e.clientHeight,o.clientHeight);return o.scrollHeight>a||o.scrollWidth>l}return!1}(e);if(!n&&!o)return!1;var r=o&&e.scrollHeight>e.clientHeight;return n&&e.scrollWidth>e.clientWidth||r}function an(e){return e&&!(e.offsetHeight<=0&&e.offsetWidth<=0)}function sn(e,t,n){return e<t?n:e<n?t:Math.max(n,t)}var un=Object.freeze({__proto__:null,getBordersWidth:Ot,getComputedStyle:Lt,getElementMargin:Ft,getElementPadding:qt,getElementScroll:Ht,getOptionHeight:kt,getSelectElementSize:Wt,isElementVisible:Bt,isSelectVisibleChild:Dt,getWidth:Gt,getHeight:Ut,getInnerWidth:jt,getInnerHeight:zt,getScrollLeft:Kt,getScrollTop:Yt,setScrollLeft:Xt,setScrollTop:$t,get:Jt,isFixedElement:function(e){return $(e)&&"fixed"===Jt(e,"position")},isNotVisibleNode:on,getScrollableParents:function(e){var t,n=Ae(e);return U(e)&&(t=Ae(j(e)),n.concat(t)),I(n,ln)},hasScroll:ln,hasDimensions:an,set:function(e,t,n){for(var o in"string"==typeof t&&At.set(e,t,n),t)t.hasOwnProperty(o)&&At.set(e,o,t[o])},getViewportDimensions:function(){return{width:sn(Ai.innerWidth,Oi.documentElement.clientWidth,Oi.body.clientWidth),height:sn(Ai.innerHeight,Oi.documentElement.clientHeight,Oi.body.clientHeight)}}}),cn=c.utils.browser,dn=c.eventSandbox.listeners,fn=c.eventSandbox.eventSimulator,hn=["click","mousedown","mouseup","dblclick","contextmenu","mousemove","mouseover","mouseout","touchstart","touchmove","touchend","keydown","keypress","input","keyup","change","focus","blur","MSPointerDown","MSPointerMove","MSPointerOver","MSPointerOut","MSPointerUp","pointerdown","pointermove","pointerover","pointerout","pointerup"],mn=123;function pn(e,t,n,o,r){var i,l=e.target||e.srcElement;if(!t&&!Ce(l)){if(/^key/.test(e.type)&&((i=e).shiftKey&&i.ctrlKey||(i.altKey||i.metaKey)&&cn.isMacPlatform||i.keyCode===mn))return void r();if("blur"===e.type)if(cn.isIE&&cn.version<12){var a=Ee(l),s=!a&&"none"===Jt(l,"display"),u=!1;a||s||(u=I(Ae(l),function(e){return"none"===Jt(e,"display")})),(s||u.length)&&c.eventSandbox.timers.deferFunction(function(){fn.blur(l)})}else if(l!==Ai&&l!==Ai.document&&!an(l))return;n()}}function gn(e){var t=c.nativeMethods.nodeChildNodesGetter.call(e);return!Ke(t)&&Rn(e)?e:S(t,Rn)}function vn(e){return S(c.nativeMethods.nodeChildNodesGetter.call(e),function(e){return Rn(e)||!Mn(e)&&vn(e)})}function En(e){return J(e)||$(e)&&Bt(e)}function yn(e){return I(c.nativeMethods.nodeChildNodesGetter.call(e),En)}function bn(e){return C(c.nativeMethods.nodeChildNodesGetter.call(e),En)}function wn(e){return C(c.nativeMethods.nodeChildNodesGetter.call(e),function(e){return Wn(e,!0)})}function Sn(e,t){var n=null,o=null;if(!Ce(e)&&!Ce(t)){var r=c.nativeMethods.nodeChildNodesGetter.call(t);return!Ge(t,e)&&Ke(r)&&/div|p/.test(Re(t))&&(n=vn(e))&&!Ge(t,n)&&(o=xn(n))&&!Ge(t,o)&&gn(t)}}function Tn(e,t){var n=Q(t),o=null,r=null,i=null;if(!Ce(e)&&!Ce(t)){var l=c.nativeMethods.nodeChildNodesGetter.call(t);if(!Ge(t,e)&&(n&&$(t)&&Ke(l)&&!/div|p/.test(Re(t))||Rn(t)&&!Ge(t,e)&&t.nodeValue.length)){if(n&&$(t)){if(!(o=vn(e))||Ge(t,o))return;if(!(r=xn(o))||Ge(t,r))return}return(i=function(e){for(var t=null,n=e;!t&&(n=n.previousSibling);)if(!Mn(n)&&!Pn(n)){t=n;break}return t}(t))&&$(i)&&/div|p/.test(Re(i))&&gn(i)}}}function Cn(e,t){var n=c.nativeMethods.nodeChildNodesGetter.call(e),o=Ke(n),r=null,i=null,l=null,a=t?Rn:J;if(!o&&a(e))return e;for(var s=0;s<o;s++){if(r=n[s],l=$(r)&&!Se(r),a(r))return r;if(Q(r)&&bn(r)&&!l&&(i=Cn(r,t)))return i}return i}function xn(e){return Cn(e,!0)}function In(e,t){var n=c.nativeMethods.nodeChildNodesGetter.call(e),o=Ke(n),r=null,i=null,l=null;if(!o&&Rn(e))return e;for(var a=o-1;0<=a;a--){if(r=n[a],l=$(r)&&!Se(r),J(r)&&(!t||!Pn(r)))return r;if(Q(r)&&bn(r)&&!l&&(i=In(r,!1)))return i}return i}function _n(e,t){if(!e||!e.length)return 0;for(var n=e.length,o=t||0,r=o;r<n&&(10===e.charCodeAt(r)||32===e.charCodeAt(r));r++)o++;return o}function Nn(e){if(!e||!e.length)return 0;for(var t=e.length,n=t,o=t-1;0<=o&&(10===e.charCodeAt(o)||32===e.charCodeAt(o));o--)n--;return n}function Pn(e){if(!J(e))return!1;var t=e.nodeValue,n=_n(t),o=Nn(t);return n===t.length&&0===o}function Rn(e){return J(e)&&!Pn(e)}function Mn(e){return!Q(e)||Ce(e)}function An(e){var t=e.getAttribute?e.getAttribute("contenteditable"):null;return""===t||"true"===t}function Vn(e){var t=Ae(e);if(An(e)&&Se(e))return e;var n=D(e);return"on"===n.designMode?n.body:S(t,function(e){return An(e)&&Se(e)})}function On(e,t){if(Ge(e,t))return Ge(t,Vn(e))?e:c.nativeMethods.nodeParentNodeGetter.call(e);var n=[],o=Vn(e),r=null;if(!De(o,t))return null;for(r=e;r!==o;r=c.nativeMethods.nodeParentNodeGetter.call(r))n.push(r);for(r=t;r!==o;r=c.nativeMethods.nodeParentNodeGetter.call(r))if(-1!==T(n,r))return r;return o}function Ln(e,t){var n=null,o=null,r=c.nativeMethods.nodeChildNodesGetter.call(e),i=Ke(r),l=i<=t;if(Ce(e))return{node:e,offset:t};if(l?n=r[i-1]:(n=r[t],o=0),Ce(n)){if(i<=1)return{node:e,offset:0};(l=i<=t-1)?n=r[i-2]:(n=r[t-1],o=0)}for(;!Mn(n)&&$(n);){var a=yn(n);if(!a.length){o=0;break}n=a[l?a.length-1:0]}return 0===o||Mn(n)||(o=n.nodeValue?n.nodeValue.length:0),{node:n,offset:o}}function Fn(e,t,n){var o=n?t.focusNode:t.anchorNode,r=n?t.focusOffset:t.anchorOffset,i={node:o,offset:r};return(Ge(e,o)||$(o))&&wn(o)&&(i=Ln(o,r)),{node:i.node,offset:i.offset}}function qn(e,t,n){var o=n?t.anchorNode:t.focusNode,r=n?t.anchorOffset:t.focusOffset,i={node:o,offset:r};return(Ge(e,o)||$(o))&&wn(o)&&(i=Ln(o,r)),{node:i.node,offset:i.offset}}function Hn(e,t,n){return Dn(e,Fn(e,t,n))}function kn(e,t,n){return Dn(e,qn(e,t,n))}function Wn(e,t){if(on(e))return!1;if(J(e))return!0;if(!$(e))return!1;if(wn(e))return t;var n=c.nativeMethods.nodeParentNodeGetter.call(e),o=!Se(n),r=C(yn(e),function(e){return"br"===Re(e)});return o||r}function Bn(a,e){var s={node:null,offset:e};return function e(t){var n,o,r=c.nativeMethods.nodeChildNodesGetter.call(t),i=Ke(r);if(s.node)return s;if(Mn(t))return s;if(J(t)){if(s.offset<=t.nodeValue.length)return s.node=t,s;t.nodeValue.length&&(!s.node&&Tn(a,t)&&s.offset--,s.offset-=t.nodeValue.length)}else if($(t)){if(!En(t))return s;if(0===s.offset&&Wn(t,!1))return s.node=t,s.offset=(n=t,o=0,S(c.nativeMethods.nodeChildNodesGetter.call(n),function(e,t){return o=t,"br"===Re(e)})?o:0),s;(s.node||!Sn(a,t)&&!Tn(a,t))&&(i||"br"!==Re(t))||s.offset--}for(var l=0;l<i;l++)s=e(r[l]);return s}(a)}function Dn(i,e){var l=e.node,a=e.offset,s=0,u=!1;return function e(t){var n=c.nativeMethods.nodeChildNodesGetter.call(t),o=Ke(n);if(u)return s;if(Ge(l,t))return(Sn(i,t)||Tn(i,t))&&s++,u=!0,s+a;if(Mn(t))return s;!o&&t.nodeValue&&t.nodeValue.length?(!u&&Tn(i,t)&&s++,s+=t.nodeValue.length):(!o&&$(t)&&"br"===Re(t)||!u&&(Sn(i,t)||Tn(i,t)))&&s++;for(var r=0;r<o;r++)s=e(n[r]);return s}(i)}function Gn(e){var t,n,o,r,i,l=J(e)?e:In(e,!0);if(!l||(t=l,o=J(n=e)?n:Cn(n,!1),r=t===o,i=t.nodeValue===String.fromCharCode(10),r&&i&&function(e,t){for(var n=["pre","pre-wrap","pre-line"];e!==t;)if(e=c.nativeMethods.nodeParentNodeGetter.call(e),-1<T(n,Jt(e,"white-space")))return 1}(t,n)))return 0;var a=D(e).createRange();return a.selectNodeContents(l),Dn(e,{node:l,offset:a.endOffset})}var Un=Object.freeze({__proto__:null,getFirstVisibleTextNode:xn,getLastTextNode:In,getFirstNonWhitespaceSymbolIndex:_n,getLastNonWhitespaceSymbolIndex:Nn,isInvisibleTextNode:Pn,findContentEditableParent:Vn,getNearestCommonAncestor:On,getSelection:function(e,t,n){return{startPos:Fn(e,t,n),endPos:qn(e,t,n)}},getSelectionStartPosition:Hn,getSelectionEndPosition:kn,calculateNodeAndOffsetByPosition:Bn,calculatePositionByNodeAndOffset:Dn,getElementBySelection:function(e){var t=On(e.anchorNode,e.focusNode);return J(t)?t.parentElement:t},getFirstVisiblePosition:function(e){var t=J(e)?e:xn(e),n=D(e).createRange();return t?(n.selectNodeContents(t),Dn(e,{node:t,offset:n.startOffset})):0},getLastVisiblePosition:Gn,getContentEditableValue:function(e){return x(function e(t){var n=[],o=c.nativeMethods.nodeChildNodesGetter.call(t),r=Ke(o);Mn(t)||r||!J(t)||n.push(t);for(var i=0;i<r;i++)n=n.concat(e(o[i]));return n}(e),function(e){return e.nodeValue}).join("")}}),jn=d.utils.position.getElementRectangle,zn=d.utils.position.getOffsetPosition,Kn=d.utils.position.offsetToClientCoords;function Yn(e){if(!Te(e)){var t=Kn(e);return{width:0,height:0,border:{bottom:0,left:0,right:0,top:0},scroll:{left:0,top:0},left:t.x,right:t.x,top:t.y,bottom:t.y}}var n,o,r,i,l=/html/i.test(e.tagName),a=l?e.getElementsByTagName("body")[0]:null,s=Ot(e),u=e.getBoundingClientRect(),c=Ht(e),d=U(e),f=l?0:u.left,h=l?0:u.top,m=l?e.clientHeight:u.height,p=l?e.clientWidth:u.width,g="BackCompat"===e.ownerDocument.compatMode;l&&a&&("boolean"==typeof Vi&&Vi||g)&&(m=a.clientHeight,p=a.clientWidth),!d||(n=j(e))&&(o=zn(n),r=Kn({x:o.left,y:o.top}),i=Ot(n),f+=r.x+i.left,h+=r.y+i.top,l&&(s.bottom+=i.bottom,s.left+=i.left,s.right+=i.right,s.top+=i.top));var v=l||jt(e)===e.clientWidth?0:Ne(),E=l||zt(e)===e.clientHeight?0:Ne();return{width:p,height:m,left:f,top:h,border:s,bottom:h+m,right:f+p,scroll:{left:c.left,top:c.top},scrollbar:{right:v,bottom:E}}}function Xn(e){var t=/^touch/.test(e.type)&&e.targetTouches?e.targetTouches[0]||e.changedTouches[0]:e,n=0===t.pageX&&0===t.pageY,o=0!==t.clientX||0!==t.clientY;if((null===t.pageX||n&&o)&&null!==t.clientX){var r=D(e.target||e.srcElement),i=r.documentElement,l=r.body;return{x:Math.round(t.clientX+(i&&i.scrollLeft||l&&l.scrollLeft||0)-(i.clientLeft||0)),y:Math.round(t.clientY+(i&&i.scrollTop||l&&l.scrollTop||0)-(i.clientTop||0))}}return{x:Math.round(t.pageX),y:Math.round(t.pageY)}}var $n=Object.freeze({__proto__:null,getElementRectangle:jn,getOffsetPosition:zn,offsetToClientCoords:Kn,getIframeClientCoordinates:function(e){var t=zn(e),n=t.left,o=t.top,r=Kn({x:n,y:o}),i=Ot(e),l=qt(e),a=r.x+i.left+l.left,s=r.y+i.top+l.top;return{left:a,top:s,right:a+Gt(e),bottom:s+Ut(e)}},isElementVisible:function e(t){if(J(t))return!on(t);var n=jn(t);if(!Se(t)&&(0===n.width||0===n.height))return!1;if(me(t)){var o=Pe(Me(t,"map"));return!!o&&e(o)}if(Dt(t)){var r=K(t),i=Y(r,t),l=Wt(r),a=Math.max(Yt(r)/kt(r),0),s=a+l-1,u=Math.max(i-a,0);return a<=u&&u<=s}return he(t)?"hidden"!==Jt(t,"visibility")&&"none"!==Jt(t,"display"):an(t)&&"hidden"!==Jt(t,"visibility")},getClientDimensions:Yn,containsOffset:function(e,t,n){var o=Yn(e),r=Math.max(e.scrollWidth,o.width),i=Math.max(e.scrollHeight,o.height),l=o.scrollbar.right+o.border.left+o.border.right+r,a=o.scrollbar.bottom+o.border.top+o.border.bottom+i;return(void 0===t||0<=t&&t<=l)&&(void 0===n||0<=n&&n<=a)},getEventAbsoluteCoordinates:function(e){var t,n,o,r=e.target||e.srcElement,i=Xn(e),l=D(r),a=0,s=0;return!U(l.documentElement)||(t=j(l))&&(n=zn(t),o=Ot(t),a=n.left+o.left,s=n.top+o.top),{x:i.x+a,y:i.y+s}},getEventPageCoordinates:Xn,getElementFromPoint:function(e,t){var n=null,o=Oi.getElementFromPoint||Oi.elementFromPoint;try{n=o.call(Oi,e,t)}catch(e){return null}for(null===n&&(n=o.call(Oi,e-1,t-1));n&&n.shadowRoot&&n.shadowRoot.elementFromPoint;){var r=n.shadowRoot.elementFromPoint(e,t);if(!r||n===r)break;n=r}return n},getIframePointRelativeToParentFrame:function(e,t){var n=ze(t),o=zn(n),r=Ot(n),i=qt(n);return Kn({x:e.x+o.left+r.left+i.left,y:e.y+o.top+r.top+i.top})},clientToOffsetCoord:function(e,t){var n=t||Oi;return{x:e.x+Kt(n),y:e.y+Yt(n)}},findCenter:function(e){var t=jn(e);return{x:Math.round(t.left+t.width/2),y:Math.round(t.top+t.height/2)}},getClientPosition:function(e){var t=zn(e),n=t.left,o=t.top,r=Kn({x:n,y:o});return r.x=Math.round(r.x),r.y=Math.round(r.y),r},getElementClientRectangle:function(e){var t=jn(e),n=Kn({x:t.left,y:t.top});return{height:t.height,left:n.x,top:n.y,width:t.width}},calcRelativePosition:function(e,t){return{left:Math.ceil(e.left-(t.left+t.border.left)),right:Math.floor(t.right-t.border.right-t.scrollbar.right-e.right),top:Math.ceil(e.top-(t.top+t.border.top)),bottom:Math.floor(t.bottom-t.border.bottom-t.scrollbar.bottom-e.bottom)}},isInRectangle:function(e,t){var n=e.x,o=e.y;return n>=t.left&&n<=t.right&&o>=t.top&&o<=t.bottom},getLineYByXCoord:function(e,t,n){if(t.x-e.x==0)return null;var o=(t.y-e.y)/(t.x-e.x),r=e.x*(e.y-t.y)/(t.x-e.x)+e.y;return Math.round(o*n+r)},getLineXByYCoord:function(e,t,n){if(t.y-e.y==0)return null;var o=(t.x-e.x)/(t.y-e.y),r=e.y*(e.x-t.x)/(t.y-e.y)+e.x;return Math.round(o*n+r)}}),Jn=d.Promise,Qn=Object.freeze({__proto__:null,whilst:function(o,r){return new Jn(function(t,n){return function e(){return o()?r().then(e).catch(function(e){return n(e)}):t()}()})},times:function(e,t){for(var n=Jn.resolve(),o=0;o<e;o++)!function(e){n=n.then(function(){return t(e)})}(o);return n},each:function(e,n){return _(e,function(e,t){return e.then(function(){return n(t)})},Jn.resolve())}}),Zn=d.utils.browser,eo=d.nativeMethods,to=d.eventSandbox.selection,no="backward",oo="forward",ro="none",io=ro,lo=0,ao=0,so=0,uo=0,co=0,fo=0;function ho(e,t,n,o){var r=null,i=null,l=null,a=null,s=null,u=!1;void 0!==t&&void 0!==n&&n<t&&(s=t,t=n,n=s,u=!0),void 0===t&&(a={node:(i=xn(e))||e,offset:i&&i.nodeValue?_n(i.nodeValue):0}),void 0===n&&(r={node:(l=In(e,!0))||e,offset:l&&l.nodeValue?Nn(l.nodeValue):0}),a=a||Bn(e,t),r=r||Bn(e,n),a.node&&r.node&&(u?yo(r,a,o):yo(a,r,o))}function mo(e){var t=e?D(e):Oi,n=t.getSelection(),o=null,r=!1;return n&&(n.isCollapsed||((o=t.createRange()).setStart(n.anchorNode,n.anchorOffset),o.setEnd(n.focusNode,n.focusOffset),r=o.collapsed,o.detach())),r}function po(e,t,n){var o=Dn(e,t);return Dn(e,n)<o}function go(e){return Se(e)?bo(e)?Hn(e,Eo(e),mo(e)):0:to.getSelection(e).start}function vo(e){return Se(e)?bo(e)?kn(e,Eo(e),mo(e)):0:to.getSelection(e).end}function Eo(e){var t=D(e);return t?t.getSelection():Ai.getSelection()}function yo(e,t,n){var o=e.node,r=t.node,i=o.nodeValue?o.length:0,l=r.nodeValue?r.length:0,a=e.offset,s=t.offset;$(o)&&a||(a=Math.min(i,e.offset)),$(r)&&s||(s=Math.min(l,t.offset));var u=Vn(o),c=po(u,e,t),d=Eo(u),f=D(u).createRange();to.wrapSetterSelection(u,function(){var e;d.removeAllRanges(),c?Zn.isIE?(f.setStart(r,s),f.setEnd(o,a),d.addRange(f)):(f.setStart(o,a),f.setEnd(o,a),d.addRange(f),e=function(e,t){try{d.extend(e,t)}catch(e){return!1}return!0},(Zn.isSafari||Zn.isChrome&&Zn.version<58)&&Pn(r)?e(r,Math.min(s,1))||e(r,0):e(r,s)):(f.setStart(o,a),f.setEnd(r,s),d.addRange(f))},n,!0)}function bo(e){var t=Eo(e);return!(!t.anchorNode||!t.focusNode)&&De(e,t.anchorNode)&&De(e,t.focusNode)}Zn.isIE&&ct(Oi,"selectionchange",function(){var e=null,t=null,n=null,o=null,r=null;try{if(this.selection)n=this.selection.createRange();else{if(!(e=eo.documentActiveElementGetter.call(this))||!be(e))return void(io=ro);var i,r=go(e),t=vo(e);e.createTextRange?((n=e.createTextRange()).collapse(!0),n.moveStart("character",r),n.moveEnd("character",t-r)):Oi.createRange&&(n=Oi.createRange(),i=d.nativeMethods.nodeFirstChildGetter.call(e),n.setStart(i,r),n.setEnd(i,t),o=n.getBoundingClientRect())}}catch(e){return void(io=ro)}var l=o?Math.ceil(o.left):n.offsetLeft,a=o?Math.ceil(o.top):n.offsetTop,s=o?Math.ceil(o.height):n.boundingHeight,u=o?Math.ceil(o.width):n.boundingWidth,c=n.htmlText?n.htmlText.length:0;!function(e,t,n,o,r){if(r)switch(io){case ro:t===fo&&(e===uo||so<n)?io=oo:(e<uo||t<fo)&&(io=no);break;case oo:if(e===uo&&t===fo||e<uo&&so<n||t===fo&&n===so&&co<r&&e+o!==lo)break;(e<uo||t<fo)&&(io=no);break;case no:if((e<uo||t<fo)&&co<r)break;t===ao&&(lo<=e||so<n)&&(io=oo)}else lo=e,ao=t,io=ro;so=n,uo=e,co=r,fo=t}(l,a,s,u,o?n.toString().length:c)},!0);var wo,So,To=Object.freeze({__proto__:null,hasInverseSelectionContentEditable:mo,isInverseSelectionContentEditable:po,getSelectionStart:go,getSelectionEnd:vo,hasInverseSelection:function(e){return Se(e)?mo(e):(to.getSelection(e).direction||io)===no},getSelectionByElement:Eo,select:function(e,t,n){var o,r,i,l;Se(e)?ho(e,t,n,!0):(o=t||0,i=!1,l=null,(r=void 0===n?Qe(e).length:n)<o&&(l=o,o=r,r=l,i=!0),to.setSelection(e,o,r,i?no:oo),io=t===n?ro:i?no:oo)},selectByNodesAndOffsets:yo,deleteSelectionContents:function(e,t){var n,o,r,i,l,a,s,u,c,d,f,h,m=go(e),p=vo(e);t&&ho(e),m!==p&&(n=Eo(e),o=n.anchorNode,r=n.focusNode,i=n.anchorOffset,l=n.focusOffset,a=_n(o.nodeValue),s=Nn(o.nodeValue),u=_n(r.nodeValue),c=Nn(r.nodeValue),f=d=null,J(o)&&(i<a&&0!==i?d=0:i!==o.nodeValue.length&&(Pn(o)&&0!==i||s<i)&&(d=o.nodeValue.length)),J(r)&&(l<u&&0!==l?f=0:l!==r.nodeValue.length&&(Pn(r)&&0!==l||c<l)&&(f=r.nodeValue.length)),(Zn.isWebKit||Zn.isIE&&11<Zn.version)&&(null!==d&&(o.nodeValue=0===d?o.nodeValue.substring(a):o.nodeValue.substring(0,s)),null!==f&&(r.nodeValue=0===f?r.nodeValue.substring(u):r.nodeValue.substring(0,c))),null===d&&null===f||yo({node:o,offset:d=null!==d?0===d?d:o.nodeValue.length:i},{node:r,offset:f=null!==f?0===f?f:r.nodeValue.length:l}),function(e){var t=Eo(e),n=t.rangeCount;if(n)for(var o=0;o<n;o++)t.getRangeAt(o).deleteContents()}(e),(h=Eo(e)).rangeCount&&!h.getRangeAt(0).collapsed&&h.getRangeAt(0).collapse(!0))},setCursorToLastVisiblePosition:function(e){var t=Gn(e);ho(e,t,t)},hasElementContainsSelection:bo}),Co=d.Promise,xo=d.nativeMethods,Io="E1001",_o="E1002",No="E1003",Po="E1004",Ro="E1005",Mo="E1006",Ao="E1007",Vo="E1008",Oo="E1009",Lo="E1010",Fo="E1011",qo="E1012",Ho="E1013",ko="E1014",Wo="E1015",Bo="E1016",Do="E1017",Go="E1018",Uo="E1019",jo="E1020",zo="E1021",Ko="E1022",Yo="E1023",Xo="E1024",$o="E1025",Jo="E1026",Qo="E1027",Zo="E1028",er="E1029",tr="E1030",nr="E1031",or="E1032",rr="E1033",ir="E1034",lr="E1035",ar="E1036",sr="E1037",ur="E1038",cr="E1039",dr="E1040",fr="E1041",hr="E1043",mr="E1044",pr="E1045",gr="E1046",vr="E1047",Er="E1048",yr="E1049",br="E1050",wr="E1051",Sr="E1052",Tr="E1053",Cr="E1054",xr="E1055",Ir="E1056",_r="https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#file-pathglob-pattern",Nr="https://devexpress.github.io/testcafe/documentation/using-testcafe/configuration-file.html#filter",Pr=((wo={}).E1000="Cannot create multiple live mode runners.",wo[Io]="Cannot run a live mode runner multiple times.",wo[_o]="The {userAgent} browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.",wo[No]="The following browsers disconnected: {userAgents}. Tests will not be run.",wo[Po]="Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.",wo[Ro]='Unable to find the browser. "{browser}" is not a browser alias or path to an executable file.',wo[Mo]='The specified "{providerName}" browser provider was not found.',wo[Ao]="No browser selected to test against.",wo[Vo]='TestCafe could not find the test files that match the following patterns:\n{sourceList}\n\nThe "{cwd}" current working directory was used as the base path.\nEnsure the file patterns are correct or change the current working directory.\nFor more information on how to specify test files, see '+_r+".",wo[Oo]="No tests found in the specified source files.\nEnsure the sources contain the 'fixture' and 'test' directives.",wo[tr]="The specified filter settings exclude all tests.\nModify these settings to leave at least one available test.\nFor more information on how to specify filter settings, see "+Nr+".",wo[Lo]='The provided "{name}" reporter does not exist. Check that you have specified the report format correctly.',wo[Fo]='The following reporters attempted to write to the same output stream: "{reporters}". Only one reporter can write to a stream.',wo[qo]='The "{optionName}" option value is not a valid regular expression.',wo[Ho]='The "{optionName}" option value is not a valid key-value pair.',wo[ko]="Speed should be a number between 0.01 and 1.",wo[Wo]="The concurrency factor should be an integer greater or equal to 1.",wo[Bo]="The number of remote browsers should be divisible by the factor of concurrency.",wo[Do]='The "--ports" option requires two numbers to be specified.',wo[Go]="The specified {portNum} port is already in use by another program.",wo[Uo]='The specified "{hostname}" hostname cannot be resolved to the current machine.',wo[jo]='Cannot find a test source file at "{path}".',wo[zo]="{#instantiationCallsiteName} code is expected to be specified as a function, but {type} was passed.",wo[Ko]="{#instantiationCallsiteName} is expected to be initialized with a function, CSS selector string, another Selector, node snapshot or a Promise returned by a Selector, but {type} was passed.",wo[Yo]="{#instantiationCallsiteName} cannot implicitly resolve the test run in context of which it should be executed. If you need to call {#instantiationCallsiteName} from the Node.js API callback, pass the test controller manually via {#instantiationCallsiteName}'s `.with({ boundTestRun: t })` method first. Note that you cannot execute {#instantiationCallsiteName} outside the test code.",wo[Xo]='{#instantiationCallsiteName} code, arguments or dependencies cannot contain generators or "async/await" syntax (use Promises instead).',wo[$o]='The "boundTestRun" option value is expected to be a test controller.',wo[Jo]="{smthg} is expected to be a {type}, but it was {actual}.",wo[Qo]='The specified "{url}" test page URL uses an unsupported {protocol}:// protocol. Only relative URLs or absolute URLs with http://, https:// and file:// protocols are supported.',wo[Zo]="Cannot implicitly resolve the test run in the context of which the test controller action should be executed. Use test function's 't' argument instead.",wo[er]="Timeout expired for a time limited promise",wo[nr]="Unable to set video or encoding options when video recording is disabled. Specify the base path where video files are stored to enable recording.",wo[or]='You cannot call the "{methodName}" method more than once. Pass an array of parameters to this method instead.',wo[rr]="Specify a file name or a writable stream as the reporter's output target.",wo[ir]='Unable to read the "{path}" file, specified by the "{option}" ssl option. Error details:\n\n{err}',wo[lr]="Cannot prepare tests due to an error.\n\n{errMessage}",wo[ar]='Cannot parse a test source file in the raw format at "{path}" due to an error.\n\n{errMessage}',wo[sr]="Tested app failed with an error:\n\n{errMessage}",wo[ur]='Was unable to open the browser "{alias}" due to error.\n\n{errMessage}',wo[cr]="There was an error while configuring the request hook:\n\n{requestHookName}: {errMsg}",wo[dr]='There are forbidden characters in the "{screenshotPath}" {screenshotPathType}:\n {forbiddenCharsDescription}',wo[fr]="Unable to locate the FFmpeg executable required to record videos. Do one of the following:\n\n* add the FFmpeg installation directory to the PATH environment variable,\n* specify the path to the FFmpeg executable in the FFMPEG_PATH environment variable or the ffmpegPath video option,\n* install the @ffmpeg-installer/ffmpeg package from npm.",wo[hr]='Unable to find the TypeScript configuration file in "{filePath}"',wo[mr]="Specify the JavaScript file path, module name or script content to inject a client script.",wo[pr]="Specify the base path for the client script file.",wo[gr]="You cannot combine the file path, module name and script content when you specify a client script to inject.",wo[vr]="Cannot load a client script from {path}.",wo[Er]="An error occurred when trying to locate the injected client script module:\n\n{errorMessage}.",wo[yr]="This method cannot be called on a service host.",wo[br]="The specified payload is too large to form an IPC packet.",wo[wr]="Cannot process a malformed IPC message.",wo[Sr]="Cannot create an IPC message due to an unexpected IPC head packet.",wo[Tr]="Cannot create an IPC message due to an unexpected IPC body packet.",wo[Cr]="Cannot create an IPC message due to an unexpected IPC tail packet.",wo[xr]="You cannot run Legacy API tests in multi-window mode.",wo[Ir]="You cannot use multi-window mode in {browsers}.",wo[er]),Rr=(s(Mr,So=Error),Mr);function Mr(){var e=So.call(this,Pr)||this;return e.code=er,e}function Ar(e){return x(e.replace(/^\+/g,"plus").replace(/\+\+/g,"+plus").split("+"),function(e){return e.replace("plus","+")})}function Vr(e){var t=1===e.length||"space"===e?e:e.toLowerCase();return l.modifiersMap[t]&&(t=l.modifiersMap[t]),t}var Or=d.utils.trim,Lr=d.Promise,Fr=d.eventSandbox.message;function qr(){}var Hr,kr="undefined"!=typeof globalThis?globalThis:void 0!==Ai?Ai:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Wr="pending",Br="settled",Dr="fulfilled",Gr="rejected",Ur=void 0!==kr&&void 0!==kr.process&&"function"==typeof kr.process.emit,jr="undefined"==typeof setImmediate?setTimeout:setImmediate,zr=[];function Kr(){for(var e=0;e<zr.length;e++)zr[e][0](zr[e][1]);Hr=!(zr=[])}function Yr(e,t){zr.push([e,t]),Hr||(Hr=!0,jr(Kr,0))}function Xr(e,t){function n(e){ei(t,e)}try{e(function(e){Qr(t,e)},n)}catch(e){n(e)}}function $r(e){var t=e.owner,n=t._state,o=t._data,r=e[n],i=e.then;if("function"==typeof r){n=Dr;try{o=r(o)}catch(e){ei(i,e)}}Jr(i,o)||(n===Dr&&Qr(i,o),n===Gr&&ei(i,o))}function Jr(t,n){var o;try{if(t===n)throw new TypeError("A promises callback cannot return that same promise.");if(n&&("function"==typeof n||"object"==typeof n)){var e=n.then;if("function"==typeof e)return e.call(n,function(e){o||(o=!0,(n===e?Zr:Qr)(t,e))},function(e){o||(o=!0,ei(t,e))}),1}}catch(e){return o||ei(t,e),1}}function Qr(e,t){e!==t&&Jr(e,t)||Zr(e,t)}function Zr(e,t){e._state===Wr&&(e._state=Br,e._data=t,Yr(ni,e))}function ei(e,t){e._state===Wr&&(e._state=Br,e._data=t,Yr(oi,e))}function ti(e){e._then=e._then.forEach($r)}function ni(e){e._state=Dr,ti(e)}function oi(e){e._state=Gr,ti(e),!e._handled&&Ur&&kr.process.emit("unhandledRejection",e._data,e)}function ri(e){kr.process.emit("rejectionHandled",e)}function ii(e){if("function"!=typeof e)throw new TypeError("Promise resolver "+e+" is not a function");if(this instanceof ii==0)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],Xr(e,this)}ii.prototype={constructor:ii,_state:Wr,_then:null,_data:void 0,_handled:!1,then:function(e,t){var n={owner:this,then:new this.constructor(qr),fulfilled:e,rejected:t};return!t&&!e||this._handled||(this._handled=!0,this._state===Gr&&Ur&&Yr(ri,this)),this._state===Dr||this._state===Gr?Yr($r,n):this._then.push(n),n.then},catch:function(e){return this.then(null,e)}},ii.all=function(l){if(!Array.isArray(l))throw new TypeError("You must pass an array to Promise.all().");return new ii(function(n,e){for(var t,o=[],r=0,i=0;i<l.length;i++)(t=l[i])&&"function"==typeof t.then?t.then(function(t){return r++,function(e){o[t]=e,--r||n(o)}}(i),e):o[i]=t;r||n(o)})},ii.race=function(r){if(!Array.isArray(r))throw new TypeError("You must pass an array to Promise.race().");return new ii(function(e,t){for(var n,o=0;o<r.length;o++)(n=r[o])&&"function"==typeof n.then?n.then(e,t):e(n)})},ii.resolve=function(t){return t&&"object"==typeof t&&t.constructor===ii?t:new ii(function(e){e(t)})},ii.reject=function(n){return new ii(function(e,t){t(n)})};var li,ai,si=ii,ui="run",ci="idle";(ai=li=li||{}).ok="ok",ai.closing="closing";var di=li,fi="x-testcafe-cache-page-request",hi=!1,mi=!1,pi=null,gi=function(){},vi=function(t){return new si(function(e){return setTimeout(e,t)})},Ei=eval,yi=300,bi=5;function wi(e,r,t){var n=void 0===t?{}:t,o=n.method,i=void 0===o?"GET":o,l=n.data,a=void 0===l?null:l,s=n.parseResponse,u=void 0===s||s;return new si(function(t,n){var o=r();o.open(i,e,!0),mi&&(o.setRequestHeader(fi,"true"),o.setRequestHeader("accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")),o.onreadystatechange=function(){var e;4===o.readyState&&(200===o.status?((e=o.responseText||"")&&u&&(e=JSON.parse(o.responseText)),t(e)):n("disconnected"))},o.send(a)})}function Si(e){return Oi.location.href.toLowerCase()===e.toLowerCase()}function Ti(){hi=!1}function Ci(e){Ti(),Oi.location=e.url}function xi(e,t){function n(){return wi(e,t,{parseResponse:!1})}function o(){return vi(yi).then(n)}for(var r=n(),i=0;i<bi;i++)r=r.catch(o);return r.catch(gi)}function Ii(){return mi}var _i=Object.freeze({__proto__:null,sendXHR:wi,startHeartbeat:function(e,t){function n(){wi(e,t).then(function(e){e.code!==di.closing||Si(e.url)||(Ti(),Oi.location=e.url)})}pi=Ai.setInterval(n,2e3),n()},stopHeartbeat:function(){Ai.clearInterval(pi)},startInitScriptExecution:function(e,t){hi=!0,function e(t,n){hi&&wi(t,n).then(function(e){return e.code?wi(t,n,{method:"POST",data:JSON.stringify(Ei(e.code))}):null}).then(function(){Ai.setTimeout(function(){return e(t,n)},1e3)})}(e,t)},stopInitScriptExecution:Ti,redirect:Ci,fetchPageToCache:xi,checkStatus:function(e,n,t){var o=(t||{}).manualRedirect;return wi(e,n).then(function(e){var t=si.resolve();return e.url&&mi&&(t=xi(e.url,n)),t.then(function(){return e})}).then(function(e){var t=(e.cmd===ui||e.cmd===ci)&&!Si(e.url);return t&&!o&&Ci(e),{command:e,redirecting:t}})},enableRetryingTestPages:function(){mi=!0},disableRetryingTestPages:function(){mi=!1},isRetryingTestPagesEnabled:Ii,getActiveWindowId:function(e,t){return wi(e,t)},setActiveWindowId:function(e,t,n){return wi(e,t,{method:"POST",data:JSON.stringify({windowId:n})})}}),Ni={};Ni.RequestBarrier=F,Ni.pageUnloadBarrier=Nt,Ni.preventRealEvents=function(){dn.initElementListening(Ai,hn),dn.addFirstInternalHandler(Ai,hn,pn),Mt.init()},Ni.disableRealEventsPreventing=function(){dn.removeInternalEventListener(Ai,hn,pn)},Ni.scrollController=Mt,Ni.serviceUtils=A,Ni.domUtils=et,Ni.contentEditable=Un,Ni.positionUtils=$n,Ni.styleUtils=un,Ni.eventUtils=ht,Ni.arrayUtils=P,Ni.promiseUtils=Qn,Ni.textSelection=To,Ni.waitFor=function(i,l,a){return new Co(function(e,t){var n,o,r=i();r?e(r):(n=xo.setInterval.call(Ai,function(){(r=i())&&(xo.clearInterval.call(Ai,n),xo.clearTimeout.call(Ai,o),e(r))},l),o=xo.setTimeout.call(Ai,function(){xo.clearInterval.call(Ai,n),t()},a))})},Ni.delay=h,Ni.getTimeLimitedPromise=function(e,t){return c.Promise.race([e,h(t).then(function(){return c.Promise.reject(new Rr)})])},Ni.noop=function(){},Ni.getKeyArray=Ar,Ni.getSanitizedKey=Vr,Ni.parseKeySequence=function(e){if("string"!=typeof e)return{error:!0};var t=(e=Or(e).replace(/\s+/g," ")).length,n=e.charAt(t-1),o=e.charAt(t-2);1<t&&"+"===n&&!/[+ ]/.test(o)&&(e=e.substring(0,e.length-1));var r=e.split(" ");return{combinations:r,error:C(r,function(e){return C(Ar(e),function(e){var t=1===e.length||"space"===e,n=Vr(e),o=l.modifiers[n],r=l.specialKeys[n];return!(t||o||r)})}),keys:e}},Ni.sendRequestToFrame=function(e,o,t){return new Lr(function(n){Fr.on(Fr.SERVICE_MSG_RECEIVED_EVENT,function e(t){t.message.cmd===o&&(Fr.off(Fr.SERVICE_MSG_RECEIVED_EVENT,e),n(t.message))}),Fr.sendServiceMsg(e,t)})},Ni.KEY_MAPS=l,Ni.NODE_TYPE_DESCRIPTIONS={1:"element",2:"attribute",3:"text",4:"cdata section",5:"entity reference",6:"entity node",7:"processing instruction",8:"comment",9:"document",10:"document type",11:"document fragment",12:"notation"},Ni.browser=_i,Ni.selectorTextFilter=function o(e,r,i,l){function t(e){for(var t=e.childNodes.length,n=0;n<t;n++)if(o(e.childNodes[n],r,i,l))return!0;return!1}function n(e){return l instanceof RegExp?l.test(e):l===e.trim()}if(1===e.nodeType)return n(e.innerText||e.textContent);if(9!==e.nodeType)return 11===e.nodeType?t(e):n(e.textContent);var a=e.querySelector("head"),s=e.querySelector("body");return t(a)||t(s)},Ni.selectorAttributeFilter=function(e,t,n,o,r){if(1!==e.nodeType)return!1;function i(e,t){return"string"==typeof t?t===e:t.test(e)}for(var l=e.attributes,a=null,s=0;s<l.length;s++)if(i((a=l[s]).nodeName,o)&