@limrun/playwright-core 1.56.1-lim.1 → 1.61.0-lim.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 (378) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +5 -0
  3. package/ThirdPartyNotices.txt +7 -1496
  4. package/bin/install_webkit_wsl.ps1 +1 -3
  5. package/bin/reinstall_chrome_beta_linux.sh +1 -1
  6. package/bin/reinstall_chrome_beta_mac.sh +1 -1
  7. package/bin/reinstall_chrome_stable_linux.sh +1 -1
  8. package/bin/reinstall_chrome_stable_mac.sh +1 -1
  9. package/bin/reinstall_msedge_beta_linux.sh +1 -1
  10. package/bin/reinstall_msedge_beta_mac.sh +1 -1
  11. package/bin/reinstall_msedge_dev_linux.sh +1 -1
  12. package/bin/reinstall_msedge_dev_mac.sh +1 -1
  13. package/bin/reinstall_msedge_stable_linux.sh +1 -1
  14. package/bin/reinstall_msedge_stable_mac.sh +1 -1
  15. package/browsers.json +23 -22
  16. package/cli.js +4 -1
  17. package/index.js +2 -17
  18. package/lib/bootstrap.js +88 -0
  19. package/lib/coreBundle.js +73385 -0
  20. package/lib/entry/cliDaemon.js +5 -0
  21. package/lib/entry/dashboardApp.js +3 -0
  22. package/lib/entry/mcp.js +10 -0
  23. package/lib/entry/oopBrowserDownload.js +3 -0
  24. package/lib/{server/deviceDescriptors.js → package.js} +18 -7
  25. package/lib/server/deviceDescriptorsSource.json +1142 -182
  26. package/lib/server/electron/loader.js +99 -13
  27. package/lib/serverRegistry.js +7343 -0
  28. package/lib/serverRegistry.js.LICENSE +354 -0
  29. package/lib/tools/cli-client/channelSessions.js +141 -0
  30. package/lib/tools/cli-client/cli.js +6 -0
  31. package/lib/tools/cli-client/help.json +693 -0
  32. package/lib/tools/cli-client/minimist.js +128 -0
  33. package/lib/tools/cli-client/output.js +343 -0
  34. package/lib/tools/cli-client/program.js +404 -0
  35. package/lib/tools/cli-client/registry.js +176 -0
  36. package/lib/tools/cli-client/session.js +254 -0
  37. package/lib/tools/cli-client/skill/SKILL.md +404 -0
  38. package/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
  39. package/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
  40. package/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
  41. package/lib/tools/cli-client/skill/references/running-code.md +241 -0
  42. package/lib/tools/cli-client/skill/references/session-management.md +225 -0
  43. package/lib/tools/cli-client/skill/references/spec-driven-testing.md +305 -0
  44. package/lib/tools/cli-client/skill/references/storage-state.md +275 -0
  45. package/lib/tools/cli-client/skill/references/test-generation.md +134 -0
  46. package/lib/tools/cli-client/skill/references/tracing.md +139 -0
  47. package/lib/tools/cli-client/skill/references/video-recording.md +143 -0
  48. package/lib/tools/dashboard/appIcon.png +0 -0
  49. package/lib/tools/trace/SKILL.md +171 -0
  50. package/lib/{server/utils/profiler.js → tools/utils/extension.js} +42 -29
  51. package/lib/tools/utils/socketConnection.js +108 -0
  52. package/lib/utilsBundle.js +86695 -68
  53. package/lib/utilsBundle.js.LICENSE +2056 -0
  54. package/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  55. package/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  56. package/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  57. package/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  58. package/lib/vite/dashboard/assets/index-BY2S1tHT.css +1 -0
  59. package/lib/vite/dashboard/assets/index-C_5TMfeg.js +52 -0
  60. package/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  61. package/lib/vite/dashboard/index.html +29 -0
  62. package/lib/vite/dashboard/playwright-logo.svg +24 -0
  63. package/lib/vite/htmlReport/index.html +2 -70
  64. package/lib/vite/htmlReport/report.css +1 -0
  65. package/lib/vite/htmlReport/report.js +72 -0
  66. package/lib/vite/{traceViewer/codeMirrorModule.C3UTv-Ge.css → recorder/assets/codeMirrorModule-DYBRYzYX.css} +1 -1
  67. package/lib/vite/recorder/assets/codeMirrorModule-DeBYQozu.js +32 -0
  68. package/lib/vite/recorder/assets/index-4ZiSSCmn.css +1 -0
  69. package/lib/vite/recorder/assets/index-Bq-mQf8S.js +193 -0
  70. package/lib/vite/recorder/index.html +2 -2
  71. package/lib/vite/traceViewer/assets/codeMirrorModule-LEHpjmcn.js +32 -0
  72. package/lib/vite/traceViewer/assets/defaultSettingsView-BNmKHKpQ.js +264 -0
  73. package/lib/vite/traceViewer/assets/urlMatch-BYQrIQwR.js +1 -0
  74. package/lib/vite/{recorder/assets/codeMirrorModule-C3UTv-Ge.css → traceViewer/codeMirrorModule.DYBRYzYX.css} +1 -1
  75. package/lib/vite/traceViewer/defaultSettingsView.CjdS-WJx.css +1 -0
  76. package/lib/vite/traceViewer/index.CzXZzn5A.css +1 -0
  77. package/lib/vite/traceViewer/index.DEBl1tfz.js +2 -0
  78. package/lib/vite/traceViewer/index.html +7 -6
  79. package/lib/vite/traceViewer/manifest.webmanifest +16 -0
  80. package/lib/vite/traceViewer/snapshot.html +4 -15
  81. package/lib/vite/traceViewer/snapshot.v8KI4P3m.js +2 -0
  82. package/lib/vite/traceViewer/sw.bundle.js +5 -3
  83. package/lib/vite/traceViewer/uiMode.BZQ54Kgt.css +1 -0
  84. package/lib/vite/traceViewer/uiMode.Ut8wwJNp.js +6 -0
  85. package/lib/vite/traceViewer/uiMode.html +5 -4
  86. package/package.json +4 -12
  87. package/types/protocol.d.ts +2101 -602
  88. package/types/types.d.ts +6183 -4591
  89. package/lib/androidServerImpl.js +0 -65
  90. package/lib/browserServerImpl.js +0 -120
  91. package/lib/cli/driver.js +0 -97
  92. package/lib/cli/program.js +0 -633
  93. package/lib/cli/programWithTestStub.js +0 -74
  94. package/lib/client/accessibility.js +0 -49
  95. package/lib/client/android.js +0 -361
  96. package/lib/client/api.js +0 -137
  97. package/lib/client/artifact.js +0 -79
  98. package/lib/client/browser.js +0 -163
  99. package/lib/client/browserContext.js +0 -529
  100. package/lib/client/browserType.js +0 -184
  101. package/lib/client/cdpSession.js +0 -51
  102. package/lib/client/channelOwner.js +0 -194
  103. package/lib/client/clientHelper.js +0 -64
  104. package/lib/client/clientInstrumentation.js +0 -55
  105. package/lib/client/clientStackTrace.js +0 -69
  106. package/lib/client/clock.js +0 -68
  107. package/lib/client/connection.js +0 -314
  108. package/lib/client/consoleMessage.js +0 -54
  109. package/lib/client/coverage.js +0 -44
  110. package/lib/client/dialog.js +0 -56
  111. package/lib/client/download.js +0 -62
  112. package/lib/client/electron.js +0 -138
  113. package/lib/client/elementHandle.js +0 -281
  114. package/lib/client/errors.js +0 -77
  115. package/lib/client/eventEmitter.js +0 -314
  116. package/lib/client/events.js +0 -99
  117. package/lib/client/fetch.js +0 -369
  118. package/lib/client/fileChooser.js +0 -46
  119. package/lib/client/fileUtils.js +0 -34
  120. package/lib/client/frame.js +0 -408
  121. package/lib/client/harRouter.js +0 -87
  122. package/lib/client/input.js +0 -84
  123. package/lib/client/jsHandle.js +0 -109
  124. package/lib/client/jsonPipe.js +0 -39
  125. package/lib/client/localUtils.js +0 -60
  126. package/lib/client/locator.js +0 -366
  127. package/lib/client/network.js +0 -747
  128. package/lib/client/page.js +0 -721
  129. package/lib/client/platform.js +0 -74
  130. package/lib/client/playwright.js +0 -75
  131. package/lib/client/selectors.js +0 -55
  132. package/lib/client/stream.js +0 -39
  133. package/lib/client/timeoutSettings.js +0 -79
  134. package/lib/client/tracing.js +0 -117
  135. package/lib/client/types.js +0 -28
  136. package/lib/client/video.js +0 -59
  137. package/lib/client/waiter.js +0 -142
  138. package/lib/client/webError.js +0 -39
  139. package/lib/client/webSocket.js +0 -93
  140. package/lib/client/worker.js +0 -63
  141. package/lib/client/writableStream.js +0 -39
  142. package/lib/generated/bindingsControllerSource.js +0 -28
  143. package/lib/generated/clockSource.js +0 -28
  144. package/lib/generated/injectedScriptSource.js +0 -28
  145. package/lib/generated/pollingRecorderSource.js +0 -28
  146. package/lib/generated/storageScriptSource.js +0 -28
  147. package/lib/generated/utilityScriptSource.js +0 -28
  148. package/lib/generated/webSocketMockSource.js +0 -336
  149. package/lib/inProcessFactory.js +0 -62
  150. package/lib/inprocess.js +0 -3
  151. package/lib/outofprocess.js +0 -76
  152. package/lib/protocol/serializers.js +0 -192
  153. package/lib/protocol/validator.js +0 -2912
  154. package/lib/protocol/validatorPrimitives.js +0 -193
  155. package/lib/remote/playwrightConnection.js +0 -129
  156. package/lib/remote/playwrightServer.js +0 -335
  157. package/lib/server/accessibility.js +0 -69
  158. package/lib/server/android/android.js +0 -465
  159. package/lib/server/android/backendAdb.js +0 -177
  160. package/lib/server/artifact.js +0 -127
  161. package/lib/server/bidi/bidiBrowser.js +0 -490
  162. package/lib/server/bidi/bidiChromium.js +0 -153
  163. package/lib/server/bidi/bidiConnection.js +0 -212
  164. package/lib/server/bidi/bidiExecutionContext.js +0 -221
  165. package/lib/server/bidi/bidiFirefox.js +0 -130
  166. package/lib/server/bidi/bidiInput.js +0 -146
  167. package/lib/server/bidi/bidiNetworkManager.js +0 -383
  168. package/lib/server/bidi/bidiOverCdp.js +0 -102
  169. package/lib/server/bidi/bidiPage.js +0 -552
  170. package/lib/server/bidi/bidiPdf.js +0 -106
  171. package/lib/server/bidi/third_party/bidiCommands.d.js +0 -22
  172. package/lib/server/bidi/third_party/bidiDeserializer.js +0 -98
  173. package/lib/server/bidi/third_party/bidiKeyboard.js +0 -256
  174. package/lib/server/bidi/third_party/bidiProtocol.js +0 -24
  175. package/lib/server/bidi/third_party/bidiProtocolCore.js +0 -179
  176. package/lib/server/bidi/third_party/bidiProtocolPermissions.js +0 -42
  177. package/lib/server/bidi/third_party/bidiSerializer.js +0 -148
  178. package/lib/server/bidi/third_party/firefoxPrefs.js +0 -259
  179. package/lib/server/browser.js +0 -149
  180. package/lib/server/browserContext.js +0 -696
  181. package/lib/server/browserType.js +0 -328
  182. package/lib/server/callLog.js +0 -82
  183. package/lib/server/chromium/chromium.js +0 -391
  184. package/lib/server/chromium/chromiumSwitches.js +0 -95
  185. package/lib/server/chromium/crAccessibility.js +0 -263
  186. package/lib/server/chromium/crBrowser.js +0 -502
  187. package/lib/server/chromium/crConnection.js +0 -202
  188. package/lib/server/chromium/crCoverage.js +0 -235
  189. package/lib/server/chromium/crDevTools.js +0 -113
  190. package/lib/server/chromium/crDragDrop.js +0 -131
  191. package/lib/server/chromium/crExecutionContext.js +0 -146
  192. package/lib/server/chromium/crInput.js +0 -187
  193. package/lib/server/chromium/crNetworkManager.js +0 -666
  194. package/lib/server/chromium/crPage.js +0 -1069
  195. package/lib/server/chromium/crPdf.js +0 -121
  196. package/lib/server/chromium/crProtocolHelper.js +0 -145
  197. package/lib/server/chromium/crServiceWorker.js +0 -123
  198. package/lib/server/chromium/defaultFontFamilies.js +0 -162
  199. package/lib/server/chromium/protocol.d.js +0 -16
  200. package/lib/server/chromium/videoRecorder.js +0 -113
  201. package/lib/server/clock.js +0 -149
  202. package/lib/server/codegen/csharp.js +0 -327
  203. package/lib/server/codegen/java.js +0 -274
  204. package/lib/server/codegen/javascript.js +0 -270
  205. package/lib/server/codegen/jsonl.js +0 -52
  206. package/lib/server/codegen/language.js +0 -132
  207. package/lib/server/codegen/languages.js +0 -68
  208. package/lib/server/codegen/python.js +0 -279
  209. package/lib/server/codegen/types.js +0 -16
  210. package/lib/server/console.js +0 -53
  211. package/lib/server/cookieStore.js +0 -206
  212. package/lib/server/debugController.js +0 -191
  213. package/lib/server/debugger.js +0 -119
  214. package/lib/server/dialog.js +0 -116
  215. package/lib/server/dispatchers/androidDispatcher.js +0 -325
  216. package/lib/server/dispatchers/artifactDispatcher.js +0 -118
  217. package/lib/server/dispatchers/browserContextDispatcher.js +0 -364
  218. package/lib/server/dispatchers/browserDispatcher.js +0 -118
  219. package/lib/server/dispatchers/browserTypeDispatcher.js +0 -64
  220. package/lib/server/dispatchers/cdpSessionDispatcher.js +0 -44
  221. package/lib/server/dispatchers/debugControllerDispatcher.js +0 -78
  222. package/lib/server/dispatchers/dialogDispatcher.js +0 -47
  223. package/lib/server/dispatchers/dispatcher.js +0 -371
  224. package/lib/server/dispatchers/electronDispatcher.js +0 -89
  225. package/lib/server/dispatchers/elementHandlerDispatcher.js +0 -181
  226. package/lib/server/dispatchers/frameDispatcher.js +0 -227
  227. package/lib/server/dispatchers/jsHandleDispatcher.js +0 -85
  228. package/lib/server/dispatchers/jsonPipeDispatcher.js +0 -58
  229. package/lib/server/dispatchers/localUtilsDispatcher.js +0 -149
  230. package/lib/server/dispatchers/networkDispatchers.js +0 -213
  231. package/lib/server/dispatchers/pageDispatcher.js +0 -401
  232. package/lib/server/dispatchers/playwrightDispatcher.js +0 -112
  233. package/lib/server/dispatchers/streamDispatcher.js +0 -67
  234. package/lib/server/dispatchers/tracingDispatcher.js +0 -68
  235. package/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -165
  236. package/lib/server/dispatchers/writableStreamDispatcher.js +0 -79
  237. package/lib/server/dom.js +0 -806
  238. package/lib/server/download.js +0 -70
  239. package/lib/server/electron/electron.js +0 -270
  240. package/lib/server/errors.js +0 -69
  241. package/lib/server/fetch.js +0 -621
  242. package/lib/server/fileChooser.js +0 -43
  243. package/lib/server/fileUploadUtils.js +0 -84
  244. package/lib/server/firefox/ffAccessibility.js +0 -238
  245. package/lib/server/firefox/ffBrowser.js +0 -428
  246. package/lib/server/firefox/ffConnection.js +0 -147
  247. package/lib/server/firefox/ffExecutionContext.js +0 -150
  248. package/lib/server/firefox/ffInput.js +0 -159
  249. package/lib/server/firefox/ffNetworkManager.js +0 -256
  250. package/lib/server/firefox/ffPage.js +0 -503
  251. package/lib/server/firefox/firefox.js +0 -105
  252. package/lib/server/firefox/protocol.d.js +0 -16
  253. package/lib/server/formData.js +0 -147
  254. package/lib/server/frameSelectors.js +0 -156
  255. package/lib/server/frames.js +0 -1448
  256. package/lib/server/har/harRecorder.js +0 -147
  257. package/lib/server/har/harTracer.js +0 -607
  258. package/lib/server/harBackend.js +0 -157
  259. package/lib/server/helper.js +0 -96
  260. package/lib/server/index.js +0 -58
  261. package/lib/server/input.js +0 -273
  262. package/lib/server/instrumentation.js +0 -69
  263. package/lib/server/javascript.js +0 -291
  264. package/lib/server/launchApp.js +0 -128
  265. package/lib/server/localUtils.js +0 -218
  266. package/lib/server/macEditingCommands.js +0 -143
  267. package/lib/server/network.js +0 -629
  268. package/lib/server/page.js +0 -870
  269. package/lib/server/pipeTransport.js +0 -89
  270. package/lib/server/playwright.js +0 -71
  271. package/lib/server/progress.js +0 -112
  272. package/lib/server/protocolError.js +0 -52
  273. package/lib/server/recorder/chat.js +0 -161
  274. package/lib/server/recorder/recorderApp.js +0 -387
  275. package/lib/server/recorder/recorderRunner.js +0 -138
  276. package/lib/server/recorder/recorderSignalProcessor.js +0 -83
  277. package/lib/server/recorder/recorderUtils.js +0 -157
  278. package/lib/server/recorder/throttledFile.js +0 -57
  279. package/lib/server/recorder.js +0 -498
  280. package/lib/server/registry/browserFetcher.js +0 -175
  281. package/lib/server/registry/dependencies.js +0 -371
  282. package/lib/server/registry/index.js +0 -1333
  283. package/lib/server/registry/nativeDeps.js +0 -1280
  284. package/lib/server/registry/oopDownloadBrowserMain.js +0 -120
  285. package/lib/server/screenshotter.js +0 -333
  286. package/lib/server/selectors.js +0 -112
  287. package/lib/server/socksClientCertificatesInterceptor.js +0 -383
  288. package/lib/server/socksInterceptor.js +0 -95
  289. package/lib/server/trace/recorder/snapshotter.js +0 -147
  290. package/lib/server/trace/recorder/snapshotterInjected.js +0 -541
  291. package/lib/server/trace/recorder/tracing.js +0 -602
  292. package/lib/server/trace/test/inMemorySnapshotter.js +0 -87
  293. package/lib/server/trace/viewer/traceViewer.js +0 -240
  294. package/lib/server/transport.js +0 -181
  295. package/lib/server/types.js +0 -28
  296. package/lib/server/usKeyboardLayout.js +0 -145
  297. package/lib/server/utils/ascii.js +0 -44
  298. package/lib/server/utils/comparators.js +0 -161
  299. package/lib/server/utils/crypto.js +0 -216
  300. package/lib/server/utils/debug.js +0 -42
  301. package/lib/server/utils/debugLogger.js +0 -122
  302. package/lib/server/utils/env.js +0 -73
  303. package/lib/server/utils/eventsHelper.js +0 -39
  304. package/lib/server/utils/expectUtils.js +0 -38
  305. package/lib/server/utils/fileUtils.js +0 -191
  306. package/lib/server/utils/happyEyeballs.js +0 -207
  307. package/lib/server/utils/hostPlatform.js +0 -111
  308. package/lib/server/utils/httpServer.js +0 -218
  309. package/lib/server/utils/image_tools/colorUtils.js +0 -89
  310. package/lib/server/utils/image_tools/compare.js +0 -109
  311. package/lib/server/utils/image_tools/imageChannel.js +0 -78
  312. package/lib/server/utils/image_tools/stats.js +0 -102
  313. package/lib/server/utils/linuxUtils.js +0 -71
  314. package/lib/server/utils/network.js +0 -227
  315. package/lib/server/utils/nodePlatform.js +0 -148
  316. package/lib/server/utils/pipeTransport.js +0 -84
  317. package/lib/server/utils/processLauncher.js +0 -241
  318. package/lib/server/utils/socksProxy.js +0 -511
  319. package/lib/server/utils/spawnAsync.js +0 -41
  320. package/lib/server/utils/task.js +0 -51
  321. package/lib/server/utils/userAgent.js +0 -98
  322. package/lib/server/utils/wsServer.js +0 -121
  323. package/lib/server/utils/zipFile.js +0 -74
  324. package/lib/server/utils/zones.js +0 -57
  325. package/lib/server/webkit/protocol.d.js +0 -16
  326. package/lib/server/webkit/webkit.js +0 -119
  327. package/lib/server/webkit/wkAccessibility.js +0 -237
  328. package/lib/server/webkit/wkBrowser.js +0 -339
  329. package/lib/server/webkit/wkConnection.js +0 -149
  330. package/lib/server/webkit/wkExecutionContext.js +0 -154
  331. package/lib/server/webkit/wkInput.js +0 -181
  332. package/lib/server/webkit/wkInterceptableRequest.js +0 -169
  333. package/lib/server/webkit/wkPage.js +0 -1134
  334. package/lib/server/webkit/wkProvisionalPage.js +0 -83
  335. package/lib/server/webkit/wkWorkers.js +0 -104
  336. package/lib/server/webkit/wsl/webkit-wsl-transport-client.js +0 -74
  337. package/lib/server/webkit/wsl/webkit-wsl-transport-server.js +0 -113
  338. package/lib/third_party/pixelmatch.js +0 -255
  339. package/lib/utils/isomorphic/ariaSnapshot.js +0 -392
  340. package/lib/utils/isomorphic/assert.js +0 -31
  341. package/lib/utils/isomorphic/colors.js +0 -72
  342. package/lib/utils/isomorphic/cssParser.js +0 -245
  343. package/lib/utils/isomorphic/cssTokenizer.js +0 -1051
  344. package/lib/utils/isomorphic/headers.js +0 -53
  345. package/lib/utils/isomorphic/locatorGenerators.js +0 -673
  346. package/lib/utils/isomorphic/locatorParser.js +0 -176
  347. package/lib/utils/isomorphic/locatorUtils.js +0 -81
  348. package/lib/utils/isomorphic/manualPromise.js +0 -114
  349. package/lib/utils/isomorphic/mimeType.js +0 -459
  350. package/lib/utils/isomorphic/multimap.js +0 -80
  351. package/lib/utils/isomorphic/protocolFormatter.js +0 -78
  352. package/lib/utils/isomorphic/protocolMetainfo.js +0 -321
  353. package/lib/utils/isomorphic/rtti.js +0 -43
  354. package/lib/utils/isomorphic/selectorParser.js +0 -386
  355. package/lib/utils/isomorphic/semaphore.js +0 -54
  356. package/lib/utils/isomorphic/stackTrace.js +0 -158
  357. package/lib/utils/isomorphic/stringUtils.js +0 -155
  358. package/lib/utils/isomorphic/time.js +0 -49
  359. package/lib/utils/isomorphic/timeoutRunner.js +0 -66
  360. package/lib/utils/isomorphic/traceUtils.js +0 -58
  361. package/lib/utils/isomorphic/types.js +0 -16
  362. package/lib/utils/isomorphic/urlMatch.js +0 -176
  363. package/lib/utils/isomorphic/utilityScriptSerializers.js +0 -251
  364. package/lib/utils.js +0 -107
  365. package/lib/utilsBundleImpl/index.js +0 -218
  366. package/lib/vite/recorder/assets/codeMirrorModule-RJCXzfmE.js +0 -24
  367. package/lib/vite/recorder/assets/index-Ri0uHF7I.css +0 -1
  368. package/lib/vite/recorder/assets/index-Y-X2TGJv.js +0 -193
  369. package/lib/vite/traceViewer/assets/codeMirrorModule-eyVcHN77.js +0 -24
  370. package/lib/vite/traceViewer/assets/defaultSettingsView-w0zYjHsW.js +0 -265
  371. package/lib/vite/traceViewer/defaultSettingsView.TQ8_7ybu.css +0 -1
  372. package/lib/vite/traceViewer/index.Bx16ehp1.js +0 -2
  373. package/lib/vite/traceViewer/index.I8N9v4jT.css +0 -1
  374. package/lib/vite/traceViewer/uiMode.Btcz36p_.css +0 -1
  375. package/lib/vite/traceViewer/uiMode.DRQ310U5.js +0 -5
  376. package/lib/zipBundle.js +0 -34
  377. package/lib/zipBundleImpl.js +0 -5
  378. /package/lib/{utilsBundleImpl/xdg-open → xdg-open} +0 -0
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var webError_exports = {};
20
- __export(webError_exports, {
21
- WebError: () => WebError
22
- });
23
- module.exports = __toCommonJS(webError_exports);
24
- class WebError {
25
- constructor(page, error) {
26
- this._page = page;
27
- this._error = error;
28
- }
29
- page() {
30
- return this._page;
31
- }
32
- error() {
33
- return this._error;
34
- }
35
- }
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- WebError
39
- });
@@ -1,93 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var webSocket_exports = {};
20
- __export(webSocket_exports, {
21
- connectOverWebSocket: () => connectOverWebSocket
22
- });
23
- module.exports = __toCommonJS(webSocket_exports);
24
- var import_connection = require("./connection");
25
- async function connectOverWebSocket(parentConnection, params) {
26
- const localUtils = parentConnection.localUtils();
27
- const transport = localUtils ? new JsonPipeTransport(localUtils) : new WebSocketTransport();
28
- const connectHeaders = await transport.connect(params);
29
- const connection = new import_connection.Connection(parentConnection._platform, localUtils, parentConnection._instrumentation, connectHeaders);
30
- connection.markAsRemote();
31
- connection.on("close", () => transport.close());
32
- let closeError;
33
- const onTransportClosed = (reason) => {
34
- connection.close(reason || closeError);
35
- };
36
- transport.onClose((reason) => onTransportClosed(reason));
37
- connection.onmessage = (message) => transport.send(message).catch(() => onTransportClosed());
38
- transport.onMessage((message) => {
39
- try {
40
- connection.dispatch(message);
41
- } catch (e) {
42
- closeError = String(e);
43
- transport.close().catch(() => {
44
- });
45
- }
46
- });
47
- return connection;
48
- }
49
- class JsonPipeTransport {
50
- constructor(owner) {
51
- this._owner = owner;
52
- }
53
- async connect(params) {
54
- const { pipe, headers: connectHeaders } = await this._owner._channel.connect(params);
55
- this._pipe = pipe;
56
- return connectHeaders;
57
- }
58
- async send(message) {
59
- await this._pipe.send({ message });
60
- }
61
- onMessage(callback) {
62
- this._pipe.on("message", ({ message }) => callback(message));
63
- }
64
- onClose(callback) {
65
- this._pipe.on("closed", ({ reason }) => callback(reason));
66
- }
67
- async close() {
68
- await this._pipe.close().catch(() => {
69
- });
70
- }
71
- }
72
- class WebSocketTransport {
73
- async connect(params) {
74
- this._ws = new window.WebSocket(params.wsEndpoint);
75
- return [];
76
- }
77
- async send(message) {
78
- this._ws.send(JSON.stringify(message));
79
- }
80
- onMessage(callback) {
81
- this._ws.addEventListener("message", (event) => callback(JSON.parse(event.data)));
82
- }
83
- onClose(callback) {
84
- this._ws.addEventListener("close", () => callback());
85
- }
86
- async close() {
87
- this._ws.close();
88
- }
89
- }
90
- // Annotate the CommonJS export names for ESM import in node:
91
- 0 && (module.exports = {
92
- connectOverWebSocket
93
- });
@@ -1,63 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var worker_exports = {};
20
- __export(worker_exports, {
21
- Worker: () => Worker
22
- });
23
- module.exports = __toCommonJS(worker_exports);
24
- var import_channelOwner = require("./channelOwner");
25
- var import_errors = require("./errors");
26
- var import_events = require("./events");
27
- var import_jsHandle = require("./jsHandle");
28
- var import_manualPromise = require("../utils/isomorphic/manualPromise");
29
- class Worker extends import_channelOwner.ChannelOwner {
30
- constructor(parent, type, guid, initializer) {
31
- super(parent, type, guid, initializer);
32
- // Set for service workers.
33
- this._closedScope = new import_manualPromise.LongStandingScope();
34
- this._channel.on("close", () => {
35
- if (this._page)
36
- this._page._workers.delete(this);
37
- if (this._context)
38
- this._context._serviceWorkers.delete(this);
39
- this.emit(import_events.Events.Worker.Close, this);
40
- });
41
- this.once(import_events.Events.Worker.Close, () => this._closedScope.close(this._page?._closeErrorWithReason() || new import_errors.TargetClosedError()));
42
- }
43
- static from(worker) {
44
- return worker._object;
45
- }
46
- url() {
47
- return this._initializer.url;
48
- }
49
- async evaluate(pageFunction, arg) {
50
- (0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
51
- const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
52
- return (0, import_jsHandle.parseResult)(result.value);
53
- }
54
- async evaluateHandle(pageFunction, arg) {
55
- (0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
56
- const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
57
- return import_jsHandle.JSHandle.from(result.handle);
58
- }
59
- }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- Worker
63
- });
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var writableStream_exports = {};
20
- __export(writableStream_exports, {
21
- WritableStream: () => WritableStream
22
- });
23
- module.exports = __toCommonJS(writableStream_exports);
24
- var import_channelOwner = require("./channelOwner");
25
- class WritableStream extends import_channelOwner.ChannelOwner {
26
- static from(Stream) {
27
- return Stream._object;
28
- }
29
- constructor(parent, type, guid, initializer) {
30
- super(parent, type, guid, initializer);
31
- }
32
- stream() {
33
- return this._platform.streamWritable(this._channel);
34
- }
35
- }
36
- // Annotate the CommonJS export names for ESM import in node:
37
- 0 && (module.exports = {
38
- WritableStream
39
- });
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var bindingsControllerSource_exports = {};
20
- __export(bindingsControllerSource_exports, {
21
- source: () => source
22
- });
23
- module.exports = __toCommonJS(bindingsControllerSource_exports);
24
- const source = '\nvar __commonJS = obj => {\n let required = false;\n let result;\n return function __require() {\n if (!required) {\n required = true;\n let fn;\n for (const name in obj) { fn = obj[name]; break; }\n const module = { exports: {} };\n fn(module.exports, module);\n result = module.exports;\n }\n return result;\n }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/bindingsController.ts\nvar bindingsController_exports = {};\n__export(bindingsController_exports, {\n BindingsController: () => BindingsController\n});\nmodule.exports = __toCommonJS(bindingsController_exports);\n\n// packages/playwright-core/src/utils/isomorphic/utilityScriptSerializers.ts\nfunction isRegExp(obj) {\n try {\n return obj instanceof RegExp || Object.prototype.toString.call(obj) === "[object RegExp]";\n } catch (error) {\n return false;\n }\n}\nfunction isDate(obj) {\n try {\n return obj instanceof Date || Object.prototype.toString.call(obj) === "[object Date]";\n } catch (error) {\n return false;\n }\n}\nfunction isURL(obj) {\n try {\n return obj instanceof URL || Object.prototype.toString.call(obj) === "[object URL]";\n } catch (error) {\n return false;\n }\n}\nfunction isError(obj) {\n var _a;\n try {\n return obj instanceof Error || obj && ((_a = Object.getPrototypeOf(obj)) == null ? void 0 : _a.name) === "Error";\n } catch (error) {\n return false;\n }\n}\nfunction isTypedArray(obj, constructor) {\n try {\n return obj instanceof constructor || Object.prototype.toString.call(obj) === `[object ${constructor.name}]`;\n } catch (error) {\n return false;\n }\n}\nvar typedArrayConstructors = {\n i8: Int8Array,\n ui8: Uint8Array,\n ui8c: Uint8ClampedArray,\n i16: Int16Array,\n ui16: Uint16Array,\n i32: Int32Array,\n ui32: Uint32Array,\n // TODO: add Float16Array once it\'s in baseline\n f32: Float32Array,\n f64: Float64Array,\n bi64: BigInt64Array,\n bui64: BigUint64Array\n};\nfunction typedArrayToBase64(array) {\n if ("toBase64" in array)\n return array.toBase64();\n const binary = Array.from(new Uint8Array(array.buffer, array.byteOffset, array.byteLength)).map((b) => String.fromCharCode(b)).join("");\n return btoa(binary);\n}\nfunction serializeAsCallArgument(value, handleSerializer) {\n return serialize(value, handleSerializer, { visited: /* @__PURE__ */ new Map(), lastId: 0 });\n}\nfunction serialize(value, handleSerializer, visitorInfo) {\n if (value && typeof value === "object") {\n if (typeof globalThis.Window === "function" && value instanceof globalThis.Window)\n return "ref: <Window>";\n if (typeof globalThis.Document === "function" && value instanceof globalThis.Document)\n return "ref: <Document>";\n if (typeof globalThis.Node === "function" && value instanceof globalThis.Node)\n return "ref: <Node>";\n }\n return innerSerialize(value, handleSerializer, visitorInfo);\n}\nfunction innerSerialize(value, handleSerializer, visitorInfo) {\n var _a;\n const result = handleSerializer(value);\n if ("fallThrough" in result)\n value = result.fallThrough;\n else\n return result;\n if (typeof value === "symbol")\n return { v: "undefined" };\n if (Object.is(value, void 0))\n return { v: "undefined" };\n if (Object.is(value, null))\n return { v: "null" };\n if (Object.is(value, NaN))\n return { v: "NaN" };\n if (Object.is(value, Infinity))\n return { v: "Infinity" };\n if (Object.is(value, -Infinity))\n return { v: "-Infinity" };\n if (Object.is(value, -0))\n return { v: "-0" };\n if (typeof value === "boolean")\n return value;\n if (typeof value === "number")\n return value;\n if (typeof value === "string")\n return value;\n if (typeof value === "bigint")\n return { bi: value.toString() };\n if (isError(value)) {\n let stack;\n if ((_a = value.stack) == null ? void 0 : _a.startsWith(value.name + ": " + value.message)) {\n stack = value.stack;\n } else {\n stack = `${value.name}: ${value.message}\n${value.stack}`;\n }\n return { e: { n: value.name, m: value.message, s: stack } };\n }\n if (isDate(value))\n return { d: value.toJSON() };\n if (isURL(value))\n return { u: value.toJSON() };\n if (isRegExp(value))\n return { r: { p: value.source, f: value.flags } };\n for (const [k, ctor] of Object.entries(typedArrayConstructors)) {\n if (isTypedArray(value, ctor))\n return { ta: { b: typedArrayToBase64(value), k } };\n }\n const id = visitorInfo.visited.get(value);\n if (id)\n return { ref: id };\n if (Array.isArray(value)) {\n const a = [];\n const id2 = ++visitorInfo.lastId;\n visitorInfo.visited.set(value, id2);\n for (let i = 0; i < value.length; ++i)\n a.push(serialize(value[i], handleSerializer, visitorInfo));\n return { a, id: id2 };\n }\n if (typeof value === "object") {\n const o = [];\n const id2 = ++visitorInfo.lastId;\n visitorInfo.visited.set(value, id2);\n for (const name of Object.keys(value)) {\n let item;\n try {\n item = value[name];\n } catch (e) {\n continue;\n }\n if (name === "toJSON" && typeof item === "function")\n o.push({ k: name, v: { o: [], id: 0 } });\n else\n o.push({ k: name, v: serialize(item, handleSerializer, visitorInfo) });\n }\n let jsonWrapper;\n try {\n if (o.length === 0 && value.toJSON && typeof value.toJSON === "function")\n jsonWrapper = { value: value.toJSON() };\n } catch (e) {\n }\n if (jsonWrapper)\n return innerSerialize(jsonWrapper.value, handleSerializer, visitorInfo);\n return { o, id: id2 };\n }\n}\n\n// packages/injected/src/bindingsController.ts\nvar BindingsController = class {\n constructor(global, globalBindingName) {\n this._bindings = /* @__PURE__ */ new Map();\n this._global = global;\n this._globalBindingName = globalBindingName;\n }\n addBinding(bindingName, needsHandle) {\n const data = {\n callbacks: /* @__PURE__ */ new Map(),\n lastSeq: 0,\n handles: /* @__PURE__ */ new Map(),\n removed: false\n };\n this._bindings.set(bindingName, data);\n this._global[bindingName] = (...args) => {\n if (data.removed)\n throw new Error(`binding "${bindingName}" has been removed`);\n if (needsHandle && args.slice(1).some((arg) => arg !== void 0))\n throw new Error(`exposeBindingHandle supports a single argument, ${args.length} received`);\n const seq = ++data.lastSeq;\n const promise = new Promise((resolve, reject) => data.callbacks.set(seq, { resolve, reject }));\n let payload;\n if (needsHandle) {\n data.handles.set(seq, args[0]);\n payload = { name: bindingName, seq };\n } else {\n const serializedArgs = [];\n for (let i = 0; i < args.length; i++) {\n serializedArgs[i] = serializeAsCallArgument(args[i], (v) => {\n return { fallThrough: v };\n });\n }\n payload = { name: bindingName, seq, serializedArgs };\n }\n this._global[this._globalBindingName](JSON.stringify(payload));\n return promise;\n };\n }\n removeBinding(bindingName) {\n const data = this._bindings.get(bindingName);\n if (data)\n data.removed = true;\n this._bindings.delete(bindingName);\n delete this._global[bindingName];\n }\n takeBindingHandle(arg) {\n const handles = this._bindings.get(arg.name).handles;\n const handle = handles.get(arg.seq);\n handles.delete(arg.seq);\n return handle;\n }\n deliverBindingResult(arg) {\n const callbacks = this._bindings.get(arg.name).callbacks;\n if ("error" in arg)\n callbacks.get(arg.seq).reject(arg.error);\n else\n callbacks.get(arg.seq).resolve(arg.result);\n callbacks.delete(arg.seq);\n }\n};\n';
25
- // Annotate the CommonJS export names for ESM import in node:
26
- 0 && (module.exports = {
27
- source
28
- });
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var clockSource_exports = {};
20
- __export(clockSource_exports, {
21
- source: () => source
22
- });
23
- module.exports = __toCommonJS(clockSource_exports);
24
- const source = '\nvar __commonJS = obj => {\n let required = false;\n let result;\n return function __require() {\n if (!required) {\n required = true;\n let fn;\n for (const name in obj) { fn = obj[name]; break; }\n const module = { exports: {} };\n fn(module.exports, module);\n result = module.exports;\n }\n return result;\n }\n};\nvar __export = (target, all) => {for (var name in all) target[name] = all[name];};\nvar __toESM = mod => ({ ...mod, \'default\': mod });\nvar __toCommonJS = mod => ({ ...mod, __esModule: true });\n\n\n// packages/injected/src/clock.ts\nvar clock_exports = {};\n__export(clock_exports, {\n ClockController: () => ClockController,\n createClock: () => createClock,\n inject: () => inject,\n install: () => install\n});\nmodule.exports = __toCommonJS(clock_exports);\nvar ClockController = class {\n constructor(embedder) {\n this._duringTick = false;\n this._uniqueTimerId = idCounterStart;\n this.disposables = [];\n this._log = [];\n this._timers = /* @__PURE__ */ new Map();\n this._now = { time: asWallTime(0), isFixedTime: false, ticks: 0, origin: asWallTime(-1) };\n this._embedder = embedder;\n }\n uninstall() {\n this.disposables.forEach((dispose) => dispose());\n this.disposables.length = 0;\n }\n now() {\n this._replayLogOnce();\n this._syncRealTime();\n return this._now.time;\n }\n install(time) {\n this._replayLogOnce();\n this._innerSetTime(asWallTime(time));\n }\n setSystemTime(time) {\n this._replayLogOnce();\n this._innerSetTime(asWallTime(time));\n }\n setFixedTime(time) {\n this._replayLogOnce();\n this._innerSetFixedTime(asWallTime(time));\n }\n performanceNow() {\n this._replayLogOnce();\n this._syncRealTime();\n return this._now.ticks;\n }\n _syncRealTime() {\n if (!this._realTime)\n return;\n const now = this._embedder.performanceNow();\n const sinceLastSync = now - this._realTime.lastSyncTicks;\n if (sinceLastSync > 0) {\n this._advanceNow(shiftTicks(this._now.ticks, sinceLastSync));\n this._realTime.lastSyncTicks = now;\n }\n }\n _innerSetTime(time) {\n this._now.time = time;\n this._now.isFixedTime = false;\n if (this._now.origin < 0)\n this._now.origin = this._now.time;\n }\n _innerSetFixedTime(time) {\n this._innerSetTime(time);\n this._now.isFixedTime = true;\n }\n _advanceNow(to) {\n if (!this._now.isFixedTime)\n this._now.time = asWallTime(this._now.time + to - this._now.ticks);\n this._now.ticks = to;\n }\n async log(type, time, param) {\n this._log.push({ type, time, param });\n }\n async runFor(ticks) {\n this._replayLogOnce();\n if (ticks < 0)\n throw new TypeError("Negative ticks are not supported");\n await this._runTo(shiftTicks(this._now.ticks, ticks));\n }\n async _runTo(to) {\n to = Math.ceil(to);\n if (this._now.ticks > to)\n return;\n let firstException;\n while (true) {\n const result = await this._callFirstTimer(to);\n if (!result.timerFound)\n break;\n firstException = firstException || result.error;\n }\n this._advanceNow(to);\n if (firstException)\n throw firstException;\n }\n async pauseAt(time) {\n this._replayLogOnce();\n this._innerPause();\n const toConsume = time - this._now.time;\n await this._innerFastForwardTo(shiftTicks(this._now.ticks, toConsume));\n return toConsume;\n }\n _innerPause() {\n this._realTime = void 0;\n this._updateRealTimeTimer();\n }\n resume() {\n this._replayLogOnce();\n this._innerResume();\n }\n _innerResume() {\n const now = this._embedder.performanceNow();\n this._realTime = { startTicks: now, lastSyncTicks: now };\n this._updateRealTimeTimer();\n }\n _updateRealTimeTimer() {\n var _a;\n if (!this._realTime) {\n (_a = this._currentRealTimeTimer) == null ? void 0 : _a.dispose();\n this._currentRealTimeTimer = void 0;\n return;\n }\n const firstTimer = this._firstTimer();\n const callAt = Math.min(firstTimer ? firstTimer.callAt : this._now.ticks + maxTimeout, this._now.ticks + 100);\n if (this._currentRealTimeTimer && this._currentRealTimeTimer.callAt < callAt)\n return;\n if (this._currentRealTimeTimer) {\n this._currentRealTimeTimer.dispose();\n this._currentRealTimeTimer = void 0;\n }\n this._currentRealTimeTimer = {\n callAt,\n dispose: this._embedder.setTimeout(() => {\n this._currentRealTimeTimer = void 0;\n this._syncRealTime();\n void this._runTo(this._now.ticks).catch((e) => console.error(e)).then(() => this._updateRealTimeTimer());\n }, callAt - this._now.ticks)\n };\n }\n async fastForward(ticks) {\n this._replayLogOnce();\n await this._innerFastForwardTo(shiftTicks(this._now.ticks, ticks | 0));\n }\n async _innerFastForwardTo(to) {\n if (to < this._now.ticks)\n throw new Error("Cannot fast-forward to the past");\n for (const timer of this._timers.values()) {\n if (to > timer.callAt)\n timer.callAt = to;\n }\n await this._runTo(to);\n }\n addTimer(options) {\n this._replayLogOnce();\n if (options.type === "AnimationFrame" /* AnimationFrame */ && !options.func)\n throw new Error("Callback must be provided to requestAnimationFrame calls");\n if (options.type === "IdleCallback" /* IdleCallback */ && !options.func)\n throw new Error("Callback must be provided to requestIdleCallback calls");\n if (["Timeout" /* Timeout */, "Interval" /* Interval */].includes(options.type) && !options.func && options.delay === void 0)\n throw new Error("Callback must be provided to timer calls");\n let delay = options.delay ? +options.delay : 0;\n if (!Number.isFinite(delay))\n delay = 0;\n delay = delay > maxTimeout ? 1 : delay;\n delay = Math.max(0, delay);\n const timer = {\n type: options.type,\n func: options.func,\n args: options.args || [],\n delay,\n callAt: shiftTicks(this._now.ticks, delay || (this._duringTick ? 1 : 0)),\n createdAt: this._now.ticks,\n id: this._uniqueTimerId++,\n error: new Error()\n };\n this._timers.set(timer.id, timer);\n if (this._realTime)\n this._updateRealTimeTimer();\n return timer.id;\n }\n countTimers() {\n return this._timers.size;\n }\n _firstTimer(beforeTick) {\n let firstTimer = null;\n for (const timer of this._timers.values()) {\n const isInRange = beforeTick === void 0 || timer.callAt <= beforeTick;\n if (isInRange && (!firstTimer || compareTimers(firstTimer, timer) === 1))\n firstTimer = timer;\n }\n return firstTimer;\n }\n _takeFirstTimer(beforeTick) {\n const timer = this._firstTimer(beforeTick);\n if (!timer)\n return null;\n this._advanceNow(timer.callAt);\n if (timer.type === "Interval" /* Interval */)\n timer.callAt = shiftTicks(timer.callAt, timer.delay);\n else\n this._timers.delete(timer.id);\n return timer;\n }\n async _callFirstTimer(beforeTick) {\n const timer = this._takeFirstTimer(beforeTick);\n if (!timer)\n return { timerFound: false };\n this._duringTick = true;\n try {\n if (typeof timer.func !== "function") {\n let error2;\n try {\n (() => {\n globalThis.eval(timer.func);\n })();\n } catch (e) {\n error2 = e;\n }\n await new Promise((f) => this._embedder.setTimeout(f));\n return { timerFound: true, error: error2 };\n }\n let args = timer.args;\n if (timer.type === "AnimationFrame" /* AnimationFrame */)\n args = [this._now.ticks];\n else if (timer.type === "IdleCallback" /* IdleCallback */)\n args = [{ didTimeout: false, timeRemaining: () => 0 }];\n let error;\n try {\n timer.func.apply(null, args);\n } catch (e) {\n error = e;\n }\n await new Promise((f) => this._embedder.setTimeout(f));\n return { timerFound: true, error };\n } finally {\n this._duringTick = false;\n }\n }\n getTimeToNextFrame() {\n return 16 - this._now.ticks % 16;\n }\n clearTimer(timerId, type) {\n this._replayLogOnce();\n if (!timerId) {\n return;\n }\n const id = Number(timerId);\n if (Number.isNaN(id) || id < idCounterStart) {\n const handlerName = getClearHandler(type);\n new Error(`Clock: ${handlerName} was invoked to clear a native timer instead of one created by the clock library.`);\n }\n const timer = this._timers.get(id);\n if (timer) {\n if (timer.type === type || timer.type === "Timeout" && type === "Interval" || timer.type === "Interval" && type === "Timeout") {\n this._timers.delete(id);\n } else {\n const clear = getClearHandler(type);\n const schedule = getScheduleHandler(timer.type);\n throw new Error(\n `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`\n );\n }\n }\n }\n _replayLogOnce() {\n if (!this._log.length)\n return;\n let lastLogTime = -1;\n let isPaused = false;\n for (const { type, time, param } of this._log) {\n if (!isPaused && lastLogTime !== -1)\n this._advanceNow(shiftTicks(this._now.ticks, time - lastLogTime));\n lastLogTime = time;\n if (type === "install") {\n this._innerSetTime(asWallTime(param));\n } else if (type === "fastForward" || type === "runFor") {\n this._advanceNow(shiftTicks(this._now.ticks, param));\n } else if (type === "pauseAt") {\n isPaused = true;\n this._innerPause();\n this._innerSetTime(asWallTime(param));\n } else if (type === "resume") {\n this._innerResume();\n isPaused = false;\n } else if (type === "setFixedTime") {\n this._innerSetFixedTime(asWallTime(param));\n } else if (type === "setSystemTime") {\n this._innerSetTime(asWallTime(param));\n }\n }\n if (!isPaused && lastLogTime > 0)\n this._advanceNow(shiftTicks(this._now.ticks, this._embedder.dateNow() - lastLogTime));\n this._log.length = 0;\n }\n};\nfunction mirrorDateProperties(target, source) {\n for (const prop in source) {\n if (source.hasOwnProperty(prop))\n target[prop] = source[prop];\n }\n target.toString = () => source.toString();\n target.prototype = source.prototype;\n target.parse = source.parse;\n target.UTC = source.UTC;\n target.prototype.toUTCString = source.prototype.toUTCString;\n target.isFake = true;\n return target;\n}\nfunction createDate(clock, NativeDate) {\n function ClockDate(year, month, date, hour, minute, second, ms) {\n if (!(this instanceof ClockDate))\n return new NativeDate(clock.now()).toString();\n switch (arguments.length) {\n case 0:\n return new NativeDate(clock.now());\n case 1:\n return new NativeDate(year);\n case 2:\n return new NativeDate(year, month);\n case 3:\n return new NativeDate(year, month, date);\n case 4:\n return new NativeDate(year, month, date, hour);\n case 5:\n return new NativeDate(year, month, date, hour, minute);\n case 6:\n return new NativeDate(\n year,\n month,\n date,\n hour,\n minute,\n second\n );\n default:\n return new NativeDate(\n year,\n month,\n date,\n hour,\n minute,\n second,\n ms\n );\n }\n }\n ClockDate.now = () => clock.now();\n return mirrorDateProperties(ClockDate, NativeDate);\n}\nfunction createIntl(clock, NativeIntl) {\n const ClockIntl = {};\n for (const key of Object.getOwnPropertyNames(NativeIntl))\n ClockIntl[key] = NativeIntl[key];\n ClockIntl.DateTimeFormat = function(...args) {\n const realFormatter = new NativeIntl.DateTimeFormat(...args);\n const formatter = {\n formatRange: realFormatter.formatRange.bind(realFormatter),\n formatRangeToParts: realFormatter.formatRangeToParts.bind(realFormatter),\n resolvedOptions: realFormatter.resolvedOptions.bind(realFormatter),\n format: (date) => realFormatter.format(date || clock.now()),\n formatToParts: (date) => realFormatter.formatToParts(date || clock.now())\n };\n return formatter;\n };\n ClockIntl.DateTimeFormat.prototype = Object.create(\n NativeIntl.DateTimeFormat.prototype\n );\n ClockIntl.DateTimeFormat.supportedLocalesOf = NativeIntl.DateTimeFormat.supportedLocalesOf;\n return ClockIntl;\n}\nfunction compareTimers(a, b) {\n if (a.callAt < b.callAt)\n return -1;\n if (a.callAt > b.callAt)\n return 1;\n if (a.type === "Immediate" /* Immediate */ && b.type !== "Immediate" /* Immediate */)\n return -1;\n if (a.type !== "Immediate" /* Immediate */ && b.type === "Immediate" /* Immediate */)\n return 1;\n if (a.createdAt < b.createdAt)\n return -1;\n if (a.createdAt > b.createdAt)\n return 1;\n if (a.id < b.id)\n return -1;\n if (a.id > b.id)\n return 1;\n}\nvar maxTimeout = Math.pow(2, 31) - 1;\nvar idCounterStart = 1e12;\nfunction platformOriginals(globalObject) {\n const raw = {\n setTimeout: globalObject.setTimeout,\n clearTimeout: globalObject.clearTimeout,\n setInterval: globalObject.setInterval,\n clearInterval: globalObject.clearInterval,\n requestAnimationFrame: globalObject.requestAnimationFrame ? globalObject.requestAnimationFrame : void 0,\n cancelAnimationFrame: globalObject.cancelAnimationFrame ? globalObject.cancelAnimationFrame : void 0,\n requestIdleCallback: globalObject.requestIdleCallback ? globalObject.requestIdleCallback : void 0,\n cancelIdleCallback: globalObject.cancelIdleCallback ? globalObject.cancelIdleCallback : void 0,\n Date: globalObject.Date,\n performance: globalObject.performance,\n Intl: globalObject.Intl\n };\n const bound = { ...raw };\n for (const key of Object.keys(bound)) {\n if (key !== "Date" && typeof bound[key] === "function")\n bound[key] = bound[key].bind(globalObject);\n }\n return { raw, bound };\n}\nfunction getScheduleHandler(type) {\n if (type === "IdleCallback" || type === "AnimationFrame")\n return `request${type}`;\n return `set${type}`;\n}\nfunction createApi(clock, originals) {\n return {\n setTimeout: (func, timeout, ...args) => {\n const delay = timeout ? +timeout : timeout;\n return clock.addTimer({\n type: "Timeout" /* Timeout */,\n func,\n args,\n delay\n });\n },\n clearTimeout: (timerId) => {\n if (timerId)\n clock.clearTimer(timerId, "Timeout" /* Timeout */);\n },\n setInterval: (func, timeout, ...args) => {\n const delay = timeout ? +timeout : timeout;\n return clock.addTimer({\n type: "Interval" /* Interval */,\n func,\n args,\n delay\n });\n },\n clearInterval: (timerId) => {\n if (timerId)\n return clock.clearTimer(timerId, "Interval" /* Interval */);\n },\n requestAnimationFrame: (callback) => {\n return clock.addTimer({\n type: "AnimationFrame" /* AnimationFrame */,\n func: callback,\n delay: clock.getTimeToNextFrame()\n });\n },\n cancelAnimationFrame: (timerId) => {\n if (timerId)\n return clock.clearTimer(timerId, "AnimationFrame" /* AnimationFrame */);\n },\n requestIdleCallback: (callback, options) => {\n let timeToNextIdlePeriod = 0;\n if (clock.countTimers() > 0)\n timeToNextIdlePeriod = 50;\n return clock.addTimer({\n type: "IdleCallback" /* IdleCallback */,\n func: callback,\n delay: (options == null ? void 0 : options.timeout) ? Math.min(options == null ? void 0 : options.timeout, timeToNextIdlePeriod) : timeToNextIdlePeriod\n });\n },\n cancelIdleCallback: (timerId) => {\n if (timerId)\n return clock.clearTimer(timerId, "IdleCallback" /* IdleCallback */);\n },\n Intl: originals.Intl ? createIntl(clock, originals.Intl) : void 0,\n Date: createDate(clock, originals.Date),\n performance: originals.performance ? fakePerformance(clock, originals.performance) : void 0\n };\n}\nfunction getClearHandler(type) {\n if (type === "IdleCallback" || type === "AnimationFrame")\n return `cancel${type}`;\n return `clear${type}`;\n}\nfunction fakePerformance(clock, performance) {\n const result = {\n now: () => clock.performanceNow()\n };\n result.__defineGetter__("timeOrigin", () => clock._now.origin || 0);\n for (const key of Object.keys(performance.__proto__)) {\n if (key === "now" || key === "timeOrigin")\n continue;\n if (key === "getEntries" || key === "getEntriesByName" || key === "getEntriesByType")\n result[key] = () => [];\n else\n result[key] = () => {\n };\n }\n return result;\n}\nfunction createClock(globalObject) {\n const originals = platformOriginals(globalObject);\n const embedder = {\n dateNow: () => originals.raw.Date.now(),\n performanceNow: () => Math.ceil(originals.raw.performance.now()),\n setTimeout: (task, timeout) => {\n const timerId = originals.bound.setTimeout(task, timeout);\n return () => originals.bound.clearTimeout(timerId);\n },\n setInterval: (task, delay) => {\n const intervalId = originals.bound.setInterval(task, delay);\n return () => originals.bound.clearInterval(intervalId);\n }\n };\n const clock = new ClockController(embedder);\n const api = createApi(clock, originals.bound);\n return { clock, api, originals: originals.raw };\n}\nfunction install(globalObject, config = {}) {\n var _a, _b;\n if ((_a = globalObject.Date) == null ? void 0 : _a.isFake) {\n throw new TypeError(`Can\'t install fake timers twice on the same global object.`);\n }\n const { clock, api, originals } = createClock(globalObject);\n const toFake = ((_b = config.toFake) == null ? void 0 : _b.length) ? config.toFake : Object.keys(originals);\n for (const method of toFake) {\n if (method === "Date") {\n globalObject.Date = mirrorDateProperties(api.Date, globalObject.Date);\n } else if (method === "Intl") {\n globalObject.Intl = api[method];\n } else if (method === "performance") {\n globalObject.performance = api[method];\n const kEventTimeStamp = Symbol("playwrightEventTimeStamp");\n Object.defineProperty(Event.prototype, "timeStamp", {\n get() {\n var _a2;\n if (!this[kEventTimeStamp])\n this[kEventTimeStamp] = (_a2 = api.performance) == null ? void 0 : _a2.now();\n return this[kEventTimeStamp];\n }\n });\n } else {\n globalObject[method] = (...args) => {\n return api[method].apply(api, args);\n };\n }\n clock.disposables.push(() => {\n globalObject[method] = originals[method];\n });\n }\n return { clock, api, originals };\n}\nfunction inject(globalObject) {\n const builtins = platformOriginals(globalObject).bound;\n const { clock: controller } = install(globalObject);\n controller.resume();\n return {\n controller,\n builtins\n };\n}\nfunction asWallTime(n) {\n return n;\n}\nfunction shiftTicks(ticks, ms) {\n return ticks + ms;\n}\n';
25
- // Annotate the CommonJS export names for ESM import in node:
26
- 0 && (module.exports = {
27
- source
28
- });