testcafe 1.14.1 → 1.14.2
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/CHANGELOG.md +6 -0
- package/LICENSE +21 -21
- package/bin/testcafe-with-v8-flag-filter.js +0 -0
- package/lib/api/exportable-lib/index.js +49 -49
- package/lib/api/request-hooks/assert-type.js +7 -7
- package/lib/api/request-hooks/hook-method-names.js +9 -9
- package/lib/api/request-hooks/hook.js +32 -32
- package/lib/api/request-hooks/interfaces.js +2 -2
- package/lib/api/request-hooks/request-logger.js +112 -112
- package/lib/api/request-hooks/request-mock/create-request-mock.js +10 -10
- package/lib/api/request-hooks/request-mock/index.js +44 -44
- package/lib/api/request-hooks/request-mock.js +46 -46
- package/lib/api/structure/base-unit.js +11 -11
- package/lib/api/structure/fixture.js +75 -75
- package/lib/api/structure/interfaces.js +2 -2
- package/lib/api/structure/test-file.js +31 -31
- package/lib/api/structure/test-timeout.js +9 -9
- package/lib/api/structure/test.js +85 -85
- package/lib/api/structure/testing-unit.js +89 -89
- package/lib/api/structure/unit-type.js +9 -9
- package/lib/api/test-controller/assertion.js +88 -88
- package/lib/api/test-controller/execution-context.js +82 -82
- package/lib/api/test-controller/index.js +358 -358
- package/lib/api/test-controller/proxy.js +28 -28
- package/lib/api/test-page-url.js +60 -60
- package/lib/api/test-run-tracker.js +68 -68
- package/lib/api/wrap-test-function.js +49 -49
- package/lib/assertions/executor.js +74 -74
- package/lib/assertions/get-fn.js +46 -46
- package/lib/assertions/type.js +20 -20
- package/lib/assets/content-types.js +9 -9
- package/lib/assets/injectables.js +18 -18
- package/lib/browser/connection/command.js +10 -10
- package/lib/browser/connection/error-hints.js +9 -9
- package/lib/browser/connection/gateway.js +159 -159
- package/lib/browser/connection/get-hints.js +33 -33
- package/lib/browser/connection/heartbeat-status.js +8 -8
- package/lib/browser/connection/index.js +328 -328
- package/lib/browser/connection/remotes-queue.js +46 -46
- package/lib/browser/connection/service-routes.js +12 -12
- package/lib/browser/connection/status.js +12 -12
- package/lib/browser/interfaces.js +2 -2
- package/lib/browser/provider/built-in/dedicated/base.js +80 -80
- package/lib/browser/provider/built-in/dedicated/chrome/browser-client.js +204 -204
- package/lib/browser/provider/built-in/dedicated/chrome/build-chrome-args.js +17 -17
- package/lib/browser/provider/built-in/dedicated/chrome/config.js +110 -110
- package/lib/browser/provider/built-in/dedicated/chrome/create-temp-profile.js +45 -45
- package/lib/browser/provider/built-in/dedicated/chrome/elapsed-upperbounds.js +15 -15
- package/lib/browser/provider/built-in/dedicated/chrome/index.js +102 -102
- package/lib/browser/provider/built-in/dedicated/chrome/interfaces.js +2 -2
- package/lib/browser/provider/built-in/dedicated/chrome/local-chrome.js +24 -24
- package/lib/browser/provider/built-in/dedicated/chrome/runtime-info.js +29 -29
- package/lib/browser/provider/built-in/dedicated/edge/index.js +10 -10
- package/lib/browser/provider/built-in/dedicated/edge/runtime-info.js +29 -29
- package/lib/browser/provider/built-in/dedicated/firefox/config.js +33 -33
- package/lib/browser/provider/built-in/dedicated/firefox/create-temp-profile.js +78 -78
- package/lib/browser/provider/built-in/dedicated/firefox/index.js +73 -73
- package/lib/browser/provider/built-in/dedicated/firefox/local-firefox.js +36 -36
- package/lib/browser/provider/built-in/dedicated/firefox/marionette-client/commands.js +13 -13
- package/lib/browser/provider/built-in/dedicated/firefox/marionette-client/index.js +200 -200
- package/lib/browser/provider/built-in/dedicated/firefox/runtime-info.js +17 -17
- package/lib/browser/provider/built-in/index.js +21 -21
- package/lib/browser/provider/built-in/locally-installed.js +30 -30
- package/lib/browser/provider/built-in/path.js +47 -47
- package/lib/browser/provider/built-in/remote.js +58 -58
- package/lib/browser/provider/index.js +303 -303
- package/lib/browser/provider/parse-provider-name.js +16 -16
- package/lib/browser/provider/plugin-host.js +121 -121
- package/lib/browser/provider/pool.js +115 -115
- package/lib/browser/provider/utils/argument-parsing.js +74 -74
- package/lib/browser/provider/utils/browser-starter.js +34 -34
- package/lib/browser/provider/utils/client-functions.js +24 -24
- package/lib/browser/provider/utils/get-maximized-headless-window-size.js +9 -9
- package/lib/cli/argument-parser.js +284 -284
- package/lib/cli/authentication-helper.js +35 -35
- package/lib/cli/cli.js +134 -134
- package/lib/cli/correct-browsers-and-sources.js +40 -40
- package/lib/cli/index.js +19 -19
- package/lib/cli/log.js +43 -43
- package/lib/cli/remotes-wizard.js +36 -36
- package/lib/cli/termination-handler.js +38 -38
- package/lib/client/automation/index.js +34 -16
- package/lib/client/automation/index.min.js +1 -1
- package/lib/client/browser/idle-page/index.html.mustache +35 -35
- package/lib/client/browser/idle-page/logo.svg +86 -86
- package/lib/client/core/index.js +14 -14
- package/lib/client/driver/index.js +46 -16
- package/lib/client/driver/index.min.js +1 -1
- package/lib/client/driver/internal-properties.js +9 -9
- package/lib/client/test-run/iframe.js.mustache +17 -17
- package/lib/client/test-run/index.js.mustache +51 -51
- package/lib/client/ui/index.js +14 -14
- package/lib/client/ui/sprite.svg +42 -42
- package/lib/client-functions/builder-symbol.js +4 -4
- package/lib/client-functions/client-function-builder.js +155 -155
- package/lib/client-functions/replicator.js +61 -61
- package/lib/client-functions/return-single-prop-mode.js +8 -8
- package/lib/client-functions/selector-api-execution-mode.js +20 -20
- package/lib/client-functions/selectors/add-api.js +645 -645
- package/lib/client-functions/selectors/create-snapshot-methods.js +13 -13
- package/lib/client-functions/selectors/prepare-api-args.js +20 -20
- package/lib/client-functions/selectors/selector-attribute-filter.js +22 -22
- package/lib/client-functions/selectors/selector-builder.js +153 -153
- package/lib/client-functions/selectors/selector-text-filter.js +43 -43
- package/lib/client-functions/selectors/snapshot-properties.js +48 -48
- package/lib/client-functions/types.js +18 -18
- package/lib/compiler/babel/format-babel-produced-code.js +10 -10
- package/lib/compiler/babel/get-base-babel-options.js +11 -11
- package/lib/compiler/babel/load-libs.js +63 -63
- package/lib/compiler/babel/preset-stage-2.js +19 -19
- package/lib/compiler/compile-client-function.js +73 -73
- package/lib/compiler/compilers.js +33 -33
- package/lib/compiler/index.js +92 -92
- package/lib/compiler/interfaces.js +2 -2
- package/lib/compiler/test-file/api-based.js +146 -146
- package/lib/compiler/test-file/base.js +36 -36
- package/lib/compiler/test-file/exportble-lib-path.js +5 -5
- package/lib/compiler/test-file/formats/coffeescript/compiler.js +38 -38
- package/lib/compiler/test-file/formats/coffeescript/get-test-list.js +29 -29
- package/lib/compiler/test-file/formats/es-next/compiler.js +42 -42
- package/lib/compiler/test-file/formats/es-next/get-test-list.js +166 -166
- package/lib/compiler/test-file/formats/es-next/is-flow-code.js +7 -7
- package/lib/compiler/test-file/formats/raw.js +85 -85
- package/lib/compiler/test-file/formats/typescript/compiler.js +135 -135
- package/lib/compiler/test-file/formats/typescript/get-test-list.js +185 -185
- package/lib/compiler/test-file/test-file-parser-base.js +214 -214
- package/lib/configuration/configuration-base.js +165 -165
- package/lib/configuration/constants.js +9 -9
- package/lib/configuration/customizable-compilers.js +7 -7
- package/lib/configuration/default-values.js +51 -51
- package/lib/configuration/interfaces.js +2 -2
- package/lib/configuration/option-names.js +53 -53
- package/lib/configuration/option-source.js +9 -9
- package/lib/configuration/option.js +14 -14
- package/lib/configuration/quarantine-option-names.js +8 -8
- package/lib/configuration/run-option-names.js +26 -26
- package/lib/configuration/screenshot-option-names.js +10 -10
- package/lib/configuration/testcafe-configuration.js +163 -163
- package/lib/configuration/types.js +2 -2
- package/lib/configuration/typescript-configuration.js +62 -62
- package/lib/custom-client-scripts/assert-type.js +7 -7
- package/lib/custom-client-scripts/client-script-init.js +2 -2
- package/lib/custom-client-scripts/client-script.js +106 -106
- package/lib/custom-client-scripts/get-code.js +11 -11
- package/lib/custom-client-scripts/get-url.js +6 -6
- package/lib/custom-client-scripts/load.js +15 -15
- package/lib/custom-client-scripts/problematic-scripts.js +2 -2
- package/lib/custom-client-scripts/routing.js +36 -36
- package/lib/custom-client-scripts/utils.js +60 -60
- package/lib/embedding-utils.js +83 -83
- package/lib/errors/create-stack-filter.js +18 -18
- package/lib/errors/error-list.js +26 -26
- package/lib/errors/get-callsite.js +31 -31
- package/lib/errors/internal-modules-prefix.js +8 -8
- package/lib/errors/is-internal-stack-frame.js +45 -45
- package/lib/errors/process-test-fn-error.js +37 -37
- package/lib/errors/runtime/index.js +123 -123
- package/lib/errors/runtime/templates.js +115 -115
- package/lib/errors/runtime/type-assertions.js +112 -112
- package/lib/errors/stack-cleaning-hook.js +64 -64
- package/lib/errors/test-run/formattable-adapter.js +59 -59
- package/lib/errors/test-run/index.js +301 -301
- package/lib/errors/test-run/render-error-template.js +31 -31
- package/lib/errors/test-run/templates.js +91 -91
- package/lib/errors/test-run/utils.js +89 -89
- package/lib/errors/types.js +156 -156
- package/lib/index.js +81 -81
- package/lib/live/bootstrapper.js +43 -43
- package/lib/live/controller.js +107 -107
- package/lib/live/file-watcher/index.js +67 -67
- package/lib/live/file-watcher/modules-graph.js +58 -58
- package/lib/live/keyboard-observer.js +76 -76
- package/lib/live/logger/index.js +64 -64
- package/lib/live/test-run-controller.js +96 -96
- package/lib/live/test-run-state.js +6 -6
- package/lib/live/test-run.js +56 -56
- package/lib/live/test-runner.js +167 -167
- package/lib/load-assets.js +29 -29
- package/lib/notifications/add-rendered-warning.js +16 -16
- package/lib/notifications/debug-logger.js +78 -78
- package/lib/notifications/deprecated.js +24 -24
- package/lib/notifications/information-message.js +9 -9
- package/lib/notifications/warning-log.js +31 -31
- package/lib/notifications/warning-message.js +47 -47
- package/lib/reporter/command/command-formatter.js +120 -109
- package/lib/reporter/command/format-command.js +8 -8
- package/lib/reporter/command/interfaces.js +2 -2
- package/lib/reporter/index.js +319 -314
- package/lib/reporter/interfaces.js +2 -2
- package/lib/reporter/plugin-host.js +135 -135
- package/lib/reporter/plugin-methods.js +12 -12
- package/lib/role/index.js +74 -74
- package/lib/role/marker-symbol.js +7 -7
- package/lib/role/phase.js +9 -9
- package/lib/runner/bootstrapper.js +271 -271
- package/lib/runner/browser-job-result.js +9 -9
- package/lib/runner/browser-job.js +152 -152
- package/lib/runner/browser-set.js +114 -114
- package/lib/runner/fixture-hook-controller.js +85 -85
- package/lib/runner/index.js +449 -449
- package/lib/runner/interfaces.js +2 -2
- package/lib/runner/reporter-stream-controller.js +27 -27
- package/lib/runner/task/index.js +151 -151
- package/lib/runner/task/phase.js +9 -9
- package/lib/runner/test-run-controller.js +165 -165
- package/lib/runner/tested-app.js +72 -72
- package/lib/screenshots/capturer.js +141 -141
- package/lib/screenshots/constants.js +11 -11
- package/lib/screenshots/crop.js +111 -111
- package/lib/screenshots/default-extension.js +4 -4
- package/lib/screenshots/index.js +67 -67
- package/lib/screenshots/utils.js +39 -39
- package/lib/services/compiler/host.js +190 -190
- package/lib/services/compiler/io.js +9 -9
- package/lib/services/compiler/protocol.js +17 -16
- package/lib/services/compiler/service.js +225 -212
- package/lib/services/compiler/test-run-proxy.js +111 -111
- package/lib/services/interfaces.js +2 -2
- package/lib/services/process-title.js +8 -8
- package/lib/services/serialization/prepare-options.js +17 -17
- package/lib/services/serialization/replicator/create-replicator.js +25 -25
- package/lib/services/serialization/replicator/custom-error-transform.js +26 -26
- package/lib/services/serialization/test-structure.js +92 -92
- package/lib/services/utils/ipc/interfaces.js +30 -30
- package/lib/services/utils/ipc/io.js +108 -108
- package/lib/services/utils/ipc/message.js +75 -75
- package/lib/services/utils/ipc/packet.js +55 -55
- package/lib/services/utils/ipc/proxy.js +109 -109
- package/lib/services/utils/ipc/transport.js +64 -64
- package/lib/shared/errors/index.js +382 -382
- package/lib/shared/node-modules-folder-name.js +4 -4
- package/lib/test-run/bookmark.js +90 -90
- package/lib/test-run/browser-console-messages.js +73 -73
- package/lib/test-run/browser-manipulation-queue.js +92 -92
- package/lib/test-run/client-messages.js +9 -9
- package/lib/test-run/commands/actions.js +486 -483
- package/lib/test-run/commands/assertion.js +45 -45
- package/lib/test-run/commands/base.js +14 -14
- package/lib/test-run/commands/browser-manipulation.js +95 -95
- package/lib/test-run/commands/from-object.js +82 -82
- package/lib/test-run/commands/observation.js +61 -61
- package/lib/test-run/commands/options.js +231 -215
- package/lib/test-run/commands/service.js +54 -48
- package/lib/test-run/commands/type.js +65 -64
- package/lib/test-run/commands/utils.js +87 -87
- package/lib/test-run/commands/validations/argument.js +90 -90
- package/lib/test-run/commands/validations/factories.js +47 -47
- package/lib/test-run/commands/validations/initializers.js +44 -44
- package/lib/test-run/debug-log.js +32 -32
- package/lib/test-run/execute-js-expression.js +74 -74
- package/lib/test-run/index.js +823 -799
- package/lib/test-run/marker-symbol.js +7 -7
- package/lib/test-run/observed-callsites-storage.js +17 -17
- package/lib/test-run/phase.js +16 -16
- package/lib/test-run/session-controller.js +104 -104
- package/lib/testcafe.js +118 -118
- package/lib/utils/assignable.js +39 -39
- package/lib/utils/async-event-emitter.js +28 -28
- package/lib/utils/async-queue.js +14 -14
- package/lib/utils/browser-connection-timeouts.js +19 -19
- package/lib/utils/callsite.js +17 -17
- package/lib/utils/check-file-path.js +31 -31
- package/lib/utils/check-url.js +51 -51
- package/lib/utils/convert-to-best-fit-type.js +16 -16
- package/lib/utils/correct-file-path.js +21 -21
- package/lib/utils/define-lazy-property.js +13 -13
- package/lib/utils/delay.js +6 -6
- package/lib/utils/delegated-api.js +44 -44
- package/lib/utils/detect-display.js +6 -6
- package/lib/utils/detect-ffmpeg.js +44 -44
- package/lib/utils/diff/colors.js +29 -29
- package/lib/utils/diff/index.js +52 -52
- package/lib/utils/diff/util.js +23 -23
- package/lib/utils/diff.js +29 -29
- package/lib/utils/escape-user-agent.js +10 -10
- package/lib/utils/flag-list.js +17 -17
- package/lib/utils/get-any-key.js +8 -8
- package/lib/utils/get-browser.js +8 -8
- package/lib/utils/get-common-path.js +34 -34
- package/lib/utils/get-filter-fn.js +40 -40
- package/lib/utils/get-options/base.js +36 -36
- package/lib/utils/get-options/compiler.js +33 -33
- package/lib/utils/get-options/grep.js +15 -15
- package/lib/utils/get-options/index.js +20 -20
- package/lib/utils/get-options/meta.js +22 -22
- package/lib/utils/get-options/quarantine.js +91 -91
- package/lib/utils/get-options/screenshot.js +17 -17
- package/lib/utils/get-options/ssl.js +45 -45
- package/lib/utils/get-options/video.js +10 -10
- package/lib/utils/get-viewport-width.js +17 -17
- package/lib/utils/guard-time-execution.js +10 -10
- package/lib/utils/handle-errors.js +74 -74
- package/lib/utils/handle-tag-args.js +8 -8
- package/lib/utils/http.js +30 -30
- package/lib/utils/is-localhost.js +11 -11
- package/lib/utils/is-password-input.js +11 -0
- package/lib/utils/is-repl.js +10 -10
- package/lib/utils/is-window-in-iframe.js +6 -6
- package/lib/utils/limit-number.js +10 -10
- package/lib/utils/make-reg-exp.js +7 -7
- package/lib/utils/moment-loader.js +20 -20
- package/lib/utils/parse-file-list.js +71 -71
- package/lib/utils/parse-user-agent.js +55 -55
- package/lib/utils/path-pattern.js +114 -114
- package/lib/utils/prepare-reporters.js +30 -30
- package/lib/utils/prerender-callsite.js +18 -18
- package/lib/utils/process.js +119 -119
- package/lib/utils/promisified-functions.js +46 -46
- package/lib/utils/re-executable-promise.js +39 -39
- package/lib/utils/render-callsite-sync.js +29 -29
- package/lib/utils/render-template.js +9 -9
- package/lib/utils/reporter.js +30 -30
- package/lib/utils/resolve-path-relatively-cwd.js +7 -7
- package/lib/utils/string.js +105 -105
- package/lib/utils/temp-directory/cleanup-process/commands.js +7 -7
- package/lib/utils/temp-directory/cleanup-process/index.js +143 -143
- package/lib/utils/temp-directory/cleanup-process/worker.js +58 -58
- package/lib/utils/temp-directory/index.js +87 -87
- package/lib/utils/temp-directory/lockfile.js +56 -56
- package/lib/utils/thennable.js +7 -7
- package/lib/utils/timer.js +15 -15
- package/lib/utils/to-posix-path.js +8 -8
- package/lib/utils/types.js +2 -2
- package/lib/video-recorder/interfaces.js +2 -2
- package/lib/video-recorder/process.js +126 -126
- package/lib/video-recorder/recorder.js +136 -136
- package/lib/video-recorder/test-run-video-recorder.js +69 -69
- package/lib/video-recorder/videos.js +37 -37
- package/package.json +2 -2
- package/ts-defs/index.d.ts +25 -14
- package/ts-defs/selectors.d.ts +16 -5
- package/ts-defs/testcafe-scripts.d.ts +17 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
window["%hammerhead%"].utils.removeInjectedScript(),function Ha(Ga){var za=Ga.document;!function(t,m,e,o){var h="default"in t?t.default:t,y="default"in m?m.default:m;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var n=h.nativeMethods,i=/^((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},f="MouseEvent",d="PointerEvent",p="KeyboardEvent",v="InputEvent",g="FocusEvent",E=(S.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:Ga,buttons:o});var r,s=S._getEventCtorByEventType(this.eventName,this.options.eventConstructor);s&&(r=new s(this.eventName,this.options),this.element.dispatchEvent(r))},S._getEventCtorByEventType=function(t,e){if(e&&"function"==typeof S._getEventCtorFromWindow(e)){var n=S._getEventCtorFromNativeMethods(e);if(n&&"function"==typeof n)return n}return i.test(t)||r.test(t)?S._getEventCtorFromNativeMethods(f):u.test(t)?S._getEventCtorFromNativeMethods(d):s.test(t)?S._getEventCtorFromNativeMethods(p):l.test(t)?S._getEventCtorFromNativeMethods(v):a.test(t)?S._getEventCtorFromNativeMethods(g):S._getEventCtorFromNativeMethods("CustomEvent")},S._getEventCtorFromNativeMethods=function(t){return n["Window"+t]||S._getEventCtorFromWindow(t)},S._getEventCtorFromWindow=function(t){return Ga[t]},S);function S(t,e,n){this.element=t,this.eventName=e,this.options=n}function b(t){return t.top!==t}var P=h.Promise,x=h.eventSandbox.message,_="automation|scroll|request",C="automation|scroll|response";x.on(x.SERVICE_MSG_RECEIVED_EVENT,function(t){var e,n,i,o,r,s;t.message.cmd===_&&(n=(e=t.message).offsetX,i=e.offsetY,o=e.maxScrollMargin,r=m.domUtils.findIframeByWindow(t.source),(s=new A(r,{offsetX:n,offsetY:i})).maxScrollMargin=o,s.run().then(function(){return x.sendServiceMsg({cmd:C},t.source)}))});var A=(w.prototype._isScrollValuesChanged=function(t,e){return m.styleUtils.getScrollLeft(t)!==e.left||m.styleUtils.getScrollTop(t)!==e.top},w.prototype._setScroll=function(t,e){var n=this,i=e.left,o=e.top,r=m.domUtils.isHtmlElement(t)?m.domUtils.findDocument(t):t,s={left:m.styleUtils.getScrollLeft(r),top:m.styleUtils.getScrollTop(r)},i=Math.max(i,0),o=Math.max(o,0),l=m.scrollController.waitForScroll(r);return m.styleUtils.setScrollLeft(r,i),m.styleUtils.setScrollTop(r,o),this._isScrollValuesChanged(r,s)?l=l.then(function(){n.scrollWasPerformed=n.scrollWasPerformed||n._isScrollValuesChanged(r,s)}):(l.cancel(),P.resolve())},w.prototype._getScrollToPoint=function(t,e,n){var i=e.x,o=e.y,r=Math.floor(t.width/2),s=Math.floor(Math.floor(t.height/2)),l=this.scrollToCenter?r:Math.min(n.left,r),a=this.scrollToCenter?s:Math.min(n.top,s),u=i>=t.scroll.left+t.width-l,c=i<=t.scroll.left+l,h=o>=t.scroll.top+t.height-a,f=o<=t.scroll.top+a,d=t.scroll.left,m=t.scroll.top;return u?d=i-t.width+l:c&&(d=i-l),h?m=o-t.height+a:f&&(m=o-a),{left:d,top:m}},w.prototype._getScrollToFullChildView=function(t,e,n){var i,o,r,s,l=null,a=null,u=t.width>=e.width,c=t.height>=e.height,h=m.positionUtils.calcRelativePosition(e,t);return u&&(i=t.width-e.width,o=Math.min(n.left,i),this.scrollToCenter&&(o=i/2),h.left<o?l=Math.round(t.scroll.left+h.left-o):h.right<o&&(l=Math.round(t.scroll.left+Math.min(h.left,-h.right)+o))),c&&(r=t.height-e.height,s=Math.min(n.top,r),this.scrollToCenter&&(s=r/2),h.top<s?a=Math.round(t.scroll.top+h.top-s):h.bottom<s&&(a=Math.round(t.scroll.top+Math.min(h.top,-h.bottom)+s))),{left:l,top:a}},w._getChildPoint=function(t,e,n){return{x:e.left-t.left+t.scroll.left+e.border.left+n.x,y:e.top-t.top+t.scroll.top+e.border.top+n.y}},w.prototype._getScrollPosition=function(t,e,n,i){var o=w._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)}},w._getChildPointAfterScroll=function(t,e,n,i){return{x:Math.round(e.left+t.scroll.left-n.left+i.x),y:Math.round(e.top+t.scroll.top-n.top+i.y)}},w.prototype._isChildFullyVisible=function(t,e,n){var i=w._getChildPointAfterScroll(t,e,t.scroll,n),o=i.x,r=i.y,s=this._getScrollPosition(t,e,n,{left:0,top:0}),l=s.left,a=s.top;return!this._isTargetElementObscuredInPoint(o,r)&&l===t.scroll.left&&a===t.scroll.top},w.prototype._scrollToChild=function(t,e,n){for(var i=m.positionUtils.getClientDimensions(t),o=m.positionUtils.getClientDimensions(e),r=m.styleUtils.getInnerWidth(Ga),s=m.styleUtils.getInnerHeight(Ga),l=i.scroll,a=!this._isChildFullyVisible(i,o,n);a;){l=this._getScrollPosition(i,o,n,this.maxScrollMargin);var u=w._getChildPointAfterScroll(i,o,l,n),c=u.x,h=u.y,f=this._isTargetElementObscuredInPoint(c,h);this.maxScrollMargin.left+=20,this.maxScrollMargin.left>=r&&(this.maxScrollMargin.left=50,this.maxScrollMargin.top+=20),a=f&&this.maxScrollMargin.top<s}return this.maxScrollMargin={left:50,top:50},this._setScroll(t,l)},w.prototype._scrollElement=function(){if(!m.styleUtils.hasScroll(this.element))return P.resolve();var t=m.positionUtils.getClientDimensions(this.element),e=this._getScrollToPoint(t,{x:this.offsetX,y:this.offsetY},this.maxScrollMargin);return this._setScroll(this.element,e)},w.prototype._scrollParents=function(){var e,n,i=this,o=m.styleUtils.getScrollableParents(this.element),r=this.element,s=this.offsetX-Math.round(m.styleUtils.getScrollLeft(r)),l=this.offsetY-Math.round(m.styleUtils.getScrollTop(r));return m.promiseUtils.times(o.length,function(t){return i._scrollToChild(o[t],r,{x:s,y:l}).then(function(){e=m.positionUtils.getClientDimensions(r),n=m.positionUtils.getClientDimensions(o[t]),s+=e.left-n.left+n.border.left,l+=e.top-n.top+n.border.top,r=o[t]})}).then(function(){return b(Ga)&&!i.skipParentFrames?m.sendRequestToFrame({cmd:_,offsetX:s,offsetY:l,maxScrollMargin:i.maxScrollMargin},C,Ga.parent):P.resolve()})},w._getFixedAncestorOrSelf=function(t){return m.domUtils.findParent(t,!0,m.styleUtils.isFixedElement)},w.prototype._isTargetElementObscuredInPoint=function(t,e){var n=m.positionUtils.getElementFromPoint(t,e);if(!n)return!1;var i=w._getFixedAncestorOrSelf(n);return i&&!i.contains(this.element)},w.prototype.run=function(){var t=this;return this._scrollElement().then(function(){return t._scrollParents()}).then(function(){return t.scrollWasPerformed})},w);function w(t,e){this.element=t,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.scrollToCenter=e.scrollToCenter,this.skipParentFrames=e.skipParentFrames,this.raiseEvents=e.raiseEvents,this.maxScrollMargin={left:50,top:50},this.scrollWasPerformed=!1}var T=function(t,e){return(T=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 M(t,e){function n(){this.constructor=t}T(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function U(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 D(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 I=h.utils.browser;function k(t,e,n){var i=I.isFirefox?Math.ceil:Math.round,o=m.positionUtils.getOffsetPosition(t,i);return{x:(t===za.documentElement?0:o.left)+e,y:(t===za.documentElement?0:o.top)+n}}function B(t){if(!t)return null;var e=Ga.screenLeft||Ga.screenX,n=Ga.screenTop||Ga.screenY;return{x:e+t.x,y:n+t.y}}function N(t){var e=t/2;return e<1?0:Math.round(e)}function O(t){var e=m.positionUtils.getElementRectangle(t);return{offsetX:N(e.width),offsetY:N(e.height)}}function F(t,e,n){var i=O(t);if(e="number"==typeof e?Math.round(e):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<e&&0<n)return{offsetX:e,offsetY:n};var o=m.positionUtils.getClientDimensions(t),r=Math.round(Math.max(t.scrollWidth,o.width)),s=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+r,a=o.scrollbar.bottom+o.border.top+o.border.bottom+s;return{offsetX:e<0?l+e:e,offsetY:n<0?a+n:n}}var Y=y.domUtils,L=b(Ga)?o.iframeCursorUI:o.cursorUI,K={x:-1,y:-1,currentActiveWindow:Ga.top,_ensureActiveWindow:function(){var t;this.currentActiveWindow!==Ga&&this.currentActiveWindow!==Ga.parent&&((t=Y.findIframeByWindow(this.currentActiveWindow))&&Y.isElementInDocument(t)||(this.currentActiveWindow=Ga))},get active(){return this._ensureActiveWindow(),this.currentActiveWindow===Ga},set activeWindow(t){this.currentActiveWindow=t},get activeWindow(){return this._ensureActiveWindow(),this.currentActiveWindow},get position(){return{x:this.x,y:this.y}},get visible(){return!b(Ga)&&L.isVisible()},move:function(t,e){return this.x=t,this.y=e,L.move(this.x,this.y)},hide:function(){this.visible&&L.hide()},show:function(){b(Ga)||L.show()},leftButtonDown:function(){return L.leftButtonDown()},rightButtonDown:function(){return L.rightButtonDown()},buttonUp:function(){return L.buttonUp()}},X=h.utils.browser,V=h.Promise,R=h.nativeMethods,W=y.positionUtils,H=y.domUtils;function G(t,e,n){var i=null;return o.hide(n).then(function(){return i=W.getElementFromPoint(t,e),o.show(n)}).then(function(){return i})}function z(t,e,n){var i=W.getElementFromPoint(t,e),o=H.containsElement(n,i)&&R.nodeTextContentGetter.call(i).length;return i&&i===n||o?i:null}function q(t,e){if(!e||!H.isDomElement(e)||!t||t===e)return t;if("tref"===H.getTagName(e))return e;var n,i,o,r="area"===H.getTagName(e)&&H.isImgElement(t);if(X.isFirefox&&r)return n=t,i=e,(o=H.closest(i,"map"))&&o.name===n.useMap.substring(1)?i:n;var s=H.isAnchorElement(e)||H.getParents(e,"a").length,l=s&&H.containsElement(e,t)&&R.nodeTextContentGetter.call(t).length;if(!s||l||!R.nodeTextContentGetter.call(e).length)return t;var a=e.getBoundingClientRect();return z(a.right-1,a.top+1,e)||z(a.left+1,a.bottom-1,e)||t}function j(n,i,o){var r=null;return G(n,i).then(function(t){r=t;var e=V.resolve(t);return!r&&b(Ga)&&0<n&&0<i&&(e=e.then(function(){return G(n,i,!0)}).then(function(t){return r=t})),e.then(function(t){return q(t,o)}).then(function(t){return{element:t,corrected:t!==r}})})}function $(){var t=K.position;return j(t.x,t.y).then(function(t){return t.element})}var Z={elementIsInvisibleError:"elementIsInvisibleError",foundElementIsNotTarget:"foundElementIsNotTarget"},J=(Object.defineProperty(Q.prototype,"mouseActionStepDelay",{get:function(){return 1===this.speedFactor?10:400*(1-this.speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"keyActionStepDelay",{get:function(){return 1===this.speedFactor?10:200*(1-this.speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this.speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this.speedFactor)/4},enumerable:!1,configurable:!0}),Q);function Q(t){this.speedFactor=t||1}var tt=(et.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},et.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t)for(var i=this._getAssignableProperties(),o=0;o<i.length;o++){for(var r,s=i[o],l=s.name,a=s.type,u=s.required,c=s.init,h=s.defaultValue,f=l.split("."),d=f.length-1,m=f[d],p=t,v=this,g=0;g<d&&p&&v;g++)p=p[f[g]],v=v[f[g]];v&&"defaultValue"in i[o]&&(v[l]=h),p&&v&&(void 0===(r=p[m])&&!u||(e&&a&&a(l,r),v[m]=c?c(l,r,n):r))}},et);function et(){}function nt(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 it(t){this.code=t,this.isTestCafeError=!0,this.callsite=null}var ot,rt,st,lt="E1",at="E4",ut="E5",ct="E9",ht="E10",ft="E11",dt="E12",mt="E24",pt="E26",vt="E27",gt="E28",Et="E29",yt="E30",St="E31",bt="E32",Pt="E33",xt="E34",_t="E35",Ct="E36",At="E37",wt="E39",Tt="E40",Mt="E41",Ut="E42",Dt="E43",It="E44",kt="E45",Bt="E46",Nt="E49",Ot="E50",Ft="E51",Yt="E52",Lt="E57",Kt="E64",Xt="E65",Vt="E68",Rt="E69",Wt="E70",Ht="E71",Gt="E72",zt="E73",qt="E74",jt="E76",$t="E77",Zt="E78",Jt="E82",Qt="E83",te=(M(ee,ot=it),ee);function ee(t,e,n){var i=ot.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function ne(t){var e=rt.call(this,Nt)||this;return e.instantiationCallsiteName=t,e}function ie(t){var e=st.call(this,Ot)||this;return e.instantiationCallsiteName=t,e}M(ne,rt=it),M(ie,st=it);var oe,re,se,le,ae,ue,ce,he,fe=(M(de,oe=it),de);function de(t,e){var n=e.apiFnChain,i=e.apiFnIndex,o=oe.call(this,t)||this;return o.apiFnChain=n,o.apiFnIndex=i,o}function me(){return re.call(this,Ft)||this}function pe(t,e){var n=se.call(this,Yt,e)||this;return n.callsite=t,n}function ve(t,e){var n=le.call(this,lt)||this;return n.errStack=t,n.pageDestUrl=e,n}function ge(t,e){var n=ae.call(this,at)||this;return n.errMsg=String(e),n.instantiationCallsiteName=t,n}function Ee(t,e,n){var i=ue.call(this,ut,e,n)||this;return i.errMsg=String(e),i.property=n,i.instantiationCallsiteName=t,i}function ye(t){var e=ce.call(this,Kt)||this;return e.errMsg=String(t),e}function Se(t,e){var n=he.call(this,Xt)||this;return n.errMsg=String(t),n.moduleName=e,n}M(me,re=it),M(pe,se=fe),M(ve,le=it),M(ge,ae=it),M(Ee,ue=it),M(ye,ce=it),M(Se,he=it);var be,Pe=(M(xe,be=te),xe);function xe(t,e){return be.call(this,ct,t,e)||this}var _e,Ce=(M(Ae,_e=te),Ae);function Ae(t,e){return _e.call(this,ht,t,e)||this}var we,Te=(M(Me,we=te),Me);function Me(t,e){return we.call(this,ft,t,e)||this}var Ue,De,Ie,ke,Be,Ne,Oe,Fe,Ye,Le,Ke,Xe,Ve,Re,We,He,Ge,ze,qe,je,$e,Ze,Je,Qe,tn,en,nn,on,rn,sn,ln,an,un,cn,hn,fn=(M(dn,Ue=te),dn);function dn(t,e){return Ue.call(this,dt,t,e)||this}function mn(t){return De.call(this,mt,t)||this}function pn(){return Ie.call(this,pt)||this}function vn(t){var e=ke.call(this,vt)||this;return e.nodeDescription=t,e}function gn(t,e){var n=Be.call(this,gt,e)||this;return n.argumentName=t,n}function En(t){var e=Ne.call(this,Et)||this;return e.argumentName=t,e}function yn(t,e){var n=Oe.call(this,yt)||this;return n.argumentName=t,n.nodeDescription=e,n}function Sn(){return Fe.call(this,St)||this}function bn(){return Ye.call(this,bt)||this}function Pn(t){var e=Le.call(this,Pt)||this;return e.argumentName=t,e}function xn(){return Ke.call(this,_t)||this}function _n(t){var e=Xe.call(this,Ct)||this;return e.argumentName=t,e}function Cn(t,e){var n=Ve.call(this,At)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function An(){return Re.call(this,xt)||this}function wn(t,e){var n=We.call(this,Mt)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function Tn(t,e){var n=He.call(this,Lt)||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 Mn(){return Ge.call(this,Tt)||this}function Un(){return ze.call(this,wt)||this}function Dn(){return qe.call(this,Ut)||this}function In(){return je.call(this,Rt)||this}function kn(){return $e.call(this,Vt)||this}function Bn(){return Ze.call(this,Wt)||this}function Nn(){return Je.call(this,Ht)||this}function On(){return Qe.call(this,zt)||this}function Fn(){return tn.call(this,Jt)||this}function Yn(t){var e=en.call(this,Zt)||this;return e.errMsg=t,e}function Ln(){return nn.call(this,qt)||this}function Kn(){return on.call(this,jt)||this}function Xn(){return rn.call(this,$t)||this}function Vn(){return sn.call(this,Gt)||this}function Rn(){return ln.call(this,Qt)||this}function Wn(){return an.call(this,Dt)||this}function Hn(){return un.call(this,It)||this}function Gn(t,e){var n=cn.call(this,kt)||this;return n.dialogType=t,n.pageUrl=e,n}function zn(t,e,n){var i=hn.call(this,Bt)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}M(mn,De=fe),M(pn,Ie=it),M(vn,ke=it),M(gn,Be=fe),M(En,Ne=it),M(yn,Oe=it),M(Sn,Fe=it),M(bn,Ye=it),M(Pn,Le=it),M(xn,Ke=it),M(_n,Xe=it),M(Cn,Ve=it),M(An,Re=it),M(wn,We=it),M(Tn,He=it),M(Mn,Ge=it),M(Un,ze=it),M(Dn,qe=it),M(In,je=it),M(kn,$e=it),M(Bn,Ze=it),M(Nn,Je=it),M(On,Qe=it),M(Fn,tn=it),M(Yn,en=it),M(Ln,nn=it),M(Kn,on=it),M(Xn,rn=it),M(Vn,sn=it),M(Rn,ln=it),M(Wn,an=it),M(Hn,un=it),M(Gn,cn=it),M(zn,hn=it);var qn,jn,$n,Zn,Jn,Qn=nt(Pe),ti=(jn=nt(qn=Ce),function(t,e){if(jn(t,e),e<0)throw new qn(t,e)}),ei=($n=Te,function(t,e){var n=typeof e;if("boolean"!=n)throw new $n(t,n)}),ni=(Zn=fn,function(t,e){var n=typeof e;if("number"!=n)throw new Zn(t,n);if(isNaN(e)||e<.01||1<e)throw new Zn(t,e)}),ii=(M(oi,Jn=tt),oi.prototype._getAssignableProperties=function(){return[{name:"speed",type:ni}]},oi);function oi(t,e){var n=Jn.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var ri,si=(M(li,ri=ii),li.prototype._getAssignableProperties=function(){return ri.prototype._getAssignableProperties.call(this).concat([{name:"offsetX",type:Qn},{name:"offsetY",type:Qn}])},li);function li(t,e){var n=ri.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var ai,ui,ci=(M(hi,ai=si),hi.prototype._getAssignableProperties=function(){return ai.prototype._getAssignableProperties.call(this).concat([{name:"scrollToCenter",type:ei},{name:"skipParentFrames",type:ei}])},hi);function hi(t,e){var n=ai.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}function fi(t,e){var n=ui.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}M(fi,ui=ii),fi.prototype._getAssignableProperties=function(){return ui.prototype._getAssignableProperties.call(this).concat([{name:"scrollTargetX",type:Qn},{name:"scrollTargetY",type:Qn},{name:"crop.left",type:Qn},{name:"crop.right",type:Qn},{name:"crop.top",type:Qn},{name:"crop.bottom",type:Qn},{name:"includeMargins",type:ei},{name:"includeBorders",type:ei},{name:"includePaddings",type:ei}])};var di,mi=(M(pi,di=si),pi.prototype._getAssignableProperties=function(){return di.prototype._getAssignableProperties.call(this).concat([{name:"modifiers.ctrl",type:ei},{name:"modifiers.alt",type:ei},{name:"modifiers.shift",type:ei},{name:"modifiers.meta",type:ei}])},pi);function pi(t,e){var n=di.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var vi,gi=(M(Ei,vi=mi),Ei.prototype._getAssignableProperties=function(){return vi.prototype._getAssignableProperties.call(this).concat([{name:"caretPos",type:ti}])},Ei);function Ei(t,e){var n=vi.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var yi,Si=(M(bi,yi=mi),bi.prototype._getAssignableProperties=function(){return yi.prototype._getAssignableProperties.call(this).concat([{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:ei},{name:"skipDefaultDragBehavior",type:ei}])},bi);function bi(t,e){var n=yi.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 Pi,xi,_i,Ci,Ai=(M(wi,Pi=gi),wi.prototype._getAssignableProperties=function(){return Pi.prototype._getAssignableProperties.call(this).concat([{name:"replace",type:ei},{name:"paste",type:ei}])},wi);function wi(t,e){var n=Pi.call(this)||this;return n.replace=!1,n.paste=!1,n._assignFrom(t,e),n}function Ti(t,e){var n=xi.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function Mi(t,e){var n=_i.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function Ui(t,e){var n=Ci.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function Di(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ii(t,e,n){for(var i,o=[],r=[{x1:n.left,y1:n.top,x2:n.left,y2:n.bottom,isHorizontal:!1},{x1:n.right,y1:n.top,x2:n.right,y2:n.bottom,isHorizontal:!1},{x1:n.left,y1:n.top,x2:n.right,y2:n.top,isHorizontal:!0},{x1:n.left,y1:n.bottom,x2:n.right,y2:n.bottom,isHorizontal:!0}],s=0;s<r.length;s++)(i=function(t,e,n){var i;if(n.isHorizontal)return(i=m.positionUtils.getLineXByYCoord(t,e,n.y1))&&i>=n.x1&&i<=n.x2?{x:i,y:n.y1}:null;var o=m.positionUtils.getLineYByXCoord(t,e,n.x1);return o&&o>=n.y1&&o<=n.y2?{x:n.x1,y:o}:null}(t,e,r[s]))&&o.push(i);return o.length?1===o.length||Di(t,o[0])<Di(t,o[1])?o[0]:o[1]:null}M(Ti,xi=mi),Ti.prototype._getAssignableProperties=function(){return xi.prototype._getAssignableProperties.call(this).concat([{name:"destinationOffsetX",type:Qn},{name:"destinationOffsetY",type:Qn}])},M(Mi,_i=tt),Mi.prototype._getAssignableProperties=function(){return[{name:"portraitOrientation",type:ei}]},M(Ui,Ci=tt),Ui.prototype._getAssignableProperties=function(){return[{name:"timeout",type:ti},{name:"allowUnawaitedPromise",type:ei}]};var ki=h.Promise,Bi=h.nativeMethods;function Ni(){return new ki(function(t){return Bi.setTimeout.call(Ga,t,0)})}var Oi=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},Fi=h.utils.browser,Yi=(Li.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},Li.prototype.leaveElement=function(){},Li.prototype.move=function(){},Li.prototype.enterElement=function(){},Li.prototype.dragAndDrop=function(){},Li.prototype.teardown=function(){},Li.prototype.run=function(t,e,n,i,o){var r=e&&m.domUtils.isElementInDocument(e),s=e&&m.domUtils.isElementInIframe(e)&&!m.domUtils.getIframeByElement(e);r&&!s||(e=null);var l=t!==e,a=l?m.domUtils.getCommonAncestor(t,e):null;this.setup(),l&&e&&this.leaveElement(t,e,a,n),Fi.isIE&&this.move(t,n),l&&m.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),Fi.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}},Li);function Li(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var Ki=h.eventSandbox.eventSimulator,Xi=h.utils.extend,Vi=h.nativeMethods,Ri=(Wi.leaveElement=function(t,e,n,i){Ki.mouseout(e,Xi({relatedTarget:t},i));for(var o=e;o&&o!==n;)Ki.mouseleave(o,Xi({relatedTarget:t},i)),o=Vi.nodeParentNodeGetter.call(o)},Wi.enterElement=function(t,e,n,i){Ki.mouseover(t,Xi({relatedTarget:e},i));for(var o=t,r=[];o&&o!==n;)r.push(o),o=m.domUtils.getParentExceptShadowRoot(o);for(var s=r.length-1;-1<s;s--)Ki.mouseenter(r[s],Xi({relatedTarget:e},i))},Wi.move=function(t,e,n){Ki[t](e,n)},Wi);function Wi(){}var Hi=(Gi.dragAndDrop=function(t,e,n,i){return Ki.drag(t,i),e!==n&&(m.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,Ki.dragenter(e,i)),n&&(i.relatedTarget=e,Ki.dragleave(n,i))),!Ki.dragover(e,i)},Gi);function Gi(){}var zi,qi=h.eventSandbox.eventSimulator,ji=(M($i,zi=Yi),$i.prototype.leaveElement=function(t,e,n,i){Ri.leaveElement(t,e,n,i)},$i.prototype.enterElement=function(t,e,n,i){Ri.enterElement(t,e,n,i)},$i.prototype.move=function(t,e){this._needEmulateMoveEvent()&&Ri.move(this.moveEvent,t,e)},$i.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&m.domUtils.isElementInDocument(t)&&t!==n&&qi[this.moveEvent](t,e)},$i.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},$i);function $i(t){var e=zi.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var Zi,Ji=(M(Qi,Zi=Yi),Qi.prototype.setup=function(){Zi.prototype.setup.call(this),this.dragAndDropMode=!0},Qi.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=Hi.dragAndDrop(t,e,n,i)},Qi);function Qi(){return null!==Zi&&Zi.apply(this,arguments)||this}var to,eo=h.eventSandbox.eventSimulator,no=(M(io,to=Yi),io.prototype.setup=function(){to.prototype.setup.call(this),this.dragAndDropMode=!0},io.prototype.leaveElement=function(t,e,n,i){Ri.leaveElement(t,e,n,i)},io.prototype.move=function(t,e){Ri.move(this.moveEvent,t,e)},io.prototype.enterElement=function(t,e,n,i){Ri.enterElement(t,e,n,i)},io.prototype.dragAndDrop=function(t,e,n,i,o){var r=eo.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=Hi.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},io.prototype.run=function(t,e,n,i,o){return to.prototype.run.call(this,t,null,n,i,o)},io);function io(){return null!==to&&to.apply(this,arguments)||this}var oo=null,ro=function(){return oo},so=function(t){oo=t},lo=h.Promise,ao=h.nativeMethods,uo=h.utils.featureDetection,co=h.utils.html,ho=h.utils.url,fo=h.eventSandbox.eventSimulator,mo=h.eventSandbox.message,po=h.eventSandbox.DataTransfer,vo=h.eventSandbox.DragDataStore,go=y.positionUtils,Eo=y.domUtils,yo=y.styleUtils,So=y.eventUtils,bo=y.promiseUtils,Po=y.sendRequestToFrame,xo="automation|move|request",_o="automation|move|response";mo.on(mo.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===xo&&(t.source.parent===Ga?Co.onMoveToIframeRequest(t):(h.on(h.EVENTS.beforeUnload,function(){return mo.sendServiceMsg({cmd:_o},t.source)}),Co.onMoveOutRequest(t)))});var Co=(Ao.getTarget=function(t,e,n){var i=!go.containsOffset(t,e,n),o=i?k(t,e,n):{x:e,y:n};return{element:i?za.documentElement:t,offsetX:o.x,offsetY:o.y}},Ao.onMoveToIframeRequest=function(t){var e={x:t.message.endX,y:t.message.endY},n=t.source,i=Eo.findIframeByWindow(n),o=yo.getBordersWidth(i),r=yo.getElementPadding(i),s=go.getIframeClientCoordinates(i),l=go.getIframePointRelativeToParentFrame(e,n),a=K.position,u=go.isInRectangle(a,s)?a:Ii(a,l,s),c={x:u.x-s.left,y:u.y-s.top},h=new Ao(i,new Si({modifiers:t.message.modifiers,offsetX:c.x+o.left+r.left,offsetY:c.y+o.top+r.top,speed:t.message.speed,skipScrolling:!0},!1)),f={cmd:_o,x:c.x,y:c.y};K.activeWindow!==n?h.run().then(function(){K.activeWindow=n,mo.sendServiceMsg(f,n)}):mo.sendServiceMsg(f,n)},Ao.onMoveOutRequest=function(t){var e=t.source,n={left:t.message.left,right:t.message.right,top:t.message.top,bottom:t.message.bottom};if(!t.message.iframeUnderCursor){var i=t.message,o=i.startX,r=i.startY,s=o-n.left,l=r-n.top,a=ro();return a&&(fo.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),fo.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),void mo.sendServiceMsg({cmd:_o},e)}var u,c=K.position,h=Ii({x:n.left+c.x,y:n.top+c.y},{x:t.message.endX,y:t.message.endY},n);h?(u=new Si({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),new Ao(za.documentElement,u).run().then(function(){var t={cmd:_o,x:h.x,y:h.y};K.activeWindow=e,mo.sendServiceMsg(t,e)})):mo.sendServiceMsg({cmd:_o,x:n.left,y:n.top},e)},Ao.prototype._getTargetClientPoint=function(){var t=yo.getElementScroll(this.element);if(Eo.isHtmlElement(this.element))return{x:Math.floor(this.offsetX-t.left),y:Math.floor(this.offsetY-t.top)};var e=go.getClientPosition(this.element),n=this.element.tagName&&Eo.isBodyElement(this.element);return{x:Math.floor(n?e.x+this.offsetX:e.x+this.offsetX-t.left),y:Math.floor(n?e.y+this.offsetY:e.y+this.offsetY-t.top)}},Ao.prototype._emulateEvents=function(t){var e,n,i=this.holdLeftButton?So.BUTTONS_PARAMETER.leftButton:So.BUTTONS_PARAMETER.noButton,o=B({x:this.x,y:this.y}),r={clientX:this.x,clientY:this.y,screenX:o.x,screenY:o.y,buttons:i,ctrl:this.modifiers.ctrl,alt:this.modifiers.alt,shift:this.modifiers.shift,meta:this.modifiers.meta,dataTransfer:this.dragAndDropState.dataTransfer},s={moveEvent:this.moveEvent,holdLeftButton:this.holdLeftButton},l=(e=this.dragAndDropState.enabled,n=this.firstMovingStepOccured,new(e?n?Ji:no:ji)(s).run(t,ro(),r,this.dragElement,this.dragAndDropState.dataStore)),a=l.dragAndDropMode,u=l.dropAllowed;this.firstMovingStepOccured=!0,this.dragAndDropState.enabled=a,this.dragAndDropState.dropAllowed=u,so(t)},Ao.prototype._movingStep=function(){var t,n=this;return this.touchMode&&!this.holdLeftButton?(this.x=this.endPoint.x,this.y=this.endPoint.y):this.startTime?(t=(Math.min(ao.dateNow(),this.endTime)-this.startTime)/(this.endTime-this.startTime),this.x=Math.floor(this.startPoint.x+this.distanceX*t),this.y=Math.floor(this.startPoint.y+this.distanceY*t)):(this.startTime=ao.dateNow(),this.endTime=this.startTime+this.movingTime,this.x+=0<this.distanceX?1:-1,this.y+=0<this.distanceY?1:-1),K.move(this.x,this.y).then($).then(function(t){var e=n.holdLeftButton&&n.touchMode?n.dragElement:t;return e?n._emulateEvents(e):null}).then(Ni)},Ao.prototype._isMovingFinished=function(){return this.x===this.endPoint.x&&this.y===this.endPoint.y},Ao.prototype._move=function(){var t=this;return this.startPoint=K.position,this.x=this.startPoint.x,this.y=this.startPoint.y,this.distanceX=this.endPoint.x-this.startPoint.x,this.distanceY=this.endPoint.y-this.startPoint.y,this.movingTime=Math.max(Math.abs(this.distanceX),Math.abs(this.distanceY))/this.cursorSpeed,this.minMovingTime&&(this.movingTime=Math.max(this.movingTime,this.minMovingTime)),bo.whilst(function(){return!t._isMovingFinished()},function(){return t._movingStep()})},Ao.prototype._scroll=function(){if(this.skipScrolling)return lo.resolve();var t=new ci({offsetX:this.offsetX,offsetY:this.offsetY},!1);return new A(this.element,t).run()},Ao.prototype._moveToCurrentFrame=function(){if(K.active)return lo.resolve();var t,e=K.position,n=e.x,i=e.y,o=K.activeWindow,r=null,s=null,l={cmd:xo,startX:n,startY:i,endX:this.endPoint.x,endY:this.endPoint.y,modifiers:this.modifiers,speed:this.speed};return o.parent===Ga&&(r=Eo.findIframeByWindow(o),t=go.getIframeClientCoordinates(r),l.left=t.left,l.top=t.top,l.right=t.right,l.bottom=t.bottom),$().then(function(t){return s=t===r,o.parent===Ga&&(l.iframeUnderCursor=s),Po(l,_o,o)}).then(function(t){return K.activeWindow=Ga,s||b(Ga)?K.move(t.x,t.y):null})},Ao.prototype.run=function(){var l=this;return $().then(function(t){l.dragElement=l.holdLeftButton?t:null;var e,n,i,o,r,s=function(t){for(var e=t;e;){if(e.draggable)return e;e=ao.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&uo.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new vo,l.dragAndDropState.dataTransfer=new po(l.dragAndDropState.dataStore),((e=Eo.isAnchorElement(l.dragElement))||Eo.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=ho.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=co.cleanUpHtml(ao.elementOuterHTMLGetter.call(l.dragElement)),l.dragAndDropState.dataTransfer.setData("text/plain",o),l.dragAndDropState.dataTransfer.setData("text/uri-list",o),l.dragAndDropState.dataTransfer.setData("text/html",r))),l._scroll()}).then(function(){var t=l._getTargetClientPoint(),e=t.x,n=t.y,i=yo.getWidth(Ga),o=yo.getHeight(Ga);return 0<=e&&e<=i&&0<=n&&n<=o?(l.endPoint={x:e,y:n},l._moveToCurrentFrame().then(function(){return l._move()})):null}).then(function(){return l.dragAndDropState})},Ao);function Ao(t,e){this.touchMode=uo.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.holdLeftButton=e.holdLeftButton,this.dragElement=null,this.dragAndDropState=new Oi,this.automationSettings=new J(e.speed);var n=Ao.getTarget(t,e.offsetX,e.offsetY);this.element=n.element,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=e.speed,this.cursorSpeed=this.holdLeftButton?this.automationSettings.draggingSpeed:this.automationSettings.cursorSpeed,this.minMovingTime=e.minMovingTime||null,this.modifiers=e.modifiers||{},this.skipScrolling=e.skipScrolling,this.skipDefaultDragBehavior=e.skipDefaultDragBehavior,this.endPoint=null,this.movingTime=null,this.x=null,this.y=null,this.startTime=null,this.endTime=null,this.distanceX=null,this.distanceY=null,this.firstMovingStepOccured=!1}var wo,To=h.utils.extend,Mo=function(t){var e=t.element,n=void 0===e?null:e,i=t.clientPoint,o=void 0===i?null:i,r=t.screenPoint,s=void 0===r?null:r,l=t.isTarget,a=void 0!==l&&l,u=t.inMoving,c=void 0!==u&&u;this.element=n,this.clientPoint=o,this.screenPoint=s,this.isTarget=a,this.inMoving=c,this.devicePoint=B(o)},Uo=(M(Do,wo=m.serviceUtils.EventEmitter),Do.prototype._getElementForEvent=function(t){var e=t.point;return j(e.x,e.y,m.positionUtils.containsOffset(this.element,this.options.offsetX,this.options.offsetY)?this.element:null).then(function(t){return t.element})},Do.prototype._moveToElement=function(){var t=this,e=new Si(To({skipScrolling:!0},this.options),!1);return new Co(this.element,e).run().then(function(){return m.delay(t.automationSettings.mouseActionStepDelay)})},Do.prototype._scrollToElement=function(){var s=this,t=new ci(this.options),e=new A(this.element,t),l=!1;return e.run().then(function(t){return l=t,m.delay(s.automationSettings.mouseActionStepDelay)}).then($).then(function(t){if(!t||!m.domUtils.contains(s.element,t)||!l)return null;var e=ro(),n=m.domUtils.getCommonAncestor(t,e),i=m.positionUtils.getClientPosition(t),o=B({x:i.x,y:i.y}),r={clientX:i.x,clientY:i.y,screenX:o.x,screenY:o.y,ctrl:!1,alt:!1,shift:!1,meta:!1,buttons:m.eventUtils.BUTTONS_PARAMETER.leftButton};return Ri.leaveElement(t,e,n,r),Ri.enterElement(t,e,n,r),so(t),l})},Do.prototype._getElementOffset=function(){var t=F(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}},Do.prototype._wrapAction=function(t){var h=this,e=this._getElementOffset(),i=e.offsetX,o=e.offsetY,f=k(this.element,i,o),d=m.positionUtils.getClientPosition(this.element);return t().then(function(){var t,e,n,l=k(h.element,i,o),a=m.positionUtils.getClientPosition(h.element),u=(t=h.element,e=l,n=m.styleUtils.getElementScroll(t),!/html/i.test(t.tagName)&&m.styleUtils.hasScroll(t)&&(e.x-=n.left,e.y-=n.top),m.positionUtils.offsetToClientCoords(e)),c=m.positionUtils.containsOffset(h.element,i,o)?h.element:null;return j(u.x,u.y,c).then(function(t){var e=t.element,n=t.corrected,i=e;if(!i)return new Mo({});var o=(o=!c||n||i===h.element)||-1<m.arrayUtils.indexOf(m.domUtils.getParents(i),h.element),r=f.x!==l.x||f.y!==l.y,s=d.x!==a.x||d.y!==a.y;return new Mo({element:e,clientPoint:u,screenPoint:l,isTarget:o,inMoving:r&&s})})})},Do._checkElementState=function(t,e){if(!t.element)throw new Error(Z.elementIsInvisibleError);if(e&&(!t.isTarget||t.inMoving))throw new Error(Z.foundElementIsNotTarget);return t},Do.prototype._ensureElement=function(e,n,i){var o=this;return this._wrapAction(function(){return o._scrollToElement()}).then(function(t){return Do._checkElementState(t,e)}).then(function(t){return i?t:o._wrapAction(function(){return o._moveToElement()})}).then(function(t){return n||Do._checkElementState(t,e),t}).then(function(t){return o.emit(o.TARGET_ELEMENT_FOUND_EVENT,{element:t.element}),{element:t.element,clientPoint:t.clientPoint,screenPoint:t.screenPoint,devicePoint:t.devicePoint}})},Do);function Do(t,e){var n=wo.call(this)||this;return n.TARGET_ELEMENT_FOUND_EVENT="automation|target-element-found-event",n.element=t,n.options=e,n.automationSettings=new J(e.speed),n}var Io=h.Promise,ko=h.eventSandbox.message;function Bo(t,i,e){return new Io(function(n){ko.on(ko.SERVICE_MSG_RECEIVED_EVENT,function t(e){e.message.cmd===i&&(ko.off(ko.SERVICE_MSG_RECEIVED_EVENT,t),n(e.message))}),ko.sendServiceMsg(t,e)})}var No=h.Promise,Oo=h.nativeMethods,Fo=h.utils.browser,Yo=h.eventSandbox.focusBlur,Lo=y.contentEditable,Ko=y.textSelection,Xo=y.domUtils,Vo=y.styleUtils,Ro=h.eventSandbox.message,Wo="automation|iframe|request",Ho="automation|iframe|response";function Go(v,g,E){var t=this;return new No(function(p){return U(t,void 0,void 0,function(){var s,n,i,o,r,l,a,u,c,h,f,d,m;return D(this,function(t){switch(t.label){case 0:return b(Ga)?[4,Bo({cmd:Wo},Ho,Ga.parent)]:[3,2];case 1:t.sent(),t.label=2;case 2:if(s=Xo.getActiveElement(),n=Xo.isTextEditableElement(v),i=Xo.closest(v,"label[for]"),o=Xo.isElementFocusable(v),r=!o&&i,l=Xo.isContentEditableElement(v),a=l?Lo.findContentEditableParent(v):v,g&&Fo.isWebKit&&n&&Ko.select(v,0,0),r)return g&&(e=i,Xo.isElementFocusable(e)?Yo.focus(e,y.noop,!1,!0):qo(e)),p(),[2];if(u=!g,c=!1,!o&&!l){if(h=Xo.findDocument(a),f=Oo.documentActiveElementGetter.call(h),d=Xo.isBodyElement(f),m=Xo.isBodyElement(a)?a:Xo.getFocusableParent(a),f&&!d&&Xo.containsElement(f,a)||d&&Xo.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return Yo.focus(a,function(){var t,e,n,i,o,r;!g||l||v===Xo.getActiveElement()?(t=v,e=E,o=Xo.isTextEditableElement(t),r=Xo.isContentEditableElement(t),o||r?r&&isNaN(parseInt(e,10))?Ko.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?Xo.getElementValue(t).length:e,Ko.select(t,n,n)):(i=Lo.findContentEditableParent(t))&&Ko.setCursorToLastVisiblePosition(Lo.findContentEditableParent(i)),g||Xo.getActiveElement()===s?p():Yo.focus(s,p,!0,!0)):p()},u,!0,!1,c),[2]}var e})})})}function zo(t){var e=Xo.closest(t,"label[for]"),n=e&&(e.control||za.getElementById(e.htmlFor));return n&&Vo.isElementVisible(n)?n:null}function qo(t){var e=zo(t);e&&Xo.getActiveElement()!==e&&Yo.focus(e,y.noop,!1,!0)}Ro.on(Ro.SERVICE_MSG_RECEIVED_EVENT,function(t){var e;t.message.cmd===Wo&&(e=Xo.findIframeByWindow(t.source),Yo.focus(e,function(){Ro.sendServiceMsg({cmd:Ho},t.source)},!1))});var jo=h.utils.browser,$o=h.eventSandbox.eventSimulator,Zo=h.eventSandbox.listeners,Jo=y.domUtils,Qo=y.styleUtils,tr=o.selectElement,er=(nr.prototype.run=function(){this.eventState.clickElement&&$o.click(this.eventState.clickElement,this.eventArgs.options),Jo.isElementFocusable(this.eventArgs.element)||qo(this.eventArgs.element)},nr);function nr(t,e){this.eventState=t,this.eventArgs=e}var ir,or=(M(rr,ir=er),rr.prototype.run=function(){function t(t){n=t.target===e.input}var e=this,n=!1;Zo.addInternalEventBeforeListener(Ga,["focus"],t),ir.prototype.run.call(this),Zo.removeInternalEventBeforeListener(Ga,["focus"],t),Jo.isElementFocusable(this.label)&&!n&&this._ensureBoundElementFocusRaised()},rr.prototype._ensureBoundElementFocusRaised=function(){$o.focus(this.input)},rr);function rr(t,e){var n=ir.call(this,t,e)||this;return n.label=n.eventArgs.element,n.input=zo(n.eventArgs.element),n}var sr,lr=(M(ar,sr=er),ar.prototype.run=function(){sr.prototype.run.call(this),this._toggleSelectOptionList()},ar.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===Qo.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(tr.isOptionListExpanded(t)?tr.collapseOptionList():tr.expandOptionList(t))},ar);function ar(t,e){return sr.call(this,t,e)||this}var ur,cr=(M(hr,ur=er),hr.prototype.run=function(){return this.eventArgs.element},hr);function hr(t,e){return ur.call(this,t,e)||this}var fr,dr=(M(mr,fr=or),mr.prototype.run=function(){function t(){e=!0}var e=!1;Zo.addInternalEventBeforeListener(Ga,["change"],t),fr.prototype.run.call(this),Zo.removeInternalEventBeforeListener(Ga,["change"],t),jo.isChrome&&!e&&this._ensureCheckboxStateChanged()},mr.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,$o.change(this.checkbox)},mr);function mr(t,e){var n=fr.call(this,t,e)||this;return n.checkbox=n.input,n}var pr,vr=h.Promise,gr=h.utils.extend,Er=h.utils.browser,yr=h.utils.featureDetection,Sr=h.eventSandbox.eventSimulator,br=h.eventSandbox.listeners,Pr=y.domUtils,xr=y.eventUtils,_r=y.arrayUtils,Cr=y.delay,Ar=(M(wr,pr=Uo),wr.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,xr.preventDefault(t),xr.unbind(e.element,"mousedown",n)};xr.bind(this.element,"mousedown",n)},wr.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,xr.unbind(t,"blur",n,!0)};xr.bind(t,"blur",n,!0)},wr.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},wr.prototype._raiseTouchEvents=function(t){yr.isTouchDevice&&(this.eventState.touchStartCancelled=!Sr.touchstart(t.element,t.options),this.eventState.touchEndCancelled=!Sr.touchend(t.element,t.options))},wr.prototype._mousedown=function(n){var i=this;return this.targetElementParentNodes=Pr.getParents(n.element),this.mouseDownElement=n.element,K.leftButtonDown().then(function(){i._raiseTouchEvents(n);var t=Pr.getActiveElement();i.activeElementBeforeMouseDown=t;var e=(Er.isWebKit||Er.isIE)&&Pr.isSelectElement(i.mouseDownElement);return e&&i._bindMousedownHandler(),i._bindBlurHandler(t),i._isTouchEventWasCancelled()||(i.eventState.simulateDefaultBehavior=Sr.mousedown(n.element,n.options)),!1===i.eventState.simulateDefaultBehavior&&(i.eventState.simulateDefaultBehavior=e&&!i.eventState.mousedownPrevented),i._ensureActiveElementBlur(t)}).then(function(){return i._focus(n)})},wr.prototype._ensureActiveElementBlur=function(e){var n=this;return new vr(function(t){Pr.getActiveElement()===e||n.eventState.blurRaised?t():Er.isIE&&Er.version<12?Ni().then(function(){n.eventState.blurRaised||Sr.blur(e),t()}):(Sr.blur(e),t())})},wr.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?vr.resolve():Go(Pr.isContentEditableElement(this.element)?this.element:t.element,!Er.isIE||this.activeElementBeforeMouseDown===Pr.getActiveElement(),this.caretPos)},wr._getElementForClick=function(t,e,n){var i=Pr.getParents(e),o=Pr.isTheSameNode(e,t);return Er.isFirefox?o?t:null:o?_r.equals(n,i)?t:null:t.contains(e)&&!Pr.isEditableFormElement(e)?t:e.contains(t)?e:_r.getCommonElement(i,n)},wr.prototype._mouseup=function(i){var o=this;return K.buttonUp().then(function(){return o._getElementForEvent(i)}).then(function(t){i.element=t,o.eventState.clickElement=wr._getElementForClick(o.mouseDownElement,t,o.targetElementParentNodes);var e={},n=function(t){e=t.timeStamp,br.removeInternalEventBeforeListener(Ga,["mouseup"],n)};return Er.isIE||br.addInternalEventBeforeListener(Ga,["mouseup"],n),o._isTouchEventWasCancelled()||Sr.mouseup(t,i.options),{timeStamp:e}})},wr.prototype._click=function(t){var e,n,i,o,r,s,l,a=(e=this.eventState,i=zo((n=t).element),o=Jo.isSelectElement(n.element),r=Jo.isOptionElement(n.element),s=Jo.isLabelElement(n.element)&&i,l=i&&Jo.isCheckboxElement(i),new(o?lr:r?cr:l?dr:s?or:er)(e,n));return this._isTouchEventWasCancelled()||a.run(),t},wr.prototype.run=function(t){var r=this,s=null;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.screenPoint,o=t.devicePoint;return s={point:n,screenPoint:i,element:e,options:gr({clientX:n.x,clientY:n.y,screenX:o.x,screenY:o.y},r.modifiers)},vr.all([Cr(r.automationSettings.mouseActionStepDelay),r._mousedown(s)])}).then(function(){return r._mouseup(s)}).then(function(t){var e=t.timeStamp;return s.options.timeStamp=e,r._click(s)})},wr);function wr(t,e){var n=pr.call(this,t,e)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.targetElementParentNodes=[],n.activeElementBeforeMouseDown=null,n.mouseDownElement=null,n.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null,touchStartCancelled:!1,touchEndCancelled:!1},n}var Tr=h.Promise,Mr=h.utils.browser,Ur=h.utils.featureDetection,Dr=h.eventSandbox.eventSimulator,Ir=h.eventSandbox.focusBlur,kr=h.nativeMethods,Br=y.domUtils,Nr=y.styleUtils,Or=y.delay,Fr=o.selectElement,Yr=Ur.isTouchDevice?0:160,Lr=(Kr.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?Fr.getEmulatedChildElement(this.element):this.element,e=1<Nr.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Mr.isIE&&e?this.parentSelect:t}},Kr.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=O(n=Fr.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=za.documentElement,i=(e=Fr.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},Kr.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Si({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return new Co(n,s).run().then(function(){return Or(e.automationSettings.mouseActionStepDelay)})},Kr.prototype._mousedown=function(){var t=this;return Mr.isFirefox?(Dr.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Mr.isIE?(Dr.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Or(Yr)}).then(function(){Dr.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},Kr.prototype._focus=function(){var e=this;return new Tr(function(t){Ir.focus(e.parentSelect,t,!1,!0)})},Kr.prototype._mouseup=function(){var t=Mr.isIE?this.parentSelect:this.eventsArgs.element;Dr.mouseup(t,this.eventsArgs.options),Mr.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=Mr.isFirefox||Mr.isSafari||Mr.isChrome&&53<=Mr.version,n=e||Mr.isIE;return e&&this.clickCausesChange&&Dr.input(this.parentSelect),n&&this.clickCausesChange&&Dr.change(this.parentSelect),Tr.resolve()},Kr.prototype._click=function(){Dr.click(this.eventsArgs.element,this.eventsArgs.options)},Kr.prototype.run=function(){var t=this;if(!this.parentSelect)return Dr.click(this.eventsArgs.element,this.eventsArgs.options),Tr.resolve();this.optionListExpanded||Fr.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Nr.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()})},Kr);function Kr(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 J(e.speed),this.parentSelect=Br.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&Fr.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=Br.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=Br.getElementIndexInParent(this.parentSelect,this.element),o=kr.nodeParentNodeGetter.call(this.element),r=Br.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 Xr,Vr=h.utils.featureDetection,Rr=h.utils.browser,Wr=h.eventSandbox.eventSimulator,Hr=y.eventUtils,Gr=y.delay,zr=Vr.isTouchDevice?0:160,qr=(M(jr,Xr=Uo),jr.prototype._firstClick=function(t){var e=this,n=new gi(this.options);n.speed=1;var i=new Ar(this.element,n);return i.on(i.TARGET_ELEMENT_FOUND_EVENT,function(t){return e.emit(e.TARGET_ELEMENT_FOUND_EVENT,t)}),i.run(t).then(function(t){return Gr(zr).then(function(){return t})})},jr.prototype._secondClick=function(t){var e=this;Rr.isIE&&Hr.bind(za,"focus",Hr.preventDefault,!0);var n=new gi({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new Ar(za.documentElement,n);return i.run().then(function(t){return e.eventState.dblClickElement=i.eventState.clickElement,Rr.isIE&&Hr.unbind(za,"focus",Hr.preventDefault,!0),t})},jr.prototype._dblClick=function(t){this.eventState.dblClickElement&&Wr.dblclick(this.eventState.dblClickElement,t.options)},jr.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)})},jr);function jr(t,e){var n=Xr.call(this,t,e)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new J(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var $r,Zr=h.Promise,Jr=h.utils.extend,Qr=h.utils.featureDetection,ts=h.eventSandbox.eventSimulator,es=h.eventSandbox.focusBlur,ns=(M(is,$r=Uo),is.prototype._getEndPoint=function(){throw new Error("Not implemented")},is.prototype._mousedown=function(t){var e=this;return K.leftButtonDown().then(function(){return e.simulateDefaultBehavior=ts[e.downEvent](t.element,t.options),e._focus(t)})},is.prototype._focus=function(n){var i=this;return new Zr(function(t){var e=m.domUtils.isContentEditableElement(i.element)?m.contentEditable.findContentEditableParent(i.element):n.element;es.focus(e,t,!1,!0)})},is.prototype._getDestination=function(){throw new Error("Not implemented")},is.prototype._drag=function(){var e=this,t=this._getDestination(),n=t.element,i=t.offsets,o=t.endPoint;this.endPoint=o;var r=new Si({offsetX:i.offsetX,offsetY:i.offsetY,modifiers:this.modifiers,speed:this.speed,minMovingTime:25,holdLeftButton:!0,skipDefaultDragBehavior:!1===this.simulateDefaultBehavior},!1);return new Co(n,r).run().then(function(t){return e.dragAndDropState=t,m.delay(e.automationSettings.mouseActionStepDelay)})},is.prototype._mouseup=function(){var r=this;return K.buttonUp().then(function(){var n=m.positionUtils.offsetToClientCoords(r.endPoint),i=null,o=Jr({clientX:n.x,clientY:n.y},r.modifiers);return j(n.x,n.y).then(function(t){var e=t.element;return(i=e)?(r.dragAndDropState.enabled?(o.dataTransfer=r.dragAndDropState.dataTransfer,r.dragAndDropState.dropAllowed&&ts.drop(i,o),ts.dragend(r.dragAndDropState.element,o),r.dragAndDropState.dataStore.setProtectedMode()):ts[r.upEvent](i,o),j(n.x,n.y)):i}).then(function(t){var e=t.element;i&&e===i&&!r.dragAndDropState.enabled&&ts.click(i,o)})})},is.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:Jr({clientX:n.x,clientY:n.y},o.modifiers)},Zr.all([m.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},is);function is(t,e){var n=$r.call(this,t,e)||this;return n.modifiers=e.modifiers,n.speed=e.speed,n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=Qr.isTouchDevice?"touchstart":"mousedown",n.upEvent=Qr.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var os,rs=y.styleUtils,ss=(M(ls,os=ns),ls.prototype._getDestination=function(){var t=k(this.element,this.offsetX,this.offsetY),e=rs.getWidth(za),n=rs.getHeight(za),i={x:t.x+this.dragOffsetX,y:t.y+this.dragOffsetY},i={x:Math.min(Math.max(0,i.x),e),y:Math.min(Math.max(0,i.y),n)};return{element:za.documentElement,offsets:{offsetX:i.x,offsetY:i.y},endPoint:i}},ls);function ls(t,e,n,i){var o=os.call(this,t,i)||this;return o.dragOffsetX=e,o.dragOffsetY=n,o}var as,us=y.positionUtils,cs=(M(hs,as=ns),hs.prototype._getDestination=function(){var t=this.destinationElement,e=us.getElementRectangle(t),n=F(t,this.destinationOffsetX,this.destinationOffsetY);return{element:t,offsets:n,endPoint:{x:e.left+n.offsetX,y:e.top+n.offsetY}}},hs);function hs(t,e,n){var i=as.call(this,t,n)||this;return i.destinationElement=e,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var fs,ds=(M(ms,fs=Uo),ms.prototype.run=function(t){return this._ensureElement(t,!0)},ms);function ms(t,e){return fs.call(this,t,e)||this}var ps=h.utils.browser,vs=h.sandbox.event,gs=h.eventSandbox.eventSimulator,Es=h.eventSandbox.listeners,ys=h.nativeMethods,Ss=y.domUtils,bs=y.contentEditable,Ps=y.textSelection,xs=/ /g;function _s(t){var e=Ps.getSelectionByElement(t),n=Ps.hasInverseSelectionContentEditable(t);return Ps.hasElementContainsSelection(t)?bs.getSelection(t,e,n):{startPos:bs.calculateNodeAndOffsetByPosition(t,0),endPos:bs.calculateNodeAndOffsetByPosition(t,0)}}function Cs(t){var e=t.startPos.node,n=t.startPos.offset,i=t.endPos.offset,o=bs.getFirstNonWhitespaceSymbolIndex(e.nodeValue),r=bs.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 As(t,e,n){return!n||gs.beforeInput(t,e)}function ws(t,e){var n;function i(t){t.preventDefault(),n=!0}function o(t){"textInput"===t.type&&(n=!1)}ps.isSafari&&(Es.addInternalEventBeforeListener(Ga,["textInput"],i),vs.on(vs.EVENT_PREVENTED_EVENT,o));var r=ps.isFirefox||gs.textInput(t,e)||n;return ps.isSafari&&(Es.removeInternalEventBeforeListener(Ga,["textInput"],i),vs.off(vs.EVENT_PREVENTED_EVENT,o)),r||ps.isIE11}function Ts(t,e){var n,i,o,r,s,l,a,u,c,h,f,d=_s(t),m=d.startPos.node,p=d.endPos.node,v=!0,g=!0,E=e;function y(){g=!1}function S(t,e,n){n()}e=e.replace(xs,String.fromCharCode(160)),m&&p&&Ss.isContentEditableElement(m)&&Ss.isContentEditableElement(p)&&(Ss.isTheSameNode(m,p)||(Ps.deleteSelectionContents(t),n=t,o=(i=d).startPos.node,r=ys.nodeParentNodeGetter.call(o)&&o.parentElement,!(ps.isChrome&&ps.version<58||ps.isSafari)&&r&&Ss.isElementContainsNode(n,o)||(i=_s(n),Ps.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&Ss.isContentEditableElement(m)&&Ss.isRenderedNode(m)&&As(t,e,ps.isChrome)&&(v=ws(t,E),g=v&&!ps.isIE11,Es.addInternalEventBeforeListener(Ga,["input"],y),Es.addInternalEventBeforeListener(Ga,["textinput"],S),(v=v&&As(t,e,ps.isSafari))&&(Ss.isElementNode(m)?(s=m,l=e,c=za.createTextNode(l),h={node:c,offset:l.length},f=ys.nodeParentNodeGetter.call(s),"br"===Ss.getTagName(s)?f.insertBefore(c,s):0<a?(u=ys.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),Ps.selectByNodesAndOffsets(h,h)):function(t,e,n){var i=e.startPos.node;Ss.isElementContainsNode(t,i)||(i=(e=Cs(_s(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),Ps.selectByNodesAndOffsets(l,l)}(t,Cs(d),e)),Ni().then(function(){g&&gs.input(t,e),Es.removeInternalEventBeforeListener(Ga,["input"],y),Es.removeInternalEventBeforeListener(Ga,["textinput"],S)})))}function Ms(t,e,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;Ss.isContentEditableElement(t)&&Ts(t,e),Ss.isElementReadOnly(t)||(Ss.isTextEditableElement(t)?(l=t,a=e,h=Ss.getElementValue(l),f=a.length,d=Ps.getSelectionStart(l),m=Ps.getSelectionEnd(l),p=Ss.isInputElement(l)&&"number"===l.type,As(l,a,ps.isChrome)&&ws(l,a)&&As(l,a,ps.isSafari)&&((u=!ps.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=ps.isIE&&ps.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&ps.isIOS&&"."===h[h.length-1]&&(d+=1),Ss.setElementValue(l,c),Ps.select(l,d+f,d+f)),gs.input(l,a))):Ss.isInputElement(t)&&(i=t,o=e,null!==(r=n)?(s=Ss.getElementValue(i),Ss.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):Ss.setElementValue(i,o),gs.change(i),gs.input(i,o)))}function Us(t){return 1===t.length&&("a"<=t&&t<="z"||"A"<=t&&t<="Z")}var Ds=h.nativeMethods,Is=h.utils.browser,ks=h.eventSandbox.focusBlur,Bs=h.Promise,Ns=m.domUtils.findDocument,Os=m.domUtils.isRadioButtonElement,Fs=m.domUtils.getActiveElement;function Ys(t){return t===t.toLowerCase()?t.toUpperCase():t.toLowerCase()}function Ls(t){var e=Fs(t||za),n=null;if(e&&m.domUtils.isIframeElement(e)&&Ds.contentDocumentGetter.call(e))try{n=Ls(Ds.contentDocumentGetter.call(e))}catch(t){}return n||e}function Ks(t,e,n){if(!Os(e))return t;if(!n&&!e.name&&!Is.isChrome)return[e];var i,o,r=(i=e,o=null,n?""===i.name||Is.isFirefox||(o=function(t){return!t.name||t===i||t.name!==i.name}):""!==i.name?o=function(t){return Os(t)&&t.name===i.name}:Is.isChrome&&(o=function(t){return Os(t)&&!t.name}),o);return r&&(t=m.arrayUtils.filter(t,r)),t}function Xs(t,e,n){var i,o,r,s,l,a=e?-1:1,u=Ks(u=m.domUtils.getFocusableElements(Ns(t),!0),t,n),c=Os(t),h=m.arrayUtils.indexOf(u,t);return(e?0===h:h===u.length-1)?n||!c?za.body:u[u.length-1-h]:e&&-1===h?u[u.length-1]:(o=(i=u)[h+a],r=n,s=Os(o)&&o.name&&!o.checked,l=null,r&&s&&(l=m.arrayUtils.find(i,function(t){return Os(t)&&t.name===o.name&&t.checked})),l||o)}function Vs(t){if(Us(t))return t.toUpperCase().charCodeAt(0);var e=m.KEY_MAPS.shiftMap[t]?m.KEY_MAPS.shiftMap[t].charCodeAt(0):t.charCodeAt(0);return m.KEY_MAPS.symbolCharCodeToKeyCode[e]||e}var Rs={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 Ws(t){return Us(t)?Rs.LETTERS[t.toLowerCase()]:Rs.SYMBOLS[t]||Rs.SPECIAL_KEYS[t]||t}function Hs(t,e,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=t?"":n),"key"in KeyboardEvent.prototype&&(i.key=e),i}var Gs=h.utils.browser,zs=h.utils.extend,qs=h.eventSandbox.eventSimulator,js=($s._isKeyActivatedInputElement=function(t){return m.domUtils.isInputElement(t)&&/button|submit|reset|radio|checkbox/.test(t.type)},$s.prototype._type=function(t,e){var n,i=t!==this.storedActiveElement,o=!i,r=t,s=m.domUtils.isEditableElement(t),l=m.domUtils.isEditableElement(this.storedActiveElement);try{i&&(n=m.domUtils.isElementInIframe(t)===m.domUtils.isElementInIframe(this.storedActiveElement)||l,o=(!Gs.isFirefox||l)&&(!Gs.isWebKit||n))}catch(t){}o&&(!Gs.isIE&&i&&l&&s&&(r=this.storedActiveElement),Ms(r,e))},$s.prototype._addKeyPropertyToEventOptions=function(t){return zs(t,Hs("keypress"===t.type,this.keyProperty,this.keyIdentifierProperty)),t},$s.prototype.down=function(t){this.storedActiveElement=Ls(this.topSameDomainDocument),this.modifierKeyCode&&(t[this.sanitizedKey]=!0),t.shift&&this.isLetter&&(this.keyProperty=Ys(this.keyProperty));var e={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(e),qs.keydown(this.storedActiveElement,zs(e,t))},$s.prototype.press=function(t){if(!this.isChar&&!this.specialKeyCode)return!0;var e=Ls(this.topSameDomainDocument),n=this.isChar?function(t,e){if("space"===t)return" ";if(e){if(Us(t))return Ys(t);if(m.KEY_MAPS.reversedShiftMap[t])return m.KEY_MAPS.reversedShiftMap[t]}return t}(this.sanitizedKey,t.shift):null,i=this.specialKeyCode||n.charCodeAt(0),o=e!==this.storedActiveElement;if(Gs.isWebKit&&o&&m.domUtils.isElementInIframe(e)!==m.domUtils.isElementInIframe(this.storedActiveElement))return!0;this.storedActiveElement=e;var r={keyCode:i,charCode:i,type:"keypress"};this._addKeyPropertyToEventOptions(r);var s=Gs.isAndroid||qs.keypress(e,zs(r,t));if(!s)return s;e=Ls(this.topSameDomainDocument),!n||t.ctrl||t.alt||this._type(e,n);var l=$s._isKeyActivatedInputElement(e),a=m.domUtils.isButtonElement(e),u=Gs.isSafari&&0<=Gs.compareVersions([Gs.webkitVersion,"603.1.30"]);return Gs.isFirefox||u||!l&&!a||"enter"!==this.sanitizedKey||e.click(),s},$s.prototype.up=function(t){this.modifierKeyCode&&(t[this.sanitizedKey]=!1);var e={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(e);var n=qs.keyup(Ls(this.topSameDomainDocument),zs(e,t)),i=Ls(this.topSameDomainDocument);return!Gs.isFirefox&&!Gs.isSafari&&(!Gs.isChrome||53<=Gs.version)&&n&&"space"===this.sanitizedKey&&$s._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty($s.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),$s);function $s(t,e){this.isLetter=Us(t),this.isChar=1===t.length||"space"===t,this.sanitizedKey=m.getSanitizedKey(t),this.modifierKeyCode=m.KEY_MAPS.modifiers[this.sanitizedKey],this.specialKeyCode=m.KEY_MAPS.specialKeys[this.sanitizedKey],this.keyCode=null,this.keyIdentifierProperty=Ws(e),this.topSameDomainDocument=m.domUtils.getTopSameDomainWindow(Ga).document,this.keyProperty=m.KEY_MAPS.keyProperty[e]||e,this.isChar&&"space"!==t?this.keyCode=Vs(this.sanitizedKey):this.modifierKeyCode?this.keyCode=this.modifierKeyCode:this.specialKeyCode&&(this.keyCode=this.specialKeyCode),this.storedActiveElement=null}var Zs,Js={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"},Qs=h.Promise,tl=h.utils.browser,el=h.eventSandbox.eventSimulator,nl=h.eventSandbox.elementEditingWatcher,il=y.textSelection,ol=y.eventUtils,rl=y.domUtils,sl=o.selectElement,ll=null,al=null;function ul(){al=ll=null,ol.unbind(this,"blur",ul,!0)}function cl(t){var e,n,i,o;rl.isTextAreaElement(t)&&(ll!==t&&(ol.bind(t,"blur",ul,!0),ll=t),e=t,n=il.hasInverseSelection(e),i=rl.getTextAreaValue(e),o=n?il.getSelectionStart(e):il.getSelectionEnd(e),al=i&&o?rl.getTextareaIndentInLine(e,o):0)}function hl(t,e){var n,i,o,r,s,l,a=rl.getTextAreaValue(t);a&&(n=il.getSelectionStart(t),i=il.getSelectionEnd(t),o=il.hasInverseSelection(t),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==al&&ll===t||cl(t),s=l.lastIndexOf("\n"),dl(t,n,i,o,Math.min(s+1+al,l.length),e))}function fl(t,e){var n,i,o,r,s,l,a,u,c,h,f=rl.getTextAreaValue(t);f&&(n=il.getSelectionStart(t),i=il.getSelectionEnd(t),u=(r=(o=il.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!==al&&ll===t||cl(t),dl(t,n,i,o,u=Math.min(u+al,u+h),e))}function dl(t,e,n,i,o,r){var s=null,l=null,l=r?(s=e!==n&&i?n:e,o):s=o;il.select(t,s,l)}function ml(t,e,n){rl.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))),rl.setElementValue(t,e),il.select(t,n,n),el.input(t)}function pl(t,e){var n,i,o,r,s,l,a,u;return rl.isTextEditableElement(t)&&(n=il.getSelectionStart(t),i=il.getSelectionEnd(t),o=il.hasInverseSelection(t),s=null,s=(r=!rl.isTextAreaElement(t)||rl.getTextareaLineNumberByPosition(t,n)===rl.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,a=-1===(l=rl.getElementValue(t).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=e?s:a,il.select(t,u,a)):o?il.select(t,i,a):il.select(t,n,a)),Qs.resolve()}function vl(t,e){var n,i,o,r,s,l,a,u,c;return rl.isTextEditableElement(t)&&(n=il.getSelectionStart(t),i=il.getSelectionEnd(t),o=il.hasInverseSelection(t),s=null,u=s=(r=!rl.isTextAreaElement(t)||rl.getTextareaLineNumberByPosition(t,n)===rl.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=rl.getElementValue(t).substring(s)).indexOf("\n"))?l.length:a,r?(c=e?s:u,il.select(t,c,u)):o?il.select(t,i,u):il.select(t,n,u)),Qs.resolve()}function gl(t){return pl(t,!0)}function El(t){return vl(t,!0)}function yl(t){return rl.isRadioButtonElement(t)&&!tl.isFirefox}function Sl(t,e){return bl(t,e,!1).then(function(t){t&&(t.checked=!0)})}function bl(t,e,n){return void 0===n&&(n=!0),t?(rl.isSelectElement(t)&&sl.collapseOptionList(),i=t,o=e,r=n,new Bs(function(t){var e=Xs(i,o,r);e?ks.focus(e,function(){return t(e)}):t()}).then(function(t){return t&&rl.isTextEditableInput(t)&&il.select(t),t})):Qs.resolve();var i,o,r}var Pl=((Zs={})[Js.ctrlA]=function(t){return rl.isEditableElement(t)&&il.select(t),Qs.resolve()},Zs[Js.backspace]=function(t){var e,n,i;return rl.isTextEditableElementAndEditingAllowed(t)&&(e=il.getSelectionStart(t),n=il.getSelectionEnd(t),i=rl.getElementValue(t).replace(/\r\n/g,"\n"),n===e?0<e&&ml(t,i.substring(0,e-1)+i.substring(n,i.length),e-1):ml(t,i.substring(0,e)+i.substring(n,i.length),e)),rl.isContentEditableElement(t)&&il.deleteSelectionContents(t),Qs.resolve()},Zs[Js.delete]=function(t){var e,n,i;return rl.isTextEditableElementAndEditingAllowed(t)&&(e=il.getSelectionStart(t),n=il.getSelectionEnd(t),i=rl.getElementValue(t).replace(/\r\n/g,"\n"),n===e?e<i.length&&ml(t,i.substring(0,e)+i.substring(n+1,i.length),e):ml(t,i.substring(0,e)+i.substring(n,i.length),e)),rl.isContentEditableElement(t)&&il.deleteSelectionContents(t),Qs.resolve()},Zs[Js.left]=function(t){var e,n,i,o,r=null;return rl.isSelectElement(t)&&sl.switchOptionsByKeys(t,"left"),yl(t)?Sl(t,!0):(rl.isTextEditableElement(t)&&(e=(r=il.getSelectionStart(t)||0)===il.getSelectionEnd(t)?r-1:r,il.select(t,e,e),cl(t)),rl.isContentEditableElement(t)&&(r=il.getSelectionStart(t))!==il.getSelectionEnd(t)&&(n=il.getSelectionByElement(t),o={node:(i=il.hasInverseSelectionContentEditable(t))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},il.selectByNodesAndOffsets(o,o,!0)),Qs.resolve())},Zs[Js.right]=function(t){var e,n,i,o,r=null,s=null;return rl.isSelectElement(t)&&sl.switchOptionsByKeys(t,"right"),yl(t)?Sl(t,!1):(rl.isTextEditableElement(t)&&(e=(r=il.getSelectionStart(t))===(s=il.getSelectionEnd(t))?s+1:s,r===rl.getElementValue(t).length&&(e=r),il.select(t,e,e),cl(t)),rl.isContentEditableElement(t)&&(r=il.getSelectionStart(t))!==(s=il.getSelectionEnd(t))&&(n=il.getSelectionByElement(t),o={node:(i=il.hasInverseSelectionContentEditable(t))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},il.selectByNodesAndOffsets(o,o,!0)),Qs.resolve())},Zs[Js.up]=function(t){return rl.isSelectElement(t)&&sl.switchOptionsByKeys(t,"up"),yl(t)?Sl(t,!0):tl.isWebKit&&rl.isInputElement(t)?pl(t):(rl.isTextAreaElement(t)&&hl(t,!1),Qs.resolve())},Zs[Js.down]=function(t){return rl.isSelectElement(t)&&sl.switchOptionsByKeys(t,"down"),yl(t)?Sl(t,!1):tl.isWebKit&&rl.isInputElement(t)?vl(t):(rl.isTextAreaElement(t)&&fl(t,!1),Qs.resolve())},Zs[Js.shiftLeft]=function(t){var e,n;return rl.isTextEditableElement(t)&&((e=il.getSelectionStart(t))===(n=il.getSelectionEnd(t))||il.hasInverseSelection(t)?il.select(t,n,Math.max(e-1,0)):il.select(t,e,Math.max(n-1,0)),cl(t)),Qs.resolve()},Zs[Js.shiftRight]=function(t){var e,n,i;return rl.isTextEditableElement(t)&&(e=il.getSelectionStart(t),n=il.getSelectionEnd(t),i=rl.getElementValue(t).length,e!==n&&il.hasInverseSelection(t)?il.select(t,n,Math.min(e+1,i)):il.select(t,e,Math.min(n+1,i)),cl(t)),Qs.resolve()},Zs[Js.shiftUp]=function(t){return tl.isWebKit&&rl.isInputElement(t)?gl(t):(rl.isTextAreaElement(t)&&hl(t,!0),Qs.resolve())},Zs[Js.shiftDown]=function(t){return tl.isWebKit&&rl.isInputElement(t)?El(t):(rl.isTextAreaElement(t)&&fl(t,!0),Qs.resolve())},Zs[Js.shiftHome]=gl,Zs[Js.shiftEnd]=El,Zs[Js.home]=pl,Zs[Js.end]=vl,Zs[Js.enter]=function(t){var e,n,i,o,r,s;return rl.isSelectElement(t)&&sl.collapseOptionList(),rl.isInputElement(t)?(tl.isIE||nl.processElementChanging(t),(e=rl.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)el.click(i);else if(rl.blocksImplicitSubmission(e)){for(var r=t.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)rl.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===e&&e.validity.valid&&el.submit(t)&&t.submit()}}(e,t)):rl.isTextAreaElement(t)?(n=il.getSelectionStart(t),o=(i=rl.getTextAreaValue(t)).substring(0,n),r=i.substring(n),s=n+1,ml(t,o+String.fromCharCode(10)+r,s)):t.tagName&&rl.isAnchorElement(t)&&el.click(t),Qs.resolve()},Zs[Js.tab]=function(t){return bl(t,!1)},Zs[Js.shiftTab]=function(t){return bl(t,!0)},Zs[Js.esc]=function(t){return rl.isSelectElement(t)&&sl.collapseOptionList(),Qs.resolve()},Zs),xl=h.Promise,_l=h.utils.browser,Cl=h.eventSandbox.message,Al=h.nativeMethods,wl="automation|press|request",Tl="automation|press|response";Cl.on(Cl.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===wl&&(h.on(h.EVENTS.beforeUnload,function(){return Cl.sendServiceMsg({cmd:Tl},t.source)}),new Ml(t.message.keyCombinations,t.message.options).run().then(function(){return Cl.sendServiceMsg({cmd:Tl},t.source)}))});var Ml=(Ul._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;m.KEY_MAPS.shiftMap[o]?t[n+1]=m.KEY_MAPS.shiftMap[o]:m.KEY_MAPS.reversedShiftMap[o]&&(e[n+1]=m.KEY_MAPS.reversedShiftMap[o])}!m.KEY_MAPS.shiftMap[i]||t[n-1]&&"shift"===t[n-1].toLowerCase()||(t[n]=m.KEY_MAPS.shiftMap[i],t.splice(n,0,"shift"),e.splice(n,0,"shift"),n++)}return{actualKeys:t,eventKeyProperties:e}}(m.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return m.arrayUtils.map(n,function(t,e){return new js(t,i[e])})},Ul._getShortcuts=function(t){for(var e=m.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("+");Pl[s]?(n.push(s),i=o=[]):o.shift()}return n},Ul._getShortcutHandlers=function(t){for(var e,n,i,o=Ul._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)]=Pl[e],t=t.substring(n+i);return r},Ul.prototype._down=function(t){this.pressedKeyString+=(this.pressedKeyString?"+":"")+t.key;var e=!t.down(this.modifiersState);return xl.resolve(e)},Ul.prototype._press=function(t,e){var n=this;if(e&&!this.isSelectElement)return m.delay(this.automationSettings.keyActionStepDelay);var i=this.shortcutHandlers[this.pressedKeyString],o=!1;return i&&!_l.isFirefox&&"enter"!==t.key||(o=!t.press(this.modifiersState)),o&&!this.isSelectElement||!i?m.delay(this.automationSettings.keyActionStepDelay):i(Ls(this.topSameDomainDocument)).then(function(){return m.delay(n.automationSettings.keyActionStepDelay)})},Ul.prototype._up=function(t){return t.up(this.modifiersState),m.delay(this.automationSettings.keyActionStepDelay)},Ul.prototype._runCombination=function(t){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=m.domUtils.isSelectElement(Ls(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=Ul._getShortcutHandlers(t);var e=Ul._getKeyPressSimulators(t);return m.promiseUtils.each(e,function(e){return n._down(e).then(function(t){return n._press(e,t)})}).then(function(){return m.arrayUtils.reverse(e),m.promiseUtils.each(e,function(t){return n._up(t)})})},Ul.prototype.run=function(){var e=this,t=m.domUtils.getActiveElement(),n=m.domUtils.isIframeElement(t);if(!b(Ga)&&n&&Al.contentWindowGetter.call(t)){var i={cmd:wl,keyCombinations:this.keyCombinations,options:this.options};return m.sendRequestToFrame(i,Tl,Al.contentWindowGetter.call(t))}return m.promiseUtils.each(this.keyCombinations,function(t){return e._runCombination(t).then(function(){return m.delay(e.automationSettings.keyActionStepDelay)})})},Ul);function Ul(t,e){this.keyCombinations=t,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=m.domUtils.getTopSameDomainWindow(Ga).document,this.automationSettings=new J(e.speed),this.options=e}var Dl,Il=h.Promise,kl=h.utils.extend,Bl=h.utils.browser,Nl=h.eventSandbox.eventSimulator,Ol=y.domUtils,Fl=y.eventUtils,Yl=y.delay,Ll=(M(Kl,Dl=Uo),Kl.prototype._mousedown=function(t){var e=this;return K.rightButtonDown().then(function(){e.eventState.activeElementBeforeMouseDown=Ol.getActiveElement(),e.eventState.simulateDefaultBehavior=Nl.mousedown(t.element,t.options)}).then(function(){return e._focus(t)})},Kl.prototype._focus=function(t){return!1===this.simulateDefaultBehavior?Ni():Go(Ol.isContentEditableElement(this.element)?this.element:t.element,!Bl.isIE||this.eventState.activeElementBeforeMouseDown===Ol.getActiveElement(),this.caretPos).then(Ni)},Kl.prototype._mouseup=function(e){var t=this;return K.buttonUp().then(function(){return t._getElementForEvent(e)}).then(function(t){return Nl.mouseup(t,e.options)})},Kl.prototype._contextmenu=function(e){return this._getElementForEvent(e).then(function(t){Nl.contextmenu(t,e.options),Ol.isElementFocusable(t)||qo(t)})},Kl.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:kl({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:Fl.BUTTON.right},o.modifiers)},Il.all([Yl(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},Kl);function Kl(t,e){var n=Dl.call(this,t,e)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var Xl=h.utils.browser,Vl=y.domUtils,Rl=y.positionUtils,Wl=y.styleUtils,Hl=y.contentEditable,Gl=y.arrayUtils,zl=["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 ql(t,e){var n,i,o,r,s,l=Wl.getBordersWidth(t),a=Rl.getOffsetPosition(t),u=t.scrollHeight||t.getBoundingClientRect().height,c=Math.ceil(e.left),h=Math.ceil(e.top),f=Math.floor(e.bottom);return Vl.isTextAreaElement(t)||(i=(n=Rl.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 jl(t){var e=Wl.getElementScroll(za);return{left:t.left+e.left,top:t.top+e.top,bottom:t.bottom+e.top}}function $l(t,e){var n=t.getBoundingClientRect(),i=function(e){var t,n,i,o=za.body,r=Rl.getOffsetPosition(e),s=Wl.getElementMargin(e),l=r.top-s.top,a=r.left-s.left,u=za.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===Wl.get(o,"position")&&(t=Wl.getElementMargin(o),n=Wl.get(o,"left"),i=Wl.get(o,"top"),a-=t.left+(parseInt(n.replace("px",""),10)||0),l-=t.top+(parseInt(i.replace("px",""),10)||0)),Gl.forEach(zl,function(t){c+=t+":"+Wl.get(e,t)+";"}),Wl.set(u,{cssText:c,position:"absolute",left:a+"px",top:l+"px",width:e.scrollWidth+"px",height:e.scrollHeight+"px"}),h.nativeMethods.nodeTextContentSetter.call(u,Vl.getElementValue(e)+" "),o.appendChild(u),u}(t),o=null,r=t.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=Vl.getElementValue(t).length;try{var u=za.createRange();u.setStart(h.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e,a)),u.setEnd(h.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e+1,a+1)),Vl.isTextAreaElement(t)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(t){o=null}return Vl.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 Zl(t,e){var n,i,o,r,s,l,a=null;return(a=Vl.isContentEditableElement(t)?(o=t,r=e,s=Vl.findDocument(o).createRange(),l=Hl.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()):$l(t,e))?{x:(a=jl(a=ql(t,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function Jl(t,e){var n=Vl.isTextEditableElement(t),i=Vl.isContentEditableElement(t);return n&&0<Vl.getElementValue(t).length||i&&Hl.getContentEditableValue(t).length?Zl(t,e):Rl.findCenter(t)}function Ql(t,e,n){var i=Vl.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=jl(ql(t,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var ta,ea=h.Promise,na=h.utils.browser,ia=h.utils.featureDetection,oa=h.eventSandbox.eventSimulator,ra=h.eventSandbox.focusBlur,sa=y.contentEditable,la=y.domUtils,aa=y.positionUtils,ua=y.eventUtils,ca=y.delay,ha=(M(fa,ta=Uo),fa._calculateEventArguments=function(t){var n=aa.offsetToClientCoords(t);return j(n.x,n.y).then(function(t){var e=t.element;if(!e)throw new Error(Z.elementIsInvisibleError);return{element:e,options:{clientX:n.x,clientY:n.y}}})},fa.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Si({offsetX:i,offsetY:o,speed:r},!1);return new Co(n,s).run().then(function(){return ca(e.automationSettings.mouseActionStepDelay)})},fa.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,ua.preventDefault(t),ua.unbind(e.element,"mousedown",n)};ua.bind(this.element,"mousedown",n)},fa.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},fa.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},fa.prototype._moveToPoint=function(t){!function(t,e){if(Vl.isEditableElement(t)){var n=Vl.isTextAreaElement(t);if(!Vl.isInputElement(t)||!(Xl.isFirefox||Xl.isIE&&10<Xl.version)){var i=Rl.getOffsetPosition(t),o=Wl.getBordersWidth(t),r=Wl.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&&Wl.setScrollTop(t,Math.round(a));s<r.left&&(a=s),s>t.clientWidth+r.left&&(a=s-t.clientWidth),null!==a&&Wl.setScrollLeft(t,Math.round(a))}}}(this.element,t),this.clientPoint=function(t,e){var n=Vl.isTextEditableElement(t),i=Vl.isInputElement(t);if(!n&&!Vl.isContentEditableElement(t))return e;var o=Rl.getOffsetPosition(t),r=Wl.getBordersWidth(t),s=Wl.getElementScroll(t),l=o.left+r.left+t.clientWidth;return i&&n&&(Xl.isFirefox||Xl.isIE&&10<Xl.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:za.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(e)},fa.prototype._mousedown=function(){var n=this;return K.leftButtonDown().then(function(){return fa._calculateEventArguments(n.clientPoint)}).then(function(t){n.eventArgs=t;var e=(na.isWebKit||na.isIE)&&la.isSelectElement(n.element);return e&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=oa[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=e&&!n.eventState.mousedownPrevented),n._focus()})},fa.prototype._focus=function(){var n=this;return new ea(function(t){var e=la.isContentEditableElement(n.element)?sa.findContentEditableParent(n.element):n.element;ra.focus(e,t,!1,!0)})},fa.prototype._setSelection=function(){throw new Error("Not implemented")},fa.prototype._mouseup=function(){var e=this;return K.buttonUp().then(function(){return e._setSelection(),fa._calculateEventArguments(e.clientPoint)}).then(function(t){e.eventArgs=t,oa[e.upEvent](e.eventArgs.element,e.eventArgs.options)})},fa.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()})},fa);function fa(t,e){var n=ta.call(this,t,e)||this;return n.absoluteStartPoint=null,n.absoluteEndPoint=null,n.clientPoint=null,n.speed=e.speed,n.downEvent=ia.isTouchDevice?"touchstart":"mousedown",n.upEvent=ia.isTouchDevice?"touchend":"mouseup",n.eventArgs={options:null,element:null},n.eventState={mousedownPrevented:!1,simulateDefaultBehavior:!0},n}var da,ma=y.textSelection,pa=y.domUtils,va=y.positionUtils,ga=(M(Ea,da=ha),Ea.prototype._calculateAbsoluteStartPoint=function(){return Jl(this.element,this.startPos)||va.findCenter(this.element)},Ea.prototype._calculateAbsoluteEndPoint=function(){var t=Jl(this.element,this.endPos);return t||(pa.isContentEditableElement(this.element)?function(t,e,n){for(var i=n<e?1:-1,o=n,r=null;o!==e&&!(r=Zl(t,o+=i)););return r=r||Zl(t,e)||Rl.findCenter(t)}(this.element,this.startPos,this.endPos):va.findCenter(this.element))},Ea.prototype._setSelection=function(){var t=pa.isTextEditableElement(this.element),e=pa.isContentEditableElement(this.element);(t||e)&&!1!==this.eventState.simulateDefaultBehavior&&ma.select(this.element,this.startPos,this.endPos)},Ea.prototype.run=function(t){var e=this;return this._ensureElement(t).then(function(){return da.prototype.run.call(e)})},Ea);function Ea(t,e,n,i){var o=da.call(this,t,i)||this;return o.startPos=e,o.endPos=n,o}var ya,Sa=y.textSelection,ba=y.contentEditable,Pa=y.positionUtils,xa=(M(_a,ya=ha),_a.prototype._calculateAbsoluteStartPoint=function(){return Ql(this.element,this.startNode,this.startOffset)||Pa.findCenter(this.element)},_a.prototype._calculateAbsoluteEndPoint=function(){return Ql(this.element,this.endNode,this.endOffset)||Pa.findCenter(this.element)},_a.prototype._setSelection=function(){var t,e;!1!==this.eventState.simulateDefaultBehavior&&(t={node:this.startNode,offset:this.startOffset},e={node:this.endNode,offset:this.endOffset},Sa.selectByNodesAndOffsets(t,e,!0))},_a);function _a(t,e,n){var i=ya.call(this,ba.getNearestCommonAncestor(t,e),n)||this,o=ba.getFirstVisiblePosition(t),r=ba.getLastVisiblePosition(e),s={node:t,offset:o},l={node:e,offset:r},a=ba.calculatePositionByNodeAndOffset(i.element,s);return ba.calculatePositionByNodeAndOffset(i.element,l)<a&&(o=ba.getLastVisiblePosition(t),r=ba.getFirstVisiblePosition(e)),s=ba.calculateNodeAndOffsetByPosition(t,o),l=ba.calculateNodeAndOffsetByPosition(e,r),i.startNode=s.node,i.startOffset=s.offset,i.endNode=l.node,i.endOffset=l.offset,i}var Ca=h.Promise,Aa=h.utils.extend,wa=h.utils.browser,Ta=h.eventSandbox.eventSimulator,Ma=h.eventSandbox.elementEditingWatcher,Ua=y.domUtils,Da=y.promiseUtils,Ia=y.contentEditable,ka=y.textSelection,Ba=y.delay,Na=y.KEY_MAPS.specialKeys,Oa=(Fa.findTextEditableChild=function(t){var e=null;if(!Ua.isEditableElement(t))for(var n=t.querySelectorAll("*"),i=0;i<n.length;i++)if(Ua.isTextEditableElementAndEditingAllowed(n[i])){e=n[i];break}return e},Fa.prototype._calculateEventArguments=function(t){var e=Ua.getActiveElement(),n=Ua.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||e===i||(i=Fa.findTextEditableChild(e)||e);var o=Aa({keyCode:t?this.currentCharCode:this.currentKeyCode},this.modifiers);return t&&(o.charCode=this.currentCharCode),Aa(o,Hs(t,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},Fa.prototype._calculateTargetElement=function(){var t=Ua.getActiveElement(),e=Ua.isContentEditableElement(this.element);if(e){if(t!==Ia.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},Fa.prototype._click=function(t){var e,n=this,i=Ua.getActiveElement(),o=Ua.isTextEditableElementAndEditingAllowed(this.element),r=Ua.isContentEditableElement(this.element);if(i===this.element)return o&&Ma.watchElementEditing(this.element),(o||r)&&(e=ka.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===e||ka.select(this.element,this.caretPos,this.caretPos)),Ca.resolve();var s=O(this.element),l=s.offsetX,a=s.offsetY,u=new gi({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new Ar(this.element,u).run(t).then(function(){return Ba(n.automationSettings.mouseActionStepDelay)})},Fa.prototype._type=function(){var t=this;if(this.eventState.skipType)return Ca.resolve();var e=Ua.isContentEditableElement(this.element);return this.replace&&(Ua.isTextEditableElementAndEditingAllowed(this.element)?ka.select(this.element):e&&ka.deleteSelectionContents(this.element,!0)),Da.whilst(function(){return!t._isTypingFinished()},function(){return t._typingStep()})},Fa.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},Fa.prototype._typingStep=function(){var t=this.typingText.charAt(this.currentPos);return this.currentKeyCode=Vs(t),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this.currentKeyCode===Na.enter?"Enter":t,this.currentKeyIdentifier=Ws(this.currentKey),this.ignoreChangeEvent=Ua.getElementValue(this.element)===Ma.getElementSavedValue(this.element),this._keydown(),this._keypress(),this._keyup()},Fa.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=Ta.keydown(this.eventArgs.element,this.eventArgs.options)},Fa.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=wa.isAndroid||Ta.keypress(this.eventArgs.element,this.eventArgs.options))},Fa.prototype._keyup=function(){var t=this,e=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=Ua.isTextEditableElement(this.element),i=Ua.isContentEditableElement(this.element),o=this.paste||!n&&!i;return Ca.resolve().then(function(){return o?t._typeAllText(e):t._typeChar(e)}).then(function(){Ta.keyup(t.eventArgs.element,t.eventArgs.options),o?t.currentPos=t.typingText.length:t.currentPos++})},Fa.prototype._typeChar=function(t){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&Ma.restartWatchingElementEditing(t),Ba(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(Ua.isInputElement(t)&&"number"===t.type){var o=ka.getSelectionStart(t),r=Ua.getInputValue(t).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===e||"-"===e&&r)||0!==o))return Ba(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(e=i+e)}return Ms(t,e,null),Ba(this.automationSettings.keyActionStepDelay)},Fa.prototype._typeAllText=function(t){return Ms(t,this.typingText,this.caretPos),Ba(this.automationSettings.keyActionStepDelay)},Fa.prototype.run=function(t){var e=this;return this._click(t).then(function(){return e._calculateTargetElement()}).then(function(){return e._type()})},Fa);function Fa(t,e,n){this.element=Fa.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 J(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 Ya=(La.prototype.run=function(){var i=this;return t.doUpload(this.element,this.paths).then(function(t){if(t.length){var e=m.arrayUtils.map(t,function(t){return t.path}),n=m.arrayUtils.reduce(t,function(t,e){return t.concat(e.resolvedPaths)},[]);throw i.createError(e,n)}})},La);function La(t,e,n){this.element=t,this.paths=e,this.createError=n}var Ka=y.domUtils,Xa=y.contentEditable,Va={};Va.DispatchEvent=E,Va.Scroll=A,Va.Click=Ar,Va.SelectChildClick=Lr,Va.DblClick=qr,Va.DragToOffset=ss,Va.DragToElement=cs,Va.Hover=ds,Va.Press=Ml,Va.RClick=Ll,Va.SelectText=ga,Va.SelectEditableContent=xa,Va.Type=Oa,Va.Upload=Ya,Va.MouseOptions=mi,Va.ClickOptions=gi,Va.TypeOptions=Ai,Va.ERROR_TYPES=Z,Va.AutomationSettings=J,Va.getOffsetOptions=F,Va.calculateSelectTextArguments=function(t,e){void 0===e&&(e={});var n,i,o,r,s,l,a,u,c,h,f,d=Ka.isTextEditableElement(t),m=d?0:Xa.getFirstVisiblePosition(t),p=d?Ka.getElementValue(t).length:Xa.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=Ka.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:Ka.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:Ka.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},Va.cursor=K,Va.getNextFocusableElement=Xs,Va.SHORTCUT_TYPE=Js,Va.getSelectionCoordinatesByPosition=Jl,Va.getElementFromPoint=j;var Ra=h.nativeMethods,Wa=h.EVENTS.evalIframeScript;Ra.objectDefineProperty(Ga,"%testCafeAutomation%",{configurable:!0,value:Va}),h.on(Wa,function(t){return Ha(Ra.contentWindowGetter.call(t.iframe))})}(Ga["%hammerhead%"],Ga["%testCafeCore%"],Ga["%hammerhead%"].Promise,Ga["%testCafeUI%"])}(window);
|
|
1
|
+
window["%hammerhead%"].utils.removeInjectedScript(),function za(qa){var ja=qa.document;!function(t,m,e,o){var h="default"in t?t.default:t,y="default"in m?m.default:m;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var n=h.nativeMethods,i=/^((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},f="MouseEvent",d="PointerEvent",p="KeyboardEvent",v="InputEvent",g="FocusEvent",E=(S.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:qa,buttons:o});var r,s=S._getEventCtorByEventType(this.eventName,this.options.eventConstructor);s&&(r=new s(this.eventName,this.options),this.element.dispatchEvent(r))},S._getEventCtorByEventType=function(t,e){if(e&&"function"==typeof S._getEventCtorFromWindow(e)){var n=S._getEventCtorFromNativeMethods(e);if(n&&"function"==typeof n)return n}return i.test(t)||r.test(t)?S._getEventCtorFromNativeMethods(f):u.test(t)?S._getEventCtorFromNativeMethods(d):s.test(t)?S._getEventCtorFromNativeMethods(p):l.test(t)?S._getEventCtorFromNativeMethods(v):a.test(t)?S._getEventCtorFromNativeMethods(g):S._getEventCtorFromNativeMethods("CustomEvent")},S._getEventCtorFromNativeMethods=function(t){return n["Window"+t]||S._getEventCtorFromWindow(t)},S._getEventCtorFromWindow=function(t){return qa[t]},S);function S(t,e,n){this.element=t,this.eventName=e,this.options=n}function b(t){return t.top!==t}var P=h.Promise,x=h.eventSandbox.message,_="automation|scroll|request",C="automation|scroll|response";x.on(x.SERVICE_MSG_RECEIVED_EVENT,function(t){var e,n,i,o,r,s;t.message.cmd===_&&(n=(e=t.message).offsetX,i=e.offsetY,o=e.maxScrollMargin,r=m.domUtils.findIframeByWindow(t.source),(s=new A(r,{offsetX:n,offsetY:i})).maxScrollMargin=o,s.run().then(function(){return x.sendServiceMsg({cmd:C},t.source)}))});var A=(w.prototype._isScrollValuesChanged=function(t,e){return m.styleUtils.getScrollLeft(t)!==e.left||m.styleUtils.getScrollTop(t)!==e.top},w.prototype._setScroll=function(t,e){var n=this,i=e.left,o=e.top,r=m.domUtils.isHtmlElement(t)?m.domUtils.findDocument(t):t,s={left:m.styleUtils.getScrollLeft(r),top:m.styleUtils.getScrollTop(r)},i=Math.max(i,0),o=Math.max(o,0),l=m.scrollController.waitForScroll(r);return m.styleUtils.setScrollLeft(r,i),m.styleUtils.setScrollTop(r,o),this._isScrollValuesChanged(r,s)?l=l.then(function(){n.scrollWasPerformed=n.scrollWasPerformed||n._isScrollValuesChanged(r,s)}):(l.cancel(),P.resolve())},w.prototype._getScrollToPoint=function(t,e,n){var i=e.x,o=e.y,r=Math.floor(t.width/2),s=Math.floor(Math.floor(t.height/2)),l=this.scrollToCenter?r:Math.min(n.left,r),a=this.scrollToCenter?s:Math.min(n.top,s),u=i>=t.scroll.left+t.width-l,c=i<=t.scroll.left+l,h=o>=t.scroll.top+t.height-a,f=o<=t.scroll.top+a,d=t.scroll.left,m=t.scroll.top;return u?d=i-t.width+l:c&&(d=i-l),h?m=o-t.height+a:f&&(m=o-a),{left:d,top:m}},w.prototype._getScrollToFullChildView=function(t,e,n){var i,o,r,s,l=null,a=null,u=t.width>=e.width,c=t.height>=e.height,h=m.positionUtils.calcRelativePosition(e,t);return u&&(i=t.width-e.width,o=Math.min(n.left,i),this.scrollToCenter&&(o=i/2),h.left<o?l=Math.round(t.scroll.left+h.left-o):h.right<o&&(l=Math.round(t.scroll.left+Math.min(h.left,-h.right)+o))),c&&(r=t.height-e.height,s=Math.min(n.top,r),this.scrollToCenter&&(s=r/2),h.top<s?a=Math.round(t.scroll.top+h.top-s):h.bottom<s&&(a=Math.round(t.scroll.top+Math.min(h.top,-h.bottom)+s))),{left:l,top:a}},w._getChildPoint=function(t,e,n){return{x:e.left-t.left+t.scroll.left+e.border.left+n.x,y:e.top-t.top+t.scroll.top+e.border.top+n.y}},w.prototype._getScrollPosition=function(t,e,n,i){var o=w._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)}},w._getChildPointAfterScroll=function(t,e,n,i){return{x:Math.round(e.left+t.scroll.left-n.left+i.x),y:Math.round(e.top+t.scroll.top-n.top+i.y)}},w.prototype._isChildFullyVisible=function(t,e,n){var i=w._getChildPointAfterScroll(t,e,t.scroll,n),o=i.x,r=i.y,s=this._getScrollPosition(t,e,n,{left:0,top:0}),l=s.left,a=s.top;return!this._isTargetElementObscuredInPoint(o,r)&&l===t.scroll.left&&a===t.scroll.top},w.prototype._scrollToChild=function(t,e,n){for(var i=m.positionUtils.getClientDimensions(t),o=m.positionUtils.getClientDimensions(e),r=m.styleUtils.getInnerWidth(qa),s=m.styleUtils.getInnerHeight(qa),l=i.scroll,a=!this._isChildFullyVisible(i,o,n);a;){l=this._getScrollPosition(i,o,n,this.maxScrollMargin);var u=w._getChildPointAfterScroll(i,o,l,n),c=u.x,h=u.y,f=this._isTargetElementObscuredInPoint(c,h);this.maxScrollMargin.left+=20,this.maxScrollMargin.left>=r&&(this.maxScrollMargin.left=50,this.maxScrollMargin.top+=20),a=f&&this.maxScrollMargin.top<s}return this.maxScrollMargin={left:50,top:50},this._setScroll(t,l)},w.prototype._scrollElement=function(){if(!m.styleUtils.hasScroll(this.element))return P.resolve();var t=m.positionUtils.getClientDimensions(this.element),e=this._getScrollToPoint(t,{x:this.offsetX,y:this.offsetY},this.maxScrollMargin);return this._setScroll(this.element,e)},w.prototype._scrollParents=function(){var e,n,i=this,o=m.styleUtils.getScrollableParents(this.element),r=this.element,s=this.offsetX-Math.round(m.styleUtils.getScrollLeft(r)),l=this.offsetY-Math.round(m.styleUtils.getScrollTop(r));return m.promiseUtils.times(o.length,function(t){return i._scrollToChild(o[t],r,{x:s,y:l}).then(function(){e=m.positionUtils.getClientDimensions(r),n=m.positionUtils.getClientDimensions(o[t]),s+=e.left-n.left+n.border.left,l+=e.top-n.top+n.border.top,r=o[t]})}).then(function(){return b(qa)&&!i.skipParentFrames?m.sendRequestToFrame({cmd:_,offsetX:s,offsetY:l,maxScrollMargin:i.maxScrollMargin},C,qa.parent):P.resolve()})},w._getFixedAncestorOrSelf=function(t){return m.domUtils.findParent(t,!0,m.styleUtils.isFixedElement)},w.prototype._isTargetElementObscuredInPoint=function(t,e){var n=m.positionUtils.getElementFromPoint(t,e);if(!n)return!1;var i=w._getFixedAncestorOrSelf(n);return i&&!i.contains(this.element)},w.prototype.run=function(){var t=this;return this._scrollElement().then(function(){return t._scrollParents()}).then(function(){return t.scrollWasPerformed})},w);function w(t,e){this.element=t,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.scrollToCenter=e.scrollToCenter,this.skipParentFrames=e.skipParentFrames,this.raiseEvents=e.raiseEvents,this.maxScrollMargin={left:50,top:50},this.scrollWasPerformed=!1}var T=function(t,e){return(T=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 M(t,e){function n(){this.constructor=t}T(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function U(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 D(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 I=h.utils.browser;function k(t,e,n){var i=I.isFirefox?Math.ceil:Math.round,o=m.positionUtils.getOffsetPosition(t,i);return{x:(t===ja.documentElement?0:o.left)+e,y:(t===ja.documentElement?0:o.top)+n}}function B(t){if(!t)return null;var e=qa.screenLeft||qa.screenX,n=qa.screenTop||qa.screenY;return{x:e+t.x,y:n+t.y}}function N(t){var e=t/2;return e<1?0:Math.round(e)}function O(t){var e=m.positionUtils.getElementRectangle(t);return{offsetX:N(e.width),offsetY:N(e.height)}}function F(t,e,n){var i=O(t);if(e="number"==typeof e?Math.round(e):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<e&&0<n)return{offsetX:e,offsetY:n};var o=m.positionUtils.getClientDimensions(t),r=Math.round(Math.max(t.scrollWidth,o.width)),s=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+r,a=o.scrollbar.bottom+o.border.top+o.border.bottom+s;return{offsetX:e<0?l+e:e,offsetY:n<0?a+n:n}}var Y=y.domUtils,L=b(qa)?o.iframeCursorUI:o.cursorUI,K={x:-1,y:-1,currentActiveWindow:qa.top,_ensureActiveWindow:function(){var t;this.currentActiveWindow!==qa&&this.currentActiveWindow!==qa.parent&&((t=Y.findIframeByWindow(this.currentActiveWindow))&&Y.isElementInDocument(t)||(this.currentActiveWindow=qa))},get active(){return this._ensureActiveWindow(),this.currentActiveWindow===qa},set activeWindow(t){this.currentActiveWindow=t},get activeWindow(){return this._ensureActiveWindow(),this.currentActiveWindow},get position(){return{x:this.x,y:this.y}},get visible(){return!b(qa)&&L.isVisible()},move:function(t,e){return this.x=t,this.y=e,L.move(this.x,this.y)},hide:function(){this.visible&&L.hide()},show:function(){b(qa)||L.show()},leftButtonDown:function(){return L.leftButtonDown()},rightButtonDown:function(){return L.rightButtonDown()},buttonUp:function(){return L.buttonUp()}},X=h.utils.browser,V=h.Promise,R=h.nativeMethods,W=y.positionUtils,H=y.domUtils;function G(t,e,n){var i=null;return o.hide(n).then(function(){return i=W.getElementFromPoint(t,e),o.show(n)}).then(function(){return i})}function z(t,e,n){var i=W.getElementFromPoint(t,e),o=H.containsElement(n,i)&&R.nodeTextContentGetter.call(i).length;return i&&i===n||o?i:null}function q(t,e){if(!e||!H.isDomElement(e)||!t||t===e)return t;if("tref"===H.getTagName(e))return e;var n,i,o,r="area"===H.getTagName(e)&&H.isImgElement(t);if(X.isFirefox&&r)return n=t,i=e,(o=H.closest(i,"map"))&&o.name===n.useMap.substring(1)?i:n;var s=H.isAnchorElement(e)||H.getParents(e,"a").length,l=s&&H.containsElement(e,t)&&R.nodeTextContentGetter.call(t).length;if(!s||l||!R.nodeTextContentGetter.call(e).length)return t;var a=e.getBoundingClientRect();return z(a.right-1,a.top+1,e)||z(a.left+1,a.bottom-1,e)||t}function j(n,i,o){var r=null;return G(n,i).then(function(t){r=t;var e=V.resolve(t);return!r&&b(qa)&&0<n&&0<i&&(e=e.then(function(){return G(n,i,!0)}).then(function(t){return r=t})),e.then(function(t){return q(t,o)}).then(function(t){return{element:t,corrected:t!==r}})})}function $(){var t=K.position;return j(t.x,t.y).then(function(t){return t.element})}var Z={elementIsInvisibleError:"elementIsInvisibleError",foundElementIsNotTarget:"foundElementIsNotTarget"},J=(Object.defineProperty(Q.prototype,"mouseActionStepDelay",{get:function(){return 1===this.speedFactor?10:400*(1-this.speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"keyActionStepDelay",{get:function(){return 1===this.speedFactor?10:200*(1-this.speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this.speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this.speedFactor)/4},enumerable:!1,configurable:!0}),Q);function Q(t){this.speedFactor=t||1}var tt=(et.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},et.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t)for(var i=this._getAssignableProperties(),o=0;o<i.length;o++){for(var r,s=i[o],l=s.name,a=s.type,u=s.required,c=s.init,h=s.defaultValue,f=l.split("."),d=f.length-1,m=f[d],p=t,v=this,g=0;g<d&&p&&v;g++)p=p[f[g]],v=v[f[g]];v&&"defaultValue"in i[o]&&(v[l]=h),p&&v&&(void 0===(r=p[m])&&!u||(e&&a&&a(l,r),v[m]=c?c(l,r,n):r))}},et);function et(){}function nt(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 it(t){this.code=t,this.isTestCafeError=!0,this.callsite=null}var ot,rt,st,lt="E1",at="E4",ut="E5",ct="E9",ht="E10",ft="E11",dt="E12",mt="E24",pt="E26",vt="E27",gt="E28",Et="E29",yt="E30",St="E31",bt="E32",Pt="E33",xt="E34",_t="E35",Ct="E36",At="E37",wt="E39",Tt="E40",Mt="E41",Ut="E42",Dt="E43",It="E44",kt="E45",Bt="E46",Nt="E49",Ot="E50",Ft="E51",Yt="E52",Lt="E57",Kt="E64",Xt="E65",Vt="E68",Rt="E69",Wt="E70",Ht="E71",Gt="E72",zt="E73",qt="E74",jt="E76",$t="E77",Zt="E78",Jt="E82",Qt="E83",te=(M(ee,ot=it),ee);function ee(t,e,n){var i=ot.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function ne(t){var e=rt.call(this,Nt)||this;return e.instantiationCallsiteName=t,e}function ie(t){var e=st.call(this,Ot)||this;return e.instantiationCallsiteName=t,e}M(ne,rt=it),M(ie,st=it);var oe,re,se,le,ae,ue,ce,he,fe=(M(de,oe=it),de);function de(t,e){var n=e.apiFnChain,i=e.apiFnIndex,o=oe.call(this,t)||this;return o.apiFnChain=n,o.apiFnIndex=i,o}function me(){return re.call(this,Ft)||this}function pe(t,e){var n=se.call(this,Yt,e)||this;return n.callsite=t,n}function ve(t,e){var n=le.call(this,lt)||this;return n.errStack=t,n.pageDestUrl=e,n}function ge(t,e){var n=ae.call(this,at)||this;return n.errMsg=String(e),n.instantiationCallsiteName=t,n}function Ee(t,e,n){var i=ue.call(this,ut,e,n)||this;return i.errMsg=String(e),i.property=n,i.instantiationCallsiteName=t,i}function ye(t){var e=ce.call(this,Kt)||this;return e.errMsg=String(t),e}function Se(t,e){var n=he.call(this,Xt)||this;return n.errMsg=String(t),n.moduleName=e,n}M(me,re=it),M(pe,se=fe),M(ve,le=it),M(ge,ae=it),M(Ee,ue=it),M(ye,ce=it),M(Se,he=it);var be,Pe=(M(xe,be=te),xe);function xe(t,e){return be.call(this,ct,t,e)||this}var _e,Ce=(M(Ae,_e=te),Ae);function Ae(t,e){return _e.call(this,ht,t,e)||this}var we,Te=(M(Me,we=te),Me);function Me(t,e){return we.call(this,ft,t,e)||this}var Ue,De,Ie,ke,Be,Ne,Oe,Fe,Ye,Le,Ke,Xe,Ve,Re,We,He,Ge,ze,qe,je,$e,Ze,Je,Qe,tn,en,nn,on,rn,sn,ln,an,un,cn,hn,fn=(M(dn,Ue=te),dn);function dn(t,e){return Ue.call(this,dt,t,e)||this}function mn(t){return De.call(this,mt,t)||this}function pn(){return Ie.call(this,pt)||this}function vn(t){var e=ke.call(this,vt)||this;return e.nodeDescription=t,e}function gn(t,e){var n=Be.call(this,gt,e)||this;return n.argumentName=t,n}function En(t){var e=Ne.call(this,Et)||this;return e.argumentName=t,e}function yn(t,e){var n=Oe.call(this,yt)||this;return n.argumentName=t,n.nodeDescription=e,n}function Sn(){return Fe.call(this,St)||this}function bn(){return Ye.call(this,bt)||this}function Pn(t){var e=Le.call(this,Pt)||this;return e.argumentName=t,e}function xn(){return Ke.call(this,_t)||this}function _n(t){var e=Xe.call(this,Ct)||this;return e.argumentName=t,e}function Cn(t,e){var n=Ve.call(this,At)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function An(){return Re.call(this,xt)||this}function wn(t,e){var n=We.call(this,Mt)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function Tn(t,e){var n=He.call(this,Lt)||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 Mn(){return Ge.call(this,Tt)||this}function Un(){return ze.call(this,wt)||this}function Dn(){return qe.call(this,Ut)||this}function In(){return je.call(this,Rt)||this}function kn(){return $e.call(this,Vt)||this}function Bn(){return Ze.call(this,Wt)||this}function Nn(){return Je.call(this,Ht)||this}function On(){return Qe.call(this,zt)||this}function Fn(){return tn.call(this,Jt)||this}function Yn(t){var e=en.call(this,Zt)||this;return e.errMsg=t,e}function Ln(){return nn.call(this,qt)||this}function Kn(){return on.call(this,jt)||this}function Xn(){return rn.call(this,$t)||this}function Vn(){return sn.call(this,Gt)||this}function Rn(){return ln.call(this,Qt)||this}function Wn(){return an.call(this,Dt)||this}function Hn(){return un.call(this,It)||this}function Gn(t,e){var n=cn.call(this,kt)||this;return n.dialogType=t,n.pageUrl=e,n}function zn(t,e,n){var i=hn.call(this,Bt)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}M(mn,De=fe),M(pn,Ie=it),M(vn,ke=it),M(gn,Be=fe),M(En,Ne=it),M(yn,Oe=it),M(Sn,Fe=it),M(bn,Ye=it),M(Pn,Le=it),M(xn,Ke=it),M(_n,Xe=it),M(Cn,Ve=it),M(An,Re=it),M(wn,We=it),M(Tn,He=it),M(Mn,Ge=it),M(Un,ze=it),M(Dn,qe=it),M(In,je=it),M(kn,$e=it),M(Bn,Ze=it),M(Nn,Je=it),M(On,Qe=it),M(Fn,tn=it),M(Yn,en=it),M(Ln,nn=it),M(Kn,on=it),M(Xn,rn=it),M(Vn,sn=it),M(Rn,ln=it),M(Wn,an=it),M(Hn,un=it),M(Gn,cn=it),M(zn,hn=it);var qn,jn,$n,Zn,Jn,Qn=nt(Pe),ti=(jn=nt(qn=Ce),function(t,e){if(jn(t,e),e<0)throw new qn(t,e)}),ei=($n=Te,function(t,e){var n=typeof e;if("boolean"!=n)throw new $n(t,n)}),ni=(Zn=fn,function(t,e){var n=typeof e;if("number"!=n)throw new Zn(t,n);if(isNaN(e)||e<.01||1<e)throw new Zn(t,e)}),ii=(M(oi,Jn=tt),oi.prototype._getAssignableProperties=function(){return[{name:"speed",type:ni}]},oi);function oi(t,e){var n=Jn.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var ri,si=(M(li,ri=ii),li.prototype._getAssignableProperties=function(){return ri.prototype._getAssignableProperties.call(this).concat([{name:"offsetX",type:Qn},{name:"offsetY",type:Qn}])},li);function li(t,e){var n=ri.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var ai,ui,ci=(M(hi,ai=si),hi.prototype._getAssignableProperties=function(){return ai.prototype._getAssignableProperties.call(this).concat([{name:"scrollToCenter",type:ei},{name:"skipParentFrames",type:ei}])},hi);function hi(t,e){var n=ai.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}function fi(t,e){var n=ui.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}M(fi,ui=ii),fi.prototype._getAssignableProperties=function(){return ui.prototype._getAssignableProperties.call(this).concat([{name:"scrollTargetX",type:Qn},{name:"scrollTargetY",type:Qn},{name:"crop.left",type:Qn},{name:"crop.right",type:Qn},{name:"crop.top",type:Qn},{name:"crop.bottom",type:Qn},{name:"includeMargins",type:ei},{name:"includeBorders",type:ei},{name:"includePaddings",type:ei}])};var di,mi=(M(pi,di=si),pi.prototype._getAssignableProperties=function(){return di.prototype._getAssignableProperties.call(this).concat([{name:"modifiers.ctrl",type:ei},{name:"modifiers.alt",type:ei},{name:"modifiers.shift",type:ei},{name:"modifiers.meta",type:ei}])},pi);function pi(t,e){var n=di.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var vi,gi=(M(Ei,vi=mi),Ei.prototype._getAssignableProperties=function(){return vi.prototype._getAssignableProperties.call(this).concat([{name:"caretPos",type:ti}])},Ei);function Ei(t,e){var n=vi.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var yi,Si=(M(bi,yi=mi),bi.prototype._getAssignableProperties=function(){return yi.prototype._getAssignableProperties.call(this).concat([{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:ei},{name:"skipDefaultDragBehavior",type:ei}])},bi);function bi(t,e){var n=yi.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 Pi,xi,_i,Ci,Ai,wi=(M(Ti,Pi=gi),Ti.prototype._getAssignableProperties=function(){return Pi.prototype._getAssignableProperties.call(this).concat([{name:"replace",type:ei},{name:"paste",type:ei},{name:"confidential",type:ei}])},Ti);function Ti(t,e){var n=Pi.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function Mi(t,e){var n=xi.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function Ui(t,e){var n=_i.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function Di(t,e){var n=Ci.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function Ii(t,e){var n=Ai.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function ki(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Bi(t,e,n){for(var i,o=[],r=[{x1:n.left,y1:n.top,x2:n.left,y2:n.bottom,isHorizontal:!1},{x1:n.right,y1:n.top,x2:n.right,y2:n.bottom,isHorizontal:!1},{x1:n.left,y1:n.top,x2:n.right,y2:n.top,isHorizontal:!0},{x1:n.left,y1:n.bottom,x2:n.right,y2:n.bottom,isHorizontal:!0}],s=0;s<r.length;s++)(i=function(t,e,n){var i;if(n.isHorizontal)return(i=m.positionUtils.getLineXByYCoord(t,e,n.y1))&&i>=n.x1&&i<=n.x2?{x:i,y:n.y1}:null;var o=m.positionUtils.getLineYByXCoord(t,e,n.x1);return o&&o>=n.y1&&o<=n.y2?{x:n.x1,y:o}:null}(t,e,r[s]))&&o.push(i);return o.length?1===o.length||ki(t,o[0])<ki(t,o[1])?o[0]:o[1]:null}M(Mi,xi=mi),Mi.prototype._getAssignableProperties=function(){return xi.prototype._getAssignableProperties.call(this).concat([{name:"destinationOffsetX",type:Qn},{name:"destinationOffsetY",type:Qn}])},M(Ui,_i=tt),Ui.prototype._getAssignableProperties=function(){return[{name:"portraitOrientation",type:ei}]},M(Di,Ci=tt),Di.prototype._getAssignableProperties=function(){return[{name:"timeout",type:ti},{name:"allowUnawaitedPromise",type:ei}]},M(Ii,Ai=ii),Ii.prototype._getAssignableProperties=function(){return Ai.prototype._getAssignableProperties.call(this).concat([{name:"confidential",type:ei}])};var Ni=h.Promise,Oi=h.nativeMethods;function Fi(){return new Ni(function(t){return Oi.setTimeout.call(qa,t,0)})}var Yi=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},Li=h.utils.browser,Ki=(Xi.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},Xi.prototype.leaveElement=function(){},Xi.prototype.move=function(){},Xi.prototype.enterElement=function(){},Xi.prototype.dragAndDrop=function(){},Xi.prototype.teardown=function(){},Xi.prototype.run=function(t,e,n,i,o){var r=e&&m.domUtils.isElementInDocument(e),s=e&&m.domUtils.isElementInIframe(e)&&!m.domUtils.getIframeByElement(e);r&&!s||(e=null);var l=t!==e,a=l?m.domUtils.getCommonAncestor(t,e):null;this.setup(),l&&e&&this.leaveElement(t,e,a,n),Li.isIE&&this.move(t,n),l&&m.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),Li.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}},Xi);function Xi(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var Vi=h.eventSandbox.eventSimulator,Ri=h.utils.extend,Wi=h.nativeMethods,Hi=(Gi.leaveElement=function(t,e,n,i){Vi.mouseout(e,Ri({relatedTarget:t},i));for(var o=e;o&&o!==n;)Vi.mouseleave(o,Ri({relatedTarget:t},i)),o=Wi.nodeParentNodeGetter.call(o)},Gi.enterElement=function(t,e,n,i){Vi.mouseover(t,Ri({relatedTarget:e},i));for(var o=t,r=[];o&&o!==n;)r.push(o),o=m.domUtils.getParentExceptShadowRoot(o);for(var s=r.length-1;-1<s;s--)Vi.mouseenter(r[s],Ri({relatedTarget:e},i))},Gi.move=function(t,e,n){Vi[t](e,n)},Gi);function Gi(){}var zi=(qi.dragAndDrop=function(t,e,n,i){return Vi.drag(t,i),e!==n&&(m.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,Vi.dragenter(e,i)),n&&(i.relatedTarget=e,Vi.dragleave(n,i))),!Vi.dragover(e,i)},qi);function qi(){}var ji,$i=h.eventSandbox.eventSimulator,Zi=(M(Ji,ji=Ki),Ji.prototype.leaveElement=function(t,e,n,i){Hi.leaveElement(t,e,n,i)},Ji.prototype.enterElement=function(t,e,n,i){Hi.enterElement(t,e,n,i)},Ji.prototype.move=function(t,e){this._needEmulateMoveEvent()&&Hi.move(this.moveEvent,t,e)},Ji.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&m.domUtils.isElementInDocument(t)&&t!==n&&$i[this.moveEvent](t,e)},Ji.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},Ji);function Ji(t){var e=ji.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var Qi,to=(M(eo,Qi=Ki),eo.prototype.setup=function(){Qi.prototype.setup.call(this),this.dragAndDropMode=!0},eo.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=zi.dragAndDrop(t,e,n,i)},eo);function eo(){return null!==Qi&&Qi.apply(this,arguments)||this}var no,io=h.eventSandbox.eventSimulator,oo=(M(ro,no=Ki),ro.prototype.setup=function(){no.prototype.setup.call(this),this.dragAndDropMode=!0},ro.prototype.leaveElement=function(t,e,n,i){Hi.leaveElement(t,e,n,i)},ro.prototype.move=function(t,e){Hi.move(this.moveEvent,t,e)},ro.prototype.enterElement=function(t,e,n,i){Hi.enterElement(t,e,n,i)},ro.prototype.dragAndDrop=function(t,e,n,i,o){var r=io.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=zi.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},ro.prototype.run=function(t,e,n,i,o){return no.prototype.run.call(this,t,null,n,i,o)},ro);function ro(){return null!==no&&no.apply(this,arguments)||this}var so=null,lo=function(){return so},ao=function(t){so=t},uo=h.Promise,co=h.nativeMethods,ho=h.utils.featureDetection,fo=h.utils.html,mo=h.utils.url,po=h.eventSandbox.eventSimulator,vo=h.eventSandbox.message,go=h.eventSandbox.DataTransfer,Eo=h.eventSandbox.DragDataStore,yo=y.positionUtils,So=y.domUtils,bo=y.styleUtils,Po=y.eventUtils,xo=y.promiseUtils,_o=y.sendRequestToFrame,Co="automation|move|request",Ao="automation|move|response";vo.on(vo.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===Co&&(t.source.parent===qa?wo.onMoveToIframeRequest(t):(h.on(h.EVENTS.beforeUnload,function(){return vo.sendServiceMsg({cmd:Ao},t.source)}),wo.onMoveOutRequest(t)))});var wo=(To.getTarget=function(t,e,n){var i=!yo.containsOffset(t,e,n),o=i?k(t,e,n):{x:e,y:n};return{element:i?ja.documentElement:t,offsetX:o.x,offsetY:o.y}},To.onMoveToIframeRequest=function(t){var e={x:t.message.endX,y:t.message.endY},n=t.source,i=So.findIframeByWindow(n),o=bo.getBordersWidth(i),r=bo.getElementPadding(i),s=yo.getIframeClientCoordinates(i),l=yo.getIframePointRelativeToParentFrame(e,n),a=K.position,u=yo.isInRectangle(a,s)?a:Bi(a,l,s),c={x:u.x-s.left,y:u.y-s.top},h=new To(i,new Si({modifiers:t.message.modifiers,offsetX:c.x+o.left+r.left,offsetY:c.y+o.top+r.top,speed:t.message.speed,skipScrolling:!0},!1)),f={cmd:Ao,x:c.x,y:c.y};K.activeWindow!==n?h.run().then(function(){K.activeWindow=n,vo.sendServiceMsg(f,n)}):vo.sendServiceMsg(f,n)},To.onMoveOutRequest=function(t){var e=t.source,n={left:t.message.left,right:t.message.right,top:t.message.top,bottom:t.message.bottom};if(!t.message.iframeUnderCursor){var i=t.message,o=i.startX,r=i.startY,s=o-n.left,l=r-n.top,a=lo();return a&&(po.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),po.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),void vo.sendServiceMsg({cmd:Ao},e)}var u,c=K.position,h=Bi({x:n.left+c.x,y:n.top+c.y},{x:t.message.endX,y:t.message.endY},n);h?(u=new Si({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),new To(ja.documentElement,u).run().then(function(){var t={cmd:Ao,x:h.x,y:h.y};K.activeWindow=e,vo.sendServiceMsg(t,e)})):vo.sendServiceMsg({cmd:Ao,x:n.left,y:n.top},e)},To.prototype._getTargetClientPoint=function(){var t=bo.getElementScroll(this.element);if(So.isHtmlElement(this.element))return{x:Math.floor(this.offsetX-t.left),y:Math.floor(this.offsetY-t.top)};var e=yo.getClientPosition(this.element),n=this.element.tagName&&So.isBodyElement(this.element);return{x:Math.floor(n?e.x+this.offsetX:e.x+this.offsetX-t.left),y:Math.floor(n?e.y+this.offsetY:e.y+this.offsetY-t.top)}},To.prototype._emulateEvents=function(t){var e,n,i=this.holdLeftButton?Po.BUTTONS_PARAMETER.leftButton:Po.BUTTONS_PARAMETER.noButton,o=B({x:this.x,y:this.y}),r={clientX:this.x,clientY:this.y,screenX:o.x,screenY:o.y,buttons:i,ctrl:this.modifiers.ctrl,alt:this.modifiers.alt,shift:this.modifiers.shift,meta:this.modifiers.meta,dataTransfer:this.dragAndDropState.dataTransfer},s={moveEvent:this.moveEvent,holdLeftButton:this.holdLeftButton},l=(e=this.dragAndDropState.enabled,n=this.firstMovingStepOccured,new(e?n?to:oo:Zi)(s).run(t,lo(),r,this.dragElement,this.dragAndDropState.dataStore)),a=l.dragAndDropMode,u=l.dropAllowed;this.firstMovingStepOccured=!0,this.dragAndDropState.enabled=a,this.dragAndDropState.dropAllowed=u,ao(t)},To.prototype._movingStep=function(){var t,n=this;return this.touchMode&&!this.holdLeftButton?(this.x=this.endPoint.x,this.y=this.endPoint.y):this.startTime?(t=(Math.min(co.dateNow(),this.endTime)-this.startTime)/(this.endTime-this.startTime),this.x=Math.floor(this.startPoint.x+this.distanceX*t),this.y=Math.floor(this.startPoint.y+this.distanceY*t)):(this.startTime=co.dateNow(),this.endTime=this.startTime+this.movingTime,this.x+=0<this.distanceX?1:-1,this.y+=0<this.distanceY?1:-1),K.move(this.x,this.y).then($).then(function(t){var e=n.holdLeftButton&&n.touchMode?n.dragElement:t;return e?n._emulateEvents(e):null}).then(Fi)},To.prototype._isMovingFinished=function(){return this.x===this.endPoint.x&&this.y===this.endPoint.y},To.prototype._move=function(){var t=this;return this.startPoint=K.position,this.x=this.startPoint.x,this.y=this.startPoint.y,this.distanceX=this.endPoint.x-this.startPoint.x,this.distanceY=this.endPoint.y-this.startPoint.y,this.movingTime=Math.max(Math.abs(this.distanceX),Math.abs(this.distanceY))/this.cursorSpeed,this.minMovingTime&&(this.movingTime=Math.max(this.movingTime,this.minMovingTime)),xo.whilst(function(){return!t._isMovingFinished()},function(){return t._movingStep()})},To.prototype._scroll=function(){if(this.skipScrolling)return uo.resolve();var t=new ci({offsetX:this.offsetX,offsetY:this.offsetY},!1);return new A(this.element,t).run()},To.prototype._moveToCurrentFrame=function(){if(K.active)return uo.resolve();var t,e=K.position,n=e.x,i=e.y,o=K.activeWindow,r=null,s=null,l={cmd:Co,startX:n,startY:i,endX:this.endPoint.x,endY:this.endPoint.y,modifiers:this.modifiers,speed:this.speed};return o.parent===qa&&(r=So.findIframeByWindow(o),t=yo.getIframeClientCoordinates(r),l.left=t.left,l.top=t.top,l.right=t.right,l.bottom=t.bottom),$().then(function(t){return s=t===r,o.parent===qa&&(l.iframeUnderCursor=s),_o(l,Ao,o)}).then(function(t){return K.activeWindow=qa,s||b(qa)?K.move(t.x,t.y):null})},To.prototype.run=function(){var l=this;return $().then(function(t){l.dragElement=l.holdLeftButton?t:null;var e,n,i,o,r,s=function(t){for(var e=t;e;){if(e.draggable)return e;e=co.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&ho.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new Eo,l.dragAndDropState.dataTransfer=new go(l.dragAndDropState.dataStore),((e=So.isAnchorElement(l.dragElement))||So.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=mo.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=fo.cleanUpHtml(co.elementOuterHTMLGetter.call(l.dragElement)),l.dragAndDropState.dataTransfer.setData("text/plain",o),l.dragAndDropState.dataTransfer.setData("text/uri-list",o),l.dragAndDropState.dataTransfer.setData("text/html",r))),l._scroll()}).then(function(){var t=l._getTargetClientPoint(),e=t.x,n=t.y,i=bo.getWidth(qa),o=bo.getHeight(qa);return 0<=e&&e<=i&&0<=n&&n<=o?(l.endPoint={x:e,y:n},l._moveToCurrentFrame().then(function(){return l._move()})):null}).then(function(){return l.dragAndDropState})},To);function To(t,e){this.touchMode=ho.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.holdLeftButton=e.holdLeftButton,this.dragElement=null,this.dragAndDropState=new Yi,this.automationSettings=new J(e.speed);var n=To.getTarget(t,e.offsetX,e.offsetY);this.element=n.element,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=e.speed,this.cursorSpeed=this.holdLeftButton?this.automationSettings.draggingSpeed:this.automationSettings.cursorSpeed,this.minMovingTime=e.minMovingTime||null,this.modifiers=e.modifiers||{},this.skipScrolling=e.skipScrolling,this.skipDefaultDragBehavior=e.skipDefaultDragBehavior,this.endPoint=null,this.movingTime=null,this.x=null,this.y=null,this.startTime=null,this.endTime=null,this.distanceX=null,this.distanceY=null,this.firstMovingStepOccured=!1}var Mo,Uo=h.utils.extend,Do=function(t){var e=t.element,n=void 0===e?null:e,i=t.clientPoint,o=void 0===i?null:i,r=t.screenPoint,s=void 0===r?null:r,l=t.isTarget,a=void 0!==l&&l,u=t.inMoving,c=void 0!==u&&u;this.element=n,this.clientPoint=o,this.screenPoint=s,this.isTarget=a,this.inMoving=c,this.devicePoint=B(o)},Io=(M(ko,Mo=m.serviceUtils.EventEmitter),ko.prototype._getElementForEvent=function(t){var e=t.point;return j(e.x,e.y,m.positionUtils.containsOffset(this.element,this.options.offsetX,this.options.offsetY)?this.element:null).then(function(t){return t.element})},ko.prototype._moveToElement=function(){var t=this,e=new Si(Uo({skipScrolling:!0},this.options),!1);return new wo(this.element,e).run().then(function(){return m.delay(t.automationSettings.mouseActionStepDelay)})},ko.prototype._scrollToElement=function(){var s=this,t=new ci(this.options),e=new A(this.element,t),l=!1;return e.run().then(function(t){return l=t,m.delay(s.automationSettings.mouseActionStepDelay)}).then($).then(function(t){if(!t||!m.domUtils.contains(s.element,t)||!l)return null;var e=lo(),n=m.domUtils.getCommonAncestor(t,e),i=m.positionUtils.getClientPosition(t),o=B({x:i.x,y:i.y}),r={clientX:i.x,clientY:i.y,screenX:o.x,screenY:o.y,ctrl:!1,alt:!1,shift:!1,meta:!1,buttons:m.eventUtils.BUTTONS_PARAMETER.leftButton};return Hi.leaveElement(t,e,n,r),Hi.enterElement(t,e,n,r),ao(t),l})},ko.prototype._getElementOffset=function(){var t=F(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}},ko.prototype._wrapAction=function(t){var h=this,e=this._getElementOffset(),i=e.offsetX,o=e.offsetY,f=k(this.element,i,o),d=m.positionUtils.getClientPosition(this.element);return t().then(function(){var t,e,n,l=k(h.element,i,o),a=m.positionUtils.getClientPosition(h.element),u=(t=h.element,e=l,n=m.styleUtils.getElementScroll(t),!/html/i.test(t.tagName)&&m.styleUtils.hasScroll(t)&&(e.x-=n.left,e.y-=n.top),m.positionUtils.offsetToClientCoords(e)),c=m.positionUtils.containsOffset(h.element,i,o)?h.element:null;return j(u.x,u.y,c).then(function(t){var e=t.element,n=t.corrected,i=e;if(!i)return new Do({});var o=(o=!c||n||i===h.element)||-1<m.arrayUtils.indexOf(m.domUtils.getParents(i),h.element),r=f.x!==l.x||f.y!==l.y,s=d.x!==a.x||d.y!==a.y;return new Do({element:e,clientPoint:u,screenPoint:l,isTarget:o,inMoving:r&&s})})})},ko._checkElementState=function(t,e){if(!t.element)throw new Error(Z.elementIsInvisibleError);if(e&&(!t.isTarget||t.inMoving))throw new Error(Z.foundElementIsNotTarget);return t},ko.prototype._ensureElement=function(e,n,i){var o=this;return this._wrapAction(function(){return o._scrollToElement()}).then(function(t){return ko._checkElementState(t,e)}).then(function(t){return i?t:o._wrapAction(function(){return o._moveToElement()})}).then(function(t){return n||ko._checkElementState(t,e),t}).then(function(t){return o.emit(o.TARGET_ELEMENT_FOUND_EVENT,{element:t.element}),{element:t.element,clientPoint:t.clientPoint,screenPoint:t.screenPoint,devicePoint:t.devicePoint}})},ko);function ko(t,e){var n=Mo.call(this)||this;return n.TARGET_ELEMENT_FOUND_EVENT="automation|target-element-found-event",n.element=t,n.options=e,n.automationSettings=new J(e.speed),n}var Bo=h.Promise,No=h.eventSandbox.message;function Oo(t,i,e){return new Bo(function(n){No.on(No.SERVICE_MSG_RECEIVED_EVENT,function t(e){e.message.cmd===i&&(No.off(No.SERVICE_MSG_RECEIVED_EVENT,t),n(e.message))}),No.sendServiceMsg(t,e)})}var Fo=h.Promise,Yo=h.nativeMethods,Lo=h.utils.browser,Ko=h.eventSandbox.focusBlur,Xo=y.contentEditable,Vo=y.textSelection,Ro=y.domUtils,Wo=y.styleUtils,Ho=h.eventSandbox.message,Go="automation|iframe|request",zo="automation|iframe|response";function qo(v,g,E){var t=this;return new Fo(function(p){return U(t,void 0,void 0,function(){var s,n,i,o,r,l,a,u,c,h,f,d,m;return D(this,function(t){switch(t.label){case 0:return b(qa)?[4,Oo({cmd:Go},zo,qa.parent)]:[3,2];case 1:t.sent(),t.label=2;case 2:if(s=Ro.getActiveElement(),n=Ro.isTextEditableElement(v),i=Ro.closest(v,"label[for]"),o=Ro.isElementFocusable(v),r=!o&&i,l=Ro.isContentEditableElement(v),a=l?Xo.findContentEditableParent(v):v,g&&Lo.isWebKit&&n&&Vo.select(v,0,0),r)return g&&(e=i,Ro.isElementFocusable(e)?Ko.focus(e,y.noop,!1,!0):$o(e)),p(),[2];if(u=!g,c=!1,!o&&!l){if(h=Ro.findDocument(a),f=Yo.documentActiveElementGetter.call(h),d=Ro.isBodyElement(f),m=Ro.isBodyElement(a)?a:Ro.getFocusableParent(a),f&&!d&&Ro.containsElement(f,a)||d&&Ro.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return Ko.focus(a,function(){var t,e,n,i,o,r;!g||l||v===Ro.getActiveElement()?(t=v,e=E,o=Ro.isTextEditableElement(t),r=Ro.isContentEditableElement(t),o||r?r&&isNaN(parseInt(e,10))?Vo.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?Ro.getElementValue(t).length:e,Vo.select(t,n,n)):(i=Xo.findContentEditableParent(t))&&Vo.setCursorToLastVisiblePosition(Xo.findContentEditableParent(i)),g||Ro.getActiveElement()===s?p():Ko.focus(s,p,!0,!0)):p()},u,!0,!1,c),[2]}var e})})})}function jo(t){var e=Ro.closest(t,"label[for]"),n=e&&(e.control||ja.getElementById(e.htmlFor));return n&&Wo.isElementVisible(n)?n:null}function $o(t){var e=jo(t);e&&Ro.getActiveElement()!==e&&Ko.focus(e,y.noop,!1,!0)}Ho.on(Ho.SERVICE_MSG_RECEIVED_EVENT,function(t){var e;t.message.cmd===Go&&(e=Ro.findIframeByWindow(t.source),Ko.focus(e,function(){Ho.sendServiceMsg({cmd:zo},t.source)},!1))});var Zo=h.utils.browser,Jo=h.eventSandbox.eventSimulator,Qo=h.eventSandbox.listeners,tr=y.domUtils,er=y.styleUtils,nr=o.selectElement,ir=(or.prototype.run=function(){this.eventState.clickElement&&Jo.click(this.eventState.clickElement,this.eventArgs.options),tr.isElementFocusable(this.eventArgs.element)||$o(this.eventArgs.element)},or);function or(t,e){this.eventState=t,this.eventArgs=e}var rr,sr=(M(lr,rr=ir),lr.prototype.run=function(){function t(t){n=t.target===e.input}var e=this,n=!1;Qo.addInternalEventBeforeListener(qa,["focus"],t),rr.prototype.run.call(this),Qo.removeInternalEventBeforeListener(qa,["focus"],t),tr.isElementFocusable(this.label)&&!n&&this._ensureBoundElementFocusRaised()},lr.prototype._ensureBoundElementFocusRaised=function(){Jo.focus(this.input)},lr);function lr(t,e){var n=rr.call(this,t,e)||this;return n.label=n.eventArgs.element,n.input=jo(n.eventArgs.element),n}var ar,ur=(M(cr,ar=ir),cr.prototype.run=function(){ar.prototype.run.call(this),this._toggleSelectOptionList()},cr.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===er.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(nr.isOptionListExpanded(t)?nr.collapseOptionList():nr.expandOptionList(t))},cr);function cr(t,e){return ar.call(this,t,e)||this}var hr,fr=(M(dr,hr=ir),dr.prototype.run=function(){return this.eventArgs.element},dr);function dr(t,e){return hr.call(this,t,e)||this}var mr,pr=(M(vr,mr=sr),vr.prototype.run=function(){function t(){e=!0}var e=!1;Qo.addInternalEventBeforeListener(qa,["change"],t),mr.prototype.run.call(this),Qo.removeInternalEventBeforeListener(qa,["change"],t),Zo.isChrome&&!e&&this._ensureCheckboxStateChanged()},vr.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,Jo.change(this.checkbox)},vr);function vr(t,e){var n=mr.call(this,t,e)||this;return n.checkbox=n.input,n}var gr,Er=h.Promise,yr=h.utils.extend,Sr=h.utils.browser,br=h.utils.featureDetection,Pr=h.eventSandbox.eventSimulator,xr=h.eventSandbox.listeners,_r=y.domUtils,Cr=y.eventUtils,Ar=y.arrayUtils,wr=y.delay,Tr=(M(Mr,gr=Io),Mr.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Cr.preventDefault(t),Cr.unbind(e.element,"mousedown",n)};Cr.bind(this.element,"mousedown",n)},Mr.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,Cr.unbind(t,"blur",n,!0)};Cr.bind(t,"blur",n,!0)},Mr.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},Mr.prototype._raiseTouchEvents=function(t){br.isTouchDevice&&(this.eventState.touchStartCancelled=!Pr.touchstart(t.element,t.options),this.eventState.touchEndCancelled=!Pr.touchend(t.element,t.options))},Mr.prototype._mousedown=function(n){var i=this;return this.targetElementParentNodes=_r.getParents(n.element),this.mouseDownElement=n.element,K.leftButtonDown().then(function(){i._raiseTouchEvents(n);var t=_r.getActiveElement();i.activeElementBeforeMouseDown=t;var e=(Sr.isWebKit||Sr.isIE)&&_r.isSelectElement(i.mouseDownElement);return e&&i._bindMousedownHandler(),i._bindBlurHandler(t),i._isTouchEventWasCancelled()||(i.eventState.simulateDefaultBehavior=Pr.mousedown(n.element,n.options)),!1===i.eventState.simulateDefaultBehavior&&(i.eventState.simulateDefaultBehavior=e&&!i.eventState.mousedownPrevented),i._ensureActiveElementBlur(t)}).then(function(){return i._focus(n)})},Mr.prototype._ensureActiveElementBlur=function(e){var n=this;return new Er(function(t){_r.getActiveElement()===e||n.eventState.blurRaised?t():Sr.isIE&&Sr.version<12?Fi().then(function(){n.eventState.blurRaised||Pr.blur(e),t()}):(Pr.blur(e),t())})},Mr.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?Er.resolve():qo(_r.isContentEditableElement(this.element)?this.element:t.element,!Sr.isIE||this.activeElementBeforeMouseDown===_r.getActiveElement(),this.caretPos)},Mr._getElementForClick=function(t,e,n){var i=_r.getParents(e),o=_r.isTheSameNode(e,t);return Sr.isFirefox?o?t:null:o?Ar.equals(n,i)?t:null:t.contains(e)&&!_r.isEditableFormElement(e)?t:e.contains(t)?e:Ar.getCommonElement(i,n)},Mr.prototype._mouseup=function(i){var o=this;return K.buttonUp().then(function(){return o._getElementForEvent(i)}).then(function(t){i.element=t,o.eventState.clickElement=Mr._getElementForClick(o.mouseDownElement,t,o.targetElementParentNodes);var e={},n=function(t){e=t.timeStamp,xr.removeInternalEventBeforeListener(qa,["mouseup"],n)};return Sr.isIE||xr.addInternalEventBeforeListener(qa,["mouseup"],n),o._isTouchEventWasCancelled()||Pr.mouseup(t,i.options),{timeStamp:e}})},Mr.prototype._click=function(t){var e,n,i,o,r,s,l,a=(e=this.eventState,i=jo((n=t).element),o=tr.isSelectElement(n.element),r=tr.isOptionElement(n.element),s=tr.isLabelElement(n.element)&&i,l=i&&tr.isCheckboxElement(i),new(o?ur:r?fr:l?pr:s?sr:ir)(e,n));return this._isTouchEventWasCancelled()||a.run(),t},Mr.prototype.run=function(t){var r=this,s=null;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.screenPoint,o=t.devicePoint;return s={point:n,screenPoint:i,element:e,options:yr({clientX:n.x,clientY:n.y,screenX:o.x,screenY:o.y},r.modifiers)},Er.all([wr(r.automationSettings.mouseActionStepDelay),r._mousedown(s)])}).then(function(){return r._mouseup(s)}).then(function(t){var e=t.timeStamp;return s.options.timeStamp=e,r._click(s)})},Mr);function Mr(t,e){var n=gr.call(this,t,e)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.targetElementParentNodes=[],n.activeElementBeforeMouseDown=null,n.mouseDownElement=null,n.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null,touchStartCancelled:!1,touchEndCancelled:!1},n}var Ur=h.Promise,Dr=h.utils.browser,Ir=h.utils.featureDetection,kr=h.eventSandbox.eventSimulator,Br=h.eventSandbox.focusBlur,Nr=h.nativeMethods,Or=y.domUtils,Fr=y.styleUtils,Yr=y.delay,Lr=o.selectElement,Kr=Ir.isTouchDevice?0:160,Xr=(Vr.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?Lr.getEmulatedChildElement(this.element):this.element,e=1<Fr.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Dr.isIE&&e?this.parentSelect:t}},Vr.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=O(n=Lr.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=ja.documentElement,i=(e=Lr.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},Vr.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Si({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return new wo(n,s).run().then(function(){return Yr(e.automationSettings.mouseActionStepDelay)})},Vr.prototype._mousedown=function(){var t=this;return Dr.isFirefox?(kr.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Dr.isIE?(kr.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Yr(Kr)}).then(function(){kr.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},Vr.prototype._focus=function(){var e=this;return new Ur(function(t){Br.focus(e.parentSelect,t,!1,!0)})},Vr.prototype._mouseup=function(){var t=Dr.isIE?this.parentSelect:this.eventsArgs.element;kr.mouseup(t,this.eventsArgs.options),Dr.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=Dr.isFirefox||Dr.isSafari||Dr.isChrome&&53<=Dr.version,n=e||Dr.isIE;return e&&this.clickCausesChange&&kr.input(this.parentSelect),n&&this.clickCausesChange&&kr.change(this.parentSelect),Ur.resolve()},Vr.prototype._click=function(){kr.click(this.eventsArgs.element,this.eventsArgs.options)},Vr.prototype.run=function(){var t=this;if(!this.parentSelect)return kr.click(this.eventsArgs.element,this.eventsArgs.options),Ur.resolve();this.optionListExpanded||Lr.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Fr.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()})},Vr);function Vr(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 J(e.speed),this.parentSelect=Or.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&Lr.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=Or.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=Or.getElementIndexInParent(this.parentSelect,this.element),o=Nr.nodeParentNodeGetter.call(this.element),r=Or.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 Rr,Wr=h.utils.featureDetection,Hr=h.utils.browser,Gr=h.eventSandbox.eventSimulator,zr=y.eventUtils,qr=y.delay,jr=Wr.isTouchDevice?0:160,$r=(M(Zr,Rr=Io),Zr.prototype._firstClick=function(t){var e=this,n=new gi(this.options);n.speed=1;var i=new Tr(this.element,n);return i.on(i.TARGET_ELEMENT_FOUND_EVENT,function(t){return e.emit(e.TARGET_ELEMENT_FOUND_EVENT,t)}),i.run(t).then(function(t){return qr(jr).then(function(){return t})})},Zr.prototype._secondClick=function(t){var e=this;Hr.isIE&&zr.bind(ja,"focus",zr.preventDefault,!0);var n=new gi({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new Tr(ja.documentElement,n);return i.run().then(function(t){return e.eventState.dblClickElement=i.eventState.clickElement,Hr.isIE&&zr.unbind(ja,"focus",zr.preventDefault,!0),t})},Zr.prototype._dblClick=function(t){this.eventState.dblClickElement&&Gr.dblclick(this.eventState.dblClickElement,t.options)},Zr.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)})},Zr);function Zr(t,e){var n=Rr.call(this,t,e)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new J(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var Jr,Qr=h.Promise,ts=h.utils.extend,es=h.utils.featureDetection,ns=h.eventSandbox.eventSimulator,is=h.eventSandbox.focusBlur,os=(M(rs,Jr=Io),rs.prototype._getEndPoint=function(){throw new Error("Not implemented")},rs.prototype._mousedown=function(t){var e=this;return K.leftButtonDown().then(function(){return e.simulateDefaultBehavior=ns[e.downEvent](t.element,t.options),e._focus(t)})},rs.prototype._focus=function(n){var i=this;return new Qr(function(t){var e=m.domUtils.isContentEditableElement(i.element)?m.contentEditable.findContentEditableParent(i.element):n.element;is.focus(e,t,!1,!0)})},rs.prototype._getDestination=function(){throw new Error("Not implemented")},rs.prototype._drag=function(){var e=this,t=this._getDestination(),n=t.element,i=t.offsets,o=t.endPoint;this.endPoint=o;var r=new Si({offsetX:i.offsetX,offsetY:i.offsetY,modifiers:this.modifiers,speed:this.speed,minMovingTime:25,holdLeftButton:!0,skipDefaultDragBehavior:!1===this.simulateDefaultBehavior},!1);return new wo(n,r).run().then(function(t){return e.dragAndDropState=t,m.delay(e.automationSettings.mouseActionStepDelay)})},rs.prototype._mouseup=function(){var r=this;return K.buttonUp().then(function(){var n=m.positionUtils.offsetToClientCoords(r.endPoint),i=null,o=ts({clientX:n.x,clientY:n.y},r.modifiers);return j(n.x,n.y).then(function(t){var e=t.element;return(i=e)?(r.dragAndDropState.enabled?(o.dataTransfer=r.dragAndDropState.dataTransfer,r.dragAndDropState.dropAllowed&&ns.drop(i,o),ns.dragend(r.dragAndDropState.element,o),r.dragAndDropState.dataStore.setProtectedMode()):ns[r.upEvent](i,o),j(n.x,n.y)):i}).then(function(t){var e=t.element;i&&e===i&&!r.dragAndDropState.enabled&&ns.click(i,o)})})},rs.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:ts({clientX:n.x,clientY:n.y},o.modifiers)},Qr.all([m.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},rs);function rs(t,e){var n=Jr.call(this,t,e)||this;return n.modifiers=e.modifiers,n.speed=e.speed,n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=es.isTouchDevice?"touchstart":"mousedown",n.upEvent=es.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var ss,ls=y.styleUtils,as=(M(us,ss=os),us.prototype._getDestination=function(){var t=k(this.element,this.offsetX,this.offsetY),e=ls.getWidth(ja),n=ls.getHeight(ja),i={x:t.x+this.dragOffsetX,y:t.y+this.dragOffsetY},i={x:Math.min(Math.max(0,i.x),e),y:Math.min(Math.max(0,i.y),n)};return{element:ja.documentElement,offsets:{offsetX:i.x,offsetY:i.y},endPoint:i}},us);function us(t,e,n,i){var o=ss.call(this,t,i)||this;return o.dragOffsetX=e,o.dragOffsetY=n,o}var cs,hs=y.positionUtils,fs=(M(ds,cs=os),ds.prototype._getDestination=function(){var t=this.destinationElement,e=hs.getElementRectangle(t),n=F(t,this.destinationOffsetX,this.destinationOffsetY);return{element:t,offsets:n,endPoint:{x:e.left+n.offsetX,y:e.top+n.offsetY}}},ds);function ds(t,e,n){var i=cs.call(this,t,n)||this;return i.destinationElement=e,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var ms,ps=(M(vs,ms=Io),vs.prototype.run=function(t){return this._ensureElement(t,!0)},vs);function vs(t,e){return ms.call(this,t,e)||this}var gs=h.utils.browser,Es=h.sandbox.event,ys=h.eventSandbox.eventSimulator,Ss=h.eventSandbox.listeners,bs=h.nativeMethods,Ps=y.domUtils,xs=y.contentEditable,_s=y.textSelection,Cs=/ /g;function As(t){var e=_s.getSelectionByElement(t),n=_s.hasInverseSelectionContentEditable(t);return _s.hasElementContainsSelection(t)?xs.getSelection(t,e,n):{startPos:xs.calculateNodeAndOffsetByPosition(t,0),endPos:xs.calculateNodeAndOffsetByPosition(t,0)}}function ws(t){var e=t.startPos.node,n=t.startPos.offset,i=t.endPos.offset,o=xs.getFirstNonWhitespaceSymbolIndex(e.nodeValue),r=xs.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 Ts(t,e,n){return!n||ys.beforeInput(t,e)}function Ms(t,e){var n;function i(t){t.preventDefault(),n=!0}function o(t){"textInput"===t.type&&(n=!1)}gs.isSafari&&(Ss.addInternalEventBeforeListener(qa,["textInput"],i),Es.on(Es.EVENT_PREVENTED_EVENT,o));var r=gs.isFirefox||ys.textInput(t,e)||n;return gs.isSafari&&(Ss.removeInternalEventBeforeListener(qa,["textInput"],i),Es.off(Es.EVENT_PREVENTED_EVENT,o)),r||gs.isIE11}function Us(t,e){var n,i,o,r,s,l,a,u,c,h,f,d=As(t),m=d.startPos.node,p=d.endPos.node,v=!0,g=!0,E=e;function y(){g=!1}function S(t,e,n){n()}e=e.replace(Cs,String.fromCharCode(160)),m&&p&&Ps.isContentEditableElement(m)&&Ps.isContentEditableElement(p)&&(Ps.isTheSameNode(m,p)||(_s.deleteSelectionContents(t),n=t,o=(i=d).startPos.node,r=bs.nodeParentNodeGetter.call(o)&&o.parentElement,!(gs.isChrome&&gs.version<58||gs.isSafari)&&r&&Ps.isElementContainsNode(n,o)||(i=As(n),_s.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&Ps.isContentEditableElement(m)&&Ps.isRenderedNode(m)&&Ts(t,e,gs.isChrome)&&(v=Ms(t,E),g=v&&!gs.isIE11,Ss.addInternalEventBeforeListener(qa,["input"],y),Ss.addInternalEventBeforeListener(qa,["textinput"],S),(v=v&&Ts(t,e,gs.isSafari))&&(Ps.isElementNode(m)?(s=m,l=e,c=ja.createTextNode(l),h={node:c,offset:l.length},f=bs.nodeParentNodeGetter.call(s),"br"===Ps.getTagName(s)?f.insertBefore(c,s):0<a?(u=bs.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),_s.selectByNodesAndOffsets(h,h)):function(t,e,n){var i=e.startPos.node;Ps.isElementContainsNode(t,i)||(i=(e=ws(As(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),_s.selectByNodesAndOffsets(l,l)}(t,ws(d),e)),Fi().then(function(){g&&ys.input(t,e),Ss.removeInternalEventBeforeListener(qa,["input"],y),Ss.removeInternalEventBeforeListener(qa,["textinput"],S)})))}function Ds(t,e,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;Ps.isContentEditableElement(t)&&Us(t,e),Ps.isElementReadOnly(t)||(Ps.isTextEditableElement(t)?(l=t,a=e,h=Ps.getElementValue(l),f=a.length,d=_s.getSelectionStart(l),m=_s.getSelectionEnd(l),p=Ps.isInputElement(l)&&"number"===l.type,Ts(l,a,gs.isChrome)&&Ms(l,a)&&Ts(l,a,gs.isSafari)&&((u=!gs.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=gs.isIE&&gs.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&gs.isIOS&&"."===h[h.length-1]&&(d+=1),Ps.setElementValue(l,c),_s.select(l,d+f,d+f)),ys.input(l,a))):Ps.isInputElement(t)&&(i=t,o=e,null!==(r=n)?(s=Ps.getElementValue(i),Ps.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):Ps.setElementValue(i,o),ys.change(i),ys.input(i,o)))}function Is(t){return 1===t.length&&("a"<=t&&t<="z"||"A"<=t&&t<="Z")}var ks=h.nativeMethods,Bs=h.utils.browser,Ns=h.eventSandbox.focusBlur,Os=h.Promise,Fs=m.domUtils.findDocument,Ys=m.domUtils.isRadioButtonElement,Ls=m.domUtils.getActiveElement;function Ks(t){return t===t.toLowerCase()?t.toUpperCase():t.toLowerCase()}function Xs(t){var e=Ls(t||ja),n=null;if(e&&m.domUtils.isIframeElement(e)&&ks.contentDocumentGetter.call(e))try{n=Xs(ks.contentDocumentGetter.call(e))}catch(t){}return n||e}function Vs(t,e,n){if(!Ys(e))return t;if(!n&&!e.name&&!Bs.isChrome)return[e];var i,o,r=(i=e,o=null,n?""===i.name||Bs.isFirefox||(o=function(t){return!t.name||t===i||t.name!==i.name}):""!==i.name?o=function(t){return Ys(t)&&t.name===i.name}:Bs.isChrome&&(o=function(t){return Ys(t)&&!t.name}),o);return r&&(t=m.arrayUtils.filter(t,r)),t}function Rs(t,e,n){var i,o,r,s,l,a=e?-1:1,u=Vs(u=m.domUtils.getFocusableElements(Fs(t),!0),t,n),c=Ys(t),h=m.arrayUtils.indexOf(u,t);return(e?0===h:h===u.length-1)?n||!c?ja.body:u[u.length-1-h]:e&&-1===h?u[u.length-1]:(o=(i=u)[h+a],r=n,s=Ys(o)&&o.name&&!o.checked,l=null,r&&s&&(l=m.arrayUtils.find(i,function(t){return Ys(t)&&t.name===o.name&&t.checked})),l||o)}function Ws(t){if(Is(t))return t.toUpperCase().charCodeAt(0);var e=m.KEY_MAPS.shiftMap[t]?m.KEY_MAPS.shiftMap[t].charCodeAt(0):t.charCodeAt(0);return m.KEY_MAPS.symbolCharCodeToKeyCode[e]||e}var Hs={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 Gs(t){return Is(t)?Hs.LETTERS[t.toLowerCase()]:Hs.SYMBOLS[t]||Hs.SPECIAL_KEYS[t]||t}function zs(t,e,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=t?"":n),"key"in KeyboardEvent.prototype&&(i.key=e),i}var qs=h.utils.browser,js=h.utils.extend,$s=h.eventSandbox.eventSimulator,Zs=(Js._isKeyActivatedInputElement=function(t){return m.domUtils.isInputElement(t)&&/button|submit|reset|radio|checkbox/.test(t.type)},Js.prototype._type=function(t,e){var n,i=t!==this.storedActiveElement,o=!i,r=t,s=m.domUtils.isEditableElement(t),l=m.domUtils.isEditableElement(this.storedActiveElement);try{i&&(n=m.domUtils.isElementInIframe(t)===m.domUtils.isElementInIframe(this.storedActiveElement)||l,o=(!qs.isFirefox||l)&&(!qs.isWebKit||n))}catch(t){}o&&(!qs.isIE&&i&&l&&s&&(r=this.storedActiveElement),Ds(r,e))},Js.prototype._addKeyPropertyToEventOptions=function(t){return js(t,zs("keypress"===t.type,this.keyProperty,this.keyIdentifierProperty)),t},Js.prototype.down=function(t){this.storedActiveElement=Xs(this.topSameDomainDocument),this.modifierKeyCode&&(t[this.sanitizedKey]=!0),t.shift&&this.isLetter&&(this.keyProperty=Ks(this.keyProperty));var e={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(e),$s.keydown(this.storedActiveElement,js(e,t))},Js.prototype.press=function(t){if(!this.isChar&&!this.specialKeyCode)return!0;var e=Xs(this.topSameDomainDocument),n=this.isChar?function(t,e){if("space"===t)return" ";if(e){if(Is(t))return Ks(t);if(m.KEY_MAPS.reversedShiftMap[t])return m.KEY_MAPS.reversedShiftMap[t]}return t}(this.sanitizedKey,t.shift):null,i=this.specialKeyCode||n.charCodeAt(0),o=e!==this.storedActiveElement;if(qs.isWebKit&&o&&m.domUtils.isElementInIframe(e)!==m.domUtils.isElementInIframe(this.storedActiveElement))return!0;this.storedActiveElement=e;var r={keyCode:i,charCode:i,type:"keypress"};this._addKeyPropertyToEventOptions(r);var s=qs.isAndroid||$s.keypress(e,js(r,t));if(!s)return s;e=Xs(this.topSameDomainDocument),!n||t.ctrl||t.alt||this._type(e,n);var l=Js._isKeyActivatedInputElement(e),a=m.domUtils.isButtonElement(e),u=qs.isSafari&&0<=qs.compareVersions([qs.webkitVersion,"603.1.30"]);return qs.isFirefox||u||!l&&!a||"enter"!==this.sanitizedKey||e.click(),s},Js.prototype.up=function(t){this.modifierKeyCode&&(t[this.sanitizedKey]=!1);var e={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(e);var n=$s.keyup(Xs(this.topSameDomainDocument),js(e,t)),i=Xs(this.topSameDomainDocument);return!qs.isFirefox&&!qs.isSafari&&(!qs.isChrome||53<=qs.version)&&n&&"space"===this.sanitizedKey&&Js._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty(Js.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),Js);function Js(t,e){this.isLetter=Is(t),this.isChar=1===t.length||"space"===t,this.sanitizedKey=m.getSanitizedKey(t),this.modifierKeyCode=m.KEY_MAPS.modifiers[this.sanitizedKey],this.specialKeyCode=m.KEY_MAPS.specialKeys[this.sanitizedKey],this.keyCode=null,this.keyIdentifierProperty=Gs(e),this.topSameDomainDocument=m.domUtils.getTopSameDomainWindow(qa).document,this.keyProperty=m.KEY_MAPS.keyProperty[e]||e,this.isChar&&"space"!==t?this.keyCode=Ws(this.sanitizedKey):this.modifierKeyCode?this.keyCode=this.modifierKeyCode:this.specialKeyCode&&(this.keyCode=this.specialKeyCode),this.storedActiveElement=null}var Qs,tl={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"},el=h.Promise,nl=h.utils.browser,il=h.eventSandbox.eventSimulator,ol=h.eventSandbox.elementEditingWatcher,rl=y.textSelection,sl=y.eventUtils,ll=y.domUtils,al=o.selectElement,ul=null,cl=null;function hl(){cl=ul=null,sl.unbind(this,"blur",hl,!0)}function fl(t){var e,n,i,o;ll.isTextAreaElement(t)&&(ul!==t&&(sl.bind(t,"blur",hl,!0),ul=t),e=t,n=rl.hasInverseSelection(e),i=ll.getTextAreaValue(e),o=n?rl.getSelectionStart(e):rl.getSelectionEnd(e),cl=i&&o?ll.getTextareaIndentInLine(e,o):0)}function dl(t,e){var n,i,o,r,s,l,a=ll.getTextAreaValue(t);a&&(n=rl.getSelectionStart(t),i=rl.getSelectionEnd(t),o=rl.hasInverseSelection(t),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==cl&&ul===t||fl(t),s=l.lastIndexOf("\n"),pl(t,n,i,o,Math.min(s+1+cl,l.length),e))}function ml(t,e){var n,i,o,r,s,l,a,u,c,h,f=ll.getTextAreaValue(t);f&&(n=rl.getSelectionStart(t),i=rl.getSelectionEnd(t),u=(r=(o=rl.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!==cl&&ul===t||fl(t),pl(t,n,i,o,u=Math.min(u+cl,u+h),e))}function pl(t,e,n,i,o,r){var s=null,l=null,l=r?(s=e!==n&&i?n:e,o):s=o;rl.select(t,s,l)}function vl(t,e,n){ll.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))),ll.setElementValue(t,e),rl.select(t,n,n),il.input(t)}function gl(t,e){var n,i,o,r,s,l,a,u;return ll.isTextEditableElement(t)&&(n=rl.getSelectionStart(t),i=rl.getSelectionEnd(t),o=rl.hasInverseSelection(t),s=null,s=(r=!ll.isTextAreaElement(t)||ll.getTextareaLineNumberByPosition(t,n)===ll.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,a=-1===(l=ll.getElementValue(t).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=e?s:a,rl.select(t,u,a)):o?rl.select(t,i,a):rl.select(t,n,a)),el.resolve()}function El(t,e){var n,i,o,r,s,l,a,u,c;return ll.isTextEditableElement(t)&&(n=rl.getSelectionStart(t),i=rl.getSelectionEnd(t),o=rl.hasInverseSelection(t),s=null,u=s=(r=!ll.isTextAreaElement(t)||ll.getTextareaLineNumberByPosition(t,n)===ll.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=ll.getElementValue(t).substring(s)).indexOf("\n"))?l.length:a,r?(c=e?s:u,rl.select(t,c,u)):o?rl.select(t,i,u):rl.select(t,n,u)),el.resolve()}function yl(t){return gl(t,!0)}function Sl(t){return El(t,!0)}function bl(t){return ll.isRadioButtonElement(t)&&!nl.isFirefox}function Pl(t,e){return xl(t,e,!1).then(function(t){t&&(t.checked=!0)})}function xl(t,e,n){return void 0===n&&(n=!0),t?(ll.isSelectElement(t)&&al.collapseOptionList(),i=t,o=e,r=n,new Os(function(t){var e=Rs(i,o,r);e?Ns.focus(e,function(){return t(e)}):t()}).then(function(t){return t&&ll.isTextEditableInput(t)&&rl.select(t),t})):el.resolve();var i,o,r}var _l=((Qs={})[tl.ctrlA]=function(t){return ll.isEditableElement(t)&&rl.select(t),el.resolve()},Qs[tl.backspace]=function(t){var e,n,i;return ll.isTextEditableElementAndEditingAllowed(t)&&(e=rl.getSelectionStart(t),n=rl.getSelectionEnd(t),i=ll.getElementValue(t).replace(/\r\n/g,"\n"),n===e?0<e&&vl(t,i.substring(0,e-1)+i.substring(n,i.length),e-1):vl(t,i.substring(0,e)+i.substring(n,i.length),e)),ll.isContentEditableElement(t)&&rl.deleteSelectionContents(t),el.resolve()},Qs[tl.delete]=function(t){var e,n,i;return ll.isTextEditableElementAndEditingAllowed(t)&&(e=rl.getSelectionStart(t),n=rl.getSelectionEnd(t),i=ll.getElementValue(t).replace(/\r\n/g,"\n"),n===e?e<i.length&&vl(t,i.substring(0,e)+i.substring(n+1,i.length),e):vl(t,i.substring(0,e)+i.substring(n,i.length),e)),ll.isContentEditableElement(t)&&rl.deleteSelectionContents(t),el.resolve()},Qs[tl.left]=function(t){var e,n,i,o,r=null;return ll.isSelectElement(t)&&al.switchOptionsByKeys(t,"left"),bl(t)?Pl(t,!0):(ll.isTextEditableElement(t)&&(e=(r=rl.getSelectionStart(t)||0)===rl.getSelectionEnd(t)?r-1:r,rl.select(t,e,e),fl(t)),ll.isContentEditableElement(t)&&(r=rl.getSelectionStart(t))!==rl.getSelectionEnd(t)&&(n=rl.getSelectionByElement(t),o={node:(i=rl.hasInverseSelectionContentEditable(t))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},rl.selectByNodesAndOffsets(o,o,!0)),el.resolve())},Qs[tl.right]=function(t){var e,n,i,o,r=null,s=null;return ll.isSelectElement(t)&&al.switchOptionsByKeys(t,"right"),bl(t)?Pl(t,!1):(ll.isTextEditableElement(t)&&(e=(r=rl.getSelectionStart(t))===(s=rl.getSelectionEnd(t))?s+1:s,r===ll.getElementValue(t).length&&(e=r),rl.select(t,e,e),fl(t)),ll.isContentEditableElement(t)&&(r=rl.getSelectionStart(t))!==(s=rl.getSelectionEnd(t))&&(n=rl.getSelectionByElement(t),o={node:(i=rl.hasInverseSelectionContentEditable(t))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},rl.selectByNodesAndOffsets(o,o,!0)),el.resolve())},Qs[tl.up]=function(t){return ll.isSelectElement(t)&&al.switchOptionsByKeys(t,"up"),bl(t)?Pl(t,!0):nl.isWebKit&&ll.isInputElement(t)?gl(t):(ll.isTextAreaElement(t)&&dl(t,!1),el.resolve())},Qs[tl.down]=function(t){return ll.isSelectElement(t)&&al.switchOptionsByKeys(t,"down"),bl(t)?Pl(t,!1):nl.isWebKit&&ll.isInputElement(t)?El(t):(ll.isTextAreaElement(t)&&ml(t,!1),el.resolve())},Qs[tl.shiftLeft]=function(t){var e,n;return ll.isTextEditableElement(t)&&((e=rl.getSelectionStart(t))===(n=rl.getSelectionEnd(t))||rl.hasInverseSelection(t)?rl.select(t,n,Math.max(e-1,0)):rl.select(t,e,Math.max(n-1,0)),fl(t)),el.resolve()},Qs[tl.shiftRight]=function(t){var e,n,i;return ll.isTextEditableElement(t)&&(e=rl.getSelectionStart(t),n=rl.getSelectionEnd(t),i=ll.getElementValue(t).length,e!==n&&rl.hasInverseSelection(t)?rl.select(t,n,Math.min(e+1,i)):rl.select(t,e,Math.min(n+1,i)),fl(t)),el.resolve()},Qs[tl.shiftUp]=function(t){return nl.isWebKit&&ll.isInputElement(t)?yl(t):(ll.isTextAreaElement(t)&&dl(t,!0),el.resolve())},Qs[tl.shiftDown]=function(t){return nl.isWebKit&&ll.isInputElement(t)?Sl(t):(ll.isTextAreaElement(t)&&ml(t,!0),el.resolve())},Qs[tl.shiftHome]=yl,Qs[tl.shiftEnd]=Sl,Qs[tl.home]=gl,Qs[tl.end]=El,Qs[tl.enter]=function(t){var e,n,i,o,r,s;return ll.isSelectElement(t)&&al.collapseOptionList(),ll.isInputElement(t)?(nl.isIE||ol.processElementChanging(t),(e=ll.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)il.click(i);else if(ll.blocksImplicitSubmission(e)){for(var r=t.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)ll.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===e&&e.validity.valid&&il.submit(t)&&t.submit()}}(e,t)):ll.isTextAreaElement(t)?(n=rl.getSelectionStart(t),o=(i=ll.getTextAreaValue(t)).substring(0,n),r=i.substring(n),s=n+1,vl(t,o+String.fromCharCode(10)+r,s)):t.tagName&&ll.isAnchorElement(t)&&il.click(t),el.resolve()},Qs[tl.tab]=function(t){return xl(t,!1)},Qs[tl.shiftTab]=function(t){return xl(t,!0)},Qs[tl.esc]=function(t){return ll.isSelectElement(t)&&al.collapseOptionList(),el.resolve()},Qs),Cl=h.Promise,Al=h.utils.browser,wl=h.eventSandbox.message,Tl=h.nativeMethods,Ml="automation|press|request",Ul="automation|press|response";wl.on(wl.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===Ml&&(h.on(h.EVENTS.beforeUnload,function(){return wl.sendServiceMsg({cmd:Ul},t.source)}),new Dl(t.message.keyCombinations,t.message.options).run().then(function(){return wl.sendServiceMsg({cmd:Ul},t.source)}))});var Dl=(Il._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;m.KEY_MAPS.shiftMap[o]?t[n+1]=m.KEY_MAPS.shiftMap[o]:m.KEY_MAPS.reversedShiftMap[o]&&(e[n+1]=m.KEY_MAPS.reversedShiftMap[o])}!m.KEY_MAPS.shiftMap[i]||t[n-1]&&"shift"===t[n-1].toLowerCase()||(t[n]=m.KEY_MAPS.shiftMap[i],t.splice(n,0,"shift"),e.splice(n,0,"shift"),n++)}return{actualKeys:t,eventKeyProperties:e}}(m.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return m.arrayUtils.map(n,function(t,e){return new Zs(t,i[e])})},Il._getShortcuts=function(t){for(var e=m.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("+");_l[s]?(n.push(s),i=o=[]):o.shift()}return n},Il._getShortcutHandlers=function(t){for(var e,n,i,o=Il._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)]=_l[e],t=t.substring(n+i);return r},Il.prototype._down=function(t){this.pressedKeyString+=(this.pressedKeyString?"+":"")+t.key;var e=!t.down(this.modifiersState);return Cl.resolve(e)},Il.prototype._press=function(t,e){var n=this;if(e&&!this.isSelectElement)return m.delay(this.automationSettings.keyActionStepDelay);var i=this.shortcutHandlers[this.pressedKeyString],o=!1;return i&&!Al.isFirefox&&"enter"!==t.key||(o=!t.press(this.modifiersState)),o&&!this.isSelectElement||!i?m.delay(this.automationSettings.keyActionStepDelay):i(Xs(this.topSameDomainDocument)).then(function(){return m.delay(n.automationSettings.keyActionStepDelay)})},Il.prototype._up=function(t){return t.up(this.modifiersState),m.delay(this.automationSettings.keyActionStepDelay)},Il.prototype._runCombination=function(t){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=m.domUtils.isSelectElement(Xs(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=Il._getShortcutHandlers(t);var e=Il._getKeyPressSimulators(t);return m.promiseUtils.each(e,function(e){return n._down(e).then(function(t){return n._press(e,t)})}).then(function(){return m.arrayUtils.reverse(e),m.promiseUtils.each(e,function(t){return n._up(t)})})},Il.prototype.run=function(){var e=this,t=m.domUtils.getActiveElement(),n=m.domUtils.isIframeElement(t);if(!b(qa)&&n&&Tl.contentWindowGetter.call(t)){var i={cmd:Ml,keyCombinations:this.keyCombinations,options:this.options};return m.sendRequestToFrame(i,Ul,Tl.contentWindowGetter.call(t))}return m.promiseUtils.each(this.keyCombinations,function(t){return e._runCombination(t).then(function(){return m.delay(e.automationSettings.keyActionStepDelay)})})},Il);function Il(t,e){this.keyCombinations=t,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=m.domUtils.getTopSameDomainWindow(qa).document,this.automationSettings=new J(e.speed),this.options=e}var kl,Bl=h.Promise,Nl=h.utils.extend,Ol=h.utils.browser,Fl=h.eventSandbox.eventSimulator,Yl=y.domUtils,Ll=y.eventUtils,Kl=y.delay,Xl=(M(Vl,kl=Io),Vl.prototype._mousedown=function(t){var e=this;return K.rightButtonDown().then(function(){e.eventState.activeElementBeforeMouseDown=Yl.getActiveElement(),e.eventState.simulateDefaultBehavior=Fl.mousedown(t.element,t.options)}).then(function(){return e._focus(t)})},Vl.prototype._focus=function(t){return!1===this.simulateDefaultBehavior?Fi():qo(Yl.isContentEditableElement(this.element)?this.element:t.element,!Ol.isIE||this.eventState.activeElementBeforeMouseDown===Yl.getActiveElement(),this.caretPos).then(Fi)},Vl.prototype._mouseup=function(e){var t=this;return K.buttonUp().then(function(){return t._getElementForEvent(e)}).then(function(t){return Fl.mouseup(t,e.options)})},Vl.prototype._contextmenu=function(e){return this._getElementForEvent(e).then(function(t){Fl.contextmenu(t,e.options),Yl.isElementFocusable(t)||$o(t)})},Vl.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:Nl({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:Ll.BUTTON.right},o.modifiers)},Bl.all([Kl(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},Vl);function Vl(t,e){var n=kl.call(this,t,e)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var Rl=h.utils.browser,Wl=y.domUtils,Hl=y.positionUtils,Gl=y.styleUtils,zl=y.contentEditable,ql=y.arrayUtils,jl=["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 $l(t,e){var n,i,o,r,s,l=Gl.getBordersWidth(t),a=Hl.getOffsetPosition(t),u=t.scrollHeight||t.getBoundingClientRect().height,c=Math.ceil(e.left),h=Math.ceil(e.top),f=Math.floor(e.bottom);return Wl.isTextAreaElement(t)||(i=(n=Hl.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 Zl(t){var e=Gl.getElementScroll(ja);return{left:t.left+e.left,top:t.top+e.top,bottom:t.bottom+e.top}}function Jl(t,e){var n=t.getBoundingClientRect(),i=function(e){var t,n,i,o=ja.body,r=Hl.getOffsetPosition(e),s=Gl.getElementMargin(e),l=r.top-s.top,a=r.left-s.left,u=ja.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===Gl.get(o,"position")&&(t=Gl.getElementMargin(o),n=Gl.get(o,"left"),i=Gl.get(o,"top"),a-=t.left+(parseInt(n.replace("px",""),10)||0),l-=t.top+(parseInt(i.replace("px",""),10)||0)),ql.forEach(jl,function(t){c+=t+":"+Gl.get(e,t)+";"}),Gl.set(u,{cssText:c,position:"absolute",left:a+"px",top:l+"px",width:e.scrollWidth+"px",height:e.scrollHeight+"px"}),h.nativeMethods.nodeTextContentSetter.call(u,Wl.getElementValue(e)+" "),o.appendChild(u),u}(t),o=null,r=t.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=Wl.getElementValue(t).length;try{var u=ja.createRange();u.setStart(h.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e,a)),u.setEnd(h.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e+1,a+1)),Wl.isTextAreaElement(t)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(t){o=null}return Wl.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 Ql(t,e){var n,i,o,r,s,l,a=null;return(a=Wl.isContentEditableElement(t)?(o=t,r=e,s=Wl.findDocument(o).createRange(),l=zl.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()):Jl(t,e))?{x:(a=Zl(a=$l(t,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function ta(t,e){var n=Wl.isTextEditableElement(t),i=Wl.isContentEditableElement(t);return n&&0<Wl.getElementValue(t).length||i&&zl.getContentEditableValue(t).length?Ql(t,e):Hl.findCenter(t)}function ea(t,e,n){var i=Wl.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=Zl($l(t,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var na,ia=h.Promise,oa=h.utils.browser,ra=h.utils.featureDetection,sa=h.eventSandbox.eventSimulator,la=h.eventSandbox.focusBlur,aa=y.contentEditable,ua=y.domUtils,ca=y.positionUtils,ha=y.eventUtils,fa=y.delay,da=(M(ma,na=Io),ma._calculateEventArguments=function(t){var n=ca.offsetToClientCoords(t);return j(n.x,n.y).then(function(t){var e=t.element;if(!e)throw new Error(Z.elementIsInvisibleError);return{element:e,options:{clientX:n.x,clientY:n.y}}})},ma.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Si({offsetX:i,offsetY:o,speed:r},!1);return new wo(n,s).run().then(function(){return fa(e.automationSettings.mouseActionStepDelay)})},ma.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,ha.preventDefault(t),ha.unbind(e.element,"mousedown",n)};ha.bind(this.element,"mousedown",n)},ma.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},ma.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},ma.prototype._moveToPoint=function(t){!function(t,e){if(Wl.isEditableElement(t)){var n=Wl.isTextAreaElement(t);if(!Wl.isInputElement(t)||!(Rl.isFirefox||Rl.isIE&&10<Rl.version)){var i=Hl.getOffsetPosition(t),o=Gl.getBordersWidth(t),r=Gl.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&&Gl.setScrollTop(t,Math.round(a));s<r.left&&(a=s),s>t.clientWidth+r.left&&(a=s-t.clientWidth),null!==a&&Gl.setScrollLeft(t,Math.round(a))}}}(this.element,t),this.clientPoint=function(t,e){var n=Wl.isTextEditableElement(t),i=Wl.isInputElement(t);if(!n&&!Wl.isContentEditableElement(t))return e;var o=Hl.getOffsetPosition(t),r=Gl.getBordersWidth(t),s=Gl.getElementScroll(t),l=o.left+r.left+t.clientWidth;return i&&n&&(Rl.isFirefox||Rl.isIE&&10<Rl.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:ja.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(e)},ma.prototype._mousedown=function(){var n=this;return K.leftButtonDown().then(function(){return ma._calculateEventArguments(n.clientPoint)}).then(function(t){n.eventArgs=t;var e=(oa.isWebKit||oa.isIE)&&ua.isSelectElement(n.element);return e&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=sa[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=e&&!n.eventState.mousedownPrevented),n._focus()})},ma.prototype._focus=function(){var n=this;return new ia(function(t){var e=ua.isContentEditableElement(n.element)?aa.findContentEditableParent(n.element):n.element;la.focus(e,t,!1,!0)})},ma.prototype._setSelection=function(){throw new Error("Not implemented")},ma.prototype._mouseup=function(){var e=this;return K.buttonUp().then(function(){return e._setSelection(),ma._calculateEventArguments(e.clientPoint)}).then(function(t){e.eventArgs=t,sa[e.upEvent](e.eventArgs.element,e.eventArgs.options)})},ma.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()})},ma);function ma(t,e){var n=na.call(this,t,e)||this;return n.absoluteStartPoint=null,n.absoluteEndPoint=null,n.clientPoint=null,n.speed=e.speed,n.downEvent=ra.isTouchDevice?"touchstart":"mousedown",n.upEvent=ra.isTouchDevice?"touchend":"mouseup",n.eventArgs={options:null,element:null},n.eventState={mousedownPrevented:!1,simulateDefaultBehavior:!0},n}var pa,va=y.textSelection,ga=y.domUtils,Ea=y.positionUtils,ya=(M(Sa,pa=da),Sa.prototype._calculateAbsoluteStartPoint=function(){return ta(this.element,this.startPos)||Ea.findCenter(this.element)},Sa.prototype._calculateAbsoluteEndPoint=function(){var t=ta(this.element,this.endPos);return t||(ga.isContentEditableElement(this.element)?function(t,e,n){for(var i=n<e?1:-1,o=n,r=null;o!==e&&!(r=Ql(t,o+=i)););return r=r||Ql(t,e)||Hl.findCenter(t)}(this.element,this.startPos,this.endPos):Ea.findCenter(this.element))},Sa.prototype._setSelection=function(){var t=ga.isTextEditableElement(this.element),e=ga.isContentEditableElement(this.element);(t||e)&&!1!==this.eventState.simulateDefaultBehavior&&va.select(this.element,this.startPos,this.endPos)},Sa.prototype.run=function(t){var e=this;return this._ensureElement(t).then(function(){return pa.prototype.run.call(e)})},Sa);function Sa(t,e,n,i){var o=pa.call(this,t,i)||this;return o.startPos=e,o.endPos=n,o}var ba,Pa=y.textSelection,xa=y.contentEditable,_a=y.positionUtils,Ca=(M(Aa,ba=da),Aa.prototype._calculateAbsoluteStartPoint=function(){return ea(this.element,this.startNode,this.startOffset)||_a.findCenter(this.element)},Aa.prototype._calculateAbsoluteEndPoint=function(){return ea(this.element,this.endNode,this.endOffset)||_a.findCenter(this.element)},Aa.prototype._setSelection=function(){var t,e;!1!==this.eventState.simulateDefaultBehavior&&(t={node:this.startNode,offset:this.startOffset},e={node:this.endNode,offset:this.endOffset},Pa.selectByNodesAndOffsets(t,e,!0))},Aa);function Aa(t,e,n){var i=ba.call(this,xa.getNearestCommonAncestor(t,e),n)||this,o=xa.getFirstVisiblePosition(t),r=xa.getLastVisiblePosition(e),s={node:t,offset:o},l={node:e,offset:r},a=xa.calculatePositionByNodeAndOffset(i.element,s);return xa.calculatePositionByNodeAndOffset(i.element,l)<a&&(o=xa.getLastVisiblePosition(t),r=xa.getFirstVisiblePosition(e)),s=xa.calculateNodeAndOffsetByPosition(t,o),l=xa.calculateNodeAndOffsetByPosition(e,r),i.startNode=s.node,i.startOffset=s.offset,i.endNode=l.node,i.endOffset=l.offset,i}var wa=h.Promise,Ta=h.utils.extend,Ma=h.utils.browser,Ua=h.eventSandbox.eventSimulator,Da=h.eventSandbox.elementEditingWatcher,Ia=y.domUtils,ka=y.promiseUtils,Ba=y.contentEditable,Na=y.textSelection,Oa=y.delay,Fa=y.KEY_MAPS.specialKeys,Ya=(La.findTextEditableChild=function(t){var e=null;if(!Ia.isEditableElement(t))for(var n=t.querySelectorAll("*"),i=0;i<n.length;i++)if(Ia.isTextEditableElementAndEditingAllowed(n[i])){e=n[i];break}return e},La.prototype._calculateEventArguments=function(t){var e=Ia.getActiveElement(),n=Ia.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||e===i||(i=La.findTextEditableChild(e)||e);var o=Ta({keyCode:t?this.currentCharCode:this.currentKeyCode},this.modifiers);return t&&(o.charCode=this.currentCharCode),Ta(o,zs(t,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},La.prototype._calculateTargetElement=function(){var t=Ia.getActiveElement(),e=Ia.isContentEditableElement(this.element);if(e){if(t!==Ba.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},La.prototype._click=function(t){var e,n=this,i=Ia.getActiveElement(),o=Ia.isTextEditableElementAndEditingAllowed(this.element),r=Ia.isContentEditableElement(this.element);if(i===this.element)return o&&Da.watchElementEditing(this.element),(o||r)&&(e=Na.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===e||Na.select(this.element,this.caretPos,this.caretPos)),wa.resolve();var s=O(this.element),l=s.offsetX,a=s.offsetY,u=new gi({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new Tr(this.element,u).run(t).then(function(){return Oa(n.automationSettings.mouseActionStepDelay)})},La.prototype._type=function(){var t=this;if(this.eventState.skipType)return wa.resolve();var e=Ia.isContentEditableElement(this.element);return this.replace&&(Ia.isTextEditableElementAndEditingAllowed(this.element)?Na.select(this.element):e&&Na.deleteSelectionContents(this.element,!0)),ka.whilst(function(){return!t._isTypingFinished()},function(){return t._typingStep()})},La.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},La.prototype._typingStep=function(){var t=this.typingText.charAt(this.currentPos);return this.currentKeyCode=Ws(t),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this.currentKeyCode===Fa.enter?"Enter":t,this.currentKeyIdentifier=Gs(this.currentKey),this.ignoreChangeEvent=Ia.getElementValue(this.element)===Da.getElementSavedValue(this.element),this._keydown(),this._keypress(),this._keyup()},La.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=Ua.keydown(this.eventArgs.element,this.eventArgs.options)},La.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=Ma.isAndroid||Ua.keypress(this.eventArgs.element,this.eventArgs.options))},La.prototype._keyup=function(){var t=this,e=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=Ia.isTextEditableElement(this.element),i=Ia.isContentEditableElement(this.element),o=this.paste||!n&&!i;return wa.resolve().then(function(){return o?t._typeAllText(e):t._typeChar(e)}).then(function(){Ua.keyup(t.eventArgs.element,t.eventArgs.options),o?t.currentPos=t.typingText.length:t.currentPos++})},La.prototype._typeChar=function(t){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&Da.restartWatchingElementEditing(t),Oa(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(Ia.isInputElement(t)&&"number"===t.type){var o=Na.getSelectionStart(t),r=Ia.getInputValue(t).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===e||"-"===e&&r)||0!==o))return Oa(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(e=i+e)}return Ds(t,e,null),Oa(this.automationSettings.keyActionStepDelay)},La.prototype._typeAllText=function(t){return Ds(t,this.typingText,this.caretPos),Oa(this.automationSettings.keyActionStepDelay)},La.prototype.run=function(t){var e=this;return this._click(t).then(function(){return e._calculateTargetElement()}).then(function(){return e._type()})},La);function La(t,e,n){this.element=La.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 J(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 Ka=(Xa.prototype.run=function(){var i=this;return t.doUpload(this.element,this.paths).then(function(t){if(t.length){var e=m.arrayUtils.map(t,function(t){return t.path}),n=m.arrayUtils.reduce(t,function(t,e){return t.concat(e.resolvedPaths)},[]);throw i.createError(e,n)}})},Xa);function Xa(t,e,n){this.element=t,this.paths=e,this.createError=n}var Va=y.domUtils,Ra=y.contentEditable,Wa={};Wa.DispatchEvent=E,Wa.Scroll=A,Wa.Click=Tr,Wa.SelectChildClick=Xr,Wa.DblClick=$r,Wa.DragToOffset=as,Wa.DragToElement=fs,Wa.Hover=ps,Wa.Press=Dl,Wa.RClick=Xl,Wa.SelectText=ya,Wa.SelectEditableContent=Ca,Wa.Type=Ya,Wa.Upload=Ka,Wa.MouseOptions=mi,Wa.ClickOptions=gi,Wa.TypeOptions=wi,Wa.ERROR_TYPES=Z,Wa.AutomationSettings=J,Wa.getOffsetOptions=F,Wa.calculateSelectTextArguments=function(t,e){void 0===e&&(e={});var n,i,o,r,s,l,a,u,c,h,f,d=Va.isTextEditableElement(t),m=d?0:Ra.getFirstVisiblePosition(t),p=d?Va.getElementValue(t).length:Ra.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=Va.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:Va.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:Va.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},Wa.cursor=K,Wa.getNextFocusableElement=Rs,Wa.SHORTCUT_TYPE=tl,Wa.getSelectionCoordinatesByPosition=ta,Wa.getElementFromPoint=j;var Ha=h.nativeMethods,Ga=h.EVENTS.evalIframeScript;Ha.objectDefineProperty(qa,"%testCafeAutomation%",{configurable:!0,value:Wa}),h.on(Ga,function(t){return za(Ha.contentWindowGetter.call(t.iframe))})}(qa["%hammerhead%"],qa["%testCafeCore%"],qa["%hammerhead%"].Promise,qa["%testCafeUI%"])}(window);
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
|
6
|
-
<title></title>
|
|
7
|
-
<script type="application/x-javascript" src="/browser/assets/index.js"></script>
|
|
8
|
-
<link rel="stylesheet" href="/browser/assets/styles.css"/>
|
|
9
|
-
<link rel="icon" type="image/x-icon" href="/favicon.ico"/>
|
|
10
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<div class="page-background">
|
|
14
|
-
<div class="container">
|
|
15
|
-
<canvas class="spinner"></canvas>
|
|
16
|
-
<div class="status-text-area">
|
|
17
|
-
<img class="logo" src="/browser/assets/logo.svg"/>
|
|
18
|
-
|
|
19
|
-
<div class="user-agent">
|
|
20
|
-
<span>{{{userAgent}}}</span>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="status">
|
|
23
|
-
<span></span>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<script type="text/javascript">
|
|
30
|
-
var idlePage = new IdlePage('{{{statusUrl}}}', '{{{heartbeatUrl}}}', '{{{initScriptUrl}}}', { retryTestPages: {{{retryTestPages}}} });
|
|
31
|
-
|
|
32
|
-
idlePage.start();
|
|
33
|
-
</script>
|
|
34
|
-
</body>
|
|
35
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
|
6
|
+
<title></title>
|
|
7
|
+
<script type="application/x-javascript" src="/browser/assets/index.js"></script>
|
|
8
|
+
<link rel="stylesheet" href="/browser/assets/styles.css"/>
|
|
9
|
+
<link rel="icon" type="image/x-icon" href="/favicon.ico"/>
|
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div class="page-background">
|
|
14
|
+
<div class="container">
|
|
15
|
+
<canvas class="spinner"></canvas>
|
|
16
|
+
<div class="status-text-area">
|
|
17
|
+
<img class="logo" src="/browser/assets/logo.svg"/>
|
|
18
|
+
|
|
19
|
+
<div class="user-agent">
|
|
20
|
+
<span>{{{userAgent}}}</span>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="status">
|
|
23
|
+
<span></span>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<script type="text/javascript">
|
|
30
|
+
var idlePage = new IdlePage('{{{statusUrl}}}', '{{{heartbeatUrl}}}', '{{{initScriptUrl}}}', { retryTestPages: {{{retryTestPages}}} });
|
|
31
|
+
|
|
32
|
+
idlePage.start();
|
|
33
|
+
</script>
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|