testcafe 2.3.1 → 2.6.1

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 (235) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/LICENSE +1 -1
  3. package/README.md +40 -46
  4. package/bin/testcafe-with-v8-flag-filter.js +10 -16
  5. package/lib/api/exportable-lib/index.js +1 -11
  6. package/lib/api/structure/test.js +4 -11
  7. package/lib/api/test-controller/execution-context.js +4 -2
  8. package/lib/api/test-controller/index.js +8 -10
  9. package/lib/api/test-run-tracker.js +1 -1
  10. package/lib/assertions/executor.js +2 -11
  11. package/lib/browser/connection/gateway/index.js +272 -0
  12. package/lib/browser/connection/gateway/status.js +10 -0
  13. package/lib/browser/connection/index.js +60 -47
  14. package/lib/browser/connection/service-routes.js +4 -2
  15. package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/index.js +3 -2
  16. package/lib/browser/provider/built-in/dedicated/chrome/index.js +48 -23
  17. package/lib/browser/provider/built-in/dedicated/edge/index.js +4 -1
  18. package/lib/browser/provider/index.js +13 -4
  19. package/lib/browser/provider/plugin-host.js +7 -1
  20. package/lib/cli/argument-parser/index.js +10 -16
  21. package/lib/cli/cli.js +4 -13
  22. package/lib/cli/remotes-wizard.js +2 -1
  23. package/lib/cli/utils/should-move-option-to-end.js +17 -0
  24. package/lib/client/automation/deps/hammerhead.js +24 -0
  25. package/lib/client/automation/deps/testcafe-core.js +24 -0
  26. package/lib/client/automation/index.js +567 -187
  27. package/lib/client/automation/index.min.js +1 -1
  28. package/lib/client/automation/playback/press/get-key-info.js +44 -0
  29. package/lib/client/automation/playback/press/utils.js +142 -0
  30. package/lib/client/automation/utils/get-key-code.js +15 -0
  31. package/lib/client/automation/utils/get-key-identifier.js +14 -0
  32. package/lib/client/automation/utils/is-letter.js +7 -0
  33. package/lib/client/automation/utils/key-identifier-maps.js +93 -0
  34. package/lib/client/browser/idle-page/index.html.mustache +2 -2
  35. package/lib/client/browser/idle-page/index.js +24 -11
  36. package/lib/client/core/index.js +67 -13
  37. package/lib/client/core/index.min.js +1 -1
  38. package/lib/client/core/utils/array.js +77 -0
  39. package/lib/client/core/utils/dom.js +459 -0
  40. package/lib/client/core/utils/send-request-to-frame.js +22 -0
  41. package/lib/client/core/utils/style.js +102 -0
  42. package/lib/client/core/utils/values/boundary-values.js +41 -0
  43. package/lib/client/driver/index.js +270 -242
  44. package/lib/client/driver/index.min.js +1 -1
  45. package/lib/client/test-run/iframe.js.mustache +6 -6
  46. package/lib/client/test-run/index.js.mustache +37 -33
  47. package/lib/client/ui/index.js +3238 -54
  48. package/lib/client/ui/index.min.js +1 -1
  49. package/lib/client/ui/sprite.svg +15 -0
  50. package/lib/client/ui/styles.css +184 -41
  51. package/lib/compiler/babel/load-libs.js +6 -6
  52. package/lib/compiler/compilers.js +7 -7
  53. package/lib/compiler/index.js +6 -6
  54. package/lib/compiler/interfaces.js +1 -1
  55. package/lib/compiler/test-file/add-export-api.js +3 -3
  56. package/lib/compiler/test-file/api-based.js +8 -37
  57. package/lib/compiler/test-file/formats/es-next/compiler.js +5 -5
  58. package/lib/compiler/test-file/formats/typescript/compiler.js +9 -9
  59. package/lib/compiler/test-file/get-exportable-lib-path.js +3 -3
  60. package/lib/configuration/configuration-base.js +9 -6
  61. package/lib/configuration/default-values.js +3 -3
  62. package/lib/configuration/formats.js +9 -5
  63. package/lib/configuration/interfaces.js +1 -1
  64. package/lib/configuration/option-names.js +3 -4
  65. package/lib/configuration/run-option-names.js +2 -2
  66. package/lib/configuration/testcafe-configuration.js +41 -24
  67. package/lib/configuration/types.js +1 -1
  68. package/lib/configuration/utils.js +32 -0
  69. package/lib/custom-client-scripts/client-script.js +2 -2
  70. package/lib/custom-client-scripts/get-code.js +3 -3
  71. package/lib/custom-client-scripts/routing.js +10 -12
  72. package/lib/errors/runtime/templates.js +3 -2
  73. package/lib/errors/test-run/templates.js +4 -1
  74. package/lib/errors/types.js +3 -1
  75. package/lib/index.js +6 -31
  76. package/lib/live/bootstrapper.js +3 -3
  77. package/lib/live/test-runner.js +9 -7
  78. package/lib/native-automation/add-custom-debug-formatters.js +23 -0
  79. package/lib/native-automation/api-base.js +27 -0
  80. package/lib/native-automation/client/event-descriptor.js +118 -0
  81. package/lib/native-automation/client/input.js +46 -0
  82. package/lib/native-automation/client/key-press/utils.js +31 -0
  83. package/lib/native-automation/client/types.js +11 -0
  84. package/lib/native-automation/client/utils.js +54 -0
  85. package/lib/native-automation/cookie-provider.js +115 -0
  86. package/lib/native-automation/empty-page-markup.js +11 -0
  87. package/lib/native-automation/error-route.js +7 -0
  88. package/lib/native-automation/errors.js +20 -0
  89. package/lib/native-automation/index.js +53 -0
  90. package/lib/native-automation/request-hooks/event-factory/frame-navigated-event-based.js +40 -0
  91. package/lib/native-automation/request-hooks/event-factory/request-paused-event-based.js +94 -0
  92. package/lib/native-automation/request-hooks/event-provider.js +55 -0
  93. package/lib/native-automation/request-hooks/pipeline-context.js +11 -0
  94. package/lib/{proxyless → native-automation}/request-pipeline/constants.js +1 -1
  95. package/lib/native-automation/request-pipeline/context-info.js +58 -0
  96. package/lib/native-automation/request-pipeline/index.js +329 -0
  97. package/lib/native-automation/request-pipeline/resendAuthRequest.js +23 -0
  98. package/lib/native-automation/request-pipeline/safe-api.js +66 -0
  99. package/lib/native-automation/request-pipeline/special-handlers.js +76 -0
  100. package/lib/native-automation/request-pipeline/test-run-bridge.js +45 -0
  101. package/lib/native-automation/resource-injector.js +175 -0
  102. package/lib/native-automation/session-storage/index.js +43 -0
  103. package/lib/native-automation/storages-provider.js +17 -0
  104. package/lib/native-automation/types.js +12 -0
  105. package/lib/native-automation/utils/cdp.js +71 -0
  106. package/lib/native-automation/utils/convert.js +11 -0
  107. package/lib/native-automation/utils/get-active-client.js +8 -0
  108. package/lib/native-automation/utils/headers.js +30 -0
  109. package/lib/native-automation/utils/string.js +32 -0
  110. package/lib/reporter/index.js +52 -4
  111. package/lib/reporter/interfaces.js +1 -1
  112. package/lib/reporter/plugin-host.js +44 -4
  113. package/lib/reporter/plugin-methods.js +2 -1
  114. package/lib/reporter/report-data-log.js +25 -0
  115. package/lib/role/role.js +4 -39
  116. package/lib/runner/bootstrapper.js +40 -15
  117. package/lib/runner/browser-job.js +4 -5
  118. package/lib/runner/fixture-hook-controller.js +1 -7
  119. package/lib/runner/index.js +87 -94
  120. package/lib/runner/interfaces.js +1 -1
  121. package/lib/runner/task/index.js +2 -32
  122. package/lib/runner/test-run-controller.js +46 -4
  123. package/lib/shared/errors/index.js +8 -2
  124. package/lib/shared/utils/is-file-protocol.js +2 -2
  125. package/lib/test-run/bookmark.js +5 -23
  126. package/lib/test-run/commands/actions.js +16 -4
  127. package/lib/test-run/commands/service.js +2 -3
  128. package/lib/test-run/commands/type.js +2 -1
  129. package/lib/test-run/commands/utils.js +4 -2
  130. package/lib/test-run/cookies/base.js +4 -1
  131. package/lib/test-run/cookies/factory.js +4 -4
  132. package/lib/test-run/cookies/provider.js +9 -2
  133. package/lib/test-run/execute-js-expression/index.js +4 -2
  134. package/lib/test-run/index.js +35 -151
  135. package/lib/test-run/request/create-request-options.js +37 -24
  136. package/lib/test-run/request/send.js +2 -3
  137. package/lib/test-run/role-provider.js +5 -5
  138. package/lib/test-run/session-controller.js +5 -5
  139. package/lib/test-run/storages/factory.js +4 -4
  140. package/lib/testcafe.js +17 -18
  141. package/lib/utils/check-is-vm.js +58 -0
  142. package/lib/utils/debug-loggers.js +9 -7
  143. package/lib/utils/get-browser.js +5 -2
  144. package/lib/utils/get-options/boolean-or-object-option.js +18 -0
  145. package/lib/utils/get-options/quarantine.js +10 -13
  146. package/lib/utils/get-options/skip-js-errors.js +12 -16
  147. package/lib/utils/parse-user-agent.js +20 -13
  148. package/lib/utils/string.js +1 -1
  149. package/package.json +14 -11
  150. package/ts-defs/index.d.ts +12 -2
  151. package/ts-defs/selectors.d.ts +8 -1
  152. package/ts-defs/testcafe-scripts.d.ts +8 -1
  153. package/lib/browser/connection/gateway.js +0 -205
  154. package/lib/compiler/test-file/test-file-temp-variable-name.js +0 -6
  155. package/lib/dashboard/config-storage.js +0 -26
  156. package/lib/dashboard/connector.js +0 -84
  157. package/lib/dashboard/documentation-url.js +0 -6
  158. package/lib/dashboard/formatting.js +0 -26
  159. package/lib/dashboard/get-dashboard-url.js +0 -10
  160. package/lib/dashboard/get-default-project-link.js +0 -23
  161. package/lib/dashboard/get-env-options.js +0 -26
  162. package/lib/dashboard/index.js +0 -145
  163. package/lib/dashboard/interfaces.js +0 -3
  164. package/lib/dashboard/messages.js +0 -21
  165. package/lib/proxyless/add-custom-debug-formatters.js +0 -22
  166. package/lib/proxyless/api-base.js +0 -25
  167. package/lib/proxyless/client/event-simulator.js +0 -40
  168. package/lib/proxyless/client/types.js +0 -11
  169. package/lib/proxyless/client/utils.js +0 -24
  170. package/lib/proxyless/cookie-provider.js +0 -87
  171. package/lib/proxyless/default-setup-options.js +0 -9
  172. package/lib/proxyless/empty-page-markup.js +0 -11
  173. package/lib/proxyless/error-route.js +0 -7
  174. package/lib/proxyless/index.js +0 -53
  175. package/lib/proxyless/request-hooks/event-factory/frame-navigated-event-based.js +0 -40
  176. package/lib/proxyless/request-hooks/event-factory/request-paused-event-based.js +0 -95
  177. package/lib/proxyless/request-hooks/event-provider.js +0 -52
  178. package/lib/proxyless/request-hooks/pipeline-context.js +0 -11
  179. package/lib/proxyless/request-pipeline/context-info.js +0 -55
  180. package/lib/proxyless/request-pipeline/index.js +0 -230
  181. package/lib/proxyless/request-pipeline/resendAuthRequest.js +0 -23
  182. package/lib/proxyless/request-pipeline/safe-api.js +0 -62
  183. package/lib/proxyless/request-pipeline/special-handlers.js +0 -73
  184. package/lib/proxyless/request-pipeline/test-run-bridge.js +0 -45
  185. package/lib/proxyless/resource-injector.js +0 -162
  186. package/lib/proxyless/session-storage/index.js +0 -39
  187. package/lib/proxyless/storages-provider.js +0 -17
  188. package/lib/proxyless/types.js +0 -10
  189. package/lib/proxyless/utils/cdp.js +0 -66
  190. package/lib/proxyless/utils/get-active-client.js +0 -8
  191. package/lib/proxyless/utils/headers.js +0 -30
  192. package/lib/proxyless/utils/string.js +0 -32
  193. package/lib/services/compiler/esm-runtime-holder-name.js +0 -6
  194. package/lib/services/compiler/host.js +0 -370
  195. package/lib/services/compiler/interfaces.js +0 -3
  196. package/lib/services/compiler/io.js +0 -10
  197. package/lib/services/compiler/protocol.js +0 -17
  198. package/lib/services/compiler/service-loader.js +0 -18
  199. package/lib/services/compiler/service.js +0 -361
  200. package/lib/services/compiler/test-run-proxy.js +0 -156
  201. package/lib/services/interfaces.js +0 -3
  202. package/lib/services/process-title.js +0 -10
  203. package/lib/services/serialization/prepare-options.js +0 -23
  204. package/lib/services/serialization/replicator/create-replicator.js +0 -58
  205. package/lib/services/serialization/replicator/interfaces.js +0 -3
  206. package/lib/services/serialization/replicator/transforms/base-transform.js +0 -16
  207. package/lib/services/serialization/replicator/transforms/browser-console-messages-transform.js +0 -23
  208. package/lib/services/serialization/replicator/transforms/callsite-record-transform.js +0 -24
  209. package/lib/services/serialization/replicator/transforms/command-base-trasform/assertion-command-constructors.js +0 -28
  210. package/lib/services/serialization/replicator/transforms/command-base-trasform/command-constructors.js +0 -66
  211. package/lib/services/serialization/replicator/transforms/command-base-trasform/index.js +0 -49
  212. package/lib/services/serialization/replicator/transforms/command-base-trasform/types.js +0 -3
  213. package/lib/services/serialization/replicator/transforms/configure-response-event-option-transform.js +0 -21
  214. package/lib/services/serialization/replicator/transforms/custom-error-transform.js +0 -29
  215. package/lib/services/serialization/replicator/transforms/function-marker-transform/index.js +0 -21
  216. package/lib/services/serialization/replicator/transforms/function-marker-transform/marker.js +0 -9
  217. package/lib/services/serialization/replicator/transforms/promise-marker-transform/index.js +0 -21
  218. package/lib/services/serialization/replicator/transforms/promise-marker-transform/marker.js +0 -9
  219. package/lib/services/serialization/replicator/transforms/raw-command-callsite-record-transform.js +0 -22
  220. package/lib/services/serialization/replicator/transforms/re-executable-promise-transform/index.js +0 -22
  221. package/lib/services/serialization/replicator/transforms/re-executable-promise-transform/marker.js +0 -6
  222. package/lib/services/serialization/replicator/transforms/request-filter-rule-transform.js +0 -23
  223. package/lib/services/serialization/replicator/transforms/request-hook-event-data-transform.js +0 -41
  224. package/lib/services/serialization/replicator/transforms/response-mock-transform.js +0 -23
  225. package/lib/services/serialization/replicator/transforms/role-transform.js +0 -21
  226. package/lib/services/serialization/replicator/transforms/testcafe-error-list-transform.js +0 -23
  227. package/lib/services/serialization/replicator/transforms/url-transform.js +0 -23
  228. package/lib/services/serialization/test-structure.js +0 -91
  229. package/lib/services/utils/ipc/interfaces.js +0 -29
  230. package/lib/services/utils/ipc/io.js +0 -109
  231. package/lib/services/utils/ipc/message.js +0 -84
  232. package/lib/services/utils/ipc/packet.js +0 -57
  233. package/lib/services/utils/ipc/proxy.js +0 -94
  234. package/lib/services/utils/ipc/transport.js +0 -65
  235. package/lib/services/utils/method-should-not-be-called-error.js +0 -10
@@ -82,6 +82,11 @@ window['%hammerhead%'].utils.removeInjectedScript();
82
82
  meta: 'Meta',
83
83
  shift: 'Shift',
84
84
  };
85
+ var NEW_LINE_KEYS = [
86
+ 'enter',
87
+ '\n',
88
+ '\r',
89
+ ];
85
90
  function reverseMap(map) {
86
91
  var reversed = {};
87
92
  for (var key in map) {
@@ -143,6 +148,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
143
148
  reversedShiftMap: reverseMap(SHIFT_MAP),
144
149
  reversedSpecialKeys: reverseMap(SPECIAL_KEYS),
145
150
  reversedKeyProperty: reverseMap(KEY_PROPERTY),
151
+ newLineKeys: NEW_LINE_KEYS,
146
152
  };
147
153
 
148
154
  var Promise = hammerhead__default.Promise;
@@ -610,6 +616,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
610
616
  var reduce = createNativeMethodWrapper('reduce');
611
617
  var concat = createNativeMethodWrapper('concat');
612
618
  var join = createNativeMethodWrapper('join');
619
+ var every = createNativeMethodWrapper('every');
613
620
  function isArray(arg) {
614
621
  return hammerhead.nativeMethods.objectToString.call(arg) === '[object Array]';
615
622
  }
@@ -676,6 +683,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
676
683
  reduce: reduce,
677
684
  concat: concat,
678
685
  join: join,
686
+ every: every,
679
687
  isArray: isArray,
680
688
  from: from,
681
689
  find: find,
@@ -3480,6 +3488,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
3480
3488
  actionFunctionOptionError: 'E99',
3481
3489
  actionInvalidObjectPropertyError: 'E100',
3482
3490
  actionElementIsNotTargetError: 'E101',
3491
+ multipleWindowsModeIsNotSupportedInNativeAutomationError: 'E102',
3483
3492
  };
3484
3493
  var RUNTIME_ERRORS = {
3485
3494
  cannotCreateMultipleLiveModeRunners: 'E1000',
@@ -3562,6 +3571,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
3562
3571
  invalidCustomActionsOptionType: 'E1079',
3563
3572
  invalidCustomActionType: 'E1080',
3564
3573
  cannotImportESMInCommonsJS: 'E1081',
3574
+ setNativeAutomationForUnsupportedBrowsers: 'E1082',
3565
3575
  };
3566
3576
 
3567
3577
  var BrowserConnectionErrorHint;
@@ -3731,7 +3741,8 @@ window['%hammerhead%'].utils.removeInjectedScript();
3731
3741
  _a[RUNTIME_ERRORS.invalidCommandInJsonCompiler] = "TestCafe terminated the test run. The \"{path}\" file contains an unknown Chrome User Flow action \"{action}\". Remove the action to continue. Refer to the following article for the definitive list of supported Chrome User Flow actions: https://testcafe.io/documentation/403998/guides/experimental-capabilities/chrome-replay-support#supported-replay-actions",
3732
3742
  _a[RUNTIME_ERRORS.invalidCustomActionsOptionType] = "The value of the customActions option does not belong to type Object. Refer to the following article for custom action setup instructions: ".concat(DOCUMENTATION_LINKS.CUSTOM_ACTIONS),
3733
3743
  _a[RUNTIME_ERRORS.invalidCustomActionType] = "TestCafe cannot parse the \"{actionName}\" action, because the action definition is invalid. Format the definition in accordance with the custom actions guide: ".concat(DOCUMENTATION_LINKS.CUSTOM_ACTIONS),
3734
- _a[RUNTIME_ERRORS.cannotImportESMInCommonsJS] = 'Cannot import the {esModule} ECMAScript module from {targetFile}. Use a dynamic import() statement or enable the --experimental-esm CLI flag.',
3744
+ _a[RUNTIME_ERRORS.cannotImportESMInCommonsJS] = 'Cannot import the {esModule} ECMAScript module from {targetFile}. Use a dynamic import() statement or enable the --esm CLI flag.',
3745
+ _a[RUNTIME_ERRORS.setNativeAutomationForUnsupportedBrowsers] = 'The "{browser}" do not support the Native Automation mode. Remove the "native automation" option to continue.',
3735
3746
  _a);
3736
3747
 
3737
3748
  var timeLimitedPromiseTimeoutExpiredTemplate = TEMPLATES[RUNTIME_ERRORS.timeLimitedPromiseTimeoutExpired];
@@ -3827,7 +3838,9 @@ window['%hammerhead%'].utils.removeInjectedScript();
3827
3838
  closeWindow: '/browser/close-window',
3828
3839
  serviceWorker: '/service-worker.js',
3829
3840
  openFileProtocol: '/browser/open-file-protocol',
3830
- dispatchProxylessEvent: '/browser/dispatch-proxyless-event',
3841
+ dispatchNativeAutomationEvent: '/browser/dispatch-native-automation-event',
3842
+ dispatchNativeAutomationEventSequence: '/browser/dispatch-native-automation-event-sequence',
3843
+ parseSelector: '/parse-selector',
3831
3844
  assets: {
3832
3845
  index: '/browser/assets/index.js',
3833
3846
  styles: '/browser/assets/styles.css',
@@ -3835,7 +3848,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
3835
3848
  },
3836
3849
  };
3837
3850
 
3838
- var FILE_PROTOCOL = 'file:///';
3851
+ var FILE_PROTOCOL = 'file://';
3839
3852
  function isFileProtocol(url) {
3840
3853
  if (url === void 0) { url = ''; }
3841
3854
  return url.indexOf(FILE_PROTOCOL) === 0;
@@ -3917,14 +3930,25 @@ window['%hammerhead%'].utils.removeInjectedScript();
3917
3930
  function stopInitScriptExecution() {
3918
3931
  allowInitScriptExecution = false;
3919
3932
  }
3920
- function redirect(command, createXHR, openFileProtocolUrl) {
3933
+ function redirectUsingCdp(command, _a) {
3934
+ var openFileProtocolUrl = _a.openFileProtocolUrl, createXHR = _a.createXHR;
3935
+ sendXHR(openFileProtocolUrl, createXHR, { method: 'POST', data: JSON.stringify({ url: command.url }) }); //eslint-disable-line no-restricted-globals
3936
+ }
3937
+ function redirect(command, opts) {
3921
3938
  stopInitScriptExecution();
3922
3939
  if (isFileProtocol(command.url))
3923
- sendXHR(openFileProtocolUrl, createXHR, { method: 'POST', data: JSON.stringify({ url: command.url }) }); //eslint-disable-line no-restricted-globals
3940
+ redirectUsingCdp(command, opts);
3924
3941
  else
3925
- document.location = command.url;
3942
+ setLocation(command, opts);
3943
+ }
3944
+ function setLocation(command, opts) {
3945
+ var hashIndex = command.url.indexOf('#');
3946
+ var onlyHashChanged = hashIndex !== -1 && command.url.slice(0, hashIndex) === LOCATION_HREF.slice(0, hashIndex);
3947
+ document.location = command.url;
3948
+ if (opts.nativeAutomation && onlyHashChanged)
3949
+ document.location.reload();
3926
3950
  }
3927
- function proxylessCheckRedirecting(_a) {
3951
+ function nativeAutomationCheckRedirecting(_a) {
3928
3952
  var result = _a.result;
3929
3953
  if (result.cmd === COMMAND.idle)
3930
3954
  return regularCheckRedirecting(result);
@@ -3938,7 +3962,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
3938
3962
  }
3939
3963
  function getStatus(_a, createXHR, _b) {
3940
3964
  var statusUrl = _a.statusUrl, openFileProtocolUrl = _a.openFileProtocolUrl;
3941
- var _c = _b === void 0 ? {} : _b, manualRedirect = _c.manualRedirect, proxyless = _c.proxyless;
3965
+ var _c = _b === void 0 ? {} : _b, manualRedirect = _c.manualRedirect, nativeAutomation = _c.nativeAutomation;
3942
3966
  return __awaiter(this, void 0, void 0, function () {
3943
3967
  var result, redirecting;
3944
3968
  return __generator(this, function (_d) {
@@ -3946,9 +3970,9 @@ window['%hammerhead%'].utils.removeInjectedScript();
3946
3970
  case 0: return [4 /*yield*/, sendXHR(statusUrl, createXHR)];
3947
3971
  case 1:
3948
3972
  result = _d.sent();
3949
- redirecting = proxyless ? proxylessCheckRedirecting({ result: result }) : regularCheckRedirecting(result);
3973
+ redirecting = nativeAutomation ? nativeAutomationCheckRedirecting({ result: result }) : regularCheckRedirecting(result);
3950
3974
  if (redirecting && !manualRedirect)
3951
- redirect(result, createXHR, openFileProtocolUrl);
3975
+ redirect(result, { createXHR: createXHR, openFileProtocolUrl: openFileProtocolUrl, nativeAutomation: nativeAutomation });
3952
3976
  return [2 /*return*/, { command: result, redirecting: redirecting }];
3953
3977
  }
3954
3978
  });
@@ -4054,7 +4078,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
4054
4078
  data: JSON.stringify({ windowId: windowId }), //eslint-disable-line no-restricted-globals
4055
4079
  });
4056
4080
  }
4057
- function dispatchProxylessEvent(dispatchProxylessEventUrl, testCafeUI, createXHR, type, options) {
4081
+ function dispatchNativeAutomationEvent(dispatchNativeAutomationEventUrl, testCafeUI, createXHR, type, options) {
4058
4082
  return __awaiter(this, void 0, void 0, function () {
4059
4083
  var data;
4060
4084
  return __generator(this, function (_a) {
@@ -4066,7 +4090,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
4066
4090
  type: type,
4067
4091
  options: options,
4068
4092
  });
4069
- return [4 /*yield*/, sendXHR(dispatchProxylessEventUrl, createXHR, {
4093
+ return [4 /*yield*/, sendXHR(dispatchNativeAutomationEventUrl, createXHR, {
4070
4094
  method: 'POST',
4071
4095
  data: data,
4072
4096
  })];
@@ -4079,6 +4103,33 @@ window['%hammerhead%'].utils.removeInjectedScript();
4079
4103
  }
4080
4104
  });
4081
4105
  });
4106
+ }
4107
+ function dispatchNativeAutomationEventSequence(dispatchNativeAutomationEventSequenceUrl, testCafeUI, createXHR, sequence) {
4108
+ return __awaiter(this, void 0, void 0, function () {
4109
+ return __generator(this, function (_a) {
4110
+ switch (_a.label) {
4111
+ case 0: return [4 /*yield*/, testCafeUI.hide()];
4112
+ case 1:
4113
+ _a.sent();
4114
+ return [4 /*yield*/, sendXHR(dispatchNativeAutomationEventSequenceUrl, createXHR, {
4115
+ method: 'POST',
4116
+ data: JSON.stringify(sequence), //eslint-disable-line no-restricted-globals
4117
+ })];
4118
+ case 2:
4119
+ _a.sent();
4120
+ return [4 /*yield*/, testCafeUI.show()];
4121
+ case 3:
4122
+ _a.sent();
4123
+ return [2 /*return*/];
4124
+ }
4125
+ });
4126
+ });
4127
+ }
4128
+ function parseSelector(parseSelectorUrl, createXHR, selector) {
4129
+ return sendXHR(parseSelectorUrl, createXHR, {
4130
+ method: 'POST',
4131
+ data: JSON.stringify({ selector: selector }), //eslint-disable-line no-restricted-globals
4132
+ });
4082
4133
  }
4083
4134
 
4084
4135
  var browser = /*#__PURE__*/Object.freeze({
@@ -4089,13 +4140,16 @@ window['%hammerhead%'].utils.removeInjectedScript();
4089
4140
  stopHeartbeat: stopHeartbeat,
4090
4141
  startInitScriptExecution: startInitScriptExecution,
4091
4142
  stopInitScriptExecution: stopInitScriptExecution,
4143
+ redirectUsingCdp: redirectUsingCdp,
4092
4144
  redirect: redirect,
4093
4145
  checkStatus: checkStatus,
4094
4146
  enableRetryingTestPages: enableRetryingTestPages,
4095
4147
  getActiveWindowId: getActiveWindowId,
4096
4148
  setActiveWindowId: setActiveWindowId,
4097
4149
  closeWindow: closeWindow,
4098
- dispatchProxylessEvent: dispatchProxylessEvent
4150
+ dispatchNativeAutomationEvent: dispatchNativeAutomationEvent,
4151
+ dispatchNativeAutomationEventSequence: dispatchNativeAutomationEventSequence,
4152
+ parseSelector: parseSelector
4099
4153
  });
4100
4154
 
4101
4155
  // -------------------------------------------------------------
@@ -1 +1 @@
1
- window["%hammerhead%"].utils.removeInjectedScript(),function pi(mi){var gi=mi.document;!function(d,u){var f="default"in d?d.default:d;u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;var e=f.utils.browser,t={alt:18,ctrl:17,meta:91,shift:16},n={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=","{":"[","}":"]",":":";",'"':"'","|":"\\","<":",",">":".","?":"/","±":"§"},o={backspace:8,capslock:20,delete:46,down:40,end:35,enter:13,esc:27,home:36,ins:45,left:37,pagedown:34,pageup:33,right:39,space:32,tab:9,up:38},r={left:e.isIE?"Left":"ArrowLeft",down:e.isIE?"Down":"ArrowDown",right:e.isIE?"Right":"ArrowRight",up:e.isIE?"Up":"ArrowUp",backspace:"Backspace",capslock:"CapsLock",delete:"Delete",end:"End",enter:"Enter",esc:"Escape",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:e.isIE?"Spacebar":" ",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"};function i(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[e[t]]=t);return n}var a={modifiers:t,shiftMap:n,specialKeys:o,keyProperty:r,modifiersMap:{option:"alt"},symbolCharCodeToKeyCode:{96:192,91:219,93:221,92:220,59:186,39:222,44:188,45:e.isFirefox?173:189,46:190,47:191},symbolKeysCharCodes:{109:45,173:45,186:59,187:61,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39,110:46,96:48,97:49,98:50,99:51,100:52,101:53,102:54,103:55,104:56,105:57,107:43,106:42,111:47},reversedModifiers:i(t),reversedShiftMap:i(n),reversedSpecialKeys:i(o),reversedKeyProperty:i(r)},s=f.Promise,l=f.nativeMethods;function c(t){return new s(function(e){return l.setTimeout.call(mi,e,t)})}var h=(p.prototype._startListening=function(){var t=this;this._emitter.onRequestSend(function(e){return t._onRequestSend(e)}),this._emitter.onRequestCompleted(function(e){return t._onRequestCompleted(e)}),this._emitter.onRequestError(function(e){return t._onRequestError(e)})},p.prototype._offListening=function(){this._emitter.offAll()},p.prototype._onRequestSend=function(e){this._collectingReqs&&this._requests.add(e)},p.prototype._onRequestCompleted=function(e){var t=this;c(this._delays.additionalRequestsCollection).then(function(){return t._onRequestFinished(e)})},p.prototype._onRequestFinished=function(e){this._requests.has(e)&&(this._requests.delete(e),this._collectingReqs||this._requests.size||!this._watchdog||this._finishWaiting())},p.prototype._onRequestError=function(e){this._onRequestFinished(e)},p.prototype._finishWaiting=function(){this._watchdog&&((0,d.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._requests.clear(),this._offListening(),this._waitResolve()},p.prototype.wait=function(e){var n=this;return c(e?this._delays.pageInitialRequestsCollection:this._delays.requestsCollection).then(function(){return new d.Promise(function(e){var t;n._collectingReqs=!1,n._waitResolve=e,n._requests.size?(t=d.nativeMethods.setTimeout,n._watchdog=t(function(){return n._finishWaiting()},p.TIMEOUT)):n._finishWaiting()})})},p.TIMEOUT=3e3,p);function p(e,t){var n,o,r;void 0===t&&(t={}),this._delays={requestsCollection:null!==(n=t.requestsCollection)&&void 0!==n?n:50,additionalRequestsCollection:null!==(o=t.additionalRequestsCollection)&&void 0!==o?o:50,pageInitialRequestsCollection:null!==(r=t.pageInitialRequestsCollection)&&void 0!==r?r:50},this._emitter=e,this._waitResolve=null,this._watchdog=null,this._requests=new Set,this._collectingReqs=!0,this._startListening()}var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function E(e,a,s,l){return new(s=s||u)(function(n,t){function o(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(o,r)}i((l=l.apply(e,a||[])).next())})}function v(n,o){var r,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function e(t){return function(e){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;l&&t[l=0]&&(s=0),s;)try{if(r=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,a&&(t=[2&t[0],a.value]),t[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],i=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function y(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||((o=o||Array.prototype.slice.call(t,0,r))[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var b=(C.prototype.on=function(e,t){this._eventsListeners[e]||(this._eventsListeners[e]=[]),this._eventsListeners[e].push(t)},C.prototype.once=function(n,o){var r=this;this.on(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.off(n,o),o.apply(void 0,e)})},C.prototype.off=function(e,t){var n=this._eventsListeners[e];n&&(this._eventsListeners[e]=d.nativeMethods.arrayFilter.call(n,function(e){return e!==t}))},C.prototype.offAll=function(e){e?this._eventsListeners[e]=[]:this._eventsListeners={}},C.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this._eventsListeners[t];if(o)for(var r=0;r<o.length;r++)try{o[r].apply(this,e)}catch(e){if(!(e.message&&-1<e.message.indexOf("freed script")))throw e;this.off(t,o[r])}},C);function C(){this._eventsListeners={}}var S,w="request-send",T="request-completed",_="request-error",I=(g(P,S=b),P.prototype._addHammerheadListener=function(e,t){f.on(e,t),this._hammerheadListenersInfo.push({evt:e,listener:t})},P.prototype.onRequestSend=function(e){this.on(w,e)},P.prototype.onRequestCompleted=function(e){this.on(T,e)},P.prototype.onRequestError=function(e){this.on(_,e)},P.prototype.offAll=function(){S.prototype.offAll.call(this);for(var e=0,t=this._hammerheadListenersInfo;e<t.length;e++){var n=t[e];f.off.call(f,n.evt,n.listener)}},P);function P(){var n=S.call(this)||this;return n._hammerheadListenersInfo=[],n._addHammerheadListener(f.EVENTS.beforeXhrSend,function(e){var t=e.xhr;return n.emit(w,t)}),n._addHammerheadListener(f.EVENTS.xhrCompleted,function(e){var t=e.xhr;return n.emit(T,t)}),n._addHammerheadListener(f.EVENTS.xhrError,function(e){var t=e.xhr;return n.emit(_,t)}),n._addHammerheadListener(f.EVENTS.fetchSent,function(e){n.emit(w,e),e.then(function(){return n.emit(T,e)},function(){return n.emit(_,e)})}),n}var N=(x.prototype._startListening=function(){var t=this;this._emitter.onScriptAdded(function(e){return t._onScriptElementAdded(e)}),this._emitter.onScriptLoadedOrFailed(function(e){return t._onScriptLoadedOrFailed(e)})},x.prototype._offListening=function(){this._emitter.offAll()},x.prototype._onScriptElementAdded=function(e){var t=this,n=(0,d.nativeMethods.setTimeout)(function(){return t._onScriptLoadedOrFailed(e,!0)},x.LOADING_TIMEOUT);this._scripts.set(e,n)},x.prototype._onScriptLoadedOrFailed=function(e,t){var n=this;void 0===t&&(t=!1),this._scripts.has(e)&&(t||(0,d.nativeMethods.clearTimeout)(this._scripts.get(e)),this._scripts.delete(e),this._scripts.size||c(25).then(function(){n._waitResolve&&!n._scripts.size&&n._finishWaiting()}))},x.prototype._finishWaiting=function(){this._watchdog&&((0,d.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._scripts.clear(),this._offListening(),this._waitResolve(),this._waitResolve=null},x.prototype.wait=function(){var n=this;return new d.Promise(function(e){var t;n._waitResolve=e,n._scripts.size?(t=d.nativeMethods.setTimeout,n._watchdog=t(function(){return n._finishWaiting()},x.TIMEOUT)):n._finishWaiting()})},x.TIMEOUT=3e3,x.LOADING_TIMEOUT=2e3,x);function x(e){this._emitter=e,this._watchdog=null,this._waitResolve=null,this._scripts=new Map,this._startListening()}var R,M=f.nativeMethods,O="script-added",F="script-loaded-or-failed",A=(g(L,R=b),L.prototype._onScriptElementAdded=function(e){var t,n=this,o=M.scriptSrcGetter.call(e);void 0!==o&&""!==o&&(this.emit(O,e),t=function(){M.removeEventListener.call(e,"load",t),M.removeEventListener.call(e,"error",t),n.emit(F,e)},M.addEventListener.call(e,"load",t),M.addEventListener.call(e,"error",t))},L.prototype.onScriptAdded=function(e){this.on(O,e)},L.prototype.onScriptLoadedOrFailed=function(e){this.on(F,e)},L.prototype.offAll=function(){R.prototype.offAll.call(this),f.off(f.EVENTS.scriptElementAdded,this._onScriptElementAdded)},L);function L(){var n=R.call(this)||this;return n._scriptElementAddedListener=function(e){var t=e.el;return n._onScriptElementAdded(t)},f.on(f.EVENTS.scriptElementAdded,n._scriptElementAddedListener),n}function V(e){var t="array"+e.charAt(0).toUpperCase()+e.slice(1),n=d.nativeMethods[t];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,e)}}var W=V("filter"),k=V("map"),H=V("slice"),D=V("splice"),U=V("unshift"),B=V("forEach"),q=V("indexOf"),G=V("some"),j=V("reverse"),z=V("reduce"),J=V("concat"),K=V("join");function Y(e,t){if(d.nativeMethods.arrayFind)return d.nativeMethods.arrayFind.call(e,t);for(var n=e.length,o=0;o<n;o++)if(t(e[o],o,e))return e[o];return null}var X=Object.freeze({__proto__:null,filter:W,map:k,slice:H,splice:D,unshift:U,forEach:B,indexOf:q,some:G,reverse:j,reduce:z,concat:J,join:K,isArray:function(e){return"[object Array]"===d.nativeMethods.objectToString.call(e)},from:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(d.nativeMethods.arrayFrom)return d.nativeMethods.arrayFrom.apply(d.nativeMethods,y([e],t,!1));for(var o=[],r=e.length,i=0;i<r;i++)o.push(e[i]);return o},find:Y,remove:function(e,t){var n=d.nativeMethods.arrayIndexOf.call(e,t);-1<n&&d.nativeMethods.arraySplice.call(e,n,1)},equals:function(e,t){if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!1;return!0},getCommonElement:function(e,t){for(var n=0;n<e.length;n++)for(var o=0;o<t.length;o++)if(e[n]===t[o])return e[n];return null}}),Q=f.utils.browser,$=f.nativeMethods,Z=f.utils.style.get,ee=f.utils.dom.getActiveElement,te=f.utils.dom.findDocument,ne=f.utils.dom.find,oe=f.utils.dom.isElementInDocument,re=f.utils.dom.isElementInIframe,ie=f.utils.dom.getIframeByElement,ae=f.utils.dom.isCrossDomainWindows,se=f.utils.dom.getSelectParent,le=f.utils.dom.getChildVisibleIndex,ce=f.utils.dom.getSelectVisibleChildren,ue=f.utils.dom.isElementNode,de=f.utils.dom.isTextNode,fe=f.utils.dom.isRenderedNode,he=f.utils.dom.isIframeElement,pe=f.utils.dom.isInputElement,me=f.utils.dom.isButtonElement,ge=f.utils.dom.isFileInput,Ee=f.utils.dom.isTextAreaElement,ve=f.utils.dom.isAnchorElement,ye=f.utils.dom.isImgElement,be=f.utils.dom.isFormElement,Ce=f.utils.dom.isLabelElement,Se=f.utils.dom.isSelectElement,we=f.utils.dom.isRadioButtonElement,Te=f.utils.dom.isColorInputElement,_e=f.utils.dom.isCheckboxElement,Ie=f.utils.dom.isOptionElement,Pe=f.utils.dom.isSVGElement,Ne=f.utils.dom.isMapElement,xe=f.utils.dom.isBodyElement,Re=f.utils.dom.isHtmlElement,Me=f.utils.dom.isDocument,Oe=f.utils.dom.isWindow,Fe=f.utils.dom.isTextEditableInput,Ae=f.utils.dom.isTextEditableElement,Le=f.utils.dom.isTextEditableElementAndEditingAllowed,Ve=f.utils.dom.isContentEditableElement,We=f.utils.dom.isDomElement,ke=f.utils.dom.isShadowUIElement,He=f.utils.dom.isShadowRoot,De=f.utils.dom.isElementFocusable,Ue=f.utils.dom.isHammerheadAttr,Be=f.utils.dom.isElementReadOnly,qe=f.utils.dom.getScrollbarSize,Ge=f.utils.dom.getMapContainer,je=f.utils.dom.getTagName,ze=f.utils.dom.closest,Je=f.utils.dom.getParents,Ke=f.utils.dom.findParent,Ye=f.utils.dom.getTopSameDomainWindow,Xe=f.utils.dom.getParentExceptShadowRoot;function Qe(e,t){var n,o={el:n=e,skip:n.shadowRoot&&n.tabIndex<0,children:{}};if(e=e.shadowRoot||e,he(e)&&(e=$.contentDocumentGetter.call(e)),e&&(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node.DOCUMENT_NODE))for(var r=0,i=function(e){for(var t,n=e.querySelectorAll("*"),o=function(e){for(var t=[],n=0;n<e.length;n++)"none"===Z(e[n],"display")&&t.push(e[n]);return t}(n),r=/^(input|button|select|textarea)$/,i=[],a=null,s=null,l=null,c=!1,u=0;u<n.length;u++){a=n[u],s=je(a),l=$e(a),c=!1,function(e,t,n){var o=null;return t.nodeType===Node.DOCUMENT_NODE&&(o=$.documentActiveElementGetter.call(t)),e===o||!(e.disabled||"none"===Z(e,"display")||"hidden"===Z(e,"visibility")||(Q.isIE||Q.isAndroid)&&Ie(e)||null!==n&&n<0)}(a,e,l)&&(r.test(s)||a.shadowRoot||he(a)?c=!0:ve(a)&&a.hasAttribute("href")&&(c=""!==a.getAttribute("href")||!Q.isIE||null!==l),""!==(t=a.getAttribute("contenteditable"))&&"true"!==t||(c=!0),null!==l&&(c=!0),c&&i.push(a))}return W(i,function(e){return!Ze(o,e)})}(e);r<i.length;r++){var a=i[r],s=!t||a.tabIndex<=0?-1:a.tabIndex;o.children[s]=o.children[s]||[],o.children[s].push(Qe(a,t))}return o}function $e(e){var t=$.getAttribute.call(e,"tabindex");return null!==t&&(t=parseInt(t,10),t=isNaN(t)?null:t),t}function Ze(e,t){return e.contains?e.contains(t):G(e,function(e){return e.contains(t)})}function et(e,t){if(nt(t,e))return!0;for(var n=$.nodeChildNodesGetter.call(e),o=st(n),r=0;r<o;r++){var i=n[r];if(!ke(i)&&et(i,t))return!0}return!1}function tt(e,t){var n=e.querySelectorAll(je(t));return q(n,t)}function nt(e,t){return e&&t&&e.isSameNode?e.isSameNode(t):e===t}function ot(t){if(!t.setTimeout)return!1;var e=null;try{e=t.frameElement}catch(e){return!!t.top}return!(!Q.isFirefox&&!Q.isWebKit||t.top===t||e)||!(!e||!$.contentDocumentGetter.call(e))}function rt(e){try{return e.top===e}catch(e){return!1}}function it(e){var t=[];ne(gi,"*",function(e){"IFRAME"===e.tagName&&t.push(e),e.shadowRoot&&ne(e.shadowRoot,"iframe",function(e){return t.push(e)})});for(var n=0;n<t.length;n++)if($.contentWindowGetter.call(t[n])===e)return t[n];return null}function at(e){return $.htmlCollectionLengthGetter.call(e)}function st(e){return $.nodeListLengthGetter.call(e)}function lt(e){return $.inputValueGetter.call(e)}function ct(e){return $.textAreaValueGetter.call(e)}function ut(e,t){return $.inputValueSetter.call(e,t)}function dt(e,t){return $.textAreaValueSetter.call(e,t)}function ft(e){return pe(e)?lt(e):Ee(e)?ct(e):e.value}function ht(e){return e&&e.getRootNode&&te(e)!==e.getRootNode()}var pt=Object.freeze({__proto__:null,getActiveElement:ee,findDocument:te,find:ne,isElementInDocument:oe,isElementInIframe:re,getIframeByElement:ie,isCrossDomainWindows:ae,getSelectParent:se,getChildVisibleIndex:le,getSelectVisibleChildren:ce,isElementNode:ue,isTextNode:de,isRenderedNode:fe,isIframeElement:he,isInputElement:pe,isButtonElement:me,isFileInput:ge,isTextAreaElement:Ee,isAnchorElement:ve,isImgElement:ye,isFormElement:be,isLabelElement:Ce,isSelectElement:Se,isRadioButtonElement:we,isColorInputElement:Te,isCheckboxElement:_e,isOptionElement:Ie,isSVGElement:Pe,isMapElement:Ne,isBodyElement:xe,isHtmlElement:Re,isDocument:Me,isWindow:Oe,isTextEditableInput:Fe,isTextEditableElement:Ae,isTextEditableElementAndEditingAllowed:Le,isContentEditableElement:Ve,isDomElement:We,isShadowUIElement:ke,isShadowRoot:He,isElementFocusable:De,isHammerheadAttr:Ue,isElementReadOnly:Be,getScrollbarSize:qe,getMapContainer:Ge,getTagName:je,closest:ze,getParents:Je,findParent:Ke,getTopSameDomainWindow:Ye,getParentExceptShadowRoot:Xe,getFocusableElements:function(e,t){return void 0===t&&(t=!1),function e(t){var n,o=[];for(n in t.skip||t.el.nodeType===Node.DOCUMENT_NODE||he(t.el)||o.push(t.el),t.children)for(var r=0,i=t.children[n];r<i.length;r++){var a=i[r];o.push.apply(o,e(a))}return o}(Qe(e,t))},getTabIndexAttributeIntValue:$e,containsElement:Ze,getTextareaIndentInLine:function(e,t){var n=ct(e);if(!n)return 0;var o=n.substring(0,t);return t-(-1===o.lastIndexOf("\n")?0:o.lastIndexOf("\n")+1)},getTextareaLineNumberByPosition:function(e,t){for(var n=ct(e).split("\n"),o=0,r=0,i=0;o<=t;i++){if(t<=o+n[i].length){r=i;break}o+=n[i].length+1}return r},getTextareaPositionByLineAndOffset:function(e,t,n){for(var o=ct(e).split("\n"),r=0,i=0;i<t;i++)r+=o[i].length+1;return r+n},blocksImplicitSubmission:function(e){return(Q.isSafari?/^(text|password|color|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:Q.isFirefox?/^(text|password|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:Q.isIE?/^(text|password|color|date|time|datetime|datetime-local|email|file|month|number|search|tel|url|week|image)$/i:/^(text|password|datetime|email|number|search|tel|url|image)$/i).test(e.type)},isEditableElement:function(e,t){return t?Le(e)||Ve(e):Ae(e)||Ve(e)},isElementContainsNode:et,isOptionGroupElement:function(e){return"[object HTMLOptGroupElement]"===f.utils.dom.instanceToString(e)},getElementIndexInParent:tt,isTheSameNode:nt,getElementDescription:function(e){var t,n,o={id:"id",name:"name",class:"className"},r=[];for(t in r.push("<"),r.push(je(e)),o)!o.hasOwnProperty(t)||(n=e[o[t]])&&r.push(" "+t+'="'+n+'"');return r.push(">"),r.join("")},getFocusableParent:function(e){for(var t=Je(e),n=0;n<t.length;n++)if(De(t[n]))return t[n];return null},remove:function(e){e&&e.parentElement&&e.parentElement.removeChild(e)},isIFrameWindowInDOM:ot,isTopWindow:rt,findIframeByWindow:it,isEditableFormElement:function(e){return Ae(e)||Se(e)},getCommonAncestor:function(e,t){if(nt(e,t))return e;for(var n=[e].concat(Je(e)),o=t;o;){if(-1<q(n,o))return o;o=$.nodeParentNodeGetter.call(o)}return o},getChildrenLength:at,getChildNodesLength:st,getInputValue:lt,getTextAreaValue:ct,setInputValue:ut,setTextAreaValue:dt,getElementValue:ft,setElementValue:function(e,t){return pe(e)?ut(e,t):Ee(e)?dt(e,t):e.value=t},isShadowElement:ht,contains:function(t,e){return!(!t||!e)&&(t.contains?t.contains(e):!!Ke(e,!0,function(e){return e===t}))},isNodeEqual:function(e,t){return e===t},getNodeText:function(e){return $.nodeTextContentGetter.call(e)},getImgMapName:function(e){return e.useMap.substring(1)},getDocumentElement:function(e){return e.document.documentElement},isDocumentElement:function(e){return e===gi.documentElement}}),mt=f.Promise,gt=f.nativeMethods,Et=f.eventSandbox.listeners,vt=f.utils.browser,yt=f.utils.event.BUTTON,bt=f.utils.event.BUTTONS_PARAMETER,Ct=f.utils.event.DOM_EVENTS,St=f.utils.event.WHICH_PARAMETER,wt=f.utils.event.preventDefault;function Tt(e,t,n,o){vt.isIE11&&Oe(e)?gt.windowAddEventListener.call(e,t,n,o):gt.addEventListener.call(e,t,n,o)}function _t(e,t,n,o){vt.isIE11&&Oe(e)?gt.windowRemoveEventListener.call(e,t,n,o):gt.removeEventListener.call(e,t,n,o)}function It(){var n=[],e=!1;function t(){e||(gi.body?(e=!0,n.forEach(function(e){return e()})):gt.setTimeout.call(mi,t,1))}function o(){(ot(mi)||rt(mi))&&(_t(gi,"DOMContentLoaded",o),t())}return"complete"===gi.readyState?gt.setTimeout.call(mi,o,1):Tt(gi,"DOMContentLoaded",o),{then:function(e){return t=e,new mt(function(e){return n.push(function(){return e(t())})});var t}}}var Pt,Nt,xt=Object.freeze({__proto__:null,BUTTON:yt,BUTTONS_PARAMETER:bt,DOM_EVENTS:Ct,WHICH_PARAMETER:St,preventDefault:wt,bind:Tt,unbind:_t,documentReady:function(e){return void 0===e&&(e=0),It().then(function(){return Et.getEventListeners(mi,"load").length?mt.race([new mt(function(e){return Tt(mi,"load",e)}),c(e)]):null})}});(Nt=Pt=Pt||{}).ready="ready",Nt.readyForBrowserManipulation="ready-for-browser-manipulation",Nt.waitForFileDownload="wait-for-file-download";var Rt=Pt,Mt=f.Promise,Ot=f.utils.browser,Ft=f.nativeMethods,At=f.transport,Lt=30,Vt=500,Wt=!1,kt=null,Ht=!1;function Dt(){if(Ot.isIE)return function(e){Bt&&Ft.clearTimeout.call(mi,Bt),Ut=!0,Bt=Ft.setTimeout.call(mi,function(){Bt=null,Ut=!1,qt.forEach(function(e){return e()}),qt=[]},e)}(Lt),void c(0).then(function(){var e;"loading"===gi.readyState&&((e=Ft.documentActiveElementGetter.call(gi))&&ve(e)&&e.hasAttribute("download")||(Wt=!0))});Wt=!0}var Ut=!1,Bt=null,qt=[],Gt=Object.freeze({__proto__:null,init:function(){f.on(f.EVENTS.beforeUnload,Dt),Tt(mi,"unload",function(){Wt=!0})},watchForPageNavigationTriggers:function(){kt=function(){Ht=!0},f.on(f.EVENTS.pageNavigationTriggered,kt)},wait:function(e){void 0===e&&(e=!kt||Ht?400:0),kt&&(f.off(f.EVENTS.pageNavigationTriggered,kt),kt=null);var t=c(e).then(function(){return Wt?c(Vt).then(function(){return At.queuedAsyncServiceMsg({cmd:Rt.waitForFileDownload})}).then(function(e){if(!e)return new Mt(function(){})}).then(function(){Wt=!1}):Ut?new Mt(function(e){return qt.push(e)}):void 0}),n=c(15e3).then(function(){Wt=!1});return Mt.race([t,n])}}),jt=b,zt=Object.freeze({__proto__:null,EventEmitter:jt,inherit:function(e,t){function n(){}n.prototype=t.prototype,f.utils.extend(e.prototype,new n),(e.prototype.constructor=e).base=t.prototype}}),Jt=d.eventSandbox.listeners;function Kt(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new jt}var Yt=(Kt.prototype._internalListener=function(e,t,n,o,r){this.events.emit("scroll",e),this.stopPropagationFlag&&(o(),r())},Kt.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,Jt.initElementListening(mi,["scroll"]),Jt.addFirstInternalEventBeforeListener(mi,["scroll"],function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n._internalListener.apply(n,e)}))},Kt.prototype.waitForScroll=function(e){var t=this,n=null,o=new d.Promise(function(e){n=e});return o.cancel=function(){return t.events.off("scroll",n)},this.initialized?this.handleScrollEvents(e,n):n(),o},Kt.prototype.handleScrollEvents=function(n,e){var o=this;this.events.once("scroll",e),ht(n)&&(Jt.initElementListening(n,["scroll"]),Jt.addFirstInternalEventBeforeListener(n,["scroll"],function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o._internalListener.apply(o,e),Jt.cancelElementListening(n)}))},Kt.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},Kt.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new Kt),Xt=(Qt.create=function(e){return new Qt(e.top,e.right,e.bottom,e.left)},Qt.prototype.add=function(e){return this.top+=e.top,this.right+=e.right,this.bottom+=e.bottom,this.left+=e.left,this},Qt.prototype.sub=function(e){return"top"in e&&(this.top-=e.top,this.left-=e.left),this.bottom-=e.bottom,this.right-=e.right,this},Qt.prototype.round=function(e,t){return void 0===e&&(e=Math.round),void 0===t&&(t=e),this.top=e(this.top),this.right=t(this.right),this.bottom=t(this.bottom),this.left=e(this.left),this},Qt.prototype.contains=function(e){return e.x>=this.left&&e.x<=this.right&&e.y>=this.top&&e.y<=this.bottom},Qt);function Qt(e,t,n,o){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===o&&(o=0),this.top=e,this.right=t,this.bottom=n,this.left=o}var $t=f.utils.style,Zt=f.utils.style.getBordersWidth,en=f.utils.style.getComputedStyle,tn=f.utils.style.getElementMargin,nn=f.utils.style.getElementPadding,on=f.utils.style.getElementScroll,rn=f.utils.style.getOptionHeight,an=f.utils.style.getSelectElementSize,sn=f.utils.style.isElementVisible,ln=f.utils.style.isVisibleChild,cn=f.utils.style.getWidth,un=f.utils.style.getHeight,dn=f.utils.style.getInnerWidth,fn=f.utils.style.getInnerHeight,hn=f.utils.style.getScrollLeft,pn=f.utils.style.getScrollTop,mn=f.utils.style.setScrollLeft,gn=f.utils.style.setScrollTop,En=f.utils.style.get,vn=f.utils.style.getBordersWidthFloat,yn=f.utils.style.getElementPaddingFloat;function bn(e,t,n){for(var o in"string"==typeof t&&$t.set(e,t,n),t)t.hasOwnProperty(o)&&$t.set(e,o,t[o])}function Cn(e,t,n){return e<t?n:e<n?t:Math.max(n,t)}function Sn(e){return!!Ke(e,!0,function(e){return ue(e)&&"hidden"===$t.get(e,"visibility")})}function wn(e){return!!Ke(e,!0,function(e){return ue(e)&&"none"===$t.get(e,"display")})}function Tn(e){return!fe(e)||wn(e)||Sn(e)}function _n(e){return e&&!(e.offsetHeight<=0&&e.offsetWidth<=0)}function In(e){return ue(e)&&"fixed"===$t.get(e,"position")}var Pn=Object.freeze({__proto__:null,getBordersWidth:Zt,getComputedStyle:en,getElementMargin:tn,getElementPadding:nn,getElementScroll:on,getOptionHeight:rn,getSelectElementSize:an,isElementVisible:sn,isSelectVisibleChild:ln,getWidth:cn,getHeight:un,getInnerWidth:dn,getInnerHeight:fn,getScrollLeft:hn,getScrollTop:pn,setScrollLeft:mn,setScrollTop:gn,get:En,getBordersWidthFloat:vn,getElementPaddingFloat:yn,set:bn,getViewportDimensions:function(){return{width:Cn(mi.innerWidth,gi.documentElement.clientWidth,gi.body.clientWidth),height:Cn(mi.innerHeight,gi.documentElement.clientHeight,gi.body.clientHeight)}},getWindowDimensions:function(e){return new Xt(0,cn(e),un(e),0)},isHiddenNode:Sn,isNotDisplayedNode:wn,isNotVisibleNode:Tn,hasDimensions:_n,isFixedElement:In}),Nn=d.utils.browser,xn=d.eventSandbox.listeners,Rn=d.eventSandbox.eventSimulator,Mn=["click","mousedown","mouseup","dblclick","contextmenu","mousemove","mouseover","mouseout","touchstart","touchmove","touchend","keydown","keypress","input","keyup","change","focus","blur","MSPointerDown","MSPointerMove","MSPointerOver","MSPointerOut","MSPointerUp","pointerdown","pointermove","pointerover","pointerout","pointerup"],On=123;function Fn(e,t,n,o,r){var i,a=d.nativeMethods.eventTargetGetter.call(e)||e.srcElement;if(!t&&!ke(a)){if(/^key/.test(e.type)&&((i=e).shiftKey&&i.ctrlKey||(i.altKey||i.metaKey)&&Nn.isMacPlatform||i.keyCode===On))return void r();if("blur"===e.type)if(Nn.isIE&&Nn.version<12){var s,l=Oe(a),c=!l&&"none"===En(a,"display"),u=!1;l||c||(s=Je(a),u=W(s,function(e){return"none"===En(e,"display")})),(c||u.length)&&d.eventSandbox.timers.deferFunction(function(){Rn.blur(a)})}else if(a!==mi&&a!==mi.document&&!_n(a))return;n()}}var An=(Ln.create=function(e){return"left"in e?new Ln(e.left,e.top):"right"in e?new Ln(e.right,e.bottom):new Ln(e.x,e.y)},Ln.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},Ln.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},Ln.prototype.round=function(e){return void 0===e&&(e=Math.round),this.x=e(this.x),this.y=e(this.y),this},Ln.prototype.eql=function(e){return this.x===e.x&&this.y===e.y},Ln.prototype.mul=function(e){return this.x*=e,this.y*=e,this},Ln.prototype.distance=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},Ln);function Ln(e,t){this.x=e,this.y=t}var Vn=/auto|scroll|hidden/i,Wn="visible";function kn(e){var t,n=En(e,"overflowX"),o=En(e,"overflowY"),r=Vn.test(n),i=Vn.test(o),a=te(e).documentElement,s=e.scrollHeight;return(d.utils.browser.isChrome||d.utils.browser.isFirefox||d.utils.browser.isSafari)&&(t=e.getBoundingClientRect().top,s=s-a.getBoundingClientRect().top+t),(r||i)&&s>a.scrollHeight}function Hn(e){if(xe(e))return kn(e);if(Re(e))return function(e){var t=En(e,"overflowX"),n=En(e,"overflowY");if("hidden"===t&&"hidden"===n)return!1;var o=e.scrollHeight>e.clientHeight,r=e.scrollWidth>e.clientWidth;if(o||r)return!0;var i=e.getElementsByTagName("body")[0];if(!i)return!1;if(kn(i))return!1;var a=Math.min(e.clientWidth,i.clientWidth),s=Math.min(e.clientHeight,i.clientHeight);return i.scrollHeight>s||i.scrollWidth>a}(e);var t,n,o,r,i,a=(n=En(t=e,"overflowX"),o=En(t,"overflowY"),r=Vn.test(n),i=Vn.test(o),d.utils.browser.isIE&&(r=r||i&&n===Wn,i=i||r&&o===Wn),new An(r,i));if(!a.x&&!a.y)return!1;var s=a.y&&e.scrollHeight>e.clientHeight;return a.x&&e.scrollWidth>e.clientWidth||s}function Dn(e){var t,n,o=Je(e);return!re(e)||(t=ie(e))&&(n=Je(t),o.concat(n)),d.nativeMethods.arrayFilter.call(o,Hn)}var Un=Object.freeze({__proto__:null,hasScroll:Hn,getScrollableParents:Dn}),Bn=f.shadowUI,qn=f.nativeMethods,Gn="disabled";function jn(){this.currentEl=null,this.optionList=null,this.groups=[],this.options=[]}var zn=(jn.prototype._createOption=function(e,t){var n=gi.createElement("div"),o=e.disabled||"optgroup"===je(e.parentElement)&&e.parentElement.disabled,r="option"===je(e)?e.text:"";qn.nodeTextContentSetter.call(n,r),t.appendChild(n),Bn.addClass(n,"tcOption"),o&&(Bn.addClass(n,Gn),bn(n,"color",En(e,"color"))),this.options.push(n)},jn.prototype._createGroup=function(e,t){var n=gi.createElement("div");qn.nodeTextContentSetter.call(n,e.label||" "),t.appendChild(n),Bn.addClass(n,"tcOptionGroup"),e.disabled&&(Bn.addClass(n,Gn),bn(n,"color",En(e,"color"))),this.createChildren(e.children,n),this.groups.push(n)},jn.prototype.clear=function(){this.optionList=null,this.currentEl=null,this.options=[],this.groups=[]},jn.prototype.createChildren=function(e,t){for(var n=at(e),o=0;o<n;o++)Ie(e[o])?this._createOption(e[o],t):"optgroup"===je(e[o])&&this._createGroup(e[o],t)},jn.prototype.getEmulatedChildElement=function(e){var t="optgroup"===je(e),n=tt(this.currentEl,e);return t?this.groups[n]:this.options[n]},jn.prototype.isOptionListExpanded=function(e){return e?e===this.currentEl:!!this.currentEl},jn.prototype.isOptionElementVisible=function(e){var t=se(e);if(!t)return!0;var n=this.isOptionListExpanded(t),o=an(t);return n||1<o},new jn),Jn=function(e,t,n,o,r,i){this.width=e,this.height=t,this.left=n.x,this.top=n.y,this.right=n.x+e,this.bottom=n.y+t,this.border=o,this.scrollbar=i,this.scroll=r},Kn={notElementOrTextNode:function(e){return"\n The ".concat(e," is neither a DOM element nor a text node.\n ")},elOutsideBounds:function(e,t){return"\n The ".concat(t," (").concat(e,") is located outside the the layout viewport.\n ")},elHasWidthOrHeightZero:function(e,t,n,o){return"\n The ".concat(t," (").concat(e,") is too small to be visible: ").concat(n,"px x ").concat(o,"px.\n ")},elHasDisplayNone:function(e,t){return"\n The ".concat(t," (").concat(e,") is invisible. \n The value of its 'display' property is 'none'.\n ")},parentHasDisplayNone:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible. \n It descends from an element that has the 'display: none' property (").concat(n,").\n ")},elHasVisibilityHidden:function(e,t){return"\n The ".concat(t," (").concat(e,") is invisible.\n The value of its 'visibility' property is 'hidden'.\n ")},parentHasVisibilityHidden:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible.\n It descends from an element that has the 'visibility: hidden' property (").concat(n,").\n ")},elHasVisibilityCollapse:function(e,t){return"\n The ".concat(t," (").concat(e,") is invisible.\n The value of its 'visibility' property is 'collapse'.\n ")},parentHasVisibilityCollapse:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible.\n It descends from an element that has the 'visibility: collapse' property (").concat(n,").\n ")},elNotRendered:function(e,t){return"\n The ".concat(t," (").concat(e,") has not been rendered.\n ")},optionNotVisible:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible. \n The parent element (").concat(n,") is collapsed, and its length is shorter than 2.\n ")},mapContainerNotVisible:function(e,t){return"\n The action target (".concat(e,") is invisible because ").concat(t,"\n ")}},Yn=f.utils.html,Xn=f.nativeMethods,Qn=10;function $n(e){if(!e)return"";var t,n,o,r=Xn.cloneNode.call(e),i=Yn.cleanUpHtml(Xn.elementOuterHTMLGetter.call(r)),a=(t=Xn.nodeTextContentGetter.call(e),n=Qn,void 0===o&&(o="..."),t.length<n?t:t.substring(0,n-o.length)+o),s=Xn.elementChildrenGetter.call(e);return 0<Xn.htmlCollectionLengthGetter.call(s)?i.replace("></",">...</"):a?i.replace("></",">".concat(a,"</")):i}var Zn=f.utils.position.getElementRectangle,eo=f.utils.position.getOffsetPosition,to=f.utils.position.offsetToClientCoords;function no(e){var t,n,o,r,i=Re(e),a=i?e.getElementsByTagName("body")[0]:null,s=e.getBoundingClientRect(),l=Xt.create(Zt(e)),c=on(e),u=re(e),d="BackCompat"===e.ownerDocument.compatMode,f=i?new An(0,0):An.create(s),h=s.height,p=s.width;i&&(p=a&&d?(h=a.clientHeight,a.clientWidth):(h=e.clientHeight,e.clientWidth)),!u||(t=ie(e))&&(n=eo(t),o=to(An.create(n)),r=Zt(t),f.add(o).add(An.create(r)),i&&l.add(r));var m=!i&&dn(e)!==e.clientWidth,g=!i&&fn(e)!==e.clientHeight,E={right:m?qe():0,bottom:g?qe():0};return new Jn(p,h,f,l,c,E)}function oo(e){var t=e.x,n=e.y,o=gi.getElementFromPoint||gi.elementFromPoint,r=null;try{r=o.call(gi,t,n)}catch(e){return null}for(null===r&&(r=o.call(gi,t-1,n-1));r&&r.shadowRoot&&r.shadowRoot.elementFromPoint;){var i=r.shadowRoot.elementFromPoint(t,n);if(!i||r===i)break;r=i}return r}function ro(e,t){return Xt.create({top:e.top-t.top,left:e.left-t.left,right:t.right-e.right,bottom:t.bottom-e.bottom}).sub(t.border).sub(t.scrollbar).round(Math.ceil,Math.floor)}function io(e){var t=/^touch/.test(e.type)&&e.targetTouches?e.targetTouches[0]||e.changedTouches[0]:e,n=0===t.pageX&&0===t.pageY,o=0!==t.clientX||0!==t.clientY;if((null===t.pageX||n&&o)&&null!==t.clientX){var r=te(e.target||e.srcElement),i=r.documentElement,a=r.body;return new An(Math.round(t.clientX+(i&&i.scrollLeft||a&&a.scrollLeft||0)-(i.clientLeft||0)),Math.round(t.clientY+(i&&i.scrollTop||a&&a.scrollTop||0)-(i.clientTop||0)))}return new An(Math.round(t.pageX),Math.round(t.pageY))}function ao(e){return!uo(e)}function so(e){return"hidden"===En(e,"visibility")}function lo(e){return"collapse"===En(e,"visibility")}function co(e){return"none"===En(e,"display")}function uo(e){return!ht(e)&&(so(e)||lo(e)||co(e))}function fo(e){var t=Zn(e);return 0===t.width||0===t.height}function ho(e){return e.replace(/.*The/,"its")}var po=Object.freeze({__proto__:null,getElementRectangle:Zn,getOffsetPosition:eo,offsetToClientCoords:to,getClientDimensions:no,getElementFromPoint:oo,calcRelativePosition:ro,getIframeClientCoordinates:function(e){var t=eo(e),n=t.left,o=t.top,r=to({x:n,y:o}),i=Zt(e),a=nn(e),s=r.x+i.left+a.left,l=r.y+i.top+a.top;return new Xt(l,s+cn(e),l+un(e),s)},containsOffset:function(e,t,n){var o=no(e),r=Math.max(e.scrollWidth,o.width),i=Math.max(e.scrollHeight,o.height),a=o.scrollbar.right+o.border.left+o.border.right+r,s=o.scrollbar.bottom+o.border.top+o.border.bottom+i;return(void 0===t||0<=t&&t<=a)&&(void 0===n||0<=n&&n<=s)},getEventAbsoluteCoordinates:function(e){var t,n,o,r=e.target||e.srcElement,i=io(e),a=te(r),s=0,l=0;return!re(a.documentElement)||(t=ie(a))&&(n=eo(t),o=Zt(t),s=n.left+o.left,l=n.top+o.top),new An(i.x+s,i.y+l)},getEventPageCoordinates:io,getIframePointRelativeToParentFrame:function(e,t){var n=it(t),o=eo(n),r=Zt(n),i=nn(n);return to({x:e.x+o.left+r.left+i.left,y:e.y+o.top+r.top+i.top})},findCenter:function(e){var t=Zn(e);return new An(Math.round(t.left+t.width/2),Math.round(t.top+t.height/2))},getClientPosition:function(e){var t=eo(e),n=t.left,o=t.top,r=to({x:n,y:o});return r.x=Math.round(r.x),r.y=Math.round(r.y),r},isInRectangle:function(e,t){var n=e.x,o=e.y;return n>=t.left&&n<=t.right&&o>=t.top&&o<=t.bottom},getWindowPosition:function(){var e=mi.screenLeft||mi.screenX,t=mi.screenTop||mi.screenY;return new An(e,t)},isIframeVisible:ao,isElementVisible:function e(t){if(!We(t)&&!de(t))return!1;if(Ie(t)||"optgroup"===je(t))return zn.isOptionElementVisible(t);if(he(t))return ao(t);if(Pe(t))return!Ke(t,!0,uo)&&!fo(t);if(de(t))return!Tn(t);if(!Ve(t)&&fo(t))return!1;if(Ne(t)){var n=Ge(ze(t,"map"));return!!n&&e(n)}return _n(t)&&!uo(t)},getSubHiddenReason:ho,getHiddenReason:function e(t,n){if(void 0===n&&(n="action target"),!t)return null;var o=de(t);if(!We(t)&&!o)return Kn.notElementOrTextNode(n);var r=o?t.data:$n(t),i=t.offsetHeight,a=t.offsetWidth;if((Ie(t)||"optgroup"===je(t))&&!zn.isOptionElementVisible(t)){var s=$n(se(t));return Kn.optionNotVisible(r,n,s)}if(Ne(t)){var l=ho(e(Ge(ze(t,"map")),"container")||"");return Kn.mapContainerNotVisible(r,l)}var c=Ke(t,!1,so);if(c)return Kn.parentHasVisibilityHidden(r,n,$n(c));var u=Ke(t,!1,lo);if(u)return Kn.parentHasVisibilityCollapse(r,n,$n(u));var d=Ke(t,!1,co);return d?Kn.parentHasDisplayNone(r,n,$n(d)):so(t)?Kn.elHasVisibilityHidden(r,n):lo(t)?Kn.elHasVisibilityCollapse(r,n):co(t)?Kn.elHasDisplayNone(r,n):de(t)&&!fe(t)?Kn.elNotRendered(r,n):!Ve(t)&&fo(t)||!_n(t)?Kn.elHasWidthOrHeightZero(r,n,a,i):null},getElOutsideBoundsReason:function e(t,n){void 0===n&&(n="action target");var o=$n(t);if(Ne(t)){var r=ho(e(Ge(ze(t,"map")),"container")||"");return Kn.mapContainerNotVisible(o,r)}return Kn.elOutsideBounds(o,n)}});function mo(n,o){return E(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<n?[4,o(t)]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}var go=Object.freeze({__proto__:null,whilst:function(t,n){return E(this,void 0,void 0,function(){return v(this,function(e){switch(e.label){case 0:return t()?[4,n()]:[3,2];case 1:return e.sent(),[3,0];case 2:return[2]}})})},times:mo,each:function(r,i){return E(this,void 0,void 0,function(){var t,n,o;return v(this,function(e){switch(e.label){case 0:t=0,n=r,e.label=1;case 1:return t<n.length?(o=n[t],[4,i(o)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}}),Eo=f.Promise,vo=f.eventSandbox.message;function yo(e,o,t){return new Eo(function(n){vo.on(vo.SERVICE_MSG_RECEIVED_EVENT,function e(t){t.message.cmd===o&&(vo.off(vo.SERVICE_MSG_RECEIVED_EVENT,e),n(t.message))}),vo.sendServiceMsg(e,t)})}var bo=(Co._isScrollValuesChanged=function(e,t){return hn(e)!==t.left||pn(e)!==t.top},Co.prototype._setScroll=function(e,t){var n=this,o=t.left,r=t.top,i=Re(e)?te(e):e,a={left:hn(i),top:pn(i)},o=Math.max(o,0),r=Math.max(r,0),s=Yt.waitForScroll(i);return mn(i,o),gn(i,r),Co._isScrollValuesChanged(i,a)?s=s.then(function(){n._scrollWasPerformed||(n._scrollWasPerformed=Co._isScrollValuesChanged(i,a))}):(s.cancel(),d.Promise.resolve())},Co.prototype._getScrollToPoint=function(e,t,n){var o=Math.floor(e.width/2),r=Math.floor(e.height/2),i=this._scrollToCenter?o:Math.min(n.left,o),a=this._scrollToCenter?r:Math.min(n.top,r),s=e.scroll,l=s.left,c=s.top,u=t.x>=l+e.width-i,d=t.x<=l+i,f=t.y>=c+e.height-a,h=t.y<=c+a;return u?l=t.x-e.width+i:d&&(l=t.x-i),f?c=t.y-e.height+a:h&&(c=t.y-a),{left:l,top:c}},Co.prototype._getScrollToFullChildView=function(e,t,n){var o,r,i,a,s={left:null,top:null},l=e.width>=t.width,c=e.height>=t.height,u=ro(t,e);return l&&(o=e.width-t.width,r=Math.min(n.left,o),this._scrollToCenter&&(r=o/2),u.left<r?s.left=Math.round(e.scroll.left+u.left-r):u.right<r&&(s.left=Math.round(e.scroll.left+Math.min(u.left,-u.right)+r))),c&&(i=e.height-t.height,a=Math.min(n.top,i),this._scrollToCenter&&(a=i/2),u.top<a?s.top=Math.round(e.scroll.top+u.top-a):u.bottom<a&&(s.top=Math.round(e.scroll.top+Math.min(u.top,-u.bottom)+a))),s},Co._getChildPoint=function(e,t,n){return An.create(t).sub(An.create(e)).add(An.create(e.scroll)).add(An.create(t.border)).add(n)},Co.prototype._getScrollPosition=function(e,t,n,o){var r=Co._getChildPoint(e,t,n),i=this._getScrollToPoint(e,r,o),a=this._getScrollToFullChildView(e,t,o);return{left:Math.max(null===a.left?i.left:a.left,0),top:Math.max(null===a.top?i.top:a.top,0)}},Co._getChildPointAfterScroll=function(e,t,n,o){return An.create(t).add(An.create(e.scroll)).sub(An.create(n)).add(o)},Co.prototype._isChildFullyVisible=function(e,t,n){var o=Co._getChildPointAfterScroll(e,t,e.scroll,n),r=this._getScrollPosition(e,t,n,{left:0,top:0}),i=r.left,a=r.top;return!this._isTargetElementObscuredInPoint(o)&&i===e.scroll.left&&a===e.scroll.top},Co.prototype._scrollToChild=function(e,t,n){for(var o=no(e),r=no(t),i=dn(mi),a=fn(mi),s=o.scroll,l=!this._isChildFullyVisible(o,r,n);l;){s=this._getScrollPosition(o,r,n,this._maxScrollMargin);var c=Co._getChildPointAfterScroll(o,r,s,n),u=this._isTargetElementObscuredInPoint(c);this._maxScrollMargin.left+=20,this._maxScrollMargin.left>=i&&(this._maxScrollMargin.left=50,this._maxScrollMargin.top+=20),l=u&&this._maxScrollMargin.top<a}return this._maxScrollMargin={left:50,top:50},this._setScroll(e,s)},Co.prototype._scrollElement=function(){if(!Hn(this._element))return d.Promise.resolve();var e=no(this._element),t=this._getScrollToPoint(e,this._offsets,this._maxScrollMargin);return this._setScroll(this._element,t)},Co.prototype._scrollParents=function(){var t,n,o=this,r=Dn(this._element),i=this._element,e=hn(i),a=pn(i),s=An.create(this._offsets).sub(new An(e,a).round()),l=mo(r.length,function(e){return o._scrollToChild(r[e],i,s).then(function(){t=no(i),n=no(r[e]),s.add(An.create(t)).sub(An.create(n)).add(An.create(n.border)),i=r[e]})}),c={scrollWasPerformed:this._scrollWasPerformed,offsetX:s.x,offsetY:s.y,maxScrollMargin:this._maxScrollMargin};return l.then(function(){var e;if(!o._skipParentFrames&&(e=mi).top!==e)return c.cmd=Co.SCROLL_REQUEST_CMD,yo(c,Co.SCROLL_RESPONSE_CMD,mi.parent)}).then(function(){return o._scrollWasPerformed})},Co._getFixedAncestorOrSelf=function(e){return Ke(e,!0,In)},Co.prototype._isTargetElementObscuredInPoint=function(e){var t=oo(e);if(!t)return!1;var n=Co._getFixedAncestorOrSelf(t);return!!n&&!n.contains(this._element)},Co.prototype.run=function(){var e=this;return this._scrollElement().then(function(){return e._scrollParents()})},Co.SCROLL_REQUEST_CMD="automation|scroll|request",Co.SCROLL_RESPONSE_CMD="automation|scroll|response",Co);function Co(e,t,n){this._element=e,this._offsets=new An(t.offsetX,t.offsetY),this._scrollToCenter=!!t.scrollToCenter,this._skipParentFrames=!!t.skipParentFrames,this._maxScrollMargin=n||{left:50,top:50},this._scrollWasPerformed=!1}function So(e){var t=d.nativeMethods.nodeChildNodesGetter.call(e);return!st(t)&&Vo(e)?e:Y(t,Vo)}function wo(e){return Y(d.nativeMethods.nodeChildNodesGetter.call(e),function(e){return Vo(e)||!Wo(e)&&wo(e)})}function To(e){return de(e)||ue(e)&&sn(e)}function _o(e){var t=d.nativeMethods.nodeChildNodesGetter.call(e);return W(t,To)}function Io(e){var t=d.nativeMethods.nodeChildNodesGetter.call(e);return G(t,To)}function Po(e){var t=d.nativeMethods.nodeChildNodesGetter.call(e);return G(t,function(e){return zo(e,!0)})}function No(e,t){var n,o;if(!ke(e)&&!ke(t)){var r=d.nativeMethods.nodeChildNodesGetter.call(t);return!nt(t,e)&&st(r)&&/div|p/.test(je(t))&&(n=wo(e))&&!nt(t,n)&&(o=Mo(n))&&!nt(t,o)&&So(t)}}function xo(e,t){var n,o,r,i=fe(t);if(!ke(e)&&!ke(t)){var a=d.nativeMethods.nodeChildNodesGetter.call(t);if(!nt(t,e)&&(i&&ue(t)&&st(a)&&!/div|p/.test(je(t))||Vo(t)&&!nt(t,e)&&t.nodeValue.length)){if(i&&ue(t)){if(!(n=wo(e))||nt(t,n))return;if(!(o=Mo(n))||nt(t,o))return}return(r=function(e){for(var t=null,n=e;!t&&(n=n.previousSibling);)if(!Wo(n)&&!Lo(n)){t=n;break}return t}(t))&&ue(r)&&/div|p/.test(je(r))&&So(r)}}}function Ro(e,t){var n,o,r=d.nativeMethods.nodeChildNodesGetter.call(e),i=st(r),a=null,s=t?Vo:de;if(!i&&s(e))return e;for(var l=0;l<i;l++){if(n=r[l],o=ue(n)&&!Ve(n),s(n))return n;if(fe(n)&&Io(n)&&!o&&(a=Ro(n,t)))return a}return a}function Mo(e){return Ro(e,!0)}function Oo(e,t){var n,o,r=d.nativeMethods.nodeChildNodesGetter.call(e),i=st(r),a=null;if(!i&&Vo(e))return e;for(var s=i-1;0<=s;s--){if(n=r[s],o=ue(n)&&!Ve(n),de(n)&&(!t||!Lo(n)))return n;if(fe(n)&&Io(n)&&!o&&(a=Oo(n,!1)))return a}return a}function Fo(e,t){if(!e||!e.length)return 0;for(var n=e.length,o=t||0,r=o;r<n&&(10===e.charCodeAt(r)||32===e.charCodeAt(r));r++)o++;return o}function Ao(e){if(!e||!e.length)return 0;for(var t=e.length,n=t,o=t-1;0<=o&&(10===e.charCodeAt(o)||32===e.charCodeAt(o));o--)n--;return n}function Lo(e){if(!de(e))return!1;var t=e.nodeValue,n=Fo(t),o=Ao(t);return n===t.length&&0===o}function Vo(e){return de(e)&&!Lo(e)}function Wo(e){return!fe(e)||ke(e)}function ko(e){var t=e.getAttribute?e.getAttribute("contenteditable"):null;return""===t||"true"===t}function Ho(e){var t=Je(e);if(ko(e)&&Ve(e))return e;var n=te(e);return"on"===n.designMode?n.body:Y(t,function(e){return ko(e)&&Ve(e)})}function Do(e,t){if(nt(e,t))return nt(t,Ho(e))?e:d.nativeMethods.nodeParentNodeGetter.call(e);var n=[],o=Ho(e),r=null;if(!et(o,t))return null;for(r=e;r!==o;r=d.nativeMethods.nodeParentNodeGetter.call(r))n.push(r);for(r=t;r!==o;r=d.nativeMethods.nodeParentNodeGetter.call(r))if(-1!==q(n,r))return r;return o}function Uo(e,t){var n=null,o=null,r=d.nativeMethods.nodeChildNodesGetter.call(e),i=st(r),a=i<=t;if(ke(e))return{node:e,offset:t};if(a?n=r[i-1]:(n=r[t],o=0),ke(n)){if(i<=1)return{node:e,offset:0};(a=i<=t-1)?n=r[i-2]:(n=r[t-1],o=0)}for(;!Wo(n)&&ue(n);){var s=_o(n);if(!s.length){o=0;break}n=s[a?s.length-1:0]}return 0===o||Wo(n)||(o=n.nodeValue?n.nodeValue.length:0),{node:n,offset:o}}function Bo(e,t,n){var o=n?t.focusNode:t.anchorNode,r=n?t.focusOffset:t.anchorOffset,i={node:o,offset:r};return(nt(e,o)||ue(o))&&Po(o)&&(i=Uo(o,r)),{node:i.node,offset:i.offset}}function qo(e,t,n){var o=n?t.anchorNode:t.focusNode,r=n?t.anchorOffset:t.focusOffset,i={node:o,offset:r};return(nt(e,o)||ue(o))&&Po(o)&&(i=Uo(o,r)),{node:i.node,offset:i.offset}}function Go(e,t,n){return Ko(e,Bo(e,t,n))}function jo(e,t,n){return Ko(e,qo(e,t,n))}function zo(e,t){if(Tn(e))return!1;if(de(e))return!0;if(!ue(e))return!1;if(Po(e))return t;var n=d.nativeMethods.nodeParentNodeGetter.call(e),o=!Ve(n),r=_o(e),i=G(r,function(e){return"br"===je(e)});return o||i}function Jo(s,e){var l={node:null,offset:e};return function e(t){var n,o,r=d.nativeMethods.nodeChildNodesGetter.call(t),i=st(r);if(l.node)return l;if(Wo(t))return l;if(de(t)){if(l.offset<=t.nodeValue.length)return l.node=t,l;t.nodeValue.length&&(!l.node&&xo(s,t)&&l.offset--,l.offset-=t.nodeValue.length)}else if(ue(t)){if(!To(t))return l;if(0===l.offset&&zo(t,!1))return l.node=t,l.offset=(n=t,o=0,Y(d.nativeMethods.nodeChildNodesGetter.call(n),function(e,t){return o=t,"br"===je(e)})?o:0),l;(l.node||!No(s,t)&&!xo(s,t))&&(i||"br"!==je(t))||l.offset--}for(var a=0;a<i;a++)l=e(r[a]);return l}(s)}function Ko(i,e){var a=e.node,s=e.offset,l=0,c=!1;return function e(t){var n=d.nativeMethods.nodeChildNodesGetter.call(t),o=st(n);if(c)return l;if(nt(a,t))return(No(i,t)||xo(i,t))&&l++,c=!0,l+s;if(Wo(t))return l;!o&&t.nodeValue&&t.nodeValue.length?(!c&&xo(i,t)&&l++,l+=t.nodeValue.length):(!o&&ue(t)&&"br"===je(t)||!c&&(No(i,t)||xo(i,t)))&&l++;for(var r=0;r<o;r++)l=e(n[r]);return l}(i)}function Yo(e){var t,n,o,r,i,a=de(e)?e:Oo(e,!0);if(!a||(t=a,o=de(n=e)?n:Ro(n,!1),r=t===o,i=t.nodeValue===String.fromCharCode(10),r&&i&&function(e,t){for(var n=["pre","pre-wrap","pre-line"];e!==t;)if(e=d.nativeMethods.nodeParentNodeGetter.call(e),-1<q(n,En(e,"white-space")))return 1}(t,n)))return 0;var s=te(e).createRange();return s.selectNodeContents(a),Ko(e,{node:a,offset:s.endOffset})}var Xo=Object.freeze({__proto__:null,getFirstVisibleTextNode:Mo,getLastTextNode:Oo,getFirstNonWhitespaceSymbolIndex:Fo,getLastNonWhitespaceSymbolIndex:Ao,isInvisibleTextNode:Lo,findContentEditableParent:Ho,getNearestCommonAncestor:Do,getSelection:function(e,t,n){return{startPos:Bo(e,t,n),endPos:qo(e,t,n)}},getSelectionStartPosition:Go,getSelectionEndPosition:jo,calculateNodeAndOffsetByPosition:Jo,calculatePositionByNodeAndOffset:Ko,getElementBySelection:function(e){var t=Do(e.anchorNode,e.focusNode);return de(t)?t.parentElement:t},getFirstVisiblePosition:function(e){var t=de(e)?e:Mo(e),n=te(e).createRange();return t?(n.selectNodeContents(t),Ko(e,{node:t,offset:n.startOffset})):0},getLastVisiblePosition:Yo,getContentEditableValue:function(e){return k(function e(t){var n=[],o=d.nativeMethods.nodeChildNodesGetter.call(t),r=st(o);Wo(t)||r||!de(t)||n.push(t);for(var i=0;i<r;i++)n=n.concat(e(o[i]));return n}(e),function(e){return e.nodeValue}).join("")}}),Qo=f.utils.browser,$o=f.nativeMethods,Zo=f.eventSandbox.selection,er="backward",tr="forward",nr="none",or=nr,rr=0,ir=0,ar=0,sr=0,lr=0,cr=0;function ur(e,t,n,o){var r,i,a,s=null,l=null,c=!1;void 0!==t&&void 0!==n&&n<t&&(a=t,t=n,n=a,c=!0),void 0===t&&(l={node:(r=Mo(e))||e,offset:r&&r.nodeValue?Fo(r.nodeValue):0}),void 0===n&&(s={node:(i=Oo(e,!0))||e,offset:i&&i.nodeValue?Ao(i.nodeValue):0}),l=l||Jo(e,t),s=s||Jo(e,n),l.node&&s.node&&(c?gr(s,l,o):gr(l,s,o))}function dr(e){var t=e?te(e):gi,n=t.getSelection(),o=null,r=!1;return n&&(n.isCollapsed||((o=t.createRange()).setStart(n.anchorNode,n.anchorOffset),o.setEnd(n.focusNode,n.focusOffset),r=o.collapsed,o.detach())),r}function fr(e,t,n){var o=Ko(e,t);return Ko(e,n)<o}function hr(e){return Ve(e)?Er(e)?Go(e,mr(e),dr(e)):0:Zo.getSelection(e).start}function pr(e){return Ve(e)?Er(e)?jo(e,mr(e),dr(e)):0:Zo.getSelection(e).end}function mr(e){var t=te(e);return t?t.getSelection():mi.getSelection()}function gr(e,t,n){var o=e.node,r=t.node,i=o.nodeValue?o.length:0,a=r.nodeValue?r.length:0,s=e.offset,l=t.offset;ue(o)&&s||(s=Math.min(i,e.offset)),ue(r)&&l||(l=Math.min(a,t.offset));var c=Ho(o),u=fr(c,e,t),d=mr(c),f=te(c).createRange();Zo.wrapSetterSelection(c,function(){var e;d.removeAllRanges(),u?Qo.isIE?(f.setStart(r,l),f.setEnd(o,s),d.addRange(f)):(f.setStart(o,s),f.setEnd(o,s),d.addRange(f),e=function(e,t){try{d.extend(e,t)}catch(e){return!1}return!0},(Qo.isSafari||Qo.isChrome&&Qo.version<58)&&Lo(r)?e(r,Math.min(l,1))||e(r,0):e(r,l)):(f.setStart(o,s),f.setEnd(r,l),d.addRange(f))},n,!0)}function Er(e){var t=mr(e);return!(!t.anchorNode||!t.focusNode)&&et(e,t.anchorNode)&&et(e,t.focusNode)}Qo.isIE&&Tt(gi,"selectionchange",function(){var e=null,t=null,n=null;try{if(this.selection)t=this.selection.createRange();else{if(!(e=$o.documentActiveElementGetter.call(this))||!Ae(e))return void(or=nr);var o,r=hr(e),i=pr(e);e.createTextRange?((t=e.createTextRange()).collapse(!0),t.moveStart("character",r),t.moveEnd("character",i-r)):gi.createRange&&(t=gi.createRange(),o=f.nativeMethods.nodeFirstChildGetter.call(e),t.setStart(o,r),t.setEnd(o,i),n=t.getBoundingClientRect())}}catch(e){return void(or=nr)}var a=n?Math.ceil(n.left):t.offsetLeft,s=n?Math.ceil(n.top):t.offsetTop,l=n?Math.ceil(n.height):t.boundingHeight,c=n?Math.ceil(n.width):t.boundingWidth,u=t.htmlText?t.htmlText.length:0;!function(e,t,n,o,r){if(r)switch(or){case nr:t===cr&&(e===sr||ar<n)?or=tr:(e<sr||t<cr)&&(or=er);break;case tr:if(e===sr&&t===cr||e<sr&&ar<n||t===cr&&n===ar&&lr<r&&e+o!==rr)break;(e<sr||t<cr)&&(or=er);break;case er:if((e<sr||t<cr)&&lr<r)break;t===ir&&(rr<=e||ar<n)&&(or=tr)}else rr=e,ir=t,or=nr;ar=n,sr=e,lr=r,cr=t}(a,s,l,c,n?t.toString().length:u)},!0);var vr,yr,br=Object.freeze({__proto__:null,hasInverseSelectionContentEditable:dr,isInverseSelectionContentEditable:fr,getSelectionStart:hr,getSelectionEnd:pr,hasInverseSelection:function(e){return Ve(e)?dr(e):(Zo.getSelection(e).direction||or)===er},getSelectionByElement:mr,select:function(e,t,n){var o,r,i,a;Ve(e)?ur(e,t,n,!0):(o=t||0,i=!1,a=null,(r=void 0===n?ft(e).length:n)<o&&(a=o,o=r,r=a,i=!0),Zo.setSelection(e,o,r,i?er:tr),or=t===n?nr:i?er:tr)},selectByNodesAndOffsets:gr,deleteSelectionContents:function(e,t){var n,o,r,i,a,s,l,c,u,d,f,h,p=hr(e),m=pr(e);t&&ur(e),p!==m&&(n=mr(e),o=n.anchorNode,r=n.focusNode,i=n.anchorOffset,a=n.focusOffset,s=Fo(o.nodeValue),l=Ao(o.nodeValue),c=Fo(r.nodeValue),u=Ao(r.nodeValue),f=d=null,de(o)&&(i<s&&0!==i?d=0:i!==o.nodeValue.length&&(Lo(o)&&0!==i||l<i)&&(d=o.nodeValue.length)),de(r)&&(a<c&&0!==a?f=0:a!==r.nodeValue.length&&(Lo(r)&&0!==a||u<a)&&(f=r.nodeValue.length)),(Qo.isWebKit||Qo.isIE&&11<Qo.version)&&(null!==d&&(o.nodeValue=0===d?o.nodeValue.substring(s):o.nodeValue.substring(0,l)),null!==f&&(r.nodeValue=0===f?r.nodeValue.substring(c):r.nodeValue.substring(0,u))),null===d&&null===f||gr({node:o,offset:d=null!==d?0===d?d:o.nodeValue.length:i},{node:r,offset:f=null!==f?0===f?f:r.nodeValue.length:a}),function(e){var t=mr(e),n=t.rangeCount;if(n)for(var o=0;o<n;o++)t.getRangeAt(o).deleteContents()}(e),(h=mr(e)).rangeCount&&!h.getRangeAt(0).collapsed&&h.getRangeAt(0).collapse(!0))},setCursorToLastVisiblePosition:function(e){var t=Yo(e);ur(e,t,t)},hasElementContainsSelection:Er}),Cr=f.Promise,Sr=f.nativeMethods,wr={cannotCreateMultipleLiveModeRunners:"E1000",cannotRunLiveModeRunnerMultipleTimes:"E1001",browserDisconnected:"E1002",cannotRunAgainstDisconnectedBrowsers:"E1003",cannotEstablishBrowserConnection:"E1004",cannotFindBrowser:"E1005",browserProviderNotFound:"E1006",browserNotSet:"E1007",testFilesNotFound:"E1008",noTestsToRun:"E1009",cannotFindReporterForAlias:"E1010",multipleSameStreamReporters:"E1011",optionValueIsNotValidRegExp:"E1012",optionValueIsNotValidKeyValue:"E1013",invalidSpeedValue:"E1014",invalidConcurrencyFactor:"E1015",cannotDivideRemotesCountByConcurrency:"E1016",portsOptionRequiresTwoNumbers:"E1017",portIsNotFree:"E1018",invalidHostname:"E1019",cannotFindSpecifiedTestSource:"E1020",clientFunctionCodeIsNotAFunction:"E1021",selectorInitializedWithWrongType:"E1022",clientFunctionCannotResolveTestRun:"E1023",regeneratorInClientFunctionCode:"E1024",invalidClientFunctionTestRunBinding:"E1025",invalidValueType:"E1026",unsupportedUrlProtocol:"E1027",testControllerProxyCannotResolveTestRun:"E1028",timeLimitedPromiseTimeoutExpired:"E1029",noTestsToRunDueFiltering:"E1030",cannotSetVideoOptionsWithoutBaseVideoPathSpecified:"E1031",multipleAPIMethodCallForbidden:"E1032",invalidReporterOutput:"E1033",cannotReadSSLCertFile:"E1034",cannotPrepareTestsDueToError:"E1035",cannotParseRawFile:"E1036",testedAppFailedWithError:"E1037",unableToOpenBrowser:"E1038",requestHookConfigureAPIError:"E1039",forbiddenCharatersInScreenshotPath:"E1040",cannotFindFFMPEG:"E1041",compositeArgumentsError:"E1042",cannotFindTypescriptConfigurationFile:"E1043",clientScriptInitializerIsNotSpecified:"E1044",clientScriptBasePathIsNotSpecified:"E1045",clientScriptInitializerMultipleContentSources:"E1046",cannotLoadClientScriptFromPath:"E1047",clientScriptModuleEntryPointPathCalculationError:"E1048",methodIsNotAvailableForAnIPCHost:"E1049",tooLargeIPCPayload:"E1050",malformedIPCMessage:"E1051",unexpectedIPCHeadPacket:"E1052",unexpectedIPCBodyPacket:"E1053",unexpectedIPCTailPacket:"E1054",cannotRunLocalNonHeadlessBrowserWithoutDisplay:"E1057",uncaughtErrorInReporter:"E1058",roleInitializedWithRelativeUrl:"E1059",typeScriptCompilerLoadingError:"E1060",cannotCustomizeSpecifiedCompilers:"E1061",cannotEnableRetryTestPagesOption:"E1062",browserConnectionError:"E1063",testRunRequestInDisconnectedBrowser:"E1064",invalidQuarantineOption:"E1065",invalidQuarantineParametersRatio:"E1066",invalidAttemptLimitValue:"E1067",invalidSuccessThresholdValue:"E1068",cannotSetConcurrencyWithCDPPort:"E1069",cannotFindTestcafeConfigurationFile:"E1070",dashboardTokenInJSON:"E1071",requestUrlInvalidValueError:"E1072",requestRuntimeError:"E1073",requestCannotResolveTestRun:"E1074",relativeBaseUrl:"E1075",invalidSkipJsErrorsOptionsObjectProperty:"E1076",invalidSkipJsErrorsCallbackWithOptionsProperty:"E1077",invalidCommandInJsonCompiler:"E1078",invalidCustomActionsOptionType:"E1079",invalidCustomActionType:"E1080",cannotImportESMInCommonsJS:"E1081"};(yr=vr=vr||{}).TooHighConcurrencyFactor="TooHighConcurrencyFactor",yr.UseBrowserInitOption="UseBrowserInitOption",yr.RestErrorCauses="RestErrorCauses";var Tr,_r,Ir,Pr,Nr,xr=vr,Rr=", ",Mr='"';function Or(e,t){return"".concat(t).concat(e).concat(t)}function Fr(e,t,n){void 0===t&&(t=Rr),void 0===n&&(n=Mr);var o=y([],e,!0);if(-1<t.indexOf("\n"))return o.map(function(e){return Or(e,n)}).join(t);if(1===o.length)return Or(o[0],n);if(2===o.length){var r=e[0],i=e[1];return"".concat(Or(r,n)," and ").concat(Or(i,n))}var a=o.pop(),s=o.map(function(e){return Or(e,n)}).join(t);return"".concat(s,", and ").concat(Or(a,n))}(_r=Tr=Tr||{}).message="message",_r.stack="stack",_r.pageUrl="pageUrl",(Pr=Ir=Ir||{}).fn="fn",Pr.dependencies="dependencies";var Ar,Lr="https://testcafe.io/documentation/402639/reference/command-line-interface#file-pathglob-pattern",Vr="https://testcafe.io/documentation/402638/reference/configuration-file#filter",Wr="https://testcafe.io/documentation/402828/guides/concepts/browsers#test-in-headless-mode",kr="https://testcafe.io/documentation/404150/guides/advanced-guides/custom-test-actions",Hr=((Nr={})[wr.cannotCreateMultipleLiveModeRunners]="Cannot launch multiple live mode instances of the TestCafe test runner.",Nr[wr.cannotRunLiveModeRunnerMultipleTimes]="Cannot launch the same live mode instance of the TestCafe test runner multiple times.",Nr[wr.browserDisconnected]="The {userAgent} browser disconnected. If you did not close the browser yourself, browser performance or network issues may be at fault.",Nr[wr.cannotRunAgainstDisconnectedBrowsers]="The following browsers disconnected: {userAgents}. Cannot run further tests.",Nr[wr.testRunRequestInDisconnectedBrowser]='"{browser}" disconnected during test execution.',Nr[wr.cannotEstablishBrowserConnection]="Cannot establish one or more browser connections.",Nr[wr.cannotFindBrowser]='Cannot find the browser. "{browser}" is neither a known browser alias, nor a path to an executable file.',Nr[wr.browserProviderNotFound]='Cannot find the "{providerName}" browser provider.',Nr[wr.browserNotSet]="You have not specified a browser.",Nr[wr.testFilesNotFound]='Could not find test files at the following location: "{cwd}".\nCheck patterns for errors:\n\n{sourceList}\n\nor launch TestCafe from a different directory.\n'+"For more information on how to specify test locations, see ".concat(Lr,"."),Nr[wr.noTestsToRun]="Source files do not contain valid 'fixture' and 'test' declarations.",Nr[wr.noTestsToRunDueFiltering]="No tests match your filter.\n"+"See ".concat(Vr,"."),Nr[wr.cannotFindReporterForAlias]='The "{name}" reporter does not exist. Check the reporter parameter for errors.',Nr[wr.multipleSameStreamReporters]='Reporters cannot share output streams. The following reporters interfere with one another: "{reporters}".',Nr[wr.optionValueIsNotValidRegExp]='The "{optionName}" option does not contain a valid regular expression.',Nr[wr.optionValueIsNotValidKeyValue]='The "{optionName}" option does not contain a valid key-value pair.',Nr[wr.invalidQuarantineOption]='The "{optionName}" option does not exist. Specify "attemptLimit" and "successThreshold" to configure quarantine mode.',Nr[wr.invalidQuarantineParametersRatio]='The value of "attemptLimit" ({attemptLimit}) should be greater then the value of "successThreshold" ({successThreshold}).',Nr[wr.invalidAttemptLimitValue]='The "{attemptLimit}" parameter only accepts values of {MIN_ATTEMPT_LIMIT} and up.',Nr[wr.invalidSuccessThresholdValue]='The "{successThreshold}" parameter only accepts values of {MIN_SUCCESS_THRESHOLD} and up.',Nr[wr.invalidSpeedValue]="Speed should be a number between 0.01 and 1.",Nr[wr.invalidConcurrencyFactor]="The concurrency factor should be an integer greater than or equal to 1.",Nr[wr.cannotDivideRemotesCountByConcurrency]="The number of remote browsers should be divisible by the concurrency factor.",Nr[wr.cannotSetConcurrencyWithCDPPort]='The value of the "concurrency" option includes the CDP port.',Nr[wr.portsOptionRequiresTwoNumbers]='The "--ports" argument accepts two values at a time.',Nr[wr.portIsNotFree]="Port {portNum} is occupied by another process.",Nr[wr.invalidHostname]='Cannot resolve hostname "{hostname}".',Nr[wr.cannotFindSpecifiedTestSource]='Cannot find a test file at "{path}".',Nr[wr.clientFunctionCodeIsNotAFunction]="Cannot initialize a ClientFunction because {#instantiationCallsiteName} is {type}, and not a function.",Nr[wr.selectorInitializedWithWrongType]="Cannot initialize a Selector because {#instantiationCallsiteName} is {type}, and not one of the following: a CSS selector string, a Selector object, a node snapshot, a function, or a Promise returned by a Selector.",Nr[wr.clientFunctionCannotResolveTestRun]="{#instantiationCallsiteName} cannot implicitly resolve the test run in context of which it should be executed. If you need to call {#instantiationCallsiteName} from the Node.js API callback, pass the test controller manually via {#instantiationCallsiteName}'s `.with({ boundTestRun: t })` method first. Note that you cannot execute {#instantiationCallsiteName} outside the test code.",Nr[wr.requestCannotResolveTestRun]="'request' cannot implicitly resolve the test run in context of which it should be executed. Note that you cannot execute 'request' in the experimental debug mode.",Nr[wr.regeneratorInClientFunctionCode]='{#instantiationCallsiteName} code, arguments or dependencies cannot contain generators or "async/await" syntax (use Promises instead).',Nr[wr.invalidClientFunctionTestRunBinding]='Cannot resolve the "boundTestRun" option because its value is not a test controller.',Nr[wr.invalidValueType]="{smthg} ({actual}) is not of expected type ({type}).",Nr[wr.unsupportedUrlProtocol]='Invalid {what}: "{url}". TestCafe cannot execute the test because the {what} includes the {protocol} protocol. TestCafe supports the following protocols: http://, https:// and file://.',Nr[wr.testControllerProxyCannotResolveTestRun]="Cannot implicitly resolve the test run in the context of which the test controller action should be executed. Use test function's 't' argument instead.",Nr[wr.timeLimitedPromiseTimeoutExpired]="A Promise timed out.",Nr[wr.cannotSetVideoOptionsWithoutBaseVideoPathSpecified]="You cannot manage advanced video parameters when the video recording capability is off. Specify the root storage folder for video content to enable video recording.",Nr[wr.multipleAPIMethodCallForbidden]='You cannot call the "{methodName}" method more than once. Specify an array of parameters instead.',Nr[wr.invalidReporterOutput]="Specify a file name or a writable stream as the reporter's output target.",Nr[wr.cannotReadSSLCertFile]='Unable to read the file referenced by the "{option}" ssl option ("{path}"). Error details:\n\n{err}',Nr[wr.cannotPrepareTestsDueToError]="Cannot prepare tests due to the following error:\n\n{errMessage}",Nr[wr.cannotParseRawFile]='Cannot parse a raw test file at "{path}" due to the following error:\n\n{errMessage}',Nr[wr.testedAppFailedWithError]="The web application failed with the following error:\n\n{errMessage}",Nr[wr.unableToOpenBrowser]='Unable to open the "{alias}" browser due to the following error:\n\n{errMessage}',Nr[wr.requestHookConfigureAPIError]="Attempt to configure a request hook resulted in the following error:\n\n{requestHookName}: {errMsg}",Nr[wr.forbiddenCharatersInScreenshotPath]='There are forbidden characters in the "{screenshotPath}" {screenshotPathType}:\n {forbiddenCharsDescription}',Nr[wr.cannotFindFFMPEG]="TestCafe cannot record videos because it cannot locate the FFmpeg executable. Try one of the following solutions:\n\n* add the path of the FFmpeg installation directory to the PATH environment variable,\n* specify the path of the FFmpeg executable in the FFMPEG_PATH environment variable or the ffmpegPath option,\n* install the @ffmpeg-installer/ffmpeg npm package.",Nr[wr.cannotFindTypescriptConfigurationFile]='"{filePath}" is not a valid TypeScript configuration file.',Nr[wr.clientScriptInitializerIsNotSpecified]="Initialize your client script with one of the following: a JavaScript script, a JavaScript file path, or the name of a JavaScript module.",Nr[wr.clientScriptBasePathIsNotSpecified]="Specify the base path for the client script file.",Nr[wr.clientScriptInitializerMultipleContentSources]="Client scripts can only have one initializer: JavaScript code, a JavaScript file path, or the name of a JavaScript module.",Nr[wr.cannotLoadClientScriptFromPath]="Cannot load a client script from {path}.\n{errorMessage}",Nr[wr.clientScriptModuleEntryPointPathCalculationError]="A client script tried to load a JavaScript module that TestCafe cannot locate:\n\n{errorMessage}.",Nr[wr.methodIsNotAvailableForAnIPCHost]="This method cannot be called on a service host.",Nr[wr.tooLargeIPCPayload]="The specified payload is too large to form an IPC packet.",Nr[wr.malformedIPCMessage]="Cannot process a malformed IPC message.",Nr[wr.unexpectedIPCHeadPacket]="Cannot create an IPC message due to an unexpected IPC head packet.",Nr[wr.unexpectedIPCBodyPacket]="Cannot create an IPC message due to an unexpected IPC body packet.",Nr[wr.unexpectedIPCTailPacket]="Cannot create an IPC message due to an unexpected IPC tail packet.",Nr[wr.cannotRunLocalNonHeadlessBrowserWithoutDisplay]="Your Linux version does not have a graphic subsystem to run {browserAlias} with a GUI. You can launch the browser in headless mode. If you use a portable browser executable, specify the browser alias before the path instead of the 'path' prefix. "+"For more information, see ".concat(Wr),Nr[wr.uncaughtErrorInReporter]='The "{methodName}" method of the "{reporterName}" reporter produced an uncaught error. Error details:\n{originalError}',Nr[wr.roleInitializedWithRelativeUrl]="You cannot specify relative login page URLs in the Role constructor. Use an absolute URL.",Nr[wr.typeScriptCompilerLoadingError]="Cannot load the TypeScript compiler.\n{originErrorMessage}.",Nr[wr.cannotCustomizeSpecifiedCompilers]="You cannot specify options for the {noncustomizableCompilerList} compiler{suffix}.",Nr[wr.cannotEnableRetryTestPagesOption]="Cannot enable the 'retryTestPages' option. Apply one of the following two solutions:\n-- set 'localhost' as the value of the 'hostname' option\n-- run TestCafe over HTTPS\n",Nr[wr.browserConnectionError]="{originErrorMessage}\n{numOfNotOpenedConnection} of {numOfAllConnections} browser connections have not been established:\n{listOfNotOpenedConnections}\n\nHints:\n{listOfHints}",Nr[xr.TooHighConcurrencyFactor]="The host machine may not be powerful enough to handle the specified concurrency factor ({concurrencyFactor}). Try to decrease the concurrency factor or allocate more computing resources to the host machine.",Nr[xr.UseBrowserInitOption]='Increase the value of the "browserInitTimeout" option if it is too low (currently: {browserInitTimeoutMsg}). This option determines how long TestCafe waits for browsers to be ready.',Nr[xr.RestErrorCauses]="The error can also be caused by network issues or remote device failure. Make sure that your network connection is stable and you can reach the remote device.",Nr[wr.cannotFindTestcafeConfigurationFile]="Cannot locate a TestCafe configuration file at {filePath}. Either the file does not exist, or the path is invalid.",Nr[wr.dashboardTokenInJSON]="Insecure token declaration: cannot declare a Dashboard token in a JSON configuration file. Use a JavaScript configuration file, or declare a Dashboard token with one of the following: the CLI, the Test Runner API, the TESTCAFE_DASHBOARD_TOKEN environment variable.",Nr[wr.relativeBaseUrl]='The value of the baseUrl argument cannot be relative: "{baseUrl}"',Nr[wr.requestUrlInvalidValueError]="Requested url isn't valid ({actualValue}).",Nr[wr.requestRuntimeError]="The request was interrupted by an error:\n{message}",Nr[wr.invalidSkipJsErrorsOptionsObjectProperty]='The "{optionName}" option does not exist. Use the following options to configure skipJsErrors: '.concat(Fr(Object.keys(Tr)),"."),Nr[wr.invalidSkipJsErrorsCallbackWithOptionsProperty]='The "{optionName}" option does not exist. Use the following options to configure skipJsErrors callback: '.concat(Fr(Object.keys(Ir)),"."),Nr[wr.invalidCommandInJsonCompiler]='TestCafe terminated the test run. The "{path}" file contains an unknown Chrome User Flow action "{action}". Remove the action to continue. Refer to the following article for the definitive list of supported Chrome User Flow actions: https://testcafe.io/documentation/403998/guides/experimental-capabilities/chrome-replay-support#supported-replay-actions',Nr[wr.invalidCustomActionsOptionType]="The value of the customActions option does not belong to type Object. Refer to the following article for custom action setup instructions: ".concat(kr),Nr[wr.invalidCustomActionType]='TestCafe cannot parse the "{actionName}" action, because the action definition is invalid. Format the definition in accordance with the custom actions guide: '.concat(kr),Nr[wr.cannotImportESMInCommonsJS]="Cannot import the {esModule} ECMAScript module from {targetFile}. Use a dynamic import() statement or enable the --experimental-esm CLI flag.",Nr[wr.timeLimitedPromiseTimeoutExpired]),Dr=(g(Ur,Ar=Error),Ur);function Ur(){var e=Ar.call(this,Hr)||this;return e.code=wr.timeLimitedPromiseTimeoutExpired,e}function Br(e){var t=e.replace(/^\+/g,"plus").replace(/\+\+/g,"+plus").split("+");return k(t,function(e){return e.replace("plus","+")})}function qr(e){var t=1===e.length||"space"===e?e:e.toLowerCase();return a.modifiersMap[t]&&(t=a.modifiersMap[t]),t}var Gr,jr,zr=f.utils.trim,Jr={run:"run",idle:"idle"};(jr=Gr=Gr||{}).ok="ok",jr.closing="closing";var Kr=Gr,Yr="file:///",Xr=gi.location.href,Qr=gi.location.origin,$r=Qr+"/service-worker.js",Zr=!1,ei=null,ti=eval;function ni(t){return new u(function(e){return setTimeout(e,t)})}function oi(e,r,t){var n=void 0===t?{}:t,o=n.method,i=void 0===o?"GET":o,a=n.data,s=void 0===a?null:a,l=n.parseResponse,c=void 0===l||l;return new u(function(t,n){var o=r();o.open(i,e,!0),o.onreadystatechange=function(){var e;4===o.readyState&&(200===o.status?((e=o.responseText||"")&&c&&(e=JSON.parse(o.responseText)),t(e)):n("disconnected"))},o.send(s)})}function ri(e){return Xr.toLowerCase()===e.toLowerCase()}function ii(){Zr=!1}function ai(e,t,n){var o;ii(),void 0===(o=e.url)&&(o=""),0===o.indexOf(Yr)?oi(n,t,{method:"POST",data:JSON.stringify({url:e.url})}):gi.location=e.url}function si(e){return(e.cmd===Jr.run||e.cmd===Jr.idle)&&!ri(e.url)}function li(e,r,t){var i=e.statusUrl,a=e.openFileProtocolUrl,n=void 0===t?{}:t,s=n.manualRedirect,l=n.proxyless;return E(this,void 0,void 0,function(){var n,o;return v(this,function(e){switch(e.label){case 0:return[4,oi(i,r)];case 1:return n=e.sent(),(o=l?(t=n).cmd!==Jr.idle||si(t):si(n))&&!s&&ai(n,r,a),[2,{command:n,redirecting:o}]}var t})})}var ci=Object.freeze({__proto__:null,delay:ni,sendXHR:oi,startHeartbeat:function(e,t){function n(){oi(e,t).then(function(e){e.code!==Kr.closing||ri(e.url)||(ii(),gi.location=e.url)})}ei=mi.setInterval(n,2e3),n()},stopHeartbeat:function(){mi.clearInterval(ei)},startInitScriptExecution:function(e,t){Zr=!0,function e(t,n){Zr&&oi(t,n).then(function(e){return e.code?oi(t,n,{method:"POST",data:JSON.stringify(ti(e.code))}):null}).then(function(){mi.setTimeout(function(){return e(t,n)},1e3)})}(e,t)},stopInitScriptExecution:ii,redirect:ai,checkStatus:function(){for(var r,i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];return E(this,void 0,void 0,function(){var t,n,o;return v(this,function(e){switch(e.label){case 0:n=t=null,o=0,e.label=1;case 1:return o<5?[4,function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return E(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,li.apply(void 0,n)];case 1:return[2,e.sent()];case 2:return t=e.sent(),console.error(t),[2,{error:t}];case 3:return[2]}})})}.apply(void 0,i)]:[3,5];case 2:return r=e.sent(),t=r.error,n=function(e,t){var n={};for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}(r,["error"]),t?[4,ni(1e3)]:[2,n];case 3:e.sent(),e.label=4;case 4:return o++,[3,1];case 5:throw t}})})},enableRetryingTestPages:function(){return E(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:if(!navigator.serviceWorker)return[2];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,navigator.serviceWorker.register($r,{scope:Qr})];case 2:return e.sent(),[4,navigator.serviceWorker.ready];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),console.error(t),[3,5];case 5:return[2]}})})},getActiveWindowId:function(e,t){return oi(e,t)},setActiveWindowId:function(e,t,n){return oi(e,t,{method:"POST",data:JSON.stringify({windowId:n})})},closeWindow:function(e,t,n){return oi(e,t,{method:"POST",data:JSON.stringify({windowId:n})})},dispatchProxylessEvent:function(n,o,r,i,a){return E(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:return[4,o.hide()];case 1:return e.sent(),t=JSON.stringify({type:i,options:a}),[4,oi(n,r,{method:"POST",data:t})];case 2:return e.sent(),[4,o.show()];case 3:return e.sent(),[2]}})})}}),ui={};ui.RequestBarrier=h,ui.ClientRequestEmitter=I,ui.ScriptExecutionBarrier=N,ui.ScriptExecutionEmitter=A,ui.pageUnloadBarrier=Gt,ui.preventRealEvents=function(){xn.initElementListening(mi,Mn),xn.addFirstInternalEventBeforeListener(mi,Mn,Fn),Yt.init()},ui.disableRealEventsPreventing=function(){xn.removeInternalEventBeforeListener(mi,Mn,Fn)},ui.scrollController=Yt,ui.ScrollAutomation=bo,ui.selectController=zn,ui.serviceUtils=zt,ui.domUtils=pt,ui.contentEditable=Xo,ui.positionUtils=po,ui.styleUtils=Pn,ui.scrollUtils=Un,ui.eventUtils=xt,ui.arrayUtils=X,ui.promiseUtils=go,ui.textSelection=br,ui.waitFor=function(i,a,s){return new Cr(function(e,t){var n,o,r=i();r?e(r):(n=Sr.setInterval.call(mi,function(){(r=i())&&(Sr.clearInterval.call(mi,n),Sr.clearTimeout.call(mi,o),e(r))},a),o=Sr.setTimeout.call(mi,function(){Sr.clearInterval.call(mi,n),t()},s))})},ui.delay=c,ui.getTimeLimitedPromise=function(e,t){return d.Promise.race([e,c(t).then(function(){return d.Promise.reject(new Dr)})])},ui.noop=function(){},ui.getKeyArray=Br,ui.getSanitizedKey=qr,ui.parseKeySequence=function(e){if("string"!=typeof e)return{error:!0};var t=(e=zr(e).replace(/\s+/g," ")).length,n=e.charAt(t-1),o=e.charAt(t-2);1<t&&"+"===n&&!/[+ ]/.test(o)&&(e=e.substring(0,e.length-1));var r=e.split(" ");return{combinations:r,error:G(r,function(e){var t=Br(e);return G(t,function(e){var t=1===e.length||"space"===e,n=qr(e),o=a.modifiers[n],r=a.specialKeys[n];return!(t||o||r)})}),keys:e}},ui.sendRequestToFrame=yo,ui.KEY_MAPS=a,ui.browser=ci,ui.stringifyElement=$n,ui.selectorTextFilter=function o(e,r,i,a){function t(e){for(var t=e.childNodes.length,n=0;n<t;n++)if(o(e.childNodes[n],r,i,a))return!0;return!1}function n(e){return a instanceof RegExp?a.test(e):a===e.trim()}if(1===e.nodeType)return n(e.innerText||e.textContent);if(9!==e.nodeType)return 11===e.nodeType?t(e):n(e.textContent);var s=e.querySelector("head"),l=e.querySelector("body");return t(s)||t(l)},ui.selectorAttributeFilter=function(e,t,n,o,r){if(1!==e.nodeType)return!1;function i(e,t){return"string"==typeof t?t===e:t.test(e)}for(var a,s=e.attributes,l=0;l<s.length;l++)if(i((a=s[l]).nodeName,o)&&(!r||i(a.nodeValue,r)))return!0;return!1},ui.TEST_RUN_ERRORS={uncaughtErrorOnPage:"E1",uncaughtErrorInTestCode:"E2",uncaughtNonErrorObjectInTestCode:"E3",uncaughtErrorInClientFunctionCode:"E4",uncaughtErrorInCustomDOMPropertyCode:"E5",unhandledPromiseRejection:"E6",uncaughtException:"E7",missingAwaitError:"E8",actionIntegerOptionError:"E9",actionPositiveIntegerOptionError:"E10",actionBooleanOptionError:"E11",actionSpeedOptionError:"E12",actionOptionsTypeError:"E14",actionBooleanArgumentError:"E15",actionStringArgumentError:"E16",actionNullableStringArgumentError:"E17",actionStringOrStringArrayArgumentError:"E18",actionStringArrayElementError:"E19",actionIntegerArgumentError:"E20",actionRoleArgumentError:"E21",actionPositiveIntegerArgumentError:"E22",actionSelectorError:"E23",actionElementNotFoundError:"E24",actionElementIsInvisibleError:"E26",actionSelectorMatchesWrongNodeTypeError:"E27",actionAdditionalElementNotFoundError:"E28",actionAdditionalElementIsInvisibleError:"E29",actionAdditionalSelectorMatchesWrongNodeTypeError:"E30",actionElementNonEditableError:"E31",actionElementNotTextAreaError:"E32",actionElementNonContentEditableError:"E33",actionElementIsNotFileInputError:"E34",actionRootContainerNotFoundError:"E35",actionIncorrectKeysError:"E36",actionCannotFindFileToUploadError:"E37",actionUnsupportedDeviceTypeError:"E38",actionIframeIsNotLoadedError:"E39",actionElementNotIframeError:"E40",actionInvalidScrollTargetError:"E41",currentIframeIsNotLoadedError:"E42",currentIframeNotFoundError:"E43",currentIframeIsInvisibleError:"E44",nativeDialogNotHandledError:"E45",uncaughtErrorInNativeDialogHandler:"E46",setTestSpeedArgumentError:"E47",setNativeDialogHandlerCodeWrongTypeError:"E48",clientFunctionExecutionInterruptionError:"E49",domNodeClientFunctionResultError:"E50",invalidSelectorResultError:"E51",cannotObtainInfoForElementSpecifiedBySelectorError:"E52",externalAssertionLibraryError:"E53",pageLoadError:"E54",windowDimensionsOverflowError:"E55",forbiddenCharactersInScreenshotPathError:"E56",invalidElementScreenshotDimensionsError:"E57",roleSwitchInRoleInitializerError:"E58",assertionExecutableArgumentError:"E59",assertionWithoutMethodCallError:"E60",assertionUnawaitedPromiseError:"E61",requestHookNotImplementedError:"E62",requestHookUnhandledError:"E63",uncaughtErrorInCustomClientScriptCode:"E64",uncaughtErrorInCustomClientScriptCodeLoadedFromModule:"E65",uncaughtErrorInCustomScript:"E66",uncaughtTestCafeErrorInCustomScript:"E67",childWindowIsNotLoadedError:"E68",childWindowNotFoundError:"E69",cannotSwitchToWindowError:"E70",closeChildWindowError:"E71",childWindowClosedBeforeSwitchingError:"E72",cannotCloseWindowWithChildrenError:"E73",targetWindowNotFoundError:"E74",parentWindowNotFoundError:"E76",previousWindowNotFoundError:"E77",switchToWindowPredicateError:"E78",actionFunctionArgumentError:"E79",multipleWindowsModeIsDisabledError:"E80",multipleWindowsModeIsNotSupportedInRemoteBrowserError:"E81",cannotCloseWindowWithoutParent:"E82",cannotRestoreChildWindowError:"E83",executionTimeoutExceeded:"E84",actionRequiredCookieArguments:"E85",actionCookieArgumentError:"E86",actionCookieArgumentsError:"E87",actionUrlCookieArgumentError:"E88",actionUrlsCookieArgumentError:"E89",actionStringOptionError:"E90",actionDateOptionError:"E91",actionNumberOptionError:"E92",actionUrlOptionError:"E93",actionUrlSearchParamsOptionError:"E94",actionObjectOptionError:"E95",actionUrlArgumentError:"E96",actionStringOrRegexOptionError:"E97",actionSkipJsErrorsArgumentError:"E98",actionFunctionOptionError:"E99",actionInvalidObjectPropertyError:"E100",actionElementIsNotTargetError:"E101"},ui.RUNTIME_ERRORS=wr;var di=f.nativeMethods,fi=f.EVENTS.evalIframeScript;di.objectDefineProperty(mi,"%testCafeCore%",{configurable:!0,value:ui}),f.on(fi,function(e){return pi(di.contentWindowGetter.call(e.iframe))});var hi=f.eventSandbox.message;hi.on(hi.SERVICE_MSG_RECEIVED_EVENT,function(e){var t,n,o,r,i;e.message.cmd===bo.SCROLL_REQUEST_CMD&&(n=(t=e.message).offsetX,o=t.offsetY,r=t.maxScrollMargin,i=it(e.source),new bo(i,{offsetX:n,offsetY:o},r).run().then(function(){return hi.sendServiceMsg({cmd:bo.SCROLL_RESPONSE_CMD},e.source)}))})}(mi["%hammerhead%"],mi["%hammerhead%"].Promise)}(window);
1
+ window["%hammerhead%"].utils.removeInjectedScript(),function gi(Ei){var vi=Ei.document;!function(d,u){var f="default"in d?d.default:d;u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;var e=f.utils.browser,t={alt:18,ctrl:17,meta:91,shift:16},n={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=","{":"[","}":"]",":":";",'"':"'","|":"\\","<":",",">":".","?":"/","±":"§"},o={backspace:8,capslock:20,delete:46,down:40,end:35,enter:13,esc:27,home:36,ins:45,left:37,pagedown:34,pageup:33,right:39,space:32,tab:9,up:38},r={left:e.isIE?"Left":"ArrowLeft",down:e.isIE?"Down":"ArrowDown",right:e.isIE?"Right":"ArrowRight",up:e.isIE?"Up":"ArrowUp",backspace:"Backspace",capslock:"CapsLock",delete:"Delete",end:"End",enter:"Enter",esc:"Escape",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:e.isIE?"Spacebar":" ",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"};function i(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[e[t]]=t);return n}var a={modifiers:t,shiftMap:n,specialKeys:o,keyProperty:r,modifiersMap:{option:"alt"},symbolCharCodeToKeyCode:{96:192,91:219,93:221,92:220,59:186,39:222,44:188,45:e.isFirefox?173:189,46:190,47:191},symbolKeysCharCodes:{109:45,173:45,186:59,187:61,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39,110:46,96:48,97:49,98:50,99:51,100:52,101:53,102:54,103:55,104:56,105:57,107:43,106:42,111:47},reversedModifiers:i(t),reversedShiftMap:i(n),reversedSpecialKeys:i(o),reversedKeyProperty:i(r),newLineKeys:["enter","\n","\r"]},s=f.Promise,l=f.nativeMethods;function c(t){return new s(function(e){return l.setTimeout.call(Ei,e,t)})}var h=(p.prototype._startListening=function(){var t=this;this._emitter.onRequestSend(function(e){return t._onRequestSend(e)}),this._emitter.onRequestCompleted(function(e){return t._onRequestCompleted(e)}),this._emitter.onRequestError(function(e){return t._onRequestError(e)})},p.prototype._offListening=function(){this._emitter.offAll()},p.prototype._onRequestSend=function(e){this._collectingReqs&&this._requests.add(e)},p.prototype._onRequestCompleted=function(e){var t=this;c(this._delays.additionalRequestsCollection).then(function(){return t._onRequestFinished(e)})},p.prototype._onRequestFinished=function(e){this._requests.has(e)&&(this._requests.delete(e),this._collectingReqs||this._requests.size||!this._watchdog||this._finishWaiting())},p.prototype._onRequestError=function(e){this._onRequestFinished(e)},p.prototype._finishWaiting=function(){this._watchdog&&((0,d.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._requests.clear(),this._offListening(),this._waitResolve()},p.prototype.wait=function(e){var n=this;return c(e?this._delays.pageInitialRequestsCollection:this._delays.requestsCollection).then(function(){return new d.Promise(function(e){var t;n._collectingReqs=!1,n._waitResolve=e,n._requests.size?(t=d.nativeMethods.setTimeout,n._watchdog=t(function(){return n._finishWaiting()},p.TIMEOUT)):n._finishWaiting()})})},p.TIMEOUT=3e3,p);function p(e,t){var n,o,r;void 0===t&&(t={}),this._delays={requestsCollection:null!==(n=t.requestsCollection)&&void 0!==n?n:50,additionalRequestsCollection:null!==(o=t.additionalRequestsCollection)&&void 0!==o?o:50,pageInitialRequestsCollection:null!==(r=t.pageInitialRequestsCollection)&&void 0!==r?r:50},this._emitter=e,this._waitResolve=null,this._watchdog=null,this._requests=new Set,this._collectingReqs=!0,this._startListening()}var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function E(e,a,s,l){return new(s=s||u)(function(n,t){function o(e){try{i(l.next(e))}catch(e){t(e)}}function r(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(o,r)}i((l=l.apply(e,a||[])).next())})}function v(n,o){var r,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function e(t){return function(e){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;l&&t[l=0]&&(s=0),s;)try{if(r=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,a&&(t=[2&t[0],a.value]),t[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],i=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function y(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||((o=o||Array.prototype.slice.call(t,0,r))[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var b=(C.prototype.on=function(e,t){this._eventsListeners[e]||(this._eventsListeners[e]=[]),this._eventsListeners[e].push(t)},C.prototype.once=function(n,o){var r=this;this.on(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.off(n,o),o.apply(void 0,e)})},C.prototype.off=function(e,t){var n=this._eventsListeners[e];n&&(this._eventsListeners[e]=d.nativeMethods.arrayFilter.call(n,function(e){return e!==t}))},C.prototype.offAll=function(e){e?this._eventsListeners[e]=[]:this._eventsListeners={}},C.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this._eventsListeners[t];if(o)for(var r=0;r<o.length;r++)try{o[r].apply(this,e)}catch(e){if(!(e.message&&-1<e.message.indexOf("freed script")))throw e;this.off(t,o[r])}},C);function C(){this._eventsListeners={}}var S,w="request-send",T="request-completed",_="request-error",I=(g(N,S=b),N.prototype._addHammerheadListener=function(e,t){f.on(e,t),this._hammerheadListenersInfo.push({evt:e,listener:t})},N.prototype.onRequestSend=function(e){this.on(w,e)},N.prototype.onRequestCompleted=function(e){this.on(T,e)},N.prototype.onRequestError=function(e){this.on(_,e)},N.prototype.offAll=function(){S.prototype.offAll.call(this);for(var e=0,t=this._hammerheadListenersInfo;e<t.length;e++){var n=t[e];f.off.call(f,n.evt,n.listener)}},N);function N(){var n=S.call(this)||this;return n._hammerheadListenersInfo=[],n._addHammerheadListener(f.EVENTS.beforeXhrSend,function(e){var t=e.xhr;return n.emit(w,t)}),n._addHammerheadListener(f.EVENTS.xhrCompleted,function(e){var t=e.xhr;return n.emit(T,t)}),n._addHammerheadListener(f.EVENTS.xhrError,function(e){var t=e.xhr;return n.emit(_,t)}),n._addHammerheadListener(f.EVENTS.fetchSent,function(e){n.emit(w,e),e.then(function(){return n.emit(T,e)},function(){return n.emit(_,e)})}),n}var P=(R.prototype._startListening=function(){var t=this;this._emitter.onScriptAdded(function(e){return t._onScriptElementAdded(e)}),this._emitter.onScriptLoadedOrFailed(function(e){return t._onScriptLoadedOrFailed(e)})},R.prototype._offListening=function(){this._emitter.offAll()},R.prototype._onScriptElementAdded=function(e){var t=this,n=(0,d.nativeMethods.setTimeout)(function(){return t._onScriptLoadedOrFailed(e,!0)},R.LOADING_TIMEOUT);this._scripts.set(e,n)},R.prototype._onScriptLoadedOrFailed=function(e,t){var n=this;void 0===t&&(t=!1),this._scripts.has(e)&&(t||(0,d.nativeMethods.clearTimeout)(this._scripts.get(e)),this._scripts.delete(e),this._scripts.size||c(25).then(function(){n._waitResolve&&!n._scripts.size&&n._finishWaiting()}))},R.prototype._finishWaiting=function(){this._watchdog&&((0,d.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._scripts.clear(),this._offListening(),this._waitResolve(),this._waitResolve=null},R.prototype.wait=function(){var n=this;return new d.Promise(function(e){var t;n._waitResolve=e,n._scripts.size?(t=d.nativeMethods.setTimeout,n._watchdog=t(function(){return n._finishWaiting()},R.TIMEOUT)):n._finishWaiting()})},R.TIMEOUT=3e3,R.LOADING_TIMEOUT=2e3,R);function R(e){this._emitter=e,this._watchdog=null,this._waitResolve=null,this._scripts=new Map,this._startListening()}var x,M=f.nativeMethods,O="script-added",A="script-loaded-or-failed",F=(g(L,x=b),L.prototype._onScriptElementAdded=function(e){var t,n=this,o=M.scriptSrcGetter.call(e);void 0!==o&&""!==o&&(this.emit(O,e),t=function(){M.removeEventListener.call(e,"load",t),M.removeEventListener.call(e,"error",t),n.emit(A,e)},M.addEventListener.call(e,"load",t),M.addEventListener.call(e,"error",t))},L.prototype.onScriptAdded=function(e){this.on(O,e)},L.prototype.onScriptLoadedOrFailed=function(e){this.on(A,e)},L.prototype.offAll=function(){x.prototype.offAll.call(this),f.off(f.EVENTS.scriptElementAdded,this._onScriptElementAdded)},L);function L(){var n=x.call(this)||this;return n._scriptElementAddedListener=function(e){var t=e.el;return n._onScriptElementAdded(t)},f.on(f.EVENTS.scriptElementAdded,n._scriptElementAddedListener),n}function V(e){var t="array"+e.charAt(0).toUpperCase()+e.slice(1),n=d.nativeMethods[t];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,e)}}var W=V("filter"),k=V("map"),H=V("slice"),D=V("splice"),U=V("unshift"),B=V("forEach"),q=V("indexOf"),G=V("some"),j=V("reverse"),z=V("reduce"),J=V("concat"),K=V("join"),Y=V("every");function X(e,t){if(d.nativeMethods.arrayFind)return d.nativeMethods.arrayFind.call(e,t);for(var n=e.length,o=0;o<n;o++)if(t(e[o],o,e))return e[o];return null}var Q=Object.freeze({__proto__:null,filter:W,map:k,slice:H,splice:D,unshift:U,forEach:B,indexOf:q,some:G,reverse:j,reduce:z,concat:J,join:K,every:Y,isArray:function(e){return"[object Array]"===d.nativeMethods.objectToString.call(e)},from:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(d.nativeMethods.arrayFrom)return d.nativeMethods.arrayFrom.apply(d.nativeMethods,y([e],t,!1));for(var o=[],r=e.length,i=0;i<r;i++)o.push(e[i]);return o},find:X,remove:function(e,t){var n=d.nativeMethods.arrayIndexOf.call(e,t);-1<n&&d.nativeMethods.arraySplice.call(e,n,1)},equals:function(e,t){if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!1;return!0},getCommonElement:function(e,t){for(var n=0;n<e.length;n++)for(var o=0;o<t.length;o++)if(e[n]===t[o])return e[n];return null}}),$=f.utils.browser,Z=f.nativeMethods,ee=f.utils.style.get,te=f.utils.dom.getActiveElement,ne=f.utils.dom.findDocument,oe=f.utils.dom.find,re=f.utils.dom.isElementInDocument,ie=f.utils.dom.isElementInIframe,ae=f.utils.dom.getIframeByElement,se=f.utils.dom.isCrossDomainWindows,le=f.utils.dom.getSelectParent,ce=f.utils.dom.getChildVisibleIndex,ue=f.utils.dom.getSelectVisibleChildren,de=f.utils.dom.isElementNode,fe=f.utils.dom.isTextNode,he=f.utils.dom.isRenderedNode,pe=f.utils.dom.isIframeElement,me=f.utils.dom.isInputElement,ge=f.utils.dom.isButtonElement,Ee=f.utils.dom.isFileInput,ve=f.utils.dom.isTextAreaElement,ye=f.utils.dom.isAnchorElement,be=f.utils.dom.isImgElement,Ce=f.utils.dom.isFormElement,Se=f.utils.dom.isLabelElement,we=f.utils.dom.isSelectElement,Te=f.utils.dom.isRadioButtonElement,_e=f.utils.dom.isColorInputElement,Ie=f.utils.dom.isCheckboxElement,Ne=f.utils.dom.isOptionElement,Pe=f.utils.dom.isSVGElement,Re=f.utils.dom.isMapElement,xe=f.utils.dom.isBodyElement,Me=f.utils.dom.isHtmlElement,Oe=f.utils.dom.isDocument,Ae=f.utils.dom.isWindow,Fe=f.utils.dom.isTextEditableInput,Le=f.utils.dom.isTextEditableElement,Ve=f.utils.dom.isTextEditableElementAndEditingAllowed,We=f.utils.dom.isContentEditableElement,ke=f.utils.dom.isDomElement,He=f.utils.dom.isShadowUIElement,De=f.utils.dom.isShadowRoot,Ue=f.utils.dom.isElementFocusable,Be=f.utils.dom.isHammerheadAttr,qe=f.utils.dom.isElementReadOnly,Ge=f.utils.dom.getScrollbarSize,je=f.utils.dom.getMapContainer,ze=f.utils.dom.getTagName,Je=f.utils.dom.closest,Ke=f.utils.dom.getParents,Ye=f.utils.dom.findParent,Xe=f.utils.dom.getTopSameDomainWindow,Qe=f.utils.dom.getParentExceptShadowRoot;function $e(e,t){var n,o={el:n=e,skip:n.shadowRoot&&n.tabIndex<0,children:{}};if(e=e.shadowRoot||e,pe(e)&&(e=Z.contentDocumentGetter.call(e)),e&&(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node.DOCUMENT_NODE))for(var r=0,i=function(e){for(var t,n=e.querySelectorAll("*"),o=function(e){for(var t=[],n=0;n<e.length;n++)"none"===ee(e[n],"display")&&t.push(e[n]);return t}(n),r=/^(input|button|select|textarea)$/,i=[],a=null,s=null,l=null,c=!1,u=0;u<n.length;u++){a=n[u],s=ze(a),l=Ze(a),c=!1,function(e,t,n){var o=null;return t.nodeType===Node.DOCUMENT_NODE&&(o=Z.documentActiveElementGetter.call(t)),e===o||!(e.disabled||"none"===ee(e,"display")||"hidden"===ee(e,"visibility")||($.isIE||$.isAndroid)&&Ne(e)||null!==n&&n<0)}(a,e,l)&&(r.test(s)||a.shadowRoot||pe(a)?c=!0:ye(a)&&a.hasAttribute("href")&&(c=""!==a.getAttribute("href")||!$.isIE||null!==l),""!==(t=a.getAttribute("contenteditable"))&&"true"!==t||(c=!0),null!==l&&(c=!0),c&&i.push(a))}return W(i,function(e){return!et(o,e)})}(e);r<i.length;r++){var a=i[r],s=!t||a.tabIndex<=0?-1:a.tabIndex;o.children[s]=o.children[s]||[],o.children[s].push($e(a,t))}return o}function Ze(e){var t=Z.getAttribute.call(e,"tabindex");return null!==t&&(t=parseInt(t,10),t=isNaN(t)?null:t),t}function et(e,t){return e.contains?e.contains(t):G(e,function(e){return e.contains(t)})}function tt(e,t){if(ot(t,e))return!0;for(var n=Z.nodeChildNodesGetter.call(e),o=lt(n),r=0;r<o;r++){var i=n[r];if(!He(i)&&tt(i,t))return!0}return!1}function nt(e,t){var n=e.querySelectorAll(ze(t));return q(n,t)}function ot(e,t){return e&&t&&e.isSameNode?e.isSameNode(t):e===t}function rt(t){if(!t.setTimeout)return!1;var e=null;try{e=t.frameElement}catch(e){return!!t.top}return!(!$.isFirefox&&!$.isWebKit||t.top===t||e)||!(!e||!Z.contentDocumentGetter.call(e))}function it(e){try{return e.top===e}catch(e){return!1}}function at(e){var t=[];oe(vi,"*",function(e){"IFRAME"===e.tagName&&t.push(e),e.shadowRoot&&oe(e.shadowRoot,"iframe",function(e){return t.push(e)})});for(var n=0;n<t.length;n++)if(Z.contentWindowGetter.call(t[n])===e)return t[n];return null}function st(e){return Z.htmlCollectionLengthGetter.call(e)}function lt(e){return Z.nodeListLengthGetter.call(e)}function ct(e){return Z.inputValueGetter.call(e)}function ut(e){return Z.textAreaValueGetter.call(e)}function dt(e,t){return Z.inputValueSetter.call(e,t)}function ft(e,t){return Z.textAreaValueSetter.call(e,t)}function ht(e){return me(e)?ct(e):ve(e)?ut(e):e.value}function pt(e){return e&&e.getRootNode&&ne(e)!==e.getRootNode()}var mt=Object.freeze({__proto__:null,getActiveElement:te,findDocument:ne,find:oe,isElementInDocument:re,isElementInIframe:ie,getIframeByElement:ae,isCrossDomainWindows:se,getSelectParent:le,getChildVisibleIndex:ce,getSelectVisibleChildren:ue,isElementNode:de,isTextNode:fe,isRenderedNode:he,isIframeElement:pe,isInputElement:me,isButtonElement:ge,isFileInput:Ee,isTextAreaElement:ve,isAnchorElement:ye,isImgElement:be,isFormElement:Ce,isLabelElement:Se,isSelectElement:we,isRadioButtonElement:Te,isColorInputElement:_e,isCheckboxElement:Ie,isOptionElement:Ne,isSVGElement:Pe,isMapElement:Re,isBodyElement:xe,isHtmlElement:Me,isDocument:Oe,isWindow:Ae,isTextEditableInput:Fe,isTextEditableElement:Le,isTextEditableElementAndEditingAllowed:Ve,isContentEditableElement:We,isDomElement:ke,isShadowUIElement:He,isShadowRoot:De,isElementFocusable:Ue,isHammerheadAttr:Be,isElementReadOnly:qe,getScrollbarSize:Ge,getMapContainer:je,getTagName:ze,closest:Je,getParents:Ke,findParent:Ye,getTopSameDomainWindow:Xe,getParentExceptShadowRoot:Qe,getFocusableElements:function(e,t){return void 0===t&&(t=!1),function e(t){var n,o=[];for(n in t.skip||t.el.nodeType===Node.DOCUMENT_NODE||pe(t.el)||o.push(t.el),t.children)for(var r=0,i=t.children[n];r<i.length;r++){var a=i[r];o.push.apply(o,e(a))}return o}($e(e,t))},getTabIndexAttributeIntValue:Ze,containsElement:et,getTextareaIndentInLine:function(e,t){var n=ut(e);if(!n)return 0;var o=n.substring(0,t);return t-(-1===o.lastIndexOf("\n")?0:o.lastIndexOf("\n")+1)},getTextareaLineNumberByPosition:function(e,t){for(var n=ut(e).split("\n"),o=0,r=0,i=0;o<=t;i++){if(t<=o+n[i].length){r=i;break}o+=n[i].length+1}return r},getTextareaPositionByLineAndOffset:function(e,t,n){for(var o=ut(e).split("\n"),r=0,i=0;i<t;i++)r+=o[i].length+1;return r+n},blocksImplicitSubmission:function(e){return($.isSafari?/^(text|password|color|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:$.isFirefox?/^(text|password|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:$.isIE?/^(text|password|color|date|time|datetime|datetime-local|email|file|month|number|search|tel|url|week|image)$/i:/^(text|password|datetime|email|number|search|tel|url|image)$/i).test(e.type)},isEditableElement:function(e,t){return t?Ve(e)||We(e):Le(e)||We(e)},isElementContainsNode:tt,isOptionGroupElement:function(e){return"[object HTMLOptGroupElement]"===f.utils.dom.instanceToString(e)},getElementIndexInParent:nt,isTheSameNode:ot,getElementDescription:function(e){var t,n,o={id:"id",name:"name",class:"className"},r=[];for(t in r.push("<"),r.push(ze(e)),o)!o.hasOwnProperty(t)||(n=e[o[t]])&&r.push(" "+t+'="'+n+'"');return r.push(">"),r.join("")},getFocusableParent:function(e){for(var t=Ke(e),n=0;n<t.length;n++)if(Ue(t[n]))return t[n];return null},remove:function(e){e&&e.parentElement&&e.parentElement.removeChild(e)},isIFrameWindowInDOM:rt,isTopWindow:it,findIframeByWindow:at,isEditableFormElement:function(e){return Le(e)||we(e)},getCommonAncestor:function(e,t){if(ot(e,t))return e;for(var n=[e].concat(Ke(e)),o=t;o;){if(-1<q(n,o))return o;o=Z.nodeParentNodeGetter.call(o)}return o},getChildrenLength:st,getChildNodesLength:lt,getInputValue:ct,getTextAreaValue:ut,setInputValue:dt,setTextAreaValue:ft,getElementValue:ht,setElementValue:function(e,t){return me(e)?dt(e,t):ve(e)?ft(e,t):e.value=t},isShadowElement:pt,contains:function(t,e){return!(!t||!e)&&(t.contains?t.contains(e):!!Ye(e,!0,function(e){return e===t}))},isNodeEqual:function(e,t){return e===t},getNodeText:function(e){return Z.nodeTextContentGetter.call(e)},getImgMapName:function(e){return e.useMap.substring(1)},getDocumentElement:function(e){return e.document.documentElement},isDocumentElement:function(e){return e===vi.documentElement}}),gt=f.Promise,Et=f.nativeMethods,vt=f.eventSandbox.listeners,yt=f.utils.browser,bt=f.utils.event.BUTTON,Ct=f.utils.event.BUTTONS_PARAMETER,St=f.utils.event.DOM_EVENTS,wt=f.utils.event.WHICH_PARAMETER,Tt=f.utils.event.preventDefault;function _t(e,t,n,o){yt.isIE11&&Ae(e)?Et.windowAddEventListener.call(e,t,n,o):Et.addEventListener.call(e,t,n,o)}function It(e,t,n,o){yt.isIE11&&Ae(e)?Et.windowRemoveEventListener.call(e,t,n,o):Et.removeEventListener.call(e,t,n,o)}function Nt(){var n=[],e=!1;function t(){e||(vi.body?(e=!0,n.forEach(function(e){return e()})):Et.setTimeout.call(Ei,t,1))}function o(){(rt(Ei)||it(Ei))&&(It(vi,"DOMContentLoaded",o),t())}return"complete"===vi.readyState?Et.setTimeout.call(Ei,o,1):_t(vi,"DOMContentLoaded",o),{then:function(e){return t=e,new gt(function(e){return n.push(function(){return e(t())})});var t}}}var Pt,Rt,xt=Object.freeze({__proto__:null,BUTTON:bt,BUTTONS_PARAMETER:Ct,DOM_EVENTS:St,WHICH_PARAMETER:wt,preventDefault:Tt,bind:_t,unbind:It,documentReady:function(e){return void 0===e&&(e=0),Nt().then(function(){return vt.getEventListeners(Ei,"load").length?gt.race([new gt(function(e){return _t(Ei,"load",e)}),c(e)]):null})}});(Rt=Pt=Pt||{}).ready="ready",Rt.readyForBrowserManipulation="ready-for-browser-manipulation",Rt.waitForFileDownload="wait-for-file-download";var Mt=Pt,Ot=f.Promise,At=f.utils.browser,Ft=f.nativeMethods,Lt=f.transport,Vt=30,Wt=500,kt=!1,Ht=null,Dt=!1;function Ut(){if(At.isIE)return function(e){qt&&Ft.clearTimeout.call(Ei,qt),Bt=!0,qt=Ft.setTimeout.call(Ei,function(){qt=null,Bt=!1,Gt.forEach(function(e){return e()}),Gt=[]},e)}(Vt),void c(0).then(function(){var e;"loading"===vi.readyState&&((e=Ft.documentActiveElementGetter.call(vi))&&ye(e)&&e.hasAttribute("download")||(kt=!0))});kt=!0}var Bt=!1,qt=null,Gt=[],jt=Object.freeze({__proto__:null,init:function(){f.on(f.EVENTS.beforeUnload,Ut),_t(Ei,"unload",function(){kt=!0})},watchForPageNavigationTriggers:function(){Ht=function(){Dt=!0},f.on(f.EVENTS.pageNavigationTriggered,Ht)},wait:function(e){void 0===e&&(e=!Ht||Dt?400:0),Ht&&(f.off(f.EVENTS.pageNavigationTriggered,Ht),Ht=null);var t=c(e).then(function(){return kt?c(Wt).then(function(){return Lt.queuedAsyncServiceMsg({cmd:Mt.waitForFileDownload})}).then(function(e){if(!e)return new Ot(function(){})}).then(function(){kt=!1}):Bt?new Ot(function(e){return Gt.push(e)}):void 0}),n=c(15e3).then(function(){kt=!1});return Ot.race([t,n])}}),zt=b,Jt=Object.freeze({__proto__:null,EventEmitter:zt,inherit:function(e,t){function n(){}n.prototype=t.prototype,f.utils.extend(e.prototype,new n),(e.prototype.constructor=e).base=t.prototype}}),Kt=d.eventSandbox.listeners;function Yt(){this.initialized=!1,this.stopPropagationFlag=!1,this.events=new zt}var Xt=(Yt.prototype._internalListener=function(e,t,n,o,r){this.events.emit("scroll",e),this.stopPropagationFlag&&(o(),r())},Yt.prototype.init=function(){var n=this;this.initialized||(this.initialized=!0,Kt.initElementListening(Ei,["scroll"]),Kt.addFirstInternalEventBeforeListener(Ei,["scroll"],function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n._internalListener.apply(n,e)}))},Yt.prototype.waitForScroll=function(e){var t=this,n=null,o=new d.Promise(function(e){n=e});return o.cancel=function(){return t.events.off("scroll",n)},this.initialized?this.handleScrollEvents(e,n):n(),o},Yt.prototype.handleScrollEvents=function(n,e){var o=this;this.events.once("scroll",e),pt(n)&&(Kt.initElementListening(n,["scroll"]),Kt.addFirstInternalEventBeforeListener(n,["scroll"],function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];o._internalListener.apply(o,e),Kt.cancelElementListening(n)}))},Yt.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},Yt.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},new Yt),Qt=($t.create=function(e){return new $t(e.top,e.right,e.bottom,e.left)},$t.prototype.add=function(e){return this.top+=e.top,this.right+=e.right,this.bottom+=e.bottom,this.left+=e.left,this},$t.prototype.sub=function(e){return"top"in e&&(this.top-=e.top,this.left-=e.left),this.bottom-=e.bottom,this.right-=e.right,this},$t.prototype.round=function(e,t){return void 0===e&&(e=Math.round),void 0===t&&(t=e),this.top=e(this.top),this.right=t(this.right),this.bottom=t(this.bottom),this.left=e(this.left),this},$t.prototype.contains=function(e){return e.x>=this.left&&e.x<=this.right&&e.y>=this.top&&e.y<=this.bottom},$t);function $t(e,t,n,o){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===o&&(o=0),this.top=e,this.right=t,this.bottom=n,this.left=o}var Zt=f.utils.style,en=f.utils.style.getBordersWidth,tn=f.utils.style.getComputedStyle,nn=f.utils.style.getElementMargin,on=f.utils.style.getElementPadding,rn=f.utils.style.getElementScroll,an=f.utils.style.getOptionHeight,sn=f.utils.style.getSelectElementSize,ln=f.utils.style.isElementVisible,cn=f.utils.style.isVisibleChild,un=f.utils.style.getWidth,dn=f.utils.style.getHeight,fn=f.utils.style.getInnerWidth,hn=f.utils.style.getInnerHeight,pn=f.utils.style.getScrollLeft,mn=f.utils.style.getScrollTop,gn=f.utils.style.setScrollLeft,En=f.utils.style.setScrollTop,vn=f.utils.style.get,yn=f.utils.style.getBordersWidthFloat,bn=f.utils.style.getElementPaddingFloat;function Cn(e,t,n){for(var o in"string"==typeof t&&Zt.set(e,t,n),t)t.hasOwnProperty(o)&&Zt.set(e,o,t[o])}function Sn(e,t,n){return e<t?n:e<n?t:Math.max(n,t)}function wn(e){return!!Ye(e,!0,function(e){return de(e)&&"hidden"===Zt.get(e,"visibility")})}function Tn(e){return!!Ye(e,!0,function(e){return de(e)&&"none"===Zt.get(e,"display")})}function _n(e){return!he(e)||Tn(e)||wn(e)}function In(e){return e&&!(e.offsetHeight<=0&&e.offsetWidth<=0)}function Nn(e){return de(e)&&"fixed"===Zt.get(e,"position")}var Pn=Object.freeze({__proto__:null,getBordersWidth:en,getComputedStyle:tn,getElementMargin:nn,getElementPadding:on,getElementScroll:rn,getOptionHeight:an,getSelectElementSize:sn,isElementVisible:ln,isSelectVisibleChild:cn,getWidth:un,getHeight:dn,getInnerWidth:fn,getInnerHeight:hn,getScrollLeft:pn,getScrollTop:mn,setScrollLeft:gn,setScrollTop:En,get:vn,getBordersWidthFloat:yn,getElementPaddingFloat:bn,set:Cn,getViewportDimensions:function(){return{width:Sn(Ei.innerWidth,vi.documentElement.clientWidth,vi.body.clientWidth),height:Sn(Ei.innerHeight,vi.documentElement.clientHeight,vi.body.clientHeight)}},getWindowDimensions:function(e){return new Qt(0,un(e),dn(e),0)},isHiddenNode:wn,isNotDisplayedNode:Tn,isNotVisibleNode:_n,hasDimensions:In,isFixedElement:Nn}),Rn=d.utils.browser,xn=d.eventSandbox.listeners,Mn=d.eventSandbox.eventSimulator,On=["click","mousedown","mouseup","dblclick","contextmenu","mousemove","mouseover","mouseout","touchstart","touchmove","touchend","keydown","keypress","input","keyup","change","focus","blur","MSPointerDown","MSPointerMove","MSPointerOver","MSPointerOut","MSPointerUp","pointerdown","pointermove","pointerover","pointerout","pointerup"],An=123;function Fn(e,t,n,o,r){var i,a=d.nativeMethods.eventTargetGetter.call(e)||e.srcElement;if(!t&&!He(a)){if(/^key/.test(e.type)&&((i=e).shiftKey&&i.ctrlKey||(i.altKey||i.metaKey)&&Rn.isMacPlatform||i.keyCode===An))return void r();if("blur"===e.type)if(Rn.isIE&&Rn.version<12){var s,l=Ae(a),c=!l&&"none"===vn(a,"display"),u=!1;l||c||(s=Ke(a),u=W(s,function(e){return"none"===vn(e,"display")})),(c||u.length)&&d.eventSandbox.timers.deferFunction(function(){Mn.blur(a)})}else if(a!==Ei&&a!==Ei.document&&!In(a))return;n()}}var Ln=(Vn.create=function(e){return"left"in e?new Vn(e.left,e.top):"right"in e?new Vn(e.right,e.bottom):new Vn(e.x,e.y)},Vn.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},Vn.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},Vn.prototype.round=function(e){return void 0===e&&(e=Math.round),this.x=e(this.x),this.y=e(this.y),this},Vn.prototype.eql=function(e){return this.x===e.x&&this.y===e.y},Vn.prototype.mul=function(e){return this.x*=e,this.y*=e,this},Vn.prototype.distance=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},Vn);function Vn(e,t){this.x=e,this.y=t}var Wn=/auto|scroll|hidden/i,kn="visible";function Hn(e){var t,n=vn(e,"overflowX"),o=vn(e,"overflowY"),r=Wn.test(n),i=Wn.test(o),a=ne(e).documentElement,s=e.scrollHeight;return(d.utils.browser.isChrome||d.utils.browser.isFirefox||d.utils.browser.isSafari)&&(t=e.getBoundingClientRect().top,s=s-a.getBoundingClientRect().top+t),(r||i)&&s>a.scrollHeight}function Dn(e){if(xe(e))return Hn(e);if(Me(e))return function(e){var t=vn(e,"overflowX"),n=vn(e,"overflowY");if("hidden"===t&&"hidden"===n)return!1;var o=e.scrollHeight>e.clientHeight,r=e.scrollWidth>e.clientWidth;if(o||r)return!0;var i=e.getElementsByTagName("body")[0];if(!i)return!1;if(Hn(i))return!1;var a=Math.min(e.clientWidth,i.clientWidth),s=Math.min(e.clientHeight,i.clientHeight);return i.scrollHeight>s||i.scrollWidth>a}(e);var t,n,o,r,i,a=(n=vn(t=e,"overflowX"),o=vn(t,"overflowY"),r=Wn.test(n),i=Wn.test(o),d.utils.browser.isIE&&(r=r||i&&n===kn,i=i||r&&o===kn),new Ln(r,i));if(!a.x&&!a.y)return!1;var s=a.y&&e.scrollHeight>e.clientHeight;return a.x&&e.scrollWidth>e.clientWidth||s}function Un(e){var t,n,o=Ke(e);return!ie(e)||(t=ae(e))&&(n=Ke(t),o.concat(n)),d.nativeMethods.arrayFilter.call(o,Dn)}var Bn=Object.freeze({__proto__:null,hasScroll:Dn,getScrollableParents:Un}),qn=f.shadowUI,Gn=f.nativeMethods,jn="disabled";function zn(){this.currentEl=null,this.optionList=null,this.groups=[],this.options=[]}var Jn=(zn.prototype._createOption=function(e,t){var n=vi.createElement("div"),o=e.disabled||"optgroup"===ze(e.parentElement)&&e.parentElement.disabled,r="option"===ze(e)?e.text:"";Gn.nodeTextContentSetter.call(n,r),t.appendChild(n),qn.addClass(n,"tcOption"),o&&(qn.addClass(n,jn),Cn(n,"color",vn(e,"color"))),this.options.push(n)},zn.prototype._createGroup=function(e,t){var n=vi.createElement("div");Gn.nodeTextContentSetter.call(n,e.label||" "),t.appendChild(n),qn.addClass(n,"tcOptionGroup"),e.disabled&&(qn.addClass(n,jn),Cn(n,"color",vn(e,"color"))),this.createChildren(e.children,n),this.groups.push(n)},zn.prototype.clear=function(){this.optionList=null,this.currentEl=null,this.options=[],this.groups=[]},zn.prototype.createChildren=function(e,t){for(var n=st(e),o=0;o<n;o++)Ne(e[o])?this._createOption(e[o],t):"optgroup"===ze(e[o])&&this._createGroup(e[o],t)},zn.prototype.getEmulatedChildElement=function(e){var t="optgroup"===ze(e),n=nt(this.currentEl,e);return t?this.groups[n]:this.options[n]},zn.prototype.isOptionListExpanded=function(e){return e?e===this.currentEl:!!this.currentEl},zn.prototype.isOptionElementVisible=function(e){var t=le(e);if(!t)return!0;var n=this.isOptionListExpanded(t),o=sn(t);return n||1<o},new zn),Kn=function(e,t,n,o,r,i){this.width=e,this.height=t,this.left=n.x,this.top=n.y,this.right=n.x+e,this.bottom=n.y+t,this.border=o,this.scrollbar=i,this.scroll=r},Yn={notElementOrTextNode:function(e){return"\n The ".concat(e," is neither a DOM element nor a text node.\n ")},elOutsideBounds:function(e,t){return"\n The ".concat(t," (").concat(e,") is located outside the the layout viewport.\n ")},elHasWidthOrHeightZero:function(e,t,n,o){return"\n The ".concat(t," (").concat(e,") is too small to be visible: ").concat(n,"px x ").concat(o,"px.\n ")},elHasDisplayNone:function(e,t){return"\n The ".concat(t," (").concat(e,") is invisible. \n The value of its 'display' property is 'none'.\n ")},parentHasDisplayNone:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible. \n It descends from an element that has the 'display: none' property (").concat(n,").\n ")},elHasVisibilityHidden:function(e,t){return"\n The ".concat(t," (").concat(e,") is invisible.\n The value of its 'visibility' property is 'hidden'.\n ")},parentHasVisibilityHidden:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible.\n It descends from an element that has the 'visibility: hidden' property (").concat(n,").\n ")},elHasVisibilityCollapse:function(e,t){return"\n The ".concat(t," (").concat(e,") is invisible.\n The value of its 'visibility' property is 'collapse'.\n ")},parentHasVisibilityCollapse:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible.\n It descends from an element that has the 'visibility: collapse' property (").concat(n,").\n ")},elNotRendered:function(e,t){return"\n The ".concat(t," (").concat(e,") has not been rendered.\n ")},optionNotVisible:function(e,t,n){return"\n The ".concat(t," (").concat(e,") is invisible. \n The parent element (").concat(n,") is collapsed, and its length is shorter than 2.\n ")},mapContainerNotVisible:function(e,t){return"\n The action target (".concat(e,") is invisible because ").concat(t,"\n ")}},Xn=f.utils.html,Qn=f.nativeMethods,$n=10;function Zn(e){if(!e)return"";var t,n,o,r=Qn.cloneNode.call(e),i=Xn.cleanUpHtml(Qn.elementOuterHTMLGetter.call(r)),a=(t=Qn.nodeTextContentGetter.call(e),n=$n,void 0===o&&(o="..."),t.length<n?t:t.substring(0,n-o.length)+o),s=Qn.elementChildrenGetter.call(e);return 0<Qn.htmlCollectionLengthGetter.call(s)?i.replace("></",">...</"):a?i.replace("></",">".concat(a,"</")):i}var eo=f.utils.position.getElementRectangle,to=f.utils.position.getOffsetPosition,no=f.utils.position.offsetToClientCoords;function oo(e){var t,n,o,r,i=Me(e),a=i?e.getElementsByTagName("body")[0]:null,s=e.getBoundingClientRect(),l=Qt.create(en(e)),c=rn(e),u=ie(e),d="BackCompat"===e.ownerDocument.compatMode,f=i?new Ln(0,0):Ln.create(s),h=s.height,p=s.width;i&&(p=a&&d?(h=a.clientHeight,a.clientWidth):(h=e.clientHeight,e.clientWidth)),!u||(t=ae(e))&&(n=to(t),o=no(Ln.create(n)),r=en(t),f.add(o).add(Ln.create(r)),i&&l.add(r));var m=!i&&fn(e)!==e.clientWidth,g=!i&&hn(e)!==e.clientHeight,E={right:m?Ge():0,bottom:g?Ge():0};return new Kn(p,h,f,l,c,E)}function ro(e){var t=e.x,n=e.y,o=vi.getElementFromPoint||vi.elementFromPoint,r=null;try{r=o.call(vi,t,n)}catch(e){return null}for(null===r&&(r=o.call(vi,t-1,n-1));r&&r.shadowRoot&&r.shadowRoot.elementFromPoint;){var i=r.shadowRoot.elementFromPoint(t,n);if(!i||r===i)break;r=i}return r}function io(e,t){return Qt.create({top:e.top-t.top,left:e.left-t.left,right:t.right-e.right,bottom:t.bottom-e.bottom}).sub(t.border).sub(t.scrollbar).round(Math.ceil,Math.floor)}function ao(e){var t=/^touch/.test(e.type)&&e.targetTouches?e.targetTouches[0]||e.changedTouches[0]:e,n=0===t.pageX&&0===t.pageY,o=0!==t.clientX||0!==t.clientY;if((null===t.pageX||n&&o)&&null!==t.clientX){var r=ne(e.target||e.srcElement),i=r.documentElement,a=r.body;return new Ln(Math.round(t.clientX+(i&&i.scrollLeft||a&&a.scrollLeft||0)-(i.clientLeft||0)),Math.round(t.clientY+(i&&i.scrollTop||a&&a.scrollTop||0)-(i.clientTop||0)))}return new Ln(Math.round(t.pageX),Math.round(t.pageY))}function so(e){return!fo(e)}function lo(e){return"hidden"===vn(e,"visibility")}function co(e){return"collapse"===vn(e,"visibility")}function uo(e){return"none"===vn(e,"display")}function fo(e){return!pt(e)&&(lo(e)||co(e)||uo(e))}function ho(e){var t=eo(e);return 0===t.width||0===t.height}function po(e){return e.replace(/.*The/,"its")}var mo=Object.freeze({__proto__:null,getElementRectangle:eo,getOffsetPosition:to,offsetToClientCoords:no,getClientDimensions:oo,getElementFromPoint:ro,calcRelativePosition:io,getIframeClientCoordinates:function(e){var t=to(e),n=t.left,o=t.top,r=no({x:n,y:o}),i=en(e),a=on(e),s=r.x+i.left+a.left,l=r.y+i.top+a.top;return new Qt(l,s+un(e),l+dn(e),s)},containsOffset:function(e,t,n){var o=oo(e),r=Math.max(e.scrollWidth,o.width),i=Math.max(e.scrollHeight,o.height),a=o.scrollbar.right+o.border.left+o.border.right+r,s=o.scrollbar.bottom+o.border.top+o.border.bottom+i;return(void 0===t||0<=t&&t<=a)&&(void 0===n||0<=n&&n<=s)},getEventAbsoluteCoordinates:function(e){var t,n,o,r=e.target||e.srcElement,i=ao(e),a=ne(r),s=0,l=0;return!ie(a.documentElement)||(t=ae(a))&&(n=to(t),o=en(t),s=n.left+o.left,l=n.top+o.top),new Ln(i.x+s,i.y+l)},getEventPageCoordinates:ao,getIframePointRelativeToParentFrame:function(e,t){var n=at(t),o=to(n),r=en(n),i=on(n);return no({x:e.x+o.left+r.left+i.left,y:e.y+o.top+r.top+i.top})},findCenter:function(e){var t=eo(e);return new Ln(Math.round(t.left+t.width/2),Math.round(t.top+t.height/2))},getClientPosition:function(e){var t=to(e),n=t.left,o=t.top,r=no({x:n,y:o});return r.x=Math.round(r.x),r.y=Math.round(r.y),r},isInRectangle:function(e,t){var n=e.x,o=e.y;return n>=t.left&&n<=t.right&&o>=t.top&&o<=t.bottom},getWindowPosition:function(){var e=Ei.screenLeft||Ei.screenX,t=Ei.screenTop||Ei.screenY;return new Ln(e,t)},isIframeVisible:so,isElementVisible:function e(t){if(!ke(t)&&!fe(t))return!1;if(Ne(t)||"optgroup"===ze(t))return Jn.isOptionElementVisible(t);if(pe(t))return so(t);if(Pe(t))return!Ye(t,!0,fo)&&!ho(t);if(fe(t))return!_n(t);if(!We(t)&&ho(t))return!1;if(Re(t)){var n=je(Je(t,"map"));return!!n&&e(n)}return In(t)&&!fo(t)},getSubHiddenReason:po,getHiddenReason:function e(t,n){if(void 0===n&&(n="action target"),!t)return null;var o=fe(t);if(!ke(t)&&!o)return Yn.notElementOrTextNode(n);var r=o?t.data:Zn(t),i=t.offsetHeight,a=t.offsetWidth;if((Ne(t)||"optgroup"===ze(t))&&!Jn.isOptionElementVisible(t)){var s=Zn(le(t));return Yn.optionNotVisible(r,n,s)}if(Re(t)){var l=po(e(je(Je(t,"map")),"container")||"");return Yn.mapContainerNotVisible(r,l)}var c=Ye(t,!1,lo);if(c)return Yn.parentHasVisibilityHidden(r,n,Zn(c));var u=Ye(t,!1,co);if(u)return Yn.parentHasVisibilityCollapse(r,n,Zn(u));var d=Ye(t,!1,uo);return d?Yn.parentHasDisplayNone(r,n,Zn(d)):lo(t)?Yn.elHasVisibilityHidden(r,n):co(t)?Yn.elHasVisibilityCollapse(r,n):uo(t)?Yn.elHasDisplayNone(r,n):fe(t)&&!he(t)?Yn.elNotRendered(r,n):!We(t)&&ho(t)||!In(t)?Yn.elHasWidthOrHeightZero(r,n,a,i):null},getElOutsideBoundsReason:function e(t,n){void 0===n&&(n="action target");var o=Zn(t);if(Re(t)){var r=po(e(je(Je(t,"map")),"container")||"");return Yn.mapContainerNotVisible(o,r)}return Yn.elOutsideBounds(o,n)}});function go(n,o){return E(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<n?[4,o(t)]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}var Eo=Object.freeze({__proto__:null,whilst:function(t,n){return E(this,void 0,void 0,function(){return v(this,function(e){switch(e.label){case 0:return t()?[4,n()]:[3,2];case 1:return e.sent(),[3,0];case 2:return[2]}})})},times:go,each:function(r,i){return E(this,void 0,void 0,function(){var t,n,o;return v(this,function(e){switch(e.label){case 0:t=0,n=r,e.label=1;case 1:return t<n.length?(o=n[t],[4,i(o)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}}),vo=f.Promise,yo=f.eventSandbox.message;function bo(e,o,t){return new vo(function(n){yo.on(yo.SERVICE_MSG_RECEIVED_EVENT,function e(t){t.message.cmd===o&&(yo.off(yo.SERVICE_MSG_RECEIVED_EVENT,e),n(t.message))}),yo.sendServiceMsg(e,t)})}var Co=(So._isScrollValuesChanged=function(e,t){return pn(e)!==t.left||mn(e)!==t.top},So.prototype._setScroll=function(e,t){var n=this,o=t.left,r=t.top,i=Me(e)?ne(e):e,a={left:pn(i),top:mn(i)},o=Math.max(o,0),r=Math.max(r,0),s=Xt.waitForScroll(i);return gn(i,o),En(i,r),So._isScrollValuesChanged(i,a)?s=s.then(function(){n._scrollWasPerformed||(n._scrollWasPerformed=So._isScrollValuesChanged(i,a))}):(s.cancel(),d.Promise.resolve())},So.prototype._getScrollToPoint=function(e,t,n){var o=Math.floor(e.width/2),r=Math.floor(e.height/2),i=this._scrollToCenter?o:Math.min(n.left,o),a=this._scrollToCenter?r:Math.min(n.top,r),s=e.scroll,l=s.left,c=s.top,u=t.x>=l+e.width-i,d=t.x<=l+i,f=t.y>=c+e.height-a,h=t.y<=c+a;return u?l=t.x-e.width+i:d&&(l=t.x-i),f?c=t.y-e.height+a:h&&(c=t.y-a),{left:l,top:c}},So.prototype._getScrollToFullChildView=function(e,t,n){var o,r,i,a,s={left:null,top:null},l=e.width>=t.width,c=e.height>=t.height,u=io(t,e);return l&&(o=e.width-t.width,r=Math.min(n.left,o),this._scrollToCenter&&(r=o/2),u.left<r?s.left=Math.round(e.scroll.left+u.left-r):u.right<r&&(s.left=Math.round(e.scroll.left+Math.min(u.left,-u.right)+r))),c&&(i=e.height-t.height,a=Math.min(n.top,i),this._scrollToCenter&&(a=i/2),u.top<a?s.top=Math.round(e.scroll.top+u.top-a):u.bottom<a&&(s.top=Math.round(e.scroll.top+Math.min(u.top,-u.bottom)+a))),s},So._getChildPoint=function(e,t,n){return Ln.create(t).sub(Ln.create(e)).add(Ln.create(e.scroll)).add(Ln.create(t.border)).add(n)},So.prototype._getScrollPosition=function(e,t,n,o){var r=So._getChildPoint(e,t,n),i=this._getScrollToPoint(e,r,o),a=this._getScrollToFullChildView(e,t,o);return{left:Math.max(null===a.left?i.left:a.left,0),top:Math.max(null===a.top?i.top:a.top,0)}},So._getChildPointAfterScroll=function(e,t,n,o){return Ln.create(t).add(Ln.create(e.scroll)).sub(Ln.create(n)).add(o)},So.prototype._isChildFullyVisible=function(e,t,n){var o=So._getChildPointAfterScroll(e,t,e.scroll,n),r=this._getScrollPosition(e,t,n,{left:0,top:0}),i=r.left,a=r.top;return!this._isTargetElementObscuredInPoint(o)&&i===e.scroll.left&&a===e.scroll.top},So.prototype._scrollToChild=function(e,t,n){for(var o=oo(e),r=oo(t),i=fn(Ei),a=hn(Ei),s=o.scroll,l=!this._isChildFullyVisible(o,r,n);l;){s=this._getScrollPosition(o,r,n,this._maxScrollMargin);var c=So._getChildPointAfterScroll(o,r,s,n),u=this._isTargetElementObscuredInPoint(c);this._maxScrollMargin.left+=20,this._maxScrollMargin.left>=i&&(this._maxScrollMargin.left=50,this._maxScrollMargin.top+=20),l=u&&this._maxScrollMargin.top<a}return this._maxScrollMargin={left:50,top:50},this._setScroll(e,s)},So.prototype._scrollElement=function(){if(!Dn(this._element))return d.Promise.resolve();var e=oo(this._element),t=this._getScrollToPoint(e,this._offsets,this._maxScrollMargin);return this._setScroll(this._element,t)},So.prototype._scrollParents=function(){var t,n,o=this,r=Un(this._element),i=this._element,e=pn(i),a=mn(i),s=Ln.create(this._offsets).sub(new Ln(e,a).round()),l=go(r.length,function(e){return o._scrollToChild(r[e],i,s).then(function(){t=oo(i),n=oo(r[e]),s.add(Ln.create(t)).sub(Ln.create(n)).add(Ln.create(n.border)),i=r[e]})}),c={scrollWasPerformed:this._scrollWasPerformed,offsetX:s.x,offsetY:s.y,maxScrollMargin:this._maxScrollMargin};return l.then(function(){var e;if(!o._skipParentFrames&&(e=Ei).top!==e)return c.cmd=So.SCROLL_REQUEST_CMD,bo(c,So.SCROLL_RESPONSE_CMD,Ei.parent)}).then(function(){return o._scrollWasPerformed})},So._getFixedAncestorOrSelf=function(e){return Ye(e,!0,Nn)},So.prototype._isTargetElementObscuredInPoint=function(e){var t=ro(e);if(!t)return!1;var n=So._getFixedAncestorOrSelf(t);return!!n&&!n.contains(this._element)},So.prototype.run=function(){var e=this;return this._scrollElement().then(function(){return e._scrollParents()})},So.SCROLL_REQUEST_CMD="automation|scroll|request",So.SCROLL_RESPONSE_CMD="automation|scroll|response",So);function So(e,t,n){this._element=e,this._offsets=new Ln(t.offsetX,t.offsetY),this._scrollToCenter=!!t.scrollToCenter,this._skipParentFrames=!!t.skipParentFrames,this._maxScrollMargin=n||{left:50,top:50},this._scrollWasPerformed=!1}function wo(e){var t=d.nativeMethods.nodeChildNodesGetter.call(e);return!lt(t)&&Wo(e)?e:X(t,Wo)}function To(e){return X(d.nativeMethods.nodeChildNodesGetter.call(e),function(e){return Wo(e)||!ko(e)&&To(e)})}function _o(e){return fe(e)||de(e)&&ln(e)}function Io(e){var t=d.nativeMethods.nodeChildNodesGetter.call(e);return W(t,_o)}function No(e){var t=d.nativeMethods.nodeChildNodesGetter.call(e);return G(t,_o)}function Po(e){var t=d.nativeMethods.nodeChildNodesGetter.call(e);return G(t,function(e){return Jo(e,!0)})}function Ro(e,t){var n,o;if(!He(e)&&!He(t)){var r=d.nativeMethods.nodeChildNodesGetter.call(t);return!ot(t,e)&&lt(r)&&/div|p/.test(ze(t))&&(n=To(e))&&!ot(t,n)&&(o=Oo(n))&&!ot(t,o)&&wo(t)}}function xo(e,t){var n,o,r,i=he(t);if(!He(e)&&!He(t)){var a=d.nativeMethods.nodeChildNodesGetter.call(t);if(!ot(t,e)&&(i&&de(t)&&lt(a)&&!/div|p/.test(ze(t))||Wo(t)&&!ot(t,e)&&t.nodeValue.length)){if(i&&de(t)){if(!(n=To(e))||ot(t,n))return;if(!(o=Oo(n))||ot(t,o))return}return(r=function(e){for(var t=null,n=e;!t&&(n=n.previousSibling);)if(!ko(n)&&!Vo(n)){t=n;break}return t}(t))&&de(r)&&/div|p/.test(ze(r))&&wo(r)}}}function Mo(e,t){var n,o,r=d.nativeMethods.nodeChildNodesGetter.call(e),i=lt(r),a=null,s=t?Wo:fe;if(!i&&s(e))return e;for(var l=0;l<i;l++){if(n=r[l],o=de(n)&&!We(n),s(n))return n;if(he(n)&&No(n)&&!o&&(a=Mo(n,t)))return a}return a}function Oo(e){return Mo(e,!0)}function Ao(e,t){var n,o,r=d.nativeMethods.nodeChildNodesGetter.call(e),i=lt(r),a=null;if(!i&&Wo(e))return e;for(var s=i-1;0<=s;s--){if(n=r[s],o=de(n)&&!We(n),fe(n)&&(!t||!Vo(n)))return n;if(he(n)&&No(n)&&!o&&(a=Ao(n,!1)))return a}return a}function Fo(e,t){if(!e||!e.length)return 0;for(var n=e.length,o=t||0,r=o;r<n&&(10===e.charCodeAt(r)||32===e.charCodeAt(r));r++)o++;return o}function Lo(e){if(!e||!e.length)return 0;for(var t=e.length,n=t,o=t-1;0<=o&&(10===e.charCodeAt(o)||32===e.charCodeAt(o));o--)n--;return n}function Vo(e){if(!fe(e))return!1;var t=e.nodeValue,n=Fo(t),o=Lo(t);return n===t.length&&0===o}function Wo(e){return fe(e)&&!Vo(e)}function ko(e){return!he(e)||He(e)}function Ho(e){var t=e.getAttribute?e.getAttribute("contenteditable"):null;return""===t||"true"===t}function Do(e){var t=Ke(e);if(Ho(e)&&We(e))return e;var n=ne(e);return"on"===n.designMode?n.body:X(t,function(e){return Ho(e)&&We(e)})}function Uo(e,t){if(ot(e,t))return ot(t,Do(e))?e:d.nativeMethods.nodeParentNodeGetter.call(e);var n=[],o=Do(e),r=null;if(!tt(o,t))return null;for(r=e;r!==o;r=d.nativeMethods.nodeParentNodeGetter.call(r))n.push(r);for(r=t;r!==o;r=d.nativeMethods.nodeParentNodeGetter.call(r))if(-1!==q(n,r))return r;return o}function Bo(e,t){var n=null,o=null,r=d.nativeMethods.nodeChildNodesGetter.call(e),i=lt(r),a=i<=t;if(He(e))return{node:e,offset:t};if(a?n=r[i-1]:(n=r[t],o=0),He(n)){if(i<=1)return{node:e,offset:0};(a=i<=t-1)?n=r[i-2]:(n=r[t-1],o=0)}for(;!ko(n)&&de(n);){var s=Io(n);if(!s.length){o=0;break}n=s[a?s.length-1:0]}return 0===o||ko(n)||(o=n.nodeValue?n.nodeValue.length:0),{node:n,offset:o}}function qo(e,t,n){var o=n?t.focusNode:t.anchorNode,r=n?t.focusOffset:t.anchorOffset,i={node:o,offset:r};return(ot(e,o)||de(o))&&Po(o)&&(i=Bo(o,r)),{node:i.node,offset:i.offset}}function Go(e,t,n){var o=n?t.anchorNode:t.focusNode,r=n?t.anchorOffset:t.focusOffset,i={node:o,offset:r};return(ot(e,o)||de(o))&&Po(o)&&(i=Bo(o,r)),{node:i.node,offset:i.offset}}function jo(e,t,n){return Yo(e,qo(e,t,n))}function zo(e,t,n){return Yo(e,Go(e,t,n))}function Jo(e,t){if(_n(e))return!1;if(fe(e))return!0;if(!de(e))return!1;if(Po(e))return t;var n=d.nativeMethods.nodeParentNodeGetter.call(e),o=!We(n),r=Io(e),i=G(r,function(e){return"br"===ze(e)});return o||i}function Ko(s,e){var l={node:null,offset:e};return function e(t){var n,o,r=d.nativeMethods.nodeChildNodesGetter.call(t),i=lt(r);if(l.node)return l;if(ko(t))return l;if(fe(t)){if(l.offset<=t.nodeValue.length)return l.node=t,l;t.nodeValue.length&&(!l.node&&xo(s,t)&&l.offset--,l.offset-=t.nodeValue.length)}else if(de(t)){if(!_o(t))return l;if(0===l.offset&&Jo(t,!1))return l.node=t,l.offset=(n=t,o=0,X(d.nativeMethods.nodeChildNodesGetter.call(n),function(e,t){return o=t,"br"===ze(e)})?o:0),l;(l.node||!Ro(s,t)&&!xo(s,t))&&(i||"br"!==ze(t))||l.offset--}for(var a=0;a<i;a++)l=e(r[a]);return l}(s)}function Yo(i,e){var a=e.node,s=e.offset,l=0,c=!1;return function e(t){var n=d.nativeMethods.nodeChildNodesGetter.call(t),o=lt(n);if(c)return l;if(ot(a,t))return(Ro(i,t)||xo(i,t))&&l++,c=!0,l+s;if(ko(t))return l;!o&&t.nodeValue&&t.nodeValue.length?(!c&&xo(i,t)&&l++,l+=t.nodeValue.length):(!o&&de(t)&&"br"===ze(t)||!c&&(Ro(i,t)||xo(i,t)))&&l++;for(var r=0;r<o;r++)l=e(n[r]);return l}(i)}function Xo(e){var t,n,o,r,i,a=fe(e)?e:Ao(e,!0);if(!a||(t=a,o=fe(n=e)?n:Mo(n,!1),r=t===o,i=t.nodeValue===String.fromCharCode(10),r&&i&&function(e,t){for(var n=["pre","pre-wrap","pre-line"];e!==t;)if(e=d.nativeMethods.nodeParentNodeGetter.call(e),-1<q(n,vn(e,"white-space")))return 1}(t,n)))return 0;var s=ne(e).createRange();return s.selectNodeContents(a),Yo(e,{node:a,offset:s.endOffset})}var Qo=Object.freeze({__proto__:null,getFirstVisibleTextNode:Oo,getLastTextNode:Ao,getFirstNonWhitespaceSymbolIndex:Fo,getLastNonWhitespaceSymbolIndex:Lo,isInvisibleTextNode:Vo,findContentEditableParent:Do,getNearestCommonAncestor:Uo,getSelection:function(e,t,n){return{startPos:qo(e,t,n),endPos:Go(e,t,n)}},getSelectionStartPosition:jo,getSelectionEndPosition:zo,calculateNodeAndOffsetByPosition:Ko,calculatePositionByNodeAndOffset:Yo,getElementBySelection:function(e){var t=Uo(e.anchorNode,e.focusNode);return fe(t)?t.parentElement:t},getFirstVisiblePosition:function(e){var t=fe(e)?e:Oo(e),n=ne(e).createRange();return t?(n.selectNodeContents(t),Yo(e,{node:t,offset:n.startOffset})):0},getLastVisiblePosition:Xo,getContentEditableValue:function(e){return k(function e(t){var n=[],o=d.nativeMethods.nodeChildNodesGetter.call(t),r=lt(o);ko(t)||r||!fe(t)||n.push(t);for(var i=0;i<r;i++)n=n.concat(e(o[i]));return n}(e),function(e){return e.nodeValue}).join("")}}),$o=f.utils.browser,Zo=f.nativeMethods,er=f.eventSandbox.selection,tr="backward",nr="forward",or="none",rr=or,ir=0,ar=0,sr=0,lr=0,cr=0,ur=0;function dr(e,t,n,o){var r,i,a,s=null,l=null,c=!1;void 0!==t&&void 0!==n&&n<t&&(a=t,t=n,n=a,c=!0),void 0===t&&(l={node:(r=Oo(e))||e,offset:r&&r.nodeValue?Fo(r.nodeValue):0}),void 0===n&&(s={node:(i=Ao(e,!0))||e,offset:i&&i.nodeValue?Lo(i.nodeValue):0}),l=l||Ko(e,t),s=s||Ko(e,n),l.node&&s.node&&(c?Er(s,l,o):Er(l,s,o))}function fr(e){var t=e?ne(e):vi,n=t.getSelection(),o=null,r=!1;return n&&(n.isCollapsed||((o=t.createRange()).setStart(n.anchorNode,n.anchorOffset),o.setEnd(n.focusNode,n.focusOffset),r=o.collapsed,o.detach())),r}function hr(e,t,n){var o=Yo(e,t);return Yo(e,n)<o}function pr(e){return We(e)?vr(e)?jo(e,gr(e),fr(e)):0:er.getSelection(e).start}function mr(e){return We(e)?vr(e)?zo(e,gr(e),fr(e)):0:er.getSelection(e).end}function gr(e){var t=ne(e);return t?t.getSelection():Ei.getSelection()}function Er(e,t,n){var o=e.node,r=t.node,i=o.nodeValue?o.length:0,a=r.nodeValue?r.length:0,s=e.offset,l=t.offset;de(o)&&s||(s=Math.min(i,e.offset)),de(r)&&l||(l=Math.min(a,t.offset));var c=Do(o),u=hr(c,e,t),d=gr(c),f=ne(c).createRange();er.wrapSetterSelection(c,function(){var e;d.removeAllRanges(),u?$o.isIE?(f.setStart(r,l),f.setEnd(o,s),d.addRange(f)):(f.setStart(o,s),f.setEnd(o,s),d.addRange(f),e=function(e,t){try{d.extend(e,t)}catch(e){return!1}return!0},($o.isSafari||$o.isChrome&&$o.version<58)&&Vo(r)?e(r,Math.min(l,1))||e(r,0):e(r,l)):(f.setStart(o,s),f.setEnd(r,l),d.addRange(f))},n,!0)}function vr(e){var t=gr(e);return!(!t.anchorNode||!t.focusNode)&&tt(e,t.anchorNode)&&tt(e,t.focusNode)}$o.isIE&&_t(vi,"selectionchange",function(){var e=null,t=null,n=null;try{if(this.selection)t=this.selection.createRange();else{if(!(e=Zo.documentActiveElementGetter.call(this))||!Le(e))return void(rr=or);var o,r=pr(e),i=mr(e);e.createTextRange?((t=e.createTextRange()).collapse(!0),t.moveStart("character",r),t.moveEnd("character",i-r)):vi.createRange&&(t=vi.createRange(),o=f.nativeMethods.nodeFirstChildGetter.call(e),t.setStart(o,r),t.setEnd(o,i),n=t.getBoundingClientRect())}}catch(e){return void(rr=or)}var a=n?Math.ceil(n.left):t.offsetLeft,s=n?Math.ceil(n.top):t.offsetTop,l=n?Math.ceil(n.height):t.boundingHeight,c=n?Math.ceil(n.width):t.boundingWidth,u=t.htmlText?t.htmlText.length:0;!function(e,t,n,o,r){if(r)switch(rr){case or:t===ur&&(e===lr||sr<n)?rr=nr:(e<lr||t<ur)&&(rr=tr);break;case nr:if(e===lr&&t===ur||e<lr&&sr<n||t===ur&&n===sr&&cr<r&&e+o!==ir)break;(e<lr||t<ur)&&(rr=tr);break;case tr:if((e<lr||t<ur)&&cr<r)break;t===ar&&(ir<=e||sr<n)&&(rr=nr)}else ir=e,ar=t,rr=or;sr=n,lr=e,cr=r,ur=t}(a,s,l,c,n?t.toString().length:u)},!0);var yr,br,Cr=Object.freeze({__proto__:null,hasInverseSelectionContentEditable:fr,isInverseSelectionContentEditable:hr,getSelectionStart:pr,getSelectionEnd:mr,hasInverseSelection:function(e){return We(e)?fr(e):(er.getSelection(e).direction||rr)===tr},getSelectionByElement:gr,select:function(e,t,n){var o,r,i,a;We(e)?dr(e,t,n,!0):(o=t||0,i=!1,a=null,(r=void 0===n?ht(e).length:n)<o&&(a=o,o=r,r=a,i=!0),er.setSelection(e,o,r,i?tr:nr),rr=t===n?or:i?tr:nr)},selectByNodesAndOffsets:Er,deleteSelectionContents:function(e,t){var n,o,r,i,a,s,l,c,u,d,f,h,p=pr(e),m=mr(e);t&&dr(e),p!==m&&(n=gr(e),o=n.anchorNode,r=n.focusNode,i=n.anchorOffset,a=n.focusOffset,s=Fo(o.nodeValue),l=Lo(o.nodeValue),c=Fo(r.nodeValue),u=Lo(r.nodeValue),f=d=null,fe(o)&&(i<s&&0!==i?d=0:i!==o.nodeValue.length&&(Vo(o)&&0!==i||l<i)&&(d=o.nodeValue.length)),fe(r)&&(a<c&&0!==a?f=0:a!==r.nodeValue.length&&(Vo(r)&&0!==a||u<a)&&(f=r.nodeValue.length)),($o.isWebKit||$o.isIE&&11<$o.version)&&(null!==d&&(o.nodeValue=0===d?o.nodeValue.substring(s):o.nodeValue.substring(0,l)),null!==f&&(r.nodeValue=0===f?r.nodeValue.substring(c):r.nodeValue.substring(0,u))),null===d&&null===f||Er({node:o,offset:d=null!==d?0===d?d:o.nodeValue.length:i},{node:r,offset:f=null!==f?0===f?f:r.nodeValue.length:a}),function(e){var t=gr(e),n=t.rangeCount;if(n)for(var o=0;o<n;o++)t.getRangeAt(o).deleteContents()}(e),(h=gr(e)).rangeCount&&!h.getRangeAt(0).collapsed&&h.getRangeAt(0).collapse(!0))},setCursorToLastVisiblePosition:function(e){var t=Xo(e);dr(e,t,t)},hasElementContainsSelection:vr}),Sr=f.Promise,wr=f.nativeMethods,Tr={cannotCreateMultipleLiveModeRunners:"E1000",cannotRunLiveModeRunnerMultipleTimes:"E1001",browserDisconnected:"E1002",cannotRunAgainstDisconnectedBrowsers:"E1003",cannotEstablishBrowserConnection:"E1004",cannotFindBrowser:"E1005",browserProviderNotFound:"E1006",browserNotSet:"E1007",testFilesNotFound:"E1008",noTestsToRun:"E1009",cannotFindReporterForAlias:"E1010",multipleSameStreamReporters:"E1011",optionValueIsNotValidRegExp:"E1012",optionValueIsNotValidKeyValue:"E1013",invalidSpeedValue:"E1014",invalidConcurrencyFactor:"E1015",cannotDivideRemotesCountByConcurrency:"E1016",portsOptionRequiresTwoNumbers:"E1017",portIsNotFree:"E1018",invalidHostname:"E1019",cannotFindSpecifiedTestSource:"E1020",clientFunctionCodeIsNotAFunction:"E1021",selectorInitializedWithWrongType:"E1022",clientFunctionCannotResolveTestRun:"E1023",regeneratorInClientFunctionCode:"E1024",invalidClientFunctionTestRunBinding:"E1025",invalidValueType:"E1026",unsupportedUrlProtocol:"E1027",testControllerProxyCannotResolveTestRun:"E1028",timeLimitedPromiseTimeoutExpired:"E1029",noTestsToRunDueFiltering:"E1030",cannotSetVideoOptionsWithoutBaseVideoPathSpecified:"E1031",multipleAPIMethodCallForbidden:"E1032",invalidReporterOutput:"E1033",cannotReadSSLCertFile:"E1034",cannotPrepareTestsDueToError:"E1035",cannotParseRawFile:"E1036",testedAppFailedWithError:"E1037",unableToOpenBrowser:"E1038",requestHookConfigureAPIError:"E1039",forbiddenCharatersInScreenshotPath:"E1040",cannotFindFFMPEG:"E1041",compositeArgumentsError:"E1042",cannotFindTypescriptConfigurationFile:"E1043",clientScriptInitializerIsNotSpecified:"E1044",clientScriptBasePathIsNotSpecified:"E1045",clientScriptInitializerMultipleContentSources:"E1046",cannotLoadClientScriptFromPath:"E1047",clientScriptModuleEntryPointPathCalculationError:"E1048",methodIsNotAvailableForAnIPCHost:"E1049",tooLargeIPCPayload:"E1050",malformedIPCMessage:"E1051",unexpectedIPCHeadPacket:"E1052",unexpectedIPCBodyPacket:"E1053",unexpectedIPCTailPacket:"E1054",cannotRunLocalNonHeadlessBrowserWithoutDisplay:"E1057",uncaughtErrorInReporter:"E1058",roleInitializedWithRelativeUrl:"E1059",typeScriptCompilerLoadingError:"E1060",cannotCustomizeSpecifiedCompilers:"E1061",cannotEnableRetryTestPagesOption:"E1062",browserConnectionError:"E1063",testRunRequestInDisconnectedBrowser:"E1064",invalidQuarantineOption:"E1065",invalidQuarantineParametersRatio:"E1066",invalidAttemptLimitValue:"E1067",invalidSuccessThresholdValue:"E1068",cannotSetConcurrencyWithCDPPort:"E1069",cannotFindTestcafeConfigurationFile:"E1070",dashboardTokenInJSON:"E1071",requestUrlInvalidValueError:"E1072",requestRuntimeError:"E1073",requestCannotResolveTestRun:"E1074",relativeBaseUrl:"E1075",invalidSkipJsErrorsOptionsObjectProperty:"E1076",invalidSkipJsErrorsCallbackWithOptionsProperty:"E1077",invalidCommandInJsonCompiler:"E1078",invalidCustomActionsOptionType:"E1079",invalidCustomActionType:"E1080",cannotImportESMInCommonsJS:"E1081",setNativeAutomationForUnsupportedBrowsers:"E1082"};(br=yr=yr||{}).TooHighConcurrencyFactor="TooHighConcurrencyFactor",br.UseBrowserInitOption="UseBrowserInitOption",br.RestErrorCauses="RestErrorCauses";var _r,Ir,Nr,Pr,Rr,xr=yr,Mr=", ",Or='"';function Ar(e,t){return"".concat(t).concat(e).concat(t)}function Fr(e,t,n){void 0===t&&(t=Mr),void 0===n&&(n=Or);var o=y([],e,!0);if(-1<t.indexOf("\n"))return o.map(function(e){return Ar(e,n)}).join(t);if(1===o.length)return Ar(o[0],n);if(2===o.length){var r=e[0],i=e[1];return"".concat(Ar(r,n)," and ").concat(Ar(i,n))}var a=o.pop(),s=o.map(function(e){return Ar(e,n)}).join(t);return"".concat(s,", and ").concat(Ar(a,n))}(Ir=_r=_r||{}).message="message",Ir.stack="stack",Ir.pageUrl="pageUrl",(Pr=Nr=Nr||{}).fn="fn",Pr.dependencies="dependencies";var Lr,Vr="https://testcafe.io/documentation/402639/reference/command-line-interface#file-pathglob-pattern",Wr="https://testcafe.io/documentation/402638/reference/configuration-file#filter",kr="https://testcafe.io/documentation/402828/guides/concepts/browsers#test-in-headless-mode",Hr="https://testcafe.io/documentation/404150/guides/advanced-guides/custom-test-actions",Dr=((Rr={})[Tr.cannotCreateMultipleLiveModeRunners]="Cannot launch multiple live mode instances of the TestCafe test runner.",Rr[Tr.cannotRunLiveModeRunnerMultipleTimes]="Cannot launch the same live mode instance of the TestCafe test runner multiple times.",Rr[Tr.browserDisconnected]="The {userAgent} browser disconnected. If you did not close the browser yourself, browser performance or network issues may be at fault.",Rr[Tr.cannotRunAgainstDisconnectedBrowsers]="The following browsers disconnected: {userAgents}. Cannot run further tests.",Rr[Tr.testRunRequestInDisconnectedBrowser]='"{browser}" disconnected during test execution.',Rr[Tr.cannotEstablishBrowserConnection]="Cannot establish one or more browser connections.",Rr[Tr.cannotFindBrowser]='Cannot find the browser. "{browser}" is neither a known browser alias, nor a path to an executable file.',Rr[Tr.browserProviderNotFound]='Cannot find the "{providerName}" browser provider.',Rr[Tr.browserNotSet]="You have not specified a browser.",Rr[Tr.testFilesNotFound]='Could not find test files at the following location: "{cwd}".\nCheck patterns for errors:\n\n{sourceList}\n\nor launch TestCafe from a different directory.\n'+"For more information on how to specify test locations, see ".concat(Vr,"."),Rr[Tr.noTestsToRun]="Source files do not contain valid 'fixture' and 'test' declarations.",Rr[Tr.noTestsToRunDueFiltering]="No tests match your filter.\n"+"See ".concat(Wr,"."),Rr[Tr.cannotFindReporterForAlias]='The "{name}" reporter does not exist. Check the reporter parameter for errors.',Rr[Tr.multipleSameStreamReporters]='Reporters cannot share output streams. The following reporters interfere with one another: "{reporters}".',Rr[Tr.optionValueIsNotValidRegExp]='The "{optionName}" option does not contain a valid regular expression.',Rr[Tr.optionValueIsNotValidKeyValue]='The "{optionName}" option does not contain a valid key-value pair.',Rr[Tr.invalidQuarantineOption]='The "{optionName}" option does not exist. Specify "attemptLimit" and "successThreshold" to configure quarantine mode.',Rr[Tr.invalidQuarantineParametersRatio]='The value of "attemptLimit" ({attemptLimit}) should be greater then the value of "successThreshold" ({successThreshold}).',Rr[Tr.invalidAttemptLimitValue]='The "{attemptLimit}" parameter only accepts values of {MIN_ATTEMPT_LIMIT} and up.',Rr[Tr.invalidSuccessThresholdValue]='The "{successThreshold}" parameter only accepts values of {MIN_SUCCESS_THRESHOLD} and up.',Rr[Tr.invalidSpeedValue]="Speed should be a number between 0.01 and 1.",Rr[Tr.invalidConcurrencyFactor]="The concurrency factor should be an integer greater than or equal to 1.",Rr[Tr.cannotDivideRemotesCountByConcurrency]="The number of remote browsers should be divisible by the concurrency factor.",Rr[Tr.cannotSetConcurrencyWithCDPPort]='The value of the "concurrency" option includes the CDP port.',Rr[Tr.portsOptionRequiresTwoNumbers]='The "--ports" argument accepts two values at a time.',Rr[Tr.portIsNotFree]="Port {portNum} is occupied by another process.",Rr[Tr.invalidHostname]='Cannot resolve hostname "{hostname}".',Rr[Tr.cannotFindSpecifiedTestSource]='Cannot find a test file at "{path}".',Rr[Tr.clientFunctionCodeIsNotAFunction]="Cannot initialize a ClientFunction because {#instantiationCallsiteName} is {type}, and not a function.",Rr[Tr.selectorInitializedWithWrongType]="Cannot initialize a Selector because {#instantiationCallsiteName} is {type}, and not one of the following: a CSS selector string, a Selector object, a node snapshot, a function, or a Promise returned by a Selector.",Rr[Tr.clientFunctionCannotResolveTestRun]="{#instantiationCallsiteName} cannot implicitly resolve the test run in context of which it should be executed. If you need to call {#instantiationCallsiteName} from the Node.js API callback, pass the test controller manually via {#instantiationCallsiteName}'s `.with({ boundTestRun: t })` method first. Note that you cannot execute {#instantiationCallsiteName} outside the test code.",Rr[Tr.requestCannotResolveTestRun]="'request' cannot implicitly resolve the test run in context of which it should be executed. Note that you cannot execute 'request' in the experimental debug mode.",Rr[Tr.regeneratorInClientFunctionCode]='{#instantiationCallsiteName} code, arguments or dependencies cannot contain generators or "async/await" syntax (use Promises instead).',Rr[Tr.invalidClientFunctionTestRunBinding]='Cannot resolve the "boundTestRun" option because its value is not a test controller.',Rr[Tr.invalidValueType]="{smthg} ({actual}) is not of expected type ({type}).",Rr[Tr.unsupportedUrlProtocol]='Invalid {what}: "{url}". TestCafe cannot execute the test because the {what} includes the {protocol} protocol. TestCafe supports the following protocols: http://, https:// and file://.',Rr[Tr.testControllerProxyCannotResolveTestRun]="Cannot implicitly resolve the test run in the context of which the test controller action should be executed. Use test function's 't' argument instead.",Rr[Tr.timeLimitedPromiseTimeoutExpired]="A Promise timed out.",Rr[Tr.cannotSetVideoOptionsWithoutBaseVideoPathSpecified]="You cannot manage advanced video parameters when the video recording capability is off. Specify the root storage folder for video content to enable video recording.",Rr[Tr.multipleAPIMethodCallForbidden]='You cannot call the "{methodName}" method more than once. Specify an array of parameters instead.',Rr[Tr.invalidReporterOutput]="Specify a file name or a writable stream as the reporter's output target.",Rr[Tr.cannotReadSSLCertFile]='Unable to read the file referenced by the "{option}" ssl option ("{path}"). Error details:\n\n{err}',Rr[Tr.cannotPrepareTestsDueToError]="Cannot prepare tests due to the following error:\n\n{errMessage}",Rr[Tr.cannotParseRawFile]='Cannot parse a raw test file at "{path}" due to the following error:\n\n{errMessage}',Rr[Tr.testedAppFailedWithError]="The web application failed with the following error:\n\n{errMessage}",Rr[Tr.unableToOpenBrowser]='Unable to open the "{alias}" browser due to the following error:\n\n{errMessage}',Rr[Tr.requestHookConfigureAPIError]="Attempt to configure a request hook resulted in the following error:\n\n{requestHookName}: {errMsg}",Rr[Tr.forbiddenCharatersInScreenshotPath]='There are forbidden characters in the "{screenshotPath}" {screenshotPathType}:\n {forbiddenCharsDescription}',Rr[Tr.cannotFindFFMPEG]="TestCafe cannot record videos because it cannot locate the FFmpeg executable. Try one of the following solutions:\n\n* add the path of the FFmpeg installation directory to the PATH environment variable,\n* specify the path of the FFmpeg executable in the FFMPEG_PATH environment variable or the ffmpegPath option,\n* install the @ffmpeg-installer/ffmpeg npm package.",Rr[Tr.cannotFindTypescriptConfigurationFile]='"{filePath}" is not a valid TypeScript configuration file.',Rr[Tr.clientScriptInitializerIsNotSpecified]="Initialize your client script with one of the following: a JavaScript script, a JavaScript file path, or the name of a JavaScript module.",Rr[Tr.clientScriptBasePathIsNotSpecified]="Specify the base path for the client script file.",Rr[Tr.clientScriptInitializerMultipleContentSources]="Client scripts can only have one initializer: JavaScript code, a JavaScript file path, or the name of a JavaScript module.",Rr[Tr.cannotLoadClientScriptFromPath]="Cannot load a client script from {path}.\n{errorMessage}",Rr[Tr.clientScriptModuleEntryPointPathCalculationError]="A client script tried to load a JavaScript module that TestCafe cannot locate:\n\n{errorMessage}.",Rr[Tr.methodIsNotAvailableForAnIPCHost]="This method cannot be called on a service host.",Rr[Tr.tooLargeIPCPayload]="The specified payload is too large to form an IPC packet.",Rr[Tr.malformedIPCMessage]="Cannot process a malformed IPC message.",Rr[Tr.unexpectedIPCHeadPacket]="Cannot create an IPC message due to an unexpected IPC head packet.",Rr[Tr.unexpectedIPCBodyPacket]="Cannot create an IPC message due to an unexpected IPC body packet.",Rr[Tr.unexpectedIPCTailPacket]="Cannot create an IPC message due to an unexpected IPC tail packet.",Rr[Tr.cannotRunLocalNonHeadlessBrowserWithoutDisplay]="Your Linux version does not have a graphic subsystem to run {browserAlias} with a GUI. You can launch the browser in headless mode. If you use a portable browser executable, specify the browser alias before the path instead of the 'path' prefix. "+"For more information, see ".concat(kr),Rr[Tr.uncaughtErrorInReporter]='The "{methodName}" method of the "{reporterName}" reporter produced an uncaught error. Error details:\n{originalError}',Rr[Tr.roleInitializedWithRelativeUrl]="You cannot specify relative login page URLs in the Role constructor. Use an absolute URL.",Rr[Tr.typeScriptCompilerLoadingError]="Cannot load the TypeScript compiler.\n{originErrorMessage}.",Rr[Tr.cannotCustomizeSpecifiedCompilers]="You cannot specify options for the {noncustomizableCompilerList} compiler{suffix}.",Rr[Tr.cannotEnableRetryTestPagesOption]="Cannot enable the 'retryTestPages' option. Apply one of the following two solutions:\n-- set 'localhost' as the value of the 'hostname' option\n-- run TestCafe over HTTPS\n",Rr[Tr.browserConnectionError]="{originErrorMessage}\n{numOfNotOpenedConnection} of {numOfAllConnections} browser connections have not been established:\n{listOfNotOpenedConnections}\n\nHints:\n{listOfHints}",Rr[xr.TooHighConcurrencyFactor]="The host machine may not be powerful enough to handle the specified concurrency factor ({concurrencyFactor}). Try to decrease the concurrency factor or allocate more computing resources to the host machine.",Rr[xr.UseBrowserInitOption]='Increase the value of the "browserInitTimeout" option if it is too low (currently: {browserInitTimeoutMsg}). This option determines how long TestCafe waits for browsers to be ready.',Rr[xr.RestErrorCauses]="The error can also be caused by network issues or remote device failure. Make sure that your network connection is stable and you can reach the remote device.",Rr[Tr.cannotFindTestcafeConfigurationFile]="Cannot locate a TestCafe configuration file at {filePath}. Either the file does not exist, or the path is invalid.",Rr[Tr.dashboardTokenInJSON]="Insecure token declaration: cannot declare a Dashboard token in a JSON configuration file. Use a JavaScript configuration file, or declare a Dashboard token with one of the following: the CLI, the Test Runner API, the TESTCAFE_DASHBOARD_TOKEN environment variable.",Rr[Tr.relativeBaseUrl]='The value of the baseUrl argument cannot be relative: "{baseUrl}"',Rr[Tr.requestUrlInvalidValueError]="Requested url isn't valid ({actualValue}).",Rr[Tr.requestRuntimeError]="The request was interrupted by an error:\n{message}",Rr[Tr.invalidSkipJsErrorsOptionsObjectProperty]='The "{optionName}" option does not exist. Use the following options to configure skipJsErrors: '.concat(Fr(Object.keys(_r)),"."),Rr[Tr.invalidSkipJsErrorsCallbackWithOptionsProperty]='The "{optionName}" option does not exist. Use the following options to configure skipJsErrors callback: '.concat(Fr(Object.keys(Nr)),"."),Rr[Tr.invalidCommandInJsonCompiler]='TestCafe terminated the test run. The "{path}" file contains an unknown Chrome User Flow action "{action}". Remove the action to continue. Refer to the following article for the definitive list of supported Chrome User Flow actions: https://testcafe.io/documentation/403998/guides/experimental-capabilities/chrome-replay-support#supported-replay-actions',Rr[Tr.invalidCustomActionsOptionType]="The value of the customActions option does not belong to type Object. Refer to the following article for custom action setup instructions: ".concat(Hr),Rr[Tr.invalidCustomActionType]='TestCafe cannot parse the "{actionName}" action, because the action definition is invalid. Format the definition in accordance with the custom actions guide: '.concat(Hr),Rr[Tr.cannotImportESMInCommonsJS]="Cannot import the {esModule} ECMAScript module from {targetFile}. Use a dynamic import() statement or enable the --esm CLI flag.",Rr[Tr.setNativeAutomationForUnsupportedBrowsers]='The "{browser}" do not support the Native Automation mode. Remove the "native automation" option to continue.',Rr[Tr.timeLimitedPromiseTimeoutExpired]),Ur=(g(Br,Lr=Error),Br);function Br(){var e=Lr.call(this,Dr)||this;return e.code=Tr.timeLimitedPromiseTimeoutExpired,e}function qr(e){var t=e.replace(/^\+/g,"plus").replace(/\+\+/g,"+plus").split("+");return k(t,function(e){return e.replace("plus","+")})}function Gr(e){var t=1===e.length||"space"===e?e:e.toLowerCase();return a.modifiersMap[t]&&(t=a.modifiersMap[t]),t}var jr,zr,Jr=f.utils.trim,Kr={run:"run",idle:"idle"};(zr=jr=jr||{}).ok="ok",zr.closing="closing";var Yr=jr,Xr="file://",Qr=vi.location.href,$r=vi.location.origin,Zr=$r+"/service-worker.js",ei=!1,ti=null,ni=eval;function oi(t){return new u(function(e){return setTimeout(e,t)})}function ri(e,r,t){var n=void 0===t?{}:t,o=n.method,i=void 0===o?"GET":o,a=n.data,s=void 0===a?null:a,l=n.parseResponse,c=void 0===l||l;return new u(function(t,n){var o=r();o.open(i,e,!0),o.onreadystatechange=function(){var e;4===o.readyState&&(200===o.status?((e=o.responseText||"")&&c&&(e=JSON.parse(o.responseText)),t(e)):n("disconnected"))},o.send(s)})}function ii(e){return Qr.toLowerCase()===e.toLowerCase()}function ai(){ei=!1}function si(e,t){ri(t.openFileProtocolUrl,t.createXHR,{method:"POST",data:JSON.stringify({url:e.url})})}function li(e,t){var n,o,r,i,a;ai(),void 0===(a=e.url)&&(a=""),0===a.indexOf(Xr)?si(e,t):(o=t,r=(n=e).url.indexOf("#"),i=-1!==r&&n.url.slice(0,r)===Qr.slice(0,r),vi.location=n.url,o.nativeAutomation&&i&&vi.location.reload())}function ci(e){return(e.cmd===Kr.run||e.cmd===Kr.idle)&&!ii(e.url)}function ui(e,r,t){var i=e.statusUrl,a=e.openFileProtocolUrl,n=void 0===t?{}:t,s=n.manualRedirect,l=n.nativeAutomation;return E(this,void 0,void 0,function(){var n,o;return v(this,function(e){switch(e.label){case 0:return[4,ri(i,r)];case 1:return n=e.sent(),(o=l?(t=n).cmd!==Kr.idle||ci(t):ci(n))&&!s&&li(n,{createXHR:r,openFileProtocolUrl:a,nativeAutomation:l}),[2,{command:n,redirecting:o}]}var t})})}var di=Object.freeze({__proto__:null,delay:oi,sendXHR:ri,startHeartbeat:function(e,t){function n(){ri(e,t).then(function(e){e.code!==Yr.closing||ii(e.url)||(ai(),vi.location=e.url)})}ti=Ei.setInterval(n,2e3),n()},stopHeartbeat:function(){Ei.clearInterval(ti)},startInitScriptExecution:function(e,t){ei=!0,function e(t,n){ei&&ri(t,n).then(function(e){return e.code?ri(t,n,{method:"POST",data:JSON.stringify(ni(e.code))}):null}).then(function(){Ei.setTimeout(function(){return e(t,n)},1e3)})}(e,t)},stopInitScriptExecution:ai,redirectUsingCdp:si,redirect:li,checkStatus:function(){for(var r,i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];return E(this,void 0,void 0,function(){var t,n,o;return v(this,function(e){switch(e.label){case 0:n=t=null,o=0,e.label=1;case 1:return o<5?[4,function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return E(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,ui.apply(void 0,n)];case 1:return[2,e.sent()];case 2:return t=e.sent(),console.error(t),[2,{error:t}];case 3:return[2]}})})}.apply(void 0,i)]:[3,5];case 2:return r=e.sent(),t=r.error,n=function(e,t){var n={};for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}(r,["error"]),t?[4,oi(1e3)]:[2,n];case 3:e.sent(),e.label=4;case 4:return o++,[3,1];case 5:throw t}})})},enableRetryingTestPages:function(){return E(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:if(!navigator.serviceWorker)return[2];e.label=1;case 1:return e.trys.push([1,4,,5]),[4,navigator.serviceWorker.register(Zr,{scope:$r})];case 2:return e.sent(),[4,navigator.serviceWorker.ready];case 3:return e.sent(),[3,5];case 4:return t=e.sent(),console.error(t),[3,5];case 5:return[2]}})})},getActiveWindowId:function(e,t){return ri(e,t)},setActiveWindowId:function(e,t,n){return ri(e,t,{method:"POST",data:JSON.stringify({windowId:n})})},closeWindow:function(e,t,n){return ri(e,t,{method:"POST",data:JSON.stringify({windowId:n})})},dispatchNativeAutomationEvent:function(n,o,r,i,a){return E(this,void 0,void 0,function(){var t;return v(this,function(e){switch(e.label){case 0:return[4,o.hide()];case 1:return e.sent(),t=JSON.stringify({type:i,options:a}),[4,ri(n,r,{method:"POST",data:t})];case 2:return e.sent(),[4,o.show()];case 3:return e.sent(),[2]}})})},dispatchNativeAutomationEventSequence:function(t,n,o,r){return E(this,void 0,void 0,function(){return v(this,function(e){switch(e.label){case 0:return[4,n.hide()];case 1:return e.sent(),[4,ri(t,o,{method:"POST",data:JSON.stringify(r)})];case 2:return e.sent(),[4,n.show()];case 3:return e.sent(),[2]}})})},parseSelector:function(e,t,n){return ri(e,t,{method:"POST",data:JSON.stringify({selector:n})})}}),fi={};fi.RequestBarrier=h,fi.ClientRequestEmitter=I,fi.ScriptExecutionBarrier=P,fi.ScriptExecutionEmitter=F,fi.pageUnloadBarrier=jt,fi.preventRealEvents=function(){xn.initElementListening(Ei,On),xn.addFirstInternalEventBeforeListener(Ei,On,Fn),Xt.init()},fi.disableRealEventsPreventing=function(){xn.removeInternalEventBeforeListener(Ei,On,Fn)},fi.scrollController=Xt,fi.ScrollAutomation=Co,fi.selectController=Jn,fi.serviceUtils=Jt,fi.domUtils=mt,fi.contentEditable=Qo,fi.positionUtils=mo,fi.styleUtils=Pn,fi.scrollUtils=Bn,fi.eventUtils=xt,fi.arrayUtils=Q,fi.promiseUtils=Eo,fi.textSelection=Cr,fi.waitFor=function(i,a,s){return new Sr(function(e,t){var n,o,r=i();r?e(r):(n=wr.setInterval.call(Ei,function(){(r=i())&&(wr.clearInterval.call(Ei,n),wr.clearTimeout.call(Ei,o),e(r))},a),o=wr.setTimeout.call(Ei,function(){wr.clearInterval.call(Ei,n),t()},s))})},fi.delay=c,fi.getTimeLimitedPromise=function(e,t){return d.Promise.race([e,c(t).then(function(){return d.Promise.reject(new Ur)})])},fi.noop=function(){},fi.getKeyArray=qr,fi.getSanitizedKey=Gr,fi.parseKeySequence=function(e){if("string"!=typeof e)return{error:!0};var t=(e=Jr(e).replace(/\s+/g," ")).length,n=e.charAt(t-1),o=e.charAt(t-2);1<t&&"+"===n&&!/[+ ]/.test(o)&&(e=e.substring(0,e.length-1));var r=e.split(" ");return{combinations:r,error:G(r,function(e){var t=qr(e);return G(t,function(e){var t=1===e.length||"space"===e,n=Gr(e),o=a.modifiers[n],r=a.specialKeys[n];return!(t||o||r)})}),keys:e}},fi.sendRequestToFrame=bo,fi.KEY_MAPS=a,fi.browser=di,fi.stringifyElement=Zn,fi.selectorTextFilter=function o(e,r,i,a){function t(e){for(var t=e.childNodes.length,n=0;n<t;n++)if(o(e.childNodes[n],r,i,a))return!0;return!1}function n(e){return a instanceof RegExp?a.test(e):a===e.trim()}if(1===e.nodeType)return n(e.innerText||e.textContent);if(9!==e.nodeType)return 11===e.nodeType?t(e):n(e.textContent);var s=e.querySelector("head"),l=e.querySelector("body");return t(s)||t(l)},fi.selectorAttributeFilter=function(e,t,n,o,r){if(1!==e.nodeType)return!1;function i(e,t){return"string"==typeof t?t===e:t.test(e)}for(var a,s=e.attributes,l=0;l<s.length;l++)if(i((a=s[l]).nodeName,o)&&(!r||i(a.nodeValue,r)))return!0;return!1},fi.TEST_RUN_ERRORS={uncaughtErrorOnPage:"E1",uncaughtErrorInTestCode:"E2",uncaughtNonErrorObjectInTestCode:"E3",uncaughtErrorInClientFunctionCode:"E4",uncaughtErrorInCustomDOMPropertyCode:"E5",unhandledPromiseRejection:"E6",uncaughtException:"E7",missingAwaitError:"E8",actionIntegerOptionError:"E9",actionPositiveIntegerOptionError:"E10",actionBooleanOptionError:"E11",actionSpeedOptionError:"E12",actionOptionsTypeError:"E14",actionBooleanArgumentError:"E15",actionStringArgumentError:"E16",actionNullableStringArgumentError:"E17",actionStringOrStringArrayArgumentError:"E18",actionStringArrayElementError:"E19",actionIntegerArgumentError:"E20",actionRoleArgumentError:"E21",actionPositiveIntegerArgumentError:"E22",actionSelectorError:"E23",actionElementNotFoundError:"E24",actionElementIsInvisibleError:"E26",actionSelectorMatchesWrongNodeTypeError:"E27",actionAdditionalElementNotFoundError:"E28",actionAdditionalElementIsInvisibleError:"E29",actionAdditionalSelectorMatchesWrongNodeTypeError:"E30",actionElementNonEditableError:"E31",actionElementNotTextAreaError:"E32",actionElementNonContentEditableError:"E33",actionElementIsNotFileInputError:"E34",actionRootContainerNotFoundError:"E35",actionIncorrectKeysError:"E36",actionCannotFindFileToUploadError:"E37",actionUnsupportedDeviceTypeError:"E38",actionIframeIsNotLoadedError:"E39",actionElementNotIframeError:"E40",actionInvalidScrollTargetError:"E41",currentIframeIsNotLoadedError:"E42",currentIframeNotFoundError:"E43",currentIframeIsInvisibleError:"E44",nativeDialogNotHandledError:"E45",uncaughtErrorInNativeDialogHandler:"E46",setTestSpeedArgumentError:"E47",setNativeDialogHandlerCodeWrongTypeError:"E48",clientFunctionExecutionInterruptionError:"E49",domNodeClientFunctionResultError:"E50",invalidSelectorResultError:"E51",cannotObtainInfoForElementSpecifiedBySelectorError:"E52",externalAssertionLibraryError:"E53",pageLoadError:"E54",windowDimensionsOverflowError:"E55",forbiddenCharactersInScreenshotPathError:"E56",invalidElementScreenshotDimensionsError:"E57",roleSwitchInRoleInitializerError:"E58",assertionExecutableArgumentError:"E59",assertionWithoutMethodCallError:"E60",assertionUnawaitedPromiseError:"E61",requestHookNotImplementedError:"E62",requestHookUnhandledError:"E63",uncaughtErrorInCustomClientScriptCode:"E64",uncaughtErrorInCustomClientScriptCodeLoadedFromModule:"E65",uncaughtErrorInCustomScript:"E66",uncaughtTestCafeErrorInCustomScript:"E67",childWindowIsNotLoadedError:"E68",childWindowNotFoundError:"E69",cannotSwitchToWindowError:"E70",closeChildWindowError:"E71",childWindowClosedBeforeSwitchingError:"E72",cannotCloseWindowWithChildrenError:"E73",targetWindowNotFoundError:"E74",parentWindowNotFoundError:"E76",previousWindowNotFoundError:"E77",switchToWindowPredicateError:"E78",actionFunctionArgumentError:"E79",multipleWindowsModeIsDisabledError:"E80",multipleWindowsModeIsNotSupportedInRemoteBrowserError:"E81",cannotCloseWindowWithoutParent:"E82",cannotRestoreChildWindowError:"E83",executionTimeoutExceeded:"E84",actionRequiredCookieArguments:"E85",actionCookieArgumentError:"E86",actionCookieArgumentsError:"E87",actionUrlCookieArgumentError:"E88",actionUrlsCookieArgumentError:"E89",actionStringOptionError:"E90",actionDateOptionError:"E91",actionNumberOptionError:"E92",actionUrlOptionError:"E93",actionUrlSearchParamsOptionError:"E94",actionObjectOptionError:"E95",actionUrlArgumentError:"E96",actionStringOrRegexOptionError:"E97",actionSkipJsErrorsArgumentError:"E98",actionFunctionOptionError:"E99",actionInvalidObjectPropertyError:"E100",actionElementIsNotTargetError:"E101",multipleWindowsModeIsNotSupportedInNativeAutomationError:"E102"},fi.RUNTIME_ERRORS=Tr;var hi=f.nativeMethods,pi=f.EVENTS.evalIframeScript;hi.objectDefineProperty(Ei,"%testCafeCore%",{configurable:!0,value:fi}),f.on(pi,function(e){return gi(hi.contentWindowGetter.call(e.iframe))});var mi=f.eventSandbox.message;mi.on(mi.SERVICE_MSG_RECEIVED_EVENT,function(e){var t,n,o,r,i;e.message.cmd===Co.SCROLL_REQUEST_CMD&&(n=(t=e.message).offsetX,o=t.offsetY,r=t.maxScrollMargin,i=at(e.source),new Co(i,{offsetX:n,offsetY:o},r).run().then(function(){return mi.sendServiceMsg({cmd:Co.SCROLL_RESPONSE_CMD},e.source)}))})}(Ei["%hammerhead%"],Ei["%hammerhead%"].Promise)}(window);