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