testcafe 1.20.2-alpha.1 → 2.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/request-hooks/assert-type.js +2 -2
- package/lib/api/request-hooks/hook.js +2 -2
- package/lib/api/request-hooks/request-logger.js +2 -2
- package/lib/api/skip-js-errors/index.js +62 -0
- package/lib/api/structure/base-unit.js +2 -2
- package/lib/api/structure/fixture.js +13 -13
- package/lib/api/structure/test.js +18 -17
- package/lib/api/structure/testing-unit.js +26 -16
- package/lib/api/test-controller/assertion.js +5 -5
- package/lib/api/test-controller/execution-context.js +2 -2
- package/lib/api/test-controller/index.js +33 -30
- package/lib/api/test-controller/proxy.js +2 -2
- package/lib/api/test-page-url.js +4 -4
- package/lib/api/test-run-tracker.js +2 -2
- package/lib/api/wrap-test-function.js +3 -3
- package/lib/assertions/executor.js +4 -4
- package/lib/assertions/get-fn.js +3 -3
- package/lib/browser/connection/gateway.js +18 -18
- package/lib/browser/connection/get-hints.js +8 -8
- package/lib/browser/connection/index.js +11 -11
- package/lib/browser/connection/remotes-queue.js +4 -4
- package/lib/browser/provider/built-in/dedicated/base.js +6 -6
- package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/index.js +10 -10
- package/lib/browser/provider/built-in/dedicated/chrome/config.js +17 -17
- package/lib/browser/provider/built-in/dedicated/chrome/create-temp-profile.js +4 -4
- package/lib/browser/provider/built-in/dedicated/chrome/index.js +6 -6
- package/lib/browser/provider/built-in/dedicated/chrome/local-chrome.js +6 -6
- package/lib/browser/provider/built-in/dedicated/chrome/runtime-info.js +4 -4
- package/lib/browser/provider/built-in/dedicated/edge/runtime-info.js +2 -2
- package/lib/browser/provider/built-in/dedicated/firefox/config.js +8 -8
- package/lib/browser/provider/built-in/dedicated/firefox/create-temp-profile.js +3 -3
- package/lib/browser/provider/built-in/dedicated/firefox/index.js +5 -5
- package/lib/browser/provider/built-in/dedicated/firefox/local-firefox.js +2 -2
- package/lib/browser/provider/built-in/dedicated/firefox/marionette-client/index.js +7 -7
- package/lib/browser/provider/built-in/dedicated/firefox/runtime-info.js +3 -3
- package/lib/browser/provider/built-in/path.js +2 -2
- package/lib/browser/provider/built-in/remote.js +3 -3
- package/lib/browser/provider/index.js +5 -5
- package/lib/browser/provider/plugin-host.js +5 -6
- package/lib/browser/provider/pool.js +4 -4
- package/lib/browser/provider/utils/argument-parsing.js +3 -3
- package/lib/browser/provider/utils/browser-starter.js +2 -2
- package/lib/cli/argument-parser/index.js +52 -41
- package/lib/cli/argument-parser/parse-utils.js +2 -2
- package/lib/cli/authentication-helper.js +3 -3
- package/lib/cli/cli.js +8 -8
- package/lib/cli/correct-browsers-and-sources.js +2 -2
- package/lib/cli/index.js +2 -2
- package/lib/cli/log.js +3 -3
- package/lib/cli/remotes-wizard.js +3 -3
- package/lib/client/automation/index.js +120 -34
- package/lib/client/automation/index.min.js +1 -1
- package/lib/client/browser/idle-page/index.js +321 -317
- package/lib/client/browser/service-worker.js +244 -290
- package/lib/client/core/deps/hammerhead.js +12 -4
- package/lib/client/core/index.js +145 -55
- package/lib/client/core/index.min.js +1 -1
- package/lib/client/core/utils/dom.js +33 -28
- package/lib/client/core/utils/position.js +18 -14
- package/lib/client/core/utils/style.js +8 -4
- package/lib/client/driver/command-executors/client-functions/selector-executor/filter.js +5 -5
- package/lib/client/driver/command-executors/client-functions/selector-executor/utils.js +3 -3
- package/lib/client/driver/deps/hammerhead.js +12 -4
- package/lib/client/driver/deps/testcafe-core.js +12 -4
- package/lib/client/driver/deps/testcafe-ui.js +12 -4
- package/lib/client/driver/index.js +654 -630
- package/lib/client/driver/index.min.js +1 -1
- package/lib/client/driver/status.js +2 -2
- package/lib/client/ui/index.js +10 -8
- package/lib/client/ui/index.min.js +1 -1
- package/lib/client-functions/builder-symbol.js +1 -2
- package/lib/client-functions/client-function-builder.js +12 -12
- package/lib/client-functions/replicator.js +2 -2
- package/lib/client-functions/selector-api-execution-mode.js +2 -2
- package/lib/client-functions/selectors/add-api.js +48 -48
- package/lib/client-functions/selectors/selector-builder.js +17 -17
- package/lib/compiler/compile-client-function.js +6 -6
- package/lib/compiler/index.js +9 -9
- package/lib/compiler/test-file/api-based.js +8 -8
- package/lib/compiler/test-file/base.js +6 -6
- package/lib/compiler/test-file/exportble-lib-path.js +2 -2
- package/lib/compiler/test-file/formats/coffeescript/compiler.js +2 -2
- package/lib/compiler/test-file/formats/coffeescript/get-test-list.js +2 -2
- package/lib/compiler/test-file/formats/es-next/compiler.js +4 -4
- package/lib/compiler/test-file/formats/es-next/get-test-list.js +4 -4
- package/lib/compiler/test-file/formats/raw.js +2 -2
- package/lib/compiler/test-file/formats/typescript/compiler.js +11 -11
- package/lib/compiler/test-file/formats/typescript/get-test-list.js +3 -3
- package/lib/compiler/test-file/test-file-parser-base.js +3 -3
- package/lib/configuration/configuration-base.js +15 -15
- package/lib/configuration/interfaces.js +1 -1
- package/lib/configuration/skip-js-errors-option-names.js +11 -0
- package/lib/configuration/testcafe-configuration.js +21 -16
- package/lib/configuration/types.js +1 -1
- package/lib/configuration/typescript-configuration.js +4 -4
- package/lib/custom-client-scripts/assert-type.js +2 -2
- package/lib/custom-client-scripts/client-script.js +6 -6
- package/lib/custom-client-scripts/get-code.js +2 -2
- package/lib/custom-client-scripts/routing.js +3 -3
- package/lib/custom-client-scripts/utils.js +3 -3
- package/lib/dashboard/connector.js +4 -4
- package/lib/dashboard/get-default-project-link.js +2 -2
- package/lib/dashboard/index.js +26 -26
- package/lib/errors/create-stack-filter.js +2 -2
- package/lib/errors/error-list.js +2 -2
- package/lib/errors/get-callsite.js +2 -2
- package/lib/errors/is-internal-stack-frame.js +5 -5
- package/lib/errors/process-test-fn-error.js +2 -2
- package/lib/errors/runtime/index.js +10 -10
- package/lib/errors/runtime/templates.js +5 -2
- package/lib/errors/runtime/type-assertions.js +6 -6
- package/lib/errors/stack-cleaning-hook.js +2 -2
- package/lib/errors/test-run/formattable-adapter.js +7 -7
- package/lib/errors/test-run/index.js +25 -5
- package/lib/errors/test-run/render-error-template/index.js +6 -6
- package/lib/errors/test-run/render-error-template/utils.js +2 -2
- package/lib/errors/test-run/templates.js +40 -31
- package/lib/errors/test-run/utils.js +7 -7
- package/lib/errors/types.js +5 -1
- package/lib/index.js +1 -1
- package/lib/live/file-watcher/index.js +2 -2
- package/lib/live/keyboard-observer.js +3 -3
- package/lib/live/test-run-controller.js +3 -3
- package/lib/live/test-run.js +3 -2
- package/lib/live/test-runner.js +2 -2
- package/lib/load-assets.js +2 -2
- package/lib/notifications/add-rendered-warning.js +4 -4
- package/lib/notifications/debug-logger.js +6 -6
- package/lib/notifications/deprecated.js +2 -2
- package/lib/notifications/information-message.js +4 -3
- package/lib/proxyless/resource-injector.js +4 -4
- package/lib/reporter/command/command-formatter.js +4 -4
- package/lib/reporter/index.js +10 -10
- package/lib/reporter/plugin-host.js +7 -7
- package/lib/role/index.js +8 -8
- package/lib/role/role.js +2 -2
- package/lib/runner/bootstrapper.js +20 -20
- package/lib/runner/browser-job.js +3 -3
- package/lib/runner/browser-set.js +12 -12
- package/lib/runner/fixture-hook-controller.js +5 -5
- package/lib/runner/index.js +43 -33
- package/lib/runner/task/index.js +10 -6
- package/lib/runner/test-run-hook-controller.js +5 -5
- package/lib/runner/tested-app.js +7 -7
- package/lib/screenshots/capturer.js +17 -17
- package/lib/screenshots/crop.js +8 -8
- package/lib/screenshots/index.js +6 -10
- package/lib/screenshots/utils.js +4 -4
- package/lib/services/compiler/host.js +8 -8
- package/lib/services/compiler/service.js +13 -13
- package/lib/services/compiler/test-run-proxy.js +8 -8
- package/lib/services/serialization/replicator/transforms/callsite-record-transform.js +2 -2
- package/lib/services/serialization/replicator/transforms/command-base-trasform/command-constructors.js +2 -1
- package/lib/services/serialization/replicator/transforms/command-base-trasform/index.js +3 -3
- package/lib/services/serialization/replicator/transforms/raw-command-callsite-record-transform.js +2 -2
- package/lib/services/serialization/test-structure.js +4 -4
- package/lib/services/utils/ipc/interfaces.js +1 -3
- package/lib/services/utils/ipc/io.js +3 -3
- package/lib/services/utils/ipc/message.js +2 -2
- package/lib/services/utils/ipc/proxy.js +4 -4
- package/lib/services/utils/ipc/transport.js +2 -2
- package/lib/shared/errors/index.js +9 -2
- package/lib/shared/errors/selector-error-ctor-callback.js +7 -3
- package/lib/test-run/bookmark.js +1 -1
- package/lib/test-run/browser-manipulation-queue.js +3 -3
- package/lib/test-run/commands/actions.js +66 -46
- package/lib/test-run/commands/assertion.js +3 -3
- package/lib/test-run/commands/base.js +2 -2
- package/lib/test-run/commands/browser-manipulation.js +8 -8
- package/lib/test-run/commands/observation.js +4 -4
- package/lib/test-run/commands/options.js +27 -12
- package/lib/test-run/commands/type.js +2 -1
- package/lib/test-run/commands/utils.js +3 -2
- package/lib/test-run/commands/validations/argument.js +19 -10
- package/lib/test-run/commands/validations/factories.js +10 -2
- package/lib/test-run/commands/validations/initializers.js +4 -4
- package/lib/test-run/debug-log.js +4 -4
- package/lib/test-run/execute-js-expression/index.js +4 -4
- package/lib/test-run/index.js +48 -41
- package/lib/test-run/request/create-request-options.js +9 -9
- package/lib/test-run/request/process-response-data.js +2 -2
- package/lib/test-run/request/send.js +5 -5
- package/lib/testcafe.js +8 -4
- package/lib/utils/check-file-path.js +2 -2
- package/lib/utils/check-url.js +2 -2
- package/lib/utils/correct-file-path.js +4 -4
- package/lib/utils/delegated-api.js +1 -1
- package/lib/utils/detect-ffmpeg.js +3 -3
- package/lib/utils/diff/colors.js +2 -2
- package/lib/utils/diff/index.js +11 -7
- package/lib/utils/diff/util.js +5 -5
- package/lib/utils/diff.js +4 -4
- package/lib/utils/escape-user-agent.js +2 -2
- package/lib/utils/execute-fn-with-timeout.js +2 -2
- package/lib/utils/get-browser.js +2 -2
- package/lib/utils/get-filter-fn.js +4 -4
- package/lib/utils/get-options/base.js +2 -2
- package/lib/utils/get-options/compiler.js +2 -2
- package/lib/utils/get-options/dashboard.js +2 -2
- package/lib/utils/get-options/get-assertion-timeout.js +1 -1
- package/lib/utils/get-options/index.js +4 -2
- package/lib/utils/get-options/meta.js +2 -2
- package/lib/utils/get-options/quarantine.js +8 -6
- package/lib/utils/get-options/screenshot.js +2 -2
- package/lib/utils/get-options/skip-js-errors.js +35 -0
- package/lib/utils/get-options/ssl.js +6 -6
- package/lib/utils/get-options/video.js +2 -2
- package/lib/utils/is-password-input.js +1 -1
- package/lib/utils/log-entry.js +2 -2
- package/lib/utils/make-reg-exp.js +19 -6
- package/lib/utils/moment-loader.js +2 -2
- package/lib/utils/parse-file-list.js +7 -7
- package/lib/utils/path-pattern.js +4 -4
- package/lib/utils/prepare-reporters.js +2 -2
- package/lib/utils/prerender-callsite.js +6 -6
- package/lib/utils/process.js +7 -7
- package/lib/utils/promisified-functions.js +14 -14
- package/lib/utils/raw-command-callsite-record.js +2 -2
- package/lib/utils/resolve-path-relatively-cwd.js +2 -2
- package/lib/utils/string.js +3 -3
- package/lib/utils/temp-directory/cleanup-process/index.js +6 -6
- package/lib/utils/temp-directory/cleanup-process/worker.js +4 -4
- package/lib/utils/temp-directory/index.js +6 -6
- package/lib/utils/temp-directory/lockfile.js +2 -2
- package/lib/video-recorder/process.js +6 -6
- package/lib/video-recorder/recorder.js +9 -9
- package/lib/video-recorder/test-run-video-recorder.js +2 -2
- package/package.json +8 -7
- package/ts-defs/index.d.ts +46 -7
- package/ts-defs/selectors.d.ts +39 -0
- package/ts-defs/testcafe-scripts.d.ts +39 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
window["%hammerhead%"].utils.removeInjectedScript(),function jc($c){var Qc=$c.document;!function(m,e,g,i){var p="default"in m?m.default:m;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var y="default"in g?g.default:g;i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;var n=p.nativeMethods,o=/^((mouse\w+)|((dbl)?click)|(contextmenu))$/,r=/^((drag\w*)|(drop))$/,s=/^key\w+$/,l=/^(before)?input$/,a=/^(blur|(focus(in|out)?))$/,u=/^pointer\w+/,c={click:1,dblclick:2,mousedown:1,mouseup:1},h="MouseEvent",f="PointerEvent",d="KeyboardEvent",v="InputEvent",E="FocusEvent",t=(b.prototype.run=function(){var t=this.options,e=t.bubbles,n=t.cancelable,i=t.detail,o=(t.view,t.buttons),e=!1!==e,n=!1!==n,i=i||c[this.eventName],o=void 0===o?1:o;Object.assign(this.options,{bubbles:e,cancelable:n,detail:i,view:$c,buttons:o});var r,s=b._getEventCtorByEventType(this.eventName,this.options.eventConstructor);s&&(r=new s(this.eventName,this.options),this.element.dispatchEvent(r))},b._getEventCtorByEventType=function(t,e){if(e&&"function"==typeof b._getEventCtorFromWindow(e)){var n=b._getEventCtorFromNativeMethods(e);if(n&&"function"==typeof n)return n}return o.test(t)||r.test(t)?b._getEventCtorFromNativeMethods(h):u.test(t)?b._getEventCtorFromNativeMethods(f):s.test(t)?b._getEventCtorFromNativeMethods(d):l.test(t)?b._getEventCtorFromNativeMethods(v):a.test(t)?b._getEventCtorFromNativeMethods(E):b._getEventCtorFromNativeMethods("CustomEvent")},b._getEventCtorFromNativeMethods=function(t){return n["Window"+t]||b._getEventCtorFromWindow(t)},b._getEventCtorFromWindow=function(t){return $c[t]},b);function b(t,e,n){this.element=t,this.eventName=e,this.options=n}var S=function(t,e){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function _(t,e){function n(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function w(t,s,l,a){return new(l=l||e)(function(n,e){function i(t){try{r(a.next(t))}catch(t){e(t)}}function o(t){try{r(a.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):((e=t.value)instanceof l?e:new l(function(t){t(e)})).then(i,o)}r((a=a.apply(t,s||[])).next())})}function P(n,i){var o,r,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(s=2&e[0]?r.return:e[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,e[1])).done)return s;switch(r=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,r=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){l.label=e[1];break}if(6===e[0]&&l.label<s[1]){l.label=s[1],s=e;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(e);break}s[2]&&l.ops.pop(),l.trys.pop();continue}e=i.call(n,l)}catch(t){e=[6,t],r=0}finally{o=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var x=(C.create=function(t){return"left"in t?new C(t.left,t.top):"right"in t?new C(t.right,t.bottom):new C(t.x,t.y)},C.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},C.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},C.prototype.round=function(t){return void 0===t&&(t=Math.round),this.x=t(this.x),this.y=t(this.y),this},C.prototype.eql=function(t){return this.x===t.x&&this.y===t.y},C.prototype.mul=function(t){return this.x*=t,this.y*=t,this},C.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},C);function C(t,e){this.x=t,this.y=e}function A(t){var e="array"+t.charAt(0).toUpperCase()+t.slice(1),n=m.nativeMethods[e];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,t)}}A("filter"),A("map"),A("slice"),A("splice"),A("unshift"),A("forEach"),A("indexOf");var T=A("some"),M=(A("reverse"),A("reduce"),A("concat"),A("join"),p.utils.browser,p.nativeMethods),D=(p.utils.style.get,p.utils.dom.getActiveElement,p.utils.dom.findDocument),I=p.utils.dom.find,U=(p.utils.dom.isElementInDocument,p.utils.dom.isElementInIframe),k=p.utils.dom.getIframeByElement,B=(p.utils.dom.isCrossDomainWindows,p.utils.dom.getSelectParent,p.utils.dom.getChildVisibleIndex,p.utils.dom.getSelectVisibleChildren,p.utils.dom.isElementNode),O=(p.utils.dom.isTextNode,p.utils.dom.isRenderedNode,p.utils.dom.isIframeElement,p.utils.dom.isInputElement,p.utils.dom.isButtonElement,p.utils.dom.isFileInput,p.utils.dom.isTextAreaElement,p.utils.dom.isAnchorElement,p.utils.dom.isImgElement),N=(p.utils.dom.isFormElement,p.utils.dom.isLabelElement,p.utils.dom.isSelectElement,p.utils.dom.isRadioButtonElement,p.utils.dom.isColorInputElement,p.utils.dom.isCheckboxElement,p.utils.dom.isOptionElement,p.utils.dom.isSVGElement,p.utils.dom.isMapElement,p.utils.dom.isBodyElement),F=p.utils.dom.isHtmlElement,L=(p.utils.dom.isDocument,p.utils.dom.isWindow,p.utils.dom.isTextEditableInput,p.utils.dom.isTextEditableElement,p.utils.dom.isTextEditableElementAndEditingAllowed,p.utils.dom.isContentEditableElement,p.utils.dom.isDomElement,p.utils.dom.isShadowUIElement,p.utils.dom.isShadowRoot,p.utils.dom.isElementFocusable,p.utils.dom.isHammerheadAttr,p.utils.dom.isElementReadOnly,p.utils.dom.getScrollbarSize),Y=(p.utils.dom.getMapContainer,p.utils.dom.getTagName),K=p.utils.dom.closest,R=p.utils.dom.getParents,W=p.utils.dom.findParent;function V(t,e){return t.contains?t.contains(e):T(t,function(t){return t.contains(e)})}function X(t){return M.nodeTextContentGetter.call(t)}p.utils.dom.getTopSameDomainWindow,p.utils.dom.getParentExceptShadowRoot;var H=(G.create=function(t){return new G(t.top,t.right,t.bottom,t.left)},G.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},G.prototype.sub=function(t){return"top"in t&&(this.top-=t.top,this.left-=t.left),this.bottom-=t.bottom,this.right-=t.right,this},G.prototype.round=function(t,e){return void 0===t&&(t=Math.round),void 0===e&&(e=t),this.top=t(this.top),this.right=e(this.right),this.bottom=e(this.bottom),this.left=t(this.left),this},G.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},G);function G(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.top=t,this.right=e,this.bottom=n,this.left=i}var q=p.utils.style,z=p.utils.style.getBordersWidth,j=(p.utils.style.getComputedStyle,p.utils.style.getElementMargin,p.utils.style.getElementPadding),$=p.utils.style.getElementScroll,Q=(p.utils.style.getOptionHeight,p.utils.style.getSelectElementSize,p.utils.style.isElementVisible,p.utils.style.isVisibleChild,p.utils.style.getWidth),Z=p.utils.style.getHeight,J=p.utils.style.getInnerWidth,tt=p.utils.style.getInnerHeight,et=p.utils.style.getScrollLeft,nt=p.utils.style.getScrollTop,it=p.utils.style.setScrollLeft,ot=p.utils.style.setScrollTop,rt=p.utils.style.get;function st(t){return B(t)&&"fixed"===q.get(t,"position")}var lt=function(t,e,n,i,o,r){this.width=t,this.height=e,this.left=n.x,this.top=n.y,this.right=n.x+t,this.bottom=n.y+e,this.border=i,this.scrollbar=r,this.scroll=o},at=p.utils.position.getElementRectangle,ut=p.utils.position.getOffsetPosition,ct=p.utils.position.offsetToClientCoords;function ht(t){var e,n,i,o,r=F(t),s=r?t.getElementsByTagName("body")[0]:null,l=t.getBoundingClientRect(),a=H.create(z(t)),u=$(t),c=U(t),h="BackCompat"===t.ownerDocument.compatMode,f=r?new x(0,0):x.create(l),d=l.height,m=l.width;r&&(m=s&&h?(d=s.clientHeight,s.clientWidth):(d=t.clientHeight,t.clientWidth)),!c||(e=k(t))&&(n=ut(e),i=ct(x.create(n)),o=z(e),f.add(i).add(x.create(o)),r&&a.add(o));var p=!r&&J(t)!==t.clientWidth,v=!r&&tt(t)!==t.clientHeight,g={right:p?L():0,bottom:v?L():0};return new lt(m,d,f,a,u,g)}function ft(t){var e=t.x,n=t.y,i=Qc.getElementFromPoint||Qc.elementFromPoint,o=null;try{o=i.call(Qc,e,n)}catch(t){return null}for(null===o&&(o=i.call(Qc,e-1,n-1));o&&o.shadowRoot&&o.shadowRoot.elementFromPoint;){var r=o.shadowRoot.elementFromPoint(e,n);if(!r||o===r)break;o=r}return o}function dt(t,e,n){var i=ht(t),o=Math.max(t.scrollWidth,i.width),r=Math.max(t.scrollHeight,i.height),s=i.scrollbar.right+i.border.left+i.border.right+o,l=i.scrollbar.bottom+i.border.top+i.border.bottom+r;return(void 0===e||0<=e&&e<=s)&&(void 0===n||0<=n&&n<=l)}function mt(t){var e=ut(t),n=e.left,i=e.top,o=ct({x:n,y:i});return o.x=Math.round(o.x),o.y=Math.round(o.y),o}function pt(n,e){return m.Promise.resolve(n===Qc.documentElement).then(function(t){if(t)return new x(0,0);var e=m.utils.browser.isFirefox?Math.ceil:Math.round;return m.Promise.resolve(ut(n,e)).then(function(t){return x.create(t)})}).then(function(t){return t.add(e)})}var vt=/auto|scroll|hidden/i,gt="visible";function Et(t){var e,n=rt(t,"overflowX"),i=rt(t,"overflowY"),o=vt.test(n),r=vt.test(i),s=D(t).documentElement,l=t.scrollHeight;return(m.utils.browser.isChrome||m.utils.browser.isFirefox||m.utils.browser.isSafari)&&(e=t.getBoundingClientRect().top,l=l-s.getBoundingClientRect().top+e),(o||r)&&l>s.scrollHeight}function yt(t){if(N(t))return Et(t);if(F(t))return function(t){var e=rt(t,"overflowX"),n=rt(t,"overflowY");if("hidden"===e&&"hidden"===n)return!1;var i=t.scrollHeight>t.clientHeight,o=t.scrollWidth>t.clientWidth;if(i||o)return!0;var r=t.getElementsByTagName("body")[0];if(!r)return!1;if(Et(r))return!1;var s=Math.min(t.clientWidth,r.clientWidth),l=Math.min(t.clientHeight,r.clientHeight);return r.scrollHeight>l||r.scrollWidth>s}(t);var e,n,i,o,r,s=(n=rt(e=t,"overflowX"),i=rt(e,"overflowY"),o=vt.test(n),r=vt.test(i),m.utils.browser.isIE&&(o=o||r&&n===gt,r=r||o&&i===gt),new x(o,r));if(!s.x&&!s.y)return!1;var l=s.y&&t.scrollHeight>t.clientHeight;return s.x&&t.scrollWidth>t.clientWidth||l}function bt(t){if(!t)return null;var e,n,i=(e=$c.screenLeft||$c.screenX,n=$c.screenTop||$c.screenY,new x(e,n)),o=i.x,r=i.y,s=o+t.x,l=r+t.y;return new x(s,l)}function St(t){var e=t/2;return e<1?0:Math.round(e)}function _t(t){var e=at(t);return{offsetX:St(e.width),offsetY:St(e.height)}}function wt(t,e,n){var i=_t(t);if(e="number"==typeof e?Math.round(e):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<e&&0<n)return{offsetX:e,offsetY:n};var o=ht(t),r=Math.round(Math.max(t.scrollWidth,o.width)),s=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+r,a=o.scrollbar.bottom+o.border.top+o.border.bottom+s;return{offsetX:e<0?l+e:e,offsetY:n<0?a+n:n}}var Pt=y.positionUtils;function xt(e,n){return void 0===n&&(n=!1),i.hide(n).then(function(){var t=Pt.getElementFromPoint(e);return i.show(n).then(function(){return t})})}function Ct(t,n){return m.Promise.resolve(ft(t)).then(function(e){return m.Promise.resolve(V(n,e)).then(function(t){return t&&X(e)}).then(function(t){return t||e&&e===n?e:null})})}function At(n,i){if(!i||!n||n===i)return n;if("tref"===Y(i))return i;var e,o,t="area"===Y(i)&&O(n);return m.utils.browser.isFirefox&&t?(e=n,o=i,m.Promise.resolve(K(o,"map")).then(function(t){return t&&t.name===e.useMap.substring(1)?o:e})):m.Promise.resolve(K(i,"a")).then(function(t){return!!t}).then(function(t){return!!t&&m.Promise.resolve(V(i,n)).then(function(t){return t&&X(n)}).then(function(t){return!t&&X(i)})}).then(function(t){return t?m.Promise.resolve(ht(i)).then(function(e){return Ct({x:e.right-1,y:e.top+1},i).then(function(t){return t||Ct({x:e.left+1,y:e.bottom-1},i)}).then(function(t){return t||n})}):n})}function Tt(n,i,o){return xt(n).then(function(t){var e=m.Promise.resolve(t);return!t&&m.utils.dom.isIframeWindow(i||$c)&&0<n.x&&0<n.y&&(e=e.then(function(){return xt(n,!0)})),e.then(function(t){return At(t,o)})})}var Mt={elementIsInvisibleError:"elementIsInvisibleError",foundElementIsNotTarget:"foundElementIsNotTarget"},Dt=(Object.defineProperty(It.prototype,"mouseActionStepDelay",{get:function(){return 1===this._speedFactor?10:400*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(It.prototype,"keyActionStepDelay",{get:function(){return 1===this._speedFactor?10:200*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(It.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this._speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(It.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this._speedFactor)/4},enumerable:!1,configurable:!0}),It);function It(t){this._speedFactor=t||1}var Ut=p.Promise,kt=p.nativeMethods;function Bt(e){return new Ut(function(t){return kt.setTimeout.call($c,t,e)})}function Ot(){return Bt(0)}var Nt=(Ft.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},Ft.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t)for(var i=this._getAssignableProperties(),o=0;o<i.length;o++){for(var r,s=i[o],l=s.name,a=s.type,u=s.required,c=s.init,h=s.defaultValue,f=l.split("."),d=f.length-1,m=f[d],p=t,v=this,g=0;g<d&&p&&v;g++)p=p[f[g]],v=v[f[g]];v&&"defaultValue"in i[o]&&(v[l]=h),p&&v&&(void 0===(r=p[m])&&!u||(e&&a&&a(l,r),v[m]=c?c(l,r,n,e):r))}},Ft);function Ft(){}function Lt(i){return function(t,e){var n=typeof e;if("number"!=n)throw new i(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new i(t,e)}}function Yt(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var Kt,Rt,Wt,Vt="E1",Xt="E4",Ht="E5",Gt="E9",qt="E10",zt="E11",jt="E12",$t="E24",Qt="E26",Zt="E27",Jt="E28",te="E29",ee="E30",ne="E31",ie="E32",oe="E33",re="E34",se="E35",le="E36",ae="E37",ue="E39",ce="E40",he="E41",fe="E42",de="E43",me="E44",pe="E45",ve="E46",ge="E49",Ee="E50",ye="E51",be="E52",Se="E57",_e="E64",we="E65",Pe="E68",xe="E69",Ce="E70",Ae="E71",Te="E72",Me="E73",De="E74",Ie="E76",Ue="E77",ke="E78",Be="E82",Oe="E83",Ne="E90",Fe="E91",Le="E92",Ye="E93",Ke="E94",Re="E95",We=(_(Ve,Kt=Yt),Ve);function Ve(t,e,n){var i=Kt.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function Xe(t,e){var n=Rt.call(this,ge,e)||this;return n.instantiationCallsiteName=t,n}function He(t,e){var n=Wt.call(this,Ee,e)||this;return n.instantiationCallsiteName=t,n}_(Xe,Rt=Yt),_(He,Wt=Yt);var Ge,qe,ze,je,$e,Qe,Ze,Je,tn=(_(en,Ge=Yt),en);function en(t,e,n){var i=e.apiFnChain,o=e.apiFnIndex,r=Ge.call(this,t,n)||this;return r.apiFnChain=i,r.apiFnIndex=o,r}function nn(t){return qe.call(this,ye,t)||this}function on(t,e){return ze.call(this,be,e,t)||this}function rn(t,e){var n=je.call(this,Vt)||this;return n.errStack=t,n.pageDestUrl=e,n}function sn(t,e,n){var i=$e.call(this,Xt,n)||this;return i.errMsg=String(e),i.instantiationCallsiteName=t,i}function ln(t,e,n,i){var o=Qe.call(this,Ht,i)||this;return o.errMsg=String(e),o.property=n,o.instantiationCallsiteName=t,o}function an(t){var e=Ze.call(this,_e)||this;return e.errMsg=String(t),e}function un(t,e){var n=Je.call(this,we)||this;return n.errMsg=String(t),n.moduleName=e,n}_(nn,qe=Yt),_(on,ze=tn),_(rn,je=Yt),_(sn,$e=Yt),_(ln,Qe=Yt),_(an,Ze=Yt),_(un,Je=Yt);var cn,hn=(_(fn,cn=We),fn);function fn(t,e){return cn.call(this,Gt,t,e)||this}var dn,mn=(_(pn,dn=We),pn);function pn(t,e){return dn.call(this,qt,t,e)||this}var vn,gn=(_(En,vn=We),En);function En(t,e){return vn.call(this,zt,t,e)||this}var yn,bn=(_(Sn,yn=We),Sn);function Sn(t,e){return yn.call(this,jt,t,e)||this}var _n,wn=(_(Pn,_n=We),Pn);function Pn(t,e){return _n.call(this,Ne,t,e)||this}var xn,Cn=(_(An,xn=We),An);function An(t,e){return xn.call(this,Fe,t,e)||this}var Tn,Mn=(_(Dn,Tn=We),Dn);function Dn(t,e){return Tn.call(this,Le,t,e)||this}var In,Un=(_(kn,In=We),kn);function kn(t,e){return In.call(this,Ye,t,e)||this}var Bn,On=(_(Nn,Bn=We),Nn);function Nn(t,e){return Bn.call(this,Ke,t,e)||this}var Fn,Ln,Yn,Kn,Rn,Wn,Vn,Xn,Hn,Gn,qn,zn,jn,$n,Qn,Zn,Jn,ti,ei,ni,ii,oi,ri,si,li,ai,ui,ci,hi,fi,di,mi,pi,vi,gi,Ei=(_(yi,Fn=We),yi);function yi(t,e){return Fn.call(this,Re,t,e)||this}function bi(t,e){return Ln.call(this,$t,e,t)||this}function Si(t){return Yn.call(this,Qt,t)||this}function _i(t){var e=Kn.call(this,Zt)||this;return e.nodeDescription=t,e}function wi(t,e){var n=Rn.call(this,Jt,e)||this;return n.argumentName=t,n}function Pi(t){var e=Wn.call(this,te)||this;return e.argumentName=t,e}function xi(t,e){var n=Vn.call(this,ee)||this;return n.argumentName=t,n.nodeDescription=e,n}function Ci(){return Xn.call(this,ne)||this}function Ai(){return Hn.call(this,ie)||this}function Ti(t){var e=Gn.call(this,oe)||this;return e.argumentName=t,e}function Mi(){return qn.call(this,se)||this}function Di(t){var e=zn.call(this,le)||this;return e.argumentName=t,e}function Ii(t,e){var n=jn.call(this,ae)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function Ui(){return $n.call(this,re)||this}function ki(t,e){var n=Qn.call(this,he)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function Bi(t,e){var n=Zn.call(this,Se)||this;return t<=0?e<=0?(n.verb="are",n.dimensions="width and height"):(n.verb="is",n.dimensions="width"):(n.verb="is",n.dimensions="height"),n}function Oi(t){return Jn.call(this,ce,t)||this}function Ni(){return ti.call(this,ue)||this}function Fi(){return ei.call(this,fe)||this}function Li(){return ni.call(this,xe)||this}function Yi(){return ii.call(this,Pe)||this}function Ki(){return oi.call(this,Ce)||this}function Ri(){return ri.call(this,Ae)||this}function Wi(){return si.call(this,Me)||this}function Vi(){return li.call(this,Be)||this}function Xi(t){var e=ai.call(this,ke)||this;return e.errMsg=t,e}function Hi(){return ui.call(this,De)||this}function Gi(){return ci.call(this,Ie)||this}function qi(){return hi.call(this,Ue)||this}function zi(){return fi.call(this,Te)||this}function ji(){return di.call(this,Oe)||this}function $i(){return mi.call(this,de)||this}function Qi(){return pi.call(this,me)||this}function Zi(t,e){var n=vi.call(this,pe)||this;return n.dialogType=t,n.pageUrl=e,n}function Ji(t,e,n){var i=gi.call(this,ve)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}_(bi,Ln=tn),_(Si,Yn=Yt),_(_i,Kn=Yt),_(wi,Rn=tn),_(Pi,Wn=Yt),_(xi,Vn=Yt),_(Ci,Xn=Yt),_(Ai,Hn=Yt),_(Ti,Gn=Yt),_(Mi,qn=Yt),_(Di,zn=Yt),_(Ii,jn=Yt),_(Ui,$n=Yt),_(ki,Qn=Yt),_(Bi,Zn=Yt),_(Oi,Jn=Yt),_(Ni,ti=Yt),_(Fi,ei=Yt),_(Li,ni=Yt),_(Yi,ii=Yt),_(Ki,oi=Yt),_(Ri,ri=Yt),_(Wi,si=Yt),_(Vi,li=Yt),_(Xi,ai=Yt),_(Hi,ui=Yt),_(Gi,ci=Yt),_(qi,hi=Yt),_(zi,fi=Yt),_(ji,di=Yt),_($i,mi=Yt),_(Qi,pi=Yt),_(Zi,vi=Yt),_(Ji,gi=Yt);var to,eo,no,io,oo,ro,so,lo,ao,uo,co,ho=Lt(hn),fo=(eo=Lt(to=mn),function(t,e){if(eo(t,e),e<0)throw new to(t,e)}),mo=(no=gn,function(t,e){var n=typeof e;if("boolean"!=n)throw new no(t,n)}),po=(io=bn,function(t,e){var n=typeof e;if("number"!=n)throw new io(t,n);if(isNaN(e)||e<.01||1<e)throw new io(t,e)}),vo=(oo=wn,function(t,e){var n=typeof e;if("string"!=n)throw new oo(t,n)}),go=(ro=Cn,function(t,e){if(!(e instanceof Date))throw new ro(t,e)}),Eo=(so=Mn,function(t,e){if(isNaN(Number(e)))throw new so(t,typeof e)}),yo=(lo=Un,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new lo(t,n)}),bo=(ao=On,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new ao(t,n)}),So=(uo=Ei,function(t,e){var n=typeof e;if("object"!=n)throw new uo(t,n)}),_o=(_(wo,co=Nt),wo.prototype._getAssignableProperties=function(){return[{name:"speed",type:po}]},wo);function wo(t,e){var n=co.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var Po,xo=(_(Co,Po=_o),Co.prototype._getAssignableProperties=function(){return Po.prototype._getAssignableProperties.call(this).concat([{name:"offsetX",type:ho},{name:"offsetY",type:ho}])},Co);function Co(t,e){var n=Po.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var Ao,To,Mo=(_(Do,Ao=xo),Do.prototype._getAssignableProperties=function(){return Ao.prototype._getAssignableProperties.call(this).concat([{name:"scrollToCenter",type:mo},{name:"skipParentFrames",type:mo}])},Do);function Do(t,e){var n=Ao.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}function Io(t,e){var n=To.call(this)||this;return n.scrollTargetX=null,n.scrollTargetY=null,n.includeMargins=!1,n.includeBorders=!0,n.includePaddings=!0,n.crop={left:null,right:null,top:null,bottom:null},n._assignFrom(t,e),n}_(Io,To=_o),Io.prototype._getAssignableProperties=function(){return To.prototype._getAssignableProperties.call(this).concat([{name:"scrollTargetX",type:ho},{name:"scrollTargetY",type:ho},{name:"crop.left",type:ho},{name:"crop.right",type:ho},{name:"crop.top",type:ho},{name:"crop.bottom",type:ho},{name:"includeMargins",type:mo},{name:"includeBorders",type:mo},{name:"includePaddings",type:mo}])};var Uo,ko=(_(Bo,Uo=xo),Bo.prototype._getAssignableProperties=function(){return Uo.prototype._getAssignableProperties.call(this).concat([{name:"modifiers.ctrl",type:mo},{name:"modifiers.alt",type:mo},{name:"modifiers.shift",type:mo},{name:"modifiers.meta",type:mo}])},Bo);function Bo(t,e){var n=Uo.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var Oo,No=(_(Fo,Oo=ko),Fo.prototype._getAssignableProperties=function(){return Oo.prototype._getAssignableProperties.call(this).concat([{name:"caretPos",type:fo}])},Fo);function Fo(t,e){var n=Oo.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var Lo,Yo=(_(Ko,Lo=ko),Ko.prototype._getAssignableProperties=function(){return Lo.prototype._getAssignableProperties.call(this).concat([{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:mo},{name:"skipDefaultDragBehavior",type:mo}])},Ko);function Ko(t,e){var n=Lo.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}var Ro,Wo,Vo,Xo,Ho,Go,qo=(_(zo,Ro=No),zo.prototype._getAssignableProperties=function(){return Ro.prototype._getAssignableProperties.call(this).concat([{name:"replace",type:mo},{name:"paste",type:mo},{name:"confidential",type:mo}])},zo);function zo(t,e){var n=Ro.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function jo(t,e){var n=Wo.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function $o(t,e){var n=Vo.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function Qo(t,e){var n=Xo.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function Zo(t,e){var n=Ho.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function Jo(t,e){var n=Go.call(this)||this;return n._assignFrom(t,e),n}_(jo,Wo=ko),jo.prototype._getAssignableProperties=function(){return Wo.prototype._getAssignableProperties.call(this).concat([{name:"destinationOffsetX",type:ho},{name:"destinationOffsetY",type:ho}])},_($o,Vo=Nt),$o.prototype._getAssignableProperties=function(){return[{name:"portraitOrientation",type:mo}]},_(Qo,Xo=Nt),Qo.prototype._getAssignableProperties=function(){return[{name:"timeout",type:fo},{name:"allowUnawaitedPromise",type:mo}]},_(Zo,Ho=_o),Zo.prototype._getAssignableProperties=function(){return Ho.prototype._getAssignableProperties.call(this).concat([{name:"confidential",type:mo}])},_(Jo,Go=Nt),Jo.prototype._getAssignableProperties=function(){return[{name:"name",type:vo},{name:"value",type:vo},{name:"domain",type:vo},{name:"path",type:vo},{name:"expires",type:go},{name:"maxAge",type:Eo},{name:"secure",type:mo},{name:"httpOnly",type:mo},{name:"sameSite",type:vo}]};var tr,er=(_(nr,tr=Nt),nr.prototype._getAssignableProperties=function(){return[{name:"username",type:vo,required:!0},{name:"password",type:vo}]},nr);function nr(t,e){var n=tr.call(this)||this;return n._assignFrom(t,e),n}var ir,or,rr,sr=(_(lr,ir=Nt),lr.prototype._getAssignableProperties=function(){return[{name:"protocol",type:vo},{name:"host",type:vo,required:!0},{name:"port",type:Eo,required:!0},{name:"auth",type:So,init:cr}]},lr);function lr(t,e){var n=ir.call(this)||this;return n._assignFrom(t,e),n}function ar(t,e){var n=or.call(this)||this;return n._assignFrom(t,e),n}function ur(t,e){var n=rr.call(this)||this;return n._assignFrom(t,e),n}function cr(t,e,n,i){return void 0===i&&(i=!0),new er(e,i)}function hr(t,e,n,i){return void 0===i&&(i=!0),new sr(e,i)}_(ar,or=Nt),ar.prototype._getAssignableProperties=function(){return[{name:"url",type:yo},{name:"method",type:vo},{name:"headers",type:So},{name:"params",type:bo},{name:"body"},{name:"timeout",type:Eo},{name:"withCredentials",type:mo},{name:"auth",type:So,init:cr},{name:"proxy",type:So,init:hr},{name:"rawResponse",type:mo}]},_(ur,rr=Nt),ur.prototype._getAssignableProperties=function(){return[{name:"credentials",type:Eo}]};var fr=null,dr=function(){return fr},mr=function(t){fr=t},pr=(p.Promise,p.nativeMethods,p.eventSandbox.listeners,p.utils.browser,p.utils.event.BUTTON,p.utils.event.BUTTONS_PARAMETER);function vr(t){return t.top!==t}p.utils.event.DOM_EVENTS,p.utils.event.WHICH_PARAMETER,p.utils.event.preventDefault;var gr=p.Promise,Er=p.eventSandbox.message;function yr(t,i,e){return new gr(function(n){Er.on(Er.SERVICE_MSG_RECEIVED_EVENT,function t(e){e.message.cmd===i&&(Er.off(Er.SERVICE_MSG_RECEIVED_EVENT,t),n(e.message))}),Er.sendServiceMsg(t,e)})}var br=(Sr.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},Sr.prototype.once=function(n,i){var o=this;this.on(n,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.off(n,i),i.apply(void 0,t)})},Sr.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=m.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},Sr.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},Sr.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=this._eventsListeners[e];if(i)for(var o=0;o<i.length;o++)try{i[o].apply(this,t)}catch(t){if(!(t.message&&-1<t.message.indexOf("freed script")))throw t;this.off(e,i[o])}},Sr);function Sr(){this._eventsListeners={}}var _r=br,wr=m.eventSandbox.listeners;function Pr(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new _r}var xr=(Pr.prototype._internalListener=function(t,e,n,i,o){this.events.emit("scroll",t),this.stopPropagationFlag&&(i(),o())},Pr.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,wr.initElementListening($c,["scroll"]),wr.addFirstInternalEventBeforeListener($c,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n._internalListener.apply(n,t)}))},Pr.prototype.waitForScroll=function(t){var e=this,n=null,i=new m.Promise(function(t){n=t});return i.cancel=function(){return e.events.off("scroll",n)},this.initialized?this.handleScrollEvents(t,n):n(),i},Pr.prototype.handleScrollEvents=function(n,t){var e,i=this;this.events.once("scroll",t),(e=n)&&e.getRootNode&&D(e)!==e.getRootNode()&&(wr.initElementListening(n,["scroll"]),wr.addFirstInternalEventBeforeListener(n,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i._internalListener.apply(i,t),wr.cancelElementListening(n)}))},Pr.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},Pr.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new Pr),Cr=(Ar._isScrollValuesChanged=function(t,e){return et(t)!==e.left||nt(t)!==e.top},Ar.prototype._setScroll=function(t,e){var n=this,i=e.left,o=e.top,r=F(t)?D(t):t,s={left:et(r),top:nt(r)},i=Math.max(i,0),o=Math.max(o,0),l=xr.waitForScroll(r);return it(r,i),ot(r,o),Ar._isScrollValuesChanged(r,s)?l=l.then(function(){n._scrollWasPerformed||(n._scrollWasPerformed=Ar._isScrollValuesChanged(r,s))}):(l.cancel(),m.Promise.resolve())},Ar.prototype._getScrollToPoint=function(t,e,n){var i=Math.floor(t.width/2),o=Math.floor(t.height/2),r=this._scrollToCenter?i:Math.min(n.left,i),s=this._scrollToCenter?o:Math.min(n.top,o),l=t.scroll,a=l.left,u=l.top,c=e.x>=a+t.width-r,h=e.x<=a+r,f=e.y>=u+t.height-s,d=e.y<=u+s;return c?a=e.x-t.width+r:h&&(a=e.x-r),f?u=e.y-t.height+s:d&&(u=e.y-s),{left:a,top:u}},Ar.prototype._getScrollToFullChildView=function(t,e,n){var i,o,r,s,l,a,u={left:null,top:null},c=t.width>=e.width,h=t.height>=e.height,f=(i=e,o=t,H.create({top:i.top-o.top,left:i.left-o.left,right:o.right-i.right,bottom:o.bottom-i.bottom}).sub(o.border).sub(o.scrollbar).round(Math.ceil,Math.floor));return c&&(r=t.width-e.width,s=Math.min(n.left,r),this._scrollToCenter&&(s=r/2),f.left<s?u.left=Math.round(t.scroll.left+f.left-s):f.right<s&&(u.left=Math.round(t.scroll.left+Math.min(f.left,-f.right)+s))),h&&(l=t.height-e.height,a=Math.min(n.top,l),this._scrollToCenter&&(a=l/2),f.top<a?u.top=Math.round(t.scroll.top+f.top-a):f.bottom<a&&(u.top=Math.round(t.scroll.top+Math.min(f.top,-f.bottom)+a))),u},Ar._getChildPoint=function(t,e,n){return x.create(e).sub(x.create(t)).add(x.create(t.scroll)).add(x.create(e.border)).add(n)},Ar.prototype._getScrollPosition=function(t,e,n,i){var o=Ar._getChildPoint(t,e,n),r=this._getScrollToPoint(t,o,i),s=this._getScrollToFullChildView(t,e,i);return{left:Math.max(null===s.left?r.left:s.left,0),top:Math.max(null===s.top?r.top:s.top,0)}},Ar._getChildPointAfterScroll=function(t,e,n,i){return x.create(e).add(x.create(t.scroll)).sub(x.create(n)).add(i)},Ar.prototype._isChildFullyVisible=function(t,e,n){var i=Ar._getChildPointAfterScroll(t,e,t.scroll,n),o=this._getScrollPosition(t,e,n,{left:0,top:0}),r=o.left,s=o.top;return!this._isTargetElementObscuredInPoint(i)&&r===t.scroll.left&&s===t.scroll.top},Ar.prototype._scrollToChild=function(t,e,n){for(var i=ht(t),o=ht(e),r=J($c),s=tt($c),l=i.scroll,a=!this._isChildFullyVisible(i,o,n);a;){l=this._getScrollPosition(i,o,n,this._maxScrollMargin);var u=Ar._getChildPointAfterScroll(i,o,l,n),c=this._isTargetElementObscuredInPoint(u);this._maxScrollMargin.left+=20,this._maxScrollMargin.left>=r&&(this._maxScrollMargin.left=50,this._maxScrollMargin.top+=20),a=c&&this._maxScrollMargin.top<s}return this._maxScrollMargin={left:50,top:50},this._setScroll(t,l)},Ar.prototype._scrollElement=function(){if(!yt(this._element))return m.Promise.resolve();var t=ht(this._element),e=this._getScrollToPoint(t,this._offsets,this._maxScrollMargin);return this._setScroll(this._element,e)},Ar.prototype._scrollParents=function(){var t,e,n,i,o,r,s=this,l=(t=this._element,i=R(t),!U(t)||(e=k(t))&&(n=R(e),i.concat(n)),m.nativeMethods.arrayFilter.call(i,yt)),a=this._element,u=et(a),c=nt(a),h=x.create(this._offsets).sub(new x(u,c).round()),f=function(n,i){return w(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e<n?[4,i(e)]:[3,4];case 2:t.sent(),t.label=3;case 3:return e++,[3,1];case 4:return[2]}})})}(l.length,function(t){return s._scrollToChild(l[t],a,h).then(function(){o=ht(a),r=ht(l[t]),h.add(x.create(o)).sub(x.create(r)).add(x.create(r.border)),a=l[t]})}),d={scrollWasPerformed:this._scrollWasPerformed,offsetX:h.x,offsetY:h.y,maxScrollMargin:this._maxScrollMargin};return f.then(function(){if(!s._skipParentFrames&&vr($c))return d.cmd=Ar.SCROLL_REQUEST_CMD,yr(d,Ar.SCROLL_RESPONSE_CMD,$c.parent)}).then(function(){return s._scrollWasPerformed})},Ar._getFixedAncestorOrSelf=function(t){return W(t,!0,st)},Ar.prototype._isTargetElementObscuredInPoint=function(t){var e=ft(t);if(!e)return!1;var n=Ar._getFixedAncestorOrSelf(e);return!!n&&!n.contains(this._element)},Ar.prototype.run=function(){var t=this;return this._scrollElement().then(function(){return t._scrollParents()})},Ar.SCROLL_REQUEST_CMD="automation|scroll|request",Ar.SCROLL_RESPONSE_CMD="automation|scroll|response",Ar);function Ar(t,e,n){this._element=t,this._offsets=new x(e.offsetX,e.offsetY),this._scrollToCenter=!!e.scrollToCenter,this._skipParentFrames=!!e.skipParentFrames,this._maxScrollMargin=n||{left:50,top:50},this._scrollWasPerformed=!1}var Tr=p.utils.browser,Mr=(Dr.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},Dr.prototype.leaveElement=function(){},Dr.prototype.move=function(){},Dr.prototype.enterElement=function(){},Dr.prototype.dragAndDrop=function(){},Dr.prototype.teardown=function(){},Dr.prototype.run=function(t,e,n,i,o){var r=e&&g.domUtils.isElementInDocument(e),s=e&&g.domUtils.isElementInIframe(e)&&!g.domUtils.getIframeByElement(e);r&&!s||(e=null);var l=t!==e,a=l?g.domUtils.getCommonAncestor(t,e):null;this.setup(),l&&e&&this.leaveElement(t,e,a,n),Tr.isIE&&this.move(t,n),l&&g.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),Tr.isIE||this.move(t,n),this.dragAndDrop(i,t,e,n,o),this.teardown(t,n,e);var u=this.dragAndDropMode,c=this.dropAllowed;return this.dragAndDropMode=!1,this.dropAllowed=!1,{dragAndDropMode:u,dropAllowed:c}},Dr);function Dr(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var Ir=p.eventSandbox.eventSimulator,Ur=p.utils.extend,kr=p.nativeMethods,Br=(Or.leaveElement=function(t,e,n,i){Ir.mouseout(e,Ur({relatedTarget:t},i));for(var o=e;o&&o!==n;)Ir.mouseleave(o,Ur({relatedTarget:t},i)),o=kr.nodeParentNodeGetter.call(o)},Or.enterElement=function(t,e,n,i){Ir.mouseover(t,Ur({relatedTarget:e},i));for(var o=t,r=[];o&&o!==n;)r.push(o),o=g.domUtils.getParentExceptShadowRoot(o);for(var s=r.length-1;-1<s;s--)Ir.mouseenter(r[s],Ur({relatedTarget:e},i))},Or.move=function(t,e,n){Ir[t](e,n)},Or);function Or(){}var Nr=(Fr.dragAndDrop=function(t,e,n,i){return Ir.drag(t,i),e!==n&&(g.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,Ir.dragenter(e,i)),n&&(i.relatedTarget=e,Ir.dragleave(n,i))),!Ir.dragover(e,i)},Fr);function Fr(){}var Lr,Yr=p.eventSandbox.eventSimulator,Kr=(_(Rr,Lr=Mr),Rr.prototype.leaveElement=function(t,e,n,i){Br.leaveElement(t,e,n,i)},Rr.prototype.enterElement=function(t,e,n,i){Br.enterElement(t,e,n,i)},Rr.prototype.move=function(t,e){this._needEmulateMoveEvent()&&Br.move(this.moveEvent,t,e)},Rr.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&g.domUtils.isElementInDocument(t)&&t!==n&&Yr[this.moveEvent](t,e)},Rr.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},Rr);function Rr(t){var e=Lr.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var Wr,Vr=(_(Xr,Wr=Mr),Xr.prototype.setup=function(){Wr.prototype.setup.call(this),this.dragAndDropMode=!0},Xr.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=Nr.dragAndDrop(t,e,n,i)},Xr);function Xr(){return null!==Wr&&Wr.apply(this,arguments)||this}var Hr,Gr=p.eventSandbox.eventSimulator,qr=(_(zr,Hr=Mr),zr.prototype.setup=function(){Hr.prototype.setup.call(this),this.dragAndDropMode=!0},zr.prototype.leaveElement=function(t,e,n,i){Br.leaveElement(t,e,n,i)},zr.prototype.move=function(t,e){Br.move(this.moveEvent,t,e)},zr.prototype.enterElement=function(t,e,n,i){Br.enterElement(t,e,n,i)},zr.prototype.dragAndDrop=function(t,e,n,i,o){var r=Gr.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=Nr.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},zr.prototype.run=function(t,e,n,i,o){return Hr.prototype.run.call(this,t,null,n,i,o)},zr);function zr(){return null!==Hr&&Hr.apply(this,arguments)||this}function jr(t,e,n){return new(t?e?Vr:qr:Kr)(n)}var $r=(Qr.create=function(o,r,s,l){return w(this,void 0,m.Promise,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,Qr.getTarget(o,s,new x(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new Qr(n,i,r,s,l)]}})})},Qr.getTarget=function(e,n,i){return m.Promise.resolve(dt(e,i.x,i.y)).then(function(t){return t?{element:e,offset:i}:m.Promise.all([pt(e,i),n.document.documentElement]).then(function(t){var e=t[0];return{element:t[1],offset:e}})})},Qr.prototype._getCursorSpeed=function(){return this.automationSettings.cursorSpeed},Qr.prototype._getTargetClientPoint=function(){var o=this;return m.Promise.resolve($(this.element)).then(function(i){return F(o.element)?x.create(o.offset).sub(x.create(i)).round(Math.round):m.Promise.resolve(mt(o.element)).then(function(t){var e=N(o.element),n=x.create(t).add(o.offset);return e||n.sub(x.create(i)),n.round(Math.floor)})})},Qr.prototype._getEventSequenceOptions=function(t){var e=pr.noButton,n=bt(t);return{eventOptions:{clientX:t.x,clientY:t.y,screenX:null==n?void 0:n.x,screenY:null==n?void 0:n.y,buttons:e,ctrl:this.modifiers.ctrl,alt:this.modifiers.alt,shift:this.modifiers.shift,meta:this.modifiers.meta},eventSequenceOptions:{moveEvent:this.moveEvent}}},Qr.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions;return jr(!1,this.firstMovingStepOccured,i).run(t,dr(),n,null,null)},Qr.prototype._emulateEvents=function(t,e){var n=this._getEventSequenceOptions(e);this._runEventSequence(t,n),this.firstMovingStepOccured=!0,mr(t)},Qr.prototype._movingStep=function(n){var i=this;return this.cursor.move(n).then(function(){return xt(i.cursor.getPosition())}).then(function(t){var e=i._getCorrectedTopElement(t);return e?i._emulateEvents(e,n):null}).then(Ot)},Qr.prototype._getCorrectedTopElement=function(t){return t},Qr.prototype._move=function(e){var n=this,i=this.cursor.getPosition(),o=x.create(e).sub(i),r=m.nativeMethods.dateNow(),s=Math.max(Math.max(Math.abs(o.x),Math.abs(o.y))/this.cursorSpeed,this.minMovingTime),l=x.create(i),a=!0;return function(e,n){return w(this,void 0,void 0,function(){return P(this,function(t){switch(t.label){case 0:return e()?[4,n()]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})})}(function(){return!l.eql(e)},function(){var t;return n._needMoveCursorImmediately()?l=x.create(e):a?(a=!1,l.add({x:0<o.x?1:-1,y:0<o.y?1:-1})):(t=Math.min((m.nativeMethods.dateNow()-r)/s,1),l=x.create(o).mul(t).add(i).round(Math.floor)),n._movingStep(l)})},Qr.prototype._needMoveCursorImmediately=function(){return this.touchMode},Qr.prototype._scroll=function(){if(this.skipScrolling)return m.Promise.resolve(!1);var t=new Mo({offsetX:this.offset.x,offsetY:this.offset.y},!1);return new Cr(this.element,t).run()},Qr.prototype._moveToCurrentFrame=function(t){var e=this;if(this.cursor.isActive(this.window))return m.Promise.resolve();var n=this.cursor.getPosition(),i=n.x,o=n.y,r=this.cursor.getActiveWindow(this.window),c=null,s=null,h={cmd:"automation|move|request",startX:i,startY:o,endX:t.x,endY:t.y,modifiers:this.modifiers,speed:this.speed};return m.Promise.resolve().then(function(){if(r.parent===e.window)return m.Promise.resolve(function(t){var e=[];I(Qc,"*",function(t){"IFRAME"===t.tagName&&e.push(t),t.shadowRoot&&I(t.shadowRoot,"iframe",function(t){return e.push(t)})});for(var n=0;n<e.length;n++)if(M.contentWindowGetter.call(e[n])===t)return e[n];return null}(r)).then(function(t){return c=t,m.Promise.resolve((n=ut(e=t),i=n.left,o=n.top,r=ct({x:i,y:o}),s=z(e),l=j(e),a=r.x+s.left+l.left,u=r.y+s.top+l.top,new H(u,a+Q(e),u+Z(e),a))).then(function(t){h.left=t.left,h.top=t.top,h.right=t.right,h.bottom=t.bottom});var e,n,i,o,r,s,l,a,u})}).then(function(){return xt(e.cursor.getPosition())}).then(function(t){return s=t===c,r.parent===e.window&&(h.iframeUnderCursor=s),yr(h,"automation|move|response",r)}).then(function(t){if(e.cursor.setActiveWindow(e.window),s||m.utils.dom.isIframeWindow(e.window))return e.cursor.move(t)})},Qr.prototype.run=function(){var n=this;return this._scroll().then(function(){return m.Promise.all([n._getTargetClientPoint(),(t=n.window,new H(0,Q(t),Z(t),0))]);var t}).then(function(t){var e=t[0];if(t[1].contains(e))return n._moveToCurrentFrame(e).then(function(){return n._move(e)})})},Qr);function Qr(t,e,n,i,o){this.touchMode=m.utils.featureDetection.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.automationSettings=new Dt(n.speed),this.cursorSpeed=this._getCursorSpeed(),this.element=t,this.window=i,this.offset=e,this.cursor=o,this.minMovingTime=n.minMovingTime||0,this.modifiers=n.modifiers||{},this.skipScrolling=n.skipScrolling,this.skipDefaultDragBehavior=n.skipDefaultDragBehavior,this.speed=n.speed,this.firstMovingStepOccured=!1}var Zr=(Jr.prototype._ensureActiveWindow=function(t){this._activeWindow!==t&&this._activeWindow!==t.parent&&this._activeWindow.parent!==t&&(this._activeWindow=t)},Jr.prototype.isActive=function(t){return this._ensureActiveWindow(t),this._activeWindow===t},Jr.prototype.setActiveWindow=function(t){this._activeWindow=t},Jr.prototype.getActiveWindow=function(t){return this._ensureActiveWindow(t),this._activeWindow},Jr.prototype.getPosition=function(){return new x(this._x,this._y)},Jr.prototype.move=function(t){return this._x=t.x,this._y=t.y,this._ui.move(t)},Jr.prototype.hide=function(){return this._ui.hide?this._ui.hide():m.Promise.resolve()},Jr.prototype.show=function(){return this._ui.show?this._ui.show():m.Promise.resolve()},Jr.prototype.leftButtonDown=function(){return this._ui.leftButtonDown()},Jr.prototype.rightButtonDown=function(){return this._ui.rightButtonDown()},Jr.prototype.buttonUp=function(){return this._ui.buttonUp()},Jr);function Jr(t,e){this._ui=e,this._x=-1,this._y=-1,this._activeWindow=t}var ts=vr($c)?i.iframeCursorUI:i.cursorUI,es=new Zr($c.top,ts),ns=y.positionUtils,is=y.domUtils,os=y.eventUtils,rs=(ss.create=function(t){var n=t.element,i=t.clientPoint,o=t.screenPoint,r=t.isTarget,s=t.inMoving;return w(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return e=null,i?[4,bt(i)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return[2,new ss({element:n,clientPoint:i,screenPoint:o,isTarget:r,inMoving:s,devicePoint:e})]}})})},ss);function ss(t){var e=t.element,n=void 0===e?null:e,i=t.clientPoint,o=void 0===i?null:i,r=t.screenPoint,s=void 0===r?null:r,l=t.isTarget,a=void 0!==l&&l,u=t.inMoving,c=void 0!==u&&u,h=t.devicePoint,f=void 0===h?null:h;this.element=n,this.clientPoint=o,this.screenPoint=s,this.devicePoint=f,this.isTarget=a,this.inMoving=c}var ls,as=(_(us,ls=br),us.prototype._ensureWindowAndCursorForLegacyTests=function(t){t.window=t.window||$c,t.cursor=es},us.prototype._getElementForEvent=function(n){return w(this,void 0,void 0,function(){var e;return P(this,function(t){return e=dt(this.element,this.options.offsetX,this.options.offsetY)?this.element:null,[2,Tt(n.point,this.window,e)]})})},us.prototype._moveToElement=function(){return w(this,void 0,void 0,function(){var e,n=this;return P(this,function(t){switch(t.label){case 0:return e=new Yo(m.utils.extend({skipScrolling:!0},this.options),!1),[4,$r.create(this.element,e,this.window,this.cursor)];case 1:return[2,t.sent().run().then(function(){return Bt(n.automationSettings.mouseActionStepDelay)})]}})})},us.prototype._scrollToElement=function(){var e=this,n=!1,t=new Mo(this.options,!1);return new Cr(this.element,t).run().then(function(t){return n=!!t,Bt(e.automationSettings.mouseActionStepDelay)}).then(function(){return Tt(e.cursor.getPosition(),e.window)}).then(function(t){return function(s,l,a){return w(this,void 0,p.Promise,function(){var e,n,i,o,r;return P(this,function(t){switch(t.label){case 0:return s&&is.contains(l,s)&&a?(e=dr(),n=is.getCommonAncestor(s,e),[4,ns.getClientPosition(s)]):[2];case 1:return[4,bt(i=t.sent())];case 2:return(o=t.sent())&&(r={clientX:i.x,clientY:i.y,screenX:o.x,screenY:o.y,ctrl:!1,alt:!1,shift:!1,meta:!1,buttons:os.BUTTONS_PARAMETER.leftButton},Br.leaveElement(s,e,n,r),Br.enterElement(s,e,n,r),mr(s)),[2]}})})}(t,e.element,n)}).then(function(){return n})},us.prototype._getElementOffset=function(){var t=wt(this.element),e=this.options,n=e.offsetX,i=e.offsetY;return{offsetX:n=n||0===n?n:t.offsetX,offsetY:i=i||0===i?i:t.offsetY}},us.prototype._wrapAction=function(p){return w(this,void 0,void 0,function(){var e,n,i,o,r,s,l,a,u,c,h,f,d,m;return P(this,function(t){switch(t.label){case 0:return e=this._getElementOffset(),n=e.offsetX,i=e.offsetY,[4,pt(this.element,{x:n,y:i})];case 1:return o=t.sent(),[4,mt(this.element)];case 2:return r=t.sent(),[4,p()];case 3:return t.sent(),[4,pt(this.element,{x:n,y:i})];case 4:return s=t.sent(),[4,mt(this.element)];case 5:return l=t.sent(),[4,function(i,o){return w(this,void 0,void 0,function(){var e,n;return P(this,function(t){switch(t.label){case 0:return[4,$(i)];case 1:return e=t.sent(),n=yt(i),!/html/i.test(i.tagName)&&n&&(o.x-=e.left,o.y-=e.top),[2,ct(o)]}})})}(this.element,s)];case 6:return a=t.sent(),[4,dt(this.element,n,i)];case 7:return u=t.sent()?this.element:null,[4,Tt(a,this.window,u)];case 8:return(c=t.sent())?(h=!u||c===u||c===this.element)?[3,10]:[4,this._contains(this.element,c)]:[2,rs.create({element:null,clientPoint:null,screenPoint:null,isTarget:!1,inMoving:!1})];case 9:h=t.sent(),t.label=10;case 10:return f=o.x!==s.x||o.y!==s.y,d=r.x!==l.x||r.y!==l.y,m=f&&d,[2,rs.create({element:c,clientPoint:a,screenPoint:s,isTarget:h,inMoving:m})]}})})},us._checkElementState=function(t,e){if(!t.element)throw new Error(Mt.elementIsInvisibleError);if(e&&(!t.isTarget||t.inMoving))throw new Error(Mt.foundElementIsNotTarget);return t},us.prototype._ensureElement=function(e,n,i){var o=this;return void 0===n&&(n=!1),void 0===i&&(i=!1),this._wrapAction(function(){return o._scrollToElement()}).then(function(t){return us._checkElementState(t,e)}).then(function(t){return i?t:o._wrapAction(function(){return o._moveToElement()})}).then(function(t){return n||us._checkElementState(t,e),t}).then(function(t){return o.emit(o.TARGET_ELEMENT_FOUND_EVENT,{element:(null==t?void 0:t.element)||null}),{element:(null==t?void 0:t.element)||null,clientPoint:(null==t?void 0:t.clientPoint)||null,screenPoint:(null==t?void 0:t.screenPoint)||null,devicePoint:(null==t?void 0:t.devicePoint)||null}})},us.prototype._contains=function(o,r){return w(this,void 0,void 0,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,R(r)];case 1:for(e=t.sent(),n=0,i=e;n<i.length;n++)if(i[n]===o)return[2,!0];return[2,!1]}})})},us);function us(t,e,n,i){var o=ls.call(this)||this;return o.TARGET_ELEMENT_FOUND_EVENT="automation|target-element-found-event",o.element=t,o.options=e,o.automationSettings=new Dt(e.speed||1),o.window=n,o.cursor=i,o._ensureWindowAndCursorForLegacyTests(o),o}var cs,hs=p.Promise,fs=(_(ds,cs=as),ds.prototype.run=function(t){var e=this,n=hs.resolve();return this.element!==Qc.scrollingElement&&this.element!==Qc.documentElement&&(n=this._ensureElement(t,!0,!0)),n.then(function(){e.element.scrollLeft=e.scrollLeft,e.element.scrollTop=e.scrollTop})},ds);function ds(t,e,n){var i,o,r,s,l,a=e.x,u=e.y,c=e.position,h=e.byX,f=e.byY,d=cs.call(this,t,n,$c,es)||this;return c&&(o=t,r=c,s=Math.floor(o.scrollWidth/2-o.clientWidth/2),l=Math.floor(o.scrollHeight/2-o.clientHeight/2),a=(i={top:[s,0],right:[o.scrollWidth,l],bottom:[s,o.scrollHeight],left:[0,l],topRight:[o.scrollWidth,0],topLeft:[0,0],bottomRight:[o.scrollWidth,o.scrollHeight],bottomLeft:[0,o.scrollHeight],center:[s,l]}[r])[0],u=i[1]),d.scrollLeft="number"==typeof a?a:t.scrollLeft,d.scrollTop="number"==typeof u?u:t.scrollTop,h&&(d.scrollLeft+=h),f&&(d.scrollTop+=f),d}var ms,ps=(_(vs,ms=as),vs.prototype.run=function(t){return this._ensureElement(t,!0,!0)},vs);function vs(t,e){return ms.call(this,t,e,$c,es)||this}var gs=p.Promise,Es=p.nativeMethods,ys=p.utils.browser,bs=p.eventSandbox.focusBlur,Ss=y.contentEditable,_s=y.textSelection,ws=y.domUtils,Ps=y.styleUtils,xs=p.eventSandbox.message,Cs="automation|iframe|request",As="automation|iframe|response";function Ts(v,g,E){var t=this;return new gs(function(p){return w(t,void 0,void 0,function(){var s,n,i,o,r,l,a,u,c,h,f,d,m;return P(this,function(t){switch(t.label){case 0:return vr($c)?[4,yr({cmd:Cs},As,$c.parent)]:[3,2];case 1:t.sent(),t.label=2;case 2:if(s=ws.getActiveElement(),n=ws.isTextEditableElement(v),i=ws.closest(v,"label[for]"),o=ws.isElementFocusable(v),r=!o&&i,l=ws.isContentEditableElement(v),a=l?Ss.findContentEditableParent(v):v,g&&ys.isWebKit&&n&&_s.select(v,0,0),r)return g&&(e=i,ws.isElementFocusable(e)?bs.focus(e,y.noop,!1,!0):Ds(e)),p(),[2];if(u=!g,c=!1,!o&&!l){if(h=ws.findDocument(a),f=Es.documentActiveElementGetter.call(h),d=ws.isBodyElement(f),m=ws.isBodyElement(a)?a:ws.getFocusableParent(a),f&&!d&&ws.containsElement(f,a)||d&&ws.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return bs.focus(a,function(){var t,e,n,i,o,r;!g||l||v===ws.getActiveElement()?(t=v,e=E,o=ws.isTextEditableElement(t),r=ws.isContentEditableElement(t),o||r?r&&isNaN(parseInt(e,10))?_s.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?ws.getElementValue(t).length:e,_s.select(t,n,n)):(i=Ss.findContentEditableParent(t))&&_s.setCursorToLastVisiblePosition(Ss.findContentEditableParent(i)),g||ws.getActiveElement()===s?p():bs.focus(s,p,!0,!0)):p()},u,!0,!1,c),[2]}var e})})})}function Ms(t){var e=ws.closest(t,"label[for]"),n=e&&(e.control||Qc.getElementById(e.htmlFor));return n&&Ps.isElementVisible(n)?n:null}function Ds(t){var e=Ms(t);e&&ws.getActiveElement()!==e&&bs.focus(e,y.noop,!1,!0)}xs.on(xs.SERVICE_MSG_RECEIVED_EVENT,function(t){var e;t.message.cmd===Cs&&(e=ws.findIframeByWindow(t.source),bs.focus(e,function(){xs.sendServiceMsg({cmd:As},t.source)},!1))});var Is=p.utils.browser,Us=p.eventSandbox.eventSimulator,ks=p.eventSandbox.listeners,Bs=p.nativeMethods,Os=y.domUtils,Ns=y.styleUtils,Fs=i.selectElement,Ls=(Ys.prototype.run=function(){this.eventState.clickElement&&Us.click(this.eventState.clickElement,this.eventArgs.options),Os.isElementFocusable(this.eventArgs.element)||Ds(this.eventArgs.element)},Ys);function Ys(t,e){this.eventState=t,this.eventArgs=e}var Ks,Rs=(_(Ws,Ks=Ls),Ws.prototype.run=function(){function t(t){n=Bs.eventTargetGetter.call(t)===e.input}var e=this,n=!1;ks.addInternalEventBeforeListener($c,["focus"],t),Ks.prototype.run.call(this),ks.removeInternalEventBeforeListener($c,["focus"],t),Os.isElementFocusable(this.targetElement)&&!n&&this._ensureBoundElementFocusRaised()},Ws.prototype._ensureBoundElementFocusRaised=function(){Us.focus(this.input)},Ws);function Ws(t,e){var n=Ks.call(this,t,e)||this;return n.targetElement=n.eventArgs.element,n.input=Ms(n.eventArgs.element),n}var Vs,Xs=(_(Hs,Vs=Ls),Hs.prototype.run=function(){Vs.prototype.run.call(this),this._toggleSelectOptionList()},Hs.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===Ns.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(Fs.isOptionListExpanded(t)?Fs.collapseOptionList():Fs.expandOptionList(t))},Hs);function Hs(t,e){return Vs.call(this,t,e)||this}var Gs,qs=(_(zs,Gs=Ls),zs.prototype.run=function(){return this.eventArgs.element},zs);function zs(t,e){return Gs.call(this,t,e)||this}var js,$s=(_(Qs,js=Rs),Qs.prototype.run=function(){function t(){e=!0}var e=!1;ks.addInternalEventBeforeListener($c,["change"],t),js.prototype.run.call(this),ks.removeInternalEventBeforeListener($c,["change"],t),!Is.isChrome||e||this.checkbox.disabled||this._isClickableElementInsideLabel(this.targetElement)||this._ensureCheckboxStateChanged()},Qs.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,Us.change(this.checkbox)},Qs.prototype._isClickableElementInsideLabel=function(t){var e=Os.isAnchorElement(t)&&t.getAttribute("href"),n=Os.isButtonElement(t);return e||n},Qs);function Qs(t,e){var n=js.call(this,t,e)||this;return n.checkbox=n.input,n}var Zs=p.Promise,Js=p.utils.browser,tl=p.utils.featureDetection,el=p.eventSandbox.eventSimulator,nl=p.eventSandbox.listeners,il=y.domUtils,ol=y.eventUtils,rl=y.arrayUtils,sl=(ll.prototype.mousedown=function(t){var e=this;this.targetElementParentNodes=il.getParents(t.element),this.mouseDownElement=t.element,this._raiseTouchEvents(t);var n=il.getActiveElement();this.activeElementBeforeMouseDown=n;var i=(Js.isWebKit||Js.isIE)&&il.isSelectElement(this.mouseDownElement);return i&&this._bindMousedownHandler(),this._bindBlurHandler(n),this._isTouchEventWasCancelled()||(this.eventState.simulateDefaultBehavior=el.mousedown(t.element,t.options)),!1===this.eventState.simulateDefaultBehavior&&(this.eventState.simulateDefaultBehavior=i&&!this.eventState.mousedownPrevented),this._ensureActiveElementBlur(n).then(function(){return e._focus(t)})},ll.prototype.mouseup=function(t,e){var n,i,o,r,s;e.element=t,this.eventState.clickElement=(n=this.mouseDownElement,i=t,o=this.targetElementParentNodes,r=il.getParents(i),s=il.isTheSameNode(i,n),Js.isFirefox?s?n:null:s?rl.equals(o,r)?n:null:n.contains(i)&&!il.isEditableFormElement(i)?n:i.contains(n)?i:rl.getCommonElement(r,o));var l={},a=function(t){l=t.timeStamp,nl.removeInternalEventBeforeListener($c,["mouseup"],a)};return Js.isIE||nl.addInternalEventBeforeListener($c,["mouseup"],a),this._isTouchEventWasCancelled()||el.mouseup(t,e.options),e.options&&(e.options.timeStamp=l),this._click(e)},ll.prototype._click=function(u){return w(this,void 0,p.Promise,function(){var a;return P(this,function(t){var e,n,i,o,r,s,l;return e=this.eventState,i=Ms((n=u).element),o=Os.isSelectElement(n.element),r=Os.isOptionElement(n.element),s=Os.isLabelElement(n.element)&&i,l=i&&Os.isCheckboxElement(i),a=new(o?Xs:r?qs:l?$s:s?Rs:Ls)(e,n),this._isTouchEventWasCancelled()||a.run(),[2,u]})})},ll.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},ll.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,ol.preventDefault(t),ol.unbind(e.element,"mousedown",n)};ol.bind(this.element,"mousedown",n)},ll.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,ol.unbind(t,"blur",n,!0)};ol.bind(t,"blur",n,!0)},ll.prototype._ensureActiveElementBlur=function(e){var n=this;return new Zs(function(t){il.getActiveElement()===e||n.eventState.blurRaised?t():Js.isIE&&Js.version<12?Ot().then(function(){n.eventState.blurRaised||el.blur(e),t()}):(el.blur(e),t())})},ll.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?Zs.resolve():Ts(il.isContentEditableElement(this.element)?this.element:t.element,!Js.isIE||this.activeElementBeforeMouseDown===il.getActiveElement(),this.caretPos)},ll.prototype._raiseTouchEvents=function(t){tl.isTouchDevice&&(this.eventState.touchStartCancelled=!el.touchstart(t.element,t.options),this.eventState.touchEndCancelled=!el.touchend(t.element,t.options))},ll);function ll(t,e){this.element=t,this.caretPos=e,this.targetElementParentNodes=[],this.activeElementBeforeMouseDown=null,this.mouseDownElement=null,this.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null,touchStartCancelled:!1,touchEndCancelled:!1}}var al,ul=(_(cl,al=as),cl.prototype._mousedown=function(t){return this.strategy.mousedown(t)},cl.prototype._mouseup=function(t,e){return this.strategy.mouseup(t,e)},cl.prototype.run=function(t){var r,s=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.screenPoint,o=t.devicePoint;return r={point:n,screenPoint:i,element:e,options:m.utils.extend({clientX:null==n?void 0:n.x,clientY:null==n?void 0:n.y,screenX:null==o?void 0:o.x,screenY:null==o?void 0:o.y},s.modifiers)},m.Promise.all([Bt(s.automationSettings.mouseActionStepDelay),s.cursor.leftButtonDown().then(function(){return s._mousedown(r)})])}).then(function(){return s.cursor.buttonUp()}).then(function(){return s._getElementForEvent(r)}).then(function(t){return t?s._mouseup(t,r):null})},cl);function cl(t,e,n,i){var o,r,s=al.call(this,t,e,n,i)||this;return s.modifiers=e.modifiers,s.strategy=(o=s.element,r=e.caretPos,new sl(o,r)),s}function hl(t,e,n){var i=function(t,e,n){if(e.y-t.y==0)return 0;var i=(e.x-t.x)/(e.y-t.y),o=t.y*(t.x-e.x)/(e.y-t.y)+t.x;return Math.round(i*n+o)}(t,e,n.top);return i&&i>=n.left&&i<=n.right?new x(i,n.top):null}function fl(t,e,n){var i=function(t,e,n){if(e.x===t.x)return 0;var i=(e.y-t.y)/(e.x-t.x),o=t.x*(t.y-e.y)/(e.x-t.x)+t.y;return Math.round(i*n+o)}(t,e,n.left);return i&&i>=n.top&&i<=n.bottom?new x(n.left,i):null}function dl(t,e,n){for(var i=[],o=0,r=[{left:n.left,top:n.top,right:n.left,bottom:n.bottom,isHorizontal:!1},{left:n.right,top:n.top,right:n.right,bottom:n.bottom,isHorizontal:!1},{left:n.left,top:n.top,right:n.right,bottom:n.top,isHorizontal:!0},{left:n.left,top:n.bottom,right:n.right,bottom:n.bottom,isHorizontal:!0}];o<r.length;o++){var s=r[o],l=(s.isHorizontal?hl:fl)(t,e,s);l&&i.push(l)}return i.length?1===i.length||i[0].distance(t)<i[1].distance(t)?i[0]:i[1]:null}var ml=p.eventSandbox.eventSimulator,pl=p.eventSandbox.message,vl=y.positionUtils,gl=y.domUtils,El=y.styleUtils,yl="automation|move|response";pl.on(pl.SERVICE_MSG_RECEIVED_EVENT,function(t){var e,n,i,o,r,s,l,a,u,c,h,f,d;"automation|move|request"===t.message.cmd&&(t.source.parent===$c?(n=new x((e=t).message.endX,e.message.endY),i=e.source,o=gl.findIframeByWindow(i),r=El.getBordersWidth(o),s=El.getElementPadding(o),l=vl.getIframeClientCoordinates(o),a=vl.getIframePointRelativeToParentFrame(n,i),u=es.getPosition(),c=vl.isInRectangle(u,l)?u:dl(u,a,l),h={x:c.x-l.left,y:c.y-l.top},f=new Yo({modifiers:e.message.modifiers,offsetX:h.x+r.left+s.left,offsetY:h.y+r.top+s.top,speed:e.message.speed,skipScrolling:!0},!1),d={cmd:yl,x:h.x,y:h.y},es.getActiveWindow($c)!==i?$r.create(o,f,$c,es).then(function(t){return t.run()}).then(function(){es.setActiveWindow(i),pl.sendServiceMsg(d,i)}):pl.sendServiceMsg(d,i)):(p.on(p.EVENTS.beforeUnload,function(){return pl.sendServiceMsg({cmd:yl},t.source)}),function(t){var e=t.source,n={left:t.message.left,right:t.message.right,top:t.message.top,bottom:t.message.bottom};if(!t.message.iframeUnderCursor){var i=t.message,o=i.startX,r=i.startY,s=o-n.left,l=r-n.top,a=dr();return a&&(ml.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),ml.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),pl.sendServiceMsg({cmd:yl},e)}var u,c=es.getPosition(),h=dl(x.create(n).add(c),new x(t.message.endX,t.message.endY),n);h?(u=new Yo({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),$r.create(Qc.documentElement,u,$c,es).then(function(t){return t.run()}).then(function(){var t={cmd:yl,x:h.x,y:h.y};es.setActiveWindow(e),pl.sendServiceMsg(t,e)})):pl.sendServiceMsg({cmd:yl,x:n.left,y:n.top},e)}(t)))});var bl=p.Promise,Sl=p.utils.browser,_l=p.utils.featureDetection,wl=p.eventSandbox.eventSimulator,Pl=p.eventSandbox.focusBlur,xl=p.nativeMethods,Cl=y.domUtils,Al=y.styleUtils,Tl=y.delay,Ml=i.selectElement,Dl=_l.isTouchDevice?0:160,Il=(Ul.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?Ml.getEmulatedChildElement(this.element):this.element,e=1<Al.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Sl.isIE&&e?this.parentSelect:t}},Ul.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=_t(n=Ml.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=Qc.documentElement,i=(e=Ml.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},Ul.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Yo({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return $r.create(n,s,$c,es).then(function(t){return t.run()}).then(function(){return Tl(e.automationSettings.mouseActionStepDelay)})},Ul.prototype._mousedown=function(){var t=this;return Sl.isFirefox?(wl.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Sl.isIE?(wl.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Tl(Dl)}).then(function(){wl.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},Ul.prototype._focus=function(){var e=this;return new bl(function(t){Pl.focus(e.parentSelect,t,!1,!0)})},Ul.prototype._mouseup=function(){var t=Sl.isIE?this.parentSelect:this.eventsArgs.element;wl.mouseup(t,this.eventsArgs.options),Sl.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=Sl.isFirefox||Sl.isSafari||Sl.isChrome&&53<=Sl.version,n=e||Sl.isIE;return e&&this.clickCausesChange&&wl.input(this.parentSelect),n&&this.clickCausesChange&&wl.change(this.parentSelect),bl.resolve()},Ul.prototype._click=function(){wl.click(this.eventsArgs.element,this.eventsArgs.options)},Ul.prototype.run=function(){var t=this;if(!this.parentSelect)return wl.click(this.eventsArgs.element,this.eventsArgs.options),bl.resolve();this.optionListExpanded||Ml.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Al.getSelectElementSize(this.parentSelect)<=1?this._move(e).then(function(){return t._click()}):this._move(e).then(function(){return t._mousedown()}).then(function(){return t._mouseup()}).then(function(){return t._click()})},Ul);function Ul(t,e){var n,i,o,r,s;this.element=t,this.modifiers=e.modifiers,this.caretPos=e.caretPos,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.speed=e.speed,this.automationSettings=new Dt(e.speed),this.parentSelect=Cl.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&Ml.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=Cl.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=Cl.getElementIndexInParent(this.parentSelect,this.element),o=xl.nodeParentNodeGetter.call(this.element),r=Cl.isOptionGroupElement(o)?o:null,s=this.element.disabled||r&&r.disabled,this.clickCausesChange=n&&!s&&this.childIndex!==i),this.eventsArgs={options:this.modifiers,element:this.element}}var kl,Bl=p.utils.featureDetection,Ol=p.utils.browser,Nl=p.eventSandbox.eventSimulator,Fl=y.eventUtils,Ll=y.delay,Yl=Bl.isTouchDevice?0:160,Kl=(_(Rl,kl=as),Rl.prototype._firstClick=function(t){var e=this,n=new No(this.options);n.speed=1;var i=new ul(this.element,n,$c,es);return i.on(i.TARGET_ELEMENT_FOUND_EVENT,function(t){return e.emit(e.TARGET_ELEMENT_FOUND_EVENT,t)}),i.run(t).then(function(t){return Ll(Yl).then(function(){return t})})},Rl.prototype._secondClick=function(t){var e=this;Ol.isIE&&Fl.bind(Qc,"focus",Fl.preventDefault,!0);var n=new No({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new ul(Qc.documentElement,n,$c,es);return i.run().then(function(t){return e.eventState.dblClickElement=i.strategy.eventState.clickElement,Ol.isIE&&Fl.unbind(Qc,"focus",Fl.preventDefault,!0),t})},Rl.prototype._dblClick=function(t){this.eventState.dblClickElement&&Nl.dblclick(this.eventState.dblClickElement,t.options)},Rl.prototype.run=function(t){var e=this;return this._firstClick(t).then(function(t){return e._secondClick(t)}).then(function(t){return e._dblClick(t)})},Rl);function Rl(t,e){var n=kl.call(this,t,e,$c,es)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new Dt(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var Wl,Vl=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},Xl=p.nativeMethods,Hl=p.utils.featureDetection,Gl=p.utils.html,ql=p.utils.url,zl=p.eventSandbox.DataTransfer,jl=p.eventSandbox.DragDataStore,$l=y.eventUtils,Ql=y.domUtils,Zl=(_(Jl,Wl=$r),Jl.create=function(o,r,s,l){return w(this,void 0,void 0,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,$r.getTarget(o,s,new x(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new Jl(n,i,r,s,l)]}})})},Jl.prototype._getCursorSpeed=function(){return this.automationSettings.draggingSpeed},Jl.prototype._getEventSequenceOptions=function(t){var e=Wl.prototype._getEventSequenceOptions.call(this,t),n=e.eventOptions,i=e.eventSequenceOptions;return n.dataTransfer=this.dragAndDropState.dataTransfer,n.buttons=$l.BUTTONS_PARAMETER.leftButton,i.holdLeftButton=!0,{eventOptions:n,eventSequenceOptions:i}},Jl.prototype._getCorrectedTopElement=function(t){return this.touchMode?this.dragElement:t},Jl.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions,o=jr(this.dragAndDropState.enabled,this.firstMovingStepOccured,i).run(t,dr(),n,this.dragElement,this.dragAndDropState.dataStore),r=o.dragAndDropMode,s=o.dropAllowed;this.dragAndDropState.enabled=r,this.dragAndDropState.dropAllowed=s},Jl.prototype._needMoveCursorImmediately=function(){return!1},Jl.prototype.run=function(){var l=this;return Tt(this.cursor.getPosition()).then(function(t){l.dragElement=t;var e,n,i,o,r,s=function(t){for(var e=t;e;){if(e.draggable)return e;e=Xl.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&Hl.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new jl,l.dragAndDropState.dataTransfer=new zl(l.dragAndDropState.dataStore),((e=Ql.isAnchorElement(l.dragElement))||Ql.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=ql.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=Gl.cleanUpHtml(Xl.elementOuterHTMLGetter.call(l.dragElement)),l.dragAndDropState.dataTransfer.setData("text/plain",o),l.dragAndDropState.dataTransfer.setData("text/uri-list",o),l.dragAndDropState.dataTransfer.setData("text/html",r))),Wl.prototype.run.call(l).then(function(){return l.dragAndDropState})})},Jl);function Jl(t,e,n,i,o){var r=Wl.call(this,t,e,n,i,o)||this;return r.dragElement=null,r.dragAndDropState=new Vl,r}var ta,ea=p.Promise,na=p.utils.extend,ia=p.utils.featureDetection,oa=p.eventSandbox.eventSimulator,ra=p.eventSandbox.focusBlur,sa=(_(la,ta=as),la.prototype._getEndPoint=function(){throw new Error("Not implemented")},la.prototype._mousedown=function(t){var e=this;return es.leftButtonDown().then(function(){return e.simulateDefaultBehavior=oa[e.downEvent](t.element,t.options),e._focus(t)})},la.prototype._focus=function(n){var i=this;return new ea(function(t){var e=g.domUtils.isContentEditableElement(i.element)?g.contentEditable.findContentEditableParent(i.element):n.element;ra.focus(e,t,!1,!0)})},la.prototype._getDestination=function(){throw new Error("Not implemented")},la.prototype._drag=function(){var r=this;return this._getDestination().then(function(t){var e=t.element,n=t.offsets,i=t.endPoint;r.endPoint=i;var o=new Yo({offsetX:n.offsetX,offsetY:n.offsetY,modifiers:r.modifiers,speed:r.speed,minMovingTime:25,skipDefaultDragBehavior:!1===r.simulateDefaultBehavior},!1);return Zl.create(e,o,$c,es)}).then(function(t){return t.run()}).then(function(t){return r.dragAndDropState=t,g.delay(r.automationSettings.mouseActionStepDelay)})},la.prototype._mouseup=function(){var o=this;return es.buttonUp().then(function(){var e=g.positionUtils.offsetToClientCoords(o.endPoint),n=null,i=na({clientX:e.x,clientY:e.y},o.modifiers);return Tt(e).then(function(t){return(n=t)?(o.dragAndDropState.enabled?(i.dataTransfer=o.dragAndDropState.dataTransfer,o.dragAndDropState.dropAllowed&&oa.drop(n,i),oa.dragend(o.dragAndDropState.element,i),o.dragAndDropState.dataStore.setProtectedMode()):oa[o.upEvent](n,i),Tt(e)):n}).then(function(t){n&&t===n&&!o.dragAndDropState.enabled&&oa.click(n,i)})})},la.prototype.run=function(t){var i,o=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint;return i={point:n,element:e,options:na({clientX:n.x,clientY:n.y},o.modifiers)},ea.all([g.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},la);function la(t,e){var n=ta.call(this,t,e,$c,es)||this;return n.modifiers=e.modifiers,n.speed=e.speed,n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=ia.isTouchDevice?"touchstart":"mousedown",n.upEvent=ia.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var aa,ua=y.styleUtils,ca=(_(ha,aa=sa),ha.prototype._getDestination=function(){return w(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){switch(t.label){case 0:return[4,pt(this.element,{x:this.offsetX,y:this.offsetY})];case 1:return e=t.sent(),n=ua.getWidth(Qc),i=ua.getHeight(Qc),o={x:e.x+this.dragOffsetX,y:e.y+this.dragOffsetY},o={x:Math.min(Math.max(0,o.x),n),y:Math.min(Math.max(0,o.y),i)},[2,{element:Qc.documentElement,offsets:{offsetX:o.x,offsetY:o.y},endPoint:o}]}})})},ha);function ha(t,e,n,i){var o=aa.call(this,t,i)||this;return o.dragOffsetX=e,o.dragOffsetY=n,o}var fa,da=y.positionUtils,ma=(_(pa,fa=sa),pa.prototype._getDestination=function(){return w(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){return e=this.destinationElement,n=da.getElementRectangle(e),i=wt(e,this.destinationOffsetX,this.destinationOffsetY),o={x:n.left+i.offsetX,y:n.top+i.offsetY},[2,{element:e,offsets:i,endPoint:o}]})})},pa);function pa(t,e,n){var i=fa.call(this,t,n)||this;return i.destinationElement=e,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var va,ga=(_(Ea,va=as),Ea.prototype.run=function(t){return this._ensureElement(t,!0)},Ea);function Ea(t,e){return va.call(this,t,e,$c,es)||this}var ya=p.utils.browser,ba=p.sandbox.event,Sa=p.eventSandbox.eventSimulator,_a=p.eventSandbox.listeners,wa=p.nativeMethods,Pa=y.domUtils,xa=y.contentEditable,Ca=y.textSelection,Aa=/ /g;function Ta(t){var e=Ca.getSelectionByElement(t),n=Ca.hasInverseSelectionContentEditable(t);return Ca.hasElementContainsSelection(t)?xa.getSelection(t,e,n):{startPos:xa.calculateNodeAndOffsetByPosition(t,0),endPos:xa.calculateNodeAndOffsetByPosition(t,0)}}function Ma(t){var e=t.startPos.node,n=t.startPos.offset,i=t.endPos.offset,o=xa.getFirstNonWhitespaceSymbolIndex(e.nodeValue),r=xa.getLastNonWhitespaceSymbolIndex(e.nodeValue);return n<o&&0!==n?(t.startPos.offset=o,t.endPos.offset=i+o-n):r<i&&i!==e.nodeValue.length&&(t.startPos.offset=e.nodeValue.length,t.endPos.offset=i+e.nodeValue.length-n),t}function Da(t,e,n){return!n||Sa.beforeInput(t,e)}function Ia(t,e){var n;function i(t){t.preventDefault(),n=!0}function o(t){"textInput"===t.type&&(n=!1)}ya.isSafari&&(_a.addInternalEventBeforeListener($c,["textInput"],i),ba.on(ba.EVENT_PREVENTED_EVENT,o));var r=ya.isFirefox||Sa.textInput(t,e)||n;return ya.isSafari&&(_a.removeInternalEventBeforeListener($c,["textInput"],i),ba.off(ba.EVENT_PREVENTED_EVENT,o)),r||ya.isIE11}function Ua(t,e){var n,i,o,r,s,l,a,u,c,h,f,d=Ta(t),m=d.startPos.node,p=d.endPos.node,v=!0,g=!0,E=e;function y(){g=!1}function b(t,e,n){n()}e=e.replace(Aa,String.fromCharCode(160)),m&&p&&Pa.isContentEditableElement(m)&&Pa.isContentEditableElement(p)&&(Pa.isTheSameNode(m,p)||(Ca.deleteSelectionContents(t),n=t,o=(i=d).startPos.node,r=wa.nodeParentNodeGetter.call(o)&&o.parentElement,!(ya.isChrome&&ya.version<58||ya.isSafari)&&r&&Pa.isElementContainsNode(n,o)||(i=Ta(n),Ca.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&Pa.isContentEditableElement(m)&&Pa.isRenderedNode(m)&&Da(t,e,ya.isChrome||ya.isFirefox)&&(v=Ia(t,E),g=v&&!ya.isIE11,_a.addInternalEventBeforeListener($c,["input"],y),_a.addInternalEventBeforeListener($c,["textinput"],b),(v=v&&Da(t,e,ya.isSafari))&&(Pa.isElementNode(m)?(s=m,l=e,c=Qc.createTextNode(l),h={node:c,offset:l.length},f=wa.nodeParentNodeGetter.call(s),"br"===Pa.getTagName(s)?f.insertBefore(c,s):0<a?(u=wa.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),Ca.selectByNodesAndOffsets(h,h)):function(t,e,n){var i=e.startPos.node;Pa.isElementContainsNode(t,i)||(i=(e=Ma(Ta(t))).startPos.node);var o=e.startPos.offset,r=e.endPos.offset,s=i.nodeValue,l={node:i,offset:o+n.length};i.nodeValue=s.substring(0,o)+n+s.substring(r,s.length),Ca.selectByNodesAndOffsets(l,l)}(t,Ma(d),e)),Ot().then(function(){g&&Sa.input(t,e),_a.removeInternalEventBeforeListener($c,["input"],y),_a.removeInternalEventBeforeListener($c,["textinput"],b)})))}function ka(t,e,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;Pa.isContentEditableElement(t)&&Ua(t,e),Pa.isElementReadOnly(t)||(Pa.isTextEditableElement(t)?(l=t,a=e,h=Pa.getElementValue(l),f=a.length,d=Ca.getSelectionStart(l),m=Ca.getSelectionEnd(l),p=Pa.isInputElement(l)&&"number"===l.type,Da(l,a,ya.isChrome||ya.isFirefox)&&Ia(l,a)&&Da(l,a,ya.isSafari)&&((u=!ya.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=ya.isIE&&ya.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&ya.isIOS&&"."===h[h.length-1]&&(d+=1),Pa.setElementValue(l,c),Ca.select(l,d+f,d+f)),Sa.input(l,a))):Pa.isInputElement(t)&&(i=t,o=e,null!==(r=n)?(s=Pa.getElementValue(i),Pa.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):Pa.setElementValue(i,o),Sa.change(i),Sa.input(i,o)))}function Ba(t){return 1===t.length&&("a"<=t&&t<="z"||"A"<=t&&t<="Z")}var Oa=p.nativeMethods,Na=p.utils.browser,Fa=p.eventSandbox.focusBlur,La=p.Promise,Ya=g.domUtils.isRadioButtonElement,Ka=g.domUtils.getActiveElement,Ra=g.domUtils.getTabIndexAttributeIntValue;function Wa(t){return t===t.toLowerCase()?t.toUpperCase():t.toLowerCase()}function Va(t){var e=Ka(t||Qc),n=null;if(e&&g.domUtils.isIframeElement(e)&&Oa.contentDocumentGetter.call(e))try{n=Va(Oa.contentDocumentGetter.call(e))}catch(t){}return n||e}function Xa(t,e,n){if(!Ya(e))return t;if(!n&&!e.name&&!Na.isChrome)return[e];var i,o,r=(i=e,o=null,n?""===i.name||Na.isFirefox||(o=function(t){return!t.name||t===i||t.name!==i.name}):""!==i.name?o=function(t){return Ya(t)&&t.name===i.name}:Na.isChrome&&(o=function(t){return Ya(t)&&!t.name}),o);return r&&(t=g.arrayUtils.filter(t,r)),t}function Ha(t,e,n){var i,o,r,s,l,a,u,c,h=e?-1:1,f=g.domUtils.getTopSameDomainWindow($c).document,d=(i=f,o=Oa.documentActiveElementGetter.call(i),r=o&&Ra(o),!(o&&r<0)),m=Xa(m=g.domUtils.getFocusableElements(f,d),t,n),p=Ya(t),v=g.arrayUtils.indexOf(m,t);return(e?0===v:v===m.length-1)?!e&&t.tabIndex<0?g.arrayUtils.find(m,function(t){return 0===t.tabIndex}):n||!p?Qc.body:m[m.length-1-v]:e&&-1===v?m[m.length-1]:(l=(s=m)[v+h],a=n,u=Ya(l)&&l.name&&!l.checked,c=null,a&&u&&(c=g.arrayUtils.find(s,function(t){return Ya(t)&&t.name===l.name&&t.checked})),c||l)}function Ga(t){if(Ba(t))return t.toUpperCase().charCodeAt(0);var e=g.KEY_MAPS.shiftMap[t]?g.KEY_MAPS.shiftMap[t].charCodeAt(0):t.charCodeAt(0);return g.KEY_MAPS.symbolCharCodeToKeyCode[e]||e}var qa={SPECIAL_KEYS:{capslock:"CapsLock",delete:"U+007F",end:"End",enter:"Enter",esc:"U+001B",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:"U+0020",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"},LETTERS:{a:"U+0041",b:"U+0042",c:"U+0043",d:"U+0044",e:"U+0045",f:"U+0046",g:"U+0047",h:"U+0048",i:"U+0049",j:"U+004A",k:"U+004B",l:"U+004C",m:"U+004D",n:"U+004E",o:"U+004F",p:"U+0050",q:"U+0051",r:"U+0052",s:"U+0053",t:"U+0054",u:"U+0055",v:"U+0056",w:"U+0057",x:"U+0058",y:"U+0059",z:"U+005A"},SYMBOLS:{0:"U+0030",1:"U+0031",2:"U+0032",3:"U+0033",4:"U+0034",5:"U+0035",6:"U+0036",7:"U+0037",8:"U+0038",9:"U+0039"," ":"U+0020","!":"U+0021","@":"U+0040","#":"U+0023",$:"U+0024","%":"U+0025","^":"U+005E","*":"U+002A","(":"U+0028",")":"U+0029",_:"U+005F","|":"U+007C","\\":"U+005C","/":"U+002F","?":"U+003F",".":"U+002E",",":"U+002C","<":"U+003C",">":"U+003E","[":"U+005B","]":"U+005D","{":"U+007B","}":"U+007D","§":"U+00A7","±":"U+00B1","'":"U+0027",'"':"U+0022",":":"U+003A",";":"U+003B","`":"U+0060","~":"U+007E"}};function za(t){return Ba(t)?qa.LETTERS[t.toLowerCase()]:qa.SYMBOLS[t]||qa.SPECIAL_KEYS[t]||t}function ja(t,e,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=t?"":n),"key"in KeyboardEvent.prototype&&(i.key=e),i}var $a=p.utils.browser,Qa=p.utils.extend,Za=p.eventSandbox.eventSimulator,Ja=(tu._isKeyActivatedInputElement=function(t){return g.domUtils.isInputElement(t)&&/button|submit|reset|radio|checkbox/.test(t.type)},tu.prototype._type=function(t,e){var n,i=t!==this.storedActiveElement,o=!i,r=t,s=g.domUtils.isEditableElement(t),l=g.domUtils.isEditableElement(this.storedActiveElement);try{i&&(n=g.domUtils.isElementInIframe(t)===g.domUtils.isElementInIframe(this.storedActiveElement)||l,o=(!$a.isFirefox||l)&&(!$a.isWebKit||n))}catch(t){}o&&(!$a.isIE&&i&&l&&s&&(r=this.storedActiveElement),ka(r,e))},tu.prototype._addKeyPropertyToEventOptions=function(t){return Qa(t,ja("keypress"===t.type,this.keyProperty,this.keyIdentifierProperty)),t},tu.prototype.down=function(t){this.storedActiveElement=Va(this.topSameDomainDocument),this.modifierKeyCode&&(t[this.sanitizedKey]=!0),t.shift&&this.isLetter&&(this.keyProperty=Wa(this.keyProperty));var e={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(e),Za.keydown(this.storedActiveElement,Qa(e,t))},tu.prototype.press=function(t){if(!this.isChar&&!this.specialKeyCode)return!0;var e=Va(this.topSameDomainDocument),n=this.isChar?function(t,e){if("space"===t)return" ";if(e){if(Ba(t))return Wa(t);if(g.KEY_MAPS.reversedShiftMap[t])return g.KEY_MAPS.reversedShiftMap[t]}return t}(this.sanitizedKey,t.shift):null,i=this.specialKeyCode||n.charCodeAt(0),o=e!==this.storedActiveElement;if($a.isWebKit&&o&&g.domUtils.isElementInIframe(e)!==g.domUtils.isElementInIframe(this.storedActiveElement))return!0;this.storedActiveElement=e;var r={keyCode:i,charCode:i,type:"keypress"};this._addKeyPropertyToEventOptions(r);var s=$a.isAndroid||Za.keypress(e,Qa(r,t));if(!s)return s;e=Va(this.topSameDomainDocument),!n||t.ctrl||t.alt||this._type(e,n);var l=tu._isKeyActivatedInputElement(e),a=g.domUtils.isButtonElement(e),u=$a.isSafari&&0<=$a.compareVersions([$a.webkitVersion,"603.1.30"]),c=$a.isFirefox&&l;return $a.isFirefox&&!c||u||!l&&!a||"enter"!==this.sanitizedKey||e.click(),s},tu.prototype.up=function(t){this.modifierKeyCode&&(t[this.sanitizedKey]=!1);var e={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(e);var n=Za.keyup(Va(this.topSameDomainDocument),Qa(e,t)),i=Va(this.topSameDomainDocument);return!$a.isFirefox&&!$a.isSafari&&(!$a.isChrome||53<=$a.version)&&n&&"space"===this.sanitizedKey&&tu._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty(tu.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),tu);function tu(t,e){this.isLetter=Ba(t),this.isChar=1===t.length||"space"===t,this.sanitizedKey=g.getSanitizedKey(t),this.modifierKeyCode=g.KEY_MAPS.modifiers[this.sanitizedKey],this.specialKeyCode=g.KEY_MAPS.specialKeys[this.sanitizedKey],this.keyCode=null,this.keyIdentifierProperty=za(e),this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow($c).document,this.keyProperty=g.KEY_MAPS.keyProperty[e]||e,this.isChar&&"space"!==t?this.keyCode=Ga(this.sanitizedKey):this.modifierKeyCode?this.keyCode=this.modifierKeyCode:this.specialKeyCode&&(this.keyCode=this.specialKeyCode),this.storedActiveElement=null}var eu,nu={ctrlA:"ctrl+a",backspace:"backspace",delete:"delete",left:"left",right:"right",up:"up",down:"down",shiftLeft:"shift+left",shiftRight:"shift+right",shiftUp:"shift+up",shiftDown:"shift+down",shiftHome:"shift+home",shiftEnd:"shift+end",home:"home",end:"end",enter:"enter",tab:"tab",shiftTab:"shift+tab",esc:"esc"},iu=p.Promise,ou=p.utils.browser,ru=p.eventSandbox.eventSimulator,su=p.eventSandbox.elementEditingWatcher,lu=y.textSelection,au=y.eventUtils,uu=y.domUtils,cu=i.selectElement,hu=null,fu=null;function du(){fu=hu=null,au.unbind(this,"blur",du,!0)}function mu(t){var e,n,i,o;uu.isTextAreaElement(t)&&(hu!==t&&(au.bind(t,"blur",du,!0),hu=t),e=t,n=lu.hasInverseSelection(e),i=uu.getTextAreaValue(e),o=n?lu.getSelectionStart(e):lu.getSelectionEnd(e),fu=i&&o?uu.getTextareaIndentInLine(e,o):0)}function pu(t,e){var n,i,o,r,s,l,a=uu.getTextAreaValue(t);a&&(n=lu.getSelectionStart(t),i=lu.getSelectionEnd(t),o=lu.hasInverseSelection(t),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==fu&&hu===t||mu(t),s=l.lastIndexOf("\n"),gu(t,n,i,o,Math.min(s+1+fu,l.length),e))}function vu(t,e){var n,i,o,r,s,l,a,u,c,h,f=uu.getTextAreaValue(t);f&&(n=lu.getSelectionStart(t),i=lu.getSelectionEnd(t),u=(r=(o=lu.hasInverseSelection(t))?n:i)+(l=-1===(c=(s=f.substring(r)).indexOf("\n"))?s.length:c+1),h=-1===(c=(a=s.substring(l)).indexOf("\n"))?a.length:c,null!==fu&&hu===t||mu(t),gu(t,n,i,o,u=Math.min(u+fu,u+h),e))}function gu(t,e,n,i,o,r){var s=null,l=null,l=r?(s=e!==n&&i?n:e,o):s=o;lu.select(t,s,l)}function Eu(t,e,n){uu.isInputElement(t)&&"number"===t.type&&("-"===e.charAt(0)&&"."===e.charAt(1)&&(e=e.substring(1)),"."===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1))),uu.setElementValue(t,e),lu.select(t,n,n),ru.input(t)}function yu(t,e){var n,i,o,r,s,l,a,u;return uu.isTextEditableElement(t)&&(n=lu.getSelectionStart(t),i=lu.getSelectionEnd(t),o=lu.hasInverseSelection(t),s=null,s=(r=!uu.isTextAreaElement(t)||uu.getTextareaLineNumberByPosition(t,n)===uu.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,a=-1===(l=uu.getElementValue(t).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=e?s:a,lu.select(t,u,a)):o?lu.select(t,i,a):lu.select(t,n,a)),iu.resolve()}function bu(t,e){var n,i,o,r,s,l,a,u,c;return uu.isTextEditableElement(t)&&(n=lu.getSelectionStart(t),i=lu.getSelectionEnd(t),o=lu.hasInverseSelection(t),s=null,u=s=(r=!uu.isTextAreaElement(t)||uu.getTextareaLineNumberByPosition(t,n)===uu.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=uu.getElementValue(t).substring(s)).indexOf("\n"))?l.length:a,r?(c=e?s:u,lu.select(t,c,u)):o?lu.select(t,i,u):lu.select(t,n,u)),iu.resolve()}function Su(t){return yu(t,!0)}function _u(t){return bu(t,!0)}function wu(t){return uu.isRadioButtonElement(t)&&!ou.isFirefox}function Pu(t,e){return xu(t,e,!1).then(function(t){t&&(t.checked=!0)})}function xu(t,e,n){return void 0===n&&(n=!0),t?(uu.isSelectElement(t)&&cu.collapseOptionList(),i=t,o=e,r=n,new La(function(t){var e=Ha(i,o,r);e?Fa.focus(e,function(){return t(e)}):t()}).then(function(t){return t&&uu.isTextEditableInput(t)&&lu.select(t),t})):iu.resolve();var i,o,r}var Cu=((eu={})[nu.ctrlA]=function(t){return uu.isEditableElement(t)&&lu.select(t),iu.resolve()},eu[nu.backspace]=function(t){var e,n,i;return uu.isTextEditableElementAndEditingAllowed(t)&&(e=lu.getSelectionStart(t),n=lu.getSelectionEnd(t),i=uu.getElementValue(t).replace(/\r\n/g,"\n"),n===e?0<e&&Eu(t,i.substring(0,e-1)+i.substring(n,i.length),e-1):Eu(t,i.substring(0,e)+i.substring(n,i.length),e)),uu.isContentEditableElement(t)&&lu.deleteSelectionContents(t),iu.resolve()},eu[nu.delete]=function(t){var e,n,i;return uu.isTextEditableElementAndEditingAllowed(t)&&(e=lu.getSelectionStart(t),n=lu.getSelectionEnd(t),i=uu.getElementValue(t).replace(/\r\n/g,"\n"),n===e?e<i.length&&Eu(t,i.substring(0,e)+i.substring(n+1,i.length),e):Eu(t,i.substring(0,e)+i.substring(n,i.length),e)),uu.isContentEditableElement(t)&&lu.deleteSelectionContents(t),iu.resolve()},eu[nu.left]=function(t){var e,n,i,o,r=null;return uu.isSelectElement(t)&&cu.switchOptionsByKeys(t,"left"),wu(t)?Pu(t,!0):(uu.isTextEditableElement(t)&&(e=(r=lu.getSelectionStart(t)||0)===lu.getSelectionEnd(t)?r-1:r,lu.select(t,e,e),mu(t)),uu.isContentEditableElement(t)&&(r=lu.getSelectionStart(t))!==lu.getSelectionEnd(t)&&(n=lu.getSelectionByElement(t),o={node:(i=lu.hasInverseSelectionContentEditable(t))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},lu.selectByNodesAndOffsets(o,o,!0)),iu.resolve())},eu[nu.right]=function(t){var e,n,i,o,r=null,s=null;return uu.isSelectElement(t)&&cu.switchOptionsByKeys(t,"right"),wu(t)?Pu(t,!1):(uu.isTextEditableElement(t)&&(e=(r=lu.getSelectionStart(t))===(s=lu.getSelectionEnd(t))?s+1:s,r===uu.getElementValue(t).length&&(e=r),lu.select(t,e,e),mu(t)),uu.isContentEditableElement(t)&&(r=lu.getSelectionStart(t))!==(s=lu.getSelectionEnd(t))&&(n=lu.getSelectionByElement(t),o={node:(i=lu.hasInverseSelectionContentEditable(t))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},lu.selectByNodesAndOffsets(o,o,!0)),iu.resolve())},eu[nu.up]=function(t){return uu.isSelectElement(t)&&cu.switchOptionsByKeys(t,"up"),wu(t)?Pu(t,!0):ou.isWebKit&&uu.isInputElement(t)?yu(t):(uu.isTextAreaElement(t)&&pu(t,!1),iu.resolve())},eu[nu.down]=function(t){return uu.isSelectElement(t)&&cu.switchOptionsByKeys(t,"down"),wu(t)?Pu(t,!1):ou.isWebKit&&uu.isInputElement(t)?bu(t):(uu.isTextAreaElement(t)&&vu(t,!1),iu.resolve())},eu[nu.shiftLeft]=function(t){var e,n;return uu.isTextEditableElement(t)&&((e=lu.getSelectionStart(t))===(n=lu.getSelectionEnd(t))||lu.hasInverseSelection(t)?lu.select(t,n,Math.max(e-1,0)):lu.select(t,e,Math.max(n-1,0)),mu(t)),iu.resolve()},eu[nu.shiftRight]=function(t){var e,n,i;return uu.isTextEditableElement(t)&&(e=lu.getSelectionStart(t),n=lu.getSelectionEnd(t),i=uu.getElementValue(t).length,e!==n&&lu.hasInverseSelection(t)?lu.select(t,n,Math.min(e+1,i)):lu.select(t,e,Math.min(n+1,i)),mu(t)),iu.resolve()},eu[nu.shiftUp]=function(t){return ou.isWebKit&&uu.isInputElement(t)?Su(t):(uu.isTextAreaElement(t)&&pu(t,!0),iu.resolve())},eu[nu.shiftDown]=function(t){return ou.isWebKit&&uu.isInputElement(t)?_u(t):(uu.isTextAreaElement(t)&&vu(t,!0),iu.resolve())},eu[nu.shiftHome]=Su,eu[nu.shiftEnd]=_u,eu[nu.home]=yu,eu[nu.end]=bu,eu[nu.enter]=function(t){var e,n,i,o,r,s;return uu.isSelectElement(t)&&cu.collapseOptionList(),uu.isInputElement(t)?(ou.isIE||su.processElementChanging(t),(e=uu.getParents(t,"form")[0])&&function(t,e){var n=t.querySelectorAll("input, button"),i=null,o=null;for(o=0;o<n.length;o++)if(!i&&"submit"===n[o].type&&!n[o].disabled){i=n[o];break}if(i)ru.click(i);else if(uu.blocksImplicitSubmission(e)){for(var r=t.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)uu.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===e&&e.validity.valid&&ru.submit(t)&&t.submit()}}(e,t)):uu.isTextAreaElement(t)?(n=lu.getSelectionStart(t),o=(i=uu.getTextAreaValue(t)).substring(0,n),r=i.substring(n),s=n+1,Eu(t,o+String.fromCharCode(10)+r,s)):t.tagName&&uu.isAnchorElement(t)&&ru.click(t),iu.resolve()},eu[nu.tab]=function(t){return xu(t,!1)},eu[nu.shiftTab]=function(t){return xu(t,!0)},eu[nu.esc]=function(t){return uu.isSelectElement(t)&&cu.collapseOptionList(),iu.resolve()},eu),Au=p.Promise,Tu=p.utils.browser,Mu=p.eventSandbox.message,Du=p.nativeMethods,Iu="automation|press|request",Uu="automation|press|response";Mu.on(Mu.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===Iu&&(p.on(p.EVENTS.beforeUnload,function(){return Mu.sendServiceMsg({cmd:Uu},t.source)}),new ku(t.message.keyCombinations,t.message.options).run().then(function(){return Mu.sendServiceMsg({cmd:Uu},t.source)}))});var ku=(Bu._getKeyPressSimulators=function(t){var e=function(t){for(var e=t.slice(),n=0;n<t.length;n++){var i=t[n];if("shift"===i.toLowerCase()){var o=t[n+1];if(!o)continue;g.KEY_MAPS.shiftMap[o]?t[n+1]=g.KEY_MAPS.shiftMap[o]:g.KEY_MAPS.reversedShiftMap[o]&&(e[n+1]=g.KEY_MAPS.reversedShiftMap[o])}!g.KEY_MAPS.shiftMap[i]||t[n-1]&&"shift"===t[n-1].toLowerCase()||(t[n]=g.KEY_MAPS.shiftMap[i],t.splice(n,0,"shift"),e.splice(n,0,"shift"),n++)}return{actualKeys:t,eventKeyProperties:e}}(g.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return g.arrayUtils.map(n,function(t,e){return new Ja(t,i[e])})},Bu._getShortcuts=function(t){for(var e=g.getKeyArray(t.toLowerCase()),n=[],i=[],o=[],r=0;r<e.length;r++)for(i.push(e[r]),o=i.slice();o.length;){var s=o.join("+");Cu[s]?(n.push(s),i=o=[]):o.shift()}return n},Bu._getShortcutHandlers=function(t){for(var e,n,i,o=Bu._getShortcuts(t.toLowerCase()),r={},s="",l=0;l<o.length;l++)e=o[l],n=t.indexOf(e),i=e.length,r[s+=t.substring(0,n+i)]=Cu[e],t=t.substring(n+i);return r},Bu.prototype._down=function(t){this.pressedKeyString+=(this.pressedKeyString?"+":"")+t.key;var e=!t.down(this.modifiersState);return Au.resolve(e)},Bu.prototype._press=function(t,e){var n=this;if(e&&!this.isSelectElement)return g.delay(this.automationSettings.keyActionStepDelay);var i=this.shortcutHandlers[this.pressedKeyString],o=!1;return i&&!Tu.isFirefox&&"enter"!==t.key||(o=!t.press(this.modifiersState)),o&&!this.isSelectElement||!i?g.delay(this.automationSettings.keyActionStepDelay):i(Va(this.topSameDomainDocument)).then(function(){return g.delay(n.automationSettings.keyActionStepDelay)})},Bu.prototype._up=function(t){return t.up(this.modifiersState),g.delay(this.automationSettings.keyActionStepDelay)},Bu.prototype._runCombination=function(t){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=g.domUtils.isSelectElement(Va(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=Bu._getShortcutHandlers(t);var e=Bu._getKeyPressSimulators(t);return g.promiseUtils.each(e,function(e){return n._down(e).then(function(t){return n._press(e,t)})}).then(function(){return g.arrayUtils.reverse(e),g.promiseUtils.each(e,function(t){return n._up(t)})})},Bu.prototype.run=function(){var e=this,t=g.domUtils.getActiveElement(),n=g.domUtils.isIframeElement(t);if(!vr($c)&&n&&Du.contentWindowGetter.call(t)){var i={cmd:Iu,keyCombinations:this.keyCombinations,options:this.options};return g.sendRequestToFrame(i,Uu,Du.contentWindowGetter.call(t))}return g.promiseUtils.each(this.keyCombinations,function(t){return e._runCombination(t).then(function(){return g.delay(e.automationSettings.keyActionStepDelay)})})},Bu);function Bu(t,e){this.keyCombinations=t,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow($c).document,this.automationSettings=new Dt(e.speed),this.options=e}var Ou,Nu=p.Promise,Fu=p.utils.extend,Lu=p.utils.browser,Yu=p.eventSandbox.eventSimulator,Ku=y.domUtils,Ru=y.eventUtils,Wu=y.delay,Vu=(_(Xu,Ou=as),Xu.prototype._mousedown=function(t){var e=this;return es.rightButtonDown().then(function(){return e.eventState.activeElementBeforeMouseDown=Ku.getActiveElement(),e.eventState.simulateDefaultBehavior=Yu.mousedown(t.element,t.options),e._focus(t)})},Xu.prototype._focus=function(t){return!1===this.simulateDefaultBehavior?Ot():Ts(Ku.isContentEditableElement(this.element)?this.element:t.element,!Lu.isIE||this.eventState.activeElementBeforeMouseDown===Ku.getActiveElement(),this.caretPos).then(Ot)},Xu.prototype._mouseup=function(e){var t=this;return es.buttonUp().then(function(){return t._getElementForEvent(e)}).then(function(t){return Yu.mouseup(t,e.options)})},Xu.prototype._contextmenu=function(e){return this._getElementForEvent(e).then(function(t){Yu.contextmenu(t,e.options),Ku.isElementFocusable(t)||Ds(t)})},Xu.prototype.run=function(t){var o=this,r=null;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.devicePoint;return r={point:n,element:e,options:Fu({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:Ru.BUTTON.right},o.modifiers)},Nu.all([Wu(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},Xu);function Xu(t,e){var n=Ou.call(this,t,e,$c,es)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var Hu=p.utils.browser,Gu=y.domUtils,qu=y.positionUtils,zu=y.styleUtils,ju=y.contentEditable,$u=y.arrayUtils,Qu=["direction","font-family","font-size","font-size-adjust","font-variant","font-weight","font-style","letter-spacing","line-height","text-align","text-indent","text-transform","word-wrap","word-spacing","padding-top","padding-left","padding-right","padding-bottom","margin-top","margin-left","margin-right","margin-bottom","border-top-width","border-left-width","border-right-width","border-bottom-width"];function Zu(t,e){var n,i,o,r,s,l=zu.getBordersWidth(t),a=qu.getOffsetPosition(t),u=t.scrollHeight||t.getBoundingClientRect().height,c=Math.ceil(e.left),h=Math.ceil(e.top),f=Math.floor(e.bottom);return Gu.isTextAreaElement(t)||(i=(n=qu.offsetToClientCoords({x:a.left,y:a.top})).x+l.left+1,o=n.y+l.top+1,r=n.y+l.top+l.bottom+u,s=n.y+l.top+u-1,c=Math.ceil(c<=n.x?i:e.left),h=Math.ceil(h<=n.y?o:e.top),f=Math.floor(r<=f?s:e.bottom)),{left:c,top:h,bottom:f}}function Ju(t){var e=zu.getElementScroll(Qc);return{left:t.left+e.left,top:t.top+e.top,bottom:t.bottom+e.top}}function tc(t,e){var n=t.getBoundingClientRect(),i=function(e){var t,n,i,o=Qc.body,r=qu.getOffsetPosition(e),s=zu.getElementMargin(e),l=r.top-s.top,a=r.left-s.left,u=Qc.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===zu.get(o,"position")&&(t=zu.getElementMargin(o),n=zu.get(o,"left"),i=zu.get(o,"top"),a-=t.left+(parseInt(n.replace("px",""),10)||0),l-=t.top+(parseInt(i.replace("px",""),10)||0)),$u.forEach(Qu,function(t){c+=t+":"+zu.get(e,t)+";"}),zu.set(u,{cssText:c,position:"absolute",left:a+"px",top:l+"px",width:e.scrollWidth+"px",height:e.scrollHeight+"px"}),p.nativeMethods.nodeTextContentSetter.call(u,Gu.getElementValue(e)+" "),o.appendChild(u),u}(t),o=null,r=t.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=Gu.getElementValue(t).length;try{var u=Qc.createRange();u.setStart(p.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e,a)),u.setEnd(p.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e+1,a+1)),Gu.isTextAreaElement(t)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(t){o=null}return Gu.remove(i),o?{width:o.width,height:o.height,top:o.top-s,bottom:o.bottom-s,left:o.left-l,right:o.right-l}:null}function ec(t,e){var n,i,o,r,s,l,a=null;return(a=Gu.isContentEditableElement(t)?(o=t,r=e,s=Gu.findDocument(o).createRange(),l=ju.calculateNodeAndOffsetByPosition(o,r),s.setStart(l.node,Math.min(l.offset,l.node.length)),s.setEnd(l.node,Math.min(l.offset,l.node.length)),s.getClientRects()[0]):"function"==typeof t.createTextRange?(n=e,(i=t.createTextRange()).collapse(!0),i.moveStart("character",n),i.moveEnd("character",n),i.collapse(!0),i.getBoundingClientRect()):tc(t,e))?{x:(a=Ju(a=Zu(t,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function nc(t,e){var n=Gu.isTextEditableElement(t),i=Gu.isContentEditableElement(t);return n&&0<Gu.getElementValue(t).length||i&&ju.getContentEditableValue(t).length?ec(t,e):qu.findCenter(t)}function ic(t,e,n){var i=Gu.findDocument(t).createRange();i.setStart(e,Math.min(n,e.length)),i.setEnd(e,Math.min(n,e.length));var o=i.getClientRects()[0];return o?{x:(o=Ju(Zu(t,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var oc,rc=p.Promise,sc=p.utils.browser,lc=p.utils.featureDetection,ac=p.eventSandbox.eventSimulator,uc=p.eventSandbox.focusBlur,cc=y.contentEditable,hc=y.domUtils,fc=y.positionUtils,dc=y.eventUtils,mc=y.delay,pc=(_(vc,oc=as),vc._calculateEventArguments=function(t){var e=fc.offsetToClientCoords(t);return Tt(e).then(function(t){if(!t)throw new Error(Mt.elementIsInvisibleError);return{element:t,options:{clientX:e.x,clientY:e.y}}})},vc.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Yo({offsetX:i,offsetY:o,speed:r},!1);return $r.create(n,s,$c,es).then(function(t){return t.run()}).then(function(){return mc(e.automationSettings.mouseActionStepDelay)})},vc.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,dc.preventDefault(t),dc.unbind(e.element,"mousedown",n)};dc.bind(this.element,"mousedown",n)},vc.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},vc.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},vc.prototype._moveToPoint=function(t){!function(t,e){if(Gu.isEditableElement(t)){var n=Gu.isTextAreaElement(t);if(!Gu.isInputElement(t)||!(Hu.isFirefox||Hu.isIE&&10<Hu.version)){var i=qu.getOffsetPosition(t),o=zu.getBordersWidth(t),r=zu.getElementScroll(t),s=e.x-i.left-o.left,l=e.y-i.top-o.top,a=null;if(n)return l<r.top&&(a=l),l>t.clientHeight+r.top&&(a=l-t.clientHeight),null!==a&&zu.setScrollTop(t,Math.round(a));s<r.left&&(a=s),s>t.clientWidth+r.left&&(a=s-t.clientWidth),null!==a&&zu.setScrollLeft(t,Math.round(a))}}}(this.element,t),this.clientPoint=function(t,e){var n=Gu.isTextEditableElement(t),i=Gu.isInputElement(t);if(!n&&!Gu.isContentEditableElement(t))return e;var o=qu.getOffsetPosition(t),r=zu.getBordersWidth(t),s=zu.getElementScroll(t),l=o.left+r.left+t.clientWidth;return i&&n&&(Hu.isFirefox||Hu.isIE&&10<Hu.version)?{x:Math.min(e.x,l),y:e.y}:{x:e.x-s.left,y:e.y-s.top}}(this.element,t);var e={element:Qc.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(e)},vc.prototype._mousedown=function(){var n=this;return es.leftButtonDown().then(function(){return vc._calculateEventArguments(n.clientPoint)}).then(function(t){n.eventArgs=t;var e=(sc.isWebKit||sc.isIE)&&hc.isSelectElement(n.element);return e&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=ac[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=e&&!n.eventState.mousedownPrevented),n._focus()})},vc.prototype._focus=function(){var n=this;return new rc(function(t){var e=hc.isContentEditableElement(n.element)?cc.findContentEditableParent(n.element):n.element;uc.focus(e,t,!1,!0)})},vc.prototype._setSelection=function(){throw new Error("Not implemented")},vc.prototype._mouseup=function(){var e=this;return es.buttonUp().then(function(){return e._setSelection(),vc._calculateEventArguments(e.clientPoint)}).then(function(t){e.eventArgs=t,ac[e.upEvent](e.eventArgs.element,e.eventArgs.options)})},vc.prototype.run=function(){var t=this;return this.absoluteStartPoint=this._calculateAbsoluteStartPoint(),this.absoluteEndPoint=this._calculateAbsoluteEndPoint(),this._moveToPoint(this.absoluteStartPoint).then(function(){return t._mousedown()}).then(function(){return t._moveToPoint(t.absoluteEndPoint)}).then(function(){return t._mouseup()})},vc);function vc(t,e){var n=oc.call(this,t,e,$c,es)||this;return n.absoluteStartPoint=null,n.absoluteEndPoint=null,n.clientPoint=null,n.speed=e.speed,n.downEvent=lc.isTouchDevice?"touchstart":"mousedown",n.upEvent=lc.isTouchDevice?"touchend":"mouseup",n.eventArgs={options:null,element:null},n.eventState={mousedownPrevented:!1,simulateDefaultBehavior:!0},n}var gc,Ec=y.textSelection,yc=y.domUtils,bc=y.positionUtils,Sc=(_(_c,gc=pc),_c.prototype._calculateAbsoluteStartPoint=function(){return nc(this.element,this.startPos)||bc.findCenter(this.element)},_c.prototype._calculateAbsoluteEndPoint=function(){var t=nc(this.element,this.endPos);return t||(yc.isContentEditableElement(this.element)?function(t,e,n){for(var i=n<e?1:-1,o=n,r=null;o!==e&&!(r=ec(t,o+=i)););return r=r||ec(t,e)||qu.findCenter(t)}(this.element,this.startPos,this.endPos):bc.findCenter(this.element))},_c.prototype._setSelection=function(){var t=yc.isTextEditableElement(this.element),e=yc.isContentEditableElement(this.element);(t||e)&&!1!==this.eventState.simulateDefaultBehavior&&Ec.select(this.element,this.startPos,this.endPos)},_c.prototype.run=function(t){var e=this;return this._ensureElement(t).then(function(){return gc.prototype.run.call(e)})},_c);function _c(t,e,n,i){var o=gc.call(this,t,i)||this;return o.startPos=e,o.endPos=n,o}var wc,Pc=y.textSelection,xc=y.contentEditable,Cc=y.positionUtils,Ac=(_(Tc,wc=pc),Tc.prototype._calculateAbsoluteStartPoint=function(){return ic(this.element,this.startNode,this.startOffset)||Cc.findCenter(this.element)},Tc.prototype._calculateAbsoluteEndPoint=function(){return ic(this.element,this.endNode,this.endOffset)||Cc.findCenter(this.element)},Tc.prototype._setSelection=function(){var t,e;!1!==this.eventState.simulateDefaultBehavior&&(t={node:this.startNode,offset:this.startOffset},e={node:this.endNode,offset:this.endOffset},Pc.selectByNodesAndOffsets(t,e,!0))},Tc);function Tc(t,e,n){var i=wc.call(this,xc.getNearestCommonAncestor(t,e),n)||this,o=xc.getFirstVisiblePosition(t),r=xc.getLastVisiblePosition(e),s={node:t,offset:o},l={node:e,offset:r},a=xc.calculatePositionByNodeAndOffset(i.element,s);return xc.calculatePositionByNodeAndOffset(i.element,l)<a&&(o=xc.getLastVisiblePosition(t),r=xc.getFirstVisiblePosition(e)),s=xc.calculateNodeAndOffsetByPosition(t,o),l=xc.calculateNodeAndOffsetByPosition(e,r),i.startNode=s.node,i.startOffset=s.offset,i.endNode=l.node,i.endOffset=l.offset,i}var Mc=p.Promise,Dc=p.utils.extend,Ic=p.utils.browser,Uc=p.eventSandbox.eventSimulator,kc=p.eventSandbox.elementEditingWatcher,Bc=y.domUtils,Oc=y.promiseUtils,Nc=y.contentEditable,Fc=y.textSelection,Lc=y.delay,Yc=y.KEY_MAPS.specialKeys,Kc=(Rc.findTextEditableChild=function(t){var e=null;if(!Bc.isEditableElement(t))for(var n=t.querySelectorAll("*"),i=0;i<n.length;i++)if(Bc.isTextEditableElementAndEditingAllowed(n[i])){e=n[i];break}return e},Rc.prototype._calculateEventArguments=function(t){var e=Bc.getActiveElement(),n=Bc.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||e===i||(i=Rc.findTextEditableChild(e)||e);var o=Dc({keyCode:t?this.currentCharCode:this.currentKeyCode},this.modifiers);return t&&(o.charCode=this.currentCharCode),Dc(o,ja(t,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},Rc.prototype._calculateTargetElement=function(){var t=Bc.getActiveElement(),e=Bc.isContentEditableElement(this.element);if(e){if(t!==Nc.findContentEditableParent(this.element))return void(this.eventState.skipType=!0)}else if(t!==this.element)return void(this.eventState.skipType=!0);this.element=e?this.element:t},Rc.prototype._click=function(t){var e,n=this,i=Bc.getActiveElement(),o=Bc.isTextEditableElementAndEditingAllowed(this.element),r=Bc.isContentEditableElement(this.element);if(i===this.element)return o&&kc.watchElementEditing(this.element),(o||r)&&(e=Fc.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===e||Fc.select(this.element,this.caretPos,this.caretPos)),Mc.resolve();var s=_t(this.element),l=s.offsetX,a=s.offsetY,u=new No({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new ul(this.element,u,$c,es).run(t).then(function(){return Lc(n.automationSettings.mouseActionStepDelay)})},Rc.prototype._type=function(){var t=this;if(this.eventState.skipType)return Mc.resolve();var e=Bc.isContentEditableElement(this.element);return this.replace&&(Bc.isTextEditableElementAndEditingAllowed(this.element)?Fc.select(this.element):e&&Fc.deleteSelectionContents(this.element,!0)),Oc.whilst(function(){return!t._isTypingFinished()},function(){return t._typingStep()})},Rc.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},Rc.prototype._typingStep=function(){var t=this.typingText.charAt(this.currentPos);return this.currentKeyCode=Ga(t),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this.currentKeyCode===Yc.enter?"Enter":t,this.currentKeyIdentifier=za(this.currentKey),this.ignoreChangeEvent=Bc.getElementValue(this.element)===kc.getElementSavedValue(this.element),this._keydown(),this._keypress(),this._keyup()},Rc.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=Uc.keydown(this.eventArgs.element,this.eventArgs.options)},Rc.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=Ic.isAndroid||Uc.keypress(this.eventArgs.element,this.eventArgs.options))},Rc.prototype._keyup=function(){var t=this,e=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=Bc.isTextEditableElement(this.element),i=Bc.isContentEditableElement(this.element),o=this.paste||!n&&!i;return Mc.resolve().then(function(){return o?t._typeAllText(e):t._typeChar(e)}).then(function(){Uc.keyup(t.eventArgs.element,t.eventArgs.options),o?t.currentPos=t.typingText.length:t.currentPos++})},Rc.prototype._typeChar=function(t){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&kc.restartWatchingElementEditing(t),Lc(this.automationSettings.keyActionStepDelay);var e=this.typingText.charAt(this.currentPos),n=/^\d$/.test(e),i=0===this.currentPos?null:this.typingText.charAt(this.currentPos-1);if(Bc.isInputElement(t)&&"number"===t.type){var o=Fc.getSelectionStart(t),r=Bc.getInputValue(t).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===e||"-"===e&&r)||0!==o))return Lc(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(e=i+e)}return ka(t,e,null),Lc(this.automationSettings.keyActionStepDelay)},Rc.prototype._typeAllText=function(t){return ka(t,this.typingText,this.caretPos),Lc(this.automationSettings.keyActionStepDelay)},Rc.prototype.run=function(t){var e=this;return this._click(t).then(function(){return e._calculateTargetElement()}).then(function(){return e._type()})},Rc);function Rc(t,e,n){this.element=Rc.findTextEditableChild(t)||t,this.typingText=e.toString(),this.modifiers=n.modifiers,this.caretPos=n.caretPos,this.replace=n.replace,this.paste=n.paste,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=n.speed,this.automationSettings=new Dt(this.speed),this.elementChanged=t!==this.element,this.currentPos=0,this.currentKeyCode=null,this.currentCharCode=null,this.currentKey=null,this.currentKeyIdentifier=null,this.ignoreChangeEvent=!0,this.eventArgs={options:null,element:null},this.eventState={skipType:!1,simulateKeypress:!0,simulateTypeChar:!0}}var Wc=(Vc.prototype.run=function(){var i=this;return m.doUpload(this.element,this.paths).then(function(t){if(t.length){var e=g.arrayUtils.map(t,function(t){return t.path}),n=g.arrayUtils.reduce(t,function(t,e){return t.concat(e.resolvedPaths)},[]);throw i.createError(e,n)}})},Vc);function Vc(t,e,n){this.element=t,this.paths=e,this.createError=n}var Xc=y.domUtils,Hc=y.contentEditable,Gc={};Gc.DispatchEvent=t,Gc.SetScroll=fs,Gc.ScrollIntoView=ps,Gc.Click=ul,Gc.SelectChildClick=Il,Gc.DblClick=Kl,Gc.DragToOffset=ca,Gc.DragToElement=ma,Gc.Hover=ga,Gc.Press=ku,Gc.RClick=Vu,Gc.SelectText=Sc,Gc.SelectEditableContent=Ac,Gc.Type=Kc,Gc.Upload=Wc,Gc.MouseOptions=ko,Gc.ClickOptions=No,Gc.TypeOptions=qo,Gc.ERROR_TYPES=Mt,Gc.AutomationSettings=Dt,Gc.getOffsetOptions=wt,Gc.calculateSelectTextArguments=function(t,e){void 0===e&&(e={});var n,i,o,r,s,l,a,u,c,h,f,d=Xc.isTextEditableElement(t),m=d?0:Hc.getFirstVisiblePosition(t),p=d?Xc.getElementValue(t).length:Hc.getLastVisiblePosition(t),v=e.startPos?Math.min(e.startPos,p):m,g=void 0===e.endPos||null===e.endPos?p:Math.min(e.endPos,p);return void 0!==e.offset?(g=0<=e.offset?Math.min(e.offset,g):(v=g,Math.max(0,g+e.offset)),{startPos:v,endPos:g}):void 0!==e.startLine?(n=t,i=e,o=Xc.getTextAreaValue(n),r=o&&o.length?o.split("\n"):[],s=r.length-1,l=i.startLine?Math.min(i.startLine,s):0,a=r[l]?r[l].length:0,u=i.startPos?Math.min(i.startPos,a):0,c=void 0===i.endLine||null===i.endLine?s:Math.min(i.endLine,s),h=r[c]?r[c].length:0,f=void 0===i.endPos||null===i.endPos?h:Math.min(i.endPos,h),{startPos:Xc.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:Xc.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},Gc.cursor=es,Gc.getNextFocusableElement=Ha,Gc.SHORTCUT_TYPE=nu,Gc.getSelectionCoordinatesByPosition=nc,Gc.getElementFromPoint=Tt,Gc.MoveAutomation=$r;var qc=p.nativeMethods,zc=p.EVENTS.evalIframeScript;qc.objectDefineProperty($c,"%testCafeAutomation%",{configurable:!0,value:Gc}),p.on(zc,function(t){return jc(qc.contentWindowGetter.call(t.iframe))})}($c["%hammerhead%"],$c["%hammerhead%"].Promise,$c["%testCafeCore%"],$c["%testCafeUI%"])}(window);
|
|
1
|
+
window["%hammerhead%"].utils.removeInjectedScript(),function ih(oh){var rh=oh.document;!function(m,e,g,i){var p="default"in m?m.default:m;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var y="default"in g?g.default:g;i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;var n=p.nativeMethods,o=/^((mouse\w+)|((dbl)?click)|(contextmenu))$/,r=/^((drag\w*)|(drop))$/,s=/^key\w+$/,l=/^(before)?input$/,a=/^(blur|(focus(in|out)?))$/,u=/^pointer\w+/,c={click:1,dblclick:2,mousedown:1,mouseup:1},h="MouseEvent",f="PointerEvent",d="KeyboardEvent",v="InputEvent",E="FocusEvent",t=(b.prototype.run=function(){var t=this.options,e=t.bubbles,n=t.cancelable,i=t.detail,o=(t.view,t.buttons),e=!1!==e,n=!1!==n,i=i||c[this.eventName],o=void 0===o?1:o;Object.assign(this.options,{bubbles:e,cancelable:n,detail:i,view:oh,buttons:o});var r,s=b._getEventCtorByEventType(this.eventName,this.options.eventConstructor);s&&(r=new s(this.eventName,this.options),this.element.dispatchEvent(r))},b._getEventCtorByEventType=function(t,e){if(e&&"function"==typeof b._getEventCtorFromWindow(e)){var n=b._getEventCtorFromNativeMethods(e);if(n&&"function"==typeof n)return n}return o.test(t)||r.test(t)?b._getEventCtorFromNativeMethods(h):u.test(t)?b._getEventCtorFromNativeMethods(f):s.test(t)?b._getEventCtorFromNativeMethods(d):l.test(t)?b._getEventCtorFromNativeMethods(v):a.test(t)?b._getEventCtorFromNativeMethods(E):b._getEventCtorFromNativeMethods("CustomEvent")},b._getEventCtorFromNativeMethods=function(t){return n["Window"+t]||b._getEventCtorFromWindow(t)},b._getEventCtorFromWindow=function(t){return oh[t]},b);function b(t,e,n){this.element=t,this.eventName=e,this.options=n}var S=function(t,e){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function _(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}S(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function w(t,s,l,a){return new(l=l||e)(function(n,e){function i(t){try{r(a.next(t))}catch(t){e(t)}}function o(t){try{r(a.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):((e=t.value)instanceof l?e:new l(function(t){t(e)})).then(i,o)}r((a=a.apply(t,s||[])).next())})}function P(n,i){var o,r,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(s=2&e[0]?r.return:e[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,e[1])).done)return s;switch(r=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,r=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){l.label=e[1];break}if(6===e[0]&&l.label<s[1]){l.label=s[1],s=e;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(e);break}s[2]&&l.ops.pop(),l.trys.pop();continue}e=i.call(n,l)}catch(t){e=[6,t],r=0}finally{o=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var x=(C.create=function(t){return"left"in t?new C(t.left,t.top):"right"in t?new C(t.right,t.bottom):new C(t.x,t.y)},C.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},C.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},C.prototype.round=function(t){return void 0===t&&(t=Math.round),this.x=t(this.x),this.y=t(this.y),this},C.prototype.eql=function(t){return this.x===t.x&&this.y===t.y},C.prototype.mul=function(t){return this.x*=t,this.y*=t,this},C.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},C);function C(t,e){this.x=t,this.y=e}function A(t){var e="array"+t.charAt(0).toUpperCase()+t.slice(1),n=m.nativeMethods[e];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,t)}}A("filter"),A("map"),A("slice"),A("splice"),A("unshift"),A("forEach"),A("indexOf");var T=A("some"),M=(A("reverse"),A("reduce"),A("concat"),A("join"),p.utils.browser,p.nativeMethods),D=(p.utils.style.get,p.utils.dom.getActiveElement,p.utils.dom.findDocument),U=p.utils.dom.find,I=(p.utils.dom.isElementInDocument,p.utils.dom.isElementInIframe),k=p.utils.dom.getIframeByElement,B=(p.utils.dom.isCrossDomainWindows,p.utils.dom.getSelectParent,p.utils.dom.getChildVisibleIndex,p.utils.dom.getSelectVisibleChildren,p.utils.dom.isElementNode),O=(p.utils.dom.isTextNode,p.utils.dom.isRenderedNode,p.utils.dom.isIframeElement,p.utils.dom.isInputElement,p.utils.dom.isButtonElement,p.utils.dom.isFileInput,p.utils.dom.isTextAreaElement,p.utils.dom.isAnchorElement,p.utils.dom.isImgElement),N=(p.utils.dom.isFormElement,p.utils.dom.isLabelElement,p.utils.dom.isSelectElement,p.utils.dom.isRadioButtonElement,p.utils.dom.isColorInputElement,p.utils.dom.isCheckboxElement,p.utils.dom.isOptionElement,p.utils.dom.isSVGElement,p.utils.dom.isMapElement,p.utils.dom.isBodyElement),F=p.utils.dom.isHtmlElement,L=(p.utils.dom.isDocument,p.utils.dom.isWindow,p.utils.dom.isTextEditableInput,p.utils.dom.isTextEditableElement,p.utils.dom.isTextEditableElementAndEditingAllowed,p.utils.dom.isContentEditableElement,p.utils.dom.isDomElement,p.utils.dom.isShadowUIElement,p.utils.dom.isShadowRoot,p.utils.dom.isElementFocusable,p.utils.dom.isHammerheadAttr,p.utils.dom.isElementReadOnly,p.utils.dom.getScrollbarSize),Y=(p.utils.dom.getMapContainer,p.utils.dom.getTagName),R=p.utils.dom.closest,K=p.utils.dom.getParents,W=p.utils.dom.findParent;function V(t,e){return t.contains?t.contains(e):T(t,function(t){return t.contains(e)})}function X(t){return M.nodeTextContentGetter.call(t)}p.utils.dom.getTopSameDomainWindow,p.utils.dom.getParentExceptShadowRoot;var H=(q.create=function(t){return new q(t.top,t.right,t.bottom,t.left)},q.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},q.prototype.sub=function(t){return"top"in t&&(this.top-=t.top,this.left-=t.left),this.bottom-=t.bottom,this.right-=t.right,this},q.prototype.round=function(t,e){return void 0===t&&(t=Math.round),void 0===e&&(e=t),this.top=t(this.top),this.right=e(this.right),this.bottom=e(this.bottom),this.left=t(this.left),this},q.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},q);function q(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.top=t,this.right=e,this.bottom=n,this.left=i}var G=p.utils.style,z=p.utils.style.getBordersWidth,j=(p.utils.style.getComputedStyle,p.utils.style.getElementMargin,p.utils.style.getElementPadding),$=p.utils.style.getElementScroll,Q=(p.utils.style.getOptionHeight,p.utils.style.getSelectElementSize,p.utils.style.isElementVisible,p.utils.style.isVisibleChild,p.utils.style.getWidth),Z=p.utils.style.getHeight,J=p.utils.style.getInnerWidth,tt=p.utils.style.getInnerHeight,et=p.utils.style.getScrollLeft,nt=p.utils.style.getScrollTop,it=p.utils.style.setScrollLeft,ot=p.utils.style.setScrollTop,rt=p.utils.style.get;function st(t){return B(t)&&"fixed"===G.get(t,"position")}var lt=function(t,e,n,i,o,r){this.width=t,this.height=e,this.left=n.x,this.top=n.y,this.right=n.x+t,this.bottom=n.y+e,this.border=i,this.scrollbar=r,this.scroll=o},at=p.utils.position.getElementRectangle,ut=p.utils.position.getOffsetPosition,ct=p.utils.position.offsetToClientCoords;function ht(t){var e,n,i,o,r=F(t),s=r?t.getElementsByTagName("body")[0]:null,l=t.getBoundingClientRect(),a=H.create(z(t)),u=$(t),c=I(t),h="BackCompat"===t.ownerDocument.compatMode,f=r?new x(0,0):x.create(l),d=l.height,m=l.width;r&&(m=s&&h?(d=s.clientHeight,s.clientWidth):(d=t.clientHeight,t.clientWidth)),!c||(e=k(t))&&(n=ut(e),i=ct(x.create(n)),o=z(e),f.add(i).add(x.create(o)),r&&a.add(o));var p=!r&&J(t)!==t.clientWidth,v=!r&&tt(t)!==t.clientHeight,g={right:p?L():0,bottom:v?L():0};return new lt(m,d,f,a,u,g)}function ft(t){var e=t.x,n=t.y,i=rh.getElementFromPoint||rh.elementFromPoint,o=null;try{o=i.call(rh,e,n)}catch(t){return null}for(null===o&&(o=i.call(rh,e-1,n-1));o&&o.shadowRoot&&o.shadowRoot.elementFromPoint;){var r=o.shadowRoot.elementFromPoint(e,n);if(!r||o===r)break;o=r}return o}function dt(t,e,n){var i=ht(t),o=Math.max(t.scrollWidth,i.width),r=Math.max(t.scrollHeight,i.height),s=i.scrollbar.right+i.border.left+i.border.right+o,l=i.scrollbar.bottom+i.border.top+i.border.bottom+r;return(void 0===e||0<=e&&e<=s)&&(void 0===n||0<=n&&n<=l)}function mt(t){var e=ut(t),n=e.left,i=e.top,o=ct({x:n,y:i});return o.x=Math.round(o.x),o.y=Math.round(o.y),o}function pt(n,e){return m.Promise.resolve(n===rh.documentElement).then(function(t){if(t)return new x(0,0);var e=m.utils.browser.isFirefox?Math.ceil:Math.round;return m.Promise.resolve(ut(n,e)).then(function(t){return x.create(t)})}).then(function(t){return t.add(e)})}var vt=/auto|scroll|hidden/i,gt="visible";function Et(t){var e,n=rt(t,"overflowX"),i=rt(t,"overflowY"),o=vt.test(n),r=vt.test(i),s=D(t).documentElement,l=t.scrollHeight;return(m.utils.browser.isChrome||m.utils.browser.isFirefox||m.utils.browser.isSafari)&&(e=t.getBoundingClientRect().top,l=l-s.getBoundingClientRect().top+e),(o||r)&&l>s.scrollHeight}function yt(t){if(N(t))return Et(t);if(F(t))return function(t){var e=rt(t,"overflowX"),n=rt(t,"overflowY");if("hidden"===e&&"hidden"===n)return!1;var i=t.scrollHeight>t.clientHeight,o=t.scrollWidth>t.clientWidth;if(i||o)return!0;var r=t.getElementsByTagName("body")[0];if(!r)return!1;if(Et(r))return!1;var s=Math.min(t.clientWidth,r.clientWidth),l=Math.min(t.clientHeight,r.clientHeight);return r.scrollHeight>l||r.scrollWidth>s}(t);var e,n,i,o,r,s=(n=rt(e=t,"overflowX"),i=rt(e,"overflowY"),o=vt.test(n),r=vt.test(i),m.utils.browser.isIE&&(o=o||r&&n===gt,r=r||o&&i===gt),new x(o,r));if(!s.x&&!s.y)return!1;var l=s.y&&t.scrollHeight>t.clientHeight;return s.x&&t.scrollWidth>t.clientWidth||l}function bt(t){if(!t)return null;var e,n,i=(e=oh.screenLeft||oh.screenX,n=oh.screenTop||oh.screenY,new x(e,n)),o=i.x,r=i.y,s=o+t.x,l=r+t.y;return new x(s,l)}function St(t){var e=t/2;return e<1?0:Math.round(e)}function _t(t){var e=at(t);return{offsetX:St(e.width),offsetY:St(e.height)}}function wt(t,e,n){var i=_t(t);if(e="number"==typeof e?Math.round(e):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<e&&0<n)return{offsetX:e,offsetY:n};var o=ht(t),r=Math.round(Math.max(t.scrollWidth,o.width)),s=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+r,a=o.scrollbar.bottom+o.border.top+o.border.bottom+s;return{offsetX:e<0?l+e:e,offsetY:n<0?a+n:n}}var Pt=y.positionUtils;function xt(e,n){return void 0===n&&(n=!1),i.hide(n).then(function(){var t=Pt.getElementFromPoint(e);return i.show(n).then(function(){return t})})}function Ct(t,n){return m.Promise.resolve(ft(t)).then(function(e){return m.Promise.resolve(V(n,e)).then(function(t){return t&&X(e)}).then(function(t){return t||e&&e===n?e:null})})}function At(n,i){if(!i||!n||n===i)return n;if("tref"===Y(i))return i;var e,o,t="area"===Y(i)&&O(n);return m.utils.browser.isFirefox&&t?(e=n,o=i,m.Promise.resolve(R(o,"map")).then(function(t){return t&&t.name===e.useMap.substring(1)?o:e})):m.Promise.resolve(R(i,"a")).then(function(t){return!!t}).then(function(t){return!!t&&m.Promise.resolve(V(i,n)).then(function(t){return t&&X(n)}).then(function(t){return!t&&X(i)})}).then(function(t){return t?m.Promise.resolve(ht(i)).then(function(e){return Ct({x:e.right-1,y:e.top+1},i).then(function(t){return t||Ct({x:e.left+1,y:e.bottom-1},i)}).then(function(t){return t||n})}):n})}function Tt(n,i,o){return xt(n).then(function(t){var e=m.Promise.resolve(t);return!t&&m.utils.dom.isIframeWindow(i||oh)&&0<n.x&&0<n.y&&(e=e.then(function(){return xt(n,!0)})),e.then(function(t){return At(t,o)})})}var Mt={elementIsInvisibleError:"elementIsInvisibleError",foundElementIsNotTarget:"foundElementIsNotTarget"},Dt=(Object.defineProperty(Ut.prototype,"mouseActionStepDelay",{get:function(){return 1===this._speedFactor?10:400*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Ut.prototype,"keyActionStepDelay",{get:function(){return 1===this._speedFactor?10:200*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Ut.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this._speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(Ut.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this._speedFactor)/4},enumerable:!1,configurable:!0}),Ut);function Ut(t){this._speedFactor=t||1}var It=p.Promise,kt=p.nativeMethods;function Bt(e){return new It(function(t){return kt.setTimeout.call(oh,t,e)})}function Ot(){return Bt(0)}var Nt=(Ft.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},Ft.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t)for(var i=this._getAssignableProperties(),o=0;o<i.length;o++){for(var r,s=i[o],l=s.name,a=s.type,u=s.required,c=s.init,h=s.defaultValue,f=l.split("."),d=f.length-1,m=f[d],p=t,v=this,g=0;g<d&&p&&v;g++)p=p[f[g]],v=v[f[g]];v&&"defaultValue"in i[o]&&(v[l]=h),p&&v&&(void 0===(r=p[m])&&!u||(e&&a&&a(l,r),v[m]=c?c(l,r,n,e):r))}},Ft);function Ft(){}function Lt(i){return function(t,e){var n=typeof e;if("number"!=n)throw new i(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new i(t,e)}}function Yt(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var Rt,Kt,Wt,Vt="E1",Xt="E4",Ht="E5",qt="E9",Gt="E10",zt="E11",jt="E12",$t="E24",Qt="E26",Zt="E27",Jt="E28",te="E29",ee="E30",ne="E31",ie="E32",oe="E33",re="E34",se="E35",le="E36",ae="E37",ue="E39",ce="E40",he="E41",fe="E42",de="E43",me="E44",pe="E45",ve="E46",ge="E49",Ee="E50",ye="E51",be="E52",Se="E57",_e="E64",we="E65",Pe="E68",xe="E69",Ce="E70",Ae="E71",Te="E72",Me="E73",De="E74",Ue="E76",Ie="E77",ke="E78",Be="E82",Oe="E83",Ne="E90",Fe="E91",Le="E92",Ye="E93",Re="E94",Ke="E95",We="E97",Ve=(_(Xe,Rt=Yt),Xe);function Xe(t,e,n){var i=Rt.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function He(t,e){var n=Kt.call(this,ge,e)||this;return n.instantiationCallsiteName=t,n}function qe(t,e){var n=Wt.call(this,Ee,e)||this;return n.instantiationCallsiteName=t,n}_(He,Kt=Yt),_(qe,Wt=Yt);var Ge,ze,je,$e,Qe,Ze,Je,tn,en=(_(nn,Ge=Yt),nn);function nn(t,e,n){var i=e.apiFnChain,o=e.apiFnIndex,r=Ge.call(this,t,n)||this;return r.apiFnChain=i,r.apiFnIndex=o,r}function on(t){return ze.call(this,ye,t)||this}function rn(t,e){return je.call(this,be,e,t)||this}function sn(t,e){var n=$e.call(this,Vt)||this;return n.errStack=t,n.pageDestUrl=e,n}function ln(t,e,n){var i=Qe.call(this,Xt,n)||this;return i.errMsg=String(e),i.instantiationCallsiteName=t,i}function an(t,e,n,i){var o=Ze.call(this,Ht,i)||this;return o.errMsg=String(e),o.property=n,o.instantiationCallsiteName=t,o}function un(t){var e=Je.call(this,_e)||this;return e.errMsg=String(t),e}function cn(t,e){var n=tn.call(this,we)||this;return n.errMsg=String(t),n.moduleName=e,n}_(on,ze=Yt),_(rn,je=en),_(sn,$e=Yt),_(ln,Qe=Yt),_(an,Ze=Yt),_(un,Je=Yt),_(cn,tn=Yt);var hn,fn=(_(dn,hn=Ve),dn);function dn(t,e){return hn.call(this,qt,t,e)||this}var mn,pn=(_(vn,mn=Ve),vn);function vn(t,e){return mn.call(this,Gt,t,e)||this}var gn,En=(_(yn,gn=Ve),yn);function yn(t,e){return gn.call(this,zt,t,e)||this}var bn,Sn=(_(_n,bn=Ve),_n);function _n(t,e){return bn.call(this,jt,t,e)||this}var wn,Pn=(_(xn,wn=Ve),xn);function xn(t,e){return wn.call(this,Ne,t,e)||this}var Cn,An=(_(Tn,Cn=Ve),Tn);function Tn(t,e){return Cn.call(this,We,t,e)||this}var Mn,Dn=(_(Un,Mn=Ve),Un);function Un(t,e){return Mn.call(this,Fe,t,e)||this}var In,kn=(_(Bn,In=Ve),Bn);function Bn(t,e){return In.call(this,Le,t,e)||this}var On,Nn=(_(Fn,On=Ve),Fn);function Fn(t,e){return On.call(this,Ye,t,e)||this}var Ln,Yn=(_(Rn,Ln=Ve),Rn);function Rn(t,e){return Ln.call(this,Re,t,e)||this}var Kn,Wn,Vn,Xn,Hn,qn,Gn,zn,jn,$n,Qn,Zn,Jn,ti,ei,ni,ii,oi,ri,si,li,ai,ui,ci,hi,fi,di,mi,pi,vi,gi,Ei,yi,bi,Si,_i=(_(wi,Kn=Ve),wi);function wi(t,e){return Kn.call(this,Ke,t,e)||this}function Pi(t,e){return Wn.call(this,$t,e,t)||this}function xi(t){return Vn.call(this,Qt,t)||this}function Ci(t){var e=Xn.call(this,Zt)||this;return e.nodeDescription=t,e}function Ai(t,e){var n=Hn.call(this,Jt,e)||this;return n.argumentName=t,n}function Ti(t){var e=qn.call(this,te)||this;return e.argumentName=t,e}function Mi(t,e){var n=Gn.call(this,ee)||this;return n.argumentName=t,n.nodeDescription=e,n}function Di(){return zn.call(this,ne)||this}function Ui(){return jn.call(this,ie)||this}function Ii(t){var e=$n.call(this,oe)||this;return e.argumentName=t,e}function ki(){return Qn.call(this,se)||this}function Bi(t){var e=Zn.call(this,le)||this;return e.argumentName=t,e}function Oi(t,e){var n=Jn.call(this,ae)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function Ni(){return ti.call(this,re)||this}function Fi(t,e){var n=ei.call(this,he)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function Li(t,e){var n=ni.call(this,Se)||this;return t<=0?e<=0?(n.verb="are",n.dimensions="width and height"):(n.verb="is",n.dimensions="width"):(n.verb="is",n.dimensions="height"),n}function Yi(t){return ii.call(this,ce,t)||this}function Ri(){return oi.call(this,ue)||this}function Ki(){return ri.call(this,fe)||this}function Wi(){return si.call(this,xe)||this}function Vi(){return li.call(this,Pe)||this}function Xi(){return ai.call(this,Ce)||this}function Hi(){return ui.call(this,Ae)||this}function qi(){return ci.call(this,Me)||this}function Gi(){return hi.call(this,Be)||this}function zi(t){var e=fi.call(this,ke)||this;return e.errMsg=t,e}function ji(){return di.call(this,De)||this}function $i(){return mi.call(this,Ue)||this}function Qi(){return pi.call(this,Ie)||this}function Zi(){return vi.call(this,Te)||this}function Ji(){return gi.call(this,Oe)||this}function to(){return Ei.call(this,de)||this}function eo(){return yi.call(this,me)||this}function no(t,e){var n=bi.call(this,pe)||this;return n.dialogType=t,n.pageUrl=e,n}function io(t,e,n){var i=Si.call(this,ve)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}_(Pi,Wn=en),_(xi,Vn=Yt),_(Ci,Xn=Yt),_(Ai,Hn=en),_(Ti,qn=Yt),_(Mi,Gn=Yt),_(Di,zn=Yt),_(Ui,jn=Yt),_(Ii,$n=Yt),_(ki,Qn=Yt),_(Bi,Zn=Yt),_(Oi,Jn=Yt),_(Ni,ti=Yt),_(Fi,ei=Yt),_(Li,ni=Yt),_(Yi,ii=Yt),_(Ri,oi=Yt),_(Ki,ri=Yt),_(Wi,si=Yt),_(Vi,li=Yt),_(Xi,ai=Yt),_(Hi,ui=Yt),_(qi,ci=Yt),_(Gi,hi=Yt),_(zi,fi=Yt),_(ji,di=Yt),_($i,mi=Yt),_(Qi,pi=Yt),_(Zi,vi=Yt),_(Ji,gi=Yt),_(to,Ei=Yt),_(eo,yi=Yt),_(no,bi=Yt),_(io,Si=Yt);var oo,ro,so,lo,ao,uo,co,ho,fo,mo,po,vo,go=Lt(fn),Eo=(ro=Lt(oo=pn),function(t,e){if(ro(t,e),e<0)throw new oo(t,e)}),yo=(so=En,function(t,e){var n=typeof e;if("boolean"!=n)throw new so(t,n)}),bo=(lo=Sn,function(t,e){var n=typeof e;if("number"!=n)throw new lo(t,n);if(isNaN(e)||e<.01||1<e)throw new lo(t,e)}),So=(ao=Pn,function(t,e){var n=typeof e;if("string"!=n)throw new ao(t,n)}),_o=(uo=An,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof RegExp))throw new uo(t,n)}),wo=(co=Dn,function(t,e){if(!(e instanceof Date))throw new co(t,e)}),Po=(ho=kn,function(t,e){if(isNaN(Number(e)))throw new ho(t,typeof e)}),xo=(fo=Nn,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new fo(t,n)}),Co=(mo=Yn,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new mo(t,n)}),Ao=(po=_i,function(t,e){var n=typeof e;if("object"!=n)throw new po(t,n)}),To=(_(Mo,vo=Nt),Mo.prototype._getAssignableProperties=function(){return[{name:"speed",type:bo}]},Mo);function Mo(t,e){var n=vo.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var Do,Uo=(_(Io,Do=To),Io.prototype._getAssignableProperties=function(){return Do.prototype._getAssignableProperties.call(this).concat([{name:"offsetX",type:go},{name:"offsetY",type:go}])},Io);function Io(t,e){var n=Do.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var ko,Bo,Oo=(_(No,ko=Uo),No.prototype._getAssignableProperties=function(){return ko.prototype._getAssignableProperties.call(this).concat([{name:"scrollToCenter",type:yo},{name:"skipParentFrames",type:yo}])},No);function No(t,e){var n=ko.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}function Fo(t,e){var n=Bo.call(this)||this;return n.scrollTargetX=null,n.scrollTargetY=null,n.includeMargins=!1,n.includeBorders=!0,n.includePaddings=!0,n.crop={left:null,right:null,top:null,bottom:null},n._assignFrom(t,e),n}_(Fo,Bo=To),Fo.prototype._getAssignableProperties=function(){return Bo.prototype._getAssignableProperties.call(this).concat([{name:"scrollTargetX",type:go},{name:"scrollTargetY",type:go},{name:"crop.left",type:go},{name:"crop.right",type:go},{name:"crop.top",type:go},{name:"crop.bottom",type:go},{name:"includeMargins",type:yo},{name:"includeBorders",type:yo},{name:"includePaddings",type:yo}])};var Lo,Yo=(_(Ro,Lo=Uo),Ro.prototype._getAssignableProperties=function(){return Lo.prototype._getAssignableProperties.call(this).concat([{name:"modifiers.ctrl",type:yo},{name:"modifiers.alt",type:yo},{name:"modifiers.shift",type:yo},{name:"modifiers.meta",type:yo}])},Ro);function Ro(t,e){var n=Lo.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var Ko,Wo=(_(Vo,Ko=Yo),Vo.prototype._getAssignableProperties=function(){return Ko.prototype._getAssignableProperties.call(this).concat([{name:"caretPos",type:Eo}])},Vo);function Vo(t,e){var n=Ko.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var Xo,Ho=(_(qo,Xo=Yo),qo.prototype._getAssignableProperties=function(){return Xo.prototype._getAssignableProperties.call(this).concat([{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:yo},{name:"skipDefaultDragBehavior",type:yo}])},qo);function qo(t,e){var n=Xo.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}var Go,zo,jo,$o,Qo,Zo,Jo=(_(tr,Go=Wo),tr.prototype._getAssignableProperties=function(){return Go.prototype._getAssignableProperties.call(this).concat([{name:"replace",type:yo},{name:"paste",type:yo},{name:"confidential",type:yo}])},tr);function tr(t,e){var n=Go.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function er(t,e){var n=zo.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function nr(t,e){var n=jo.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function ir(t,e){var n=$o.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function or(t,e){var n=Qo.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function rr(t,e){var n=Zo.call(this)||this;return n._assignFrom(t,e),n}_(er,zo=Yo),er.prototype._getAssignableProperties=function(){return zo.prototype._getAssignableProperties.call(this).concat([{name:"destinationOffsetX",type:go},{name:"destinationOffsetY",type:go}])},_(nr,jo=Nt),nr.prototype._getAssignableProperties=function(){return[{name:"portraitOrientation",type:yo}]},_(ir,$o=Nt),ir.prototype._getAssignableProperties=function(){return[{name:"timeout",type:Eo},{name:"allowUnawaitedPromise",type:yo}]},_(or,Qo=To),or.prototype._getAssignableProperties=function(){return Qo.prototype._getAssignableProperties.call(this).concat([{name:"confidential",type:yo}])},_(rr,Zo=Nt),rr.prototype._getAssignableProperties=function(){return[{name:"name",type:So},{name:"value",type:So},{name:"domain",type:So},{name:"path",type:So},{name:"expires",type:wo},{name:"maxAge",type:Po},{name:"secure",type:yo},{name:"httpOnly",type:yo},{name:"sameSite",type:So}]};var sr,lr=(_(ar,sr=Nt),ar.prototype._getAssignableProperties=function(){return[{name:"username",type:So,required:!0},{name:"password",type:So}]},ar);function ar(t,e){var n=sr.call(this)||this;return n._assignFrom(t,e),n}var ur,cr,hr,fr,dr=(_(mr,ur=Nt),mr.prototype._getAssignableProperties=function(){return[{name:"protocol",type:So},{name:"host",type:So,required:!0},{name:"port",type:Po,required:!0},{name:"auth",type:Ao,init:Er}]},mr);function mr(t,e){var n=ur.call(this)||this;return n._assignFrom(t,e),n}function pr(t,e){var n=cr.call(this)||this;return n._assignFrom(t,e),n}function vr(t,e){var n=hr.call(this)||this;return n._assignFrom(t,e),n}function gr(t,e){var n=fr.call(this)||this;return n._assignFrom(t,e),n}function Er(t,e,n,i){return void 0===i&&(i=!0),new lr(e,i)}function yr(t,e,n,i){return void 0===i&&(i=!0),new dr(e,i)}_(pr,cr=Nt),pr.prototype._getAssignableProperties=function(){return[{name:"url",type:xo},{name:"method",type:So},{name:"headers",type:Ao},{name:"params",type:Co},{name:"body"},{name:"timeout",type:Po},{name:"withCredentials",type:yo},{name:"auth",type:Ao,init:Er},{name:"proxy",type:Ao,init:yr},{name:"rawResponse",type:yo}]},_(vr,hr=Nt),vr.prototype._getAssignableProperties=function(){return[{name:"credentials",type:Po}]},_(gr,fr=Nt),gr.prototype._getAssignableProperties=function(){return[{name:"stack",type:_o,required:!1},{name:"message",type:_o,required:!1},{name:"pageUrl",type:_o,required:!1}]};var br=null,Sr=function(){return br},_r=function(t){br=t},wr=(p.Promise,p.nativeMethods,p.eventSandbox.listeners,p.utils.browser,p.utils.event.BUTTON,p.utils.event.BUTTONS_PARAMETER);function Pr(t){return t.top!==t}p.utils.event.DOM_EVENTS,p.utils.event.WHICH_PARAMETER,p.utils.event.preventDefault;var xr=p.Promise,Cr=p.eventSandbox.message;function Ar(t,i,e){return new xr(function(n){Cr.on(Cr.SERVICE_MSG_RECEIVED_EVENT,function t(e){e.message.cmd===i&&(Cr.off(Cr.SERVICE_MSG_RECEIVED_EVENT,t),n(e.message))}),Cr.sendServiceMsg(t,e)})}var Tr=(Mr.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},Mr.prototype.once=function(n,i){var o=this;this.on(n,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.off(n,i),i.apply(void 0,t)})},Mr.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=m.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},Mr.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},Mr.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=this._eventsListeners[e];if(i)for(var o=0;o<i.length;o++)try{i[o].apply(this,t)}catch(t){if(!(t.message&&-1<t.message.indexOf("freed script")))throw t;this.off(e,i[o])}},Mr);function Mr(){this._eventsListeners={}}var Dr=Tr,Ur=m.eventSandbox.listeners;function Ir(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new Dr}var kr=(Ir.prototype._internalListener=function(t,e,n,i,o){this.events.emit("scroll",t),this.stopPropagationFlag&&(i(),o())},Ir.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,Ur.initElementListening(oh,["scroll"]),Ur.addFirstInternalEventBeforeListener(oh,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n._internalListener.apply(n,t)}))},Ir.prototype.waitForScroll=function(t){var e=this,n=null,i=new m.Promise(function(t){n=t});return i.cancel=function(){return e.events.off("scroll",n)},this.initialized?this.handleScrollEvents(t,n):n(),i},Ir.prototype.handleScrollEvents=function(n,t){var e,i=this;this.events.once("scroll",t),(e=n)&&e.getRootNode&&D(e)!==e.getRootNode()&&(Ur.initElementListening(n,["scroll"]),Ur.addFirstInternalEventBeforeListener(n,["scroll"],function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i._internalListener.apply(i,t),Ur.cancelElementListening(n)}))},Ir.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},Ir.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new Ir),Br=(Or._isScrollValuesChanged=function(t,e){return et(t)!==e.left||nt(t)!==e.top},Or.prototype._setScroll=function(t,e){var n=this,i=e.left,o=e.top,r=F(t)?D(t):t,s={left:et(r),top:nt(r)},i=Math.max(i,0),o=Math.max(o,0),l=kr.waitForScroll(r);return it(r,i),ot(r,o),Or._isScrollValuesChanged(r,s)?l=l.then(function(){n._scrollWasPerformed||(n._scrollWasPerformed=Or._isScrollValuesChanged(r,s))}):(l.cancel(),m.Promise.resolve())},Or.prototype._getScrollToPoint=function(t,e,n){var i=Math.floor(t.width/2),o=Math.floor(t.height/2),r=this._scrollToCenter?i:Math.min(n.left,i),s=this._scrollToCenter?o:Math.min(n.top,o),l=t.scroll,a=l.left,u=l.top,c=e.x>=a+t.width-r,h=e.x<=a+r,f=e.y>=u+t.height-s,d=e.y<=u+s;return c?a=e.x-t.width+r:h&&(a=e.x-r),f?u=e.y-t.height+s:d&&(u=e.y-s),{left:a,top:u}},Or.prototype._getScrollToFullChildView=function(t,e,n){var i,o,r,s,l,a,u={left:null,top:null},c=t.width>=e.width,h=t.height>=e.height,f=(i=e,o=t,H.create({top:i.top-o.top,left:i.left-o.left,right:o.right-i.right,bottom:o.bottom-i.bottom}).sub(o.border).sub(o.scrollbar).round(Math.ceil,Math.floor));return c&&(r=t.width-e.width,s=Math.min(n.left,r),this._scrollToCenter&&(s=r/2),f.left<s?u.left=Math.round(t.scroll.left+f.left-s):f.right<s&&(u.left=Math.round(t.scroll.left+Math.min(f.left,-f.right)+s))),h&&(l=t.height-e.height,a=Math.min(n.top,l),this._scrollToCenter&&(a=l/2),f.top<a?u.top=Math.round(t.scroll.top+f.top-a):f.bottom<a&&(u.top=Math.round(t.scroll.top+Math.min(f.top,-f.bottom)+a))),u},Or._getChildPoint=function(t,e,n){return x.create(e).sub(x.create(t)).add(x.create(t.scroll)).add(x.create(e.border)).add(n)},Or.prototype._getScrollPosition=function(t,e,n,i){var o=Or._getChildPoint(t,e,n),r=this._getScrollToPoint(t,o,i),s=this._getScrollToFullChildView(t,e,i);return{left:Math.max(null===s.left?r.left:s.left,0),top:Math.max(null===s.top?r.top:s.top,0)}},Or._getChildPointAfterScroll=function(t,e,n,i){return x.create(e).add(x.create(t.scroll)).sub(x.create(n)).add(i)},Or.prototype._isChildFullyVisible=function(t,e,n){var i=Or._getChildPointAfterScroll(t,e,t.scroll,n),o=this._getScrollPosition(t,e,n,{left:0,top:0}),r=o.left,s=o.top;return!this._isTargetElementObscuredInPoint(i)&&r===t.scroll.left&&s===t.scroll.top},Or.prototype._scrollToChild=function(t,e,n){for(var i=ht(t),o=ht(e),r=J(oh),s=tt(oh),l=i.scroll,a=!this._isChildFullyVisible(i,o,n);a;){l=this._getScrollPosition(i,o,n,this._maxScrollMargin);var u=Or._getChildPointAfterScroll(i,o,l,n),c=this._isTargetElementObscuredInPoint(u);this._maxScrollMargin.left+=20,this._maxScrollMargin.left>=r&&(this._maxScrollMargin.left=50,this._maxScrollMargin.top+=20),a=c&&this._maxScrollMargin.top<s}return this._maxScrollMargin={left:50,top:50},this._setScroll(t,l)},Or.prototype._scrollElement=function(){if(!yt(this._element))return m.Promise.resolve();var t=ht(this._element),e=this._getScrollToPoint(t,this._offsets,this._maxScrollMargin);return this._setScroll(this._element,e)},Or.prototype._scrollParents=function(){var t,e,n,i,o,r,s=this,l=(t=this._element,i=K(t),!I(t)||(e=k(t))&&(n=K(e),i.concat(n)),m.nativeMethods.arrayFilter.call(i,yt)),a=this._element,u=et(a),c=nt(a),h=x.create(this._offsets).sub(new x(u,c).round()),f=function(n,i){return w(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e<n?[4,i(e)]:[3,4];case 2:t.sent(),t.label=3;case 3:return e++,[3,1];case 4:return[2]}})})}(l.length,function(t){return s._scrollToChild(l[t],a,h).then(function(){o=ht(a),r=ht(l[t]),h.add(x.create(o)).sub(x.create(r)).add(x.create(r.border)),a=l[t]})}),d={scrollWasPerformed:this._scrollWasPerformed,offsetX:h.x,offsetY:h.y,maxScrollMargin:this._maxScrollMargin};return f.then(function(){if(!s._skipParentFrames&&Pr(oh))return d.cmd=Or.SCROLL_REQUEST_CMD,Ar(d,Or.SCROLL_RESPONSE_CMD,oh.parent)}).then(function(){return s._scrollWasPerformed})},Or._getFixedAncestorOrSelf=function(t){return W(t,!0,st)},Or.prototype._isTargetElementObscuredInPoint=function(t){var e=ft(t);if(!e)return!1;var n=Or._getFixedAncestorOrSelf(e);return!!n&&!n.contains(this._element)},Or.prototype.run=function(){var t=this;return this._scrollElement().then(function(){return t._scrollParents()})},Or.SCROLL_REQUEST_CMD="automation|scroll|request",Or.SCROLL_RESPONSE_CMD="automation|scroll|response",Or);function Or(t,e,n){this._element=t,this._offsets=new x(e.offsetX,e.offsetY),this._scrollToCenter=!!e.scrollToCenter,this._skipParentFrames=!!e.skipParentFrames,this._maxScrollMargin=n||{left:50,top:50},this._scrollWasPerformed=!1}var Nr=p.utils.browser,Fr=(Lr.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},Lr.prototype.leaveElement=function(){},Lr.prototype.move=function(){},Lr.prototype.enterElement=function(){},Lr.prototype.dragAndDrop=function(){},Lr.prototype.teardown=function(){},Lr.prototype.run=function(t,e,n,i,o){var r=e&&g.domUtils.isElementInDocument(e),s=e&&g.domUtils.isElementInIframe(e)&&!g.domUtils.getIframeByElement(e);r&&!s||(e=null);var l=t!==e,a=l?g.domUtils.getCommonAncestor(t,e):null;this.setup(),l&&e&&this.leaveElement(t,e,a,n),Nr.isIE&&this.move(t,n),l&&g.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),Nr.isIE||this.move(t,n),this.dragAndDrop(i,t,e,n,o),this.teardown(t,n,e);var u=this.dragAndDropMode,c=this.dropAllowed;return this.dragAndDropMode=!1,this.dropAllowed=!1,{dragAndDropMode:u,dropAllowed:c}},Lr);function Lr(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var Yr=p.eventSandbox.eventSimulator,Rr=p.utils.extend,Kr=p.nativeMethods,Wr=(Vr.leaveElement=function(t,e,n,i){Yr.mouseout(e,Rr({relatedTarget:t},i));for(var o=e;o&&o!==n;)Yr.mouseleave(o,Rr({relatedTarget:t},i)),o=Kr.nodeParentNodeGetter.call(o)},Vr.enterElement=function(t,e,n,i){Yr.mouseover(t,Rr({relatedTarget:e},i));for(var o=t,r=[];o&&o!==n;)r.push(o),o=g.domUtils.getParentExceptShadowRoot(o);for(var s=r.length-1;-1<s;s--)Yr.mouseenter(r[s],Rr({relatedTarget:e},i))},Vr.move=function(t,e,n){Yr[t](e,n)},Vr);function Vr(){}var Xr=(Hr.dragAndDrop=function(t,e,n,i){return Yr.drag(t,i),e!==n&&(g.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,Yr.dragenter(e,i)),n&&(i.relatedTarget=e,Yr.dragleave(n,i))),!Yr.dragover(e,i)},Hr);function Hr(){}var qr,Gr=p.eventSandbox.eventSimulator,zr=(_(jr,qr=Fr),jr.prototype.leaveElement=function(t,e,n,i){Wr.leaveElement(t,e,n,i)},jr.prototype.enterElement=function(t,e,n,i){Wr.enterElement(t,e,n,i)},jr.prototype.move=function(t,e){this._needEmulateMoveEvent()&&Wr.move(this.moveEvent,t,e)},jr.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&g.domUtils.isElementInDocument(t)&&t!==n&&Gr[this.moveEvent](t,e)},jr.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},jr);function jr(t){var e=qr.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var $r,Qr=(_(Zr,$r=Fr),Zr.prototype.setup=function(){$r.prototype.setup.call(this),this.dragAndDropMode=!0},Zr.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=Xr.dragAndDrop(t,e,n,i)},Zr);function Zr(){return null!==$r&&$r.apply(this,arguments)||this}var Jr,ts=p.eventSandbox.eventSimulator,es=(_(ns,Jr=Fr),ns.prototype.setup=function(){Jr.prototype.setup.call(this),this.dragAndDropMode=!0},ns.prototype.leaveElement=function(t,e,n,i){Wr.leaveElement(t,e,n,i)},ns.prototype.move=function(t,e){Wr.move(this.moveEvent,t,e)},ns.prototype.enterElement=function(t,e,n,i){Wr.enterElement(t,e,n,i)},ns.prototype.dragAndDrop=function(t,e,n,i,o){var r=ts.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=Xr.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},ns.prototype.run=function(t,e,n,i,o){return Jr.prototype.run.call(this,t,null,n,i,o)},ns);function ns(){return null!==Jr&&Jr.apply(this,arguments)||this}function is(t,e,n){return new(t?e?Qr:es:zr)(n)}var os=(rs.create=function(o,r,s,l){return w(this,void 0,m.Promise,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,rs.getTarget(o,s,new x(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new rs(n,i,r,s,l)]}})})},rs.getTarget=function(e,n,i){return m.Promise.resolve(dt(e,i.x,i.y)).then(function(t){return t?{element:e,offset:i}:m.Promise.all([pt(e,i),n.document.documentElement]).then(function(t){var e=t[0];return{element:t[1],offset:e}})})},rs.prototype._getCursorSpeed=function(){return this.automationSettings.cursorSpeed},rs.prototype._getTargetClientPoint=function(){var o=this;return m.Promise.resolve($(this.element)).then(function(i){return F(o.element)?x.create(o.offset).sub(x.create(i)).round(Math.round):m.Promise.resolve(mt(o.element)).then(function(t){var e=N(o.element),n=x.create(t).add(o.offset);return e||n.sub(x.create(i)),n.round(Math.floor)})})},rs.prototype._getEventSequenceOptions=function(t){var e=wr.noButton,n=bt(t);return{eventOptions:{clientX:t.x,clientY:t.y,screenX:null==n?void 0:n.x,screenY:null==n?void 0:n.y,buttons:e,ctrl:this.modifiers.ctrl,alt:this.modifiers.alt,shift:this.modifiers.shift,meta:this.modifiers.meta},eventSequenceOptions:{moveEvent:this.moveEvent}}},rs.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions;return is(!1,this.firstMovingStepOccured,i).run(t,Sr(),n,null,null)},rs.prototype._emulateEvents=function(t,e){var n=this._getEventSequenceOptions(e);this._runEventSequence(t,n),this.firstMovingStepOccured=!0,_r(t)},rs.prototype._movingStep=function(n){var i=this;return this.cursor.move(n).then(function(){return xt(i.cursor.getPosition())}).then(function(t){var e=i._getCorrectedTopElement(t);return e?i._emulateEvents(e,n):null}).then(Ot)},rs.prototype._getCorrectedTopElement=function(t){return t},rs.prototype._move=function(e){var n=this,i=this.cursor.getPosition(),o=x.create(e).sub(i),r=m.nativeMethods.dateNow(),s=Math.max(Math.max(Math.abs(o.x),Math.abs(o.y))/this.cursorSpeed,this.minMovingTime),l=x.create(i),a=!0;return function(e,n){return w(this,void 0,void 0,function(){return P(this,function(t){switch(t.label){case 0:return e()?[4,n()]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})})}(function(){return!l.eql(e)},function(){var t;return n._needMoveCursorImmediately()?l=x.create(e):a?(a=!1,l.add({x:0<o.x?1:-1,y:0<o.y?1:-1})):(t=Math.min((m.nativeMethods.dateNow()-r)/s,1),l=x.create(o).mul(t).add(i).round(Math.floor)),n._movingStep(l)})},rs.prototype._needMoveCursorImmediately=function(){return this.touchMode},rs.prototype._scroll=function(){if(this.skipScrolling)return m.Promise.resolve(!1);var t=new Oo({offsetX:this.offset.x,offsetY:this.offset.y},!1);return new Br(this.element,t).run()},rs.prototype._moveToCurrentFrame=function(t){var e=this;if(this.cursor.isActive(this.window))return m.Promise.resolve();var n=this.cursor.getPosition(),i=n.x,o=n.y,r=this.cursor.getActiveWindow(this.window),c=null,s=null,h={cmd:"automation|move|request",startX:i,startY:o,endX:t.x,endY:t.y,modifiers:this.modifiers,speed:this.speed};return m.Promise.resolve().then(function(){if(r.parent===e.window)return m.Promise.resolve(function(t){var e=[];U(rh,"*",function(t){"IFRAME"===t.tagName&&e.push(t),t.shadowRoot&&U(t.shadowRoot,"iframe",function(t){return e.push(t)})});for(var n=0;n<e.length;n++)if(M.contentWindowGetter.call(e[n])===t)return e[n];return null}(r)).then(function(t){return c=t,m.Promise.resolve((n=ut(e=t),i=n.left,o=n.top,r=ct({x:i,y:o}),s=z(e),l=j(e),a=r.x+s.left+l.left,u=r.y+s.top+l.top,new H(u,a+Q(e),u+Z(e),a))).then(function(t){h.left=t.left,h.top=t.top,h.right=t.right,h.bottom=t.bottom});var e,n,i,o,r,s,l,a,u})}).then(function(){return xt(e.cursor.getPosition())}).then(function(t){return s=t===c,r.parent===e.window&&(h.iframeUnderCursor=s),Ar(h,"automation|move|response",r)}).then(function(t){if(e.cursor.setActiveWindow(e.window),s||m.utils.dom.isIframeWindow(e.window))return e.cursor.move(t)})},rs.prototype.run=function(){var n=this;return this._scroll().then(function(){return m.Promise.all([n._getTargetClientPoint(),(t=n.window,new H(0,Q(t),Z(t),0))]);var t}).then(function(t){var e=t[0];if(t[1].contains(e))return n._moveToCurrentFrame(e).then(function(){return n._move(e)})})},rs);function rs(t,e,n,i,o){this.touchMode=m.utils.featureDetection.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.automationSettings=new Dt(n.speed),this.cursorSpeed=this._getCursorSpeed(),this.element=t,this.window=i,this.offset=e,this.cursor=o,this.minMovingTime=n.minMovingTime||0,this.modifiers=n.modifiers||{},this.skipScrolling=n.skipScrolling,this.skipDefaultDragBehavior=n.skipDefaultDragBehavior,this.speed=n.speed,this.firstMovingStepOccured=!1}var ss=(ls.prototype._ensureActiveWindow=function(t){this._activeWindow!==t&&this._activeWindow!==t.parent&&this._activeWindow.parent!==t&&(this._activeWindow=t)},ls.prototype.isActive=function(t){return this._ensureActiveWindow(t),this._activeWindow===t},ls.prototype.setActiveWindow=function(t){this._activeWindow=t},ls.prototype.getActiveWindow=function(t){return this._ensureActiveWindow(t),this._activeWindow},ls.prototype.getPosition=function(){return new x(this._x,this._y)},ls.prototype.move=function(t){return this._x=t.x,this._y=t.y,this._ui.move(t)},ls.prototype.hide=function(){return this._ui.hide?this._ui.hide():m.Promise.resolve()},ls.prototype.show=function(){return this._ui.show?this._ui.show():m.Promise.resolve()},ls.prototype.leftButtonDown=function(){return this._ui.leftButtonDown()},ls.prototype.rightButtonDown=function(){return this._ui.rightButtonDown()},ls.prototype.buttonUp=function(){return this._ui.buttonUp()},ls);function ls(t,e){this._ui=e,this._x=-1,this._y=-1,this._activeWindow=t}var as=Pr(oh)?i.iframeCursorUI:i.cursorUI,us=new ss(oh.top,as),cs=y.positionUtils,hs=y.domUtils,fs=y.eventUtils,ds=(ms.create=function(t){var n=t.element,i=t.clientPoint,o=t.screenPoint,r=t.isTarget,s=t.inMoving;return w(this,void 0,void 0,function(){var e;return P(this,function(t){switch(t.label){case 0:return e=null,i?[4,bt(i)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return[2,new ms({element:n,clientPoint:i,screenPoint:o,isTarget:r,inMoving:s,devicePoint:e})]}})})},ms);function ms(t){var e=t.element,n=void 0===e?null:e,i=t.clientPoint,o=void 0===i?null:i,r=t.screenPoint,s=void 0===r?null:r,l=t.isTarget,a=void 0!==l&&l,u=t.inMoving,c=void 0!==u&&u,h=t.devicePoint,f=void 0===h?null:h;this.element=n,this.clientPoint=o,this.screenPoint=s,this.devicePoint=f,this.isTarget=a,this.inMoving=c}var ps,vs=(_(gs,ps=Tr),gs.prototype._ensureWindowAndCursorForLegacyTests=function(t){t.window=t.window||oh,t.cursor=us},gs.prototype._getElementForEvent=function(n){return w(this,void 0,void 0,function(){var e;return P(this,function(t){return e=dt(this.element,this.options.offsetX,this.options.offsetY)?this.element:null,[2,Tt(n.point,this.window,e)]})})},gs.prototype._moveToElement=function(){return w(this,void 0,void 0,function(){var e,n=this;return P(this,function(t){switch(t.label){case 0:return e=new Ho(m.utils.extend({skipScrolling:!0},this.options),!1),[4,os.create(this.element,e,this.window,this.cursor)];case 1:return[2,t.sent().run().then(function(){return Bt(n.automationSettings.mouseActionStepDelay)})]}})})},gs.prototype._scrollToElement=function(){var e=this,n=!1,t=new Oo(this.options,!1);return new Br(this.element,t).run().then(function(t){return n=!!t,Bt(e.automationSettings.mouseActionStepDelay)}).then(function(){return Tt(e.cursor.getPosition(),e.window)}).then(function(t){return function(s,l,a){return w(this,void 0,p.Promise,function(){var e,n,i,o,r;return P(this,function(t){switch(t.label){case 0:return s&&hs.contains(l,s)&&a?(e=Sr(),n=hs.getCommonAncestor(s,e),[4,cs.getClientPosition(s)]):[2];case 1:return[4,bt(i=t.sent())];case 2:return(o=t.sent())&&(r={clientX:i.x,clientY:i.y,screenX:o.x,screenY:o.y,ctrl:!1,alt:!1,shift:!1,meta:!1,buttons:fs.BUTTONS_PARAMETER.leftButton},Wr.leaveElement(s,e,n,r),Wr.enterElement(s,e,n,r),_r(s)),[2]}})})}(t,e.element,n)}).then(function(){return n})},gs.prototype._getElementOffset=function(){var t=wt(this.element),e=this.options,n=e.offsetX,i=e.offsetY;return{offsetX:n=n||0===n?n:t.offsetX,offsetY:i=i||0===i?i:t.offsetY}},gs.prototype._wrapAction=function(p){return w(this,void 0,void 0,function(){var e,n,i,o,r,s,l,a,u,c,h,f,d,m;return P(this,function(t){switch(t.label){case 0:return e=this._getElementOffset(),n=e.offsetX,i=e.offsetY,[4,pt(this.element,{x:n,y:i})];case 1:return o=t.sent(),[4,mt(this.element)];case 2:return r=t.sent(),[4,p()];case 3:return t.sent(),[4,pt(this.element,{x:n,y:i})];case 4:return s=t.sent(),[4,mt(this.element)];case 5:return l=t.sent(),[4,function(i,o){return w(this,void 0,void 0,function(){var e,n;return P(this,function(t){switch(t.label){case 0:return[4,$(i)];case 1:return e=t.sent(),n=yt(i),!/html/i.test(i.tagName)&&n&&(o.x-=e.left,o.y-=e.top),[2,ct(o)]}})})}(this.element,s)];case 6:return a=t.sent(),[4,dt(this.element,n,i)];case 7:return u=t.sent()?this.element:null,[4,Tt(a,this.window,u)];case 8:return(c=t.sent())?(h=!u||c===u||c===this.element)?[3,10]:[4,this._contains(this.element,c)]:[2,ds.create({element:null,clientPoint:null,screenPoint:null,isTarget:!1,inMoving:!1})];case 9:h=t.sent(),t.label=10;case 10:return f=o.x!==s.x||o.y!==s.y,d=r.x!==l.x||r.y!==l.y,m=f&&d,[2,ds.create({element:c,clientPoint:a,screenPoint:s,isTarget:h,inMoving:m})]}})})},gs._checkElementState=function(t,e){if(!t.element)throw new Error(Mt.elementIsInvisibleError);if(e&&(!t.isTarget||t.inMoving))throw new Error(Mt.foundElementIsNotTarget);return t},gs.prototype._ensureElement=function(e,n,i){var o=this;return void 0===n&&(n=!1),void 0===i&&(i=!1),this._wrapAction(function(){return o._scrollToElement()}).then(function(t){return gs._checkElementState(t,e)}).then(function(t){return i?t:o._wrapAction(function(){return o._moveToElement()})}).then(function(t){return n||gs._checkElementState(t,e),t}).then(function(t){return o.emit(o.TARGET_ELEMENT_FOUND_EVENT,{element:(null==t?void 0:t.element)||null}),{element:(null==t?void 0:t.element)||null,clientPoint:(null==t?void 0:t.clientPoint)||null,screenPoint:(null==t?void 0:t.screenPoint)||null,devicePoint:(null==t?void 0:t.devicePoint)||null}})},gs.prototype._contains=function(o,r){return w(this,void 0,void 0,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,K(r)];case 1:for(e=t.sent(),n=0,i=e;n<i.length;n++)if(i[n]===o)return[2,!0];return[2,!1]}})})},gs);function gs(t,e,n,i){var o=ps.call(this)||this;return o.TARGET_ELEMENT_FOUND_EVENT="automation|target-element-found-event",o.element=t,o.options=e,o.automationSettings=new Dt(e.speed||1),o.window=n,o.cursor=i,o._ensureWindowAndCursorForLegacyTests(o),o}var Es,ys=p.Promise,bs=(_(Ss,Es=vs),Ss.prototype.run=function(t){var e=this,n=ys.resolve();return this.element!==rh.scrollingElement&&this.element!==rh.documentElement&&(n=this._ensureElement(t,!0,!0)),n.then(function(){e.element.scrollLeft=e.scrollLeft,e.element.scrollTop=e.scrollTop})},Ss);function Ss(t,e,n){var i,o,r,s,l,a=e.x,u=e.y,c=e.position,h=e.byX,f=e.byY,d=Es.call(this,t,n,oh,us)||this;return c&&(o=t,r=c,s=Math.floor(o.scrollWidth/2-o.clientWidth/2),l=Math.floor(o.scrollHeight/2-o.clientHeight/2),a=(i={top:[s,0],right:[o.scrollWidth,l],bottom:[s,o.scrollHeight],left:[0,l],topRight:[o.scrollWidth,0],topLeft:[0,0],bottomRight:[o.scrollWidth,o.scrollHeight],bottomLeft:[0,o.scrollHeight],center:[s,l]}[r])[0],u=i[1]),d.scrollLeft="number"==typeof a?a:t.scrollLeft,d.scrollTop="number"==typeof u?u:t.scrollTop,h&&(d.scrollLeft+=h),f&&(d.scrollTop+=f),d}var _s,ws=(_(Ps,_s=vs),Ps.prototype.run=function(t){return this._ensureElement(t,!0,!0)},Ps);function Ps(t,e){return _s.call(this,t,e,oh,us)||this}var xs=p.Promise,Cs=p.nativeMethods,As=p.utils.browser,Ts=p.eventSandbox.focusBlur,Ms=y.contentEditable,Ds=y.textSelection,Us=y.domUtils,Is=y.styleUtils,ks=p.eventSandbox.message,Bs="automation|iframe|request",Os="automation|iframe|response";function Ns(v,g,E){var t=this;return new xs(function(p){return w(t,void 0,void 0,function(){var s,n,i,o,r,l,a,u,c,h,f,d,m;return P(this,function(t){switch(t.label){case 0:return Pr(oh)?[4,Ar({cmd:Bs},Os,oh.parent)]:[3,2];case 1:t.sent(),t.label=2;case 2:if(s=Us.getActiveElement(),n=Us.isTextEditableElement(v),i=Us.closest(v,"label[for]"),o=Us.isElementFocusable(v),r=!o&&i,l=Us.isContentEditableElement(v),a=l?Ms.findContentEditableParent(v):v,g&&As.isWebKit&&n&&Ds.select(v,0,0),r)return g&&(e=i,Us.isElementFocusable(e)?Ts.focus(e,y.noop,!1,!0):Ls(e)),p(),[2];if(u=!g,c=!1,!o&&!l){if(h=Us.findDocument(a),f=Cs.documentActiveElementGetter.call(h),d=Us.isBodyElement(f),m=Us.isBodyElement(a)?a:Us.getFocusableParent(a),f&&!d&&Us.containsElement(f,a)||d&&Us.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return Ts.focus(a,function(){var t,e,n,i,o,r;!g||l||v===Us.getActiveElement()?(t=v,e=E,o=Us.isTextEditableElement(t),r=Us.isContentEditableElement(t),o||r?r&&isNaN(parseInt(e,10))?Ds.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?Us.getElementValue(t).length:e,Ds.select(t,n,n)):(i=Ms.findContentEditableParent(t))&&Ds.setCursorToLastVisiblePosition(Ms.findContentEditableParent(i)),g||Us.getActiveElement()===s?p():Ts.focus(s,p,!0,!0)):p()},u,!0,!1,c),[2]}var e})})})}function Fs(t){var e=Us.closest(t,"label[for]"),n=e&&(e.control||rh.getElementById(e.htmlFor));return n&&Is.isElementVisible(n)?n:null}function Ls(t){var e=Fs(t);e&&Us.getActiveElement()!==e&&Ts.focus(e,y.noop,!1,!0)}ks.on(ks.SERVICE_MSG_RECEIVED_EVENT,function(t){var e;t.message.cmd===Bs&&(e=Us.findIframeByWindow(t.source),Ts.focus(e,function(){ks.sendServiceMsg({cmd:Os},t.source)},!1))});var Ys=p.utils.browser,Rs=p.eventSandbox.eventSimulator,Ks=p.eventSandbox.listeners,Ws=p.nativeMethods,Vs=y.domUtils,Xs=y.styleUtils,Hs=i.selectElement,qs=(Gs.prototype.run=function(){this.eventState.clickElement&&Rs.click(this.eventState.clickElement,this.eventArgs.options),Vs.isElementFocusable(this.eventArgs.element)||Ls(this.eventArgs.element)},Gs);function Gs(t,e){this.eventState=t,this.eventArgs=e}var zs,js=(_($s,zs=qs),$s.prototype.run=function(){function t(t){n=Ws.eventTargetGetter.call(t)===e.input}var e=this,n=!1;Ks.addInternalEventBeforeListener(oh,["focus"],t),zs.prototype.run.call(this),Ks.removeInternalEventBeforeListener(oh,["focus"],t),Vs.isElementFocusable(this.targetElement)&&!n&&this._ensureBoundElementFocusRaised()},$s.prototype._ensureBoundElementFocusRaised=function(){Rs.focus(this.input)},$s);function $s(t,e){var n=zs.call(this,t,e)||this;return n.targetElement=n.eventArgs.element,n.input=Fs(n.eventArgs.element),n}var Qs,Zs=(_(Js,Qs=qs),Js.prototype.run=function(){Qs.prototype.run.call(this),this._toggleSelectOptionList()},Js.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===Xs.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(Hs.isOptionListExpanded(t)?Hs.collapseOptionList():Hs.expandOptionList(t))},Js);function Js(t,e){return Qs.call(this,t,e)||this}var tl,el=(_(nl,tl=qs),nl.prototype.run=function(){return this.eventArgs.element},nl);function nl(t,e){return tl.call(this,t,e)||this}var il,ol=(_(rl,il=js),rl.prototype.run=function(){function t(){e=!0}var e=!1;Ks.addInternalEventBeforeListener(oh,["change"],t),il.prototype.run.call(this),Ks.removeInternalEventBeforeListener(oh,["change"],t),!Ys.isChrome||e||this.checkbox.disabled||this._isClickableElementInsideLabel(this.targetElement)||this._ensureCheckboxStateChanged()},rl.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,Rs.change(this.checkbox)},rl.prototype._isClickableElementInsideLabel=function(t){var e=Vs.isAnchorElement(t)&&t.getAttribute("href"),n=Vs.isButtonElement(t);return e||n},rl);function rl(t,e){var n=il.call(this,t,e)||this;return n.checkbox=n.input,n}var sl=p.Promise,ll=p.utils.browser,al=p.utils.featureDetection,ul=p.eventSandbox.eventSimulator,cl=p.eventSandbox.listeners,hl=y.domUtils,fl=y.eventUtils,dl=y.arrayUtils,ml=(pl.prototype.mousedown=function(t){var e=this;this.targetElementParentNodes=hl.getParents(t.element),this.mouseDownElement=t.element,this._raiseTouchEvents(t);var n=hl.getActiveElement();this.activeElementBeforeMouseDown=n;var i=(ll.isWebKit||ll.isIE)&&hl.isSelectElement(this.mouseDownElement);return i&&this._bindMousedownHandler(),this._bindBlurHandler(n),this._isTouchEventWasCancelled()||(this.eventState.simulateDefaultBehavior=ul.mousedown(t.element,t.options)),!1===this.eventState.simulateDefaultBehavior&&(this.eventState.simulateDefaultBehavior=i&&!this.eventState.mousedownPrevented),this._ensureActiveElementBlur(n).then(function(){return e._focus(t)})},pl.prototype.mouseup=function(t,e){var n,i,o,r,s;e.element=t,this.eventState.clickElement=(n=this.mouseDownElement,i=t,o=this.targetElementParentNodes,r=hl.getParents(i),s=hl.isTheSameNode(i,n),ll.isFirefox?s?n:null:s?dl.equals(o,r)?n:null:n.contains(i)&&!hl.isEditableFormElement(i)?n:i.contains(n)?i:dl.getCommonElement(r,o));var l={},a=function(t){l=t.timeStamp,cl.removeInternalEventBeforeListener(oh,["mouseup"],a)};return ll.isIE||cl.addInternalEventBeforeListener(oh,["mouseup"],a),this._isTouchEventWasCancelled()||ul.mouseup(t,e.options),e.options&&(e.options.timeStamp=l),this._click(e)},pl.prototype._click=function(u){return w(this,void 0,p.Promise,function(){var a;return P(this,function(t){var e,n,i,o,r,s,l;return e=this.eventState,i=Fs((n=u).element),o=Vs.isSelectElement(n.element),r=Vs.isOptionElement(n.element),s=Vs.isLabelElement(n.element)&&i,l=i&&Vs.isCheckboxElement(i),a=new(o?Zs:r?el:l?ol:s?js:qs)(e,n),this._isTouchEventWasCancelled()||a.run(),[2,u]})})},pl.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},pl.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,fl.preventDefault(t),fl.unbind(e.element,"mousedown",n)};fl.bind(this.element,"mousedown",n)},pl.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,fl.unbind(t,"blur",n,!0)};fl.bind(t,"blur",n,!0)},pl.prototype._ensureActiveElementBlur=function(e){var n=this;return new sl(function(t){hl.getActiveElement()===e||n.eventState.blurRaised?t():ll.isIE&&ll.version<12?Ot().then(function(){n.eventState.blurRaised||ul.blur(e),t()}):(ul.blur(e),t())})},pl.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?sl.resolve():Ns(hl.isContentEditableElement(this.element)?this.element:t.element,!ll.isIE||this.activeElementBeforeMouseDown===hl.getActiveElement(),this.caretPos)},pl.prototype._raiseTouchEvents=function(t){al.isTouchDevice&&(this.eventState.touchStartCancelled=!ul.touchstart(t.element,t.options),this.eventState.touchEndCancelled=!ul.touchend(t.element,t.options))},pl);function pl(t,e){this.element=t,this.caretPos=e,this.targetElementParentNodes=[],this.activeElementBeforeMouseDown=null,this.mouseDownElement=null,this.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null,touchStartCancelled:!1,touchEndCancelled:!1}}var vl,gl=(_(El,vl=vs),El.prototype._mousedown=function(t){return this.strategy.mousedown(t)},El.prototype._mouseup=function(t,e){return this.strategy.mouseup(t,e)},El.prototype.run=function(t){var r,s=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.screenPoint,o=t.devicePoint;return r={point:n,screenPoint:i,element:e,options:m.utils.extend({clientX:null==n?void 0:n.x,clientY:null==n?void 0:n.y,screenX:null==o?void 0:o.x,screenY:null==o?void 0:o.y},s.modifiers)},m.Promise.all([Bt(s.automationSettings.mouseActionStepDelay),s.cursor.leftButtonDown().then(function(){return s._mousedown(r)})])}).then(function(){return s.cursor.buttonUp()}).then(function(){return s._getElementForEvent(r)}).then(function(t){return t?s._mouseup(t,r):null})},El);function El(t,e,n,i){var o,r,s=vl.call(this,t,e,n,i)||this;return s.modifiers=e.modifiers,s.strategy=(o=s.element,r=e.caretPos,new ml(o,r)),s}function yl(t,e,n){var i=function(t,e,n){if(e.y-t.y==0)return 0;var i=(e.x-t.x)/(e.y-t.y),o=t.y*(t.x-e.x)/(e.y-t.y)+t.x;return Math.round(i*n+o)}(t,e,n.top);return i&&i>=n.left&&i<=n.right?new x(i,n.top):null}function bl(t,e,n){var i=function(t,e,n){if(e.x===t.x)return 0;var i=(e.y-t.y)/(e.x-t.x),o=t.x*(t.y-e.y)/(e.x-t.x)+t.y;return Math.round(i*n+o)}(t,e,n.left);return i&&i>=n.top&&i<=n.bottom?new x(n.left,i):null}function Sl(t,e,n){for(var i=[],o=0,r=[{left:n.left,top:n.top,right:n.left,bottom:n.bottom,isHorizontal:!1},{left:n.right,top:n.top,right:n.right,bottom:n.bottom,isHorizontal:!1},{left:n.left,top:n.top,right:n.right,bottom:n.top,isHorizontal:!0},{left:n.left,top:n.bottom,right:n.right,bottom:n.bottom,isHorizontal:!0}];o<r.length;o++){var s=r[o],l=(s.isHorizontal?yl:bl)(t,e,s);l&&i.push(l)}return i.length?1===i.length||i[0].distance(t)<i[1].distance(t)?i[0]:i[1]:null}var _l=p.eventSandbox.eventSimulator,wl=p.eventSandbox.message,Pl=y.positionUtils,xl=y.domUtils,Cl=y.styleUtils,Al="automation|move|response";wl.on(wl.SERVICE_MSG_RECEIVED_EVENT,function(t){var e,n,i,o,r,s,l,a,u,c,h,f,d;"automation|move|request"===t.message.cmd&&(t.source.parent===oh?(n=new x((e=t).message.endX,e.message.endY),i=e.source,o=xl.findIframeByWindow(i),r=Cl.getBordersWidth(o),s=Cl.getElementPadding(o),l=Pl.getIframeClientCoordinates(o),a=Pl.getIframePointRelativeToParentFrame(n,i),u=us.getPosition(),c=Pl.isInRectangle(u,l)?u:Sl(u,a,l),h={x:c.x-l.left,y:c.y-l.top},f=new Ho({modifiers:e.message.modifiers,offsetX:h.x+r.left+s.left,offsetY:h.y+r.top+s.top,speed:e.message.speed,skipScrolling:!0},!1),d={cmd:Al,x:h.x,y:h.y},us.getActiveWindow(oh)!==i?os.create(o,f,oh,us).then(function(t){return t.run()}).then(function(){us.setActiveWindow(i),wl.sendServiceMsg(d,i)}):wl.sendServiceMsg(d,i)):(p.on(p.EVENTS.beforeUnload,function(){return wl.sendServiceMsg({cmd:Al},t.source)}),function(t){var e=t.source,n={left:t.message.left,right:t.message.right,top:t.message.top,bottom:t.message.bottom};if(!t.message.iframeUnderCursor){var i=t.message,o=i.startX,r=i.startY,s=o-n.left,l=r-n.top,a=Sr();return a&&(_l.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),_l.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),wl.sendServiceMsg({cmd:Al},e)}var u,c=us.getPosition(),h=Sl(x.create(n).add(c),new x(t.message.endX,t.message.endY),n);h?(u=new Ho({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),os.create(rh.documentElement,u,oh,us).then(function(t){return t.run()}).then(function(){var t={cmd:Al,x:h.x,y:h.y};us.setActiveWindow(e),wl.sendServiceMsg(t,e)})):wl.sendServiceMsg({cmd:Al,x:n.left,y:n.top},e)}(t)))});var Tl=p.Promise,Ml=p.utils.browser,Dl=p.utils.featureDetection,Ul=p.eventSandbox.eventSimulator,Il=p.eventSandbox.focusBlur,kl=p.nativeMethods,Bl=y.domUtils,Ol=y.styleUtils,Nl=y.delay,Fl=i.selectElement,Ll=Dl.isTouchDevice?0:160,Yl=(Rl.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?Fl.getEmulatedChildElement(this.element):this.element,e=1<Ol.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Ml.isIE&&e?this.parentSelect:t}},Rl.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=_t(n=Fl.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=rh.documentElement,i=(e=Fl.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},Rl.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Ho({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return os.create(n,s,oh,us).then(function(t){return t.run()}).then(function(){return Nl(e.automationSettings.mouseActionStepDelay)})},Rl.prototype._mousedown=function(){var t=this;return Ml.isFirefox?(Ul.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Ml.isIE?(Ul.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Nl(Ll)}).then(function(){Ul.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},Rl.prototype._focus=function(){var e=this;return new Tl(function(t){Il.focus(e.parentSelect,t,!1,!0)})},Rl.prototype._mouseup=function(){var t=Ml.isIE?this.parentSelect:this.eventsArgs.element;Ul.mouseup(t,this.eventsArgs.options),Ml.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=Ml.isFirefox||Ml.isSafari||Ml.isChrome&&53<=Ml.version,n=e||Ml.isIE;return e&&this.clickCausesChange&&Ul.input(this.parentSelect),n&&this.clickCausesChange&&Ul.change(this.parentSelect),Tl.resolve()},Rl.prototype._click=function(){Ul.click(this.eventsArgs.element,this.eventsArgs.options)},Rl.prototype.run=function(){var t=this;if(!this.parentSelect)return Ul.click(this.eventsArgs.element,this.eventsArgs.options),Tl.resolve();this.optionListExpanded||Fl.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Ol.getSelectElementSize(this.parentSelect)<=1?this._move(e).then(function(){return t._click()}):this._move(e).then(function(){return t._mousedown()}).then(function(){return t._mouseup()}).then(function(){return t._click()})},Rl);function Rl(t,e){var n,i,o,r,s;this.element=t,this.modifiers=e.modifiers,this.caretPos=e.caretPos,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.speed=e.speed,this.automationSettings=new Dt(e.speed),this.parentSelect=Bl.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&Fl.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=Bl.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=Bl.getElementIndexInParent(this.parentSelect,this.element),o=kl.nodeParentNodeGetter.call(this.element),r=Bl.isOptionGroupElement(o)?o:null,s=this.element.disabled||r&&r.disabled,this.clickCausesChange=n&&!s&&this.childIndex!==i),this.eventsArgs={options:this.modifiers,element:this.element}}var Kl,Wl=p.utils.featureDetection,Vl=p.utils.browser,Xl=p.eventSandbox.eventSimulator,Hl=y.eventUtils,ql=y.delay,Gl=Wl.isTouchDevice?0:160,zl=(_(jl,Kl=vs),jl.prototype._firstClick=function(t){var e=this,n=new Wo(this.options);n.speed=1;var i=new gl(this.element,n,oh,us);return i.on(i.TARGET_ELEMENT_FOUND_EVENT,function(t){return e.emit(e.TARGET_ELEMENT_FOUND_EVENT,t)}),i.run(t).then(function(t){return ql(Gl).then(function(){return t})})},jl.prototype._secondClick=function(t){var e=this;Vl.isIE&&Hl.bind(rh,"focus",Hl.preventDefault,!0);var n=new Wo({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new gl(rh.documentElement,n,oh,us);return i.run().then(function(t){return e.eventState.dblClickElement=i.strategy.eventState.clickElement,Vl.isIE&&Hl.unbind(rh,"focus",Hl.preventDefault,!0),t})},jl.prototype._dblClick=function(t){this.eventState.dblClickElement&&Xl.dblclick(this.eventState.dblClickElement,t.options)},jl.prototype.run=function(t){var e=this;return this._firstClick(t).then(function(t){return e._secondClick(t)}).then(function(t){return e._dblClick(t)})},jl);function jl(t,e){var n=Kl.call(this,t,e,oh,us)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new Dt(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var $l,Ql=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},Zl=p.nativeMethods,Jl=p.utils.featureDetection,ta=p.utils.html,ea=p.utils.url,na=p.eventSandbox.DataTransfer,ia=p.eventSandbox.DragDataStore,oa=y.eventUtils,ra=y.domUtils,sa=(_(la,$l=os),la.create=function(o,r,s,l){return w(this,void 0,void 0,function(){var e,n,i;return P(this,function(t){switch(t.label){case 0:return[4,os.getTarget(o,s,new x(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new la(n,i,r,s,l)]}})})},la.prototype._getCursorSpeed=function(){return this.automationSettings.draggingSpeed},la.prototype._getEventSequenceOptions=function(t){var e=$l.prototype._getEventSequenceOptions.call(this,t),n=e.eventOptions,i=e.eventSequenceOptions;return n.dataTransfer=this.dragAndDropState.dataTransfer,n.buttons=oa.BUTTONS_PARAMETER.leftButton,i.holdLeftButton=!0,{eventOptions:n,eventSequenceOptions:i}},la.prototype._getCorrectedTopElement=function(t){return this.touchMode?this.dragElement:t},la.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions,o=is(this.dragAndDropState.enabled,this.firstMovingStepOccured,i).run(t,Sr(),n,this.dragElement,this.dragAndDropState.dataStore),r=o.dragAndDropMode,s=o.dropAllowed;this.dragAndDropState.enabled=r,this.dragAndDropState.dropAllowed=s},la.prototype._needMoveCursorImmediately=function(){return!1},la.prototype.run=function(){var l=this;return Tt(this.cursor.getPosition()).then(function(t){l.dragElement=t;var e,n,i,o,r,s=function(t){for(var e=t;e;){if(e.draggable)return e;e=Zl.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&Jl.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new ia,l.dragAndDropState.dataTransfer=new na(l.dragAndDropState.dataStore),((e=ra.isAnchorElement(l.dragElement))||ra.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=ea.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=ta.cleanUpHtml(Zl.elementOuterHTMLGetter.call(l.dragElement)),l.dragAndDropState.dataTransfer.setData("text/plain",o),l.dragAndDropState.dataTransfer.setData("text/uri-list",o),l.dragAndDropState.dataTransfer.setData("text/html",r))),$l.prototype.run.call(l).then(function(){return l.dragAndDropState})})},la);function la(t,e,n,i,o){var r=$l.call(this,t,e,n,i,o)||this;return r.dragElement=null,r.dragAndDropState=new Ql,r}var aa,ua=p.Promise,ca=p.utils.extend,ha=p.utils.featureDetection,fa=p.eventSandbox.eventSimulator,da=p.eventSandbox.focusBlur,ma=(_(pa,aa=vs),pa.prototype._getEndPoint=function(){throw new Error("Not implemented")},pa.prototype._mousedown=function(t){var e=this;return us.leftButtonDown().then(function(){return e.simulateDefaultBehavior=fa[e.downEvent](t.element,t.options),e._focus(t)})},pa.prototype._focus=function(n){var i=this;return new ua(function(t){var e=g.domUtils.isContentEditableElement(i.element)?g.contentEditable.findContentEditableParent(i.element):n.element;da.focus(e,t,!1,!0)})},pa.prototype._getDestination=function(){throw new Error("Not implemented")},pa.prototype._drag=function(){var r=this;return this._getDestination().then(function(t){var e=t.element,n=t.offsets,i=t.endPoint;r.endPoint=i;var o=new Ho({offsetX:n.offsetX,offsetY:n.offsetY,modifiers:r.modifiers,speed:r.speed,minMovingTime:25,skipDefaultDragBehavior:!1===r.simulateDefaultBehavior},!1);return sa.create(e,o,oh,us)}).then(function(t){return t.run()}).then(function(t){return r.dragAndDropState=t,g.delay(r.automationSettings.mouseActionStepDelay)})},pa.prototype._mouseup=function(){var o=this;return us.buttonUp().then(function(){var e=g.positionUtils.offsetToClientCoords(o.endPoint),n=null,i=ca({clientX:e.x,clientY:e.y},o.modifiers);return Tt(e).then(function(t){return(n=t)?(o.dragAndDropState.enabled?(i.dataTransfer=o.dragAndDropState.dataTransfer,o.dragAndDropState.dropAllowed&&fa.drop(n,i),fa.dragend(o.dragAndDropState.element,i),o.dragAndDropState.dataStore.setProtectedMode()):fa[o.upEvent](n,i),Tt(e)):n}).then(function(t){n&&t===n&&!o.dragAndDropState.enabled&&fa.click(n,i)})})},pa.prototype.run=function(t){var i,o=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint;return i={point:n,element:e,options:ca({clientX:n.x,clientY:n.y},o.modifiers)},ua.all([g.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},pa);function pa(t,e){var n=aa.call(this,t,e,oh,us)||this;return n.modifiers=e.modifiers,n.speed=e.speed,n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=ha.isTouchDevice?"touchstart":"mousedown",n.upEvent=ha.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var va,ga=y.styleUtils,Ea=(_(ya,va=ma),ya.prototype._getDestination=function(){return w(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){switch(t.label){case 0:return[4,pt(this.element,{x:this.offsetX,y:this.offsetY})];case 1:return e=t.sent(),n=ga.getWidth(rh),i=ga.getHeight(rh),o={x:e.x+this.dragOffsetX,y:e.y+this.dragOffsetY},o={x:Math.min(Math.max(0,o.x),n),y:Math.min(Math.max(0,o.y),i)},[2,{element:rh.documentElement,offsets:{offsetX:o.x,offsetY:o.y},endPoint:o}]}})})},ya);function ya(t,e,n,i){var o=va.call(this,t,i)||this;return o.dragOffsetX=e,o.dragOffsetY=n,o}var ba,Sa=y.positionUtils,_a=(_(wa,ba=ma),wa.prototype._getDestination=function(){return w(this,void 0,void 0,function(){var e,n,i,o;return P(this,function(t){return e=this.destinationElement,n=Sa.getElementRectangle(e),i=wt(e,this.destinationOffsetX,this.destinationOffsetY),o={x:n.left+i.offsetX,y:n.top+i.offsetY},[2,{element:e,offsets:i,endPoint:o}]})})},wa);function wa(t,e,n){var i=ba.call(this,t,n)||this;return i.destinationElement=e,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var Pa,xa=(_(Ca,Pa=vs),Ca.prototype.run=function(t){return this._ensureElement(t,!0)},Ca);function Ca(t,e){return Pa.call(this,t,e,oh,us)||this}var Aa=p.utils.browser,Ta=p.sandbox.event,Ma=p.eventSandbox.eventSimulator,Da=p.eventSandbox.listeners,Ua=p.nativeMethods,Ia=y.domUtils,ka=y.contentEditable,Ba=y.textSelection,Oa=/ /g;function Na(t){var e=Ba.getSelectionByElement(t),n=Ba.hasInverseSelectionContentEditable(t);return Ba.hasElementContainsSelection(t)?ka.getSelection(t,e,n):{startPos:ka.calculateNodeAndOffsetByPosition(t,0),endPos:ka.calculateNodeAndOffsetByPosition(t,0)}}function Fa(t){var e=t.startPos.node,n=t.startPos.offset,i=t.endPos.offset,o=ka.getFirstNonWhitespaceSymbolIndex(e.nodeValue),r=ka.getLastNonWhitespaceSymbolIndex(e.nodeValue);return n<o&&0!==n?(t.startPos.offset=o,t.endPos.offset=i+o-n):r<i&&i!==e.nodeValue.length&&(t.startPos.offset=e.nodeValue.length,t.endPos.offset=i+e.nodeValue.length-n),t}function La(t,e,n){return!n||Ma.beforeInput(t,e)}function Ya(t,e){var n;function i(t){t.preventDefault(),n=!0}function o(t){"textInput"===t.type&&(n=!1)}Aa.isSafari&&(Da.addInternalEventBeforeListener(oh,["textInput"],i),Ta.on(Ta.EVENT_PREVENTED_EVENT,o));var r=Aa.isFirefox||Ma.textInput(t,e)||n;return Aa.isSafari&&(Da.removeInternalEventBeforeListener(oh,["textInput"],i),Ta.off(Ta.EVENT_PREVENTED_EVENT,o)),r||Aa.isIE11}function Ra(t,e){var n,i,o,r,s,l,a,u,c,h,f,d=Na(t),m=d.startPos.node,p=d.endPos.node,v=!0,g=!0,E=e;function y(){g=!1}function b(t,e,n){n()}e=e.replace(Oa,String.fromCharCode(160)),m&&p&&Ia.isContentEditableElement(m)&&Ia.isContentEditableElement(p)&&(Ia.isTheSameNode(m,p)||(Ba.deleteSelectionContents(t),n=t,o=(i=d).startPos.node,r=Ua.nodeParentNodeGetter.call(o)&&o.parentElement,!(Aa.isChrome&&Aa.version<58||Aa.isSafari)&&r&&Ia.isElementContainsNode(n,o)||(i=Na(n),Ba.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&Ia.isContentEditableElement(m)&&Ia.isRenderedNode(m)&&La(t,e,Aa.isChrome||Aa.isFirefox)&&(v=Ya(t,E),g=v&&!Aa.isIE11,Da.addInternalEventBeforeListener(oh,["input"],y),Da.addInternalEventBeforeListener(oh,["textinput"],b),(v=v&&La(t,e,Aa.isSafari))&&(Ia.isElementNode(m)?(s=m,l=e,c=rh.createTextNode(l),h={node:c,offset:l.length},f=Ua.nodeParentNodeGetter.call(s),"br"===Ia.getTagName(s)?f.insertBefore(c,s):0<a?(u=Ua.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),Ba.selectByNodesAndOffsets(h,h)):function(t,e,n){var i=e.startPos.node;Ia.isElementContainsNode(t,i)||(i=(e=Fa(Na(t))).startPos.node);var o=e.startPos.offset,r=e.endPos.offset,s=i.nodeValue,l={node:i,offset:o+n.length};i.nodeValue=s.substring(0,o)+n+s.substring(r,s.length),Ba.selectByNodesAndOffsets(l,l)}(t,Fa(d),e)),Ot().then(function(){g&&Ma.input(t,e),Da.removeInternalEventBeforeListener(oh,["input"],y),Da.removeInternalEventBeforeListener(oh,["textinput"],b)})))}function Ka(t,e,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;Ia.isContentEditableElement(t)&&Ra(t,e),Ia.isElementReadOnly(t)||(Ia.isTextEditableElement(t)?(l=t,a=e,h=Ia.getElementValue(l),f=a.length,d=Ba.getSelectionStart(l),m=Ba.getSelectionEnd(l),p=Ia.isInputElement(l)&&"number"===l.type,La(l,a,Aa.isChrome||Aa.isFirefox)&&Ya(l,a)&&La(l,a,Aa.isSafari)&&((u=!Aa.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=Aa.isIE&&Aa.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&Aa.isIOS&&"."===h[h.length-1]&&(d+=1),Ia.setElementValue(l,c),Ba.select(l,d+f,d+f)),Ma.input(l,a))):Ia.isInputElement(t)&&(i=t,o=e,null!==(r=n)?(s=Ia.getElementValue(i),Ia.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):Ia.setElementValue(i,o),Ma.change(i),Ma.input(i,o)))}function Wa(t){return 1===t.length&&("a"<=t&&t<="z"||"A"<=t&&t<="Z")}var Va=p.nativeMethods,Xa=p.utils.browser,Ha=p.eventSandbox.focusBlur,qa=p.Promise,Ga=g.domUtils.isRadioButtonElement,za=g.domUtils.getActiveElement,ja=g.domUtils.getTabIndexAttributeIntValue;function $a(t){return t===t.toLowerCase()?t.toUpperCase():t.toLowerCase()}function Qa(t){var e=za(t||rh),n=null;if(e&&g.domUtils.isIframeElement(e)&&Va.contentDocumentGetter.call(e))try{n=Qa(Va.contentDocumentGetter.call(e))}catch(t){}return n||e}function Za(t,e,n){if(!Ga(e))return t;if(!n&&!e.name&&!Xa.isChrome)return[e];var i,o,r=(i=e,o=null,n?""===i.name||Xa.isFirefox||(o=function(t){return!t.name||t===i||t.name!==i.name}):""!==i.name?o=function(t){return Ga(t)&&t.name===i.name}:Xa.isChrome&&(o=function(t){return Ga(t)&&!t.name}),o);return r&&(t=g.arrayUtils.filter(t,r)),t}function Ja(t,e,n){var i,o,r,s,l,a,u,c,h=e?-1:1,f=g.domUtils.getTopSameDomainWindow(oh).document,d=(i=f,o=Va.documentActiveElementGetter.call(i),r=o&&ja(o),!(o&&r<0)),m=Za(m=g.domUtils.getFocusableElements(f,d),t,n),p=Ga(t),v=g.arrayUtils.indexOf(m,t);return(e?0===v:v===m.length-1)?!e&&t.tabIndex<0?g.arrayUtils.find(m,function(t){return 0===t.tabIndex}):n||!p?rh.body:m[m.length-1-v]:e&&-1===v?m[m.length-1]:(l=(s=m)[v+h],a=n,u=Ga(l)&&l.name&&!l.checked,c=null,a&&u&&(c=g.arrayUtils.find(s,function(t){return Ga(t)&&t.name===l.name&&t.checked})),c||l)}function tu(t){if(Wa(t))return t.toUpperCase().charCodeAt(0);var e=g.KEY_MAPS.shiftMap[t]?g.KEY_MAPS.shiftMap[t].charCodeAt(0):t.charCodeAt(0);return g.KEY_MAPS.symbolCharCodeToKeyCode[e]||e}var eu={SPECIAL_KEYS:{capslock:"CapsLock",delete:"U+007F",end:"End",enter:"Enter",esc:"U+001B",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:"U+0020",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"},LETTERS:{a:"U+0041",b:"U+0042",c:"U+0043",d:"U+0044",e:"U+0045",f:"U+0046",g:"U+0047",h:"U+0048",i:"U+0049",j:"U+004A",k:"U+004B",l:"U+004C",m:"U+004D",n:"U+004E",o:"U+004F",p:"U+0050",q:"U+0051",r:"U+0052",s:"U+0053",t:"U+0054",u:"U+0055",v:"U+0056",w:"U+0057",x:"U+0058",y:"U+0059",z:"U+005A"},SYMBOLS:{0:"U+0030",1:"U+0031",2:"U+0032",3:"U+0033",4:"U+0034",5:"U+0035",6:"U+0036",7:"U+0037",8:"U+0038",9:"U+0039"," ":"U+0020","!":"U+0021","@":"U+0040","#":"U+0023",$:"U+0024","%":"U+0025","^":"U+005E","*":"U+002A","(":"U+0028",")":"U+0029",_:"U+005F","|":"U+007C","\\":"U+005C","/":"U+002F","?":"U+003F",".":"U+002E",",":"U+002C","<":"U+003C",">":"U+003E","[":"U+005B","]":"U+005D","{":"U+007B","}":"U+007D","§":"U+00A7","±":"U+00B1","'":"U+0027",'"':"U+0022",":":"U+003A",";":"U+003B","`":"U+0060","~":"U+007E"}};function nu(t){return Wa(t)?eu.LETTERS[t.toLowerCase()]:eu.SYMBOLS[t]||eu.SPECIAL_KEYS[t]||t}function iu(t,e,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=t?"":n),"key"in KeyboardEvent.prototype&&(i.key=e),i}var ou=p.utils.browser,ru=p.utils.extend,su=p.eventSandbox.eventSimulator,lu=(au._isKeyActivatedInputElement=function(t){return g.domUtils.isInputElement(t)&&/button|submit|reset|radio|checkbox/.test(t.type)},au.prototype._type=function(t,e){var n,i=t!==this.storedActiveElement,o=!i,r=t,s=g.domUtils.isEditableElement(t),l=g.domUtils.isEditableElement(this.storedActiveElement);try{i&&(n=g.domUtils.isElementInIframe(t)===g.domUtils.isElementInIframe(this.storedActiveElement)||l,o=(!ou.isFirefox||l)&&(!ou.isWebKit||n))}catch(t){}o&&(!ou.isIE&&i&&l&&s&&(r=this.storedActiveElement),Ka(r,e))},au.prototype._addKeyPropertyToEventOptions=function(t){return ru(t,iu("keypress"===t.type,this.keyProperty,this.keyIdentifierProperty)),t},au.prototype.down=function(t){this.storedActiveElement=Qa(this.topSameDomainDocument),this.modifierKeyCode&&(t[this.sanitizedKey]=!0),t.shift&&this.isLetter&&(this.keyProperty=$a(this.keyProperty));var e={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(e),su.keydown(this.storedActiveElement,ru(e,t))},au.prototype.press=function(t){if(!this.isChar&&!this.specialKeyCode)return!0;var e=Qa(this.topSameDomainDocument),n=this.isChar?function(t,e){if("space"===t)return" ";if(e){if(Wa(t))return $a(t);if(g.KEY_MAPS.reversedShiftMap[t])return g.KEY_MAPS.reversedShiftMap[t]}return t}(this.sanitizedKey,t.shift):null,i=this.specialKeyCode||n.charCodeAt(0),o=e!==this.storedActiveElement;if(ou.isWebKit&&o&&g.domUtils.isElementInIframe(e)!==g.domUtils.isElementInIframe(this.storedActiveElement))return!0;this.storedActiveElement=e;var r={keyCode:i,charCode:i,type:"keypress"};this._addKeyPropertyToEventOptions(r);var s=ou.isAndroid||su.keypress(e,ru(r,t));if(!s)return s;e=Qa(this.topSameDomainDocument),!n||t.ctrl||t.alt||this._type(e,n);var l=au._isKeyActivatedInputElement(e),a=g.domUtils.isButtonElement(e),u=ou.isSafari&&0<=ou.compareVersions([ou.webkitVersion,"603.1.30"]),c=ou.isFirefox&&l;return ou.isFirefox&&!c||u||!l&&!a||"enter"!==this.sanitizedKey||e.click(),s},au.prototype.up=function(t){this.modifierKeyCode&&(t[this.sanitizedKey]=!1);var e={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(e);var n=su.keyup(Qa(this.topSameDomainDocument),ru(e,t)),i=Qa(this.topSameDomainDocument);return!ou.isFirefox&&!ou.isSafari&&(!ou.isChrome||53<=ou.version)&&n&&"space"===this.sanitizedKey&&au._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty(au.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),au);function au(t,e){this.isLetter=Wa(t),this.isChar=1===t.length||"space"===t,this.sanitizedKey=g.getSanitizedKey(t),this.modifierKeyCode=g.KEY_MAPS.modifiers[this.sanitizedKey],this.specialKeyCode=g.KEY_MAPS.specialKeys[this.sanitizedKey],this.keyCode=null,this.keyIdentifierProperty=nu(e),this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(oh).document,this.keyProperty=g.KEY_MAPS.keyProperty[e]||e,this.isChar&&"space"!==t?this.keyCode=tu(this.sanitizedKey):this.modifierKeyCode?this.keyCode=this.modifierKeyCode:this.specialKeyCode&&(this.keyCode=this.specialKeyCode),this.storedActiveElement=null}var uu,cu={ctrlA:"ctrl+a",backspace:"backspace",delete:"delete",left:"left",right:"right",up:"up",down:"down",shiftLeft:"shift+left",shiftRight:"shift+right",shiftUp:"shift+up",shiftDown:"shift+down",shiftHome:"shift+home",shiftEnd:"shift+end",home:"home",end:"end",enter:"enter",tab:"tab",shiftTab:"shift+tab",esc:"esc"},hu=p.Promise,fu=p.utils.browser,du=p.eventSandbox.eventSimulator,mu=p.eventSandbox.elementEditingWatcher,pu=y.textSelection,vu=y.eventUtils,gu=y.domUtils,Eu=i.selectElement,yu=null,bu=null;function Su(){bu=yu=null,vu.unbind(this,"blur",Su,!0)}function _u(t){var e,n,i,o;gu.isTextAreaElement(t)&&(yu!==t&&(vu.bind(t,"blur",Su,!0),yu=t),e=t,n=pu.hasInverseSelection(e),i=gu.getTextAreaValue(e),o=n?pu.getSelectionStart(e):pu.getSelectionEnd(e),bu=i&&o?gu.getTextareaIndentInLine(e,o):0)}function wu(t,e){var n,i,o,r,s,l,a=gu.getTextAreaValue(t);a&&(n=pu.getSelectionStart(t),i=pu.getSelectionEnd(t),o=pu.hasInverseSelection(t),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==bu&&yu===t||_u(t),s=l.lastIndexOf("\n"),xu(t,n,i,o,Math.min(s+1+bu,l.length),e))}function Pu(t,e){var n,i,o,r,s,l,a,u,c,h,f=gu.getTextAreaValue(t);f&&(n=pu.getSelectionStart(t),i=pu.getSelectionEnd(t),u=(r=(o=pu.hasInverseSelection(t))?n:i)+(l=-1===(c=(s=f.substring(r)).indexOf("\n"))?s.length:c+1),h=-1===(c=(a=s.substring(l)).indexOf("\n"))?a.length:c,null!==bu&&yu===t||_u(t),xu(t,n,i,o,u=Math.min(u+bu,u+h),e))}function xu(t,e,n,i,o,r){var s=null,l=null,l=r?(s=e!==n&&i?n:e,o):s=o;pu.select(t,s,l)}function Cu(t,e,n){gu.isInputElement(t)&&"number"===t.type&&("-"===e.charAt(0)&&"."===e.charAt(1)&&(e=e.substring(1)),"."===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1))),gu.setElementValue(t,e),pu.select(t,n,n),du.input(t)}function Au(t,e){var n,i,o,r,s,l,a,u;return gu.isTextEditableElement(t)&&(n=pu.getSelectionStart(t),i=pu.getSelectionEnd(t),o=pu.hasInverseSelection(t),s=null,s=(r=!gu.isTextAreaElement(t)||gu.getTextareaLineNumberByPosition(t,n)===gu.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,a=-1===(l=gu.getElementValue(t).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=e?s:a,pu.select(t,u,a)):o?pu.select(t,i,a):pu.select(t,n,a)),hu.resolve()}function Tu(t,e){var n,i,o,r,s,l,a,u,c;return gu.isTextEditableElement(t)&&(n=pu.getSelectionStart(t),i=pu.getSelectionEnd(t),o=pu.hasInverseSelection(t),s=null,u=s=(r=!gu.isTextAreaElement(t)||gu.getTextareaLineNumberByPosition(t,n)===gu.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=gu.getElementValue(t).substring(s)).indexOf("\n"))?l.length:a,r?(c=e?s:u,pu.select(t,c,u)):o?pu.select(t,i,u):pu.select(t,n,u)),hu.resolve()}function Mu(t){return Au(t,!0)}function Du(t){return Tu(t,!0)}function Uu(t){return gu.isRadioButtonElement(t)&&!fu.isFirefox}function Iu(t,e){return ku(t,e,!1).then(function(t){t&&(t.checked=!0)})}function ku(t,e,n){return void 0===n&&(n=!0),t?(gu.isSelectElement(t)&&Eu.collapseOptionList(),i=t,o=e,r=n,new qa(function(t){var e=Ja(i,o,r);e?Ha.focus(e,function(){return t(e)}):t()}).then(function(t){return t&&gu.isTextEditableInput(t)&&pu.select(t),t})):hu.resolve();var i,o,r}var Bu=((uu={})[cu.ctrlA]=function(t){return gu.isEditableElement(t)&&pu.select(t),hu.resolve()},uu[cu.backspace]=function(t){var e,n,i;return gu.isTextEditableElementAndEditingAllowed(t)&&(e=pu.getSelectionStart(t),n=pu.getSelectionEnd(t),i=gu.getElementValue(t).replace(/\r\n/g,"\n"),n===e?0<e&&Cu(t,i.substring(0,e-1)+i.substring(n,i.length),e-1):Cu(t,i.substring(0,e)+i.substring(n,i.length),e)),gu.isContentEditableElement(t)&&pu.deleteSelectionContents(t),hu.resolve()},uu[cu.delete]=function(t){var e,n,i;return gu.isTextEditableElementAndEditingAllowed(t)&&(e=pu.getSelectionStart(t),n=pu.getSelectionEnd(t),i=gu.getElementValue(t).replace(/\r\n/g,"\n"),n===e?e<i.length&&Cu(t,i.substring(0,e)+i.substring(n+1,i.length),e):Cu(t,i.substring(0,e)+i.substring(n,i.length),e)),gu.isContentEditableElement(t)&&pu.deleteSelectionContents(t),hu.resolve()},uu[cu.left]=function(t){var e,n,i,o,r=null;return gu.isSelectElement(t)&&Eu.switchOptionsByKeys(t,"left"),Uu(t)?Iu(t,!0):(gu.isTextEditableElement(t)&&(e=(r=pu.getSelectionStart(t)||0)===pu.getSelectionEnd(t)?r-1:r,pu.select(t,e,e),_u(t)),gu.isContentEditableElement(t)&&(r=pu.getSelectionStart(t))!==pu.getSelectionEnd(t)&&(n=pu.getSelectionByElement(t),o={node:(i=pu.hasInverseSelectionContentEditable(t))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},pu.selectByNodesAndOffsets(o,o,!0)),hu.resolve())},uu[cu.right]=function(t){var e,n,i,o,r=null,s=null;return gu.isSelectElement(t)&&Eu.switchOptionsByKeys(t,"right"),Uu(t)?Iu(t,!1):(gu.isTextEditableElement(t)&&(e=(r=pu.getSelectionStart(t))===(s=pu.getSelectionEnd(t))?s+1:s,r===gu.getElementValue(t).length&&(e=r),pu.select(t,e,e),_u(t)),gu.isContentEditableElement(t)&&(r=pu.getSelectionStart(t))!==(s=pu.getSelectionEnd(t))&&(n=pu.getSelectionByElement(t),o={node:(i=pu.hasInverseSelectionContentEditable(t))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},pu.selectByNodesAndOffsets(o,o,!0)),hu.resolve())},uu[cu.up]=function(t){return gu.isSelectElement(t)&&Eu.switchOptionsByKeys(t,"up"),Uu(t)?Iu(t,!0):fu.isWebKit&&gu.isInputElement(t)?Au(t):(gu.isTextAreaElement(t)&&wu(t,!1),hu.resolve())},uu[cu.down]=function(t){return gu.isSelectElement(t)&&Eu.switchOptionsByKeys(t,"down"),Uu(t)?Iu(t,!1):fu.isWebKit&&gu.isInputElement(t)?Tu(t):(gu.isTextAreaElement(t)&&Pu(t,!1),hu.resolve())},uu[cu.shiftLeft]=function(t){var e,n;return gu.isTextEditableElement(t)&&((e=pu.getSelectionStart(t))===(n=pu.getSelectionEnd(t))||pu.hasInverseSelection(t)?pu.select(t,n,Math.max(e-1,0)):pu.select(t,e,Math.max(n-1,0)),_u(t)),hu.resolve()},uu[cu.shiftRight]=function(t){var e,n,i;return gu.isTextEditableElement(t)&&(e=pu.getSelectionStart(t),n=pu.getSelectionEnd(t),i=gu.getElementValue(t).length,e!==n&&pu.hasInverseSelection(t)?pu.select(t,n,Math.min(e+1,i)):pu.select(t,e,Math.min(n+1,i)),_u(t)),hu.resolve()},uu[cu.shiftUp]=function(t){return fu.isWebKit&&gu.isInputElement(t)?Mu(t):(gu.isTextAreaElement(t)&&wu(t,!0),hu.resolve())},uu[cu.shiftDown]=function(t){return fu.isWebKit&&gu.isInputElement(t)?Du(t):(gu.isTextAreaElement(t)&&Pu(t,!0),hu.resolve())},uu[cu.shiftHome]=Mu,uu[cu.shiftEnd]=Du,uu[cu.home]=Au,uu[cu.end]=Tu,uu[cu.enter]=function(t){var e,n,i,o,r,s;return gu.isSelectElement(t)&&Eu.collapseOptionList(),gu.isInputElement(t)?(fu.isIE||mu.processElementChanging(t),(e=gu.getParents(t,"form")[0])&&function(t,e){var n=t.querySelectorAll("input, button"),i=null,o=null;for(o=0;o<n.length;o++)if(!i&&"submit"===n[o].type&&!n[o].disabled){i=n[o];break}if(i)du.click(i);else if(gu.blocksImplicitSubmission(e)){for(var r=t.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)gu.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===e&&e.validity.valid&&du.submit(t)&&t.submit()}}(e,t)):gu.isTextAreaElement(t)?(n=pu.getSelectionStart(t),o=(i=gu.getTextAreaValue(t)).substring(0,n),r=i.substring(n),s=n+1,Cu(t,o+String.fromCharCode(10)+r,s)):t.tagName&&gu.isAnchorElement(t)&&du.click(t),hu.resolve()},uu[cu.tab]=function(t){return ku(t,!1)},uu[cu.shiftTab]=function(t){return ku(t,!0)},uu[cu.esc]=function(t){return gu.isSelectElement(t)&&Eu.collapseOptionList(),hu.resolve()},uu),Ou=p.Promise,Nu=p.utils.browser,Fu=p.eventSandbox.message,Lu=p.nativeMethods,Yu="automation|press|request",Ru="automation|press|response";Fu.on(Fu.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===Yu&&(p.on(p.EVENTS.beforeUnload,function(){return Fu.sendServiceMsg({cmd:Ru},t.source)}),new Ku(t.message.keyCombinations,t.message.options).run().then(function(){return Fu.sendServiceMsg({cmd:Ru},t.source)}))});var Ku=(Wu._getKeyPressSimulators=function(t){var e=function(t){for(var e=t.slice(),n=0;n<t.length;n++){var i=t[n];if("shift"===i.toLowerCase()){var o=t[n+1];if(!o)continue;g.KEY_MAPS.shiftMap[o]?t[n+1]=g.KEY_MAPS.shiftMap[o]:g.KEY_MAPS.reversedShiftMap[o]&&(e[n+1]=g.KEY_MAPS.reversedShiftMap[o])}!g.KEY_MAPS.shiftMap[i]||t[n-1]&&"shift"===t[n-1].toLowerCase()||(t[n]=g.KEY_MAPS.shiftMap[i],t.splice(n,0,"shift"),e.splice(n,0,"shift"),n++)}return{actualKeys:t,eventKeyProperties:e}}(g.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return g.arrayUtils.map(n,function(t,e){return new lu(t,i[e])})},Wu._getShortcuts=function(t){for(var e=g.getKeyArray(t.toLowerCase()),n=[],i=[],o=[],r=0;r<e.length;r++)for(i.push(e[r]),o=i.slice();o.length;){var s=o.join("+");Bu[s]?(n.push(s),i=o=[]):o.shift()}return n},Wu._getShortcutHandlers=function(t){for(var e,n,i,o=Wu._getShortcuts(t.toLowerCase()),r={},s="",l=0;l<o.length;l++)e=o[l],n=t.indexOf(e),i=e.length,r[s+=t.substring(0,n+i)]=Bu[e],t=t.substring(n+i);return r},Wu.prototype._down=function(t){this.pressedKeyString+=(this.pressedKeyString?"+":"")+t.key;var e=!t.down(this.modifiersState);return Ou.resolve(e)},Wu.prototype._press=function(t,e){var n=this;if(e&&!this.isSelectElement)return g.delay(this.automationSettings.keyActionStepDelay);var i=this.shortcutHandlers[this.pressedKeyString],o=!1;return i&&!Nu.isFirefox&&"enter"!==t.key||(o=!t.press(this.modifiersState)),o&&!this.isSelectElement||!i?g.delay(this.automationSettings.keyActionStepDelay):i(Qa(this.topSameDomainDocument)).then(function(){return g.delay(n.automationSettings.keyActionStepDelay)})},Wu.prototype._up=function(t){return t.up(this.modifiersState),g.delay(this.automationSettings.keyActionStepDelay)},Wu.prototype._runCombination=function(t){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=g.domUtils.isSelectElement(Qa(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=Wu._getShortcutHandlers(t);var e=Wu._getKeyPressSimulators(t);return g.promiseUtils.each(e,function(e){return n._down(e).then(function(t){return n._press(e,t)})}).then(function(){return g.arrayUtils.reverse(e),g.promiseUtils.each(e,function(t){return n._up(t)})})},Wu.prototype.run=function(){var e=this,t=g.domUtils.getActiveElement(),n=g.domUtils.isIframeElement(t);if(!Pr(oh)&&n&&Lu.contentWindowGetter.call(t)){var i={cmd:Yu,keyCombinations:this.keyCombinations,options:this.options};return g.sendRequestToFrame(i,Ru,Lu.contentWindowGetter.call(t))}return g.promiseUtils.each(this.keyCombinations,function(t){return e._runCombination(t).then(function(){return g.delay(e.automationSettings.keyActionStepDelay)})})},Wu);function Wu(t,e){this.keyCombinations=t,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(oh).document,this.automationSettings=new Dt(e.speed),this.options=e}var Vu,Xu=p.Promise,Hu=p.utils.extend,qu=p.utils.browser,Gu=p.eventSandbox.eventSimulator,zu=y.domUtils,ju=y.eventUtils,$u=y.delay,Qu=(_(Zu,Vu=vs),Zu.prototype._mousedown=function(t){var e=this;return us.rightButtonDown().then(function(){return e.eventState.activeElementBeforeMouseDown=zu.getActiveElement(),e.eventState.simulateDefaultBehavior=Gu.mousedown(t.element,t.options),e._focus(t)})},Zu.prototype._focus=function(t){return!1===this.simulateDefaultBehavior?Ot():Ns(zu.isContentEditableElement(this.element)?this.element:t.element,!qu.isIE||this.eventState.activeElementBeforeMouseDown===zu.getActiveElement(),this.caretPos).then(Ot)},Zu.prototype._mouseup=function(e){var t=this;return us.buttonUp().then(function(){return t._getElementForEvent(e)}).then(function(t){return Gu.mouseup(t,e.options)})},Zu.prototype._contextmenu=function(e){return this._getElementForEvent(e).then(function(t){Gu.contextmenu(t,e.options),zu.isElementFocusable(t)||Ls(t)})},Zu.prototype.run=function(t){var o=this,r=null;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.devicePoint;return r={point:n,element:e,options:Hu({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:ju.BUTTON.right},o.modifiers)},Xu.all([$u(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},Zu);function Zu(t,e){var n=Vu.call(this,t,e,oh,us)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var Ju=p.utils.browser,tc=y.domUtils,ec=y.positionUtils,nc=y.styleUtils,ic=y.contentEditable,oc=y.arrayUtils,rc=["direction","font-family","font-size","font-size-adjust","font-variant","font-weight","font-style","letter-spacing","line-height","text-align","text-indent","text-transform","word-wrap","word-spacing","padding-top","padding-left","padding-right","padding-bottom","margin-top","margin-left","margin-right","margin-bottom","border-top-width","border-left-width","border-right-width","border-bottom-width"];function sc(t,e){var n,i,o,r,s,l=nc.getBordersWidth(t),a=ec.getOffsetPosition(t),u=t.scrollHeight||t.getBoundingClientRect().height,c=Math.ceil(e.left),h=Math.ceil(e.top),f=Math.floor(e.bottom);return tc.isTextAreaElement(t)||(i=(n=ec.offsetToClientCoords({x:a.left,y:a.top})).x+l.left+1,o=n.y+l.top+1,r=n.y+l.top+l.bottom+u,s=n.y+l.top+u-1,c=Math.ceil(c<=n.x?i:e.left),h=Math.ceil(h<=n.y?o:e.top),f=Math.floor(r<=f?s:e.bottom)),{left:c,top:h,bottom:f}}function lc(t){var e=nc.getElementScroll(rh);return{left:t.left+e.left,top:t.top+e.top,bottom:t.bottom+e.top}}function ac(t,e){var n=t.getBoundingClientRect(),i=function(e){var t,n,i,o=rh.body,r=ec.getOffsetPosition(e),s=nc.getElementMargin(e),l=r.top-s.top,a=r.left-s.left,u=rh.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===nc.get(o,"position")&&(t=nc.getElementMargin(o),n=nc.get(o,"left"),i=nc.get(o,"top"),a-=t.left+(parseInt(n.replace("px",""),10)||0),l-=t.top+(parseInt(i.replace("px",""),10)||0)),oc.forEach(rc,function(t){c+="".concat(t,":").concat(nc.get(e,t),";")}),nc.set(u,{cssText:c,position:"absolute",left:a+"px",top:l+"px",width:e.scrollWidth+"px",height:e.scrollHeight+"px"}),p.nativeMethods.nodeTextContentSetter.call(u,tc.getElementValue(e)+" "),o.appendChild(u),u}(t),o=null,r=t.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=tc.getElementValue(t).length;try{var u=rh.createRange();u.setStart(p.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e,a)),u.setEnd(p.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e+1,a+1)),tc.isTextAreaElement(t)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(t){o=null}return tc.remove(i),o?{width:o.width,height:o.height,top:o.top-s,bottom:o.bottom-s,left:o.left-l,right:o.right-l}:null}function uc(t,e){var n,i,o,r,s,l,a=null;return(a=tc.isContentEditableElement(t)?(o=t,r=e,s=tc.findDocument(o).createRange(),l=ic.calculateNodeAndOffsetByPosition(o,r),s.setStart(l.node,Math.min(l.offset,l.node.length)),s.setEnd(l.node,Math.min(l.offset,l.node.length)),s.getClientRects()[0]):"function"==typeof t.createTextRange?(n=e,(i=t.createTextRange()).collapse(!0),i.moveStart("character",n),i.moveEnd("character",n),i.collapse(!0),i.getBoundingClientRect()):ac(t,e))?{x:(a=lc(a=sc(t,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function cc(t,e){var n=tc.isTextEditableElement(t),i=tc.isContentEditableElement(t);return n&&0<tc.getElementValue(t).length||i&&ic.getContentEditableValue(t).length?uc(t,e):ec.findCenter(t)}function hc(t,e,n){var i=tc.findDocument(t).createRange();i.setStart(e,Math.min(n,e.length)),i.setEnd(e,Math.min(n,e.length));var o=i.getClientRects()[0];return o?{x:(o=lc(sc(t,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var fc,dc=p.Promise,mc=p.utils.browser,pc=p.utils.featureDetection,vc=p.eventSandbox.eventSimulator,gc=p.eventSandbox.focusBlur,Ec=y.contentEditable,yc=y.domUtils,bc=y.positionUtils,Sc=y.eventUtils,_c=y.delay,wc=(_(Pc,fc=vs),Pc._calculateEventArguments=function(t){var e=bc.offsetToClientCoords(t);return Tt(e).then(function(t){if(!t)throw new Error(Mt.elementIsInvisibleError);return{element:t,options:{clientX:e.x,clientY:e.y}}})},Pc.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Ho({offsetX:i,offsetY:o,speed:r},!1);return os.create(n,s,oh,us).then(function(t){return t.run()}).then(function(){return _c(e.automationSettings.mouseActionStepDelay)})},Pc.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Sc.preventDefault(t),Sc.unbind(e.element,"mousedown",n)};Sc.bind(this.element,"mousedown",n)},Pc.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},Pc.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},Pc.prototype._moveToPoint=function(t){!function(t,e){if(tc.isEditableElement(t)){var n=tc.isTextAreaElement(t);if(!tc.isInputElement(t)||!(Ju.isFirefox||Ju.isIE&&10<Ju.version)){var i=ec.getOffsetPosition(t),o=nc.getBordersWidth(t),r=nc.getElementScroll(t),s=e.x-i.left-o.left,l=e.y-i.top-o.top,a=null;if(n)return l<r.top&&(a=l),l>t.clientHeight+r.top&&(a=l-t.clientHeight),null!==a&&nc.setScrollTop(t,Math.round(a));s<r.left&&(a=s),s>t.clientWidth+r.left&&(a=s-t.clientWidth),null!==a&&nc.setScrollLeft(t,Math.round(a))}}}(this.element,t),this.clientPoint=function(t,e){var n=tc.isTextEditableElement(t),i=tc.isInputElement(t);if(!n&&!tc.isContentEditableElement(t))return e;var o=ec.getOffsetPosition(t),r=nc.getBordersWidth(t),s=nc.getElementScroll(t),l=o.left+r.left+t.clientWidth;return i&&n&&(Ju.isFirefox||Ju.isIE&&10<Ju.version)?{x:Math.min(e.x,l),y:e.y}:{x:e.x-s.left,y:e.y-s.top}}(this.element,t);var e={element:rh.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(e)},Pc.prototype._mousedown=function(){var n=this;return us.leftButtonDown().then(function(){return Pc._calculateEventArguments(n.clientPoint)}).then(function(t){n.eventArgs=t;var e=(mc.isWebKit||mc.isIE)&&yc.isSelectElement(n.element);return e&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=vc[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=e&&!n.eventState.mousedownPrevented),n._focus()})},Pc.prototype._focus=function(){var n=this;return new dc(function(t){var e=yc.isContentEditableElement(n.element)?Ec.findContentEditableParent(n.element):n.element;gc.focus(e,t,!1,!0)})},Pc.prototype._setSelection=function(){throw new Error("Not implemented")},Pc.prototype._mouseup=function(){var e=this;return us.buttonUp().then(function(){return e._setSelection(),Pc._calculateEventArguments(e.clientPoint)}).then(function(t){e.eventArgs=t,vc[e.upEvent](e.eventArgs.element,e.eventArgs.options)})},Pc.prototype.run=function(){var t=this;return this.absoluteStartPoint=this._calculateAbsoluteStartPoint(),this.absoluteEndPoint=this._calculateAbsoluteEndPoint(),this._moveToPoint(this.absoluteStartPoint).then(function(){return t._mousedown()}).then(function(){return t._moveToPoint(t.absoluteEndPoint)}).then(function(){return t._mouseup()})},Pc);function Pc(t,e){var n=fc.call(this,t,e,oh,us)||this;return n.absoluteStartPoint=null,n.absoluteEndPoint=null,n.clientPoint=null,n.speed=e.speed,n.downEvent=pc.isTouchDevice?"touchstart":"mousedown",n.upEvent=pc.isTouchDevice?"touchend":"mouseup",n.eventArgs={options:null,element:null},n.eventState={mousedownPrevented:!1,simulateDefaultBehavior:!0},n}var xc,Cc=y.textSelection,Ac=y.domUtils,Tc=y.positionUtils,Mc=(_(Dc,xc=wc),Dc.prototype._calculateAbsoluteStartPoint=function(){return cc(this.element,this.startPos)||Tc.findCenter(this.element)},Dc.prototype._calculateAbsoluteEndPoint=function(){var t=cc(this.element,this.endPos);return t||(Ac.isContentEditableElement(this.element)?function(t,e,n){for(var i=n<e?1:-1,o=n,r=null;o!==e&&!(r=uc(t,o+=i)););return r=r||uc(t,e)||ec.findCenter(t)}(this.element,this.startPos,this.endPos):Tc.findCenter(this.element))},Dc.prototype._setSelection=function(){var t=Ac.isTextEditableElement(this.element),e=Ac.isContentEditableElement(this.element);(t||e)&&!1!==this.eventState.simulateDefaultBehavior&&Cc.select(this.element,this.startPos,this.endPos)},Dc.prototype.run=function(t){var e=this;return this._ensureElement(t).then(function(){return xc.prototype.run.call(e)})},Dc);function Dc(t,e,n,i){var o=xc.call(this,t,i)||this;return o.startPos=e,o.endPos=n,o}var Uc,Ic=y.textSelection,kc=y.contentEditable,Bc=y.positionUtils,Oc=(_(Nc,Uc=wc),Nc.prototype._calculateAbsoluteStartPoint=function(){return hc(this.element,this.startNode,this.startOffset)||Bc.findCenter(this.element)},Nc.prototype._calculateAbsoluteEndPoint=function(){return hc(this.element,this.endNode,this.endOffset)||Bc.findCenter(this.element)},Nc.prototype._setSelection=function(){var t,e;!1!==this.eventState.simulateDefaultBehavior&&(t={node:this.startNode,offset:this.startOffset},e={node:this.endNode,offset:this.endOffset},Ic.selectByNodesAndOffsets(t,e,!0))},Nc);function Nc(t,e,n){var i=Uc.call(this,kc.getNearestCommonAncestor(t,e),n)||this,o=kc.getFirstVisiblePosition(t),r=kc.getLastVisiblePosition(e),s={node:t,offset:o},l={node:e,offset:r},a=kc.calculatePositionByNodeAndOffset(i.element,s);return kc.calculatePositionByNodeAndOffset(i.element,l)<a&&(o=kc.getLastVisiblePosition(t),r=kc.getFirstVisiblePosition(e)),s=kc.calculateNodeAndOffsetByPosition(t,o),l=kc.calculateNodeAndOffsetByPosition(e,r),i.startNode=s.node,i.startOffset=s.offset,i.endNode=l.node,i.endOffset=l.offset,i}var Fc=p.Promise,Lc=p.utils.extend,Yc=p.utils.browser,Rc=p.eventSandbox.eventSimulator,Kc=p.eventSandbox.elementEditingWatcher,Wc=y.domUtils,Vc=y.promiseUtils,Xc=y.contentEditable,Hc=y.textSelection,qc=y.delay,Gc=y.KEY_MAPS.specialKeys,zc=(jc.findTextEditableChild=function(t){var e=null;if(!Wc.isEditableElement(t))for(var n=t.querySelectorAll("*"),i=0;i<n.length;i++)if(Wc.isTextEditableElementAndEditingAllowed(n[i])){e=n[i];break}return e},jc.prototype._calculateEventArguments=function(t){var e=Wc.getActiveElement(),n=Wc.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||e===i||(i=jc.findTextEditableChild(e)||e);var o=Lc({keyCode:t?this.currentCharCode:this.currentKeyCode},this.modifiers);return t&&(o.charCode=this.currentCharCode),Lc(o,iu(t,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},jc.prototype._calculateTargetElement=function(){var t=Wc.getActiveElement(),e=Wc.isContentEditableElement(this.element);if(e){if(t!==Xc.findContentEditableParent(this.element))return void(this.eventState.skipType=!0)}else if(t!==this.element)return void(this.eventState.skipType=!0);this.element=e?this.element:t},jc.prototype._click=function(t){var e,n=this,i=Wc.getActiveElement(),o=Wc.isTextEditableElementAndEditingAllowed(this.element),r=Wc.isContentEditableElement(this.element);if(i===this.element)return o&&Kc.watchElementEditing(this.element),(o||r)&&(e=Hc.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===e||Hc.select(this.element,this.caretPos,this.caretPos)),Fc.resolve();var s=_t(this.element),l=s.offsetX,a=s.offsetY,u=new Wo({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new gl(this.element,u,oh,us).run(t).then(function(){return qc(n.automationSettings.mouseActionStepDelay)})},jc.prototype._type=function(){var t=this;if(this.eventState.skipType)return Fc.resolve();var e=Wc.isContentEditableElement(this.element);return this.replace&&(Wc.isTextEditableElementAndEditingAllowed(this.element)?Hc.select(this.element):e&&Hc.deleteSelectionContents(this.element,!0)),Vc.whilst(function(){return!t._isTypingFinished()},function(){return t._typingStep()})},jc.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},jc.prototype._typingStep=function(){var t=this.typingText.charAt(this.currentPos);return this.currentKeyCode=tu(t),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this.currentKeyCode===Gc.enter?"Enter":t,this.currentKeyIdentifier=nu(this.currentKey),this.ignoreChangeEvent=Wc.getElementValue(this.element)===Kc.getElementSavedValue(this.element),this._keydown(),this._keypress(),this._keyup()},jc.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=Rc.keydown(this.eventArgs.element,this.eventArgs.options)},jc.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=Yc.isAndroid||Rc.keypress(this.eventArgs.element,this.eventArgs.options))},jc.prototype._keyup=function(){var t=this,e=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=Wc.isTextEditableElement(this.element),i=Wc.isContentEditableElement(this.element),o=this.paste||!n&&!i;return Fc.resolve().then(function(){return o?t._typeAllText(e):t._typeChar(e)}).then(function(){Rc.keyup(t.eventArgs.element,t.eventArgs.options),o?t.currentPos=t.typingText.length:t.currentPos++})},jc.prototype._typeChar=function(t){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&Kc.restartWatchingElementEditing(t),qc(this.automationSettings.keyActionStepDelay);var e=this.typingText.charAt(this.currentPos),n=/^\d$/.test(e),i=0===this.currentPos?null:this.typingText.charAt(this.currentPos-1);if(Wc.isInputElement(t)&&"number"===t.type){var o=Hc.getSelectionStart(t),r=Wc.getInputValue(t).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===e||"-"===e&&r)||0!==o))return qc(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(e=i+e)}return Ka(t,e,null),qc(this.automationSettings.keyActionStepDelay)},jc.prototype._typeAllText=function(t){return Ka(t,this.typingText,this.caretPos),qc(this.automationSettings.keyActionStepDelay)},jc.prototype.run=function(t){var e=this;return this._click(t).then(function(){return e._calculateTargetElement()}).then(function(){return e._type()})},jc);function jc(t,e,n){this.element=jc.findTextEditableChild(t)||t,this.typingText=e.toString(),this.modifiers=n.modifiers,this.caretPos=n.caretPos,this.replace=n.replace,this.paste=n.paste,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=n.speed,this.automationSettings=new Dt(this.speed),this.elementChanged=t!==this.element,this.currentPos=0,this.currentKeyCode=null,this.currentCharCode=null,this.currentKey=null,this.currentKeyIdentifier=null,this.ignoreChangeEvent=!0,this.eventArgs={options:null,element:null},this.eventState={skipType:!1,simulateKeypress:!0,simulateTypeChar:!0}}var $c=(Qc.prototype.run=function(){var i=this;return m.doUpload(this.element,this.paths).then(function(t){if(t.length){var e=g.arrayUtils.map(t,function(t){return t.path}),n=g.arrayUtils.reduce(t,function(t,e){return t.concat(e.resolvedPaths)},[]);throw i.createError(e,n)}})},Qc);function Qc(t,e,n){this.element=t,this.paths=e,this.createError=n}var Zc=y.domUtils,Jc=y.contentEditable,th={};th.DispatchEvent=t,th.SetScroll=bs,th.ScrollIntoView=ws,th.Click=gl,th.SelectChildClick=Yl,th.DblClick=zl,th.DragToOffset=Ea,th.DragToElement=_a,th.Hover=xa,th.Press=Ku,th.RClick=Qu,th.SelectText=Mc,th.SelectEditableContent=Oc,th.Type=zc,th.Upload=$c,th.MouseOptions=Yo,th.ClickOptions=Wo,th.TypeOptions=Jo,th.ERROR_TYPES=Mt,th.AutomationSettings=Dt,th.getOffsetOptions=wt,th.calculateSelectTextArguments=function(t,e){void 0===e&&(e={});var n,i,o,r,s,l,a,u,c,h,f,d=Zc.isTextEditableElement(t),m=d?0:Jc.getFirstVisiblePosition(t),p=d?Zc.getElementValue(t).length:Jc.getLastVisiblePosition(t),v=e.startPos?Math.min(e.startPos,p):m,g=void 0===e.endPos||null===e.endPos?p:Math.min(e.endPos,p);return void 0!==e.offset?(g=0<=e.offset?Math.min(e.offset,g):(v=g,Math.max(0,g+e.offset)),{startPos:v,endPos:g}):void 0!==e.startLine?(n=t,i=e,o=Zc.getTextAreaValue(n),r=o&&o.length?o.split("\n"):[],s=r.length-1,l=i.startLine?Math.min(i.startLine,s):0,a=r[l]?r[l].length:0,u=i.startPos?Math.min(i.startPos,a):0,c=void 0===i.endLine||null===i.endLine?s:Math.min(i.endLine,s),h=r[c]?r[c].length:0,f=void 0===i.endPos||null===i.endPos?h:Math.min(i.endPos,h),{startPos:Zc.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:Zc.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},th.cursor=us,th.getNextFocusableElement=Ja,th.SHORTCUT_TYPE=cu,th.getSelectionCoordinatesByPosition=cc,th.getElementFromPoint=Tt,th.MoveAutomation=os;var eh=p.nativeMethods,nh=p.EVENTS.evalIframeScript;eh.objectDefineProperty(oh,"%testCafeAutomation%",{configurable:!0,value:th}),p.on(nh,function(t){return ih(eh.contentWindowGetter.call(t.iframe))})}(oh["%hammerhead%"],oh["%hammerhead%"].Promise,oh["%testCafeCore%"],oh["%testCafeUI%"])}(window);
|