@smoothdeploy/playwright-core 1.58.4 → 1.60.0-beta-1780662356000

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 (380) hide show
  1. package/ThirdPartyNotices.txt +7 -4070
  2. package/browsers.json +16 -14
  3. package/cli.js +4 -1
  4. package/index.js +1 -1
  5. package/lib/bootstrap.js +77 -0
  6. package/lib/coreBundle.js +70057 -0
  7. package/lib/entry/cliDaemon.js +5 -0
  8. package/lib/entry/dashboardApp.js +3 -0
  9. package/lib/entry/mcp.js +10 -0
  10. package/lib/entry/oopBrowserDownload.js +3 -0
  11. package/lib/{server/deviceDescriptors.js → package.js} +18 -7
  12. package/lib/server/deviceDescriptorsSource.json +137 -137
  13. package/lib/server/electron/loader.js +99 -13
  14. package/lib/serverRegistry.js +7343 -0
  15. package/lib/serverRegistry.js.LICENSE +354 -0
  16. package/lib/tools/cli-client/channelSessions.js +141 -0
  17. package/lib/tools/cli-client/cli.js +6 -0
  18. package/lib/tools/cli-client/help.json +679 -0
  19. package/lib/tools/cli-client/minimist.js +128 -0
  20. package/lib/tools/cli-client/output.js +343 -0
  21. package/lib/tools/cli-client/program.js +380 -0
  22. package/lib/tools/cli-client/registry.js +176 -0
  23. package/lib/tools/cli-client/session.js +265 -0
  24. package/lib/tools/cli-client/skill/SKILL.md +388 -0
  25. package/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
  26. package/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
  27. package/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
  28. package/lib/tools/cli-client/skill/references/running-code.md +241 -0
  29. package/lib/tools/cli-client/skill/references/session-management.md +225 -0
  30. package/lib/tools/cli-client/skill/references/spec-driven-testing.md +305 -0
  31. package/lib/tools/cli-client/skill/references/storage-state.md +275 -0
  32. package/lib/tools/cli-client/skill/references/test-generation.md +134 -0
  33. package/lib/tools/cli-client/skill/references/tracing.md +139 -0
  34. package/lib/tools/cli-client/skill/references/video-recording.md +143 -0
  35. package/lib/tools/dashboard/appIcon.png +0 -0
  36. package/lib/tools/trace/SKILL.md +171 -0
  37. package/lib/{server/utils/profiler.js → tools/utils/extension.js} +42 -29
  38. package/lib/tools/utils/socketConnection.js +108 -0
  39. package/lib/utilsBundle.js +85377 -68
  40. package/lib/utilsBundle.js.LICENSE +2002 -0
  41. package/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  42. package/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  43. package/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  44. package/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  45. package/lib/vite/dashboard/assets/index-BY2S1tHT.css +1 -0
  46. package/lib/vite/dashboard/assets/index-DpEq2p62.js +52 -0
  47. package/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  48. package/lib/vite/dashboard/index.html +29 -0
  49. package/lib/vite/dashboard/playwright-logo.svg +24 -0
  50. package/lib/vite/htmlReport/index.html +2 -70
  51. package/lib/vite/htmlReport/report.css +1 -0
  52. package/lib/vite/htmlReport/report.js +72 -0
  53. package/lib/vite/recorder/assets/{codeMirrorModule-SGmxtuwi.js → codeMirrorModule-DyIpd_mA.js} +20 -20
  54. package/lib/vite/recorder/assets/index-4ZiSSCmn.css +1 -0
  55. package/lib/vite/recorder/assets/index-5q9Mg4LR.js +195 -0
  56. package/lib/vite/recorder/index.html +2 -2
  57. package/lib/vite/traceViewer/assets/{codeMirrorModule-BOUrQdmH.js → codeMirrorModule-DZq9EItR.js} +20 -20
  58. package/lib/vite/traceViewer/assets/defaultSettingsView-D4EpQvB-.js +262 -0
  59. package/lib/vite/traceViewer/assets/urlMatch-BYQrIQwR.js +1 -0
  60. package/lib/vite/traceViewer/defaultSettingsView.BDKsFU3c.css +1 -0
  61. package/lib/vite/traceViewer/index.CcoKXsOB.js +2 -0
  62. package/lib/vite/traceViewer/{index.BVu7tZDe.css → index.CzXZzn5A.css} +1 -1
  63. package/lib/vite/traceViewer/index.html +5 -4
  64. package/lib/vite/traceViewer/snapshot.html +4 -15
  65. package/lib/vite/traceViewer/snapshot.v8KI4P3m.js +2 -0
  66. package/lib/vite/traceViewer/sw.bundle.js +4 -4
  67. package/lib/vite/traceViewer/uiMode.B1W9rAxj.js +6 -0
  68. package/lib/vite/traceViewer/uiMode.html +4 -3
  69. package/package.json +4 -14
  70. package/types/protocol.d.ts +1084 -343
  71. package/types/types.d.ts +6035 -4360
  72. package/lib/androidServerImpl.js +0 -65
  73. package/lib/browserServerImpl.js +0 -120
  74. package/lib/cli/driver.js +0 -97
  75. package/lib/cli/program.js +0 -589
  76. package/lib/cli/programWithTestStub.js +0 -74
  77. package/lib/client/android.js +0 -361
  78. package/lib/client/api.js +0 -137
  79. package/lib/client/artifact.js +0 -79
  80. package/lib/client/browser.js +0 -161
  81. package/lib/client/browserContext.js +0 -582
  82. package/lib/client/browserType.js +0 -185
  83. package/lib/client/cdpSession.js +0 -51
  84. package/lib/client/channelOwner.js +0 -195
  85. package/lib/client/clientHelper.js +0 -64
  86. package/lib/client/clientInstrumentation.js +0 -65
  87. package/lib/client/clientStackTrace.js +0 -69
  88. package/lib/client/clock.js +0 -68
  89. package/lib/client/connection.js +0 -318
  90. package/lib/client/consoleMessage.js +0 -58
  91. package/lib/client/coverage.js +0 -44
  92. package/lib/client/dialog.js +0 -56
  93. package/lib/client/download.js +0 -62
  94. package/lib/client/electron.js +0 -138
  95. package/lib/client/elementHandle.js +0 -284
  96. package/lib/client/errors.js +0 -77
  97. package/lib/client/eventEmitter.js +0 -314
  98. package/lib/client/events.js +0 -103
  99. package/lib/client/fetch.js +0 -368
  100. package/lib/client/fileChooser.js +0 -46
  101. package/lib/client/fileUtils.js +0 -34
  102. package/lib/client/frame.js +0 -409
  103. package/lib/client/harRouter.js +0 -87
  104. package/lib/client/input.js +0 -84
  105. package/lib/client/jsHandle.js +0 -109
  106. package/lib/client/jsonPipe.js +0 -39
  107. package/lib/client/localUtils.js +0 -60
  108. package/lib/client/locator.js +0 -369
  109. package/lib/client/network.js +0 -747
  110. package/lib/client/page.js +0 -745
  111. package/lib/client/pageAgent.js +0 -64
  112. package/lib/client/platform.js +0 -77
  113. package/lib/client/playwright.js +0 -71
  114. package/lib/client/selectors.js +0 -55
  115. package/lib/client/stream.js +0 -39
  116. package/lib/client/timeoutSettings.js +0 -79
  117. package/lib/client/tracing.js +0 -119
  118. package/lib/client/types.js +0 -28
  119. package/lib/client/video.js +0 -59
  120. package/lib/client/waiter.js +0 -142
  121. package/lib/client/webError.js +0 -39
  122. package/lib/client/webSocket.js +0 -93
  123. package/lib/client/worker.js +0 -85
  124. package/lib/client/writableStream.js +0 -39
  125. package/lib/generated/bindingsControllerSource.js +0 -28
  126. package/lib/generated/clockSource.js +0 -28
  127. package/lib/generated/injectedScriptSource.js +0 -28
  128. package/lib/generated/pollingRecorderSource.js +0 -28
  129. package/lib/generated/storageScriptSource.js +0 -28
  130. package/lib/generated/utilityScriptSource.js +0 -28
  131. package/lib/generated/webSocketMockSource.js +0 -336
  132. package/lib/inProcessFactory.js +0 -60
  133. package/lib/inprocess.js +0 -3
  134. package/lib/mcpBundle.js +0 -84
  135. package/lib/mcpBundleImpl/index.js +0 -147
  136. package/lib/outofprocess.js +0 -76
  137. package/lib/protocol/serializers.js +0 -197
  138. package/lib/protocol/validator.js +0 -3023
  139. package/lib/protocol/validatorPrimitives.js +0 -193
  140. package/lib/remote/playwrightConnection.js +0 -129
  141. package/lib/remote/playwrightServer.js +0 -334
  142. package/lib/server/agent/actionRunner.js +0 -335
  143. package/lib/server/agent/actions.js +0 -128
  144. package/lib/server/agent/codegen.js +0 -111
  145. package/lib/server/agent/context.js +0 -150
  146. package/lib/server/agent/expectTools.js +0 -156
  147. package/lib/server/agent/pageAgent.js +0 -204
  148. package/lib/server/agent/performTools.js +0 -262
  149. package/lib/server/agent/tool.js +0 -109
  150. package/lib/server/android/android.js +0 -465
  151. package/lib/server/android/backendAdb.js +0 -177
  152. package/lib/server/artifact.js +0 -127
  153. package/lib/server/bidi/bidiBrowser.js +0 -549
  154. package/lib/server/bidi/bidiChromium.js +0 -149
  155. package/lib/server/bidi/bidiConnection.js +0 -213
  156. package/lib/server/bidi/bidiDeserializer.js +0 -116
  157. package/lib/server/bidi/bidiExecutionContext.js +0 -267
  158. package/lib/server/bidi/bidiFirefox.js +0 -128
  159. package/lib/server/bidi/bidiInput.js +0 -146
  160. package/lib/server/bidi/bidiNetworkManager.js +0 -383
  161. package/lib/server/bidi/bidiOverCdp.js +0 -102
  162. package/lib/server/bidi/bidiPage.js +0 -583
  163. package/lib/server/bidi/bidiPdf.js +0 -106
  164. package/lib/server/bidi/third_party/bidiCommands.d.js +0 -22
  165. package/lib/server/bidi/third_party/bidiKeyboard.js +0 -256
  166. package/lib/server/bidi/third_party/bidiProtocol.js +0 -24
  167. package/lib/server/bidi/third_party/bidiProtocolCore.js +0 -180
  168. package/lib/server/bidi/third_party/bidiProtocolPermissions.js +0 -42
  169. package/lib/server/bidi/third_party/bidiSerializer.js +0 -148
  170. package/lib/server/bidi/third_party/firefoxPrefs.js +0 -259
  171. package/lib/server/browser.js +0 -149
  172. package/lib/server/browserContext.js +0 -700
  173. package/lib/server/browserType.js +0 -336
  174. package/lib/server/callLog.js +0 -82
  175. package/lib/server/chromium/chromium.js +0 -397
  176. package/lib/server/chromium/chromiumSwitches.js +0 -104
  177. package/lib/server/chromium/crBrowser.js +0 -520
  178. package/lib/server/chromium/crConnection.js +0 -197
  179. package/lib/server/chromium/crCoverage.js +0 -235
  180. package/lib/server/chromium/crDevTools.js +0 -111
  181. package/lib/server/chromium/crDragDrop.js +0 -131
  182. package/lib/server/chromium/crExecutionContext.js +0 -146
  183. package/lib/server/chromium/crInput.js +0 -187
  184. package/lib/server/chromium/crNetworkManager.js +0 -707
  185. package/lib/server/chromium/crPage.js +0 -1001
  186. package/lib/server/chromium/crPdf.js +0 -121
  187. package/lib/server/chromium/crProtocolHelper.js +0 -145
  188. package/lib/server/chromium/crServiceWorker.js +0 -136
  189. package/lib/server/chromium/defaultFontFamilies.js +0 -162
  190. package/lib/server/chromium/protocol.d.js +0 -16
  191. package/lib/server/clock.js +0 -149
  192. package/lib/server/codegen/csharp.js +0 -327
  193. package/lib/server/codegen/java.js +0 -274
  194. package/lib/server/codegen/javascript.js +0 -247
  195. package/lib/server/codegen/jsonl.js +0 -52
  196. package/lib/server/codegen/language.js +0 -133
  197. package/lib/server/codegen/languages.js +0 -68
  198. package/lib/server/codegen/python.js +0 -279
  199. package/lib/server/codegen/types.js +0 -16
  200. package/lib/server/console.js +0 -57
  201. package/lib/server/cookieStore.js +0 -206
  202. package/lib/server/debugController.js +0 -181
  203. package/lib/server/debugger.js +0 -119
  204. package/lib/server/dialog.js +0 -116
  205. package/lib/server/dispatchers/androidDispatcher.js +0 -325
  206. package/lib/server/dispatchers/artifactDispatcher.js +0 -118
  207. package/lib/server/dispatchers/browserContextDispatcher.js +0 -384
  208. package/lib/server/dispatchers/browserDispatcher.js +0 -118
  209. package/lib/server/dispatchers/browserTypeDispatcher.js +0 -64
  210. package/lib/server/dispatchers/cdpSessionDispatcher.js +0 -44
  211. package/lib/server/dispatchers/debugControllerDispatcher.js +0 -78
  212. package/lib/server/dispatchers/dialogDispatcher.js +0 -47
  213. package/lib/server/dispatchers/dispatcher.js +0 -364
  214. package/lib/server/dispatchers/electronDispatcher.js +0 -89
  215. package/lib/server/dispatchers/elementHandlerDispatcher.js +0 -181
  216. package/lib/server/dispatchers/frameDispatcher.js +0 -227
  217. package/lib/server/dispatchers/jsHandleDispatcher.js +0 -85
  218. package/lib/server/dispatchers/jsonPipeDispatcher.js +0 -58
  219. package/lib/server/dispatchers/localUtilsDispatcher.js +0 -149
  220. package/lib/server/dispatchers/networkDispatchers.js +0 -213
  221. package/lib/server/dispatchers/pageAgentDispatcher.js +0 -96
  222. package/lib/server/dispatchers/pageDispatcher.js +0 -393
  223. package/lib/server/dispatchers/playwrightDispatcher.js +0 -108
  224. package/lib/server/dispatchers/streamDispatcher.js +0 -67
  225. package/lib/server/dispatchers/tracingDispatcher.js +0 -68
  226. package/lib/server/dispatchers/webSocketRouteDispatcher.js +0 -165
  227. package/lib/server/dispatchers/writableStreamDispatcher.js +0 -79
  228. package/lib/server/dom.js +0 -815
  229. package/lib/server/download.js +0 -70
  230. package/lib/server/electron/electron.js +0 -273
  231. package/lib/server/errors.js +0 -69
  232. package/lib/server/fetch.js +0 -621
  233. package/lib/server/fileChooser.js +0 -43
  234. package/lib/server/fileUploadUtils.js +0 -84
  235. package/lib/server/firefox/ffBrowser.js +0 -418
  236. package/lib/server/firefox/ffConnection.js +0 -142
  237. package/lib/server/firefox/ffExecutionContext.js +0 -150
  238. package/lib/server/firefox/ffInput.js +0 -159
  239. package/lib/server/firefox/ffNetworkManager.js +0 -256
  240. package/lib/server/firefox/ffPage.js +0 -497
  241. package/lib/server/firefox/firefox.js +0 -114
  242. package/lib/server/firefox/protocol.d.js +0 -16
  243. package/lib/server/formData.js +0 -147
  244. package/lib/server/frameSelectors.js +0 -160
  245. package/lib/server/frames.js +0 -1471
  246. package/lib/server/har/harRecorder.js +0 -147
  247. package/lib/server/har/harTracer.js +0 -607
  248. package/lib/server/harBackend.js +0 -157
  249. package/lib/server/helper.js +0 -96
  250. package/lib/server/index.js +0 -58
  251. package/lib/server/input.js +0 -277
  252. package/lib/server/instrumentation.js +0 -72
  253. package/lib/server/javascript.js +0 -291
  254. package/lib/server/launchApp.js +0 -128
  255. package/lib/server/localUtils.js +0 -214
  256. package/lib/server/macEditingCommands.js +0 -143
  257. package/lib/server/network.js +0 -667
  258. package/lib/server/page.js +0 -830
  259. package/lib/server/pipeTransport.js +0 -89
  260. package/lib/server/playwright.js +0 -69
  261. package/lib/server/progress.js +0 -132
  262. package/lib/server/protocolError.js +0 -52
  263. package/lib/server/recorder/chat.js +0 -161
  264. package/lib/server/recorder/recorderApp.js +0 -366
  265. package/lib/server/recorder/recorderRunner.js +0 -138
  266. package/lib/server/recorder/recorderSignalProcessor.js +0 -83
  267. package/lib/server/recorder/recorderUtils.js +0 -157
  268. package/lib/server/recorder/throttledFile.js +0 -57
  269. package/lib/server/recorder.js +0 -554
  270. package/lib/server/registry/browserFetcher.js +0 -177
  271. package/lib/server/registry/dependencies.js +0 -371
  272. package/lib/server/registry/index.js +0 -1422
  273. package/lib/server/registry/nativeDeps.js +0 -1280
  274. package/lib/server/registry/oopDownloadBrowserMain.js +0 -127
  275. package/lib/server/screencast.js +0 -190
  276. package/lib/server/screenshotCompositor.js +0 -153
  277. package/lib/server/screenshotter.js +0 -333
  278. package/lib/server/selectors.js +0 -112
  279. package/lib/server/socksClientCertificatesInterceptor.js +0 -383
  280. package/lib/server/socksInterceptor.js +0 -95
  281. package/lib/server/trace/recorder/snapshotter.js +0 -147
  282. package/lib/server/trace/recorder/snapshotterInjected.js +0 -561
  283. package/lib/server/trace/recorder/tracing.js +0 -604
  284. package/lib/server/trace/viewer/traceParser.js +0 -72
  285. package/lib/server/trace/viewer/traceViewer.js +0 -245
  286. package/lib/server/transport.js +0 -181
  287. package/lib/server/types.js +0 -28
  288. package/lib/server/usKeyboardLayout.js +0 -145
  289. package/lib/server/utils/ascii.js +0 -44
  290. package/lib/server/utils/comparators.js +0 -139
  291. package/lib/server/utils/crypto.js +0 -216
  292. package/lib/server/utils/debug.js +0 -42
  293. package/lib/server/utils/debugLogger.js +0 -122
  294. package/lib/server/utils/env.js +0 -73
  295. package/lib/server/utils/eventsHelper.js +0 -39
  296. package/lib/server/utils/expectUtils.js +0 -123
  297. package/lib/server/utils/fileUtils.js +0 -191
  298. package/lib/server/utils/happyEyeballs.js +0 -207
  299. package/lib/server/utils/hostPlatform.js +0 -138
  300. package/lib/server/utils/httpServer.js +0 -203
  301. package/lib/server/utils/imageUtils.js +0 -141
  302. package/lib/server/utils/image_tools/colorUtils.js +0 -89
  303. package/lib/server/utils/image_tools/compare.js +0 -109
  304. package/lib/server/utils/image_tools/imageChannel.js +0 -78
  305. package/lib/server/utils/image_tools/stats.js +0 -102
  306. package/lib/server/utils/linuxUtils.js +0 -71
  307. package/lib/server/utils/network.js +0 -242
  308. package/lib/server/utils/nodePlatform.js +0 -154
  309. package/lib/server/utils/pipeTransport.js +0 -84
  310. package/lib/server/utils/processLauncher.js +0 -241
  311. package/lib/server/utils/socksProxy.js +0 -511
  312. package/lib/server/utils/spawnAsync.js +0 -41
  313. package/lib/server/utils/task.js +0 -51
  314. package/lib/server/utils/userAgent.js +0 -98
  315. package/lib/server/utils/wsServer.js +0 -121
  316. package/lib/server/utils/zipFile.js +0 -74
  317. package/lib/server/utils/zones.js +0 -57
  318. package/lib/server/videoRecorder.js +0 -124
  319. package/lib/server/webkit/protocol.d.js +0 -16
  320. package/lib/server/webkit/webkit.js +0 -108
  321. package/lib/server/webkit/wkBrowser.js +0 -335
  322. package/lib/server/webkit/wkConnection.js +0 -144
  323. package/lib/server/webkit/wkExecutionContext.js +0 -154
  324. package/lib/server/webkit/wkInput.js +0 -181
  325. package/lib/server/webkit/wkInterceptableRequest.js +0 -197
  326. package/lib/server/webkit/wkPage.js +0 -1159
  327. package/lib/server/webkit/wkProvisionalPage.js +0 -83
  328. package/lib/server/webkit/wkWorkers.js +0 -105
  329. package/lib/third_party/pixelmatch.js +0 -255
  330. package/lib/utils/isomorphic/ariaSnapshot.js +0 -455
  331. package/lib/utils/isomorphic/assert.js +0 -31
  332. package/lib/utils/isomorphic/colors.js +0 -72
  333. package/lib/utils/isomorphic/cssParser.js +0 -245
  334. package/lib/utils/isomorphic/cssTokenizer.js +0 -1051
  335. package/lib/utils/isomorphic/headers.js +0 -53
  336. package/lib/utils/isomorphic/locatorGenerators.js +0 -689
  337. package/lib/utils/isomorphic/locatorParser.js +0 -176
  338. package/lib/utils/isomorphic/locatorUtils.js +0 -81
  339. package/lib/utils/isomorphic/lruCache.js +0 -51
  340. package/lib/utils/isomorphic/manualPromise.js +0 -114
  341. package/lib/utils/isomorphic/mimeType.js +0 -459
  342. package/lib/utils/isomorphic/multimap.js +0 -80
  343. package/lib/utils/isomorphic/protocolFormatter.js +0 -81
  344. package/lib/utils/isomorphic/protocolMetainfo.js +0 -330
  345. package/lib/utils/isomorphic/rtti.js +0 -43
  346. package/lib/utils/isomorphic/selectorParser.js +0 -386
  347. package/lib/utils/isomorphic/semaphore.js +0 -54
  348. package/lib/utils/isomorphic/stackTrace.js +0 -158
  349. package/lib/utils/isomorphic/stringUtils.js +0 -204
  350. package/lib/utils/isomorphic/time.js +0 -49
  351. package/lib/utils/isomorphic/timeoutRunner.js +0 -66
  352. package/lib/utils/isomorphic/trace/entries.js +0 -16
  353. package/lib/utils/isomorphic/trace/snapshotRenderer.js +0 -499
  354. package/lib/utils/isomorphic/trace/snapshotServer.js +0 -120
  355. package/lib/utils/isomorphic/trace/snapshotStorage.js +0 -89
  356. package/lib/utils/isomorphic/trace/traceLoader.js +0 -131
  357. package/lib/utils/isomorphic/trace/traceModel.js +0 -365
  358. package/lib/utils/isomorphic/trace/traceModernizer.js +0 -400
  359. package/lib/utils/isomorphic/trace/versions/traceV3.js +0 -16
  360. package/lib/utils/isomorphic/trace/versions/traceV4.js +0 -16
  361. package/lib/utils/isomorphic/trace/versions/traceV5.js +0 -16
  362. package/lib/utils/isomorphic/trace/versions/traceV6.js +0 -16
  363. package/lib/utils/isomorphic/trace/versions/traceV7.js +0 -16
  364. package/lib/utils/isomorphic/trace/versions/traceV8.js +0 -16
  365. package/lib/utils/isomorphic/traceUtils.js +0 -58
  366. package/lib/utils/isomorphic/types.js +0 -16
  367. package/lib/utils/isomorphic/urlMatch.js +0 -190
  368. package/lib/utils/isomorphic/utilityScriptSerializers.js +0 -251
  369. package/lib/utils/isomorphic/yaml.js +0 -84
  370. package/lib/utils.js +0 -111
  371. package/lib/utilsBundleImpl/index.js +0 -218
  372. package/lib/vite/recorder/assets/index-BSjZa4pk.css +0 -1
  373. package/lib/vite/recorder/assets/index-xK8wYVpV.js +0 -195
  374. package/lib/vite/traceViewer/assets/defaultSettingsView-k0nPICvc.js +0 -266
  375. package/lib/vite/traceViewer/defaultSettingsView.7ch9cixO.css +0 -1
  376. package/lib/vite/traceViewer/index.CVz8LATg.js +0 -2
  377. package/lib/vite/traceViewer/uiMode.C7uDu3VD.js +0 -5
  378. package/lib/zipBundle.js +0 -34
  379. package/lib/zipBundleImpl.js +0 -5
  380. /package/lib/{utilsBundleImpl/xdg-open → xdg-open} +0 -0
@@ -1,1051 +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 cssTokenizer_exports = {};
20
- __export(cssTokenizer_exports, {
21
- AtKeywordToken: () => AtKeywordToken,
22
- BadStringToken: () => BadStringToken,
23
- BadURLToken: () => BadURLToken,
24
- CDCToken: () => CDCToken,
25
- CDOToken: () => CDOToken,
26
- CSSParserToken: () => CSSParserToken,
27
- CloseCurlyToken: () => CloseCurlyToken,
28
- CloseParenToken: () => CloseParenToken,
29
- CloseSquareToken: () => CloseSquareToken,
30
- ColonToken: () => ColonToken,
31
- ColumnToken: () => ColumnToken,
32
- CommaToken: () => CommaToken,
33
- DashMatchToken: () => DashMatchToken,
34
- DelimToken: () => DelimToken,
35
- DimensionToken: () => DimensionToken,
36
- EOFToken: () => EOFToken,
37
- FunctionToken: () => FunctionToken,
38
- GroupingToken: () => GroupingToken,
39
- HashToken: () => HashToken,
40
- IdentToken: () => IdentToken,
41
- IncludeMatchToken: () => IncludeMatchToken,
42
- InvalidCharacterError: () => InvalidCharacterError,
43
- NumberToken: () => NumberToken,
44
- OpenCurlyToken: () => OpenCurlyToken,
45
- OpenParenToken: () => OpenParenToken,
46
- OpenSquareToken: () => OpenSquareToken,
47
- PercentageToken: () => PercentageToken,
48
- PrefixMatchToken: () => PrefixMatchToken,
49
- SemicolonToken: () => SemicolonToken,
50
- StringToken: () => StringToken,
51
- StringValuedToken: () => StringValuedToken,
52
- SubstringMatchToken: () => SubstringMatchToken,
53
- SuffixMatchToken: () => SuffixMatchToken,
54
- URLToken: () => URLToken,
55
- WhitespaceToken: () => WhitespaceToken,
56
- tokenize: () => tokenize
57
- });
58
- module.exports = __toCommonJS(cssTokenizer_exports);
59
- const between = function(num, first, last) {
60
- return num >= first && num <= last;
61
- };
62
- function digit(code) {
63
- return between(code, 48, 57);
64
- }
65
- function hexdigit(code) {
66
- return digit(code) || between(code, 65, 70) || between(code, 97, 102);
67
- }
68
- function uppercaseletter(code) {
69
- return between(code, 65, 90);
70
- }
71
- function lowercaseletter(code) {
72
- return between(code, 97, 122);
73
- }
74
- function letter(code) {
75
- return uppercaseletter(code) || lowercaseletter(code);
76
- }
77
- function nonascii(code) {
78
- return code >= 128;
79
- }
80
- function namestartchar(code) {
81
- return letter(code) || nonascii(code) || code === 95;
82
- }
83
- function namechar(code) {
84
- return namestartchar(code) || digit(code) || code === 45;
85
- }
86
- function nonprintable(code) {
87
- return between(code, 0, 8) || code === 11 || between(code, 14, 31) || code === 127;
88
- }
89
- function newline(code) {
90
- return code === 10;
91
- }
92
- function whitespace(code) {
93
- return newline(code) || code === 9 || code === 32;
94
- }
95
- const maximumallowedcodepoint = 1114111;
96
- class InvalidCharacterError extends Error {
97
- constructor(message) {
98
- super(message);
99
- this.name = "InvalidCharacterError";
100
- }
101
- }
102
- function preprocess(str) {
103
- const codepoints = [];
104
- for (let i = 0; i < str.length; i++) {
105
- let code = str.charCodeAt(i);
106
- if (code === 13 && str.charCodeAt(i + 1) === 10) {
107
- code = 10;
108
- i++;
109
- }
110
- if (code === 13 || code === 12)
111
- code = 10;
112
- if (code === 0)
113
- code = 65533;
114
- if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {
115
- const lead = code - 55296;
116
- const trail = str.charCodeAt(i + 1) - 56320;
117
- code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;
118
- i++;
119
- }
120
- codepoints.push(code);
121
- }
122
- return codepoints;
123
- }
124
- function stringFromCode(code) {
125
- if (code <= 65535)
126
- return String.fromCharCode(code);
127
- code -= Math.pow(2, 16);
128
- const lead = Math.floor(code / Math.pow(2, 10)) + 55296;
129
- const trail = code % Math.pow(2, 10) + 56320;
130
- return String.fromCharCode(lead) + String.fromCharCode(trail);
131
- }
132
- function tokenize(str1) {
133
- const str = preprocess(str1);
134
- let i = -1;
135
- const tokens = [];
136
- let code;
137
- let line = 0;
138
- let column = 0;
139
- let lastLineLength = 0;
140
- const incrLineno = function() {
141
- line += 1;
142
- lastLineLength = column;
143
- column = 0;
144
- };
145
- const locStart = { line, column };
146
- const codepoint = function(i2) {
147
- if (i2 >= str.length)
148
- return -1;
149
- return str[i2];
150
- };
151
- const next = function(num) {
152
- if (num === void 0)
153
- num = 1;
154
- if (num > 3)
155
- throw "Spec Error: no more than three codepoints of lookahead.";
156
- return codepoint(i + num);
157
- };
158
- const consume = function(num) {
159
- if (num === void 0)
160
- num = 1;
161
- i += num;
162
- code = codepoint(i);
163
- if (newline(code))
164
- incrLineno();
165
- else
166
- column += num;
167
- return true;
168
- };
169
- const reconsume = function() {
170
- i -= 1;
171
- if (newline(code)) {
172
- line -= 1;
173
- column = lastLineLength;
174
- } else {
175
- column -= 1;
176
- }
177
- locStart.line = line;
178
- locStart.column = column;
179
- return true;
180
- };
181
- const eof = function(codepoint2) {
182
- if (codepoint2 === void 0)
183
- codepoint2 = code;
184
- return codepoint2 === -1;
185
- };
186
- const donothing = function() {
187
- };
188
- const parseerror = function() {
189
- };
190
- const consumeAToken = function() {
191
- consumeComments();
192
- consume();
193
- if (whitespace(code)) {
194
- while (whitespace(next()))
195
- consume();
196
- return new WhitespaceToken();
197
- } else if (code === 34) {
198
- return consumeAStringToken();
199
- } else if (code === 35) {
200
- if (namechar(next()) || areAValidEscape(next(1), next(2))) {
201
- const token = new HashToken("");
202
- if (wouldStartAnIdentifier(next(1), next(2), next(3)))
203
- token.type = "id";
204
- token.value = consumeAName();
205
- return token;
206
- } else {
207
- return new DelimToken(code);
208
- }
209
- } else if (code === 36) {
210
- if (next() === 61) {
211
- consume();
212
- return new SuffixMatchToken();
213
- } else {
214
- return new DelimToken(code);
215
- }
216
- } else if (code === 39) {
217
- return consumeAStringToken();
218
- } else if (code === 40) {
219
- return new OpenParenToken();
220
- } else if (code === 41) {
221
- return new CloseParenToken();
222
- } else if (code === 42) {
223
- if (next() === 61) {
224
- consume();
225
- return new SubstringMatchToken();
226
- } else {
227
- return new DelimToken(code);
228
- }
229
- } else if (code === 43) {
230
- if (startsWithANumber()) {
231
- reconsume();
232
- return consumeANumericToken();
233
- } else {
234
- return new DelimToken(code);
235
- }
236
- } else if (code === 44) {
237
- return new CommaToken();
238
- } else if (code === 45) {
239
- if (startsWithANumber()) {
240
- reconsume();
241
- return consumeANumericToken();
242
- } else if (next(1) === 45 && next(2) === 62) {
243
- consume(2);
244
- return new CDCToken();
245
- } else if (startsWithAnIdentifier()) {
246
- reconsume();
247
- return consumeAnIdentlikeToken();
248
- } else {
249
- return new DelimToken(code);
250
- }
251
- } else if (code === 46) {
252
- if (startsWithANumber()) {
253
- reconsume();
254
- return consumeANumericToken();
255
- } else {
256
- return new DelimToken(code);
257
- }
258
- } else if (code === 58) {
259
- return new ColonToken();
260
- } else if (code === 59) {
261
- return new SemicolonToken();
262
- } else if (code === 60) {
263
- if (next(1) === 33 && next(2) === 45 && next(3) === 45) {
264
- consume(3);
265
- return new CDOToken();
266
- } else {
267
- return new DelimToken(code);
268
- }
269
- } else if (code === 64) {
270
- if (wouldStartAnIdentifier(next(1), next(2), next(3)))
271
- return new AtKeywordToken(consumeAName());
272
- else
273
- return new DelimToken(code);
274
- } else if (code === 91) {
275
- return new OpenSquareToken();
276
- } else if (code === 92) {
277
- if (startsWithAValidEscape()) {
278
- reconsume();
279
- return consumeAnIdentlikeToken();
280
- } else {
281
- parseerror();
282
- return new DelimToken(code);
283
- }
284
- } else if (code === 93) {
285
- return new CloseSquareToken();
286
- } else if (code === 94) {
287
- if (next() === 61) {
288
- consume();
289
- return new PrefixMatchToken();
290
- } else {
291
- return new DelimToken(code);
292
- }
293
- } else if (code === 123) {
294
- return new OpenCurlyToken();
295
- } else if (code === 124) {
296
- if (next() === 61) {
297
- consume();
298
- return new DashMatchToken();
299
- } else if (next() === 124) {
300
- consume();
301
- return new ColumnToken();
302
- } else {
303
- return new DelimToken(code);
304
- }
305
- } else if (code === 125) {
306
- return new CloseCurlyToken();
307
- } else if (code === 126) {
308
- if (next() === 61) {
309
- consume();
310
- return new IncludeMatchToken();
311
- } else {
312
- return new DelimToken(code);
313
- }
314
- } else if (digit(code)) {
315
- reconsume();
316
- return consumeANumericToken();
317
- } else if (namestartchar(code)) {
318
- reconsume();
319
- return consumeAnIdentlikeToken();
320
- } else if (eof()) {
321
- return new EOFToken();
322
- } else {
323
- return new DelimToken(code);
324
- }
325
- };
326
- const consumeComments = function() {
327
- while (next(1) === 47 && next(2) === 42) {
328
- consume(2);
329
- while (true) {
330
- consume();
331
- if (code === 42 && next() === 47) {
332
- consume();
333
- break;
334
- } else if (eof()) {
335
- parseerror();
336
- return;
337
- }
338
- }
339
- }
340
- };
341
- const consumeANumericToken = function() {
342
- const num = consumeANumber();
343
- if (wouldStartAnIdentifier(next(1), next(2), next(3))) {
344
- const token = new DimensionToken();
345
- token.value = num.value;
346
- token.repr = num.repr;
347
- token.type = num.type;
348
- token.unit = consumeAName();
349
- return token;
350
- } else if (next() === 37) {
351
- consume();
352
- const token = new PercentageToken();
353
- token.value = num.value;
354
- token.repr = num.repr;
355
- return token;
356
- } else {
357
- const token = new NumberToken();
358
- token.value = num.value;
359
- token.repr = num.repr;
360
- token.type = num.type;
361
- return token;
362
- }
363
- };
364
- const consumeAnIdentlikeToken = function() {
365
- const str2 = consumeAName();
366
- if (str2.toLowerCase() === "url" && next() === 40) {
367
- consume();
368
- while (whitespace(next(1)) && whitespace(next(2)))
369
- consume();
370
- if (next() === 34 || next() === 39)
371
- return new FunctionToken(str2);
372
- else if (whitespace(next()) && (next(2) === 34 || next(2) === 39))
373
- return new FunctionToken(str2);
374
- else
375
- return consumeAURLToken();
376
- } else if (next() === 40) {
377
- consume();
378
- return new FunctionToken(str2);
379
- } else {
380
- return new IdentToken(str2);
381
- }
382
- };
383
- const consumeAStringToken = function(endingCodePoint) {
384
- if (endingCodePoint === void 0)
385
- endingCodePoint = code;
386
- let string = "";
387
- while (consume()) {
388
- if (code === endingCodePoint || eof()) {
389
- return new StringToken(string);
390
- } else if (newline(code)) {
391
- parseerror();
392
- reconsume();
393
- return new BadStringToken();
394
- } else if (code === 92) {
395
- if (eof(next()))
396
- donothing();
397
- else if (newline(next()))
398
- consume();
399
- else
400
- string += stringFromCode(consumeEscape());
401
- } else {
402
- string += stringFromCode(code);
403
- }
404
- }
405
- throw new Error("Internal error");
406
- };
407
- const consumeAURLToken = function() {
408
- const token = new URLToken("");
409
- while (whitespace(next()))
410
- consume();
411
- if (eof(next()))
412
- return token;
413
- while (consume()) {
414
- if (code === 41 || eof()) {
415
- return token;
416
- } else if (whitespace(code)) {
417
- while (whitespace(next()))
418
- consume();
419
- if (next() === 41 || eof(next())) {
420
- consume();
421
- return token;
422
- } else {
423
- consumeTheRemnantsOfABadURL();
424
- return new BadURLToken();
425
- }
426
- } else if (code === 34 || code === 39 || code === 40 || nonprintable(code)) {
427
- parseerror();
428
- consumeTheRemnantsOfABadURL();
429
- return new BadURLToken();
430
- } else if (code === 92) {
431
- if (startsWithAValidEscape()) {
432
- token.value += stringFromCode(consumeEscape());
433
- } else {
434
- parseerror();
435
- consumeTheRemnantsOfABadURL();
436
- return new BadURLToken();
437
- }
438
- } else {
439
- token.value += stringFromCode(code);
440
- }
441
- }
442
- throw new Error("Internal error");
443
- };
444
- const consumeEscape = function() {
445
- consume();
446
- if (hexdigit(code)) {
447
- const digits = [code];
448
- for (let total = 0; total < 5; total++) {
449
- if (hexdigit(next())) {
450
- consume();
451
- digits.push(code);
452
- } else {
453
- break;
454
- }
455
- }
456
- if (whitespace(next()))
457
- consume();
458
- let value = parseInt(digits.map(function(x) {
459
- return String.fromCharCode(x);
460
- }).join(""), 16);
461
- if (value > maximumallowedcodepoint)
462
- value = 65533;
463
- return value;
464
- } else if (eof()) {
465
- return 65533;
466
- } else {
467
- return code;
468
- }
469
- };
470
- const areAValidEscape = function(c1, c2) {
471
- if (c1 !== 92)
472
- return false;
473
- if (newline(c2))
474
- return false;
475
- return true;
476
- };
477
- const startsWithAValidEscape = function() {
478
- return areAValidEscape(code, next());
479
- };
480
- const wouldStartAnIdentifier = function(c1, c2, c3) {
481
- if (c1 === 45)
482
- return namestartchar(c2) || c2 === 45 || areAValidEscape(c2, c3);
483
- else if (namestartchar(c1))
484
- return true;
485
- else if (c1 === 92)
486
- return areAValidEscape(c1, c2);
487
- else
488
- return false;
489
- };
490
- const startsWithAnIdentifier = function() {
491
- return wouldStartAnIdentifier(code, next(1), next(2));
492
- };
493
- const wouldStartANumber = function(c1, c2, c3) {
494
- if (c1 === 43 || c1 === 45) {
495
- if (digit(c2))
496
- return true;
497
- if (c2 === 46 && digit(c3))
498
- return true;
499
- return false;
500
- } else if (c1 === 46) {
501
- if (digit(c2))
502
- return true;
503
- return false;
504
- } else if (digit(c1)) {
505
- return true;
506
- } else {
507
- return false;
508
- }
509
- };
510
- const startsWithANumber = function() {
511
- return wouldStartANumber(code, next(1), next(2));
512
- };
513
- const consumeAName = function() {
514
- let result = "";
515
- while (consume()) {
516
- if (namechar(code)) {
517
- result += stringFromCode(code);
518
- } else if (startsWithAValidEscape()) {
519
- result += stringFromCode(consumeEscape());
520
- } else {
521
- reconsume();
522
- return result;
523
- }
524
- }
525
- throw new Error("Internal parse error");
526
- };
527
- const consumeANumber = function() {
528
- let repr = "";
529
- let type = "integer";
530
- if (next() === 43 || next() === 45) {
531
- consume();
532
- repr += stringFromCode(code);
533
- }
534
- while (digit(next())) {
535
- consume();
536
- repr += stringFromCode(code);
537
- }
538
- if (next(1) === 46 && digit(next(2))) {
539
- consume();
540
- repr += stringFromCode(code);
541
- consume();
542
- repr += stringFromCode(code);
543
- type = "number";
544
- while (digit(next())) {
545
- consume();
546
- repr += stringFromCode(code);
547
- }
548
- }
549
- const c1 = next(1), c2 = next(2), c3 = next(3);
550
- if ((c1 === 69 || c1 === 101) && digit(c2)) {
551
- consume();
552
- repr += stringFromCode(code);
553
- consume();
554
- repr += stringFromCode(code);
555
- type = "number";
556
- while (digit(next())) {
557
- consume();
558
- repr += stringFromCode(code);
559
- }
560
- } else if ((c1 === 69 || c1 === 101) && (c2 === 43 || c2 === 45) && digit(c3)) {
561
- consume();
562
- repr += stringFromCode(code);
563
- consume();
564
- repr += stringFromCode(code);
565
- consume();
566
- repr += stringFromCode(code);
567
- type = "number";
568
- while (digit(next())) {
569
- consume();
570
- repr += stringFromCode(code);
571
- }
572
- }
573
- const value = convertAStringToANumber(repr);
574
- return { type, value, repr };
575
- };
576
- const convertAStringToANumber = function(string) {
577
- return +string;
578
- };
579
- const consumeTheRemnantsOfABadURL = function() {
580
- while (consume()) {
581
- if (code === 41 || eof()) {
582
- return;
583
- } else if (startsWithAValidEscape()) {
584
- consumeEscape();
585
- donothing();
586
- } else {
587
- donothing();
588
- }
589
- }
590
- };
591
- let iterationCount = 0;
592
- while (!eof(next())) {
593
- tokens.push(consumeAToken());
594
- iterationCount++;
595
- if (iterationCount > str.length * 2)
596
- throw new Error("I'm infinite-looping!");
597
- }
598
- return tokens;
599
- }
600
- class CSSParserToken {
601
- constructor() {
602
- this.tokenType = "";
603
- }
604
- toJSON() {
605
- return { token: this.tokenType };
606
- }
607
- toString() {
608
- return this.tokenType;
609
- }
610
- toSource() {
611
- return "" + this;
612
- }
613
- }
614
- class BadStringToken extends CSSParserToken {
615
- constructor() {
616
- super(...arguments);
617
- this.tokenType = "BADSTRING";
618
- }
619
- }
620
- class BadURLToken extends CSSParserToken {
621
- constructor() {
622
- super(...arguments);
623
- this.tokenType = "BADURL";
624
- }
625
- }
626
- class WhitespaceToken extends CSSParserToken {
627
- constructor() {
628
- super(...arguments);
629
- this.tokenType = "WHITESPACE";
630
- }
631
- toString() {
632
- return "WS";
633
- }
634
- toSource() {
635
- return " ";
636
- }
637
- }
638
- class CDOToken extends CSSParserToken {
639
- constructor() {
640
- super(...arguments);
641
- this.tokenType = "CDO";
642
- }
643
- toSource() {
644
- return "<!--";
645
- }
646
- }
647
- class CDCToken extends CSSParserToken {
648
- constructor() {
649
- super(...arguments);
650
- this.tokenType = "CDC";
651
- }
652
- toSource() {
653
- return "-->";
654
- }
655
- }
656
- class ColonToken extends CSSParserToken {
657
- constructor() {
658
- super(...arguments);
659
- this.tokenType = ":";
660
- }
661
- }
662
- class SemicolonToken extends CSSParserToken {
663
- constructor() {
664
- super(...arguments);
665
- this.tokenType = ";";
666
- }
667
- }
668
- class CommaToken extends CSSParserToken {
669
- constructor() {
670
- super(...arguments);
671
- this.tokenType = ",";
672
- }
673
- }
674
- class GroupingToken extends CSSParserToken {
675
- constructor() {
676
- super(...arguments);
677
- this.value = "";
678
- this.mirror = "";
679
- }
680
- }
681
- class OpenCurlyToken extends GroupingToken {
682
- constructor() {
683
- super();
684
- this.tokenType = "{";
685
- this.value = "{";
686
- this.mirror = "}";
687
- }
688
- }
689
- class CloseCurlyToken extends GroupingToken {
690
- constructor() {
691
- super();
692
- this.tokenType = "}";
693
- this.value = "}";
694
- this.mirror = "{";
695
- }
696
- }
697
- class OpenSquareToken extends GroupingToken {
698
- constructor() {
699
- super();
700
- this.tokenType = "[";
701
- this.value = "[";
702
- this.mirror = "]";
703
- }
704
- }
705
- class CloseSquareToken extends GroupingToken {
706
- constructor() {
707
- super();
708
- this.tokenType = "]";
709
- this.value = "]";
710
- this.mirror = "[";
711
- }
712
- }
713
- class OpenParenToken extends GroupingToken {
714
- constructor() {
715
- super();
716
- this.tokenType = "(";
717
- this.value = "(";
718
- this.mirror = ")";
719
- }
720
- }
721
- class CloseParenToken extends GroupingToken {
722
- constructor() {
723
- super();
724
- this.tokenType = ")";
725
- this.value = ")";
726
- this.mirror = "(";
727
- }
728
- }
729
- class IncludeMatchToken extends CSSParserToken {
730
- constructor() {
731
- super(...arguments);
732
- this.tokenType = "~=";
733
- }
734
- }
735
- class DashMatchToken extends CSSParserToken {
736
- constructor() {
737
- super(...arguments);
738
- this.tokenType = "|=";
739
- }
740
- }
741
- class PrefixMatchToken extends CSSParserToken {
742
- constructor() {
743
- super(...arguments);
744
- this.tokenType = "^=";
745
- }
746
- }
747
- class SuffixMatchToken extends CSSParserToken {
748
- constructor() {
749
- super(...arguments);
750
- this.tokenType = "$=";
751
- }
752
- }
753
- class SubstringMatchToken extends CSSParserToken {
754
- constructor() {
755
- super(...arguments);
756
- this.tokenType = "*=";
757
- }
758
- }
759
- class ColumnToken extends CSSParserToken {
760
- constructor() {
761
- super(...arguments);
762
- this.tokenType = "||";
763
- }
764
- }
765
- class EOFToken extends CSSParserToken {
766
- constructor() {
767
- super(...arguments);
768
- this.tokenType = "EOF";
769
- }
770
- toSource() {
771
- return "";
772
- }
773
- }
774
- class DelimToken extends CSSParserToken {
775
- constructor(code) {
776
- super();
777
- this.tokenType = "DELIM";
778
- this.value = "";
779
- this.value = stringFromCode(code);
780
- }
781
- toString() {
782
- return "DELIM(" + this.value + ")";
783
- }
784
- toJSON() {
785
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
786
- json.value = this.value;
787
- return json;
788
- }
789
- toSource() {
790
- if (this.value === "\\")
791
- return "\\\n";
792
- else
793
- return this.value;
794
- }
795
- }
796
- class StringValuedToken extends CSSParserToken {
797
- constructor() {
798
- super(...arguments);
799
- this.value = "";
800
- }
801
- ASCIIMatch(str) {
802
- return this.value.toLowerCase() === str.toLowerCase();
803
- }
804
- toJSON() {
805
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
806
- json.value = this.value;
807
- return json;
808
- }
809
- }
810
- class IdentToken extends StringValuedToken {
811
- constructor(val) {
812
- super();
813
- this.tokenType = "IDENT";
814
- this.value = val;
815
- }
816
- toString() {
817
- return "IDENT(" + this.value + ")";
818
- }
819
- toSource() {
820
- return escapeIdent(this.value);
821
- }
822
- }
823
- class FunctionToken extends StringValuedToken {
824
- constructor(val) {
825
- super();
826
- this.tokenType = "FUNCTION";
827
- this.value = val;
828
- this.mirror = ")";
829
- }
830
- toString() {
831
- return "FUNCTION(" + this.value + ")";
832
- }
833
- toSource() {
834
- return escapeIdent(this.value) + "(";
835
- }
836
- }
837
- class AtKeywordToken extends StringValuedToken {
838
- constructor(val) {
839
- super();
840
- this.tokenType = "AT-KEYWORD";
841
- this.value = val;
842
- }
843
- toString() {
844
- return "AT(" + this.value + ")";
845
- }
846
- toSource() {
847
- return "@" + escapeIdent(this.value);
848
- }
849
- }
850
- class HashToken extends StringValuedToken {
851
- constructor(val) {
852
- super();
853
- this.tokenType = "HASH";
854
- this.value = val;
855
- this.type = "unrestricted";
856
- }
857
- toString() {
858
- return "HASH(" + this.value + ")";
859
- }
860
- toJSON() {
861
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
862
- json.value = this.value;
863
- json.type = this.type;
864
- return json;
865
- }
866
- toSource() {
867
- if (this.type === "id")
868
- return "#" + escapeIdent(this.value);
869
- else
870
- return "#" + escapeHash(this.value);
871
- }
872
- }
873
- class StringToken extends StringValuedToken {
874
- constructor(val) {
875
- super();
876
- this.tokenType = "STRING";
877
- this.value = val;
878
- }
879
- toString() {
880
- return '"' + escapeString(this.value) + '"';
881
- }
882
- }
883
- class URLToken extends StringValuedToken {
884
- constructor(val) {
885
- super();
886
- this.tokenType = "URL";
887
- this.value = val;
888
- }
889
- toString() {
890
- return "URL(" + this.value + ")";
891
- }
892
- toSource() {
893
- return 'url("' + escapeString(this.value) + '")';
894
- }
895
- }
896
- class NumberToken extends CSSParserToken {
897
- constructor() {
898
- super();
899
- this.tokenType = "NUMBER";
900
- this.type = "integer";
901
- this.repr = "";
902
- }
903
- toString() {
904
- if (this.type === "integer")
905
- return "INT(" + this.value + ")";
906
- return "NUMBER(" + this.value + ")";
907
- }
908
- toJSON() {
909
- const json = super.toJSON();
910
- json.value = this.value;
911
- json.type = this.type;
912
- json.repr = this.repr;
913
- return json;
914
- }
915
- toSource() {
916
- return this.repr;
917
- }
918
- }
919
- class PercentageToken extends CSSParserToken {
920
- constructor() {
921
- super();
922
- this.tokenType = "PERCENTAGE";
923
- this.repr = "";
924
- }
925
- toString() {
926
- return "PERCENTAGE(" + this.value + ")";
927
- }
928
- toJSON() {
929
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
930
- json.value = this.value;
931
- json.repr = this.repr;
932
- return json;
933
- }
934
- toSource() {
935
- return this.repr + "%";
936
- }
937
- }
938
- class DimensionToken extends CSSParserToken {
939
- constructor() {
940
- super();
941
- this.tokenType = "DIMENSION";
942
- this.type = "integer";
943
- this.repr = "";
944
- this.unit = "";
945
- }
946
- toString() {
947
- return "DIM(" + this.value + "," + this.unit + ")";
948
- }
949
- toJSON() {
950
- const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
951
- json.value = this.value;
952
- json.type = this.type;
953
- json.repr = this.repr;
954
- json.unit = this.unit;
955
- return json;
956
- }
957
- toSource() {
958
- const source = this.repr;
959
- let unit = escapeIdent(this.unit);
960
- if (unit[0].toLowerCase() === "e" && (unit[1] === "-" || between(unit.charCodeAt(1), 48, 57))) {
961
- unit = "\\65 " + unit.slice(1, unit.length);
962
- }
963
- return source + unit;
964
- }
965
- }
966
- function escapeIdent(string) {
967
- string = "" + string;
968
- let result = "";
969
- const firstcode = string.charCodeAt(0);
970
- for (let i = 0; i < string.length; i++) {
971
- const code = string.charCodeAt(i);
972
- if (code === 0)
973
- throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
974
- if (between(code, 1, 31) || code === 127 || i === 0 && between(code, 48, 57) || i === 1 && between(code, 48, 57) && firstcode === 45)
975
- result += "\\" + code.toString(16) + " ";
976
- else if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))
977
- result += string[i];
978
- else
979
- result += "\\" + string[i];
980
- }
981
- return result;
982
- }
983
- function escapeHash(string) {
984
- string = "" + string;
985
- let result = "";
986
- for (let i = 0; i < string.length; i++) {
987
- const code = string.charCodeAt(i);
988
- if (code === 0)
989
- throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
990
- if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))
991
- result += string[i];
992
- else
993
- result += "\\" + code.toString(16) + " ";
994
- }
995
- return result;
996
- }
997
- function escapeString(string) {
998
- string = "" + string;
999
- let result = "";
1000
- for (let i = 0; i < string.length; i++) {
1001
- const code = string.charCodeAt(i);
1002
- if (code === 0)
1003
- throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
1004
- if (between(code, 1, 31) || code === 127)
1005
- result += "\\" + code.toString(16) + " ";
1006
- else if (code === 34 || code === 92)
1007
- result += "\\" + string[i];
1008
- else
1009
- result += string[i];
1010
- }
1011
- return result;
1012
- }
1013
- // Annotate the CommonJS export names for ESM import in node:
1014
- 0 && (module.exports = {
1015
- AtKeywordToken,
1016
- BadStringToken,
1017
- BadURLToken,
1018
- CDCToken,
1019
- CDOToken,
1020
- CSSParserToken,
1021
- CloseCurlyToken,
1022
- CloseParenToken,
1023
- CloseSquareToken,
1024
- ColonToken,
1025
- ColumnToken,
1026
- CommaToken,
1027
- DashMatchToken,
1028
- DelimToken,
1029
- DimensionToken,
1030
- EOFToken,
1031
- FunctionToken,
1032
- GroupingToken,
1033
- HashToken,
1034
- IdentToken,
1035
- IncludeMatchToken,
1036
- InvalidCharacterError,
1037
- NumberToken,
1038
- OpenCurlyToken,
1039
- OpenParenToken,
1040
- OpenSquareToken,
1041
- PercentageToken,
1042
- PrefixMatchToken,
1043
- SemicolonToken,
1044
- StringToken,
1045
- StringValuedToken,
1046
- SubstringMatchToken,
1047
- SuffixMatchToken,
1048
- URLToken,
1049
- WhitespaceToken,
1050
- tokenize
1051
- });