testcafe
Version:
Automated browser testing for the modern web development stack.
1 lines • 78.7 kB
JavaScript
window["%hammerhead%"].utils.removeInjectedScript(),function ei(ti){var ni=ti.document;!function(c,e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(c),d=t(e),n={alt:18,ctrl:17,meta:91,shift:16},r={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=","{":"[","}":"]",":":";",'"':"'","|":"\\","<":",",">":".","?":"/","±":"§"},i={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},a={left:"ArrowLeft",down:"ArrowDown",right:"ArrowRight",up:"ArrowUp",backspace:"Backspace",capslock:"CapsLock",delete:"Delete",end:"End",enter:"Enter",esc:"Escape",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:" ",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"};function l(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[e[t]]=t);return n}var s={modifiers:n,shiftMap:r,specialKeys:i,keyProperty:a,modifiersMap:{option:"alt"},symbolCharCodeToKeyCode:{96:192,91:219,93:221,92:220,59:186,39:222,44:188,45:o.default.utils.browser.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:l(n),reversedShiftMap:l(r),reversedSpecialKeys:l(i),reversedKeyProperty:l(a),newLineKeys:["enter","\n","\r"]},u=o.default.Promise,f=o.default.nativeMethods;function h(t){return new u(function(e){return f.setTimeout.call(ti,e,t)})}var p=(m.prototype._startListening=function(){var t=this;this._emitter.onRequestSend(function(e){return t._onRequestSend(e)}),this._emitter.onRequestCompleted(function(e){return t._onRequestCompleted(e)}),this._emitter.onRequestError(function(e){return t._onRequestError(e)})},m.prototype._offListening=function(){this._emitter.offAll()},m.prototype._onRequestSend=function(e){this._collectingReqs&&this._requests.add(e)},m.prototype._onRequestCompleted=function(e){var t=this;h(this._delays.additionalRequestsCollection).then(function(){return t._onRequestFinished(e)})},m.prototype._onRequestFinished=function(e){this._requests.has(e)&&(this._requests.delete(e),this._collectingReqs||this._requests.size||!this._watchdog||this._finishWaiting())},m.prototype._onRequestError=function(e){this._onRequestFinished(e)},m.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._requests.clear(),this._offListening(),this._waitResolve()},m.prototype.wait=function(e){var n=this;return h(e?this._delays.pageInitialRequestsCollection:this._delays.requestsCollection).then(function(){return new c.Promise(function(e){var t;n._collectingReqs=!1,n._waitResolve=e,n._requests.size?(t=c.nativeMethods.setTimeout,n._watchdog=t(function(){return n._finishWaiting()},m.TIMEOUT)):n._finishWaiting()})})},m.TIMEOUT=3e3,m);function m(e,t){var n,o,r;void 0===t&&(t={}),this._delays={requestsCollection:null!==(n=t.requestsCollection)&&void 0!==n?n:50,additionalRequestsCollection:null!==(o=t.additionalRequestsCollection)&&void 0!==o?o:50,pageInitialRequestsCollection:null!==(r=t.pageInitialRequestsCollection)&&void 0!==r?r:50},this._emitter=e,this._waitResolve=null,this._watchdog=null,this._requests=new Set,this._collectingReqs=!0,this._startListening()}var g=function(e,t){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function E(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function v(e,a,l,s){return new(l=l||d.default)(function(n,t){function o(e){try{i(s.next(e))}catch(e){t(e)}}function r(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof l?t:new l(function(e){e(t)})).then(o,r)}i((s=s.apply(e,a||[])).next())})}function y(n,o){var r,i,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=e(0),s.throw=e(1),s.return=e(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function e(t){return function(e){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;s&&t[s=0]&&(l=0),l;)try{if(r=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,a&&(t=[2&t[0],a.value]),t[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,i=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){l.label=t[1];break}if(6===t[0]&&l.label<a[1]){l.label=a[1],a=t;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(t);break}a[2]&&l.ops.pop(),l.trys.pop();continue}t=o.call(n,l)}catch(e){t=[6,e],i=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function b(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||((o=o||Array.prototype.slice.call(t,0,r))[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var C=(S.prototype.on=function(e,t){this._eventsListeners[e]||(this._eventsListeners[e]=[]),this._eventsListeners[e].push(t)},S.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)})},S.prototype.off=function(e,t){var n=this._eventsListeners[e];n&&(this._eventsListeners[e]=c.nativeMethods.arrayFilter.call(n,function(e){return e!==t}))},S.prototype.offAll=function(e){e?this._eventsListeners[e]=[]:this._eventsListeners={}},S.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=this._eventsListeners[e];if(o)for(var r=0;r<o.length;r++)o[r].apply(this,t)},S);function S(){this._eventsListeners={}}var w,T="request-send",_="request-completed",I="request-error",P=(E(N,w=C),N.prototype._addHammerheadListener=function(e,t){o.default.on(e,t),this._hammerheadListenersInfo.push({evt:e,listener:t})},N.prototype.onRequestSend=function(e){this.on(T,e)},N.prototype.onRequestCompleted=function(e){this.on(_,e)},N.prototype.onRequestError=function(e){this.on(I,e)},N.prototype.offAll=function(){w.prototype.offAll.call(this);for(var e=0,t=this._hammerheadListenersInfo;e<t.length;e++){var n=t[e];o.default.off.call(o.default,n.evt,n.listener)}},N);function N(){var n=w.call(this)||this;return n._hammerheadListenersInfo=[],n._addHammerheadListener(o.default.EVENTS.beforeXhrSend,function(e){var t=e.xhr;return n.emit(T,t)}),n._addHammerheadListener(o.default.EVENTS.xhrCompleted,function(e){var t=e.xhr;return n.emit(_,t)}),n._addHammerheadListener(o.default.EVENTS.xhrError,function(e){var t=e.xhr;return n.emit(I,t)}),n._addHammerheadListener(o.default.EVENTS.fetchSent,function(e){n.emit(T,e),e.then(function(){return n.emit(_,e)},function(){return n.emit(I,e)})}),n}var R=(M.prototype._startListening=function(){var t=this;this._emitter.onScriptAdded(function(e){return t._onScriptElementAdded(e)}),this._emitter.onScriptLoadedOrFailed(function(e){return t._onScriptLoadedOrFailed(e)})},M.prototype._offListening=function(){this._emitter.offAll()},M.prototype._onScriptElementAdded=function(e){var t=this,n=(0,c.nativeMethods.setTimeout)(function(){return t._onScriptLoadedOrFailed(e,!0)},M.LOADING_TIMEOUT);this._scripts.set(e,n)},M.prototype._onScriptLoadedOrFailed=function(e,t){var n=this;void 0===t&&(t=!1),this._scripts.has(e)&&(t||(0,c.nativeMethods.clearTimeout)(this._scripts.get(e)),this._scripts.delete(e),this._scripts.size||h(25).then(function(){n._waitResolve&&!n._scripts.size&&n._finishWaiting()}))},M.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._scripts.clear(),this._offListening(),this._waitResolve(),this._waitResolve=null},M.prototype.wait=function(){var n=this;return new c.Promise(function(e){var t;n._waitResolve=e,n._scripts.size?(t=c.nativeMethods.setTimeout,n._watchdog=t(function(){return n._finishWaiting()},M.TIMEOUT)):n._finishWaiting()})},M.TIMEOUT=3e3,M.LOADING_TIMEOUT=2e3,M);function M(e){this._emitter=e,this._watchdog=null,this._waitResolve=null,this._scripts=new Map,this._startListening()}var O,x=o.default.nativeMethods,A="script-added",F="script-loaded-or-failed",L=(E(V,O=C),V.prototype._onScriptElementAdded=function(e){var t,n=this,o=x.scriptSrcGetter.call(e);void 0!==o&&""!==o&&(this.emit(A,e),t=function(){x.removeEventListener.call(e,"load",t),x.removeEventListener.call(e,"error",t),n.emit(F,e)},x.addEventListener.call(e,"load",t),x.addEventListener.call(e,"error",t))},V.prototype.onScriptAdded=function(e){this.on(A,e)},V.prototype.onScriptLoadedOrFailed=function(e){this.on(F,e)},V.prototype.offAll=function(){O.prototype.offAll.call(this),o.default.off(o.default.EVENTS.scriptElementAdded,this._onScriptElementAdded)},V);function V(){var n=O.call(this)||this;return n._scriptElementAddedListener=function(e){var t=e.el;return n._onScriptElementAdded(t)},o.default.on(o.default.EVENTS.scriptElementAdded,n._scriptElementAddedListener),n}function W(e){var t="array"+e.charAt(0).toUpperCase()+e.slice(1),n=c.nativeMethods[t];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,e)}}var H=W("filter"),D=W("map"),k=W("slice"),U=W("splice"),B=W("unshift"),q=W("forEach"),G=W("indexOf"),j=W("some"),z=W("reverse"),J=W("reduce"),K=W("concat"),Y=W("join"),X=W("every");function Q(e,t){return c.nativeMethods.arrayFind.call(e,t)}var $=Object.freeze({__proto__:null,filter:H,map:D,slice:k,splice:U,unshift:B,forEach:q,indexOf:G,some:j,reverse:z,reduce:J,concat:K,join:Y,every:X,isArray:function(e){return"[object Array]"===c.nativeMethods.objectToString.call(e)},from:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return c.nativeMethods.arrayFrom.apply(c.nativeMethods,b([e],t,!1))},find:Q,remove:function(e,t){var n=c.nativeMethods.arrayIndexOf.call(e,t);-1<n&&c.nativeMethods.arraySplice.call(e,n,1)},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}}),Z=o.default.utils.browser,ee=o.default.nativeMethods,te=o.default.utils.style.get,ne=o.default.utils.dom.getActiveElement,oe=o.default.utils.dom.findDocument,re=o.default.utils.dom.find,ie=o.default.utils.dom.isElementInDocument,ae=o.default.utils.dom.isElementInIframe,le=o.default.utils.dom.getIframeByElement,se=o.default.utils.dom.isCrossDomainWindows,ue=o.default.utils.dom.getSelectParent,ce=o.default.utils.dom.getChildVisibleIndex,de=o.default.utils.dom.getSelectVisibleChildren,fe=o.default.utils.dom.isElementNode,he=o.default.utils.dom.isTextNode,pe=o.default.utils.dom.isRenderedNode,me=o.default.utils.dom.isIframeElement,ge=o.default.utils.dom.isInputElement,Ee=o.default.utils.dom.isButtonElement,ve=o.default.utils.dom.isFileInput,ye=o.default.utils.dom.isTextAreaElement,be=o.default.utils.dom.isAnchorElement,Ce=o.default.utils.dom.isImgElement,Se=o.default.utils.dom.isFormElement,we=o.default.utils.dom.isLabelElement,Te=o.default.utils.dom.isSelectElement,_e=o.default.utils.dom.isRadioButtonElement,Ie=o.default.utils.dom.isColorInputElement,Pe=o.default.utils.dom.isCheckboxElement,Ne=o.default.utils.dom.isOptionElement,Re=o.default.utils.dom.isSVGElement,Me=o.default.utils.dom.isMapElement,Oe=o.default.utils.dom.isBodyElement,xe=o.default.utils.dom.isHtmlElement,Ae=o.default.utils.dom.isDocument,Fe=o.default.utils.dom.isTextEditableInput,Le=o.default.utils.dom.isTextEditableElement,Ve=o.default.utils.dom.isTextEditableElementAndEditingAllowed,We=o.default.utils.dom.isContentEditableElement,He=o.default.utils.dom.isDomElement,De=o.default.utils.dom.isShadowUIElement,ke=o.default.utils.dom.isShadowRoot,Ue=o.default.utils.dom.isElementFocusable,Be=o.default.utils.dom.isHammerheadAttr,qe=o.default.utils.dom.isElementReadOnly,Ge=o.default.utils.dom.getScrollbarSize,je=o.default.utils.dom.getMapContainer,ze=o.default.utils.dom.getTagName,Je=o.default.utils.dom.closest,Ke=o.default.utils.dom.getParents,Ye=o.default.utils.dom.findParent,Xe=o.default.utils.dom.getTopSameDomainWindow,Qe=o.default.utils.dom.getParentExceptShadowRoot;function $e(e,t){var n,o={el:n=e,skip:n.shadowRoot&&n.tabIndex<0,children:{}};if(e=e.shadowRoot||e,me(e)&&(e=ee.contentDocumentGetter.call(e)),e&&(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node.DOCUMENT_NODE))for(var r=0,i=function(e){for(var t,n=e.querySelectorAll("*"),o=function(e){for(var t=[],n=0;n<e.length;n++)"none"===te(e[n],"display")&&t.push(e[n]);return t}(n),r=/^(input|button|select|textarea)$/,i=[],a=null,l=null,s=null,u=0;u<n.length;u++){a=n[u],l=ze(a),s=Ze(a),function(e,t,n){var o=null;return t.nodeType===Node.DOCUMENT_NODE&&(o=ee.documentActiveElementGetter.call(t)),e===o||!(e.disabled||"none"===te(e,"display")||"hidden"===te(e,"visibility")||Z.isAndroid&&Ne(e)||null!==n&&n<0)}(a,e,s)&&(t=a.getAttribute("contenteditable"),(r.test(l)||a.shadowRoot||me(a)||be(a)&&a.hasAttribute("href")||""===t||"true"===t||null!==s)&&i.push(a))}return H(i,function(e){return!et(o,e)})}(e);r<i.length;r++){var a=i[r],l=!t||a.tabIndex<=0?-1:a.tabIndex;o.children[l]=o.children[l]||[],o.children[l].push($e(a,t))}return o}function Ze(e){var t=ee.getAttribute.call(e,"tabindex");return null!==t&&(t=parseInt(t,10),t=isNaN(t)?null:t),t}function et(e,t){return e.contains?e.contains(t):j(e,function(e){return e.contains(t)})}function tt(e,t){if(ot(t,e))return!0;for(var n=ee.nodeChildNodesGetter.call(e),o=st(n),r=0;r<o;r++){var i=n[r];if(!De(i)&&tt(i,t))return!0}return!1}function nt(e,t){var n=e.querySelectorAll(ze(t));return G(n,t)}function ot(e,t){return e&&t&&e.isSameNode?e.isSameNode(t):e===t}function rt(t){var e=null;try{e=t.frameElement}catch(e){return!!t.top}return!(!Z.isFirefox&&!Z.isWebKit||t.top===t||e)||!(!e||!ee.contentDocumentGetter.call(e))}function it(e){return e.top===e}function at(e){var t=[];re(ni,"*",function(e){"IFRAME"===e.tagName&&t.push(e),e.shadowRoot&&re(e.shadowRoot,"iframe",function(e){return t.push(e)})});for(var n=0;n<t.length;n++)if(ee.contentWindowGetter.call(t[n])===e)return t[n];return null}function lt(e){return ee.htmlCollectionLengthGetter.call(e)}function st(e){return ee.nodeListLengthGetter.call(e)}function ut(e){return ee.inputValueGetter.call(e)}function ct(e){return ee.textAreaValueGetter.call(e)}function dt(e,t){return ee.inputValueSetter.call(e,t)}function ft(e,t){return ee.textAreaValueSetter.call(e,t)}function ht(e){return ge(e)?ut(e):ye(e)?ct(e):e.value}function pt(e){return e&&e.getRootNode&&oe(e)!==e.getRootNode()}var mt=Object.freeze({__proto__:null,getActiveElement:ne,findDocument:oe,find:re,isElementInDocument:ie,isElementInIframe:ae,getIframeByElement:le,isCrossDomainWindows:se,getSelectParent:ue,getChildVisibleIndex:ce,getSelectVisibleChildren:de,isElementNode:fe,isTextNode:he,isRenderedNode:pe,isIframeElement:me,isInputElement:ge,isButtonElement:Ee,isFileInput:ve,isTextAreaElement:ye,isAnchorElement:be,isImgElement:Ce,isFormElement:Se,isLabelElement:we,isSelectElement:Te,isRadioButtonElement:_e,isColorInputElement:Ie,isCheckboxElement:Pe,isOptionElement:Ne,isSVGElement:Re,isMapElement:Me,isBodyElement:Oe,isHtmlElement:xe,isDocument:Ae,isTextEditableInput:Fe,isTextEditableElement:Le,isTextEditableElementAndEditingAllowed:Ve,isContentEditableElement:We,isDomElement:He,isShadowUIElement:De,isShadowRoot:ke,isElementFocusable:Ue,isHammerheadAttr:Be,isElementReadOnly:qe,getScrollbarSize:Ge,getMapContainer:je,getTagName:ze,closest:Je,getParents:Ke,findParent:Ye,getTopSameDomainWindow:Xe,getParentExceptShadowRoot:Qe,getFocusableElements:function(e,t){return void 0===t&&(t=!1),function e(t){var n,o=[];for(n in t.skip||t.el.nodeType===Node.DOCUMENT_NODE||me(t.el)||o.push(t.el),t.children)for(var r=0,i=t.children[n];r<i.length;r++){var a=i[r];o.push.apply(o,e(a))}return o}($e(e,t))},getTabIndexAttributeIntValue:Ze,containsElement:et,getTextareaIndentInLine:function(e,t){var n=ct(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=ct(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=ct(e).split("\n"),r=0,i=0;i<t;i++)r+=o[i].length+1;return r+n},blocksImplicitSubmission:function(e){return(Z.isSafari?/^(text|password|color|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:Z.isFirefox?/^(text|password|date|time|datetime|datetime-local|email|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?Ve(e)||We(e):Le(e)||We(e)},isElementContainsNode:tt,isOptionGroupElement:function(e){return"[object HTMLOptGroupElement]"===o.default.utils.dom.instanceToString(e)},getElementIndexInParent:nt,isTheSameNode:ot,getElementDescription:function(e){var t,n,o={id:"id",name:"name",class:"className"},r=[];for(t in r.push("<"),r.push(ze(e)),o)!o.hasOwnProperty(t)||(n=e[o[t]])&&r.push(" "+t+'="'+n+'"');return r.push(">"),r.join("")},getFocusableParent:function(e){for(var t=Ke(e),n=0;n<t.length;n++)if(Ue(t[n]))return t[n];return null},remove:function(e){e&&e.parentElement&&e.parentElement.removeChild(e)},isIFrameWindowInDOM:rt,isTopWindow:it,findIframeByWindow:at,isEditableFormElement:function(e){return Le(e)||Te(e)},getCommonAncestor:function(e,t){if(ot(e,t))return e;for(var n=[e].concat(Ke(e)),o=t;o;){if(-1<G(n,o))return o;o=ee.nodeParentNodeGetter.call(o)}return o},getChildrenLength:lt,getChildNodesLength:st,getInputValue:ut,getTextAreaValue:ct,setInputValue:dt,setTextAreaValue:ft,getElementValue:ht,setElementValue:function(e,t){return ge(e)?dt(e,t):ye(e)?ft(e,t):e.value=t},isShadowElement:pt,contains:function(t,e){return!(!t||!e)&&(t.contains?t.contains(e):!!Ye(e,!0,function(e){return e===t}))},isNodeEqual:function(e,t){return e===t},getNodeText:function(e){return ee.nodeTextContentGetter.call(e)},getImgMapName:function(e){return e.useMap.substring(1)},getDocumentElement:function(e){return e.document.documentElement},isDocumentElement:function(e){return e===ni.documentElement}}),gt=o.default.Promise,Et=o.default.nativeMethods,vt=o.default.eventSandbox.listeners,yt=o.default.utils.event.BUTTON,bt=o.default.utils.event.BUTTONS_PARAMETER,Ct=o.default.utils.event.DOM_EVENTS,St=o.default.utils.event.WHICH_PARAMETER,wt=o.default.utils.event.preventDefault;function Tt(e,t,n,o){Et.addEventListener.call(e,t,n,o)}function _t(e,t,n,o){Et.removeEventListener.call(e,t,n,o)}function It(){var n=[],e=!1;function t(){e||(ni.body?(e=!0,n.forEach(function(e){return e()})):Et.setTimeout.call(ti,t,1))}function o(){(rt(ti)||it(ti))&&(_t(ni,"DOMContentLoaded",o),t())}return"complete"===ni.readyState?Et.setTimeout.call(ti,o,1):Tt(ni,"DOMContentLoaded",o),{then:function(e){return t=e,new gt(function(e){return n.push(function(){return e(t())})});var t}}}var Pt,Nt,Rt=Object.freeze({__proto__:null,BUTTON:yt,BUTTONS_PARAMETER:bt,DOM_EVENTS:Ct,WHICH_PARAMETER:St,preventDefault:wt,bind:Tt,unbind:_t,documentReady:function(e){return void 0===e&&(e=0),It().then(function(){return vt.getEventListeners(ti,"load").length?gt.race([new gt(function(e){return Tt(ti,"load",e)}),h(e)]):null})}});(Nt=Pt=Pt||{}).ready="ready",Nt.readyForBrowserManipulation="ready-for-browser-manipulation",Nt.waitForFileDownload="wait-for-file-download";var Mt=Pt,Ot=o.default.Promise,xt=o.default.transport,At=500,Ft=!1,Lt=null,Vt=!1;function Wt(){Ft=!0}var Ht=Object.freeze({__proto__:null,init:function(){o.default.on(o.default.EVENTS.beforeUnload,Wt),Tt(ti,"unload",function(){Ft=!0})},watchForPageNavigationTriggers:function(){Lt=function(){Vt=!0},o.default.on(o.default.EVENTS.pageNavigationTriggered,Lt)},wait:function(e){void 0===e&&(e=!Lt||Vt?400:0),Lt&&(o.default.off(o.default.EVENTS.pageNavigationTriggered,Lt),Lt=null);var t=h(e).then(function(){if(Ft)return h(At).then(function(){return xt.queuedAsyncServiceMsg({cmd:Mt.waitForFileDownload})}).then(function(e){if(!e)return new Ot(function(){})}).then(function(){Ft=!1})}),n=h(15e3).then(function(){Ft=!1});return Ot.race([t,n])}}),Dt=C,kt=Object.freeze({__proto__:null,EventEmitter:Dt,inherit:function(e,t){function n(){}n.prototype=t.prototype,o.default.utils.extend(e.prototype,new n),(e.prototype.constructor=e).base=t.prototype}}),Ut=c.eventSandbox.listeners;function Bt(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new Dt}var qt=(Bt.prototype._internalListener=function(e,t,n,o,r){this.events.emit("scroll",e),this.stopPropagationFlag&&(o(),r())},Bt.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,Ut.initElementListening(ti,["scroll"]),Ut.addFirstInternalEventBeforeListener(ti,["scroll"],function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n._internalListener.apply(n,e)}))},Bt.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},Bt.prototype.handleScrollEvents=function(n,e){var o=this;this.events.once("scroll",e),pt(n)&&(Ut.initElementListening(n,["scroll"]),Ut.addFirstInternalEventBeforeListener(n,["scroll"],function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o._internalListener.apply(o,e),Ut.cancelElementListening(n)}))},Bt.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},Bt.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new Bt),Gt=(jt.create=function(e){return new jt(e.top,e.right,e.bottom,e.left)},jt.prototype.add=function(e){return this.top+=e.top,this.right+=e.right,this.bottom+=e.bottom,this.left+=e.left,this},jt.prototype.sub=function(e){return"top"in e&&(this.top-=e.top,this.left-=e.left),this.bottom-=e.bottom,this.right-=e.right,this},jt.prototype.round=function(e,t){return void 0===e&&(e=Math.round),void 0===t&&(t=e),this.top=e(this.top),this.right=t(this.right),this.bottom=t(this.bottom),this.left=e(this.left),this},jt.prototype.contains=function(e){return e.x>=this.left&&e.x<=this.right&&e.y>=this.top&&e.y<=this.bottom},jt);function jt(e,t,n,o){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===o&&(o=0),this.top=e,this.right=t,this.bottom=n,this.left=o}var zt=o.default.utils.style,Jt=o.default.utils.style.getBordersWidth,Kt=o.default.utils.style.getComputedStyle,Yt=o.default.utils.style.getElementMargin,Xt=o.default.utils.style.getElementPadding,Qt=o.default.utils.style.getElementScroll,$t=o.default.utils.style.getOptionHeight,Zt=o.default.utils.style.getSelectElementSize,en=o.default.utils.style.isElementVisible,tn=o.default.utils.style.isVisibleChild,nn=o.default.utils.style.getWidth,on=o.default.utils.style.getHeight,rn=o.default.utils.style.getInnerWidth,an=o.default.utils.style.getInnerHeight,ln=o.default.utils.style.getScrollLeft,sn=o.default.utils.style.getScrollTop,un=o.default.utils.style.setScrollLeft,cn=o.default.utils.style.setScrollTop,dn=o.default.utils.style.get,fn=o.default.utils.style.getBordersWidthFloat,hn=o.default.utils.style.getElementPaddingFloat;function pn(e,t,n){for(var o in"string"==typeof t&&zt.set(e,t,n),t)t.hasOwnProperty(o)&&zt.set(e,o,t[o])}function mn(e,t,n){return e<t?n:e<n?t:Math.max(n,t)}function gn(e){return!!Ye(e,!0,function(e){return fe(e)&&"hidden"===zt.get(e,"visibility")})}function En(e){return!!Ye(e,!0,function(e){return fe(e)&&"none"===zt.get(e,"display")})}function vn(e){return!pe(e)||En(e)||gn(e)}function yn(e){return e&&!(e.offsetHeight<=0&&e.offsetWidth<=0)}function bn(e){return fe(e)&&"fixed"===zt.get(e,"position")}function Cn(e){return fe(e)&&"sticky"===zt.get(e,"position")}var Sn=Object.freeze({__proto__:null,getBordersWidth:Jt,getComputedStyle:Kt,getElementMargin:Yt,getElementPadding:Xt,getElementScroll:Qt,getOptionHeight:$t,getSelectElementSize:Zt,isElementVisible:en,isSelectVisibleChild:tn,getWidth:nn,getHeight:on,getInnerWidth:rn,getInnerHeight:an,getScrollLeft:ln,getScrollTop:sn,setScrollLeft:un,setScrollTop:cn,get:dn,getBordersWidthFloat:fn,getElementPaddingFloat:hn,set:pn,getViewportDimensions:function(){return{width:mn(ti.innerWidth,ni.documentElement.clientWidth,ni.body.clientWidth),height:mn(ti.innerHeight,ni.documentElement.clientHeight,ni.body.clientHeight)}},getWindowDimensions:function(e){return new Gt(0,nn(e),on(e),0)},isHiddenNode:gn,isNotDisplayedNode:En,isNotVisibleNode:vn,hasDimensions:yn,isFixedElement:bn,isStickyElement:Cn}),wn=c.utils.browser,Tn=c.eventSandbox.listeners,_n=["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"],In=123;function Pn(e,t,n,o,r){var i,a=c.nativeMethods.eventTargetGetter.call(e)||e.srcElement;if(!t&&!De(a)){if(/^key/.test(e.type)&&((i=e).shiftKey&&i.ctrlKey||(i.altKey||i.metaKey)&&wn.isMacPlatform||i.keyCode===In))return void r();if("blur"===e.type&&a!==ti&&a!==ti.document&&!yn(a))return;n()}}var Nn=(Rn.create=function(e){return"left"in e?new Rn(e.left,e.top):"right"in e?new Rn(e.right,e.bottom):new Rn(e.x,e.y)},Rn.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},Rn.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},Rn.prototype.round=function(e){return void 0===e&&(e=Math.round),this.x=e(this.x),this.y=e(this.y),this},Rn.prototype.eql=function(e){return this.x===e.x&&this.y===e.y},Rn.prototype.mul=function(e){return this.x*=e,this.y*=e,this},Rn.prototype.distance=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},Rn);function Rn(e,t){this.x=e,this.y=t}var Mn=/auto|scroll|hidden/i;function On(e){var t,n=dn(e,"overflowX"),o=dn(e,"overflowY"),r=Mn.test(n),i=Mn.test(o),a=oe(e).documentElement,l=e.scrollHeight;return(c.utils.browser.isChrome||c.utils.browser.isFirefox||c.utils.browser.isSafari)&&(t=e.getBoundingClientRect().top,l=l-a.getBoundingClientRect().top+t),(r||i)&&l>a.scrollHeight}function xn(e){if(Oe(e))return On(e);if(xe(e))return function(e){var t=dn(e,"overflowX"),n=dn(e,"overflowY");if("hidden"===t&&"hidden"===n)return!1;var o=e.scrollHeight>e.clientHeight,r=e.scrollWidth>e.clientWidth;if(o||r)return!0;var i=e.getElementsByTagName("body")[0];if(!i)return!1;if(On(i))return!1;var a=Math.min(e.clientWidth,i.clientWidth),l=Math.min(e.clientHeight,i.clientHeight);return i.scrollHeight>l||i.scrollWidth>a}(e);var t,n,o,r,i,a=(n=dn(t=e,"overflowX"),o=dn(t,"overflowY"),r=Mn.test(n),i=Mn.test(o),new Nn(r,i));if(!a.x&&!a.y)return!1;var l=a.y&&e.scrollHeight>e.clientHeight;return a.x&&e.scrollWidth>e.clientWidth||l}function An(e){var t,n,o=Ke(e);return!ae(e)||(t=le(e))&&(n=Ke(t),o.concat(n)),c.nativeMethods.arrayFilter.call(o,xn)}var Fn=Object.freeze({__proto__:null,hasScroll:xn,getScrollableParents:An}),Ln=o.default.shadowUI,Vn=o.default.nativeMethods,Wn="disabled";function Hn(){this.currentEl=null,this.optionList=null,this.groups=[],this.options=[]}var Dn=(Hn.prototype._createOption=function(e,t){var n=ni.createElement("div"),o=e.disabled||"optgroup"===ze(e.parentElement)&&e.parentElement.disabled,r="option"===ze(e)?e.text:"";Vn.nodeTextContentSetter.call(n,r),t.appendChild(n),Ln.addClass(n,"tcOption"),o&&(Ln.addClass(n,Wn),pn(n,"color",dn(e,"color"))),this.options.push(n)},Hn.prototype._createGroup=function(e,t){var n=ni.createElement("div");Vn.nodeTextContentSetter.call(n,e.label||" "),t.appendChild(n),Ln.addClass(n,"tcOptionGroup"),e.disabled&&(Ln.addClass(n,Wn),pn(n,"color",dn(e,"color"))),this.createChildren(e.children,n),this.groups.push(n)},Hn.prototype.clear=function(){this.optionList=null,this.currentEl=null,this.options=[],this.groups=[]},Hn.prototype.createChildren=function(e,t){for(var n=lt(e),o=0;o<n;o++)Ne(e[o])?this._createOption(e[o],t):"optgroup"===ze(e[o])&&this._createGroup(e[o],t)},Hn.prototype.getEmulatedChildElement=function(e){var t="optgroup"===ze(e),n=nt(this.currentEl,e);return t?this.groups[n]:this.options[n]},Hn.prototype.isOptionListExpanded=function(e){return e?e===this.currentEl:!!this.currentEl},Hn.prototype.isOptionElementVisible=function(e){var t=ue(e);if(!t)return!0;var n=this.isOptionListExpanded(t),o=Zt(t);return n||1<o},new Hn),kn=function(e,t,n,o,r,i){this.width=e,this.height=t,this.left=n.x,this.top=n.y,this.right=n.x+e,this.bottom=n.y+t,this.border=o,this.scrollbar=i,this.scroll=r},Un={notElementOrTextNode:function(e){return"\n The ".concat(e," is neither a DOM element nor a text node.\n ")},elOutsideBounds:function(e,t){return"\n The ".concat(t," (").concat(e,") is located outside the the layout viewport.\n ")},elHasWidthOrHeightZero:function(e,t,n,o){return"\n The ".concat(t," (").concat(e,") is too small to be visible: ").concat(n,"px x ").concat(o,"px.\n ")},elHasDisplayNone:function(e,t){return"\n The ".concat(t," (").concat(e,") is invisible. \n The value of its 'display' property is 'none'.\n ")},parentHasDisplayNone:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible. \n It descends from an element that has the 'display: none' property (").concat(n,").\n ")},elHasVisibilityHidden:function(e,t){return"\n The ".concat(t," (").concat(e,") is invisible.\n The value of its 'visibility' property is 'hidden'.\n ")},parentHasVisibilityHidden:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible.\n It descends from an element that has the 'visibility: hidden' property (").concat(n,").\n ")},elHasVisibilityCollapse:function(e,t){return"\n The ".concat(t," (").concat(e,") is invisible.\n The value of its 'visibility' property is 'collapse'.\n ")},parentHasVisibilityCollapse:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible.\n It descends from an element that has the 'visibility: collapse' property (").concat(n,").\n ")},elNotRendered:function(e,t){return"\n The ".concat(t," (").concat(e,") has not been rendered.\n ")},optionNotVisible:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible. \n The parent element (").concat(n,") is collapsed, and its length is shorter than 2.\n ")},mapContainerNotVisible:function(e,t){return"\n The action target (".concat(e,") is invisible because ").concat(t,"\n ")}},Bn=o.default.utils.html,qn=o.default.nativeMethods,Gn=10;function jn(e){if(!e)return"";var t,n,o,r=qn.cloneNode.call(e),i=Bn.cleanUpHtml(qn.elementOuterHTMLGetter.call(r)),a=(t=qn.nodeTextContentGetter.call(e),n=Gn,void 0===o&&(o="..."),t.length<n?t:t.substring(0,n-o.length)+o),l=qn.elementChildrenGetter.call(e);return 0<qn.htmlCollectionLengthGetter.call(l)?i.replace("></",">...</"):a?i.replace("></",">".concat(a,"</")):i}var zn=o.default.utils.position.getElementRectangle,Jn=o.default.utils.position.getOffsetPosition,Kn=o.default.utils.position.offsetToClientCoords;function Yn(e){var t,n,o,r,i=xe(e),a=i?e.getElementsByTagName("body")[0]:null,l=e.getBoundingClientRect(),s=Gt.create(Jt(e)),u=Qt(e),c=ae(e),d="BackCompat"===e.ownerDocument.compatMode,f=i?new Nn(0,0):Nn.create(l),h=l.height,p=l.width;i&&(p=a&&d?(h=a.clientHeight,a.clientWidth):(h=e.clientHeight,e.clientWidth)),!c||(t=le(e))&&(n=Jn(t),o=Kn(Nn.create(n)),r=Jt(t),f.add(o).add(Nn.create(r)),i&&s.add(r));var m=!i&&rn(e)!==e.clientWidth,g=!i&&an(e)!==e.clientHeight,E={right:m?Ge():0,bottom:g?Ge():0};return new kn(p,h,f,s,u,E)}function Xn(e){var t=e.x,n=e.y,o=ni.elementFromPoint,r=null;try{r=o.call(ni,t,n)}catch(e){return null}for(null===r&&(r=o.call(ni,t-1,n-1));r&&r.shadowRoot&&r.shadowRoot.elementFromPoint;){var i=r.shadowRoot.elementFromPoint(t,n);if(!i||r===i)break;r=i}return r}function Qn(e,t){return Gt.create({top:e.top-t.top,left:e.left-t.left,right:t.right-e.right,bottom:t.bottom-e.bottom}).sub(t.border).sub(t.scrollbar).round(Math.ceil,Math.floor)}function $n(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=oe(e.target||e.srcElement),i=r.documentElement,a=r.body;return new Nn(Math.round(t.clientX+(i&&i.scrollLeft||a&&a.scrollLeft||0)-(i.clientLeft||0)),Math.round(t.clientY+(i&&i.scrollTop||a&&a.scrollTop||0)-(i.clientTop||0)))}return new Nn(Math.round(t.pageX),Math.round(t.pageY))}function Zn(e){return!oo(e)}function eo(e){return"hidden"===dn(e,"visibility")}function to(e){return"collapse"===dn(e,"visibility")}function no(e){return"none"===dn(e,"display")}function oo(e){return!pt(e)&&(eo(e)||to(e)||no(e))}function ro(e){var t=zn(e);return 0===t.width||0===t.height}function io(e){return e.replace(/.*The/,"its")}var ao=Object.freeze({__proto__:null,getElementRectangle:zn,getOffsetPosition:Jn,offsetToClientCoords:Kn,getClientDimensions:Yn,getElementFromPoint:Xn,calcRelativePosition:Qn,getIframeClientCoordinates:function(e){var t=Jn(e),n=t.left,o=t.top,r=Kn({x:n,y:o}),i=Jt(e),a=Xt(e),l=r.x+i.left+a.left,s=r.y+i.top+a.top;return new Gt(s,l+nn(e),s+on(e),l)},containsOffset:function(e,t,n){var o=Yn(e),r=Math.max(e.scrollWidth,o.width),i=Math.max(e.scrollHeight,o.height),a=o.scrollbar.right+o.border.left+o.border.right+r,l=o.scrollbar.bottom+o.border.top+o.border.bottom+i;return(void 0===t||0<=t&&t<=a)&&(void 0===n||0<=n&&n<=l)},getEventAbsoluteCoordinates:function(e){var t,n,o,r=e.target||e.srcElement,i=$n(e),a=oe(r),l=0,s=0;return!ae(a.documentElement)||(t=le(a))&&(n=Jn(t),o=Jt(t),l=n.left+o.left,s=n.top+o.top),new Nn(i.x+l,i.y+s)},getEventPageCoordinates:$n,getIframePointRelativeToParentFrame:function(e,t){var n=at(t),o=Jn(n),r=Jt(n),i=Xt(n);return Kn({x:e.x+o.left+r.left+i.left,y:e.y+o.top+r.top+i.top})},findCenter:function(e){var t=zn(e);return new Nn(Math.round(t.left+t.width/2),Math.round(t.top+t.height/2))},getClientPosition:function(e){var t=Jn(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},isInRectangle:function(e,t){var n=e.x,o=e.y;return n>=t.left&&n<=t.right&&o>=t.top&&o<=t.bottom},getWindowPosition:function(){var e=ti.screenLeft||ti.screenX,t=ti.screenTop||ti.screenY;return new Nn(e,t)},isIframeVisible:Zn,isElementVisible:function e(t){if(!He(t)&&!he(t))return!1;if(Ne(t)||"optgroup"===ze(t))return Dn.isOptionElementVisible(t);if(me(t))return Zn(t);if(Re(t))return!Ye(t,!0,oo)&&!ro(t);if(he(t))return!vn(t);if(!We(t)&&ro(t))return!1;if(Me(t)){var n=je(Je(t,"map"));return!!n&&e(n)}return yn(t)&&!oo(t)},getSubHiddenReason:io,getHiddenReason:function e(t,n){if(void 0===n&&(n="action target"),!t)return null;var o=he(t);if(!He(t)&&!o)return Un.notElementOrTextNode(n);var r=o?t.data:jn(t),i=t.offsetHeight,a=t.offsetWidth;if((Ne(t)||"optgroup"===ze(t))&&!Dn.isOptionElementVisible(t)){var l=jn(ue(t));return Un.optionNotVisible(r,n,l)}if(Me(t)){var s=io(e(je(Je(t,"map")),"container")||"");return Un.mapContainerNotVisible(r,s)}var u=Ye(t,!1,eo);if(u)return Un.parentHasVisibilityHidden(r,n,jn(u));var c=Ye(t,!1,to);if(c)return Un.parentHasVisibilityCollapse(r,n,jn(c));var d=Ye(t,!1,no);return d?Un.parentHasDisplayNone(r,n,jn(d)):eo(t)?Un.elHasVisibilityHidden(r,n):to(t)?Un.elHasVisibilityCollapse(r,n):no(t)?Un.elHasDisplayNone(r,n):he(t)&&!pe(t)?Un.elNotRendered(r,n):!We(t)&&ro(t)||!yn(t)?Un.elHasWidthOrHeightZero(r,n,a,i):null},getElOutsideBoundsReason:function e(t,n){void 0===n&&(n="action target");var o=jn(t);if(Me(t)){var r=io(e(je(Je(t,"map")),"container")||"");return Un.mapContainerNotVisible(o,r)}return Un.elOutsideBounds(o,n)}});function lo(n,o){return v(this,void 0,void 0,function(){var t;return y(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<n?[4,o(t)]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}var so=Object.freeze({__proto__:null,whilst:function(t,n){return v(this,void 0,void 0,function(){return y(this,function(e){switch(e.label){case 0:return t()?[4,n()]:[3,2];case 1:return e.sent(),[3,0];case 2:return[2]}})})},times:lo,each:function(r,i){return v(this,void 0,void 0,function(){var t,n,o;return y(this,function(e){switch(e.label){case 0:t=0,n=r,e.label=1;case 1:return t<n.length?(o=n[t],[4,i(o)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}}),uo=o.default.Promise,co=o.default.eventSandbox.message;function fo(e,o,t){return new uo(function(n){co.on(co.SERVICE_MSG_RECEIVED_EVENT,function e(t){t.message.cmd===o&&(co.off(co.SERVICE_MSG_RECEIVED_EVENT,e),n(t.message))}),co.sendServiceMsg(e,t)})}var ho=(po._isScrollValuesChanged=function(e,t){return ln(e)!==t.left||sn(e)!==t.top},po.prototype._setScroll=function(e,t){var n=this,o=t.left,r=t.top,i=xe(e)?oe(e):e,a={left:ln(i),top:sn(i)},o=Math.max(o,0),r=Math.max(r,0),l=qt.waitForScroll(i);return un(i,o),cn(i,r),po._isScrollValuesChanged(i,a)?l=l.then(function(){n._scrollWasPerformed||(n._scrollWasPerformed=po._isScrollValuesChanged(i,a))}):(l.cancel(),c.Promise.resolve())},po.prototype._getScrollToPoint=function(e,t,n){var o=Math.floor(e.width/2),r=Math.floor(e.height/2),i=this._scrollToCenter?o:Math.min(n.left,o),a=this._scrollToCenter?r:Math.min(n.top,r),l=e.scroll,s=l.left,u=l.top,c=t.x>=s+e.width-i,d=t.x<=s+i,f=t.y>=u+e.height-a,h=t.y<=u+a;return c?s=t.x-e.width+i:d&&(s=t.x-i),f?u=t.y-e.height+a:h&&(u=t.y-a),{left:s,top:u}},po.prototype._getScrollToFullChildView=function(e,t,n){var o,r,i,a,l={left:null,top:null},s=e.width>=t.width,u=e.height>=t.height,c=Qn(t,e);return s&&(o=e.width-t.width,r=Math.min(n.left,o),this._scrollToCenter&&(r=o/2),c.left<r?l.left=Math.round(e.scroll.left+c.left-r):c.right<r&&(l.left=Math.round(e.scroll.left+Math.min(c.left,-c.right)+r))),u&&(i=e.height-t.height,a=Math.min(n.top,i),this._scrollToCenter&&(a=i/2),c.top<a?l.top=Math.round(e.scroll.top+c.top-a):c.bottom<a&&(l.top=Math.round(e.scroll.top+Math.min(c.top,-c.bottom)+a))),l},po._getChildPoint=function(e,t,n){return Nn.create(t).sub(Nn.create(e)).add(Nn.create(e.scroll)).add(Nn.create(t.border)).add(n)},po.prototype._getScrollPosition=function(e,t,n,o){var r=po._getChildPoint(e,t,n),i=this._getScrollToPoint(e,r,o),a=this._getScrollToFullChildView(e,t,o);return{left:Math.max(null===a.left?i.left:a.left,0),top:Math.max(null===a.top?i.top:a.top,0)}},po._getChildPointAfterScroll=function(e,t,n,o){return Nn.create(t).add(Nn.create(e.scroll)).sub(Nn.create(n)).add(o)},po.prototype._isChildFullyVisible=function(e,t,n){var o=po._getChildPointAfterScroll(e,t,e.scroll,n),r=this._getScrollPosition(e,t,n,{left:0,top:0}),i=r.left,a=r.top;return!this._isTargetElementObscuredInPoint(o)&&i===e.scroll.left&&a===e.scroll.top},po.prototype._scrollToChild=function(e,t,n){for(var o=Yn(e),r=Yn(t),i=rn(ti),a=an(ti),l=o.scroll,s=!this._isChildFullyVisible(o,r,n);s;){l=this._getScrollPosition(o,r,n,this._maxScrollMargin);var u=po._getChildPointAfterScroll(o,r,l,n),c=this._isTargetElementObscuredInPoint(u);this._maxScrollMargin.left+=20,this._maxScrollMargin.left>=i&&(this._maxScrollMargin.left=50,this._maxScrollMargin.top+=20),s=c&&this._maxScrollMargin.top<a}return this._maxScrollMargin={left:50,top:50},this._setScroll(e,l)},po.prototype._scrollElement=function(){if(!xn(this._element))return c.Promise.resolve();var e=Yn(this._element),t=this._getScrollToPoint(e,this._offsets,this._maxScrollMargin);return this._setScroll(this._element,t)},po.prototype._scrollParents=function(){var t,n,o=this,r=An(this._element),i=this._element,e=ln(i),a=sn(i),l=Nn.create(this._offsets).sub(new Nn(e,a).round()),s=lo(r.length,function(e){return o._scrollToChild(r[e],i,l).then(function(){t=Yn(i),n=Yn(r[e]),l.add(Nn.create(t)).sub(Nn.create(n)).add(Nn.create(n.border)),i=r[e]})}),u={scrollWasPerformed:this._scrollWasPerformed,offsetX:l.x,offsetY:l.y,maxScrollMargin:this._maxScrollMargin};return s.then(function(){var e;if(!o._skipParentFrames&&(e=ti).top!==e)return u.cmd=po.SCROLL_REQUEST_CMD,fo(u,po.SCROLL_RESPONSE_CMD,ti.parent)}).then(function(){return o._scrollWasPerformed})},po._getPinnedElementAncestorOrSelf=function(e,t){return Ye(e,!0,t)},po.prototype._isTargetElementObscuredInPointByElement=function(e,t){var n=po._getPinnedElementAncestorOrSelf(e,t);return!!n&&!n.contains(this._element)},po.prototype._isTargetElementObscuredInPoint=function(e){var t=Xn(e);return!!t&&(this._isTargetElementObscuredInPointByElement(t,bn)||this._isTargetElementObscuredInPointByElement(t,Cn))},po.prototype.run=function(){var e=this;return this._scrollElement().then(function(){return e._scrollParents()})},po.SCROLL_REQUEST_CMD="automation|scroll|request",po.SCROLL_RESPONSE_CMD="automation|scroll|response",po);function po(e,t,n){this._element=e,this._offsets=new Nn(t.offsetX,t.offsetY),this._scrollToCenter=!!t.scrollToCenter,this._skipParentFrames=!!t.skipParentFrames,this._maxScrollMargin=n||{left:50,top:50},this._scrollWasPerformed=!1}function mo(e){var t=c.nativeMethods.nodeChildNodesGetter.call(e);return!st(t)&&Ro(e)?e:Q(t,Ro)}function go(e){return Q(c.nativeMethods.nodeChildNodesGetter.call(e),function(e){return Ro(e)||!Mo(e)&&go(e)})}function Eo(e){return he(e)||fe(e)&&en(e)}function vo(e){var t=c.nativeMethods.nodeChildNodesGetter.call(e);return H(t,Eo)}function yo(e){var t=c.nativeMethods.nodeChildNodesGetter.call(e);return j(t,Eo)}function bo(e){var t=c.nativeMethods.nodeChildNodesGetter.call(e);return j(t,function(e){return Do(e,!0)})}function Co(e,t){var n,o;if(!De(e)&&!De(t)){var r=c.nativeMethods.nodeChildNodesGetter.call(t);return!ot(t,e)&&st(r)&&/div|p/.test(ze(t))&&(n=go(e))&&!ot(t,n)&&(o=To(n))&&!ot(t,o)&&mo(t)}}function So(e,t){var n,o,r,i=pe(t);if(!De(e)&&!De(t)){var a=c.nativeMethods.nodeChildNodesGetter.call(t);if(!ot(t,e)&&(i&&fe(t)&&st(a)&&!/div|p/.test(ze(t))||Ro(t)&&!ot(t,e)&&t.nodeValue.length)){if(i&&fe(t)){if(!(n=go(e))||ot(t,n))return;if(!(o=To(n))||ot(t,o))return}return(r=function(e){for(var t=null,n=e;!t&&(n=n.previousSibling);)if(!Mo(n)&&!No(n)){t=n;break}return t}(t))&&fe(r)&&/div|p/.test(ze(r))&&mo(r)}}}function wo(e,t){var n,o,r=c.nativeMethods.nodeChildNodesGetter.call(e),i=st(r),a=null,l=t?Ro:he;if(!i&&l(e))return e;for(var s=0;s<i;s++){if(n=r[s],o=fe(n)&&!We(n),l(n))return n;if(pe(n)&&yo(n)&&!o&&(a=wo(n,t)))return a}return a}function To(e){return wo(e,!0)}function _o(e,t){var n,o,r=c.nativeMethods.nodeChildNodesGetter.call(e),i=st(r),a=null;if(!i&&Ro(e))return e;for(var l=i-1;0<=l;l--){if(n=r[l],o=fe(n)&&!We(n),he(n)&&(!t||!No(n)))return n;if(pe(n)&&yo(n)&&!o&&(a=_o(n,!1)))return a}return a}function Io(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 Po(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 No(e){if(!he(e))return!1;var t=e.nodeValue,n=Io(t),o=Po(t);return n===t.length&&0===o}function Ro(e){return he(e)&&!No(e)}function Mo(e){return!pe(e)||De(e)}function Oo(e){var t=e.getAttribute?e.getAttribute("contenteditable"):null;return""===t||"true"===t}function xo(e){var t=Ke(e);if(Oo(e)&&We(e))return e;var n=oe(e);return"on"===n.designMode?n.body:Q(t,function(e){return Oo(e)&&We(e)})}function Ao(e,t){if(ot(e,t))return ot(t,xo(e))?e:c.nativeMethods.nodeParentNodeGetter.call(e);var n=[],o=xo(e),r=null;if(!tt(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!==G(n,r))return r;return o}function Fo(e,t){var n=c.nativeMethods.nodeChildNodesGetter.call(e),o=st(n),r=o<=t,i=n[t],a=0;if(De(e)||!i)return{node:e,offset:t};if(De(i)){if(o<=1)return{node:e,offset:0};(r=o<=t-1)?i=n[o-2]:(i=n[t-1],a=0)}for(;!Mo(i)&&fe(i);){var l=vo(i);if(!l.length){a=0;break}i=l[r?l.length-1:0]}return 0===a||Mo(i)||(a=i.nodeValue?i.nodeValue.length:0),{node:i,offset:a}}function Lo(e,t,n){var o=n?t.focusNode:t.anchorNode,r=n?t.focusOffset:t.anchorOffset,i={node:o,offset:r};return(ot(e,o)||fe(o))&&bo(o)&&(i=Fo(o,r)),{node:i.node,offset:i.offset}}function Vo(e,t,n){var o=n?t.anchorNode:t.focusNode,r=n?t.anchorOffset:t.focusOffset,i={node:o,offset:r};return(ot(e,o)||fe(o))&&bo(o)&&(i=Fo(o,r)),{node:i.node,offset:i.offset}}function Wo(e,t,n){return Uo(e,Lo(e,t,n))}function Ho(e,t,n){return Uo(e,Vo(e,t,n))}function Do(e,t){if(vn(e))return!1;if(he(e))return!0;if(!fe(e))return!1;if(bo(e))return t;var n=c.nativeMethods.nodeParentNodeGetter.call(e),o=!We(n),r=vo(e),i=j(r,function(e){return"br"===ze(e)});return o||i}function ko(l,e){var s={node:null,offset:e};return function e(t){var n,o,r=c.nativeMethods.nodeChildNodesGetter.call(t),i=st(r);if(s.node)return s;if(Mo(t))return s;if(he(t)){if(s.offset<=t.nodeValue.length)return s.node=t,s;t.nodeValue.length&&(!s.node&&So(l,t)&&s.offset--,s.offset-=t.nodeValue.length)}else if(fe(t)){if(!Eo(t))return s;if(0===s.offset&&Do(t,!1))return s.node=t,s.offset=(n=t,o=0,Q(c.nativeMethods.nodeChildNodesGetter.call(n),function(e,t){return o=t,"br"===ze(e)})?o:0),s;(s.node||!Co(l,t)&&!So(l,t))&&(i||"br"!==ze(t))||s.offset--}for(var a=0;a<i;a++)s=e(r[a]);return s}(l)}function Uo(i,e){var a=e.node,l=e.offset,s=0,u=!1;return function e(t){var n=c.nativeMethods.nodeChildNodesGetter.call(t),o=st(n);if(u)return s;if(ot(a,t))return(Co(i,t)||So(i,t))&&s++,u=!0,s+l;if(Mo(t))return s;!o&&t.nodeValue&&t.nodeValue.length?(!u&&So(i,t)&&s++,s+=t.nodeValue.length):(!o&&fe(t)&&"br"===ze(t)||!u&&(Co(i,t)||So(i,t)))&&s++;for(var r=0;r<o;r++)s=e(n[r]);return s}(i)}function Bo(e){var t,n,o,r,i,a=he(e)?e:_o(e,!0);if(!a||(t=a,o=he(n=e)?n:wo(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<G(n,dn(e,"white-space")))return 1}(t,n)))return 0;var l=oe(e).createRange();return l.selectNodeContents(a),Uo(e,{node:a,offset:l.endOffset})}var qo=Object.freeze({__proto__:null,getFirstVisibleTextNode:To,getLastTextNode:_o,getFirstNonWhitespaceSymbolIndex:Io,getLastNonWhitespaceSymbolIndex:Po,isInvisibleTextNode:No,findContentEditableParent:xo,getNearestCommonAncestor:Ao,getSelection:function(e,t,n){return{startPos:Lo(e,t,n),endPos:Vo(e,t,n)}},getSelectionStartPosition:Wo,getSelectionEndPosition:Ho,calculateNodeAndOffsetByPosition:ko,calculatePositionByNodeAndOffset:Uo,getElementBySelection:function(e){var t=Ao(e.anchorNode,e.focusNode);return he(t)?t.parentElement:t},getFirstVisiblePosition:function(e){var t=he(e)?e:To(e),n=oe(e).createRange();return t?(n.selectNodeContents(t),Uo(e,{node:t,offset:n.startOffset})):0},getLastVisiblePosition:Bo,getContentEditableValue:function(e){return D(function e(t){var n=[],o=c.nativeMethods.nodeChildNodesGetter.call(t),r=st(o);Mo(t)||r||!he(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("")}}),Go=o.default.utils.browser,jo=o.default.eventSandbox.selection,zo="backward",Jo="forward",Ko="none";function Yo(e,t,n,o){var r,i,a,l=null,s=null,u=!1;void 0!==t&&void 0!==n&&n<t&&(a=t,t=n,n=a,u=!0),void 0===t&&(s={node:(r=To(e))||e,offset:r&&r.nodeValue?Io(r.nodeValue):0}),void 0===n&&(l={node:(i=_o(e,!0))||e,offset:i&&i.nodeValue?Po(i.nodeValue):0}),s=s||ko(e,t),l=l||ko(e,n),s.node&&l.node&&(u?tr(l,s,o):tr(s,l,o))}function Xo(e){var t=e?oe(e):ni,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 Qo(e,t,n){var o=Uo(e,t);return Uo(e,n)<o}function $o(e){return We(e)?nr(e)?Wo(e,er(e),Xo(e)):0:jo.getSelection(e).start}function Zo(e){return We(e)?nr(e)?Ho(e,er(e),Xo(e)):0:jo.getSelection(e).end}function er(e){var t=oe(e);return t?t.getSelection():ti.getSelection()}function tr(e,t,n){var o=e.node,r=t.node,i=o.nodeValue?o.length:0,a=r.nodeValue?r.length:0,l=e.offset,s=t.offset;fe(o)&&l||(l=Math.min(i,e.offset)),fe(r)&&s||(s=Math.min(a,t.offset));var u=xo(o),c=Qo(u,e,t),d=er(u),f=oe(u).createRange();jo.wrapSetterSelection(u,function(){var e;d.removeAllRanges(),c?(f.setStart(o,l),f.setEnd(o,l),d.addRange(f),e=function(e,t){try{d.extend(e,t)}catch(e){return!1}return!0},(Go.isSafari||Go.isChrome&&Go.version<58)&&No(r)?e(r,Math.min(s,1))||e(r,0):e(r,s)):(f.setStart(o,l),f.setEnd(r,s),d.addRange(f))},n,!0)}function nr(e){var t=er(e);return!(!t.anchorNode||!t.focusNode)&&tt(e,t.anchorNode)&&tt(e,t.focusNode)}var or,rr,ir=Object.freeze({__proto__:null,hasInverseSelectionContentEditable:Xo,isInverseSelectionContentEditable:Qo,getSelectionStart:$o,getSelectionEnd:Zo,hasInverseSelection:function(e){return We(e)?Xo(e):(jo.getSelection(e).direction||Ko)===zo},getSelectionByElement:er,select:function(e,t,n){var o,r,i,a;We(e)?Yo(e,t,n,!0):(o=t||0,i=!1,a=null,(r=void 0===n?ht(e).length:n)<o&&(a=o,o=r,r=a,i=!0),jo.setSelection(e,o,r,i?zo:Jo),Ko=t===n?"none":i?zo:Jo)},selectByNodesAndOffsets:tr,deleteSelectionContents:function(e,t){var n,o,r,i,a,l,s,u,c,d,f,h,p=$o(e),m=Zo(e);t&&Yo(e),p!==m&&(n=er(e),o=n.anchorNode,r=n.focusNode,i=n.anchorOffset,a=n.focusOffset,l=Io(o.nodeValue),s=Po(o.nodeValue),u=Io(r.nodeValue),c=Po(r.nodeValue),f=d=null,he(o)&&(i<l&&0!==i?d=0:i!==o.nodeValue.length&&(No(o)&&0!==i||s<i)&&(d=o.nodeValue.length)),he(r)&&(a<u&&0!==a?f=0:a!==r.nodeValue.length&&(No(r)&&0!==a||c<a)&&(f=r.nodeVal