From 4d0f740e972066310fa1ca133e3ae6ffab06b1ef Mon Sep 17 00:00:00 2001 From: Ryan Spore Date: Mon, 16 Dec 2024 11:48:52 -0800 Subject: [PATCH] Update Playwright to 1.49.1 Co-authored-by: Corey Innis --- README.md | 2 +- mix.exs | 4 +- mix.lock | 2 +- priv/static/node_modules/.package-lock.json | 18 +- .../playwright-core/ThirdPartyNotices.txt | 705 +- .../bin/reinstall_chrome_beta_linux.sh | 18 +- .../bin/reinstall_chrome_stable_linux.sh | 18 +- .../bin/reinstall_msedge_beta_linux.sh | 20 +- .../bin/reinstall_msedge_dev_linux.sh | 20 +- .../bin/reinstall_msedge_stable_linux.sh | 20 +- .../playwright-core/browsers.json | 48 +- .../playwright-core/lib/androidServerImpl.js | 2 +- .../playwright-core/lib/browserServerImpl.js | 2 +- .../playwright-core/lib/cli/driver.js | 4 +- .../playwright-core/lib/cli/program.js | 68 +- .../playwright-core/lib/client/api.js | 13 + .../lib/client/browserContext.js | 49 +- .../playwright-core/lib/client/browserType.js | 22 +- .../lib/client/channelOwner.js | 31 +- .../lib/client/clientInstrumentation.js | 24 +- .../playwright-core/lib/client/clock.js | 68 + .../playwright-core/lib/client/connection.js | 10 +- .../playwright-core/lib/client/electron.js | 12 +- .../lib/client/elementHandle.js | 58 +- .../lib/client/eventEmitter.js | 314 + .../playwright-core/lib/client/fetch.js | 46 +- .../playwright-core/lib/client/frame.js | 6 +- .../playwright-core/lib/client/jsHandle.js | 8 - .../playwright-core/lib/client/localUtils.js | 1 + .../playwright-core/lib/client/locator.js | 7 + .../playwright-core/lib/client/network.js | 216 +- .../playwright-core/lib/client/page.js | 63 +- .../playwright-core/lib/client/playwright.js | 6 + .../playwright-core/lib/client/tracing.js | 49 +- .../playwright-core/lib/client/waiter.js | 26 +- .../playwright-core/lib/common/socksProxy.js | 4 +- .../lib/generated/clockSource.js | 7 + .../lib/generated/consoleApiSource.js | 2 +- .../lib/generated/injectedScriptSource.js | 2 +- .../lib/generated/pollingRecorderSource.js | 7 + .../lib/generated/recorderSource.js | 7 - .../lib/generated/utilityScriptSource.js | 2 +- .../lib/generated/webSocketMockSource.js | 7 + .../lib/protocol/serializers.js | 23 +- .../playwright-core/lib/protocol/validator.js | 270 +- .../lib/server/ariaSnapshot.js | 33 + .../lib/server/bidi/bidiBrowser.js | 311 + .../lib/server/bidi/bidiChromium.js | 124 + .../lib/server/bidi/bidiConnection.js | 204 + .../lib/server/bidi/bidiExecutionContext.js | 156 + .../lib/server/bidi/bidiFirefox.js | 104 + .../lib/server/bidi/bidiInput.js | 158 + .../lib/server/bidi/bidiNetworkManager.js | 338 + .../lib/server/bidi/bidiOverCdp.js | 103 + .../lib/server/bidi/bidiPage.js | 529 ++ .../lib/server/bidi/bidiPdf.js | 140 + .../bidi/third_party/bidiDeserializer.js | 93 + .../server/bidi/third_party/bidiKeyboard.js | 238 + .../server/bidi/third_party/bidiProtocol.js | 139 + .../server/bidi/third_party/bidiSerializer.js | 144 + .../server/bidi/third_party/firefoxPrefs.js | 221 + .../playwright-core/lib/server/browser.js | 21 +- .../lib/server/browserContext.js | 73 +- .../playwright-core/lib/server/browserType.js | 86 +- .../lib/server/chromium/chromium.js | 41 +- .../lib/server/chromium/chromiumSwitches.js | 11 +- .../lib/server/chromium/crBrowser.js | 25 +- .../lib/server/chromium/crDragDrop.js | 57 +- .../lib/server/chromium/crExecutionContext.js | 20 - .../lib/server/chromium/crNetworkManager.js | 32 +- .../lib/server/chromium/crPage.js | 67 +- .../lib/server/chromium/crProtocolHelper.js | 4 +- .../lib/server/chromium/videoRecorder.js | 4 +- .../playwright-core/lib/server/clock.js | 125 + .../server/{recorder => codegen}/csharp.js | 62 +- .../lib/server/{recorder => codegen}/java.js | 48 +- .../{recorder => codegen}/javascript.js | 74 +- .../lib/server/{recorder => codegen}/jsonl.js | 4 +- .../lib/server/codegen/language.js | 88 + .../lib/server/codegen/languages.js | 30 + .../server/{recorder => codegen}/python.js | 67 +- .../recorderActions.js => codegen/types.js} | 0 .../playwright-core/lib/server/cookieStore.js | 73 + .../lib/server/debugController.js | 21 +- .../lib/server/deviceDescriptors.js | 13 +- .../lib/server/deviceDescriptorsSource.json | 358 +- .../playwright-core/lib/server/dialog.js | 1 + .../server/dispatchers/androidDispatcher.js | 15 +- .../dispatchers/browserContextDispatcher.js | 66 +- .../dispatchers/debugControllerDispatcher.js | 2 +- .../lib/server/dispatchers/dispatcher.js | 6 +- .../lib/server/dispatchers/frameDispatcher.js | 12 +- .../server/dispatchers/jsHandleDispatcher.js | 7 +- .../dispatchers/localUtilsDispatcher.js | 20 +- .../server/dispatchers/networkDispatchers.js | 4 +- .../lib/server/dispatchers/pageDispatcher.js | 9 + .../dispatchers/playwrightDispatcher.js | 2 + .../server/dispatchers/tracingDispatcher.js | 10 + .../dispatchers/webSocketRouteDispatcher.js | 189 + .../dispatchers/writableStreamDispatcher.js | 13 +- .../playwright-core/lib/server/dom.js | 257 +- .../playwright-core/lib/server/download.js | 11 +- .../lib/server/electron/electron.js | 28 +- .../playwright-core/lib/server/fetch.js | 282 +- .../lib/server/fileUploadUtils.js | 10 +- .../lib/server/firefox/ffBrowser.js | 62 +- .../lib/server/firefox/ffExecutionContext.js | 15 - .../lib/server/firefox/ffNetworkManager.js | 6 +- .../lib/server/firefox/ffPage.js | 32 +- .../lib/server/firefox/firefox.js | 20 +- .../lib/server/frameSelectors.js | 6 +- .../playwright-core/lib/server/frames.js | 285 +- .../lib/server/har/harTracer.js | 27 +- .../playwright-core/lib/server/index.js | 6 - .../playwright-core/lib/server/input.js | 6 +- .../lib/server/instrumentation.js | 4 - .../isomorphic/utilityScriptSerializers.js | 24 +- .../playwright-core/lib/server/javascript.js | 18 +- .../playwright-core/lib/server/launchApp.js | 11 +- .../playwright-core/lib/server/network.js | 18 +- .../playwright-core/lib/server/page.js | 133 +- .../playwright-core/lib/server/playwright.js | 10 +- .../playwright-core/lib/server/progress.js | 3 - .../playwright-core/lib/server/recorder.js | 540 +- .../lib/server/recorder/codeGenerator.js | 153 - .../lib/server/recorder/contextRecorder.js | 299 + .../lib/server/recorder/language.js | 44 - .../lib/server/recorder/recorderApp.js | 54 +- .../lib/server/recorder/recorderCollection.js | 116 + .../lib/server/recorder/recorderFrontend.js | 5 + .../server/recorder/recorderInTraceViewer.js | 144 + .../lib/server/recorder/recorderRunner.js | 155 + .../lib/server/recorder/recorderUtils.js | 65 + .../lib/server/recorder/throttledFile.js | 46 + .../lib/server/recorder/utils.js | 45 - .../lib/server/registry/index.js | 325 +- .../lib/server/registry/nativeDeps.js | 114 +- .../lib/server/screenshotter.js | 18 +- .../socksClientCertificatesInterceptor.js | 340 + .../lib/server/trace/recorder/snapshotter.js | 14 +- .../trace/recorder/snapshotterInjected.js | 24 +- .../lib/server/trace/recorder/tracing.js | 245 +- .../server/trace/test/inMemorySnapshotter.js | 8 +- .../lib/server/trace/viewer/traceViewer.js | 14 +- .../lib/server/webkit/webkit.js | 12 +- .../lib/server/webkit/wkBrowser.js | 37 +- .../lib/server/webkit/wkConnection.js | 2 +- .../lib/server/webkit/wkExecutionContext.js | 16 - .../server/webkit/wkInterceptableRequest.js | 12 +- .../lib/server/webkit/wkPage.js | 87 +- .../lib/server/webkit/wkProvisionalPage.js | 37 +- .../lib/third_party/diff_match_patch.js | 2222 ----- .../playwright-core/lib/utils/comparators.js | 42 +- .../playwright-core/lib/utils/crypto.js | 138 + .../playwright-core/lib/utils/debugLogger.js | 2 + .../playwright-core/lib/utils/env.js | 6 +- .../playwright-core/lib/utils/expectUtils.js | 33 + .../playwright-core/lib/utils/fileUtils.js | 141 +- .../lib/utils/happy-eyeballs.js | 44 +- .../playwright-core/lib/utils/hostPlatform.js | 25 +- .../playwright-core/lib/utils/httpServer.js | 28 +- .../playwright-core/lib/utils/index.js | 84 +- .../lib/utils/isomorphic/ariaSnapshot.js | 267 + .../lib/utils/isomorphic/cssTokenizer.js | 2 +- .../lib/utils/isomorphic/locatorGenerators.js | 51 +- .../lib/utils/isomorphic/locatorParser.js | 6 +- .../lib/utils/{ => isomorphic}/mimeType.js | 0 .../lib/utils/isomorphic/recorderUtils.js | 227 + .../lib/utils/isomorphic/stringUtils.js | 59 +- .../utils/{glob.js => isomorphic/urlMatch.js} | 41 + .../playwright-core/lib/utils/network.js | 44 +- .../playwright-core/lib/utils/sequence.js | 64 + .../playwright-core/lib/utils/stackTrace.js | 19 +- .../playwright-core/lib/utils/zones.js | 55 +- .../playwright-core/lib/utilsBundle.js | 10 +- .../lib/utilsBundleImpl/index.js | 221 +- .../lib/vite/htmlReport/index.html | 35 +- .../assets/codeMirrorModule-BwGUc5aQ.js | 24 - .../assets/codeMirrorModule-C5j27SYZ.js | 24 + .../assets/codicon-DCmgc-ay.ttf} | Bin 73464 -> 80340 bytes .../vite/recorder/assets/index-B5iDPo7P.css | 1 - .../vite/recorder/assets/index-BBRTdeT3.js | 47 - .../vite/recorder/assets/index-iA1aAGZg.css | 1 + .../vite/recorder/assets/index-m0XdVJHe.js | 184 + .../lib/vite/recorder/index.html | 4 +- .../assets/codeMirrorModule-BBCX0spr.js | 24 + .../assets/codeMirrorModule-ITBVLGwz.js | 24 - .../assets/inspectorTab-B4Iw34Ow.js | 68 + .../assets/testServerConnection-DeE2kSzz.js | 1 + .../assets/testServerConnection-Dj8RHZjQ.js | 69 - .../traceViewer/assets/workbench-DFlGYqou.js | 9 + .../codicon.DCmgc-ay.ttf} | Bin 73464 -> 80340 bytes .../lib/vite/traceViewer/embedded.CmarehFk.js | 2 + .../lib/vite/traceViewer/embedded.html | 18 + .../vite/traceViewer/embedded.w7WN2u1R.css | 1 + .../lib/vite/traceViewer/index.64QeAVuG.js | 2 - .../lib/vite/traceViewer/index.FBucu_gE.js | 2 + .../lib/vite/traceViewer/index.html | 30 +- .../traceViewer/inspectorTab.DEOUW62d.css | 1 + .../vite/traceViewer/recorder.B_SY1GJM.css | 0 .../lib/vite/traceViewer/recorder.CW_rzcEp.js | 2 + .../lib/vite/traceViewer/recorder.html | 17 + .../lib/vite/traceViewer/snapshot.html | 2 +- .../lib/vite/traceViewer/sw.bundle.js | 7 +- .../testServerConnection.0WapKERv.css | 1 - .../lib/vite/traceViewer/uiMode.Btn2TM9w.css | 1 - .../lib/vite/traceViewer/uiMode.Bug1KrYi.js | 10 - .../lib/vite/traceViewer/uiMode.CDUVjusr.js | 5 + .../lib/vite/traceViewer/uiMode.html | 11 +- .../lib/vite/traceViewer/uiMode.voC1ZiOQ.css | 1 + .../vite/traceViewer/workbench.C-zR9ysA.css | 1 + .../node_modules/playwright-core/package.json | 4 +- .../playwright-core/types/protocol.d.ts | 807 +- .../playwright-core/types/types.d.ts | 7627 ++++++++++------- priv/static/node_modules/playwright/README.md | 11 +- .../playwright/ThirdPartyNotices.txt | 357 +- .../node_modules/playwright/jsx-runtime.js | 3 +- .../playwright/lib/common/config.js | 37 +- .../playwright/lib/common/configLoader.js | 42 +- .../playwright/lib/common/esmLoaderHost.js | 20 +- .../playwright/lib/common/expectBundle.js | 6 +- .../playwright/lib/common/expectBundleImpl.js | 460 +- .../playwright/lib/common/fixtures.js | 59 +- .../playwright/lib/common/globals.js | 15 - .../playwright/lib/common/process.js | 36 +- .../playwright/lib/common/test.js | 4 +- .../playwright/lib/common/testType.js | 32 +- .../node_modules/playwright/lib/fsWatcher.js | 23 +- .../node_modules/playwright/lib/index.js | 142 +- .../playwright/lib/isomorphic/teleReceiver.js | 4 +- .../lib/isomorphic/teleSuiteUpdater.js | 144 + .../lib/isomorphic/testServerConnection.js | 57 +- .../playwright/lib/matchers/expect.js | 152 +- .../playwright/lib/matchers/matcherHint.js | 9 +- .../playwright/lib/matchers/matchers.js | 38 +- .../playwright/lib/matchers/toBeTruthy.js | 29 +- .../playwright/lib/matchers/toEqual.js | 39 +- .../lib/matchers/toMatchAriaSnapshot.js | 132 + .../lib/matchers/toMatchSnapshot.js | 156 +- .../playwright/lib/matchers/toMatchText.js | 72 +- .../playwright/lib/plugins/webServerPlugin.js | 20 +- .../node_modules/playwright/lib/program.js | 85 +- .../playwright/lib/reporters/base.js | 231 +- .../playwright/lib/reporters/dot.js | 3 - .../playwright/lib/reporters/empty.js | 17 +- .../playwright/lib/reporters/github.js | 38 +- .../playwright/lib/reporters/html.js | 121 +- .../lib/reporters/internalReporter.js | 42 +- .../playwright/lib/reporters/json.js | 7 +- .../playwright/lib/reporters/junit.js | 14 +- .../playwright/lib/reporters/line.js | 10 +- .../playwright/lib/reporters/list.js | 45 +- .../playwright/lib/reporters/merge.js | 39 +- .../playwright/lib/reporters/multiplexer.js | 59 +- .../playwright/lib/reporters/teleEmitter.js | 29 +- .../playwright/lib/runner/dispatcher.js | 42 +- .../playwright/lib/runner/failureTracker.js | 12 +- .../playwright/lib/runner/lastRun.js | 66 + .../playwright/lib/runner/loadUtils.js | 23 +- .../playwright/lib/runner/loaderHost.js | 1 - .../playwright/lib/runner/rebase.js | 100 + .../playwright/lib/runner/reporters.js | 30 +- .../playwright/lib/runner/runner.js | 141 +- .../playwright/lib/runner/taskRunner.js | 26 +- .../playwright/lib/runner/tasks.js | 256 +- .../playwright/lib/runner/testGroups.js | 4 +- .../playwright/lib/runner/testServer.js | 457 +- .../node_modules/playwright/lib/runner/vcs.js | 55 + .../playwright/lib/runner/watchMode.js | 501 +- .../playwright/lib/runner/workerHost.js | 2 +- .../lib/third_party/tsconfig-loader.js | 47 +- .../playwright/lib/transform/babelBundle.js | 6 +- .../lib/transform/babelBundleImpl.js | 254 +- .../lib/transform/compilationCache.js | 28 +- .../playwright/lib/transform/esmLoader.js | 9 +- .../playwright/lib/transform/transform.js | 102 +- .../node_modules/playwright/lib/util.js | 75 +- .../playwright/lib/utilsBundle.js | 5 +- .../playwright/lib/utilsBundleImpl.js | 96 +- .../playwright/lib/worker/fixtureRunner.js | 88 +- .../playwright/lib/worker/testInfo.js | 68 +- .../playwright/lib/worker/testTracing.js | 42 +- .../playwright/lib/worker/timeoutManager.js | 30 +- .../playwright/lib/worker/util.js | 29 + .../playwright/lib/worker/workerMain.js | 78 +- .../node_modules/playwright/package.json | 8 +- .../node_modules/playwright/types/test.d.ts | 2486 ++++-- .../playwright/types/testReporter.d.ts | 78 +- priv/static/package-lock.json | 20 +- priv/static/package.json | 2 +- 290 files changed, 20743 insertions(+), 11612 deletions(-) create mode 100644 priv/static/node_modules/playwright-core/lib/client/clock.js create mode 100644 priv/static/node_modules/playwright-core/lib/client/eventEmitter.js create mode 100644 priv/static/node_modules/playwright-core/lib/generated/clockSource.js create mode 100644 priv/static/node_modules/playwright-core/lib/generated/pollingRecorderSource.js delete mode 100644 priv/static/node_modules/playwright-core/lib/generated/recorderSource.js create mode 100644 priv/static/node_modules/playwright-core/lib/generated/webSocketMockSource.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/ariaSnapshot.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiChromium.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiConnection.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiInput.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiPage.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/bidiPdf.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/third_party/bidiDeserializer.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/clock.js rename priv/static/node_modules/playwright-core/lib/server/{recorder => codegen}/csharp.js (84%) rename priv/static/node_modules/playwright-core/lib/server/{recorder => codegen}/java.js (77%) rename priv/static/node_modules/playwright-core/lib/server/{recorder => codegen}/javascript.js (76%) rename priv/static/node_modules/playwright-core/lib/server/{recorder => codegen}/jsonl.js (88%) create mode 100644 priv/static/node_modules/playwright-core/lib/server/codegen/language.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/codegen/languages.js rename priv/static/node_modules/playwright-core/lib/server/{recorder => codegen}/python.js (81%) rename priv/static/node_modules/playwright-core/lib/server/{recorder/recorderActions.js => codegen/types.js} (100%) create mode 100644 priv/static/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js delete mode 100644 priv/static/node_modules/playwright-core/lib/server/recorder/codeGenerator.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/recorder/contextRecorder.js delete mode 100644 priv/static/node_modules/playwright-core/lib/server/recorder/language.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/recorder/recorderCollection.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/recorder/recorderFrontend.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/recorder/recorderInTraceViewer.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/recorder/recorderRunner.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/recorder/throttledFile.js delete mode 100644 priv/static/node_modules/playwright-core/lib/server/recorder/utils.js create mode 100644 priv/static/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js delete mode 100644 priv/static/node_modules/playwright-core/lib/third_party/diff_match_patch.js create mode 100644 priv/static/node_modules/playwright-core/lib/utils/expectUtils.js create mode 100644 priv/static/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js rename priv/static/node_modules/playwright-core/lib/utils/{ => isomorphic}/mimeType.js (100%) create mode 100644 priv/static/node_modules/playwright-core/lib/utils/isomorphic/recorderUtils.js rename priv/static/node_modules/playwright-core/lib/utils/{glob.js => isomorphic/urlMatch.js} (59%) create mode 100644 priv/static/node_modules/playwright-core/lib/utils/sequence.js delete mode 100644 priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BwGUc5aQ.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-C5j27SYZ.js rename priv/static/node_modules/playwright-core/lib/vite/{traceViewer/codicon.DMa5iZz2.ttf => recorder/assets/codicon-DCmgc-ay.ttf} (70%) delete mode 100644 priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-B5iDPo7P.css delete mode 100644 priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-BBRTdeT3.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-iA1aAGZg.css create mode 100644 priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-m0XdVJHe.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BBCX0spr.js delete mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-ITBVLGwz.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/inspectorTab-B4Iw34Ow.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/testServerConnection-DeE2kSzz.js delete mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/testServerConnection-Dj8RHZjQ.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/workbench-DFlGYqou.js rename priv/static/node_modules/playwright-core/lib/vite/{recorder/assets/codicon-DMa5iZz2.ttf => traceViewer/codicon.DCmgc-ay.ttf} (70%) create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/embedded.CmarehFk.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/embedded.html create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/embedded.w7WN2u1R.css delete mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/index.64QeAVuG.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/index.FBucu_gE.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/inspectorTab.DEOUW62d.css create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/recorder.B_SY1GJM.css create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/recorder.CW_rzcEp.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/recorder.html delete mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/testServerConnection.0WapKERv.css delete mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btn2TM9w.css delete mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Bug1KrYi.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CDUVjusr.js create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/uiMode.voC1ZiOQ.css create mode 100644 priv/static/node_modules/playwright-core/lib/vite/traceViewer/workbench.C-zR9ysA.css create mode 100644 priv/static/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js create mode 100644 priv/static/node_modules/playwright/lib/matchers/toMatchAriaSnapshot.js create mode 100644 priv/static/node_modules/playwright/lib/runner/lastRun.js create mode 100644 priv/static/node_modules/playwright/lib/runner/rebase.js create mode 100644 priv/static/node_modules/playwright/lib/runner/vcs.js create mode 100644 priv/static/node_modules/playwright/lib/worker/util.js diff --git a/README.md b/README.md index 09eb9e08..902f9471 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The package can be installed by adding `playwright` to your list of dependencies ```elixir def deps do [ - {:playwright, "~> 1.44.0-alpha.4"} + {:playwright, "~> 1.49.1-alpha.1"} ] end ``` diff --git a/mix.exs b/mix.exs index 0bd2810b..b6d387f7 100644 --- a/mix.exs +++ b/mix.exs @@ -20,7 +20,7 @@ defmodule Playwright.MixProject do preferred_cli_env: [credo: :test, dialyzer: :test, docs: :docs], source_url: @source_url, start_permanent: Mix.env() == :prod, - version: "1.44.0-alpha.4" + version: "1.49.1-alpha.1" ] end @@ -54,7 +54,7 @@ defmodule Playwright.MixProject do {:gun, "~> 1.3.3"}, {:jason, "~> 1.4"}, {:mix_audit, "~> 1.0", only: [:dev, :test], runtime: false}, - {:playwright_assets, "1.44.0", only: [:test]}, + {:playwright_assets, "1.49.1", only: [:test]}, {:recase, "~> 0.7"}, {:uuid, "~> 1.1"} ] diff --git a/mix.lock b/mix.lock index 6a3aed6b..c5b5b771 100644 --- a/mix.lock +++ b/mix.lock @@ -18,7 +18,7 @@ "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, "mix_audit": {:hex, :mix_audit, "1.0.1", "9dd114408961b8db214f42fee40b2f632ecd7e4fd29500403068c82c77db8361", [:make, :mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.8.0", [hex: :yaml_elixir, repo: "hexpm", optional: false]}], "hexpm", "65066bb7757078aa49faaa2f7c1e2d52f56ff6fe6cff01723dbaf5be2a75771b"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, - "playwright_assets": {:hex, :playwright_assets, "1.44.0", "87276d2cf800c921fa475684699aa42df64d5df09fc3098ac81485be0feb8264", [:mix], [{:cowlib, "~> 2.7.3", [hex: :cowlib, repo: "hexpm", optional: false]}, {:plug, "~> 1.12", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.1.3", [hex: :plug_cowboy, repo: "hexpm", optional: false]}], "hexpm", "0e7788596f247db2c312992b70613a53a24b9f20d7dedeb76e37549f780066e8"}, + "playwright_assets": {:hex, :playwright_assets, "1.49.1", "22f633af14bf2c16a4dcf64c9e08c21fe6e16750705ac7767f07797faf4d5756", [:mix], [{:cowlib, "~> 2.7.3", [hex: :cowlib, repo: "hexpm", optional: false]}, {:plug, "~> 1.12", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.1.3", [hex: :plug_cowboy, repo: "hexpm", optional: false]}], "hexpm", "688727f5bcbf8d6b8b83f5febc207130c83fb7e00e83853ab8c9d75c9a1642d4"}, "plug": {:hex, :plug, "1.16.0", "1d07d50cb9bb05097fdf187b31cf087c7297aafc3fed8299aac79c128a707e47", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cbf53aa1f5c4d758a7559c0bd6d59e286c2be0c6a1fac8cc3eee2f638243b93e"}, "plug_cowboy": {:hex, :plug_cowboy, "2.1.3", "38999a3e85e39f0e6bdfdf820761abac61edde1632cfebbacc445cdcb6ae1333", [:mix], [{:cowboy, "~> 2.5", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "056f41f814dbb38ea44613e0f613b3b2b2f2c6afce64126e252837669eba84db"}, "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, diff --git a/priv/static/node_modules/.package-lock.json b/priv/static/node_modules/.package-lock.json index 4a8bef64..82b13734 100644 --- a/priv/static/node_modules/.package-lock.json +++ b/priv/static/node_modules/.package-lock.json @@ -17,31 +17,31 @@ } }, "node_modules/playwright": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.44.0.tgz", - "integrity": "sha512-F9b3GUCLQ3Nffrfb6dunPOkE5Mh68tR7zN32L4jCk4FjQamgesGay7/dAAe1WaMEGV04DkdJfcJzjoCKygUaRQ==", + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.1.tgz", + "integrity": "sha512-VYL8zLoNTBxVOrJBbDuRgDWa3i+mfQgDTrL8Ah9QXZ7ax4Dsj0MSq5bYgytRnDVVe+njoKnfsYkH3HzqVj5UZA==", "dependencies": { - "playwright-core": "1.44.0" + "playwright-core": "1.49.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.0.tgz", - "integrity": "sha512-ZTbkNpFfYcGWohvTTl+xewITm7EOuqIqex0c7dNZ+aXsbrLj0qI8XlGKfPpipjm0Wny/4Lt4CJsWJk1stVS5qQ==", + "version": "1.49.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.1.tgz", + "integrity": "sha512-BzmpVcs4kE2CH15rWfzpjzVGhWERJfmnXmniSyKeRZUs9Ws65m+RGIi7mjJK/euCegfn3i7jvqWeWyHe9y3Vgg==", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } } } diff --git a/priv/static/node_modules/playwright-core/ThirdPartyNotices.txt b/priv/static/node_modules/playwright-core/ThirdPartyNotices.txt index 6480e85f..89a6418a 100644 --- a/priv/static/node_modules/playwright-core/ThirdPartyNotices.txt +++ b/priv/static/node_modules/playwright-core/ThirdPartyNotices.txt @@ -6,27 +6,30 @@ This project incorporates components from the projects listed below. The origina - @types/node@17.0.24 (https://github.com/DefinitelyTyped/DefinitelyTyped) - @types/yauzl@2.10.0 (https://github.com/DefinitelyTyped/DefinitelyTyped) -- agent-base@6.0.2 (https://github.com/TooTallNate/node-agent-base) +- agent-base@7.1.1 (https://github.com/TooTallNate/proxy-agents) - balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match) - brace-expansion@1.1.11 (https://github.com/juliangruber/brace-expansion) - buffer-crc32@0.2.13 (https://github.com/brianloveswords/buffer-crc32) -- codemirror-shadow-1@0.0.1 (https://github.com/codemirror/CodeMirror) +- codemirror@5.65.18 (https://github.com/codemirror/CodeMirror) - colors@1.4.0 (https://github.com/Marak/colors.js) - commander@8.3.0 (https://github.com/tj/commander.js) - concat-map@0.0.1 (https://github.com/substack/node-concat-map) - debug@4.3.4 (https://github.com/debug-js/debug) - define-lazy-prop@2.0.0 (https://github.com/sindresorhus/define-lazy-prop) +- diff@7.0.0 (https://github.com/kpdecker/jsdiff) +- dotenv@16.4.5 (https://github.com/motdotla/dotenv) - end-of-stream@1.4.4 (https://github.com/mafintosh/end-of-stream) - escape-string-regexp@2.0.0 (https://github.com/sindresorhus/escape-string-regexp) - extract-zip@2.0.1 (https://github.com/maxogden/extract-zip) - fd-slicer@1.1.0 (https://github.com/andrewrk/node-fd-slicer) - get-stream@5.2.0 (https://github.com/sindresorhus/get-stream) - graceful-fs@4.2.10 (https://github.com/isaacs/node-graceful-fs) -- https-proxy-agent@5.0.0 (https://github.com/TooTallNate/node-https-proxy-agent) -- ip@2.0.1 (https://github.com/indutny/node-ip) +- https-proxy-agent@7.0.5 (https://github.com/TooTallNate/proxy-agents) +- ip-address@9.0.5 (https://github.com/beaugunderson/ip-address) - is-docker@2.2.1 (https://github.com/sindresorhus/is-docker) - is-wsl@2.2.0 (https://github.com/sindresorhus/is-wsl) - jpeg-js@0.4.4 (https://github.com/eugeneware/jpeg-js) +- jsbn@1.1.0 (https://github.com/andyperlitch/jsbn) - mime@3.0.0 (https://github.com/broofa/mime) - minimatch@3.1.2 (https://github.com/isaacs/minimatch) - ms@2.1.2 (https://github.com/zeit/ms) @@ -40,11 +43,13 @@ This project incorporates components from the projects listed below. The origina - retry@0.12.0 (https://github.com/tim-kos/node-retry) - signal-exit@3.0.7 (https://github.com/tapjs/signal-exit) - smart-buffer@4.2.0 (https://github.com/JoshGlazebrook/smart-buffer) -- socks-proxy-agent@6.1.1 (https://github.com/TooTallNate/node-socks-proxy-agent) -- socks@2.7.0 (https://github.com/JoshGlazebrook/socks) +- socks-proxy-agent@8.0.4 (https://github.com/TooTallNate/proxy-agents) +- socks@2.8.3 (https://github.com/JoshGlazebrook/socks) +- sprintf-js@1.1.3 (https://github.com/alexei/sprintf.js) - stack-utils@2.0.5 (https://github.com/tapjs/stack-utils) - wrappy@1.0.2 (https://github.com/npm/wrappy) -- ws@8.4.2 (https://github.com/websockets/ws) +- ws@8.17.1 (https://github.com/websockets/ws) +- yaml@2.6.0 (https://github.com/eemeli/yaml) - yauzl@2.10.0 (https://github.com/thejoshwolfe/yauzl) - yazl@2.5.1 (https://github.com/thejoshwolfe/yazl) @@ -100,128 +105,11 @@ MIT License ========================================= END OF @types/yauzl@2.10.0 AND INFORMATION -%% agent-base@6.0.2 NOTICES AND INFORMATION BEGIN HERE +%% agent-base@7.1.1 NOTICES AND INFORMATION BEGIN HERE ========================================= -agent-base -========== -### Turn a function into an [`http.Agent`][http.Agent] instance -[![Build Status](https://github.com/TooTallNate/node-agent-base/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI) - -This module provides an `http.Agent` generator. That is, you pass it an async -callback function, and it returns a new `http.Agent` instance that will invoke the -given callback function when sending outbound HTTP requests. - -#### Some subclasses: - -Here's some more interesting uses of `agent-base`. -Send a pull request to list yours! - - * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints - * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints - * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS - * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install agent-base -``` - - -Example -------- - -Here's a minimal example that creates a new `net.Socket` connection to the server -for every HTTP request (i.e. the equivalent of `agent: false` option): - -```js -var net = require('net'); -var tls = require('tls'); -var url = require('url'); -var http = require('http'); -var agent = require('agent-base'); - -var endpoint = 'http://nodejs.org/api/'; -var parsed = url.parse(endpoint); - -// This is the important part! -parsed.agent = agent(function (req, opts) { - var socket; - // `secureEndpoint` is true when using the https module - if (opts.secureEndpoint) { - socket = tls.connect(opts); - } else { - socket = net.connect(opts); - } - return socket; -}); - -// Everything else works just like normal... -http.get(parsed, function (res) { - console.log('"response" event!', res.headers); - res.pipe(process.stdout); -}); -``` - -Returning a Promise or using an `async` function is also supported: - -```js -agent(async function (req, opts) { - await sleep(1000); - // etc… -}); -``` - -Return another `http.Agent` instance to "pass through" the responsibility -for that HTTP request to that agent: - -```js -agent(function (req, opts) { - return opts.secureEndpoint ? https.globalAgent : http.globalAgent; -}); -``` - - -API ---- - -## Agent(Function callback[, Object options]) → [http.Agent][] - -Creates a base `http.Agent` that will execute the callback function `callback` -for every HTTP request that it is used as the `agent` for. The callback function -is responsible for creating a `stream.Duplex` instance of some kind that will be -used as the underlying socket in the HTTP request. - -The `options` object accepts the following properties: - - * `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional). - -The callback function should have the following signature: - -### callback(http.ClientRequest req, Object options, Function cb) → undefined - -The ClientRequest `req` can be accessed to read request headers and -and the path, etc. The `options` object contains the options passed -to the `http.request()`/`https.request()` function call, and is formatted -to be directly passed to `net.connect()`/`tls.connect()`, or however -else you want a Socket to be created. Pass the created socket to -the callback function `cb` once created, and the HTTP request will -continue to proceed. - -If the `https` module is used to invoke the HTTP request, then the -`secureEndpoint` property on `options` _will be set to `true`_. - - -License -------- - (The MIT License) -Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net> +Copyright (c) 2013 Nathan Rajlich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -241,14 +129,8 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent -[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent -[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent -[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent -[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent ========================================= -END OF agent-base@6.0.2 AND INFORMATION +END OF agent-base@7.1.1 AND INFORMATION %% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE ========================================= @@ -326,7 +208,7 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL ========================================= END OF buffer-crc32@0.2.13 AND INFORMATION -%% codemirror-shadow-1@0.0.1 NOTICES AND INFORMATION BEGIN HERE +%% codemirror@5.65.18 NOTICES AND INFORMATION BEGIN HERE ========================================= MIT License @@ -350,7 +232,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========================================= -END OF codemirror-shadow-1@0.0.1 AND INFORMATION +END OF codemirror@5.65.18 AND INFORMATION %% colors@1.4.0 NOTICES AND INFORMATION BEGIN HERE ========================================= @@ -470,6 +352,68 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ========================================= END OF define-lazy-prop@2.0.0 AND INFORMATION +%% diff@7.0.0 NOTICES AND INFORMATION BEGIN HERE +========================================= +BSD 3-Clause License + +Copyright (c) 2009-2015, Kevin Decker +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +========================================= +END OF diff@7.0.0 AND INFORMATION + +%% dotenv@16.4.5 NOTICES AND INFORMATION BEGIN HERE +========================================= +Copyright (c) 2015, Scott Motte +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +========================================= +END OF dotenv@16.4.5 AND INFORMATION + %% end-of-stream@1.4.4 NOTICES AND INFORMATION BEGIN HERE ========================================= The MIT License (MIT) @@ -598,124 +542,11 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ========================================= END OF graceful-fs@4.2.10 AND INFORMATION -%% https-proxy-agent@5.0.0 NOTICES AND INFORMATION BEGIN HERE +%% https-proxy-agent@7.0.5 NOTICES AND INFORMATION BEGIN HERE ========================================= -https-proxy-agent -================ -### An HTTP(s) proxy `http.Agent` implementation for HTTPS -[![Build Status](https://github.com/TooTallNate/node-https-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-https-proxy-agent/actions?workflow=Node+CI) - -This module provides an `http.Agent` implementation that connects to a specified -HTTP or HTTPS proxy server, and can be used with the built-in `https` module. - -Specifically, this `Agent` implementation connects to an intermediary "proxy" -server and issues the [CONNECT HTTP method][CONNECT], which tells the proxy to -open a direct TCP connection to the destination server. - -Since this agent implements the CONNECT HTTP method, it also works with other -protocols that use this method when connecting over proxies (i.e. WebSockets). -See the "Examples" section below for more. - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install https-proxy-agent -``` - - -Examples --------- - -#### `https` module example - -``` js -var url = require('url'); -var https = require('https'); -var HttpsProxyAgent = require('https-proxy-agent'); - -// HTTP/HTTPS proxy to connect to -var proxy = process.env.http_proxy || 'http://168.63.76.32:3128'; -console.log('using proxy server %j', proxy); - -// HTTPS endpoint for the proxy to connect to -var endpoint = process.argv[2] || 'https://graph.facebook.com/tootallnate'; -console.log('attempting to GET %j', endpoint); -var options = url.parse(endpoint); - -// create an instance of the `HttpsProxyAgent` class with the proxy server information -var agent = new HttpsProxyAgent(proxy); -options.agent = agent; - -https.get(options, function (res) { - console.log('"response" event!', res.headers); - res.pipe(process.stdout); -}); -``` - -#### `ws` WebSocket connection example - -``` js -var url = require('url'); -var WebSocket = require('ws'); -var HttpsProxyAgent = require('https-proxy-agent'); - -// HTTP/HTTPS proxy to connect to -var proxy = process.env.http_proxy || 'http://168.63.76.32:3128'; -console.log('using proxy server %j', proxy); - -// WebSocket endpoint for the proxy to connect to -var endpoint = process.argv[2] || 'ws://echo.websocket.org'; -var parsed = url.parse(endpoint); -console.log('attempting to connect to WebSocket %j', endpoint); - -// create an instance of the `HttpsProxyAgent` class with the proxy server information -var options = url.parse(proxy); - -var agent = new HttpsProxyAgent(options); - -// finally, initiate the WebSocket connection -var socket = new WebSocket(endpoint, { agent: agent }); - -socket.on('open', function () { - console.log('"open" event!'); - socket.send('hello world'); -}); - -socket.on('message', function (data, flags) { - console.log('"message" event! %j %j', data, flags); - socket.close(); -}); -``` - -API ---- - -### new HttpsProxyAgent(Object options) - -The `HttpsProxyAgent` class implements an `http.Agent` subclass that connects -to the specified "HTTP(s) proxy server" in order to proxy HTTPS and/or WebSocket -requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT]. - -The `options` argument may either be a string URI of the proxy server to use, or an -"options" object with more specific properties: - - * `host` - String - Proxy host to connect to (may use `hostname` as well). Required. - * `port` - Number - Proxy port to connect to. Required. - * `protocol` - String - If `https:`, then use TLS to connect to the proxy. - * `headers` - Object - Additional HTTP headers to be sent on the HTTP CONNECT method. - * Any other options given are passed to the `net.connect()`/`tls.connect()` functions. - - -License -------- - (The MIT License) -Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net> +Copyright (c) 2013 Nathan Rajlich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -735,105 +566,32 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -[CONNECT]: http://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_Tunneling ========================================= -END OF https-proxy-agent@5.0.0 AND INFORMATION +END OF https-proxy-agent@7.0.5 AND INFORMATION -%% ip@2.0.1 NOTICES AND INFORMATION BEGIN HERE +%% ip-address@9.0.5 NOTICES AND INFORMATION BEGIN HERE ========================================= -# IP -[![](https://badge.fury.io/js/ip.svg)](https://www.npmjs.com/package/ip) - -IP address utilities for node.js - -## Installation - -### npm -```shell -npm install ip -``` - -### git +Copyright (C) 2011 by Beau Gunderson -```shell -git clone https://github.com/indutny/node-ip.git -``` - -## Usage -Get your ip address, compare ip addresses, validate ip addresses, etc. - -```js -var ip = require('ip'); - -ip.address() // my ip address -ip.isEqual('::1', '::0:1'); // true -ip.toBuffer('127.0.0.1') // Buffer([127, 0, 0, 1]) -ip.toString(new Buffer([127, 0, 0, 1])) // 127.0.0.1 -ip.fromPrefixLen(24) // 255.255.255.0 -ip.mask('192.168.1.134', '255.255.255.0') // 192.168.1.0 -ip.cidr('192.168.1.134/26') // 192.168.1.128 -ip.not('255.255.255.0') // 0.0.0.255 -ip.or('192.168.1.134', '0.0.0.255') // 192.168.1.255 -ip.isPrivate('127.0.0.1') // true -ip.isV4Format('127.0.0.1'); // true -ip.isV6Format('::ffff:127.0.0.1'); // true - -// operate on buffers in-place -var buf = new Buffer(128); -var offset = 64; -ip.toBuffer('127.0.0.1', buf, offset); // [127, 0, 0, 1] at offset 64 -ip.toString(buf, offset, 4); // '127.0.0.1' - -// subnet information -ip.subnet('192.168.1.134', '255.255.255.192') -// { networkAddress: '192.168.1.128', -// firstAddress: '192.168.1.129', -// lastAddress: '192.168.1.190', -// broadcastAddress: '192.168.1.191', -// subnetMask: '255.255.255.192', -// subnetMaskLength: 26, -// numHosts: 62, -// length: 64, -// contains: function(addr){...} } -ip.cidrSubnet('192.168.1.134/26') -// Same as previous. - -// range checking -ip.cidrSubnet('192.168.1.134/26').contains('192.168.1.190') // true - - -// ipv4 long conversion -ip.toLong('127.0.0.1'); // 2130706433 -ip.fromLong(2130706433); // '127.0.0.1' -``` - -### License - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2012. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. ========================================= -END OF ip@2.0.1 AND INFORMATION +END OF ip-address@9.0.5 AND INFORMATION %% is-docker@2.2.1 NOTICES AND INFORMATION BEGIN HERE ========================================= @@ -893,6 +651,51 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ========================================= END OF jpeg-js@0.4.4 AND INFORMATION +%% jsbn@1.1.0 NOTICES AND INFORMATION BEGIN HERE +========================================= +Licensing +--------- + +This software is covered under the following copyright: + +/* + * Copyright (c) 2003-2005 Tom Wu + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * + * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF + * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * In addition, the following condition applies: + * + * All redistributions must retain an intact copy of this copyright notice + * and disclaimer. + */ + +Address all questions regarding this license to: + + Tom Wu + tjw@cs.Stanford.EDU +========================================= +END OF jsbn@1.1.0 AND INFORMATION + %% mime@3.0.0 NOTICES AND INFORMATION BEGIN HERE ========================================= The MIT License (MIT) @@ -1202,141 +1005,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========================================= END OF smart-buffer@4.2.0 AND INFORMATION -%% socks-proxy-agent@6.1.1 NOTICES AND INFORMATION BEGIN HERE +%% socks-proxy-agent@8.0.4 NOTICES AND INFORMATION BEGIN HERE ========================================= -socks-proxy-agent -================ -### A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS -[![Build Status](https://github.com/TooTallNate/node-socks-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-socks-proxy-agent/actions?workflow=Node+CI) - -This module provides an `http.Agent` implementation that connects to a -specified SOCKS proxy server, and can be used with the built-in `http` -and `https` modules. - -It can also be used in conjunction with the `ws` module to establish a WebSocket -connection over a SOCKS proxy. See the "Examples" section below. - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install socks-proxy-agent -``` - - -Examples --------- - -#### TypeScript example - -```ts -import https from 'https'; -import { SocksProxyAgent } from 'socks-proxy-agent'; - -const info = { - host: 'br41.nordvpn.com', - userId: 'your-name@gmail.com', - password: 'abcdef12345124' -}; -const agent = new SocksProxyAgent(info); - -https.get('https://jsonip.org', { agent }, (res) => { - console.log(res.headers); - res.pipe(process.stdout); -}); -``` - -#### `http` module example - -```js -var url = require('url'); -var http = require('http'); -var SocksProxyAgent = require('socks-proxy-agent'); - -// SOCKS proxy to connect to -var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080'; -console.log('using proxy server %j', proxy); - -// HTTP endpoint for the proxy to connect to -var endpoint = process.argv[2] || 'http://nodejs.org/api/'; -console.log('attempting to GET %j', endpoint); -var opts = url.parse(endpoint); - -// create an instance of the `SocksProxyAgent` class with the proxy server information -var agent = new SocksProxyAgent(proxy); -opts.agent = agent; - -http.get(opts, function (res) { - console.log('"response" event!', res.headers); - res.pipe(process.stdout); -}); -``` - -#### `https` module example - -```js -var url = require('url'); -var https = require('https'); -var SocksProxyAgent = require('socks-proxy-agent'); - -// SOCKS proxy to connect to -var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080'; -console.log('using proxy server %j', proxy); - -// HTTP endpoint for the proxy to connect to -var endpoint = process.argv[2] || 'https://encrypted.google.com/'; -console.log('attempting to GET %j', endpoint); -var opts = url.parse(endpoint); - -// create an instance of the `SocksProxyAgent` class with the proxy server information -var agent = new SocksProxyAgent(proxy); -opts.agent = agent; - -https.get(opts, function (res) { - console.log('"response" event!', res.headers); - res.pipe(process.stdout); -}); -``` - -#### `ws` WebSocket connection example - -``` js -var WebSocket = require('ws'); -var SocksProxyAgent = require('socks-proxy-agent'); - -// SOCKS proxy to connect to -var proxy = process.env.socks_proxy || 'socks://127.0.0.1:1080'; -console.log('using proxy server %j', proxy); - -// WebSocket endpoint for the proxy to connect to -var endpoint = process.argv[2] || 'ws://echo.websocket.org'; -console.log('attempting to connect to WebSocket %j', endpoint); - -// create an instance of the `SocksProxyAgent` class with the proxy server information -var agent = new SocksProxyAgent(proxy); - -// initiate the WebSocket connection -var socket = new WebSocket(endpoint, { agent: agent }); - -socket.on('open', function () { - console.log('"open" event!'); - socket.send('hello world'); -}); - -socket.on('message', function (data, flags) { - console.log('"message" event! %j %j', data, flags); - socket.close(); -}); -``` - -License -------- - (The MIT License) -Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net> +Copyright (c) 2013 Nathan Rajlich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -1357,9 +1030,9 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========================================= -END OF socks-proxy-agent@6.1.1 AND INFORMATION +END OF socks-proxy-agent@8.0.4 AND INFORMATION -%% socks@2.7.0 NOTICES AND INFORMATION BEGIN HERE +%% socks@2.8.3 NOTICES AND INFORMATION BEGIN HERE ========================================= The MIT License (MIT) @@ -1382,7 +1055,36 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ========================================= -END OF socks@2.7.0 AND INFORMATION +END OF socks@2.8.3 AND INFORMATION + +%% sprintf-js@1.1.3 NOTICES AND INFORMATION BEGIN HERE +========================================= +Copyright (c) 2007-present, Alexandru Mărășteanu +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of this software nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +========================================= +END OF sprintf-js@1.1.3 AND INFORMATION %% stack-utils@2.0.5 NOTICES AND INFORMATION BEGIN HERE ========================================= @@ -1430,29 +1132,48 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ========================================= END OF wrappy@1.0.2 AND INFORMATION -%% ws@8.4.2 NOTICES AND INFORMATION BEGIN HERE +%% ws@8.17.1 NOTICES AND INFORMATION BEGIN HERE ========================================= Copyright (c) 2011 Einar Otto Stangvik +Copyright (c) 2013 Arnout Kazemier and contributors +Copyright (c) 2016 Luigi Pinca and contributors -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF ws@8.17.1 AND INFORMATION + +%% yaml@2.6.0 NOTICES AND INFORMATION BEGIN HERE +========================================= +Copyright Eemeli Aro + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. ========================================= -END OF ws@8.4.2 AND INFORMATION +END OF yaml@2.6.0 AND INFORMATION %% yauzl@2.10.0 NOTICES AND INFORMATION BEGIN HERE ========================================= @@ -1508,6 +1229,6 @@ END OF yazl@2.5.1 AND INFORMATION SUMMARY BEGIN HERE ========================================= -Total Packages: 43 +Total Packages: 48 ========================================= END OF SUMMARY \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh b/priv/static/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh index 14c68459..0451bda3 100755 --- a/priv/static/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +++ b/priv/static/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh @@ -7,15 +7,17 @@ if [[ $(arch) == "aarch64" ]]; then exit 1 fi -if [[ ! -f "/etc/os-release" ]]; then - echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" - exit 1 -fi +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi -ID=$(bash -c 'source /etc/os-release && echo $ID') -if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then - echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" - exit 1 + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi fi # 1. make sure to remove old beta if any. diff --git a/priv/static/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh b/priv/static/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh index 28a19699..78f1d413 100755 --- a/priv/static/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +++ b/priv/static/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh @@ -7,15 +7,17 @@ if [[ $(arch) == "aarch64" ]]; then exit 1 fi -if [[ ! -f "/etc/os-release" ]]; then - echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" - exit 1 -fi +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi -ID=$(bash -c 'source /etc/os-release && echo $ID') -if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then - echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" - exit 1 + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi fi # 1. make sure to remove old stable if any. diff --git a/priv/static/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh b/priv/static/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh index ff8c3c9f..ececd05a 100755 --- a/priv/static/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +++ b/priv/static/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh @@ -8,15 +8,17 @@ if [[ $(arch) == "aarch64" ]]; then exit 1 fi -if [[ ! -f "/etc/os-release" ]]; then - echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" - exit 1 -fi - -ID=$(bash -c 'source /etc/os-release && echo $ID') -if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then - echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" - exit 1 +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi + + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi fi # 1. make sure to remove old beta if any. diff --git a/priv/static/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh b/priv/static/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh index 6a026722..6ab84c31 100755 --- a/priv/static/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +++ b/priv/static/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh @@ -8,15 +8,17 @@ if [[ $(arch) == "aarch64" ]]; then exit 1 fi -if [[ ! -f "/etc/os-release" ]]; then - echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" - exit 1 -fi - -ID=$(bash -c 'source /etc/os-release && echo $ID') -if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then - echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" - exit 1 +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi + + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi fi # 1. make sure to remove old dev if any. diff --git a/priv/static/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh b/priv/static/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh index 1f2c9bf3..e66f85bb 100755 --- a/priv/static/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +++ b/priv/static/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh @@ -8,15 +8,17 @@ if [[ $(arch) == "aarch64" ]]; then exit 1 fi -if [[ ! -f "/etc/os-release" ]]; then - echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" - exit 1 -fi - -ID=$(bash -c 'source /etc/os-release && echo $ID') -if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then - echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" - exit 1 +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi + + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi fi # 1. make sure to remove old stable if any. diff --git a/priv/static/node_modules/playwright-core/browsers.json b/priv/static/node_modules/playwright-core/browsers.json index e49f9fd6..81f1d3af 100644 --- a/priv/static/node_modules/playwright-core/browsers.json +++ b/priv/static/node_modules/playwright-core/browsers.json @@ -3,54 +3,62 @@ "browsers": [ { "name": "chromium", - "revision": "1117", + "revision": "1148", "installByDefault": true, - "browserVersion": "125.0.6422.26" + "browserVersion": "131.0.6778.33" + }, + { + "name": "chromium-headless-shell", + "revision": "1148", + "installByDefault": true, + "browserVersion": "131.0.6778.33" }, { "name": "chromium-tip-of-tree", - "revision": "1215", + "revision": "1277", "installByDefault": false, - "browserVersion": "126.0.6439.0" + "browserVersion": "132.0.6834.0" }, { "name": "firefox", - "revision": "1449", + "revision": "1466", "installByDefault": true, - "browserVersion": "125.0.1" - }, - { - "name": "firefox-asan", - "revision": "1449", - "installByDefault": false, - "browserVersion": "125.0.1" + "browserVersion": "132.0" }, { "name": "firefox-beta", - "revision": "1449", + "revision": "1465", "installByDefault": false, - "browserVersion": "126.0b1" + "browserVersion": "132.0b8" }, { "name": "webkit", - "revision": "2003", + "revision": "2104", "installByDefault": true, "revisionOverrides": { "mac10.14": "1446", "mac10.15": "1616", "mac11": "1816", - "mac11-arm64": "1816" + "mac11-arm64": "1816", + "mac12": "2009", + "mac12-arm64": "2009", + "ubuntu20.04-x64": "2092", + "ubuntu20.04-arm64": "2092" }, - "browserVersion": "17.4" + "browserVersion": "18.2" }, { "name": "ffmpeg", - "revision": "1009", - "installByDefault": true + "revision": "1010", + "installByDefault": true, + "revisionOverrides": { + "mac12": "1010", + "mac12-arm64": "1010" + } }, { "name": "android", - "revision": "1000", + "revision": "1001", "installByDefault": false } ] diff --git a/priv/static/node_modules/playwright-core/lib/androidServerImpl.js b/priv/static/node_modules/playwright-core/lib/androidServerImpl.js index 6cedb97e..72556cb6 100644 --- a/priv/static/node_modules/playwright-core/lib/androidServerImpl.js +++ b/priv/static/node_modules/playwright-core/lib/androidServerImpl.js @@ -52,7 +52,7 @@ class AndroidServerLauncherImpl { maxConnections: 1, preLaunchedAndroidDevice: device }); - const wsEndpoint = await server.listen(options.port); + const wsEndpoint = await server.listen(options.port, options.host); // 3. Return the BrowserServer interface const browserServer = new _utilsBundle.ws.EventEmitter(); diff --git a/priv/static/node_modules/playwright-core/lib/browserServerImpl.js b/priv/static/node_modules/playwright-core/lib/browserServerImpl.js index 951e22bb..f6101fe3 100644 --- a/priv/static/node_modules/playwright-core/lib/browserServerImpl.js +++ b/priv/static/node_modules/playwright-core/lib/browserServerImpl.js @@ -65,7 +65,7 @@ class BrowserServerLauncherImpl { preLaunchedBrowser: browser, preLaunchedSocksProxy: socksProxy }); - const wsEndpoint = await server.listen(options.port); + const wsEndpoint = await server.listen(options.port, options.host); // 3. Return the BrowserServer interface const browserServer = new _utilsBundle.ws.EventEmitter(); diff --git a/priv/static/node_modules/playwright-core/lib/cli/driver.js b/priv/static/node_modules/playwright-core/lib/cli/driver.js index 66175bf8..ddbf3e5d 100644 --- a/priv/static/node_modules/playwright-core/lib/cli/driver.js +++ b/priv/static/node_modules/playwright-core/lib/cli/driver.js @@ -53,9 +53,7 @@ function runDriver() { // Certain Language Binding JSON parsers (e.g. .NET) do not like strings with lone surrogates. const isJavaScriptLanguageBinding = !process.env.PW_LANG_NAME || process.env.PW_LANG_NAME === 'javascript'; const replacer = !isJavaScriptLanguageBinding && String.prototype.toWellFormed ? (key, value) => { - if (typeof value === 'string') - // @ts-expect-error - return value.toWellFormed(); + if (typeof value === 'string') return value.toWellFormed(); return value; } : undefined; dispatcherConnection.onmessage = message => transport.send(JSON.stringify(message, replacer)); diff --git a/priv/static/node_modules/playwright-core/lib/cli/program.js b/priv/static/node_modules/playwright-core/lib/cli/program.js index 58448d59..ce7bd998 100644 --- a/priv/static/node_modules/playwright-core/lib/cli/program.js +++ b/priv/static/node_modules/playwright-core/lib/cli/program.js @@ -82,23 +82,41 @@ Examples: function suggestedBrowsersToInstall() { return _server.registry.executables().filter(e => e.installType !== 'none' && e.type !== 'tool').map(e => e.name).join(', '); } -function checkBrowsersToInstall(args) { +function defaultBrowsersToInstall(options) { + let executables = _server.registry.defaultExecutables(); + if (options.noShell) executables = executables.filter(e => e.name !== 'chromium-headless-shell'); + if (options.onlyShell) executables = executables.filter(e => e.name !== 'chromium'); + return executables; +} +function checkBrowsersToInstall(args, options) { + if (options.noShell && options.onlyShell) throw new Error(`Only one of --no-shell and --only-shell can be specified`); const faultyArguments = []; const executables = []; - for (const arg of args) { + const handleArgument = arg => { const executable = _server.registry.findExecutable(arg); if (!executable || executable.installType === 'none') faultyArguments.push(arg);else executables.push(executable); + if ((executable === null || executable === void 0 ? void 0 : executable.browserName) === 'chromium') executables.push(_server.registry.findExecutable('ffmpeg')); + }; + for (const arg of args) { + if (arg === 'chromium') { + if (!options.onlyShell) handleArgument('chromium'); + if (!options.noShell) handleArgument('chromium-headless-shell'); + } else { + handleArgument(arg); + } } if (faultyArguments.length) throw new Error(`Invalid installation targets: ${faultyArguments.map(name => `'${name}'`).join(', ')}. Expecting one of: ${suggestedBrowsersToInstall()}`); return executables; } -_utilsBundle.program.command('install [browser...]').description('ensure browsers necessary for this version of Playwright are installed').option('--with-deps', 'install system dependencies for browsers').option('--dry-run', 'do not execute installation, only print information').option('--force', 'force reinstall of stable browser channels').action(async function (args, options) { +_utilsBundle.program.command('install [browser...]').description('ensure browsers necessary for this version of Playwright are installed').option('--with-deps', 'install system dependencies for browsers').option('--dry-run', 'do not execute installation, only print information').option('--force', 'force reinstall of stable browser channels').option('--only-shell', 'only install headless shell when installing chromium').option('--no-shell', 'do not install chromium headless shell').action(async function (args, options) { + // For '--no-shell' option, commander sets `shell: false` instead. + if (options.shell === false) options.noShell = true; if ((0, _utils.isLikelyNpxGlobal)()) { console.error((0, _utils.wrapInASCIIBox)([`WARNING: It looks like you are running 'npx playwright install' without first`, `installing your project's dependencies.`, ``, `To avoid unexpected behavior, please install your dependencies first, and`, `then run Playwright's install command:`, ``, ` npm install`, ` npx playwright install`, ``, `If your project does not yet depend on Playwright, first install the`, `applicable npm package (most commonly @playwright/test), and`, `then run Playwright's install command to download the browsers:`, ``, ` npm install @playwright/test`, ` npx playwright install`, ``].join('\n'), 1)); } try { const hasNoArguments = !args.length; - const executables = hasNoArguments ? _server.registry.defaultExecutables() : checkBrowsersToInstall(args); + const executables = hasNoArguments ? defaultBrowsersToInstall(options) : checkBrowsersToInstall(args, options); if (options.withDeps) await _server.registry.installDeps(executables, !!options.dryRun); if (options.dryRun) { for (const executable of executables) { @@ -146,7 +164,7 @@ _utilsBundle.program.command('uninstall').description('Removes browsers used by }); _utilsBundle.program.command('install-deps [browser...]').description('install dependencies necessary to run browsers (will ask for sudo permissions)').option('--dry-run', 'Do not execute installation commands, only print them').action(async function (args, options) { try { - if (!args.length) await _server.registry.installDeps(_server.registry.defaultExecutables(), !!options.dryRun);else await _server.registry.installDeps(checkBrowsersToInstall(args), !!options.dryRun); + if (!args.length) await _server.registry.installDeps(defaultBrowsersToInstall({}), !!options.dryRun);else await _server.registry.installDeps(checkBrowsersToInstall(args, {}), !!options.dryRun); } catch (e) { console.log(`Failed to install browser dependencies\n${e}`); (0, _utils.gracefullyProcessExitDoNotHang)(1); @@ -238,13 +256,10 @@ _utilsBundle.program.command('show-trace [trace...]').option('-b, --browser p.close())); + if (autoExitCondition && text.includes(autoExitCondition)) closeBrowser(); }; // Make sure we exit abnormally when browser crashes. const logs = []; @@ -383,7 +398,7 @@ async function launchContext(options, headless, executablePath) { const hasPage = browser.contexts().some(context => context.pages().length > 0); if (hasPage) return; // Avoid the error when the last page is closed because the browser has been closed. - closeBrowser().catch(e => null); + closeBrowser().catch(() => {}); }); }); process.on('SIGINT', async () => { @@ -431,13 +446,17 @@ async function open(options, url, language) { context, launchOptions, contextOptions - } = await launchContext(options, !!process.env.PWTEST_CLI_HEADLESS, process.env.PWTEST_CLI_EXECUTABLE_PATH); + } = await launchContext(options, { + headless: !!process.env.PWTEST_CLI_HEADLESS, + executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH + }); await context._enableRecorder({ language, launchOptions, contextOptions, device: options.device, - saveStorage: options.saveStorage + saveStorage: options.saveStorage, + handleSIGINT: false }); await openPage(context, url); } @@ -447,11 +466,19 @@ async function codegen(options, url) { output: outputFile, testIdAttribute: testIdAttributeName } = options; + const tracesDir = _path.default.join(_os.default.tmpdir(), `playwright-recorder-trace-${Date.now()}`); const { context, launchOptions, contextOptions - } = await launchContext(options, !!process.env.PWTEST_CLI_HEADLESS, process.env.PWTEST_CLI_EXECUTABLE_PATH); + } = await launchContext(options, { + headless: !!process.env.PWTEST_CLI_HEADLESS, + executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH, + tracesDir + }); + _utilsBundle.dotenv.config({ + path: 'playwright.env' + }); await context._enableRecorder({ language, launchOptions, @@ -459,6 +486,7 @@ async function codegen(options, url) { device: options.device, saveStorage: options.saveStorage, mode: 'recording', + codegenMode: process.env.PW_RECORDER_IS_TRACE_VIEWER ? 'trace-events' : 'actions', testIdAttributeName, outputFile: outputFile ? _path.default.resolve(outputFile) : undefined, handleSIGINT: false @@ -478,7 +506,9 @@ async function waitForPage(page, captureOptions) { async function screenshot(options, captureOptions, url, path) { const { context - } = await launchContext(options, true); + } = await launchContext(options, { + headless: true + }); console.log('Navigating to ' + url); const page = await openPage(context, url); await waitForPage(page, captureOptions); @@ -497,7 +527,9 @@ async function pdf(options, captureOptions, url, path) { } = await launchContext({ ...options, browser: 'chromium' - }, true); + }, { + headless: true + }); console.log('Navigating to ' + url); const page = await openPage(context, url); await waitForPage(page, captureOptions); diff --git a/priv/static/node_modules/playwright-core/lib/client/api.js b/priv/static/node_modules/playwright-core/lib/client/api.js index 6444428e..85fe3b07 100644 --- a/priv/static/node_modules/playwright-core/lib/client/api.js +++ b/priv/static/node_modules/playwright-core/lib/client/api.js @@ -81,6 +81,12 @@ Object.defineProperty(exports, "CDPSession", { return _cdpSession.CDPSession; } }); +Object.defineProperty(exports, "Clock", { + enumerable: true, + get: function () { + return _clock.Clock; + } +}); Object.defineProperty(exports, "ConsoleMessage", { enumerable: true, get: function () { @@ -237,6 +243,12 @@ Object.defineProperty(exports, "WebSocket", { return _network.WebSocket; } }); +Object.defineProperty(exports, "WebSocketRoute", { + enumerable: true, + get: function () { + return _network.WebSocketRoute; + } +}); Object.defineProperty(exports, "Worker", { enumerable: true, get: function () { @@ -248,6 +260,7 @@ var _android = require("./android"); var _browser = require("./browser"); var _browserContext = require("./browserContext"); var _browserType = require("./browserType"); +var _clock = require("./clock"); var _consoleMessage = require("./consoleMessage"); var _coverage = require("./coverage"); var _dialog = require("./dialog"); diff --git a/priv/static/node_modules/playwright-core/lib/client/browserContext.js b/priv/static/node_modules/playwright-core/lib/client/browserContext.js index bb8b6746..b1bc34d1 100644 --- a/priv/static/node_modules/playwright-core/lib/client/browserContext.js +++ b/priv/static/node_modules/playwright-core/lib/client/browserContext.js @@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.BrowserContext = void 0; exports.prepareBrowserContextParams = prepareBrowserContextParams; +exports.toClientCertificatesProtocol = toClientCertificatesProtocol; var _page = require("./page"); var _frame = require("./frame"); var network = _interopRequireWildcard(require("./network")); @@ -18,7 +19,6 @@ var _events = require("./events"); var _timeoutSettings = require("../common/timeoutSettings"); var _waiter = require("./waiter"); var _utils = require("../utils"); -var _fileUtils = require("../utils/fileUtils"); var _cdpSession = require("./cdpSession"); var _tracing = require("./tracing"); var _artifact = require("./artifact"); @@ -29,6 +29,7 @@ var _consoleMessage = require("./consoleMessage"); var _dialog = require("./dialog"); var _webError = require("./webError"); var _errors = require("./errors"); +var _clock = require("./clock"); let _Symbol$asyncDispose; /** * Copyright 2017 Google Inc. All rights reserved. @@ -62,6 +63,7 @@ class BrowserContext extends _channelOwner.ChannelOwner { super(parent, type, guid, initializer); this._pages = new Set(); this._routes = []; + this._webSocketRoutes = []; this._browser = null; this._browserType = void 0; this._bindings = new Map(); @@ -71,6 +73,7 @@ class BrowserContext extends _channelOwner.ChannelOwner { this._options = {}; this.request = void 0; this.tracing = void 0; + this.clock = void 0; this._backgroundPages = new Set(); this._serviceWorkers = new Set(); this._isChromium = void 0; @@ -83,6 +86,7 @@ class BrowserContext extends _channelOwner.ChannelOwner { this._isChromium = ((_this$_browser2 = this._browser) === null || _this$_browser2 === void 0 ? void 0 : _this$_browser2._name) === 'chromium'; this.tracing = _tracing.Tracing.from(initializer.tracing); this.request = _fetch.APIRequestContext.from(initializer.requestContext); + this.clock = new _clock.Clock(this); this._channel.on('bindingCall', ({ binding }) => this._onBinding(_page.BindingCall.from(binding))); @@ -93,6 +97,9 @@ class BrowserContext extends _channelOwner.ChannelOwner { this._channel.on('route', ({ route }) => this._onRoute(network.Route.from(route))); + this._channel.on('webSocketRoute', ({ + webSocketRoute + }) => this._onWebSocketRoute(network.WebSocketRoute.from(webSocketRoute))); this._channel.on('backgroundPage', ({ page }) => { @@ -212,7 +219,11 @@ class BrowserContext extends _channelOwner.ChannelOwner { } // If the page is closed or unrouteAll() was called without waiting and interception disabled, // the method will throw an error - silence it. - await route._innerContinue(true).catch(() => {}); + await route._innerContinue(true /* isFallback */).catch(() => {}); + } + async _onWebSocketRoute(webSocketRoute) { + const routeHandler = this._webSocketRoutes.find(route => route.matches(webSocketRoute.url())); + if (routeHandler) await routeHandler.handle(webSocketRoute);else webSocketRoute.connectToServer(); } async _onBinding(bindingCall) { const func = this._bindings.get(bindingCall._initializer.name); @@ -324,6 +335,10 @@ class BrowserContext extends _channelOwner.ChannelOwner { this._routes.unshift(new network.RouteHandler(this._options.baseURL, url, handler, options.times)); await this._updateInterceptionPatterns(); } + async routeWebSocket(url, handler) { + this._webSocketRoutes.unshift(new network.WebSocketRouteHandler(this._options.baseURL, url, handler)); + await this._updateWebSocketInterceptionPatterns(); + } async _recordIntoHAR(har, page, options = {}) { var _options$updateConten, _options$updateMode, _options$updateConten2; const { @@ -382,6 +397,12 @@ class BrowserContext extends _channelOwner.ChannelOwner { patterns }); } + async _updateWebSocketInterceptionPatterns() { + const patterns = network.WebSocketRouteHandler.prepareInterceptionPatterns(this._webSocketRoutes); + await this._channel.setWebSocketInterceptionPatterns({ + patterns + }); + } _effectiveCloseReason() { var _this$_browser3; return this._closeReason || ((_this$_browser3 = this._browser) === null || _this$_browser3 === void 0 ? void 0 : _this$_browser3._closeReason); @@ -401,7 +422,7 @@ class BrowserContext extends _channelOwner.ChannelOwner { async storageState(options = {}) { const state = await this._channel.storageState(); if (options.path) { - await (0, _fileUtils.mkdirIfNeeded)(options.path); + await (0, _utils.mkdirIfNeeded)(options.path); await _fs.default.promises.writeFile(options.path, JSON.stringify(state, undefined, 2), 'utf8'); } return state; @@ -437,6 +458,9 @@ class BrowserContext extends _channelOwner.ChannelOwner { if (this._closeWasCalled) return; this._closeReason = options.reason; this._closeWasCalled = true; + await this._wrapApiCall(async () => { + await this.request.dispose(options); + }, true); await this._wrapApiCall(async () => { var _this$_browserType2; await ((_this$_browserType2 = this._browserType) === null || _this$_browserType2 === void 0 ? void 0 : _this$_browserType2._willCloseContext(this)); @@ -464,7 +488,7 @@ class BrowserContext extends _channelOwner.ChannelOwner { await this._closedPromise; } async _enableRecorder(params) { - await this._channel.recorderSupplementEnable(params); + await this._channel.enableRecorder(params); } } exports.BrowserContext = BrowserContext; @@ -502,7 +526,8 @@ async function prepareBrowserContextParams(options) { colorScheme: options.colorScheme === null ? 'no-override' : options.colorScheme, reducedMotion: options.reducedMotion === null ? 'no-override' : options.reducedMotion, forcedColors: options.forcedColors === null ? 'no-override' : options.forcedColors, - acceptDownloads: toAcceptDownloadsProtocol(options.acceptDownloads) + acceptDownloads: toAcceptDownloadsProtocol(options.acceptDownloads), + clientCertificates: await toClientCertificatesProtocol(options.clientCertificates) }; if (!contextParams.recordVideo && options.videosPath) { contextParams.recordVideo = { @@ -517,4 +542,18 @@ function toAcceptDownloadsProtocol(acceptDownloads) { if (acceptDownloads === undefined) return undefined; if (acceptDownloads) return 'accept'; return 'deny'; +} +async function toClientCertificatesProtocol(certs) { + if (!certs) return undefined; + const bufferizeContent = async (value, path) => { + if (value) return value; + if (path) return await _fs.default.promises.readFile(path); + }; + return await Promise.all(certs.map(async cert => ({ + origin: cert.origin, + cert: await bufferizeContent(cert.cert, cert.certPath), + key: await bufferizeContent(cert.key, cert.keyPath), + pfx: await bufferizeContent(cert.pfx, cert.pfxPath), + passphrase: cert.passphrase + }))); } \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/client/browserType.js b/priv/static/node_modules/playwright-core/lib/client/browserType.js index b9797ac1..130e89b0 100644 --- a/priv/static/node_modules/playwright-core/lib/client/browserType.js +++ b/priv/static/node_modules/playwright-core/lib/client/browserType.js @@ -143,20 +143,28 @@ class BrowserType extends _channelOwner.ChannelOwner { let browser; let closeError; const onPipeClosed = reason => { - var _browser2; // Emulate all pages, contexts and the browser closing upon disconnect. for (const context of ((_browser = browser) === null || _browser === void 0 ? void 0 : _browser.contexts()) || []) { var _browser; for (const page of context.pages()) page._onClose(); context._onClose(); } - (_browser2 = browser) === null || _browser2 === void 0 || _browser2._didClose(); connection.close(reason || closeError); + // Give a chance to any API call promises to reject upon page/context closure. + // This happens naturally when we receive page.onClose and browser.onClose from the server + // in separate tasks. However, upon pipe closure we used to dispatch them all synchronously + // here and promises did not have a chance to reject. + // The order of rejects vs closure is a part of the API contract and our test runner + // relies on it to attribute rejections to the right test. + setTimeout(() => { + var _browser2; + return (_browser2 = browser) === null || _browser2 === void 0 ? void 0 : _browser2._didClose(); + }, 0); }; pipe.on('closed', params => onPipeClosed(params.reason)); - connection.onmessage = message => pipe.send({ + connection.onmessage = message => this._wrapApiCall(() => pipe.send({ message - }).catch(() => onPipeClosed()); + }).catch(() => onPipeClosed()), /* isInternal */true); pipe.on('message', ({ message }) => { @@ -180,7 +188,7 @@ class BrowserType extends _channelOwner.ChannelOwner { this._didLaunchBrowser(browser, {}, logger); browser._shouldCloseConnectionOnClose = true; browser._connectHeaders = connectHeaders; - browser.on(_events.Events.Browser.Disconnected, closePipe); + browser.on(_events.Events.Browser.Disconnected, () => this._wrapApiCall(() => closePipe(), /* isInternal */true)); return browser; }, deadline); if (!result.timedOut) { @@ -223,11 +231,11 @@ class BrowserType extends _channelOwner.ChannelOwner { context._setOptions(contextOptions, browserOptions); if (this._defaultContextTimeout !== undefined) context.setDefaultTimeout(this._defaultContextTimeout); if (this._defaultContextNavigationTimeout !== undefined) context.setDefaultNavigationTimeout(this._defaultContextNavigationTimeout); - await this._instrumentation.onDidCreateBrowserContext(context); + await this._instrumentation.runAfterCreateBrowserContext(context); } async _willCloseContext(context) { this._contexts.delete(context); - await this._instrumentation.onWillCloseBrowserContext(context); + await this._instrumentation.runBeforeCloseBrowserContext(context); } } exports.BrowserType = BrowserType; \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/client/channelOwner.js b/priv/static/node_modules/playwright-core/lib/client/channelOwner.js index 2fa73c76..5b0ca946 100644 --- a/priv/static/node_modules/playwright-core/lib/client/channelOwner.js +++ b/priv/static/node_modules/playwright-core/lib/client/channelOwner.js @@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ChannelOwner = void 0; -var _events = require("events"); +var _eventEmitter = require("./eventEmitter"); var _validator = require("../protocol/validator"); var _debugLogger = require("../utils/debugLogger"); var _stackTrace = require("../utils/stackTrace"); @@ -26,7 +26,7 @@ var _zones = require("../utils/zones"); * limitations under the License. */ -class ChannelOwner extends _events.EventEmitter { +class ChannelOwner extends _eventEmitter.EventEmitter { constructor(parent, type, guid, initializer) { super(); this._connection = void 0; @@ -39,6 +39,7 @@ class ChannelOwner extends _events.EventEmitter { this._logger = void 0; this._instrumentation = void 0; this._eventToSubscriptionMapping = new Map(); + this._isInternalType = false; this._wasCollected = false; this.setMaxListeners(0); this._connection = parent instanceof ChannelOwner ? parent._connection : parent; @@ -51,9 +52,12 @@ class ChannelOwner extends _events.EventEmitter { this._parent._objects.set(guid, this); this._logger = this._parent._logger; } - this._channel = this._createChannel(new _events.EventEmitter()); + this._channel = this._createChannel(new _eventEmitter.EventEmitter()); this._initializer = initializer; } + markAsInternalType() { + this._isInternalType = true; + } _setEventToSubscriptionMapping(mapping) { this._eventToSubscriptionMapping = mapping; } @@ -127,20 +131,25 @@ class ChannelOwner extends _events.EventEmitter { frames, csi, callCookie, - wallTime + stepId } = apiZone.reported ? { apiName: undefined, csi: undefined, callCookie: undefined, frames: [], - wallTime: undefined + stepId: undefined } : apiZone; apiZone.reported = true; - if (csi && apiName) csi.onApiCallBegin(apiName, params, frames, wallTime, callCookie); + let currentStepId = stepId; + if (csi && apiName) { + const out = {}; + csi.onApiCallBegin(apiName, params, frames, callCookie, out); + currentStepId = out.stepId; + } return await this._connection.sendMessageToServer(this, prop, validator(params, '', { tChannelImpl: tChannelImplToWire, binary: this._connection.rawBuffers() ? 'buffer' : 'toBase64' - }), apiName, frames, wallTime); + }), apiName, frames, currentStepId); }); }; } @@ -151,19 +160,19 @@ class ChannelOwner extends _events.EventEmitter { channel._object = this; return channel; } - async _wrapApiCall(func, isInternal = false) { + async _wrapApiCall(func, isInternal) { const logger = this._logger; const apiZone = _zones.zones.zoneData('apiZone'); if (apiZone) return await func(apiZone); const stackTrace = (0, _stackTrace.captureLibraryStackTrace)(); let apiName = stackTrace.apiName; const frames = stackTrace.frames; - isInternal = isInternal || this._type === 'LocalUtils'; + if (isInternal === undefined) isInternal = this._isInternalType; if (isInternal) apiName = undefined; // Enclosing zone could have provided the apiName and wallTime. const expectZone = _zones.zones.zoneData('expectZone'); - const wallTime = expectZone ? expectZone.wallTime : Date.now(); + const stepId = expectZone === null || expectZone === void 0 ? void 0 : expectZone.stepId; if (!isInternal && expectZone) apiName = expectZone.title; // If we are coming from the expectZone, there is no need to generate a new @@ -179,7 +188,7 @@ class ChannelOwner extends _events.EventEmitter { reported: false, csi, callCookie, - wallTime + stepId }; const result = await _zones.zones.run('apiZone', apiZone, async () => await func(apiZone)); csi === null || csi === void 0 || csi.onApiCallEnd(callCookie); diff --git a/priv/static/node_modules/playwright-core/lib/client/clientInstrumentation.js b/priv/static/node_modules/playwright-core/lib/client/clientInstrumentation.js index 60f9865f..838addbc 100644 --- a/priv/static/node_modules/playwright-core/lib/client/clientInstrumentation.js +++ b/priv/static/node_modules/playwright-core/lib/client/clientInstrumentation.js @@ -28,13 +28,23 @@ function createInstrumentation() { if (prop === 'addListener') return listener => listeners.push(listener); if (prop === 'removeListener') return listener => listeners.splice(listeners.indexOf(listener), 1); if (prop === 'removeAllListeners') return () => listeners.splice(0, listeners.length); - if (!prop.startsWith('on')) return obj[prop]; - return async (...params) => { - for (const listener of listeners) { - var _prop, _ref; - await ((_prop = (_ref = listener)[prop]) === null || _prop === void 0 ? void 0 : _prop.call(_ref, ...params)); - } - }; + if (prop.startsWith('run')) { + return async (...params) => { + for (const listener of listeners) { + var _prop, _ref; + await ((_prop = (_ref = listener)[prop]) === null || _prop === void 0 ? void 0 : _prop.call(_ref, ...params)); + } + }; + } + if (prop.startsWith('on')) { + return (...params) => { + for (const listener of listeners) { + var _prop2, _ref2; + (_prop2 = (_ref2 = listener)[prop]) === null || _prop2 === void 0 || _prop2.call(_ref2, ...params); + } + }; + } + return obj[prop]; } }); } \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/client/clock.js b/priv/static/node_modules/playwright-core/lib/client/clock.js new file mode 100644 index 00000000..3ff8423d --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/client/clock.js @@ -0,0 +1,68 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.Clock = void 0; +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class Clock { + constructor(browserContext) { + this._browserContext = void 0; + this._browserContext = browserContext; + } + async install(options = {}) { + await this._browserContext._channel.clockInstall(options.time !== undefined ? parseTime(options.time) : {}); + } + async fastForward(ticks) { + await this._browserContext._channel.clockFastForward(parseTicks(ticks)); + } + async pauseAt(time) { + await this._browserContext._channel.clockPauseAt(parseTime(time)); + } + async resume() { + await this._browserContext._channel.clockResume({}); + } + async runFor(ticks) { + await this._browserContext._channel.clockRunFor(parseTicks(ticks)); + } + async setFixedTime(time) { + await this._browserContext._channel.clockSetFixedTime(parseTime(time)); + } + async setSystemTime(time) { + await this._browserContext._channel.clockSetSystemTime(parseTime(time)); + } +} +exports.Clock = Clock; +function parseTime(time) { + if (typeof time === 'number') return { + timeNumber: time + }; + if (typeof time === 'string') return { + timeString: time + }; + if (!isFinite(time.getTime())) throw new Error(`Invalid date: ${time}`); + return { + timeNumber: time.getTime() + }; +} +function parseTicks(ticks) { + return { + ticksNumber: typeof ticks === 'number' ? ticks : undefined, + ticksString: typeof ticks === 'string' ? ticks : undefined + }; +} \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/client/connection.js b/priv/static/node_modules/playwright-core/lib/client/connection.js index 9506fbf3..66731a3a 100644 --- a/priv/static/node_modules/playwright-core/lib/client/connection.js +++ b/priv/static/node_modules/playwright-core/lib/client/connection.js @@ -104,7 +104,7 @@ class Connection extends _events.EventEmitter { setIsTracing(isTracing) { if (isTracing) this._tracingCount++;else this._tracingCount--; } - async sendMessageToServer(object, method, params, apiName, frames, wallTime) { + async sendMessageToServer(object, method, params, apiName, frames, stepId) { var _this$_localUtils; if (this._closedError) throw this._closedError; if (object._wasCollected) throw new Error('The object has been collected to prevent unbounded heap growth.'); @@ -127,10 +127,10 @@ class Connection extends _events.EventEmitter { column: frames[0].column } : undefined; const metadata = { - wallTime, apiName, location, - internal: !apiName + internal: !apiName, + stepId }; if (this._tracingCount && frames && type !== 'LocalUtils') (_this$_localUtils = this._localUtils) === null || _this$_localUtils === void 0 || _this$_localUtils._channel.addStackToTracingNoReply({ callData: { @@ -205,6 +205,7 @@ class Connection extends _events.EventEmitter { })); } close(cause) { + if (this._closedError) return; this._closedError = new _errors.TargetClosedError(cause); for (const callback of this._callbacks.values()) callback.reject(this._closedError); this._callbacks.clear(); @@ -314,6 +315,9 @@ class Connection extends _events.EventEmitter { case 'WebSocket': result = new _network.WebSocket(parent, type, guid, initializer); break; + case 'WebSocketRoute': + result = new _network.WebSocketRoute(parent, type, guid, initializer); + break; case 'Worker': result = new _worker.Worker(parent, type, guid, initializer); break; diff --git a/priv/static/node_modules/playwright-core/lib/client/electron.js b/priv/static/node_modules/playwright-core/lib/client/electron.js index ccf7fdd2..de7fa93b 100644 --- a/priv/static/node_modules/playwright-core/lib/client/electron.js +++ b/priv/static/node_modules/playwright-core/lib/client/electron.js @@ -43,7 +43,7 @@ class Electron extends _channelOwner.ChannelOwner { tracesDir: options.tracesDir }; const app = ElectronApplication.from((await this._channel.launch(params)).electronApplication); - app._context._options = params; + app._context._setOptions(params, options); return app; } } @@ -58,12 +58,10 @@ class ElectronApplication extends _channelOwner.ChannelOwner { this._context = void 0; this._windows = new Set(); this._timeoutSettings = new _timeoutSettings.TimeoutSettings(); - this._isClosed = false; this._context = _browserContext.BrowserContext.from(initializer.context); for (const page of this._context._pages) this._onPage(page); this._context.on(_events.Events.BrowserContext.Page, page => this._onPage(page)); this._channel.on('close', () => { - this._isClosed = true; this.emit(_events.Events.ElectronApplication.Close); }); this._channel.on('console', event => this.emit(_events.Events.ElectronApplication.Console, new _consoleMessage.ConsoleMessage(event))); @@ -92,8 +90,12 @@ class ElectronApplication extends _channelOwner.ChannelOwner { await this.close(); } async close() { - if (this._isClosed) return; - await this._channel.close().catch(() => {}); + try { + await this._context.close(); + } catch (e) { + if ((0, _errors.isTargetClosedError)(e)) return; + throw e; + } } async waitForEvent(event, optionsOrPredicate = {}) { return await this._wrapApiCall(async () => { diff --git a/priv/static/node_modules/playwright-core/lib/client/elementHandle.js b/priv/static/node_modules/playwright-core/lib/client/elementHandle.js index 2bbbc846..3cdcb94f 100644 --- a/priv/static/node_modules/playwright-core/lib/client/elementHandle.js +++ b/priv/static/node_modules/playwright-core/lib/client/elementHandle.js @@ -250,29 +250,59 @@ function convertSelectOptionValues(values) { function filePayloadExceedsSizeLimit(payloads) { return payloads.reduce((size, item) => size + (item.buffer ? item.buffer.byteLength : 0), 0) >= _fileUtils.fileUploadSizeLimit; } +async function resolvePathsAndDirectoryForInputFiles(items) { + var _localPaths2; + let localPaths; + let localDirectory; + for (const item of items) { + const stat = await _fs.default.promises.stat(item); + if (stat.isDirectory()) { + if (localDirectory) throw new Error('Multiple directories are not supported'); + localDirectory = _path.default.resolve(item); + } else { + var _localPaths; + (_localPaths = localPaths) !== null && _localPaths !== void 0 ? _localPaths : localPaths = []; + localPaths.push(_path.default.resolve(item)); + } + } + if ((_localPaths2 = localPaths) !== null && _localPaths2 !== void 0 && _localPaths2.length && localDirectory) throw new Error('File paths must be all files or a single directory'); + return [localPaths, localDirectory]; +} async function convertInputFiles(files, context) { const items = Array.isArray(files) ? files.slice() : [files]; if (items.some(item => typeof item === 'string')) { if (!items.every(item => typeof item === 'string')) throw new Error('File paths cannot be mixed with buffers'); + const [localPaths, localDirectory] = await resolvePathsAndDirectoryForInputFiles(items); if (context._connection.isRemote()) { - const streams = await Promise.all(items.map(async item => { - const lastModifiedMs = (await _fs.default.promises.stat(item)).mtimeMs; - const { - writableStream: stream - } = await context._wrapApiCall(() => context._channel.createTempFile({ - name: _path.default.basename(item), - lastModifiedMs - }), true); - const writable = _writableStream.WritableStream.from(stream); - await pipelineAsync(_fs.default.createReadStream(item), writable.stream()); - return stream; - })); + const files = localDirectory ? (await _fs.default.promises.readdir(localDirectory, { + withFileTypes: true, + recursive: true + })).filter(f => f.isFile()).map(f => _path.default.join(f.path, f.name)) : localPaths; + const { + writableStreams, + rootDir + } = await context._wrapApiCall(async () => context._channel.createTempFiles({ + rootDirName: localDirectory ? _path.default.basename(localDirectory) : undefined, + items: await Promise.all(files.map(async file => { + const lastModifiedMs = (await _fs.default.promises.stat(file)).mtimeMs; + return { + name: localDirectory ? _path.default.relative(localDirectory, file) : _path.default.basename(file), + lastModifiedMs + }; + })) + }), true); + for (let i = 0; i < files.length; i++) { + const writable = _writableStream.WritableStream.from(writableStreams[i]); + await pipelineAsync(_fs.default.createReadStream(files[i]), writable.stream()); + } return { - streams + directoryStream: rootDir, + streams: localDirectory ? undefined : writableStreams }; } return { - localPaths: items.map(f => _path.default.resolve(f)) + localPaths, + localDirectory }; } const payloads = items; diff --git a/priv/static/node_modules/playwright-core/lib/client/eventEmitter.js b/priv/static/node_modules/playwright-core/lib/client/eventEmitter.js new file mode 100644 index 00000000..ff1a16d0 --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/client/eventEmitter.js @@ -0,0 +1,314 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.EventEmitter = void 0; +var _events = require("events"); +var _utils = require("../utils"); +/** + * Copyright Joyent, Inc. and other Node contributors. + * Modifications copyright (c) Microsoft Corporation. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +class EventEmitter { + constructor() { + this._events = undefined; + this._eventsCount = 0; + this._maxListeners = undefined; + this._pendingHandlers = new Map(); + this._rejectionHandler = void 0; + if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } + this._maxListeners = this._maxListeners || undefined; + this.on = this.addListener; + this.off = this.removeListener; + } + setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || Number.isNaN(n)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + this._maxListeners = n; + return this; + } + getMaxListeners() { + return this._maxListeners === undefined ? _events.EventEmitter.defaultMaxListeners : this._maxListeners; + } + emit(type, ...args) { + const events = this._events; + if (events === undefined) return false; + const handler = events === null || events === void 0 ? void 0 : events[type]; + if (handler === undefined) return false; + if (typeof handler === 'function') { + this._callHandler(type, handler, args); + } else { + const len = handler.length; + const listeners = handler.slice(); + for (let i = 0; i < len; ++i) this._callHandler(type, listeners[i], args); + } + return true; + } + _callHandler(type, handler, args) { + const promise = Reflect.apply(handler, this, args); + if (!(promise instanceof Promise)) return; + let set = this._pendingHandlers.get(type); + if (!set) { + set = new Set(); + this._pendingHandlers.set(type, set); + } + set.add(promise); + promise.catch(e => { + if (this._rejectionHandler) this._rejectionHandler(e);else throw e; + }).finally(() => set.delete(promise)); + } + addListener(type, listener) { + return this._addListener(type, listener, false); + } + on(type, listener) { + return this._addListener(type, listener, false); + } + _addListener(type, listener, prepend) { + checkListener(listener); + let events = this._events; + let existing; + if (events === undefined) { + events = this._events = Object.create(null); + this._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + this.emit('newListener', type, unwrapListener(listener)); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = this._events; + } + existing = events[type]; + } + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++this._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + // Check for listener leak + const m = this.getMaxListeners(); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + const w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' ' + String(type) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = this; + w.type = type; + w.count = existing.length; + if (!(0, _utils.isUnderTest)()) { + // eslint-disable-next-line no-console + console.warn(w); + } + } + } + return this; + } + prependListener(type, listener) { + return this._addListener(type, listener, true); + } + once(type, listener) { + checkListener(listener); + this.on(type, new OnceWrapper(this, type, listener).wrapperFunction); + return this; + } + prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, new OnceWrapper(this, type, listener).wrapperFunction); + return this; + } + removeListener(type, listener) { + checkListener(listener); + const events = this._events; + if (events === undefined) return this; + const list = events[type]; + if (list === undefined) return this; + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) { + this._events = Object.create(null); + } else { + var _listener; + delete events[type]; + if (events.removeListener) this.emit('removeListener', type, (_listener = list.listener) !== null && _listener !== void 0 ? _listener : listener); + } + } else if (typeof list !== 'function') { + let position = -1; + let originalListener; + for (let i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || wrappedListener(list[i]) === listener) { + originalListener = wrappedListener(list[i]); + position = i; + break; + } + } + if (position < 0) return this; + if (position === 0) list.shift();else list.splice(position, 1); + if (list.length === 1) events[type] = list[0]; + if (events.removeListener !== undefined) this.emit('removeListener', type, originalListener || listener); + } + return this; + } + off(type, listener) { + return this.removeListener(type, listener); + } + removeAllListeners(type, options) { + this._removeAllListeners(type); + if (!options) return this; + if (options.behavior === 'wait') { + const errors = []; + this._rejectionHandler = error => errors.push(error); + // eslint-disable-next-line internal-playwright/await-promise-in-class-returns + return this._waitFor(type).then(() => { + if (errors.length) throw errors[0]; + }); + } + if (options.behavior === 'ignoreErrors') this._rejectionHandler = () => {}; + + // eslint-disable-next-line internal-playwright/await-promise-in-class-returns + return Promise.resolve(); + } + _removeAllListeners(type) { + const events = this._events; + if (!events) return; + + // not listening for removeListener, no need to emit + if (!events.removeListener) { + if (type === undefined) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) this._events = Object.create(null);else delete events[type]; + } + return; + } + + // emit removeListener for all listeners on all events + if (type === undefined) { + const keys = Object.keys(events); + let key; + for (let i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this._removeAllListeners(key); + } + this._removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return; + } + const listeners = events[type]; + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (let i = listeners.length - 1; i >= 0; i--) this.removeListener(type, listeners[i]); + } + } + listeners(type) { + return this._listeners(this, type, true); + } + rawListeners(type) { + return this._listeners(this, type, false); + } + listenerCount(type) { + const events = this._events; + if (events !== undefined) { + const listener = events[type]; + if (typeof listener === 'function') return 1; + if (listener !== undefined) return listener.length; + } + return 0; + } + eventNames() { + return this._eventsCount > 0 && this._events ? Reflect.ownKeys(this._events) : []; + } + async _waitFor(type) { + let promises = []; + if (type) { + promises = [...(this._pendingHandlers.get(type) || [])]; + } else { + promises = []; + for (const [, pending] of this._pendingHandlers) promises.push(...pending); + } + await Promise.all(promises); + } + _listeners(target, type, unwrap) { + const events = target._events; + if (events === undefined) return []; + const listener = events[type]; + if (listener === undefined) return []; + if (typeof listener === 'function') return unwrap ? [unwrapListener(listener)] : [listener]; + return unwrap ? unwrapListeners(listener) : listener.slice(); + } +} +exports.EventEmitter = EventEmitter; +function checkListener(listener) { + if (typeof listener !== 'function') throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); +} +class OnceWrapper { + constructor(eventEmitter, eventType, listener) { + this._fired = false; + this.wrapperFunction = void 0; + this._listener = void 0; + this._eventEmitter = void 0; + this._eventType = void 0; + this._eventEmitter = eventEmitter; + this._eventType = eventType; + this._listener = listener; + this.wrapperFunction = this._handle.bind(this); + this.wrapperFunction.listener = listener; + } + _handle(...args) { + if (this._fired) return; + this._fired = true; + this._eventEmitter.removeListener(this._eventType, this.wrapperFunction); + return this._listener.apply(this._eventEmitter, args); + } +} +function unwrapListener(l) { + var _wrappedListener; + return (_wrappedListener = wrappedListener(l)) !== null && _wrappedListener !== void 0 ? _wrappedListener : l; +} +function unwrapListeners(arr) { + return arr.map(l => { + var _wrappedListener2; + return (_wrappedListener2 = wrappedListener(l)) !== null && _wrappedListener2 !== void 0 ? _wrappedListener2 : l; + }); +} +function wrappedListener(l) { + return l.listener; +} \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/client/fetch.js b/priv/static/node_modules/playwright-core/lib/client/fetch.js index c2b2edfb..50a8de81 100644 --- a/priv/static/node_modules/playwright-core/lib/client/fetch.js +++ b/priv/static/node_modules/playwright-core/lib/client/fetch.js @@ -13,6 +13,7 @@ var _channelOwner = require("./channelOwner"); var _network = require("./network"); var _tracing = require("./tracing"); var _errors = require("./errors"); +var _browserContext = require("./browserContext"); let _Symbol$asyncDispose, _Symbol$asyncDispose2, _util$inspect$custom; /** * Copyright (c) Microsoft Corporation. @@ -53,12 +54,13 @@ class APIRequest { ...options, extraHTTPHeaders: options.extraHTTPHeaders ? (0, _utils.headersObjectToArray)(options.extraHTTPHeaders) : undefined, storageState, - tracesDir + tracesDir, + clientCertificates: await (0, _browserContext.toClientCertificatesProtocol)(options.clientCertificates) })).request); this._contexts.add(context); context._request = this; context._tracing._tracesDir = tracesDir; - await context._instrumentation.onDidCreateRequestContext(context); + await context._instrumentation.runAfterCreateRequestContext(context); return context; } } @@ -72,15 +74,22 @@ class APIRequestContext extends _channelOwner.ChannelOwner { super(parent, type, guid, initializer); this._request = void 0; this._tracing = void 0; + this._closeReason = void 0; this._tracing = _tracing.Tracing.from(initializer.tracing); } async [_Symbol$asyncDispose]() { await this.dispose(); } - async dispose() { + async dispose(options = {}) { var _this$_request; - await this._instrumentation.onWillCloseRequestContext(this); - await this._channel.dispose(); + this._closeReason = options.reason; + await this._instrumentation.runBeforeCloseRequestContext(this); + try { + await this._channel.dispose(options); + } catch (e) { + if ((0, _errors.isTargetClosedError)(e)) return; + throw e; + } this._tracing._resetStackCounter(); (_this$_request = this._request) === null || _this$_request === void 0 || _this$_request._contexts.delete(this); } @@ -132,13 +141,15 @@ class APIRequestContext extends _channelOwner.ChannelOwner { async _innerFetch(options = {}) { return await this._wrapApiCall(async () => { var _options$request, _options$request2, _options$request3; + if (this._closeReason) throw new _errors.TargetClosedError(this._closeReason); (0, _utils.assert)(options.request || typeof options.url === 'string', 'First argument must be either URL string or Request'); (0, _utils.assert)((options.data === undefined ? 0 : 1) + (options.form === undefined ? 0 : 1) + (options.multipart === undefined ? 0 : 1) <= 1, `Only one of 'data', 'form' or 'multipart' can be specified`); - (0, _utils.assert)(options.maxRedirects === undefined || options.maxRedirects >= 0, `'maxRedirects' should be greater than or equal to '0'`); + (0, _utils.assert)(options.maxRedirects === undefined || options.maxRedirects >= 0, `'maxRedirects' must be greater than or equal to '0'`); + (0, _utils.assert)(options.maxRetries === undefined || options.maxRetries >= 0, `'maxRetries' must be greater than or equal to '0'`); const url = options.url !== undefined ? options.url : options.request.url(); - const params = objectToArray(options.params); const method = options.method || ((_options$request = options.request) === null || _options$request === void 0 ? void 0 : _options$request.method()); - const maxRedirects = options.maxRedirects; + let encodedParams = undefined; + if (typeof options.params === 'string') encodedParams = options.params;else if (options.params instanceof URLSearchParams) encodedParams = options.params.toString(); // Cannot call allHeaders() here as the request may be paused inside route handler. const headersObj = options.headers || ((_options$request2 = options.request) === null || _options$request2 === void 0 ? void 0 : _options$request2.headers()); const headers = headersObj ? (0, _utils.headersObjectToArray)(headersObj) : undefined; @@ -157,7 +168,18 @@ class APIRequestContext extends _channelOwner.ChannelOwner { throw new Error(`Unexpected 'data' type`); } } else if (options.form) { - formData = objectToArray(options.form); + if (globalThis.FormData && options.form instanceof FormData) { + formData = []; + for (const [name, value] of options.form.entries()) { + if (typeof value !== 'string') throw new Error(`Expected string for options.form["${name}"], found File. Please use options.multipart instead.`); + formData.push({ + name, + value + }); + } + } else { + formData = objectToArray(options.form); + } } else if (options.multipart) { multipartData = []; if (globalThis.FormData && options.multipart instanceof FormData) { @@ -191,7 +213,8 @@ class APIRequestContext extends _channelOwner.ChannelOwner { }; const result = await this._channel.fetch({ url, - params, + params: typeof options.params === 'object' ? objectToArray(options.params) : undefined, + encodedParams, method, headers, postData: postDataBuffer, @@ -201,7 +224,8 @@ class APIRequestContext extends _channelOwner.ChannelOwner { timeout: options.timeout, failOnStatusCode: options.failOnStatusCode, ignoreHTTPSErrors: options.ignoreHTTPSErrors, - maxRedirects: maxRedirects, + maxRedirects: options.maxRedirects, + maxRetries: options.maxRetries, ...fixtures }); return new APIResponse(this, result.response); diff --git a/priv/static/node_modules/playwright-core/lib/client/frame.js b/priv/static/node_modules/playwright-core/lib/client/frame.js index ed92aab7..9b04ac31 100644 --- a/priv/static/node_modules/playwright-core/lib/client/frame.js +++ b/priv/static/node_modules/playwright-core/lib/client/frame.js @@ -17,7 +17,6 @@ var _events = require("events"); var _waiter = require("./waiter"); var _events2 = require("./events"); var _types = require("./types"); -var _network2 = require("../utils/network"); var _clientHelper = require("./clientHelper"); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } @@ -111,7 +110,7 @@ class Frame extends _channelOwner.ChannelOwner { // Any failed navigation results in a rejection. if (event.error) return true; waiter.log(` navigated to "${event.url}"`); - return (0, _network2.urlMatches)((_this$_page = this._page) === null || _this$_page === void 0 ? void 0 : _this$_page.context()._options.baseURL, event.url, options.url); + return (0, _utils.urlMatches)((_this$_page = this._page) === null || _this$_page === void 0 ? void 0 : _this$_page.context()._options.baseURL, event.url, options.url); }); if (navigatedEvent.error) { const e = new Error(navigatedEvent.error); @@ -147,7 +146,7 @@ class Frame extends _channelOwner.ChannelOwner { } async waitForURL(url, options = {}) { var _this$_page2; - if ((0, _network2.urlMatches)((_this$_page2 = this._page) === null || _this$_page2 === void 0 ? void 0 : _this$_page2.context()._options.baseURL, this.url(), url)) return await this.waitForLoadState(options.waitUntil, options); + if ((0, _utils.urlMatches)((_this$_page2 = this._page) === null || _this$_page2 === void 0 ? void 0 : _this$_page2.context()._options.baseURL, this.url(), url)) return await this.waitForLoadState(options.waitUntil, options); await this.waitForNavigation({ url, ...options @@ -179,7 +178,6 @@ class Frame extends _channelOwner.ChannelOwner { const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === 'function', - exposeUtilityScript: true, arg: (0, _jsHandle.serializeArgument)(arg) }); return (0, _jsHandle.parseResult)(result.value); diff --git a/priv/static/node_modules/playwright-core/lib/client/jsHandle.js b/priv/static/node_modules/playwright-core/lib/client/jsHandle.js index e8c884e6..2d24bec1 100644 --- a/priv/static/node_modules/playwright-core/lib/client/jsHandle.js +++ b/priv/static/node_modules/playwright-core/lib/client/jsHandle.js @@ -86,14 +86,6 @@ class JSHandle extends _channelOwner.ChannelOwner { throw e; } } - async _objectCount() { - return await this._wrapApiCall(async () => { - const { - count - } = await this._channel.objectCount(); - return count; - }); - } toString() { return this._preview; } diff --git a/priv/static/node_modules/playwright-core/lib/client/localUtils.js b/priv/static/node_modules/playwright-core/lib/client/localUtils.js index 88304cf9..b5473652 100644 --- a/priv/static/node_modules/playwright-core/lib/client/localUtils.js +++ b/priv/static/node_modules/playwright-core/lib/client/localUtils.js @@ -25,6 +25,7 @@ class LocalUtils extends _channelOwner.ChannelOwner { constructor(parent, type, guid, initializer) { super(parent, type, guid, initializer); this.devices = void 0; + this.markAsInternalType(); this.devices = {}; for (const { name, diff --git a/priv/static/node_modules/playwright-core/lib/client/locator.js b/priv/static/node_modules/playwright-core/lib/client/locator.js index ba2ba51e..72f7e780 100644 --- a/priv/static/node_modules/playwright-core/lib/client/locator.js +++ b/priv/static/node_modules/playwright-core/lib/client/locator.js @@ -291,6 +291,13 @@ class Locator { timeout }), options.timeout); } + async ariaSnapshot(options) { + const result = await this._frame._channel.ariaSnapshot({ + ...options, + selector: this._selector + }); + return result.snapshot; + } async scrollIntoViewIfNeeded(options = {}) { return await this._withElement((h, timeout) => h.scrollIntoViewIfNeeded({ ...options, diff --git a/priv/static/node_modules/playwright-core/lib/client/network.js b/priv/static/node_modules/playwright-core/lib/client/network.js index 9a162f80..4ef6518a 100644 --- a/priv/static/node_modules/playwright-core/lib/client/network.js +++ b/priv/static/node_modules/playwright-core/lib/client/network.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.WebSocket = exports.RouteHandler = exports.Route = exports.Response = exports.Request = exports.RawHeaders = void 0; +exports.WebSocketRouteHandler = exports.WebSocketRoute = exports.WebSocket = exports.RouteHandler = exports.Route = exports.Response = exports.Request = exports.RawHeaders = void 0; exports.validateHeaders = validateHeaders; var _url = require("url"); var _channelOwner = require("./channelOwner"); @@ -15,10 +15,9 @@ var _utils = require("../utils"); var _manualPromise = require("../utils/manualPromise"); var _events = require("./events"); var _waiter = require("./waiter"); -var _network = require("../utils/network"); -var _multimap = require("../utils/multimap"); var _fetch = require("./fetch"); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _errors = require("./errors"); +let _Symbol$asyncDispose; /** * Copyright (c) Microsoft Corporation. * @@ -34,7 +33,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * See the License for the specific language governing permissions and * limitations under the License. */ - +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Request extends _channelOwner.ChannelOwner { static from(request) { return request._object; @@ -54,7 +53,6 @@ class Request extends _channelOwner.ChannelOwner { this._redirectedFrom = Request.fromNullable(initializer.redirectedFrom); if (this._redirectedFrom) this._redirectedFrom._redirectedTo = this; this._provisionalHeaders = new RawHeaders(initializer.headers); - this._fallbackOverrides.postDataBuffer = initializer.postData; this._timing = { startTime: 0, domainLookupStart: -1, @@ -77,11 +75,11 @@ class Request extends _channelOwner.ChannelOwner { return this._fallbackOverrides.method || this._initializer.method; } postData() { - var _this$_fallbackOverri; - return ((_this$_fallbackOverri = this._fallbackOverrides.postDataBuffer) === null || _this$_fallbackOverri === void 0 ? void 0 : _this$_fallbackOverri.toString('utf-8')) || null; + var _ref; + return ((_ref = this._fallbackOverrides.postDataBuffer || this._initializer.postData) === null || _ref === void 0 ? void 0 : _ref.toString('utf-8')) || null; } postDataBuffer() { - return this._fallbackOverrides.postDataBuffer || null; + return this._fallbackOverrides.postDataBuffer || this._initializer.postData || null; } postDataJSON() { const postData = this.postData(); @@ -205,6 +203,7 @@ class Route extends _channelOwner.ChannelOwner { this._handlingPromise = null; this._context = void 0; this._didThrow = false; + this.markAsInternalType(); } request() { return Request.from(this._initializer.request); @@ -227,7 +226,6 @@ class Route extends _channelOwner.ChannelOwner { async abort(errorCode) { await this._handleRoute(async () => { await this._raceWithTargetClose(this._channel.abort({ - requestUrl: this.request()._initializer.url, errorCode })); }); @@ -304,7 +302,6 @@ class Route extends _channelOwner.ChannelOwner { if (options.contentType) headers['content-type'] = String(options.contentType);else if (options.json) headers['content-type'] = 'application/json';else if (options.path) headers['content-type'] = _utilsBundle.mime.getType(options.path) || 'application/octet-stream'; if (length && !('content-length' in headers)) headers['content-length'] = String(length); await this._raceWithTargetClose(this._channel.fulfill({ - requestUrl: this.request()._initializer.url, status: statusOption || 200, headers: (0, _utils.headersObjectToArray)(headers), body, @@ -315,7 +312,7 @@ class Route extends _channelOwner.ChannelOwner { async continue(options = {}) { await this._handleRoute(async () => { this.request()._applyFallbackOverrides(options); - await this._innerContinue(); + await this._innerContinue(false /* isFallback */); }); } _checkNotHandled() { @@ -326,21 +323,180 @@ class Route extends _channelOwner.ChannelOwner { this._handlingPromise = null; chain.resolve(done); } - async _innerContinue(internal = false) { + async _innerContinue(isFallback) { const options = this.request()._fallbackOverridesForContinue(); - return await this._wrapApiCall(async () => { - await this._raceWithTargetClose(this._channel.continue({ - requestUrl: this.request()._initializer.url, - url: options.url, - method: options.method, - headers: options.headers ? (0, _utils.headersObjectToArray)(options.headers) : undefined, - postData: options.postDataBuffer, - isFallback: internal - })); - }, !!internal); + return await this._raceWithTargetClose(this._channel.continue({ + url: options.url, + method: options.method, + headers: options.headers ? (0, _utils.headersObjectToArray)(options.headers) : undefined, + postData: options.postDataBuffer, + isFallback + })); } } exports.Route = Route; +_Symbol$asyncDispose = Symbol.asyncDispose; +class WebSocketRoute extends _channelOwner.ChannelOwner { + static from(route) { + return route._object; + } + constructor(parent, type, guid, initializer) { + super(parent, type, guid, initializer); + this._onPageMessage = void 0; + this._onPageClose = void 0; + this._onServerMessage = void 0; + this._onServerClose = void 0; + this._server = void 0; + this._connected = false; + this.markAsInternalType(); + this._server = { + onMessage: handler => { + this._onServerMessage = handler; + }, + onClose: handler => { + this._onServerClose = handler; + }, + connectToServer: () => { + throw new Error(`connectToServer must be called on the page-side WebSocketRoute`); + }, + url: () => { + return this._initializer.url; + }, + close: async (options = {}) => { + await this._channel.closeServer({ + ...options, + wasClean: true + }).catch(() => {}); + }, + send: message => { + if ((0, _utils.isString)(message)) this._channel.sendToServer({ + message, + isBase64: false + }).catch(() => {});else this._channel.sendToServer({ + message: message.toString('base64'), + isBase64: true + }).catch(() => {}); + }, + async [Symbol.asyncDispose]() { + await this.close(); + } + }; + this._channel.on('messageFromPage', ({ + message, + isBase64 + }) => { + if (this._onPageMessage) this._onPageMessage(isBase64 ? Buffer.from(message, 'base64') : message);else if (this._connected) this._channel.sendToServer({ + message, + isBase64 + }).catch(() => {}); + }); + this._channel.on('messageFromServer', ({ + message, + isBase64 + }) => { + if (this._onServerMessage) this._onServerMessage(isBase64 ? Buffer.from(message, 'base64') : message);else this._channel.sendToPage({ + message, + isBase64 + }).catch(() => {}); + }); + this._channel.on('closePage', ({ + code, + reason, + wasClean + }) => { + if (this._onPageClose) this._onPageClose(code, reason);else this._channel.closeServer({ + code, + reason, + wasClean + }).catch(() => {}); + }); + this._channel.on('closeServer', ({ + code, + reason, + wasClean + }) => { + if (this._onServerClose) this._onServerClose(code, reason);else this._channel.closePage({ + code, + reason, + wasClean + }).catch(() => {}); + }); + } + url() { + return this._initializer.url; + } + async close(options = {}) { + await this._channel.closePage({ + ...options, + wasClean: true + }).catch(() => {}); + } + connectToServer() { + if (this._connected) throw new Error('Already connected to the server'); + this._connected = true; + this._channel.connect().catch(() => {}); + return this._server; + } + send(message) { + if ((0, _utils.isString)(message)) this._channel.sendToPage({ + message, + isBase64: false + }).catch(() => {});else this._channel.sendToPage({ + message: message.toString('base64'), + isBase64: true + }).catch(() => {}); + } + onMessage(handler) { + this._onPageMessage = handler; + } + onClose(handler) { + this._onPageClose = handler; + } + async [_Symbol$asyncDispose]() { + await this.close(); + } + async _afterHandle() { + if (this._connected) return; + // Ensure that websocket is "open" and can send messages without an actual server connection. + await this._channel.ensureOpened(); + } +} +exports.WebSocketRoute = WebSocketRoute; +class WebSocketRouteHandler { + constructor(baseURL, url, handler) { + this._baseURL = void 0; + this.url = void 0; + this.handler = void 0; + this._baseURL = baseURL; + this.url = url; + this.handler = handler; + } + static prepareInterceptionPatterns(handlers) { + const patterns = []; + let all = false; + for (const handler of handlers) { + if ((0, _utils.isString)(handler.url)) patterns.push({ + glob: handler.url + });else if ((0, _utils.isRegExp)(handler.url)) patterns.push({ + regexSource: handler.url.source, + regexFlags: handler.url.flags + });else all = true; + } + if (all) return [{ + glob: '**/*' + }]; + return patterns; + } + matches(wsURL) { + return (0, _utils.urlMatches)(this._baseURL, wsURL, this.url); + } + async handle(webSocketRoute) { + const handler = this.handler; + await handler(webSocketRoute); + await webSocketRoute._afterHandle(); + } +} +exports.WebSocketRouteHandler = WebSocketRouteHandler; class Response extends _channelOwner.ChannelOwner { static from(response) { return response._object; @@ -498,10 +654,12 @@ class RouteHandler { this.handler = void 0; this._ignoreException = false; this._activeInvocations = new Set(); + this._svedZone = void 0; this._baseURL = baseURL; this._times = times; this.url = url; this.handler = handler; + this._svedZone = _utils.zones.currentZone(); } static prepareInterceptionPatterns(handlers) { const patterns = []; @@ -520,9 +678,12 @@ class RouteHandler { return patterns; } matches(requestURL) { - return (0, _network.urlMatches)(this._baseURL, requestURL, this.url); + return (0, _utils.urlMatches)(this._baseURL, requestURL, this.url); } async handle(route) { + return await this._svedZone.run(async () => this._handleImpl(route)); + } + async _handleImpl(route) { const handlerInvocation = { complete: new _manualPromise.ManualPromise(), route @@ -533,6 +694,11 @@ class RouteHandler { } catch (e) { // If the handler was stopped (without waiting for completion), we ignore all exceptions. if (this._ignoreException) return false; + if ((0, _errors.isTargetClosedError)(e)) { + // We are failing in the handler because the target close closed. + // Give user a hint! + (0, _utils.rewriteErrorMessage)(e, `"${e.message}" while running route callback.\nConsider awaiting \`await page.unrouteAll({ behavior: 'ignoreErrors' })\`\nbefore the end of the test to ignore remaining routes in flight.`); + } throw e; } finally { handlerInvocation.complete.resolve(); @@ -577,7 +743,7 @@ class RawHeaders { } constructor(headers) { this._headersArray = void 0; - this._headersMap = new _multimap.MultiMap(); + this._headersMap = new _utils.MultiMap(); this._headersArray = headers; for (const header of headers) this._headersMap.set(header.name.toLowerCase(), header.value); } diff --git a/priv/static/node_modules/playwright-core/lib/client/page.js b/priv/static/node_modules/playwright-core/lib/client/page.js index 1f141608..b18ceb45 100644 --- a/priv/static/node_modules/playwright-core/lib/client/page.js +++ b/priv/static/node_modules/playwright-core/lib/client/page.js @@ -7,10 +7,8 @@ exports.Page = exports.BindingCall = void 0; var _fs = _interopRequireDefault(require("fs")); var _path = _interopRequireDefault(require("path")); var _errors = require("./errors"); -var _network = require("../utils/network"); var _timeoutSettings = require("../common/timeoutSettings"); var _utils = require("../utils"); -var _fileUtils = require("../utils/fileUtils"); var _accessibility = require("./accessibility"); var _artifact = require("./artifact"); var _channelOwner = require("./channelOwner"); @@ -23,8 +21,7 @@ var _fileChooser = require("./fileChooser"); var _frame = require("./frame"); var _input = require("./input"); var _jsHandle = require("./jsHandle"); -var _stringUtils = require("../utils/isomorphic/stringUtils"); -var _network2 = require("./network"); +var _network = require("./network"); var _video = require("./video"); var _waiter = require("./waiter"); var _worker = require("./worker"); @@ -66,12 +63,14 @@ class Page extends _channelOwner.ChannelOwner { this._closedOrCrashedScope = new _utils.LongStandingScope(); this._viewportSize = void 0; this._routes = []; + this._webSocketRoutes = []; this.accessibility = void 0; this.coverage = void 0; this.keyboard = void 0; this.mouse = void 0; this.request = void 0; this.touchscreen = void 0; + this.clock = void 0; this._bindings = new Map(); this._timeoutSettings = void 0; this._video = null; @@ -87,6 +86,7 @@ class Page extends _channelOwner.ChannelOwner { this.mouse = new _input.Mouse(this); this.request = this._browserContext.request; this.touchscreen = new _input.Touchscreen(this); + this.clock = this._browserContext.clock; this._mainFrame = _frame.Frame.from(initializer.mainFrame); this._mainFrame._page = this; this._frames.add(this._mainFrame); @@ -121,7 +121,10 @@ class Page extends _channelOwner.ChannelOwner { }) => this._onLocatorHandlerTriggered(uid)); this._channel.on('route', ({ route - }) => this._onRoute(_network2.Route.from(route))); + }) => this._onRoute(_network.Route.from(route))); + this._channel.on('webSocketRoute', ({ + webSocketRoute + }) => this._onWebSocketRoute(_network.WebSocketRoute.from(webSocketRoute))); this._channel.on('video', ({ artifact }) => { @@ -130,7 +133,7 @@ class Page extends _channelOwner.ChannelOwner { }); this._channel.on('webSocket', ({ webSocket - }) => this.emit(_events.Events.Page.WebSocket, _network2.WebSocket.from(webSocket))); + }) => this.emit(_events.Events.Page.WebSocket, _network.WebSocket.from(webSocket))); this._channel.on('worker', ({ worker }) => this._onWorker(_worker.Worker.from(worker))); @@ -167,6 +170,10 @@ class Page extends _channelOwner.ChannelOwner { } await this._browserContext._onRoute(route); } + async _onWebSocketRoute(webSocketRoute) { + const routeHandler = this._webSocketRoutes.find(route => route.matches(webSocketRoute.url())); + if (routeHandler) await routeHandler.handle(webSocketRoute);else await this._browserContext._onWebSocketRoute(webSocketRoute); + } async _onBinding(bindingCall) { const func = this._bindings.get(bindingCall._initializer.name); if (func) { @@ -206,7 +213,7 @@ class Page extends _channelOwner.ChannelOwner { (0, _utils.assert)(name || url, 'Either name or url matcher should be specified'); return this.frames().find(f => { if (name) return f.name() === name; - return (0, _network.urlMatches)(this._browserContext._options.baseURL, f.url(), url); + return (0, _utils.urlMatches)(this._browserContext._options.baseURL, f.url(), url); }) || null; } frames() { @@ -284,7 +291,7 @@ class Page extends _channelOwner.ChannelOwner { this._bindings.set(name, callback); } async setExtraHTTPHeaders(headers) { - (0, _network2.validateHeaders)(headers); + (0, _network.validateHeaders)(headers); await this._channel.setExtraHTTPHeaders({ headers: (0, _utils.headersObjectToArray)(headers) }); @@ -303,7 +310,7 @@ class Page extends _channelOwner.ChannelOwner { } async reload(options = {}) { const waitUntil = (0, _frame.verifyLoadState)('waitUntil', options.waitUntil === undefined ? 'load' : options.waitUntil); - return _network2.Response.fromNullable((await this._channel.reload({ + return _network.Response.fromNullable((await this._channel.reload({ ...options, waitUntil })).response); @@ -333,6 +340,7 @@ class Page extends _channelOwner.ChannelOwner { } remove = (handler === null || handler === void 0 ? void 0 : handler.times) === 0; } finally { + if (remove) this._locatorHandlers.delete(uid); this._wrapApiCall(() => this._channel.resolveLocatorHandlerNoReply({ uid, remove @@ -360,7 +368,7 @@ class Page extends _channelOwner.ChannelOwner { } async waitForRequest(urlOrPredicate, options = {}) { const predicate = async request => { - if ((0, _utils.isString)(urlOrPredicate) || (0, _utils.isRegExp)(urlOrPredicate)) return (0, _network.urlMatches)(this._browserContext._options.baseURL, request.url(), urlOrPredicate); + if ((0, _utils.isString)(urlOrPredicate) || (0, _utils.isRegExp)(urlOrPredicate)) return (0, _utils.urlMatches)(this._browserContext._options.baseURL, request.url(), urlOrPredicate); return await urlOrPredicate(request); }; const trimmedUrl = trimUrl(urlOrPredicate); @@ -372,7 +380,7 @@ class Page extends _channelOwner.ChannelOwner { } async waitForResponse(urlOrPredicate, options = {}) { const predicate = async response => { - if ((0, _utils.isString)(urlOrPredicate) || (0, _utils.isRegExp)(urlOrPredicate)) return (0, _network.urlMatches)(this._browserContext._options.baseURL, response.url(), urlOrPredicate); + if ((0, _utils.isString)(urlOrPredicate) || (0, _utils.isRegExp)(urlOrPredicate)) return (0, _utils.urlMatches)(this._browserContext._options.baseURL, response.url(), urlOrPredicate); return await urlOrPredicate(response); }; const trimmedUrl = trimUrl(urlOrPredicate); @@ -404,18 +412,21 @@ class Page extends _channelOwner.ChannelOwner { } async goBack(options = {}) { const waitUntil = (0, _frame.verifyLoadState)('waitUntil', options.waitUntil === undefined ? 'load' : options.waitUntil); - return _network2.Response.fromNullable((await this._channel.goBack({ + return _network.Response.fromNullable((await this._channel.goBack({ ...options, waitUntil })).response); } async goForward(options = {}) { const waitUntil = (0, _frame.verifyLoadState)('waitUntil', options.waitUntil === undefined ? 'load' : options.waitUntil); - return _network2.Response.fromNullable((await this._channel.goForward({ + return _network.Response.fromNullable((await this._channel.goForward({ ...options, waitUntil })).response); } + async requestGC() { + await this._channel.requestGC(); + } async emulateMedia(options = {}) { await this._channel.emulateMedia({ media: options.media === null ? 'no-override' : options.media, @@ -444,7 +455,7 @@ class Page extends _channelOwner.ChannelOwner { }); } async route(url, handler, options = {}) { - this._routes.unshift(new _network2.RouteHandler(this._browserContext._options.baseURL, url, handler, options.times)); + this._routes.unshift(new _network.RouteHandler(this._browserContext._options.baseURL, url, handler, options.times)); await this._updateInterceptionPatterns(); } async routeFromHAR(har, options = {}) { @@ -458,6 +469,10 @@ class Page extends _channelOwner.ChannelOwner { this._harRouters.push(harRouter); await harRouter.addPageRoute(this); } + async routeWebSocket(url, handler) { + this._webSocketRoutes.unshift(new _network.WebSocketRouteHandler(this._browserContext._options.baseURL, url, handler)); + await this._updateWebSocketInterceptionPatterns(); + } _disposeHarRouters() { this._harRouters.forEach(router => router.dispose()); this._harRouters = []; @@ -482,11 +497,17 @@ class Page extends _channelOwner.ChannelOwner { await Promise.all(promises); } async _updateInterceptionPatterns() { - const patterns = _network2.RouteHandler.prepareInterceptionPatterns(this._routes); + const patterns = _network.RouteHandler.prepareInterceptionPatterns(this._routes); await this._channel.setNetworkInterceptionPatterns({ patterns }); } + async _updateWebSocketInterceptionPatterns() { + const patterns = _network.WebSocketRouteHandler.prepareInterceptionPatterns(this._webSocketRoutes); + await this._channel.setWebSocketInterceptionPatterns({ + patterns + }); + } async screenshot(options = {}) { const copy = { ...options, @@ -501,7 +522,7 @@ class Page extends _channelOwner.ChannelOwner { } const result = await this._channel.screenshot(copy); if (options.path) { - await (0, _fileUtils.mkdirIfNeeded)(options.path); + await (0, _utils.mkdirIfNeeded)(options.path); await _fs.default.promises.writeFile(options.path, result.binary); } return result.binary; @@ -655,14 +676,16 @@ class Page extends _channelOwner.ChannelOwner { workers() { return [...this._workers]; } - async pause() { + async pause(_options) { var _this$_instrumentatio; if (require('inspector').url()) return; const defaultNavigationTimeout = this._browserContext._timeoutSettings.defaultNavigationTimeout(); const defaultTimeout = this._browserContext._timeoutSettings.defaultTimeout(); this._browserContext.setDefaultNavigationTimeout(0); this._browserContext.setDefaultTimeout(0); - (_this$_instrumentatio = this._instrumentation) === null || _this$_instrumentatio === void 0 || _this$_instrumentatio.onWillPause(); + (_this$_instrumentatio = this._instrumentation) === null || _this$_instrumentatio === void 0 || _this$_instrumentatio.onWillPause({ + keepTestTimeout: !!(_options !== null && _options !== void 0 && _options.__testHookKeepTestTimeout) + }); await this._closedOrCrashedScope.safeRace(this.context()._channel.pause()); this._browserContext.setDefaultNavigationTimeout(defaultNavigationTimeout); this._browserContext.setDefaultTimeout(defaultTimeout); @@ -720,6 +743,6 @@ class BindingCall extends _channelOwner.ChannelOwner { } exports.BindingCall = BindingCall; function trimUrl(param) { - if ((0, _utils.isRegExp)(param)) return `/${(0, _stringUtils.trimStringWithEllipsis)(param.source, 50)}/${param.flags}`; - if ((0, _utils.isString)(param)) return `"${(0, _stringUtils.trimStringWithEllipsis)(param, 50)}"`; + if ((0, _utils.isRegExp)(param)) return `/${(0, _utils.trimStringWithEllipsis)(param.source, 50)}/${param.flags}`; + if ((0, _utils.isString)(param)) return `"${(0, _utils.trimStringWithEllipsis)(param, 50)}"`; } \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/client/playwright.js b/priv/static/node_modules/playwright-core/lib/client/playwright.js index 6f2b30c5..c290605b 100644 --- a/priv/static/node_modules/playwright-core/lib/client/playwright.js +++ b/priv/static/node_modules/playwright-core/lib/client/playwright.js @@ -33,6 +33,8 @@ class Playwright extends _channelOwner.ChannelOwner { super(parent, type, guid, initializer); this._android = void 0; this._electron = void 0; + this._bidiChromium = void 0; + this._bidiFirefox = void 0; this.chromium = void 0; this.firefox = void 0; this.webkit = void 0; @@ -49,6 +51,10 @@ class Playwright extends _channelOwner.ChannelOwner { this.webkit._playwright = this; this._android = _android.Android.from(initializer.android); this._electron = _electron.Electron.from(initializer.electron); + this._bidiChromium = _browserType.BrowserType.from(initializer.bidiChromium); + this._bidiChromium._playwright = this; + this._bidiFirefox = _browserType.BrowserType.from(initializer.bidiFirefox); + this._bidiFirefox._playwright = this; this.devices = (_this$_connection$loc = (_this$_connection$loc2 = this._connection.localUtils()) === null || _this$_connection$loc2 === void 0 ? void 0 : _this$_connection$loc2.devices) !== null && _this$_connection$loc !== void 0 ? _this$_connection$loc : {}; this.selectors = new _selectors.Selectors(); this.errors = { diff --git a/priv/static/node_modules/playwright-core/lib/client/tracing.js b/priv/static/node_modules/playwright-core/lib/client/tracing.js index dcca63f9..928fe27d 100644 --- a/priv/static/node_modules/playwright-core/lib/client/tracing.js +++ b/priv/static/node_modules/playwright-core/lib/client/tracing.js @@ -32,22 +32,22 @@ class Tracing extends _channelOwner.ChannelOwner { this._tracesDir = void 0; this._stacksId = void 0; this._isTracing = false; + this.markAsInternalType(); } async start(options = {}) { this._includeSources = !!options.sources; - const traceName = await this._wrapApiCall(async () => { - await this._channel.tracingStart({ - name: options.name, - snapshots: options.snapshots, - screenshots: options.screenshots, - live: options._live - }); - const response = await this._channel.tracingStartChunk({ - name: options.name, - title: options.title - }); - return response.traceName; - }, true); + await this._channel.tracingStart({ + name: options.name, + snapshots: options.snapshots, + screenshots: options.screenshots, + live: options._live + }); + const { + traceName + } = await this._channel.tracingStartChunk({ + name: options.name, + title: options.title + }); await this._startCollectingStacks(traceName); } async startChunk(options = {}) { @@ -56,6 +56,19 @@ class Tracing extends _channelOwner.ChannelOwner { } = await this._channel.tracingStartChunk(options); await this._startCollectingStacks(traceName); } + async group(name, options = {}) { + await this._wrapApiCall(async () => { + await this._channel.tracingGroup({ + name, + location: options.location + }); + }, false); + } + async groupEnd() { + await this._wrapApiCall(async () => { + await this._channel.tracingGroupEnd(); + }, false); + } async _startCollectingStacks(traceName) { if (!this._isTracing) { this._isTracing = true; @@ -68,15 +81,11 @@ class Tracing extends _channelOwner.ChannelOwner { this._stacksId = result.stacksId; } async stopChunk(options = {}) { - await this._wrapApiCall(async () => { - await this._doStopChunk(options.path); - }, true); + await this._doStopChunk(options.path); } async stop(options = {}) { - await this._wrapApiCall(async () => { - await this._doStopChunk(options.path); - await this._channel.tracingStop(); - }, true); + await this._doStopChunk(options.path); + await this._channel.tracingStop(); } async _doStopChunk(filePath) { this._resetStackCounter(); diff --git a/priv/static/node_modules/playwright-core/lib/client/waiter.js b/priv/static/node_modules/playwright-core/lib/client/waiter.js index 28854a86..af83f8ba 100644 --- a/priv/static/node_modules/playwright-core/lib/client/waiter.js +++ b/priv/static/node_modules/playwright-core/lib/client/waiter.js @@ -32,8 +32,10 @@ class Waiter { this._channelOwner = void 0; this._waitId = void 0; this._error = void 0; + this._savedZone = void 0; this._waitId = (0, _utils.createGuid)(); this._channelOwner = channelOwner; + this._savedZone = _utils.zones.currentZone(); this._channelOwner._channel.waitForEventInfo({ info: { waitId: this._waitId, @@ -58,14 +60,14 @@ class Waiter { const { promise, dispose - } = waitForEvent(emitter, event, predicate); + } = waitForEvent(emitter, event, this._savedZone, predicate); return await this.waitForPromise(promise, dispose); } rejectOnEvent(emitter, event, error, predicate) { const { promise, dispose - } = waitForEvent(emitter, event, predicate); + } = waitForEvent(emitter, event, this._savedZone, predicate); this._rejectOn(promise.then(() => { throw typeof error === 'function' ? error() : error; }), dispose); @@ -118,18 +120,20 @@ class Waiter { } } exports.Waiter = Waiter; -function waitForEvent(emitter, event, predicate) { +function waitForEvent(emitter, event, savedZone, predicate) { let listener; const promise = new Promise((resolve, reject) => { listener = async eventArg => { - try { - if (predicate && !(await predicate(eventArg))) return; - emitter.removeListener(event, listener); - resolve(eventArg); - } catch (e) { - emitter.removeListener(event, listener); - reject(e); - } + await savedZone.run(async () => { + try { + if (predicate && !(await predicate(eventArg))) return; + emitter.removeListener(event, listener); + resolve(eventArg); + } catch (e) { + emitter.removeListener(event, listener); + reject(e); + } + }); }; emitter.addListener(event, listener); }); diff --git a/priv/static/node_modules/playwright-core/lib/common/socksProxy.js b/priv/static/node_modules/playwright-core/lib/common/socksProxy.js index 87335ea3..23362696 100644 --- a/priv/static/node_modules/playwright-core/lib/common/socksProxy.js +++ b/priv/static/node_modules/playwright-core/lib/common/socksProxy.js @@ -385,9 +385,9 @@ class SocksProxy extends _events.default { port() { return this._port; } - async listen(port) { + async listen(port, hostname) { return new Promise(f => { - this._server.listen(port, () => { + this._server.listen(port, hostname, () => { const port = this._server.address().port; this._port = port; f(port); diff --git a/priv/static/node_modules/playwright-core/lib/generated/clockSource.js b/priv/static/node_modules/playwright-core/lib/generated/clockSource.js new file mode 100644 index 00000000..19828c4b --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/generated/clockSource.js @@ -0,0 +1,7 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.source = void 0; +const source = exports.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/playwright-core/src/server/injected/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._timers = /* @__PURE__ */ new Map();\n this._uniqueTimerId = idCounterStart;\n this.disposables = [];\n this._log = [];\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 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 return this._now.ticks;\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 const now = this._embedder.performanceNow();\n this._currentRealTimeTimer = void 0;\n const sinceLastSync = now - this._realTime.lastSyncTicks;\n this._realTime.lastSyncTicks = now;\n void this._runTo(shiftTicks(this._now.ticks, sinceLastSync)).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 builtin = platformOriginals(globalObject).bound;\n const { clock: controller } = install(globalObject);\n controller.resume();\n return {\n controller,\n builtin\n };\n}\nfunction asWallTime(n) {\n return n;\n}\nfunction shiftTicks(ticks, ms) {\n return ticks + ms;\n}\n"; \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/generated/consoleApiSource.js b/priv/static/node_modules/playwright-core/lib/generated/consoleApiSource.js index c260598a..933a11a3 100644 --- a/priv/static/node_modules/playwright-core/lib/generated/consoleApiSource.js +++ b/priv/static/node_modules/playwright-core/lib/generated/consoleApiSource.js @@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.source = void 0; -const source = exports.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/playwright-core/src/server/injected/consoleApi.ts\nvar consoleApi_exports = {};\n__export(consoleApi_exports, {\n default: () => consoleApi_default\n});\nmodule.exports = __toCommonJS(consoleApi_exports);\n\n// packages/playwright-core/src/utils/isomorphic/stringUtils.ts\nfunction escapeWithQuotes(text, char = \"'\") {\n const stringified = JSON.stringify(text);\n const escapedText = stringified.substring(1, stringified.length - 1).replace(/\\\\\"/g, '\"');\n if (char === \"'\")\n return char + escapedText.replace(/[']/g, \"\\\\'\") + char;\n if (char === '\"')\n return char + escapedText.replace(/[\"]/g, '\\\\\"') + char;\n if (char === \"`\")\n return char + escapedText.replace(/[`]/g, \"`\") + char;\n throw new Error(\"Invalid escape char\");\n}\nfunction toTitleCase(name) {\n return name.charAt(0).toUpperCase() + name.substring(1);\n}\nfunction toSnakeCase(name) {\n return name.replace(/([a-z0-9])([A-Z])/g, \"$1_$2\").replace(/([A-Z])([A-Z][a-z])/g, \"$1_$2\").toLowerCase();\n}\nfunction normalizeEscapedRegexQuotes(source) {\n return source.replace(/(^|[^\\\\])(\\\\\\\\)*\\\\(['\"`])/g, \"$1$2$3\");\n}\nfunction escapeRegexForSelector(re) {\n if (re.unicode || re.unicodeSets)\n return String(re);\n return String(re).replace(/(^|[^\\\\])(\\\\\\\\)*([\"'`])/g, \"$1$2\\\\$3\").replace(/>>/g, \"\\\\>\\\\>\");\n}\nfunction escapeForTextSelector(text, exact) {\n if (typeof text !== \"string\")\n return escapeRegexForSelector(text);\n return `${JSON.stringify(text)}${exact ? \"s\" : \"i\"}`;\n}\nfunction escapeForAttributeSelector(value, exact) {\n if (typeof value !== \"string\")\n return escapeRegexForSelector(value);\n return `\"${value.replace(/\\\\/g, \"\\\\\\\\\").replace(/[\"]/g, '\\\\\"')}\"${exact ? \"s\" : \"i\"}`;\n}\n\n// packages/playwright-core/src/utils/isomorphic/locatorUtils.ts\nfunction getByAttributeTextSelector(attrName, text, options) {\n return `internal:attr=[${attrName}=${escapeForAttributeSelector(text, (options == null ? void 0 : options.exact) || false)}]`;\n}\nfunction getByTestIdSelector(testIdAttributeName, testId) {\n return `internal:testid=[${testIdAttributeName}=${escapeForAttributeSelector(testId, true)}]`;\n}\nfunction getByLabelSelector(text, options) {\n return \"internal:label=\" + escapeForTextSelector(text, !!(options == null ? void 0 : options.exact));\n}\nfunction getByAltTextSelector(text, options) {\n return getByAttributeTextSelector(\"alt\", text, options);\n}\nfunction getByTitleSelector(text, options) {\n return getByAttributeTextSelector(\"title\", text, options);\n}\nfunction getByPlaceholderSelector(text, options) {\n return getByAttributeTextSelector(\"placeholder\", text, options);\n}\nfunction getByTextSelector(text, options) {\n return \"internal:text=\" + escapeForTextSelector(text, !!(options == null ? void 0 : options.exact));\n}\nfunction getByRoleSelector(role, options = {}) {\n const props = [];\n if (options.checked !== void 0)\n props.push([\"checked\", String(options.checked)]);\n if (options.disabled !== void 0)\n props.push([\"disabled\", String(options.disabled)]);\n if (options.selected !== void 0)\n props.push([\"selected\", String(options.selected)]);\n if (options.expanded !== void 0)\n props.push([\"expanded\", String(options.expanded)]);\n if (options.includeHidden !== void 0)\n props.push([\"include-hidden\", String(options.includeHidden)]);\n if (options.level !== void 0)\n props.push([\"level\", String(options.level)]);\n if (options.name !== void 0)\n props.push([\"name\", escapeForAttributeSelector(options.name, !!options.exact)]);\n if (options.pressed !== void 0)\n props.push([\"pressed\", String(options.pressed)]);\n return `internal:role=${role}${props.map(([n, v]) => `[${n}=${v}]`).join(\"\")}`;\n}\n\n// packages/playwright-core/src/utils/isomorphic/cssTokenizer.ts\nvar between = function(num, first, last) {\n return num >= first && num <= last;\n};\nfunction digit(code) {\n return between(code, 48, 57);\n}\nfunction hexdigit(code) {\n return digit(code) || between(code, 65, 70) || between(code, 97, 102);\n}\nfunction uppercaseletter(code) {\n return between(code, 65, 90);\n}\nfunction lowercaseletter(code) {\n return between(code, 97, 122);\n}\nfunction letter(code) {\n return uppercaseletter(code) || lowercaseletter(code);\n}\nfunction nonascii(code) {\n return code >= 128;\n}\nfunction namestartchar(code) {\n return letter(code) || nonascii(code) || code === 95;\n}\nfunction namechar(code) {\n return namestartchar(code) || digit(code) || code === 45;\n}\nfunction nonprintable(code) {\n return between(code, 0, 8) || code === 11 || between(code, 14, 31) || code === 127;\n}\nfunction newline(code) {\n return code === 10;\n}\nfunction whitespace(code) {\n return newline(code) || code === 9 || code === 32;\n}\nvar maximumallowedcodepoint = 1114111;\nvar InvalidCharacterError = class extends Error {\n constructor(message) {\n super(message);\n this.name = \"InvalidCharacterError\";\n }\n};\nfunction preprocess(str) {\n const codepoints = [];\n for (let i = 0; i < str.length; i++) {\n let code = str.charCodeAt(i);\n if (code === 13 && str.charCodeAt(i + 1) === 10) {\n code = 10;\n i++;\n }\n if (code === 13 || code === 12)\n code = 10;\n if (code === 0)\n code = 65533;\n if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {\n const lead = code - 55296;\n const trail = str.charCodeAt(i + 1) - 56320;\n code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;\n i++;\n }\n codepoints.push(code);\n }\n return codepoints;\n}\nfunction stringFromCode(code) {\n if (code <= 65535)\n return String.fromCharCode(code);\n code -= Math.pow(2, 16);\n const lead = Math.floor(code / Math.pow(2, 10)) + 55296;\n const trail = code % Math.pow(2, 10) + 56320;\n return String.fromCharCode(lead) + String.fromCharCode(trail);\n}\nfunction tokenize(str1) {\n const str = preprocess(str1);\n let i = -1;\n const tokens = [];\n let code;\n let line = 0;\n let column = 0;\n let lastLineLength = 0;\n const incrLineno = function() {\n line += 1;\n lastLineLength = column;\n column = 0;\n };\n const locStart = { line, column };\n const codepoint = function(i2) {\n if (i2 >= str.length)\n return -1;\n return str[i2];\n };\n const next = function(num) {\n if (num === void 0)\n num = 1;\n if (num > 3)\n throw \"Spec Error: no more than three codepoints of lookahead.\";\n return codepoint(i + num);\n };\n const consume = function(num) {\n if (num === void 0)\n num = 1;\n i += num;\n code = codepoint(i);\n if (newline(code))\n incrLineno();\n else\n column += num;\n return true;\n };\n const reconsume = function() {\n i -= 1;\n if (newline(code)) {\n line -= 1;\n column = lastLineLength;\n } else {\n column -= 1;\n }\n locStart.line = line;\n locStart.column = column;\n return true;\n };\n const eof = function(codepoint2) {\n if (codepoint2 === void 0)\n codepoint2 = code;\n return codepoint2 === -1;\n };\n const donothing = function() {\n };\n const parseerror = function() {\n };\n const consumeAToken = function() {\n consumeComments();\n consume();\n if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n return new WhitespaceToken();\n } else if (code === 34) {\n return consumeAStringToken();\n } else if (code === 35) {\n if (namechar(next()) || areAValidEscape(next(1), next(2))) {\n const token = new HashToken(\"\");\n if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n token.type = \"id\";\n token.value = consumeAName();\n return token;\n } else {\n return new DelimToken(code);\n }\n } else if (code === 36) {\n if (next() === 61) {\n consume();\n return new SuffixMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 39) {\n return consumeAStringToken();\n } else if (code === 40) {\n return new OpenParenToken();\n } else if (code === 41) {\n return new CloseParenToken();\n } else if (code === 42) {\n if (next() === 61) {\n consume();\n return new SubstringMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 43) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 44) {\n return new CommaToken();\n } else if (code === 45) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else if (next(1) === 45 && next(2) === 62) {\n consume(2);\n return new CDCToken();\n } else if (startsWithAnIdentifier()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 46) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 58) {\n return new ColonToken();\n } else if (code === 59) {\n return new SemicolonToken();\n } else if (code === 60) {\n if (next(1) === 33 && next(2) === 45 && next(3) === 45) {\n consume(3);\n return new CDOToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 64) {\n if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n return new AtKeywordToken(consumeAName());\n else\n return new DelimToken(code);\n } else if (code === 91) {\n return new OpenSquareToken();\n } else if (code === 92) {\n if (startsWithAValidEscape()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n parseerror();\n return new DelimToken(code);\n }\n } else if (code === 93) {\n return new CloseSquareToken();\n } else if (code === 94) {\n if (next() === 61) {\n consume();\n return new PrefixMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 123) {\n return new OpenCurlyToken();\n } else if (code === 124) {\n if (next() === 61) {\n consume();\n return new DashMatchToken();\n } else if (next() === 124) {\n consume();\n return new ColumnToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 125) {\n return new CloseCurlyToken();\n } else if (code === 126) {\n if (next() === 61) {\n consume();\n return new IncludeMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (digit(code)) {\n reconsume();\n return consumeANumericToken();\n } else if (namestartchar(code)) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else if (eof()) {\n return new EOFToken();\n } else {\n return new DelimToken(code);\n }\n };\n const consumeComments = function() {\n while (next(1) === 47 && next(2) === 42) {\n consume(2);\n while (true) {\n consume();\n if (code === 42 && next() === 47) {\n consume();\n break;\n } else if (eof()) {\n parseerror();\n return;\n }\n }\n }\n };\n const consumeANumericToken = function() {\n const num = consumeANumber();\n if (wouldStartAnIdentifier(next(1), next(2), next(3))) {\n const token = new DimensionToken();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n token.unit = consumeAName();\n return token;\n } else if (next() === 37) {\n consume();\n const token = new PercentageToken();\n token.value = num.value;\n token.repr = num.repr;\n return token;\n } else {\n const token = new NumberToken();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n return token;\n }\n };\n const consumeAnIdentlikeToken = function() {\n const str2 = consumeAName();\n if (str2.toLowerCase() === \"url\" && next() === 40) {\n consume();\n while (whitespace(next(1)) && whitespace(next(2)))\n consume();\n if (next() === 34 || next() === 39)\n return new FunctionToken(str2);\n else if (whitespace(next()) && (next(2) === 34 || next(2) === 39))\n return new FunctionToken(str2);\n else\n return consumeAURLToken();\n } else if (next() === 40) {\n consume();\n return new FunctionToken(str2);\n } else {\n return new IdentToken(str2);\n }\n };\n const consumeAStringToken = function(endingCodePoint) {\n if (endingCodePoint === void 0)\n endingCodePoint = code;\n let string = \"\";\n while (consume()) {\n if (code === endingCodePoint || eof()) {\n return new StringToken(string);\n } else if (newline(code)) {\n parseerror();\n reconsume();\n return new BadStringToken();\n } else if (code === 92) {\n if (eof(next()))\n donothing();\n else if (newline(next()))\n consume();\n else\n string += stringFromCode(consumeEscape());\n } else {\n string += stringFromCode(code);\n }\n }\n throw new Error(\"Internal error\");\n };\n const consumeAURLToken = function() {\n const token = new URLToken(\"\");\n while (whitespace(next()))\n consume();\n if (eof(next()))\n return token;\n while (consume()) {\n if (code === 41 || eof()) {\n return token;\n } else if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n if (next() === 41 || eof(next())) {\n consume();\n return token;\n } else {\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n }\n } else if (code === 34 || code === 39 || code === 40 || nonprintable(code)) {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n } else if (code === 92) {\n if (startsWithAValidEscape()) {\n token.value += stringFromCode(consumeEscape());\n } else {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n }\n } else {\n token.value += stringFromCode(code);\n }\n }\n throw new Error(\"Internal error\");\n };\n const consumeEscape = function() {\n consume();\n if (hexdigit(code)) {\n const digits = [code];\n for (let total = 0; total < 5; total++) {\n if (hexdigit(next())) {\n consume();\n digits.push(code);\n } else {\n break;\n }\n }\n if (whitespace(next()))\n consume();\n let value = parseInt(digits.map(function(x) {\n return String.fromCharCode(x);\n }).join(\"\"), 16);\n if (value > maximumallowedcodepoint)\n value = 65533;\n return value;\n } else if (eof()) {\n return 65533;\n } else {\n return code;\n }\n };\n const areAValidEscape = function(c1, c2) {\n if (c1 !== 92)\n return false;\n if (newline(c2))\n return false;\n return true;\n };\n const startsWithAValidEscape = function() {\n return areAValidEscape(code, next());\n };\n const wouldStartAnIdentifier = function(c1, c2, c3) {\n if (c1 === 45)\n return namestartchar(c2) || c2 === 45 || areAValidEscape(c2, c3);\n else if (namestartchar(c1))\n return true;\n else if (c1 === 92)\n return areAValidEscape(c1, c2);\n else\n return false;\n };\n const startsWithAnIdentifier = function() {\n return wouldStartAnIdentifier(code, next(1), next(2));\n };\n const wouldStartANumber = function(c1, c2, c3) {\n if (c1 === 43 || c1 === 45) {\n if (digit(c2))\n return true;\n if (c2 === 46 && digit(c3))\n return true;\n return false;\n } else if (c1 === 46) {\n if (digit(c2))\n return true;\n return false;\n } else if (digit(c1)) {\n return true;\n } else {\n return false;\n }\n };\n const startsWithANumber = function() {\n return wouldStartANumber(code, next(1), next(2));\n };\n const consumeAName = function() {\n let result = \"\";\n while (consume()) {\n if (namechar(code)) {\n result += stringFromCode(code);\n } else if (startsWithAValidEscape()) {\n result += stringFromCode(consumeEscape());\n } else {\n reconsume();\n return result;\n }\n }\n throw new Error(\"Internal parse error\");\n };\n const consumeANumber = function() {\n let repr = \"\";\n let type = \"integer\";\n if (next() === 43 || next() === 45) {\n consume();\n repr += stringFromCode(code);\n }\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n if (next(1) === 46 && digit(next(2))) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = \"number\";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n const c1 = next(1), c2 = next(2), c3 = next(3);\n if ((c1 === 69 || c1 === 101) && digit(c2)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = \"number\";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n } else if ((c1 === 69 || c1 === 101) && (c2 === 43 || c2 === 45) && digit(c3)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = \"number\";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n const value = convertAStringToANumber(repr);\n return { type, value, repr };\n };\n const convertAStringToANumber = function(string) {\n return +string;\n };\n const consumeTheRemnantsOfABadURL = function() {\n while (consume()) {\n if (code === 41 || eof()) {\n return;\n } else if (startsWithAValidEscape()) {\n consumeEscape();\n donothing();\n } else {\n donothing();\n }\n }\n };\n let iterationCount = 0;\n while (!eof(next())) {\n tokens.push(consumeAToken());\n iterationCount++;\n if (iterationCount > str.length * 2)\n throw new Error(\"I'm infinite-looping!\");\n }\n return tokens;\n}\nvar CSSParserToken = class {\n constructor() {\n this.tokenType = \"\";\n }\n toJSON() {\n return { token: this.tokenType };\n }\n toString() {\n return this.tokenType;\n }\n toSource() {\n return \"\" + this;\n }\n};\nvar BadStringToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"BADSTRING\";\n }\n};\nvar BadURLToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"BADURL\";\n }\n};\nvar WhitespaceToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"WHITESPACE\";\n }\n toString() {\n return \"WS\";\n }\n toSource() {\n return \" \";\n }\n};\nvar CDOToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"CDO\";\n }\n toSource() {\n return \"\";\n }\n};\nvar ColonToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \":\";\n }\n};\nvar SemicolonToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \";\";\n }\n};\nvar CommaToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \",\";\n }\n};\nvar GroupingToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.value = \"\";\n this.mirror = \"\";\n }\n};\nvar OpenCurlyToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"{\";\n this.value = \"{\";\n this.mirror = \"}\";\n }\n};\nvar CloseCurlyToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"}\";\n this.value = \"}\";\n this.mirror = \"{\";\n }\n};\nvar OpenSquareToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"[\";\n this.value = \"[\";\n this.mirror = \"]\";\n }\n};\nvar CloseSquareToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"]\";\n this.value = \"]\";\n this.mirror = \"[\";\n }\n};\nvar OpenParenToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"(\";\n this.value = \"(\";\n this.mirror = \")\";\n }\n};\nvar CloseParenToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \")\";\n this.value = \")\";\n this.mirror = \"(\";\n }\n};\nvar IncludeMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"~=\";\n }\n};\nvar DashMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"|=\";\n }\n};\nvar PrefixMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"^=\";\n }\n};\nvar SuffixMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"$=\";\n }\n};\nvar SubstringMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"*=\";\n }\n};\nvar ColumnToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"||\";\n }\n};\nvar EOFToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"EOF\";\n }\n toSource() {\n return \"\";\n }\n};\nvar DelimToken = class extends CSSParserToken {\n constructor(code) {\n super();\n this.tokenType = \"DELIM\";\n this.value = \"\";\n this.value = stringFromCode(code);\n }\n toString() {\n return \"DELIM(\" + this.value + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n }\n toSource() {\n if (this.value === \"\\\\\")\n return \"\\\\\\n\";\n else\n return this.value;\n }\n};\nvar StringValuedToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.value = \"\";\n }\n ASCIIMatch(str) {\n return this.value.toLowerCase() === str.toLowerCase();\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n }\n};\nvar IdentToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"IDENT\";\n this.value = val;\n }\n toString() {\n return \"IDENT(\" + this.value + \")\";\n }\n toSource() {\n return escapeIdent(this.value);\n }\n};\nvar FunctionToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"FUNCTION\";\n this.value = val;\n this.mirror = \")\";\n }\n toString() {\n return \"FUNCTION(\" + this.value + \")\";\n }\n toSource() {\n return escapeIdent(this.value) + \"(\";\n }\n};\nvar AtKeywordToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"AT-KEYWORD\";\n this.value = val;\n }\n toString() {\n return \"AT(\" + this.value + \")\";\n }\n toSource() {\n return \"@\" + escapeIdent(this.value);\n }\n};\nvar HashToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"HASH\";\n this.value = val;\n this.type = \"unrestricted\";\n }\n toString() {\n return \"HASH(\" + this.value + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n return json;\n }\n toSource() {\n if (this.type === \"id\")\n return \"#\" + escapeIdent(this.value);\n else\n return \"#\" + escapeHash(this.value);\n }\n};\nvar StringToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"STRING\";\n this.value = val;\n }\n toString() {\n return '\"' + escapeString(this.value) + '\"';\n }\n};\nvar URLToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"URL\";\n this.value = val;\n }\n toString() {\n return \"URL(\" + this.value + \")\";\n }\n toSource() {\n return 'url(\"' + escapeString(this.value) + '\")';\n }\n};\nvar NumberToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = \"NUMBER\";\n this.type = \"integer\";\n this.repr = \"\";\n }\n toString() {\n if (this.type === \"integer\")\n return \"INT(\" + this.value + \")\";\n return \"NUMBER(\" + this.value + \")\";\n }\n toJSON() {\n const json = super.toJSON();\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n return json;\n }\n toSource() {\n return this.repr;\n }\n};\nvar PercentageToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = \"PERCENTAGE\";\n this.repr = \"\";\n }\n toString() {\n return \"PERCENTAGE(\" + this.value + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.repr = this.repr;\n return json;\n }\n toSource() {\n return this.repr + \"%\";\n }\n};\nvar DimensionToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = \"DIMENSION\";\n this.type = \"integer\";\n this.repr = \"\";\n this.unit = \"\";\n }\n toString() {\n return \"DIM(\" + this.value + \",\" + this.unit + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n json.unit = this.unit;\n return json;\n }\n toSource() {\n const source = this.repr;\n let unit = escapeIdent(this.unit);\n if (unit[0].toLowerCase() === \"e\" && (unit[1] === \"-\" || between(unit.charCodeAt(1), 48, 57))) {\n unit = \"\\\\65 \" + unit.slice(1, unit.length);\n }\n return source + unit;\n }\n};\nfunction escapeIdent(string) {\n string = \"\" + string;\n let result = \"\";\n const firstcode = string.charCodeAt(0);\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");\n if (between(code, 1, 31) || code === 127 || i === 0 && between(code, 48, 57) || i === 1 && between(code, 48, 57) && firstcode === 45)\n result += \"\\\\\" + code.toString(16) + \" \";\n else if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n result += string[i];\n else\n result += \"\\\\\" + string[i];\n }\n return result;\n}\nfunction escapeHash(string) {\n string = \"\" + string;\n let result = \"\";\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");\n if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n result += string[i];\n else\n result += \"\\\\\" + code.toString(16) + \" \";\n }\n return result;\n}\nfunction escapeString(string) {\n string = \"\" + string;\n let result = \"\";\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");\n if (between(code, 1, 31) || code === 127)\n result += \"\\\\\" + code.toString(16) + \" \";\n else if (code === 34 || code === 92)\n result += \"\\\\\" + string[i];\n else\n result += string[i];\n }\n return result;\n}\n\n// packages/playwright-core/src/utils/isomorphic/cssParser.ts\nvar InvalidSelectorError = class extends Error {\n};\nfunction parseCSS(selector, customNames) {\n let tokens;\n try {\n tokens = tokenize(selector);\n if (!(tokens[tokens.length - 1] instanceof EOFToken))\n tokens.push(new EOFToken());\n } catch (e) {\n const newMessage = e.message + ` while parsing selector \"${selector}\"`;\n const index = (e.stack || \"\").indexOf(e.message);\n if (index !== -1)\n e.stack = e.stack.substring(0, index) + newMessage + e.stack.substring(index + e.message.length);\n e.message = newMessage;\n throw e;\n }\n const unsupportedToken = tokens.find((token) => {\n return token instanceof AtKeywordToken || token instanceof BadStringToken || token instanceof BadURLToken || token instanceof ColumnToken || token instanceof CDOToken || token instanceof CDCToken || token instanceof SemicolonToken || // TODO: Consider using these for something, e.g. to escape complex strings.\n // For example :xpath{ (//div/bar[@attr=\"foo\"])[2]/baz }\n // Or this way :xpath( {complex-xpath-goes-here(\"hello\")} )\n token instanceof OpenCurlyToken || token instanceof CloseCurlyToken || // TODO: Consider treating these as strings?\n token instanceof URLToken || token instanceof PercentageToken;\n });\n if (unsupportedToken)\n throw new InvalidSelectorError(`Unsupported token \"${unsupportedToken.toSource()}\" while parsing selector \"${selector}\"`);\n let pos = 0;\n const names = /* @__PURE__ */ new Set();\n function unexpected() {\n return new InvalidSelectorError(`Unexpected token \"${tokens[pos].toSource()}\" while parsing selector \"${selector}\"`);\n }\n function skipWhitespace() {\n while (tokens[pos] instanceof WhitespaceToken)\n pos++;\n }\n function isIdent(p = pos) {\n return tokens[p] instanceof IdentToken;\n }\n function isString(p = pos) {\n return tokens[p] instanceof StringToken;\n }\n function isNumber(p = pos) {\n return tokens[p] instanceof NumberToken;\n }\n function isComma(p = pos) {\n return tokens[p] instanceof CommaToken;\n }\n function isOpenParen(p = pos) {\n return tokens[p] instanceof OpenParenToken;\n }\n function isCloseParen(p = pos) {\n return tokens[p] instanceof CloseParenToken;\n }\n function isFunction(p = pos) {\n return tokens[p] instanceof FunctionToken;\n }\n function isStar(p = pos) {\n return tokens[p] instanceof DelimToken && tokens[p].value === \"*\";\n }\n function isEOF(p = pos) {\n return tokens[p] instanceof EOFToken;\n }\n function isClauseCombinator(p = pos) {\n return tokens[p] instanceof DelimToken && [\">\", \"+\", \"~\"].includes(tokens[p].value);\n }\n function isSelectorClauseEnd(p = pos) {\n return isComma(p) || isCloseParen(p) || isEOF(p) || isClauseCombinator(p) || tokens[p] instanceof WhitespaceToken;\n }\n function consumeFunctionArguments() {\n const result2 = [consumeArgument()];\n while (true) {\n skipWhitespace();\n if (!isComma())\n break;\n pos++;\n result2.push(consumeArgument());\n }\n return result2;\n }\n function consumeArgument() {\n skipWhitespace();\n if (isNumber())\n return tokens[pos++].value;\n if (isString())\n return tokens[pos++].value;\n return consumeComplexSelector();\n }\n function consumeComplexSelector() {\n const result2 = { simples: [] };\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples.push({ selector: { functions: [{ name: \"scope\", args: [] }] }, combinator: \"\" });\n } else {\n result2.simples.push({ selector: consumeSimpleSelector(), combinator: \"\" });\n }\n while (true) {\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples[result2.simples.length - 1].combinator = tokens[pos++].value;\n skipWhitespace();\n } else if (isSelectorClauseEnd()) {\n break;\n }\n result2.simples.push({ combinator: \"\", selector: consumeSimpleSelector() });\n }\n return result2;\n }\n function consumeSimpleSelector() {\n let rawCSSString = \"\";\n const functions = [];\n while (!isSelectorClauseEnd()) {\n if (isIdent() || isStar()) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof HashToken) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof DelimToken && tokens[pos].value === \".\") {\n pos++;\n if (isIdent())\n rawCSSString += \".\" + tokens[pos++].toSource();\n else\n throw unexpected();\n } else if (tokens[pos] instanceof ColonToken) {\n pos++;\n if (isIdent()) {\n if (!customNames.has(tokens[pos].value.toLowerCase())) {\n rawCSSString += \":\" + tokens[pos++].toSource();\n } else {\n const name = tokens[pos++].value.toLowerCase();\n functions.push({ name, args: [] });\n names.add(name);\n }\n } else if (isFunction()) {\n const name = tokens[pos++].value.toLowerCase();\n if (!customNames.has(name)) {\n rawCSSString += `:${name}(${consumeBuiltinFunctionArguments()})`;\n } else {\n functions.push({ name, args: consumeFunctionArguments() });\n names.add(name);\n }\n skipWhitespace();\n if (!isCloseParen())\n throw unexpected();\n pos++;\n } else {\n throw unexpected();\n }\n } else if (tokens[pos] instanceof OpenSquareToken) {\n rawCSSString += \"[\";\n pos++;\n while (!(tokens[pos] instanceof CloseSquareToken) && !isEOF())\n rawCSSString += tokens[pos++].toSource();\n if (!(tokens[pos] instanceof CloseSquareToken))\n throw unexpected();\n rawCSSString += \"]\";\n pos++;\n } else {\n throw unexpected();\n }\n }\n if (!rawCSSString && !functions.length)\n throw unexpected();\n return { css: rawCSSString || void 0, functions };\n }\n function consumeBuiltinFunctionArguments() {\n let s = \"\";\n let balance = 1;\n while (!isEOF()) {\n if (isOpenParen() || isFunction())\n balance++;\n if (isCloseParen())\n balance--;\n if (!balance)\n break;\n s += tokens[pos++].toSource();\n }\n return s;\n }\n const result = consumeFunctionArguments();\n if (!isEOF())\n throw unexpected();\n if (result.some((arg) => typeof arg !== \"object\" || !(\"simples\" in arg)))\n throw new InvalidSelectorError(`Error while parsing selector \"${selector}\"`);\n return { selector: result, names: Array.from(names) };\n}\n\n// packages/playwright-core/src/utils/isomorphic/selectorParser.ts\nvar kNestedSelectorNames = /* @__PURE__ */ new Set([\"internal:has\", \"internal:has-not\", \"internal:and\", \"internal:or\", \"internal:chain\", \"left-of\", \"right-of\", \"above\", \"below\", \"near\"]);\nvar kNestedSelectorNamesWithDistance = /* @__PURE__ */ new Set([\"left-of\", \"right-of\", \"above\", \"below\", \"near\"]);\nvar customCSSNames = /* @__PURE__ */ new Set([\"not\", \"is\", \"where\", \"has\", \"scope\", \"light\", \"visible\", \"text\", \"text-matches\", \"text-is\", \"has-text\", \"above\", \"below\", \"right-of\", \"left-of\", \"near\", \"nth-match\"]);\nfunction parseSelector(selector) {\n const parsedStrings = parseSelectorString(selector);\n const parts = [];\n for (const part of parsedStrings.parts) {\n if (part.name === \"css\" || part.name === \"css:light\") {\n if (part.name === \"css:light\")\n part.body = \":light(\" + part.body + \")\";\n const parsedCSS = parseCSS(part.body, customCSSNames);\n parts.push({\n name: \"css\",\n body: parsedCSS.selector,\n source: part.body\n });\n continue;\n }\n if (kNestedSelectorNames.has(part.name)) {\n let innerSelector;\n let distance;\n try {\n const unescaped = JSON.parse(\"[\" + part.body + \"]\");\n if (!Array.isArray(unescaped) || unescaped.length < 1 || unescaped.length > 2 || typeof unescaped[0] !== \"string\")\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n innerSelector = unescaped[0];\n if (unescaped.length === 2) {\n if (typeof unescaped[1] !== \"number\" || !kNestedSelectorNamesWithDistance.has(part.name))\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n distance = unescaped[1];\n }\n } catch (e) {\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n }\n const nested = { name: part.name, source: part.body, body: { parsed: parseSelector(innerSelector), distance } };\n const lastFrame = [...nested.body.parsed.parts].reverse().find((part2) => part2.name === \"internal:control\" && part2.body === \"enter-frame\");\n const lastFrameIndex = lastFrame ? nested.body.parsed.parts.indexOf(lastFrame) : -1;\n if (lastFrameIndex !== -1 && selectorPartsEqual(nested.body.parsed.parts.slice(0, lastFrameIndex + 1), parts.slice(0, lastFrameIndex + 1)))\n nested.body.parsed.parts.splice(0, lastFrameIndex + 1);\n parts.push(nested);\n continue;\n }\n parts.push({ ...part, source: part.body });\n }\n if (kNestedSelectorNames.has(parts[0].name))\n throw new InvalidSelectorError(`\"${parts[0].name}\" selector cannot be first`);\n return {\n capture: parsedStrings.capture,\n parts\n };\n}\nfunction selectorPartsEqual(list1, list2) {\n return stringifySelector({ parts: list1 }) === stringifySelector({ parts: list2 });\n}\nfunction stringifySelector(selector, forceEngineName) {\n if (typeof selector === \"string\")\n return selector;\n return selector.parts.map((p, i) => {\n let includeEngine = true;\n if (!forceEngineName && i !== selector.capture) {\n if (p.name === \"css\")\n includeEngine = false;\n else if (p.name === \"xpath\" && p.source.startsWith(\"//\") || p.source.startsWith(\"..\"))\n includeEngine = false;\n }\n const prefix = includeEngine ? p.name + \"=\" : \"\";\n return `${i === selector.capture ? \"*\" : \"\"}${prefix}${p.source}`;\n }).join(\" >> \");\n}\nfunction parseSelectorString(selector) {\n let index = 0;\n let quote;\n let start = 0;\n const result = { parts: [] };\n const append = () => {\n const part = selector.substring(start, index).trim();\n const eqIndex = part.indexOf(\"=\");\n let name;\n let body;\n if (eqIndex !== -1 && part.substring(0, eqIndex).trim().match(/^[a-zA-Z_0-9-+:*]+$/)) {\n name = part.substring(0, eqIndex).trim();\n body = part.substring(eqIndex + 1);\n } else if (part.length > 1 && part[0] === '\"' && part[part.length - 1] === '\"') {\n name = \"text\";\n body = part;\n } else if (part.length > 1 && part[0] === \"'\" && part[part.length - 1] === \"'\") {\n name = \"text\";\n body = part;\n } else if (/^\\(*\\/\\//.test(part) || part.startsWith(\"..\")) {\n name = \"xpath\";\n body = part;\n } else {\n name = \"css\";\n body = part;\n }\n let capture = false;\n if (name[0] === \"*\") {\n capture = true;\n name = name.substring(1);\n }\n result.parts.push({ name, body });\n if (capture) {\n if (result.capture !== void 0)\n throw new InvalidSelectorError(`Only one of the selectors can capture using * modifier`);\n result.capture = result.parts.length - 1;\n }\n };\n if (!selector.includes(\">>\")) {\n index = selector.length;\n append();\n return result;\n }\n const shouldIgnoreTextSelectorQuote = () => {\n const prefix = selector.substring(start, index);\n const match = prefix.match(/^\\s*text\\s*=(.*)$/);\n return !!match && !!match[1];\n };\n while (index < selector.length) {\n const c = selector[index];\n if (c === \"\\\\\" && index + 1 < selector.length) {\n index += 2;\n } else if (c === quote) {\n quote = void 0;\n index++;\n } else if (!quote && (c === '\"' || c === \"'\" || c === \"`\") && !shouldIgnoreTextSelectorQuote()) {\n quote = c;\n index++;\n } else if (!quote && c === \">\" && selector[index + 1] === \">\") {\n append();\n index += 2;\n start = index;\n } else {\n index++;\n }\n }\n append();\n return result;\n}\nfunction parseAttributeSelector(selector, allowUnquotedStrings) {\n let wp = 0;\n let EOL = selector.length === 0;\n const next = () => selector[wp] || \"\";\n const eat1 = () => {\n const result2 = next();\n ++wp;\n EOL = wp >= selector.length;\n return result2;\n };\n const syntaxError = (stage) => {\n if (EOL)\n throw new InvalidSelectorError(`Unexpected end of selector while parsing selector \\`${selector}\\``);\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - unexpected symbol \"${next()}\" at position ${wp}` + (stage ? \" during \" + stage : \"\"));\n };\n function skipSpaces() {\n while (!EOL && /\\s/.test(next()))\n eat1();\n }\n function isCSSNameChar(char) {\n return char >= \"\\x80\" || char >= \"0\" && char <= \"9\" || char >= \"A\" && char <= \"Z\" || char >= \"a\" && char <= \"z\" || char >= \"0\" && char <= \"9\" || char === \"_\" || char === \"-\";\n }\n function readIdentifier() {\n let result2 = \"\";\n skipSpaces();\n while (!EOL && isCSSNameChar(next()))\n result2 += eat1();\n return result2;\n }\n function readQuotedString(quote) {\n let result2 = eat1();\n if (result2 !== quote)\n syntaxError(\"parsing quoted string\");\n while (!EOL && next() !== quote) {\n if (next() === \"\\\\\")\n eat1();\n result2 += eat1();\n }\n if (next() !== quote)\n syntaxError(\"parsing quoted string\");\n result2 += eat1();\n return result2;\n }\n function readRegularExpression() {\n if (eat1() !== \"/\")\n syntaxError(\"parsing regular expression\");\n let source = \"\";\n let inClass = false;\n while (!EOL) {\n if (next() === \"\\\\\") {\n source += eat1();\n if (EOL)\n syntaxError(\"parsing regular expression\");\n } else if (inClass && next() === \"]\") {\n inClass = false;\n } else if (!inClass && next() === \"[\") {\n inClass = true;\n } else if (!inClass && next() === \"/\") {\n break;\n }\n source += eat1();\n }\n if (eat1() !== \"/\")\n syntaxError(\"parsing regular expression\");\n let flags = \"\";\n while (!EOL && next().match(/[dgimsuy]/))\n flags += eat1();\n try {\n return new RegExp(source, flags);\n } catch (e) {\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\`: ${e.message}`);\n }\n }\n function readAttributeToken() {\n let token = \"\";\n skipSpaces();\n if (next() === `'` || next() === `\"`)\n token = readQuotedString(next()).slice(1, -1);\n else\n token = readIdentifier();\n if (!token)\n syntaxError(\"parsing property path\");\n return token;\n }\n function readOperator() {\n skipSpaces();\n let op = \"\";\n if (!EOL)\n op += eat1();\n if (!EOL && op !== \"=\")\n op += eat1();\n if (![\"=\", \"*=\", \"^=\", \"$=\", \"|=\", \"~=\"].includes(op))\n syntaxError(\"parsing operator\");\n return op;\n }\n function readAttribute() {\n eat1();\n const jsonPath = [];\n jsonPath.push(readAttributeToken());\n skipSpaces();\n while (next() === \".\") {\n eat1();\n jsonPath.push(readAttributeToken());\n skipSpaces();\n }\n if (next() === \"]\") {\n eat1();\n return { name: jsonPath.join(\".\"), jsonPath, op: \"\", value: null, caseSensitive: false };\n }\n const operator = readOperator();\n let value = void 0;\n let caseSensitive = true;\n skipSpaces();\n if (next() === \"/\") {\n if (operator !== \"=\")\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with regular expression`);\n value = readRegularExpression();\n } else if (next() === `'` || next() === `\"`) {\n value = readQuotedString(next()).slice(1, -1);\n skipSpaces();\n if (next() === \"i\" || next() === \"I\") {\n caseSensitive = false;\n eat1();\n } else if (next() === \"s\" || next() === \"S\") {\n caseSensitive = true;\n eat1();\n }\n } else {\n value = \"\";\n while (!EOL && (isCSSNameChar(next()) || next() === \"+\" || next() === \".\"))\n value += eat1();\n if (value === \"true\") {\n value = true;\n } else if (value === \"false\") {\n value = false;\n } else {\n if (!allowUnquotedStrings) {\n value = +value;\n if (Number.isNaN(value))\n syntaxError(\"parsing attribute value\");\n }\n }\n }\n skipSpaces();\n if (next() !== \"]\")\n syntaxError(\"parsing attribute value\");\n eat1();\n if (operator !== \"=\" && typeof value !== \"string\")\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with non-string matching value - ${value}`);\n return { name: jsonPath.join(\".\"), jsonPath, op: operator, value, caseSensitive };\n }\n const result = {\n name: \"\",\n attributes: []\n };\n result.name = readIdentifier();\n skipSpaces();\n while (next() === \"[\") {\n result.attributes.push(readAttribute());\n skipSpaces();\n }\n if (!EOL)\n syntaxError(void 0);\n if (!result.name && !result.attributes.length)\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - selector cannot be empty`);\n return result;\n}\n\n// packages/playwright-core/src/utils/isomorphic/locatorGenerators.ts\nfunction asLocator(lang, selector, isFrameLocator = false) {\n return asLocators(lang, selector, isFrameLocator)[0];\n}\nfunction asLocators(lang, selector, isFrameLocator = false, maxOutputSize = 20, preferredQuote) {\n try {\n return innerAsLocators(new generators[lang](preferredQuote), parseSelector(selector), isFrameLocator, maxOutputSize);\n } catch (e) {\n return [selector];\n }\n}\nfunction innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize = 20) {\n const parts = [...parsed.parts];\n for (let index = 0; index < parts.length - 1; index++) {\n if (parts[index].name === \"nth\" && parts[index + 1].name === \"internal:control\" && parts[index + 1].body === \"enter-frame\") {\n const [nth] = parts.splice(index, 1);\n parts.splice(index + 1, 0, nth);\n }\n }\n const tokens = [];\n let nextBase = isFrameLocator ? \"frame-locator\" : \"page\";\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const base = nextBase;\n nextBase = \"locator\";\n if (part.name === \"nth\") {\n if (part.body === \"0\")\n tokens.push([factory.generateLocator(base, \"first\", \"\"), factory.generateLocator(base, \"nth\", \"0\")]);\n else if (part.body === \"-1\")\n tokens.push([factory.generateLocator(base, \"last\", \"\"), factory.generateLocator(base, \"nth\", \"-1\")]);\n else\n tokens.push([factory.generateLocator(base, \"nth\", part.body)]);\n continue;\n }\n if (part.name === \"internal:text\") {\n const { exact, text } = detectExact(part.body);\n tokens.push([factory.generateLocator(base, \"text\", text, { exact })]);\n continue;\n }\n if (part.name === \"internal:has-text\") {\n const { exact, text } = detectExact(part.body);\n if (!exact) {\n tokens.push([factory.generateLocator(base, \"has-text\", text, { exact })]);\n continue;\n }\n }\n if (part.name === \"internal:has-not-text\") {\n const { exact, text } = detectExact(part.body);\n if (!exact) {\n tokens.push([factory.generateLocator(base, \"has-not-text\", text, { exact })]);\n continue;\n }\n }\n if (part.name === \"internal:has\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"has\", inner)));\n continue;\n }\n if (part.name === \"internal:has-not\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"hasNot\", inner)));\n continue;\n }\n if (part.name === \"internal:and\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"and\", inner)));\n continue;\n }\n if (part.name === \"internal:or\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"or\", inner)));\n continue;\n }\n if (part.name === \"internal:chain\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"chain\", inner)));\n continue;\n }\n if (part.name === \"internal:label\") {\n const { exact, text } = detectExact(part.body);\n tokens.push([factory.generateLocator(base, \"label\", text, { exact })]);\n continue;\n }\n if (part.name === \"internal:role\") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const options = { attrs: [] };\n for (const attr of attrSelector.attributes) {\n if (attr.name === \"name\") {\n options.exact = attr.caseSensitive;\n options.name = attr.value;\n } else {\n if (attr.name === \"level\" && typeof attr.value === \"string\")\n attr.value = +attr.value;\n options.attrs.push({ name: attr.name === \"include-hidden\" ? \"includeHidden\" : attr.name, value: attr.value });\n }\n }\n tokens.push([factory.generateLocator(base, \"role\", attrSelector.name, options)]);\n continue;\n }\n if (part.name === \"internal:testid\") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const { value } = attrSelector.attributes[0];\n tokens.push([factory.generateLocator(base, \"test-id\", value)]);\n continue;\n }\n if (part.name === \"internal:attr\") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const { name, value, caseSensitive } = attrSelector.attributes[0];\n const text = value;\n const exact = !!caseSensitive;\n if (name === \"placeholder\") {\n tokens.push([factory.generateLocator(base, \"placeholder\", text, { exact })]);\n continue;\n }\n if (name === \"alt\") {\n tokens.push([factory.generateLocator(base, \"alt\", text, { exact })]);\n continue;\n }\n if (name === \"title\") {\n tokens.push([factory.generateLocator(base, \"title\", text, { exact })]);\n continue;\n }\n }\n let locatorType = \"default\";\n const nextPart = parts[index + 1];\n if (nextPart && nextPart.name === \"internal:control\" && nextPart.body === \"enter-frame\") {\n locatorType = \"frame\";\n nextBase = \"frame-locator\";\n index++;\n }\n const selectorPart = stringifySelector({ parts: [part] });\n const locatorPart = factory.generateLocator(base, locatorType, selectorPart);\n if (locatorType === \"default\" && nextPart && [\"internal:has-text\", \"internal:has-not-text\"].includes(nextPart.name)) {\n const { exact, text } = detectExact(nextPart.body);\n if (!exact) {\n const nextLocatorPart = factory.generateLocator(\"locator\", nextPart.name === \"internal:has-text\" ? \"has-text\" : \"has-not-text\", text, { exact });\n const options = {};\n if (nextPart.name === \"internal:has-text\")\n options.hasText = text;\n else\n options.hasNotText = text;\n const combinedPart = factory.generateLocator(base, \"default\", selectorPart, options);\n tokens.push([factory.chainLocators([locatorPart, nextLocatorPart]), combinedPart]);\n index++;\n continue;\n }\n }\n let locatorPartWithEngine;\n if ([\"xpath\", \"css\"].includes(part.name)) {\n const selectorPart2 = stringifySelector(\n { parts: [part] },\n /* forceEngineName */\n true\n );\n locatorPartWithEngine = factory.generateLocator(base, locatorType, selectorPart2);\n }\n tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean));\n }\n return combineTokens(factory, tokens, maxOutputSize);\n}\nfunction combineTokens(factory, tokens, maxOutputSize) {\n const currentTokens = tokens.map(() => \"\");\n const result = [];\n const visit = (index) => {\n if (index === tokens.length) {\n result.push(factory.chainLocators(currentTokens));\n return currentTokens.length < maxOutputSize;\n }\n for (const taken of tokens[index]) {\n currentTokens[index] = taken;\n if (!visit(index + 1))\n return false;\n }\n return true;\n };\n visit(0);\n return result;\n}\nfunction detectExact(text) {\n let exact = false;\n const match = text.match(/^\\/(.*)\\/([igm]*)$/);\n if (match)\n return { text: new RegExp(match[1], match[2]) };\n if (text.endsWith('\"')) {\n text = JSON.parse(text);\n exact = true;\n } else if (text.endsWith('\"s')) {\n text = JSON.parse(text.substring(0, text.length - 1));\n exact = true;\n } else if (text.endsWith('\"i')) {\n text = JSON.parse(text.substring(0, text.length - 1));\n exact = false;\n }\n return { exact, text };\n}\nvar JavaScriptLocatorFactory = class {\n constructor(preferredQuote) {\n this.preferredQuote = preferredQuote;\n }\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, { hasText: ${this.toHasText(options.hasText)} })`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, { hasNotText: ${this.toHasText(options.hasNotText)} })`;\n return `locator(${this.quote(body)})`;\n case \"frame\":\n return `frameLocator(${this.quote(body)})`;\n case \"nth\":\n return `nth(${body})`;\n case \"first\":\n return `first()`;\n case \"last\":\n return `last()`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`name: ${this.regexToSourceString(options.name)}`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`name: ${this.quote(options.name)}`);\n if (options.exact)\n attrs.push(`exact: true`);\n }\n for (const { name, value } of options.attrs)\n attrs.push(`${name}: ${typeof value === \"string\" ? this.quote(value) : value}`);\n const attrString = attrs.length ? `, { ${attrs.join(\", \")} }` : \"\";\n return `getByRole(${this.quote(body)}${attrString})`;\n case \"has-text\":\n return `filter({ hasText: ${this.toHasText(body)} })`;\n case \"has-not-text\":\n return `filter({ hasNotText: ${this.toHasText(body)} })`;\n case \"has\":\n return `filter({ has: ${body} })`;\n case \"hasNot\":\n return `filter({ hasNot: ${body} })`;\n case \"and\":\n return `and(${body})`;\n case \"or\":\n return `or(${body})`;\n case \"chain\":\n return `locator(${body})`;\n case \"test-id\":\n return `getByTestId(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(\"getByText\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(\"getByAltText\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(\"getByPlaceholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(\"getByLabel\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(\"getByTitle\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToSourceString(re) {\n return normalizeEscapedRegexQuotes(String(re));\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToSourceString(body)})`;\n return exact ? `${method}(${this.quote(body)}, { exact: true })` : `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToSourceString(body);\n return this.quote(body);\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToSourceString(value);\n return this.quote(value);\n }\n quote(text) {\n var _a;\n return escapeWithQuotes(text, (_a = this.preferredQuote) != null ? _a : \"'\");\n }\n};\nvar PythonLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, has_text=${this.toHasText(options.hasText)})`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, has_not_text=${this.toHasText(options.hasNotText)})`;\n return `locator(${this.quote(body)})`;\n case \"frame\":\n return `frame_locator(${this.quote(body)})`;\n case \"nth\":\n return `nth(${body})`;\n case \"first\":\n return `first`;\n case \"last\":\n return `last`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`name=${this.regexToString(options.name)}`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`name=${this.quote(options.name)}`);\n if (options.exact)\n attrs.push(`exact=True`);\n }\n for (const { name, value } of options.attrs) {\n let valueString = typeof value === \"string\" ? this.quote(value) : value;\n if (typeof value === \"boolean\")\n valueString = value ? \"True\" : \"False\";\n attrs.push(`${toSnakeCase(name)}=${valueString}`);\n }\n const attrString = attrs.length ? `, ${attrs.join(\", \")}` : \"\";\n return `get_by_role(${this.quote(body)}${attrString})`;\n case \"has-text\":\n return `filter(has_text=${this.toHasText(body)})`;\n case \"has-not-text\":\n return `filter(has_not_text=${this.toHasText(body)})`;\n case \"has\":\n return `filter(has=${body})`;\n case \"hasNot\":\n return `filter(has_not=${body})`;\n case \"and\":\n return `and_(${body})`;\n case \"or\":\n return `or_(${body})`;\n case \"chain\":\n return `locator(${body})`;\n case \"test-id\":\n return `get_by_test_id(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(\"get_by_text\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(\"get_by_alt_text\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(\"get_by_placeholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(\"get_by_label\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(\"get_by_title\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToString(body) {\n const suffix = body.flags.includes(\"i\") ? \", re.IGNORECASE\" : \"\";\n return `re.compile(r\"${normalizeEscapedRegexQuotes(body.source).replace(/\\\\\\//, \"/\").replace(/\"/g, '\\\\\"')}\"${suffix})`;\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, exact=True)`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToString(body);\n return `${this.quote(body)}`;\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n quote(text) {\n return escapeWithQuotes(text, '\"');\n }\n};\nvar JavaLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n let clazz;\n switch (base) {\n case \"page\":\n clazz = \"Page\";\n break;\n case \"frame-locator\":\n clazz = \"FrameLocator\";\n break;\n case \"locator\":\n clazz = \"Locator\";\n break;\n }\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasText(${this.toHasText(options.hasText)}))`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasNotText(${this.toHasText(options.hasNotText)}))`;\n return `locator(${this.quote(body)})`;\n case \"frame\":\n return `frameLocator(${this.quote(body)})`;\n case \"nth\":\n return `nth(${body})`;\n case \"first\":\n return `first()`;\n case \"last\":\n return `last()`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`.setName(${this.regexToString(options.name)})`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`.setName(${this.quote(options.name)})`);\n if (options.exact)\n attrs.push(`.setExact(true)`);\n }\n for (const { name, value } of options.attrs)\n attrs.push(`.set${toTitleCase(name)}(${typeof value === \"string\" ? this.quote(value) : value})`);\n const attrString = attrs.length ? `, new ${clazz}.GetByRoleOptions()${attrs.join(\"\")}` : \"\";\n return `getByRole(AriaRole.${toSnakeCase(body).toUpperCase()}${attrString})`;\n case \"has-text\":\n return `filter(new ${clazz}.FilterOptions().setHasText(${this.toHasText(body)}))`;\n case \"has-not-text\":\n return `filter(new ${clazz}.FilterOptions().setHasNotText(${this.toHasText(body)}))`;\n case \"has\":\n return `filter(new ${clazz}.FilterOptions().setHas(${body}))`;\n case \"hasNot\":\n return `filter(new ${clazz}.FilterOptions().setHasNot(${body}))`;\n case \"and\":\n return `and(${body})`;\n case \"or\":\n return `or(${body})`;\n case \"chain\":\n return `locator(${body})`;\n case \"test-id\":\n return `getByTestId(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(clazz, \"getByText\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(clazz, \"getByAltText\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(clazz, \"getByPlaceholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(clazz, \"getByLabel\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(clazz, \"getByTitle\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToString(body) {\n const suffix = body.flags.includes(\"i\") ? \", Pattern.CASE_INSENSITIVE\" : \"\";\n return `Pattern.compile(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n }\n toCallWithExact(clazz, method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, new ${clazz}.${toTitleCase(method)}Options().setExact(true))`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToString(body);\n return this.quote(body);\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n quote(text) {\n return escapeWithQuotes(text, '\"');\n }\n};\nvar CSharpLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `Locator(${this.quote(body)}, new() { ${this.toHasText(options.hasText)} })`;\n if (options.hasNotText !== void 0)\n return `Locator(${this.quote(body)}, new() { ${this.toHasNotText(options.hasNotText)} })`;\n return `Locator(${this.quote(body)})`;\n case \"frame\":\n return `FrameLocator(${this.quote(body)})`;\n case \"nth\":\n return `Nth(${body})`;\n case \"first\":\n return `First`;\n case \"last\":\n return `Last`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`NameRegex = ${this.regexToString(options.name)}`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`Name = ${this.quote(options.name)}`);\n if (options.exact)\n attrs.push(`Exact = true`);\n }\n for (const { name, value } of options.attrs)\n attrs.push(`${toTitleCase(name)} = ${typeof value === \"string\" ? this.quote(value) : value}`);\n const attrString = attrs.length ? `, new() { ${attrs.join(\", \")} }` : \"\";\n return `GetByRole(AriaRole.${toTitleCase(body)}${attrString})`;\n case \"has-text\":\n return `Filter(new() { ${this.toHasText(body)} })`;\n case \"has-not-text\":\n return `Filter(new() { ${this.toHasNotText(body)} })`;\n case \"has\":\n return `Filter(new() { Has = ${body} })`;\n case \"hasNot\":\n return `Filter(new() { HasNot = ${body} })`;\n case \"and\":\n return `And(${body})`;\n case \"or\":\n return `Or(${body})`;\n case \"chain\":\n return `Locator(${body})`;\n case \"test-id\":\n return `GetByTestId(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(\"GetByText\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(\"GetByAltText\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(\"GetByPlaceholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(\"GetByLabel\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(\"GetByTitle\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToString(body) {\n const suffix = body.flags.includes(\"i\") ? \", RegexOptions.IgnoreCase\" : \"\";\n return `new Regex(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, new() { Exact = true })`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return `HasTextRegex = ${this.regexToString(body)}`;\n return `HasText = ${this.quote(body)}`;\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n toHasNotText(body) {\n if (isRegExp(body))\n return `HasNotTextRegex = ${this.regexToString(body)}`;\n return `HasNotText = ${this.quote(body)}`;\n }\n quote(text) {\n return escapeWithQuotes(text, '\"');\n }\n};\nvar JsonlLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n return JSON.stringify({\n kind,\n body,\n options\n });\n }\n chainLocators(locators) {\n const objects = locators.map((l) => JSON.parse(l));\n for (let i = 0; i < objects.length - 1; ++i)\n objects[i].next = objects[i + 1];\n return JSON.stringify(objects[0]);\n }\n};\nvar generators = {\n javascript: JavaScriptLocatorFactory,\n python: PythonLocatorFactory,\n java: JavaLocatorFactory,\n csharp: CSharpLocatorFactory,\n jsonl: JsonlLocatorFactory\n};\nfunction isRegExp(obj) {\n return obj instanceof RegExp;\n}\n\n// packages/playwright-core/src/server/injected/consoleApi.ts\nvar selectorSymbol = Symbol(\"selector\");\nvar _Locator = class _Locator {\n constructor(injectedScript, selector, options) {\n if (options == null ? void 0 : options.hasText)\n selector += ` >> internal:has-text=${escapeForTextSelector(options.hasText, false)}`;\n if (options == null ? void 0 : options.hasNotText)\n selector += ` >> internal:has-not-text=${escapeForTextSelector(options.hasNotText, false)}`;\n if (options == null ? void 0 : options.has)\n selector += ` >> internal:has=` + JSON.stringify(options.has[selectorSymbol]);\n if (options == null ? void 0 : options.hasNot)\n selector += ` >> internal:has-not=` + JSON.stringify(options.hasNot[selectorSymbol]);\n this[selectorSymbol] = selector;\n if (selector) {\n const parsed = injectedScript.parseSelector(selector);\n this.element = injectedScript.querySelector(parsed, injectedScript.document, false);\n this.elements = injectedScript.querySelectorAll(parsed, injectedScript.document);\n }\n const selectorBase = selector;\n const self = this;\n self.locator = (selector2, options2) => {\n return new _Locator(injectedScript, selectorBase ? selectorBase + \" >> \" + selector2 : selector2, options2);\n };\n self.getByTestId = (testId) => self.locator(getByTestIdSelector(injectedScript.testIdAttributeNameForStrictErrorAndConsoleCodegen(), testId));\n self.getByAltText = (text, options2) => self.locator(getByAltTextSelector(text, options2));\n self.getByLabel = (text, options2) => self.locator(getByLabelSelector(text, options2));\n self.getByPlaceholder = (text, options2) => self.locator(getByPlaceholderSelector(text, options2));\n self.getByText = (text, options2) => self.locator(getByTextSelector(text, options2));\n self.getByTitle = (text, options2) => self.locator(getByTitleSelector(text, options2));\n self.getByRole = (role, options2 = {}) => self.locator(getByRoleSelector(role, options2));\n self.filter = (options2) => new _Locator(injectedScript, selector, options2);\n self.first = () => self.locator(\"nth=0\");\n self.last = () => self.locator(\"nth=-1\");\n self.nth = (index) => self.locator(`nth=${index}`);\n self.and = (locator) => new _Locator(injectedScript, selectorBase + ` >> internal:and=` + JSON.stringify(locator[selectorSymbol]));\n self.or = (locator) => new _Locator(injectedScript, selectorBase + ` >> internal:or=` + JSON.stringify(locator[selectorSymbol]));\n }\n};\nselectorSymbol;\nvar Locator = _Locator;\nvar ConsoleAPI = class {\n constructor(injectedScript) {\n this._injectedScript = injectedScript;\n if (this._injectedScript.window.playwright)\n return;\n this._injectedScript.window.playwright = {\n $: (selector, strict) => this._querySelector(selector, !!strict),\n $$: (selector) => this._querySelectorAll(selector),\n inspect: (selector) => this._inspect(selector),\n selector: (element) => this._selector(element),\n generateLocator: (element, language) => this._generateLocator(element, language),\n resume: () => this._resume(),\n ...new Locator(injectedScript, \"\")\n };\n delete this._injectedScript.window.playwright.filter;\n delete this._injectedScript.window.playwright.first;\n delete this._injectedScript.window.playwright.last;\n delete this._injectedScript.window.playwright.nth;\n delete this._injectedScript.window.playwright.and;\n delete this._injectedScript.window.playwright.or;\n }\n _querySelector(selector, strict) {\n if (typeof selector !== \"string\")\n throw new Error(`Usage: playwright.query('Playwright >> selector').`);\n const parsed = this._injectedScript.parseSelector(selector);\n return this._injectedScript.querySelector(parsed, this._injectedScript.document, strict);\n }\n _querySelectorAll(selector) {\n if (typeof selector !== \"string\")\n throw new Error(`Usage: playwright.$$('Playwright >> selector').`);\n const parsed = this._injectedScript.parseSelector(selector);\n return this._injectedScript.querySelectorAll(parsed, this._injectedScript.document);\n }\n _inspect(selector) {\n if (typeof selector !== \"string\")\n throw new Error(`Usage: playwright.inspect('Playwright >> selector').`);\n this._injectedScript.window.inspect(this._querySelector(selector, false));\n }\n _selector(element) {\n if (!(element instanceof Element))\n throw new Error(`Usage: playwright.selector(element).`);\n return this._injectedScript.generateSelectorSimple(element);\n }\n _generateLocator(element, language) {\n if (!(element instanceof Element))\n throw new Error(`Usage: playwright.locator(element).`);\n const selector = this._injectedScript.generateSelectorSimple(element);\n return asLocator(language || \"javascript\", selector);\n }\n _resume() {\n this._injectedScript.window.__pw_resume().catch(() => {\n });\n }\n};\nvar consoleApi_default = ConsoleAPI;\n"; \ No newline at end of file +const source = exports.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/playwright-core/src/server/injected/consoleApi.ts\nvar consoleApi_exports = {};\n__export(consoleApi_exports, {\n default: () => consoleApi_default\n});\nmodule.exports = __toCommonJS(consoleApi_exports);\n\n// packages/playwright-core/src/utils/isomorphic/stringUtils.ts\nfunction escapeWithQuotes(text, char = \"'\") {\n const stringified = JSON.stringify(text);\n const escapedText = stringified.substring(1, stringified.length - 1).replace(/\\\\\"/g, '\"');\n if (char === \"'\")\n return char + escapedText.replace(/[']/g, \"\\\\'\") + char;\n if (char === '\"')\n return char + escapedText.replace(/[\"]/g, '\\\\\"') + char;\n if (char === \"`\")\n return char + escapedText.replace(/[`]/g, \"`\") + char;\n throw new Error(\"Invalid escape char\");\n}\nfunction toTitleCase(name) {\n return name.charAt(0).toUpperCase() + name.substring(1);\n}\nfunction toSnakeCase(name) {\n return name.replace(/([a-z0-9])([A-Z])/g, \"$1_$2\").replace(/([A-Z])([A-Z][a-z])/g, \"$1_$2\").toLowerCase();\n}\nfunction normalizeEscapedRegexQuotes(source) {\n return source.replace(/(^|[^\\\\])(\\\\\\\\)*\\\\(['\"`])/g, \"$1$2$3\");\n}\nfunction escapeRegexForSelector(re) {\n if (re.unicode || re.unicodeSets)\n return String(re);\n return String(re).replace(/(^|[^\\\\])(\\\\\\\\)*([\"'`])/g, \"$1$2\\\\$3\").replace(/>>/g, \"\\\\>\\\\>\");\n}\nfunction escapeForTextSelector(text, exact) {\n if (typeof text !== \"string\")\n return escapeRegexForSelector(text);\n return `${JSON.stringify(text)}${exact ? \"s\" : \"i\"}`;\n}\nfunction escapeForAttributeSelector(value, exact) {\n if (typeof value !== \"string\")\n return escapeRegexForSelector(value);\n return `\"${value.replace(/\\\\/g, \"\\\\\\\\\").replace(/[\"]/g, '\\\\\"')}\"${exact ? \"s\" : \"i\"}`;\n}\n\n// packages/playwright-core/src/utils/isomorphic/locatorUtils.ts\nfunction getByAttributeTextSelector(attrName, text, options) {\n return `internal:attr=[${attrName}=${escapeForAttributeSelector(text, (options == null ? void 0 : options.exact) || false)}]`;\n}\nfunction getByTestIdSelector(testIdAttributeName, testId) {\n return `internal:testid=[${testIdAttributeName}=${escapeForAttributeSelector(testId, true)}]`;\n}\nfunction getByLabelSelector(text, options) {\n return \"internal:label=\" + escapeForTextSelector(text, !!(options == null ? void 0 : options.exact));\n}\nfunction getByAltTextSelector(text, options) {\n return getByAttributeTextSelector(\"alt\", text, options);\n}\nfunction getByTitleSelector(text, options) {\n return getByAttributeTextSelector(\"title\", text, options);\n}\nfunction getByPlaceholderSelector(text, options) {\n return getByAttributeTextSelector(\"placeholder\", text, options);\n}\nfunction getByTextSelector(text, options) {\n return \"internal:text=\" + escapeForTextSelector(text, !!(options == null ? void 0 : options.exact));\n}\nfunction getByRoleSelector(role, options = {}) {\n const props = [];\n if (options.checked !== void 0)\n props.push([\"checked\", String(options.checked)]);\n if (options.disabled !== void 0)\n props.push([\"disabled\", String(options.disabled)]);\n if (options.selected !== void 0)\n props.push([\"selected\", String(options.selected)]);\n if (options.expanded !== void 0)\n props.push([\"expanded\", String(options.expanded)]);\n if (options.includeHidden !== void 0)\n props.push([\"include-hidden\", String(options.includeHidden)]);\n if (options.level !== void 0)\n props.push([\"level\", String(options.level)]);\n if (options.name !== void 0)\n props.push([\"name\", escapeForAttributeSelector(options.name, !!options.exact)]);\n if (options.pressed !== void 0)\n props.push([\"pressed\", String(options.pressed)]);\n return `internal:role=${role}${props.map(([n, v]) => `[${n}=${v}]`).join(\"\")}`;\n}\n\n// packages/playwright-core/src/utils/isomorphic/cssTokenizer.ts\nvar between = function(num, first, last) {\n return num >= first && num <= last;\n};\nfunction digit(code) {\n return between(code, 48, 57);\n}\nfunction hexdigit(code) {\n return digit(code) || between(code, 65, 70) || between(code, 97, 102);\n}\nfunction uppercaseletter(code) {\n return between(code, 65, 90);\n}\nfunction lowercaseletter(code) {\n return between(code, 97, 122);\n}\nfunction letter(code) {\n return uppercaseletter(code) || lowercaseletter(code);\n}\nfunction nonascii(code) {\n return code >= 128;\n}\nfunction namestartchar(code) {\n return letter(code) || nonascii(code) || code === 95;\n}\nfunction namechar(code) {\n return namestartchar(code) || digit(code) || code === 45;\n}\nfunction nonprintable(code) {\n return between(code, 0, 8) || code === 11 || between(code, 14, 31) || code === 127;\n}\nfunction newline(code) {\n return code === 10;\n}\nfunction whitespace(code) {\n return newline(code) || code === 9 || code === 32;\n}\nvar maximumallowedcodepoint = 1114111;\nvar InvalidCharacterError = class extends Error {\n constructor(message) {\n super(message);\n this.name = \"InvalidCharacterError\";\n }\n};\nfunction preprocess(str) {\n const codepoints = [];\n for (let i = 0; i < str.length; i++) {\n let code = str.charCodeAt(i);\n if (code === 13 && str.charCodeAt(i + 1) === 10) {\n code = 10;\n i++;\n }\n if (code === 13 || code === 12)\n code = 10;\n if (code === 0)\n code = 65533;\n if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {\n const lead = code - 55296;\n const trail = str.charCodeAt(i + 1) - 56320;\n code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;\n i++;\n }\n codepoints.push(code);\n }\n return codepoints;\n}\nfunction stringFromCode(code) {\n if (code <= 65535)\n return String.fromCharCode(code);\n code -= Math.pow(2, 16);\n const lead = Math.floor(code / Math.pow(2, 10)) + 55296;\n const trail = code % Math.pow(2, 10) + 56320;\n return String.fromCharCode(lead) + String.fromCharCode(trail);\n}\nfunction tokenize(str1) {\n const str = preprocess(str1);\n let i = -1;\n const tokens = [];\n let code;\n let line = 0;\n let column = 0;\n let lastLineLength = 0;\n const incrLineno = function() {\n line += 1;\n lastLineLength = column;\n column = 0;\n };\n const locStart = { line, column };\n const codepoint = function(i2) {\n if (i2 >= str.length)\n return -1;\n return str[i2];\n };\n const next = function(num) {\n if (num === void 0)\n num = 1;\n if (num > 3)\n throw \"Spec Error: no more than three codepoints of lookahead.\";\n return codepoint(i + num);\n };\n const consume = function(num) {\n if (num === void 0)\n num = 1;\n i += num;\n code = codepoint(i);\n if (newline(code))\n incrLineno();\n else\n column += num;\n return true;\n };\n const reconsume = function() {\n i -= 1;\n if (newline(code)) {\n line -= 1;\n column = lastLineLength;\n } else {\n column -= 1;\n }\n locStart.line = line;\n locStart.column = column;\n return true;\n };\n const eof = function(codepoint2) {\n if (codepoint2 === void 0)\n codepoint2 = code;\n return codepoint2 === -1;\n };\n const donothing = function() {\n };\n const parseerror = function() {\n };\n const consumeAToken = function() {\n consumeComments();\n consume();\n if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n return new WhitespaceToken();\n } else if (code === 34) {\n return consumeAStringToken();\n } else if (code === 35) {\n if (namechar(next()) || areAValidEscape(next(1), next(2))) {\n const token = new HashToken(\"\");\n if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n token.type = \"id\";\n token.value = consumeAName();\n return token;\n } else {\n return new DelimToken(code);\n }\n } else if (code === 36) {\n if (next() === 61) {\n consume();\n return new SuffixMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 39) {\n return consumeAStringToken();\n } else if (code === 40) {\n return new OpenParenToken();\n } else if (code === 41) {\n return new CloseParenToken();\n } else if (code === 42) {\n if (next() === 61) {\n consume();\n return new SubstringMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 43) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 44) {\n return new CommaToken();\n } else if (code === 45) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else if (next(1) === 45 && next(2) === 62) {\n consume(2);\n return new CDCToken();\n } else if (startsWithAnIdentifier()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 46) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 58) {\n return new ColonToken();\n } else if (code === 59) {\n return new SemicolonToken();\n } else if (code === 60) {\n if (next(1) === 33 && next(2) === 45 && next(3) === 45) {\n consume(3);\n return new CDOToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 64) {\n if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n return new AtKeywordToken(consumeAName());\n else\n return new DelimToken(code);\n } else if (code === 91) {\n return new OpenSquareToken();\n } else if (code === 92) {\n if (startsWithAValidEscape()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n parseerror();\n return new DelimToken(code);\n }\n } else if (code === 93) {\n return new CloseSquareToken();\n } else if (code === 94) {\n if (next() === 61) {\n consume();\n return new PrefixMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 123) {\n return new OpenCurlyToken();\n } else if (code === 124) {\n if (next() === 61) {\n consume();\n return new DashMatchToken();\n } else if (next() === 124) {\n consume();\n return new ColumnToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 125) {\n return new CloseCurlyToken();\n } else if (code === 126) {\n if (next() === 61) {\n consume();\n return new IncludeMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (digit(code)) {\n reconsume();\n return consumeANumericToken();\n } else if (namestartchar(code)) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else if (eof()) {\n return new EOFToken();\n } else {\n return new DelimToken(code);\n }\n };\n const consumeComments = function() {\n while (next(1) === 47 && next(2) === 42) {\n consume(2);\n while (true) {\n consume();\n if (code === 42 && next() === 47) {\n consume();\n break;\n } else if (eof()) {\n parseerror();\n return;\n }\n }\n }\n };\n const consumeANumericToken = function() {\n const num = consumeANumber();\n if (wouldStartAnIdentifier(next(1), next(2), next(3))) {\n const token = new DimensionToken();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n token.unit = consumeAName();\n return token;\n } else if (next() === 37) {\n consume();\n const token = new PercentageToken();\n token.value = num.value;\n token.repr = num.repr;\n return token;\n } else {\n const token = new NumberToken();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n return token;\n }\n };\n const consumeAnIdentlikeToken = function() {\n const str2 = consumeAName();\n if (str2.toLowerCase() === \"url\" && next() === 40) {\n consume();\n while (whitespace(next(1)) && whitespace(next(2)))\n consume();\n if (next() === 34 || next() === 39)\n return new FunctionToken(str2);\n else if (whitespace(next()) && (next(2) === 34 || next(2) === 39))\n return new FunctionToken(str2);\n else\n return consumeAURLToken();\n } else if (next() === 40) {\n consume();\n return new FunctionToken(str2);\n } else {\n return new IdentToken(str2);\n }\n };\n const consumeAStringToken = function(endingCodePoint) {\n if (endingCodePoint === void 0)\n endingCodePoint = code;\n let string = \"\";\n while (consume()) {\n if (code === endingCodePoint || eof()) {\n return new StringToken(string);\n } else if (newline(code)) {\n parseerror();\n reconsume();\n return new BadStringToken();\n } else if (code === 92) {\n if (eof(next()))\n donothing();\n else if (newline(next()))\n consume();\n else\n string += stringFromCode(consumeEscape());\n } else {\n string += stringFromCode(code);\n }\n }\n throw new Error(\"Internal error\");\n };\n const consumeAURLToken = function() {\n const token = new URLToken(\"\");\n while (whitespace(next()))\n consume();\n if (eof(next()))\n return token;\n while (consume()) {\n if (code === 41 || eof()) {\n return token;\n } else if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n if (next() === 41 || eof(next())) {\n consume();\n return token;\n } else {\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n }\n } else if (code === 34 || code === 39 || code === 40 || nonprintable(code)) {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n } else if (code === 92) {\n if (startsWithAValidEscape()) {\n token.value += stringFromCode(consumeEscape());\n } else {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n }\n } else {\n token.value += stringFromCode(code);\n }\n }\n throw new Error(\"Internal error\");\n };\n const consumeEscape = function() {\n consume();\n if (hexdigit(code)) {\n const digits = [code];\n for (let total = 0; total < 5; total++) {\n if (hexdigit(next())) {\n consume();\n digits.push(code);\n } else {\n break;\n }\n }\n if (whitespace(next()))\n consume();\n let value = parseInt(digits.map(function(x) {\n return String.fromCharCode(x);\n }).join(\"\"), 16);\n if (value > maximumallowedcodepoint)\n value = 65533;\n return value;\n } else if (eof()) {\n return 65533;\n } else {\n return code;\n }\n };\n const areAValidEscape = function(c1, c2) {\n if (c1 !== 92)\n return false;\n if (newline(c2))\n return false;\n return true;\n };\n const startsWithAValidEscape = function() {\n return areAValidEscape(code, next());\n };\n const wouldStartAnIdentifier = function(c1, c2, c3) {\n if (c1 === 45)\n return namestartchar(c2) || c2 === 45 || areAValidEscape(c2, c3);\n else if (namestartchar(c1))\n return true;\n else if (c1 === 92)\n return areAValidEscape(c1, c2);\n else\n return false;\n };\n const startsWithAnIdentifier = function() {\n return wouldStartAnIdentifier(code, next(1), next(2));\n };\n const wouldStartANumber = function(c1, c2, c3) {\n if (c1 === 43 || c1 === 45) {\n if (digit(c2))\n return true;\n if (c2 === 46 && digit(c3))\n return true;\n return false;\n } else if (c1 === 46) {\n if (digit(c2))\n return true;\n return false;\n } else if (digit(c1)) {\n return true;\n } else {\n return false;\n }\n };\n const startsWithANumber = function() {\n return wouldStartANumber(code, next(1), next(2));\n };\n const consumeAName = function() {\n let result = \"\";\n while (consume()) {\n if (namechar(code)) {\n result += stringFromCode(code);\n } else if (startsWithAValidEscape()) {\n result += stringFromCode(consumeEscape());\n } else {\n reconsume();\n return result;\n }\n }\n throw new Error(\"Internal parse error\");\n };\n const consumeANumber = function() {\n let repr = \"\";\n let type = \"integer\";\n if (next() === 43 || next() === 45) {\n consume();\n repr += stringFromCode(code);\n }\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n if (next(1) === 46 && digit(next(2))) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = \"number\";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n const c1 = next(1), c2 = next(2), c3 = next(3);\n if ((c1 === 69 || c1 === 101) && digit(c2)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = \"number\";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n } else if ((c1 === 69 || c1 === 101) && (c2 === 43 || c2 === 45) && digit(c3)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = \"number\";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n const value = convertAStringToANumber(repr);\n return { type, value, repr };\n };\n const convertAStringToANumber = function(string) {\n return +string;\n };\n const consumeTheRemnantsOfABadURL = function() {\n while (consume()) {\n if (code === 41 || eof()) {\n return;\n } else if (startsWithAValidEscape()) {\n consumeEscape();\n donothing();\n } else {\n donothing();\n }\n }\n };\n let iterationCount = 0;\n while (!eof(next())) {\n tokens.push(consumeAToken());\n iterationCount++;\n if (iterationCount > str.length * 2)\n throw new Error(\"I'm infinite-looping!\");\n }\n return tokens;\n}\nvar CSSParserToken = class {\n constructor() {\n this.tokenType = \"\";\n }\n toJSON() {\n return { token: this.tokenType };\n }\n toString() {\n return this.tokenType;\n }\n toSource() {\n return \"\" + this;\n }\n};\nvar BadStringToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"BADSTRING\";\n }\n};\nvar BadURLToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"BADURL\";\n }\n};\nvar WhitespaceToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"WHITESPACE\";\n }\n toString() {\n return \"WS\";\n }\n toSource() {\n return \" \";\n }\n};\nvar CDOToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"CDO\";\n }\n toSource() {\n return \"\";\n }\n};\nvar ColonToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \":\";\n }\n};\nvar SemicolonToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \";\";\n }\n};\nvar CommaToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \",\";\n }\n};\nvar GroupingToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.value = \"\";\n this.mirror = \"\";\n }\n};\nvar OpenCurlyToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"{\";\n this.value = \"{\";\n this.mirror = \"}\";\n }\n};\nvar CloseCurlyToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"}\";\n this.value = \"}\";\n this.mirror = \"{\";\n }\n};\nvar OpenSquareToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"[\";\n this.value = \"[\";\n this.mirror = \"]\";\n }\n};\nvar CloseSquareToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"]\";\n this.value = \"]\";\n this.mirror = \"[\";\n }\n};\nvar OpenParenToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"(\";\n this.value = \"(\";\n this.mirror = \")\";\n }\n};\nvar CloseParenToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \")\";\n this.value = \")\";\n this.mirror = \"(\";\n }\n};\nvar IncludeMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"~=\";\n }\n};\nvar DashMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"|=\";\n }\n};\nvar PrefixMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"^=\";\n }\n};\nvar SuffixMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"$=\";\n }\n};\nvar SubstringMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"*=\";\n }\n};\nvar ColumnToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"||\";\n }\n};\nvar EOFToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"EOF\";\n }\n toSource() {\n return \"\";\n }\n};\nvar DelimToken = class extends CSSParserToken {\n constructor(code) {\n super();\n this.tokenType = \"DELIM\";\n this.value = \"\";\n this.value = stringFromCode(code);\n }\n toString() {\n return \"DELIM(\" + this.value + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n }\n toSource() {\n if (this.value === \"\\\\\")\n return \"\\\\\\n\";\n else\n return this.value;\n }\n};\nvar StringValuedToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.value = \"\";\n }\n ASCIIMatch(str) {\n return this.value.toLowerCase() === str.toLowerCase();\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n }\n};\nvar IdentToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"IDENT\";\n this.value = val;\n }\n toString() {\n return \"IDENT(\" + this.value + \")\";\n }\n toSource() {\n return escapeIdent(this.value);\n }\n};\nvar FunctionToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"FUNCTION\";\n this.value = val;\n this.mirror = \")\";\n }\n toString() {\n return \"FUNCTION(\" + this.value + \")\";\n }\n toSource() {\n return escapeIdent(this.value) + \"(\";\n }\n};\nvar AtKeywordToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"AT-KEYWORD\";\n this.value = val;\n }\n toString() {\n return \"AT(\" + this.value + \")\";\n }\n toSource() {\n return \"@\" + escapeIdent(this.value);\n }\n};\nvar HashToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"HASH\";\n this.value = val;\n this.type = \"unrestricted\";\n }\n toString() {\n return \"HASH(\" + this.value + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n return json;\n }\n toSource() {\n if (this.type === \"id\")\n return \"#\" + escapeIdent(this.value);\n else\n return \"#\" + escapeHash(this.value);\n }\n};\nvar StringToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"STRING\";\n this.value = val;\n }\n toString() {\n return '\"' + escapeString(this.value) + '\"';\n }\n};\nvar URLToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"URL\";\n this.value = val;\n }\n toString() {\n return \"URL(\" + this.value + \")\";\n }\n toSource() {\n return 'url(\"' + escapeString(this.value) + '\")';\n }\n};\nvar NumberToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = \"NUMBER\";\n this.type = \"integer\";\n this.repr = \"\";\n }\n toString() {\n if (this.type === \"integer\")\n return \"INT(\" + this.value + \")\";\n return \"NUMBER(\" + this.value + \")\";\n }\n toJSON() {\n const json = super.toJSON();\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n return json;\n }\n toSource() {\n return this.repr;\n }\n};\nvar PercentageToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = \"PERCENTAGE\";\n this.repr = \"\";\n }\n toString() {\n return \"PERCENTAGE(\" + this.value + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.repr = this.repr;\n return json;\n }\n toSource() {\n return this.repr + \"%\";\n }\n};\nvar DimensionToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = \"DIMENSION\";\n this.type = \"integer\";\n this.repr = \"\";\n this.unit = \"\";\n }\n toString() {\n return \"DIM(\" + this.value + \",\" + this.unit + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n json.unit = this.unit;\n return json;\n }\n toSource() {\n const source = this.repr;\n let unit = escapeIdent(this.unit);\n if (unit[0].toLowerCase() === \"e\" && (unit[1] === \"-\" || between(unit.charCodeAt(1), 48, 57))) {\n unit = \"\\\\65 \" + unit.slice(1, unit.length);\n }\n return source + unit;\n }\n};\nfunction escapeIdent(string) {\n string = \"\" + string;\n let result = \"\";\n const firstcode = string.charCodeAt(0);\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");\n if (between(code, 1, 31) || code === 127 || i === 0 && between(code, 48, 57) || i === 1 && between(code, 48, 57) && firstcode === 45)\n result += \"\\\\\" + code.toString(16) + \" \";\n else if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n result += string[i];\n else\n result += \"\\\\\" + string[i];\n }\n return result;\n}\nfunction escapeHash(string) {\n string = \"\" + string;\n let result = \"\";\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");\n if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n result += string[i];\n else\n result += \"\\\\\" + code.toString(16) + \" \";\n }\n return result;\n}\nfunction escapeString(string) {\n string = \"\" + string;\n let result = \"\";\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");\n if (between(code, 1, 31) || code === 127)\n result += \"\\\\\" + code.toString(16) + \" \";\n else if (code === 34 || code === 92)\n result += \"\\\\\" + string[i];\n else\n result += string[i];\n }\n return result;\n}\n\n// packages/playwright-core/src/utils/isomorphic/cssParser.ts\nvar InvalidSelectorError = class extends Error {\n};\nfunction parseCSS(selector, customNames) {\n let tokens;\n try {\n tokens = tokenize(selector);\n if (!(tokens[tokens.length - 1] instanceof EOFToken))\n tokens.push(new EOFToken());\n } catch (e) {\n const newMessage = e.message + ` while parsing selector \"${selector}\"`;\n const index = (e.stack || \"\").indexOf(e.message);\n if (index !== -1)\n e.stack = e.stack.substring(0, index) + newMessage + e.stack.substring(index + e.message.length);\n e.message = newMessage;\n throw e;\n }\n const unsupportedToken = tokens.find((token) => {\n return token instanceof AtKeywordToken || token instanceof BadStringToken || token instanceof BadURLToken || token instanceof ColumnToken || token instanceof CDOToken || token instanceof CDCToken || token instanceof SemicolonToken || // TODO: Consider using these for something, e.g. to escape complex strings.\n // For example :xpath{ (//div/bar[@attr=\"foo\"])[2]/baz }\n // Or this way :xpath( {complex-xpath-goes-here(\"hello\")} )\n token instanceof OpenCurlyToken || token instanceof CloseCurlyToken || // TODO: Consider treating these as strings?\n token instanceof URLToken || token instanceof PercentageToken;\n });\n if (unsupportedToken)\n throw new InvalidSelectorError(`Unsupported token \"${unsupportedToken.toSource()}\" while parsing selector \"${selector}\"`);\n let pos = 0;\n const names = /* @__PURE__ */ new Set();\n function unexpected() {\n return new InvalidSelectorError(`Unexpected token \"${tokens[pos].toSource()}\" while parsing selector \"${selector}\"`);\n }\n function skipWhitespace() {\n while (tokens[pos] instanceof WhitespaceToken)\n pos++;\n }\n function isIdent(p = pos) {\n return tokens[p] instanceof IdentToken;\n }\n function isString(p = pos) {\n return tokens[p] instanceof StringToken;\n }\n function isNumber(p = pos) {\n return tokens[p] instanceof NumberToken;\n }\n function isComma(p = pos) {\n return tokens[p] instanceof CommaToken;\n }\n function isOpenParen(p = pos) {\n return tokens[p] instanceof OpenParenToken;\n }\n function isCloseParen(p = pos) {\n return tokens[p] instanceof CloseParenToken;\n }\n function isFunction(p = pos) {\n return tokens[p] instanceof FunctionToken;\n }\n function isStar(p = pos) {\n return tokens[p] instanceof DelimToken && tokens[p].value === \"*\";\n }\n function isEOF(p = pos) {\n return tokens[p] instanceof EOFToken;\n }\n function isClauseCombinator(p = pos) {\n return tokens[p] instanceof DelimToken && [\">\", \"+\", \"~\"].includes(tokens[p].value);\n }\n function isSelectorClauseEnd(p = pos) {\n return isComma(p) || isCloseParen(p) || isEOF(p) || isClauseCombinator(p) || tokens[p] instanceof WhitespaceToken;\n }\n function consumeFunctionArguments() {\n const result2 = [consumeArgument()];\n while (true) {\n skipWhitespace();\n if (!isComma())\n break;\n pos++;\n result2.push(consumeArgument());\n }\n return result2;\n }\n function consumeArgument() {\n skipWhitespace();\n if (isNumber())\n return tokens[pos++].value;\n if (isString())\n return tokens[pos++].value;\n return consumeComplexSelector();\n }\n function consumeComplexSelector() {\n const result2 = { simples: [] };\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples.push({ selector: { functions: [{ name: \"scope\", args: [] }] }, combinator: \"\" });\n } else {\n result2.simples.push({ selector: consumeSimpleSelector(), combinator: \"\" });\n }\n while (true) {\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples[result2.simples.length - 1].combinator = tokens[pos++].value;\n skipWhitespace();\n } else if (isSelectorClauseEnd()) {\n break;\n }\n result2.simples.push({ combinator: \"\", selector: consumeSimpleSelector() });\n }\n return result2;\n }\n function consumeSimpleSelector() {\n let rawCSSString = \"\";\n const functions = [];\n while (!isSelectorClauseEnd()) {\n if (isIdent() || isStar()) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof HashToken) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof DelimToken && tokens[pos].value === \".\") {\n pos++;\n if (isIdent())\n rawCSSString += \".\" + tokens[pos++].toSource();\n else\n throw unexpected();\n } else if (tokens[pos] instanceof ColonToken) {\n pos++;\n if (isIdent()) {\n if (!customNames.has(tokens[pos].value.toLowerCase())) {\n rawCSSString += \":\" + tokens[pos++].toSource();\n } else {\n const name = tokens[pos++].value.toLowerCase();\n functions.push({ name, args: [] });\n names.add(name);\n }\n } else if (isFunction()) {\n const name = tokens[pos++].value.toLowerCase();\n if (!customNames.has(name)) {\n rawCSSString += `:${name}(${consumeBuiltinFunctionArguments()})`;\n } else {\n functions.push({ name, args: consumeFunctionArguments() });\n names.add(name);\n }\n skipWhitespace();\n if (!isCloseParen())\n throw unexpected();\n pos++;\n } else {\n throw unexpected();\n }\n } else if (tokens[pos] instanceof OpenSquareToken) {\n rawCSSString += \"[\";\n pos++;\n while (!(tokens[pos] instanceof CloseSquareToken) && !isEOF())\n rawCSSString += tokens[pos++].toSource();\n if (!(tokens[pos] instanceof CloseSquareToken))\n throw unexpected();\n rawCSSString += \"]\";\n pos++;\n } else {\n throw unexpected();\n }\n }\n if (!rawCSSString && !functions.length)\n throw unexpected();\n return { css: rawCSSString || void 0, functions };\n }\n function consumeBuiltinFunctionArguments() {\n let s = \"\";\n let balance = 1;\n while (!isEOF()) {\n if (isOpenParen() || isFunction())\n balance++;\n if (isCloseParen())\n balance--;\n if (!balance)\n break;\n s += tokens[pos++].toSource();\n }\n return s;\n }\n const result = consumeFunctionArguments();\n if (!isEOF())\n throw unexpected();\n if (result.some((arg) => typeof arg !== \"object\" || !(\"simples\" in arg)))\n throw new InvalidSelectorError(`Error while parsing selector \"${selector}\"`);\n return { selector: result, names: Array.from(names) };\n}\n\n// packages/playwright-core/src/utils/isomorphic/selectorParser.ts\nvar kNestedSelectorNames = /* @__PURE__ */ new Set([\"internal:has\", \"internal:has-not\", \"internal:and\", \"internal:or\", \"internal:chain\", \"left-of\", \"right-of\", \"above\", \"below\", \"near\"]);\nvar kNestedSelectorNamesWithDistance = /* @__PURE__ */ new Set([\"left-of\", \"right-of\", \"above\", \"below\", \"near\"]);\nvar customCSSNames = /* @__PURE__ */ new Set([\"not\", \"is\", \"where\", \"has\", \"scope\", \"light\", \"visible\", \"text\", \"text-matches\", \"text-is\", \"has-text\", \"above\", \"below\", \"right-of\", \"left-of\", \"near\", \"nth-match\"]);\nfunction parseSelector(selector) {\n const parsedStrings = parseSelectorString(selector);\n const parts = [];\n for (const part of parsedStrings.parts) {\n if (part.name === \"css\" || part.name === \"css:light\") {\n if (part.name === \"css:light\")\n part.body = \":light(\" + part.body + \")\";\n const parsedCSS = parseCSS(part.body, customCSSNames);\n parts.push({\n name: \"css\",\n body: parsedCSS.selector,\n source: part.body\n });\n continue;\n }\n if (kNestedSelectorNames.has(part.name)) {\n let innerSelector;\n let distance;\n try {\n const unescaped = JSON.parse(\"[\" + part.body + \"]\");\n if (!Array.isArray(unescaped) || unescaped.length < 1 || unescaped.length > 2 || typeof unescaped[0] !== \"string\")\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n innerSelector = unescaped[0];\n if (unescaped.length === 2) {\n if (typeof unescaped[1] !== \"number\" || !kNestedSelectorNamesWithDistance.has(part.name))\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n distance = unescaped[1];\n }\n } catch (e) {\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n }\n const nested = { name: part.name, source: part.body, body: { parsed: parseSelector(innerSelector), distance } };\n const lastFrame = [...nested.body.parsed.parts].reverse().find((part2) => part2.name === \"internal:control\" && part2.body === \"enter-frame\");\n const lastFrameIndex = lastFrame ? nested.body.parsed.parts.indexOf(lastFrame) : -1;\n if (lastFrameIndex !== -1 && selectorPartsEqual(nested.body.parsed.parts.slice(0, lastFrameIndex + 1), parts.slice(0, lastFrameIndex + 1)))\n nested.body.parsed.parts.splice(0, lastFrameIndex + 1);\n parts.push(nested);\n continue;\n }\n parts.push({ ...part, source: part.body });\n }\n if (kNestedSelectorNames.has(parts[0].name))\n throw new InvalidSelectorError(`\"${parts[0].name}\" selector cannot be first`);\n return {\n capture: parsedStrings.capture,\n parts\n };\n}\nfunction selectorPartsEqual(list1, list2) {\n return stringifySelector({ parts: list1 }) === stringifySelector({ parts: list2 });\n}\nfunction stringifySelector(selector, forceEngineName) {\n if (typeof selector === \"string\")\n return selector;\n return selector.parts.map((p, i) => {\n let includeEngine = true;\n if (!forceEngineName && i !== selector.capture) {\n if (p.name === \"css\")\n includeEngine = false;\n else if (p.name === \"xpath\" && p.source.startsWith(\"//\") || p.source.startsWith(\"..\"))\n includeEngine = false;\n }\n const prefix = includeEngine ? p.name + \"=\" : \"\";\n return `${i === selector.capture ? \"*\" : \"\"}${prefix}${p.source}`;\n }).join(\" >> \");\n}\nfunction parseSelectorString(selector) {\n let index = 0;\n let quote;\n let start = 0;\n const result = { parts: [] };\n const append = () => {\n const part = selector.substring(start, index).trim();\n const eqIndex = part.indexOf(\"=\");\n let name;\n let body;\n if (eqIndex !== -1 && part.substring(0, eqIndex).trim().match(/^[a-zA-Z_0-9-+:*]+$/)) {\n name = part.substring(0, eqIndex).trim();\n body = part.substring(eqIndex + 1);\n } else if (part.length > 1 && part[0] === '\"' && part[part.length - 1] === '\"') {\n name = \"text\";\n body = part;\n } else if (part.length > 1 && part[0] === \"'\" && part[part.length - 1] === \"'\") {\n name = \"text\";\n body = part;\n } else if (/^\\(*\\/\\//.test(part) || part.startsWith(\"..\")) {\n name = \"xpath\";\n body = part;\n } else {\n name = \"css\";\n body = part;\n }\n let capture = false;\n if (name[0] === \"*\") {\n capture = true;\n name = name.substring(1);\n }\n result.parts.push({ name, body });\n if (capture) {\n if (result.capture !== void 0)\n throw new InvalidSelectorError(`Only one of the selectors can capture using * modifier`);\n result.capture = result.parts.length - 1;\n }\n };\n if (!selector.includes(\">>\")) {\n index = selector.length;\n append();\n return result;\n }\n const shouldIgnoreTextSelectorQuote = () => {\n const prefix = selector.substring(start, index);\n const match = prefix.match(/^\\s*text\\s*=(.*)$/);\n return !!match && !!match[1];\n };\n while (index < selector.length) {\n const c = selector[index];\n if (c === \"\\\\\" && index + 1 < selector.length) {\n index += 2;\n } else if (c === quote) {\n quote = void 0;\n index++;\n } else if (!quote && (c === '\"' || c === \"'\" || c === \"`\") && !shouldIgnoreTextSelectorQuote()) {\n quote = c;\n index++;\n } else if (!quote && c === \">\" && selector[index + 1] === \">\") {\n append();\n index += 2;\n start = index;\n } else {\n index++;\n }\n }\n append();\n return result;\n}\nfunction parseAttributeSelector(selector, allowUnquotedStrings) {\n let wp = 0;\n let EOL = selector.length === 0;\n const next = () => selector[wp] || \"\";\n const eat1 = () => {\n const result2 = next();\n ++wp;\n EOL = wp >= selector.length;\n return result2;\n };\n const syntaxError = (stage) => {\n if (EOL)\n throw new InvalidSelectorError(`Unexpected end of selector while parsing selector \\`${selector}\\``);\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - unexpected symbol \"${next()}\" at position ${wp}` + (stage ? \" during \" + stage : \"\"));\n };\n function skipSpaces() {\n while (!EOL && /\\s/.test(next()))\n eat1();\n }\n function isCSSNameChar(char) {\n return char >= \"\\x80\" || char >= \"0\" && char <= \"9\" || char >= \"A\" && char <= \"Z\" || char >= \"a\" && char <= \"z\" || char >= \"0\" && char <= \"9\" || char === \"_\" || char === \"-\";\n }\n function readIdentifier() {\n let result2 = \"\";\n skipSpaces();\n while (!EOL && isCSSNameChar(next()))\n result2 += eat1();\n return result2;\n }\n function readQuotedString(quote) {\n let result2 = eat1();\n if (result2 !== quote)\n syntaxError(\"parsing quoted string\");\n while (!EOL && next() !== quote) {\n if (next() === \"\\\\\")\n eat1();\n result2 += eat1();\n }\n if (next() !== quote)\n syntaxError(\"parsing quoted string\");\n result2 += eat1();\n return result2;\n }\n function readRegularExpression() {\n if (eat1() !== \"/\")\n syntaxError(\"parsing regular expression\");\n let source = \"\";\n let inClass = false;\n while (!EOL) {\n if (next() === \"\\\\\") {\n source += eat1();\n if (EOL)\n syntaxError(\"parsing regular expression\");\n } else if (inClass && next() === \"]\") {\n inClass = false;\n } else if (!inClass && next() === \"[\") {\n inClass = true;\n } else if (!inClass && next() === \"/\") {\n break;\n }\n source += eat1();\n }\n if (eat1() !== \"/\")\n syntaxError(\"parsing regular expression\");\n let flags = \"\";\n while (!EOL && next().match(/[dgimsuy]/))\n flags += eat1();\n try {\n return new RegExp(source, flags);\n } catch (e) {\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\`: ${e.message}`);\n }\n }\n function readAttributeToken() {\n let token = \"\";\n skipSpaces();\n if (next() === `'` || next() === `\"`)\n token = readQuotedString(next()).slice(1, -1);\n else\n token = readIdentifier();\n if (!token)\n syntaxError(\"parsing property path\");\n return token;\n }\n function readOperator() {\n skipSpaces();\n let op = \"\";\n if (!EOL)\n op += eat1();\n if (!EOL && op !== \"=\")\n op += eat1();\n if (![\"=\", \"*=\", \"^=\", \"$=\", \"|=\", \"~=\"].includes(op))\n syntaxError(\"parsing operator\");\n return op;\n }\n function readAttribute() {\n eat1();\n const jsonPath = [];\n jsonPath.push(readAttributeToken());\n skipSpaces();\n while (next() === \".\") {\n eat1();\n jsonPath.push(readAttributeToken());\n skipSpaces();\n }\n if (next() === \"]\") {\n eat1();\n return { name: jsonPath.join(\".\"), jsonPath, op: \"\", value: null, caseSensitive: false };\n }\n const operator = readOperator();\n let value = void 0;\n let caseSensitive = true;\n skipSpaces();\n if (next() === \"/\") {\n if (operator !== \"=\")\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with regular expression`);\n value = readRegularExpression();\n } else if (next() === `'` || next() === `\"`) {\n value = readQuotedString(next()).slice(1, -1);\n skipSpaces();\n if (next() === \"i\" || next() === \"I\") {\n caseSensitive = false;\n eat1();\n } else if (next() === \"s\" || next() === \"S\") {\n caseSensitive = true;\n eat1();\n }\n } else {\n value = \"\";\n while (!EOL && (isCSSNameChar(next()) || next() === \"+\" || next() === \".\"))\n value += eat1();\n if (value === \"true\") {\n value = true;\n } else if (value === \"false\") {\n value = false;\n } else {\n if (!allowUnquotedStrings) {\n value = +value;\n if (Number.isNaN(value))\n syntaxError(\"parsing attribute value\");\n }\n }\n }\n skipSpaces();\n if (next() !== \"]\")\n syntaxError(\"parsing attribute value\");\n eat1();\n if (operator !== \"=\" && typeof value !== \"string\")\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with non-string matching value - ${value}`);\n return { name: jsonPath.join(\".\"), jsonPath, op: operator, value, caseSensitive };\n }\n const result = {\n name: \"\",\n attributes: []\n };\n result.name = readIdentifier();\n skipSpaces();\n while (next() === \"[\") {\n result.attributes.push(readAttribute());\n skipSpaces();\n }\n if (!EOL)\n syntaxError(void 0);\n if (!result.name && !result.attributes.length)\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - selector cannot be empty`);\n return result;\n}\n\n// packages/playwright-core/src/utils/isomorphic/locatorGenerators.ts\nfunction asLocator(lang, selector, isFrameLocator = false) {\n return asLocators(lang, selector, isFrameLocator)[0];\n}\nfunction asLocators(lang, selector, isFrameLocator = false, maxOutputSize = 20, preferredQuote) {\n try {\n return innerAsLocators(new generators[lang](preferredQuote), parseSelector(selector), isFrameLocator, maxOutputSize);\n } catch (e) {\n return [selector];\n }\n}\nfunction innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize = 20) {\n const parts = [...parsed.parts];\n const tokens = [];\n let nextBase = isFrameLocator ? \"frame-locator\" : \"page\";\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const base = nextBase;\n nextBase = \"locator\";\n if (part.name === \"nth\") {\n if (part.body === \"0\")\n tokens.push([factory.generateLocator(base, \"first\", \"\"), factory.generateLocator(base, \"nth\", \"0\")]);\n else if (part.body === \"-1\")\n tokens.push([factory.generateLocator(base, \"last\", \"\"), factory.generateLocator(base, \"nth\", \"-1\")]);\n else\n tokens.push([factory.generateLocator(base, \"nth\", part.body)]);\n continue;\n }\n if (part.name === \"internal:text\") {\n const { exact, text } = detectExact(part.body);\n tokens.push([factory.generateLocator(base, \"text\", text, { exact })]);\n continue;\n }\n if (part.name === \"internal:has-text\") {\n const { exact, text } = detectExact(part.body);\n if (!exact) {\n tokens.push([factory.generateLocator(base, \"has-text\", text, { exact })]);\n continue;\n }\n }\n if (part.name === \"internal:has-not-text\") {\n const { exact, text } = detectExact(part.body);\n if (!exact) {\n tokens.push([factory.generateLocator(base, \"has-not-text\", text, { exact })]);\n continue;\n }\n }\n if (part.name === \"internal:has\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"has\", inner)));\n continue;\n }\n if (part.name === \"internal:has-not\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"hasNot\", inner)));\n continue;\n }\n if (part.name === \"internal:and\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"and\", inner)));\n continue;\n }\n if (part.name === \"internal:or\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"or\", inner)));\n continue;\n }\n if (part.name === \"internal:chain\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"chain\", inner)));\n continue;\n }\n if (part.name === \"internal:label\") {\n const { exact, text } = detectExact(part.body);\n tokens.push([factory.generateLocator(base, \"label\", text, { exact })]);\n continue;\n }\n if (part.name === \"internal:role\") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const options = { attrs: [] };\n for (const attr of attrSelector.attributes) {\n if (attr.name === \"name\") {\n options.exact = attr.caseSensitive;\n options.name = attr.value;\n } else {\n if (attr.name === \"level\" && typeof attr.value === \"string\")\n attr.value = +attr.value;\n options.attrs.push({ name: attr.name === \"include-hidden\" ? \"includeHidden\" : attr.name, value: attr.value });\n }\n }\n tokens.push([factory.generateLocator(base, \"role\", attrSelector.name, options)]);\n continue;\n }\n if (part.name === \"internal:testid\") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const { value } = attrSelector.attributes[0];\n tokens.push([factory.generateLocator(base, \"test-id\", value)]);\n continue;\n }\n if (part.name === \"internal:attr\") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const { name, value, caseSensitive } = attrSelector.attributes[0];\n const text = value;\n const exact = !!caseSensitive;\n if (name === \"placeholder\") {\n tokens.push([factory.generateLocator(base, \"placeholder\", text, { exact })]);\n continue;\n }\n if (name === \"alt\") {\n tokens.push([factory.generateLocator(base, \"alt\", text, { exact })]);\n continue;\n }\n if (name === \"title\") {\n tokens.push([factory.generateLocator(base, \"title\", text, { exact })]);\n continue;\n }\n }\n if (part.name === \"internal:control\" && part.body === \"enter-frame\") {\n const lastTokens = tokens[tokens.length - 1];\n const lastPart = parts[index - 1];\n const transformed = lastTokens.map((token) => factory.chainLocators([token, factory.generateLocator(base, \"frame\", \"\")]));\n if ([\"xpath\", \"css\"].includes(lastPart.name)) {\n transformed.push(\n factory.generateLocator(base, \"frame-locator\", stringifySelector({ parts: [lastPart] })),\n factory.generateLocator(base, \"frame-locator\", stringifySelector({ parts: [lastPart] }, true))\n );\n }\n lastTokens.splice(0, lastTokens.length, ...transformed);\n nextBase = \"frame-locator\";\n continue;\n }\n const nextPart = parts[index + 1];\n const selectorPart = stringifySelector({ parts: [part] });\n const locatorPart = factory.generateLocator(base, \"default\", selectorPart);\n if (nextPart && [\"internal:has-text\", \"internal:has-not-text\"].includes(nextPart.name)) {\n const { exact, text } = detectExact(nextPart.body);\n if (!exact) {\n const nextLocatorPart = factory.generateLocator(\"locator\", nextPart.name === \"internal:has-text\" ? \"has-text\" : \"has-not-text\", text, { exact });\n const options = {};\n if (nextPart.name === \"internal:has-text\")\n options.hasText = text;\n else\n options.hasNotText = text;\n const combinedPart = factory.generateLocator(base, \"default\", selectorPart, options);\n tokens.push([factory.chainLocators([locatorPart, nextLocatorPart]), combinedPart]);\n index++;\n continue;\n }\n }\n let locatorPartWithEngine;\n if ([\"xpath\", \"css\"].includes(part.name)) {\n const selectorPart2 = stringifySelector(\n { parts: [part] },\n /* forceEngineName */\n true\n );\n locatorPartWithEngine = factory.generateLocator(base, \"default\", selectorPart2);\n }\n tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean));\n }\n return combineTokens(factory, tokens, maxOutputSize);\n}\nfunction combineTokens(factory, tokens, maxOutputSize) {\n const currentTokens = tokens.map(() => \"\");\n const result = [];\n const visit = (index) => {\n if (index === tokens.length) {\n result.push(factory.chainLocators(currentTokens));\n return currentTokens.length < maxOutputSize;\n }\n for (const taken of tokens[index]) {\n currentTokens[index] = taken;\n if (!visit(index + 1))\n return false;\n }\n return true;\n };\n visit(0);\n return result;\n}\nfunction detectExact(text) {\n let exact = false;\n const match = text.match(/^\\/(.*)\\/([igm]*)$/);\n if (match)\n return { text: new RegExp(match[1], match[2]) };\n if (text.endsWith('\"')) {\n text = JSON.parse(text);\n exact = true;\n } else if (text.endsWith('\"s')) {\n text = JSON.parse(text.substring(0, text.length - 1));\n exact = true;\n } else if (text.endsWith('\"i')) {\n text = JSON.parse(text.substring(0, text.length - 1));\n exact = false;\n }\n return { exact, text };\n}\nvar JavaScriptLocatorFactory = class {\n constructor(preferredQuote) {\n this.preferredQuote = preferredQuote;\n }\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, { hasText: ${this.toHasText(options.hasText)} })`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, { hasNotText: ${this.toHasText(options.hasNotText)} })`;\n return `locator(${this.quote(body)})`;\n case \"frame-locator\":\n return `frameLocator(${this.quote(body)})`;\n case \"frame\":\n return `contentFrame()`;\n case \"nth\":\n return `nth(${body})`;\n case \"first\":\n return `first()`;\n case \"last\":\n return `last()`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`name: ${this.regexToSourceString(options.name)}`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`name: ${this.quote(options.name)}`);\n if (options.exact)\n attrs.push(`exact: true`);\n }\n for (const { name, value } of options.attrs)\n attrs.push(`${name}: ${typeof value === \"string\" ? this.quote(value) : value}`);\n const attrString = attrs.length ? `, { ${attrs.join(\", \")} }` : \"\";\n return `getByRole(${this.quote(body)}${attrString})`;\n case \"has-text\":\n return `filter({ hasText: ${this.toHasText(body)} })`;\n case \"has-not-text\":\n return `filter({ hasNotText: ${this.toHasText(body)} })`;\n case \"has\":\n return `filter({ has: ${body} })`;\n case \"hasNot\":\n return `filter({ hasNot: ${body} })`;\n case \"and\":\n return `and(${body})`;\n case \"or\":\n return `or(${body})`;\n case \"chain\":\n return `locator(${body})`;\n case \"test-id\":\n return `getByTestId(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(\"getByText\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(\"getByAltText\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(\"getByPlaceholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(\"getByLabel\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(\"getByTitle\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToSourceString(re) {\n return normalizeEscapedRegexQuotes(String(re));\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToSourceString(body)})`;\n return exact ? `${method}(${this.quote(body)}, { exact: true })` : `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToSourceString(body);\n return this.quote(body);\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToSourceString(value);\n return this.quote(value);\n }\n quote(text) {\n var _a;\n return escapeWithQuotes(text, (_a = this.preferredQuote) != null ? _a : \"'\");\n }\n};\nvar PythonLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, has_text=${this.toHasText(options.hasText)})`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, has_not_text=${this.toHasText(options.hasNotText)})`;\n return `locator(${this.quote(body)})`;\n case \"frame-locator\":\n return `frame_locator(${this.quote(body)})`;\n case \"frame\":\n return `content_frame`;\n case \"nth\":\n return `nth(${body})`;\n case \"first\":\n return `first`;\n case \"last\":\n return `last`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`name=${this.regexToString(options.name)}`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`name=${this.quote(options.name)}`);\n if (options.exact)\n attrs.push(`exact=True`);\n }\n for (const { name, value } of options.attrs) {\n let valueString = typeof value === \"string\" ? this.quote(value) : value;\n if (typeof value === \"boolean\")\n valueString = value ? \"True\" : \"False\";\n attrs.push(`${toSnakeCase(name)}=${valueString}`);\n }\n const attrString = attrs.length ? `, ${attrs.join(\", \")}` : \"\";\n return `get_by_role(${this.quote(body)}${attrString})`;\n case \"has-text\":\n return `filter(has_text=${this.toHasText(body)})`;\n case \"has-not-text\":\n return `filter(has_not_text=${this.toHasText(body)})`;\n case \"has\":\n return `filter(has=${body})`;\n case \"hasNot\":\n return `filter(has_not=${body})`;\n case \"and\":\n return `and_(${body})`;\n case \"or\":\n return `or_(${body})`;\n case \"chain\":\n return `locator(${body})`;\n case \"test-id\":\n return `get_by_test_id(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(\"get_by_text\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(\"get_by_alt_text\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(\"get_by_placeholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(\"get_by_label\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(\"get_by_title\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToString(body) {\n const suffix = body.flags.includes(\"i\") ? \", re.IGNORECASE\" : \"\";\n return `re.compile(r\"${normalizeEscapedRegexQuotes(body.source).replace(/\\\\\\//, \"/\").replace(/\"/g, '\\\\\"')}\"${suffix})`;\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, exact=True)`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToString(body);\n return `${this.quote(body)}`;\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n quote(text) {\n return escapeWithQuotes(text, '\"');\n }\n};\nvar JavaLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n let clazz;\n switch (base) {\n case \"page\":\n clazz = \"Page\";\n break;\n case \"frame-locator\":\n clazz = \"FrameLocator\";\n break;\n case \"locator\":\n clazz = \"Locator\";\n break;\n }\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasText(${this.toHasText(options.hasText)}))`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasNotText(${this.toHasText(options.hasNotText)}))`;\n return `locator(${this.quote(body)})`;\n case \"frame-locator\":\n return `frameLocator(${this.quote(body)})`;\n case \"frame\":\n return `contentFrame()`;\n case \"nth\":\n return `nth(${body})`;\n case \"first\":\n return `first()`;\n case \"last\":\n return `last()`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`.setName(${this.regexToString(options.name)})`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`.setName(${this.quote(options.name)})`);\n if (options.exact)\n attrs.push(`.setExact(true)`);\n }\n for (const { name, value } of options.attrs)\n attrs.push(`.set${toTitleCase(name)}(${typeof value === \"string\" ? this.quote(value) : value})`);\n const attrString = attrs.length ? `, new ${clazz}.GetByRoleOptions()${attrs.join(\"\")}` : \"\";\n return `getByRole(AriaRole.${toSnakeCase(body).toUpperCase()}${attrString})`;\n case \"has-text\":\n return `filter(new ${clazz}.FilterOptions().setHasText(${this.toHasText(body)}))`;\n case \"has-not-text\":\n return `filter(new ${clazz}.FilterOptions().setHasNotText(${this.toHasText(body)}))`;\n case \"has\":\n return `filter(new ${clazz}.FilterOptions().setHas(${body}))`;\n case \"hasNot\":\n return `filter(new ${clazz}.FilterOptions().setHasNot(${body}))`;\n case \"and\":\n return `and(${body})`;\n case \"or\":\n return `or(${body})`;\n case \"chain\":\n return `locator(${body})`;\n case \"test-id\":\n return `getByTestId(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(clazz, \"getByText\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(clazz, \"getByAltText\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(clazz, \"getByPlaceholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(clazz, \"getByLabel\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(clazz, \"getByTitle\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToString(body) {\n const suffix = body.flags.includes(\"i\") ? \", Pattern.CASE_INSENSITIVE\" : \"\";\n return `Pattern.compile(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n }\n toCallWithExact(clazz, method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, new ${clazz}.${toTitleCase(method)}Options().setExact(true))`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToString(body);\n return this.quote(body);\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n quote(text) {\n return escapeWithQuotes(text, '\"');\n }\n};\nvar CSharpLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `Locator(${this.quote(body)}, new() { ${this.toHasText(options.hasText)} })`;\n if (options.hasNotText !== void 0)\n return `Locator(${this.quote(body)}, new() { ${this.toHasNotText(options.hasNotText)} })`;\n return `Locator(${this.quote(body)})`;\n case \"frame-locator\":\n return `FrameLocator(${this.quote(body)})`;\n case \"frame\":\n return `ContentFrame`;\n case \"nth\":\n return `Nth(${body})`;\n case \"first\":\n return `First`;\n case \"last\":\n return `Last`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`NameRegex = ${this.regexToString(options.name)}`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`Name = ${this.quote(options.name)}`);\n if (options.exact)\n attrs.push(`Exact = true`);\n }\n for (const { name, value } of options.attrs)\n attrs.push(`${toTitleCase(name)} = ${typeof value === \"string\" ? this.quote(value) : value}`);\n const attrString = attrs.length ? `, new() { ${attrs.join(\", \")} }` : \"\";\n return `GetByRole(AriaRole.${toTitleCase(body)}${attrString})`;\n case \"has-text\":\n return `Filter(new() { ${this.toHasText(body)} })`;\n case \"has-not-text\":\n return `Filter(new() { ${this.toHasNotText(body)} })`;\n case \"has\":\n return `Filter(new() { Has = ${body} })`;\n case \"hasNot\":\n return `Filter(new() { HasNot = ${body} })`;\n case \"and\":\n return `And(${body})`;\n case \"or\":\n return `Or(${body})`;\n case \"chain\":\n return `Locator(${body})`;\n case \"test-id\":\n return `GetByTestId(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(\"GetByText\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(\"GetByAltText\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(\"GetByPlaceholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(\"GetByLabel\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(\"GetByTitle\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToString(body) {\n const suffix = body.flags.includes(\"i\") ? \", RegexOptions.IgnoreCase\" : \"\";\n return `new Regex(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, new() { Exact = true })`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return `HasTextRegex = ${this.regexToString(body)}`;\n return `HasText = ${this.quote(body)}`;\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n toHasNotText(body) {\n if (isRegExp(body))\n return `HasNotTextRegex = ${this.regexToString(body)}`;\n return `HasNotText = ${this.quote(body)}`;\n }\n quote(text) {\n return escapeWithQuotes(text, '\"');\n }\n};\nvar JsonlLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n return JSON.stringify({\n kind,\n body,\n options\n });\n }\n chainLocators(locators) {\n const objects = locators.map((l) => JSON.parse(l));\n for (let i = 0; i < objects.length - 1; ++i)\n objects[i].next = objects[i + 1];\n return JSON.stringify(objects[0]);\n }\n};\nvar generators = {\n javascript: JavaScriptLocatorFactory,\n python: PythonLocatorFactory,\n java: JavaLocatorFactory,\n csharp: CSharpLocatorFactory,\n jsonl: JsonlLocatorFactory\n};\nfunction isRegExp(obj) {\n return obj instanceof RegExp;\n}\n\n// packages/playwright-core/src/server/injected/consoleApi.ts\nvar selectorSymbol = Symbol(\"selector\");\nvar _Locator = class _Locator {\n constructor(injectedScript, selector, options) {\n if (options == null ? void 0 : options.hasText)\n selector += ` >> internal:has-text=${escapeForTextSelector(options.hasText, false)}`;\n if (options == null ? void 0 : options.hasNotText)\n selector += ` >> internal:has-not-text=${escapeForTextSelector(options.hasNotText, false)}`;\n if (options == null ? void 0 : options.has)\n selector += ` >> internal:has=` + JSON.stringify(options.has[selectorSymbol]);\n if (options == null ? void 0 : options.hasNot)\n selector += ` >> internal:has-not=` + JSON.stringify(options.hasNot[selectorSymbol]);\n this[selectorSymbol] = selector;\n if (selector) {\n const parsed = injectedScript.parseSelector(selector);\n this.element = injectedScript.querySelector(parsed, injectedScript.document, false);\n this.elements = injectedScript.querySelectorAll(parsed, injectedScript.document);\n }\n const selectorBase = selector;\n const self = this;\n self.locator = (selector2, options2) => {\n return new _Locator(injectedScript, selectorBase ? selectorBase + \" >> \" + selector2 : selector2, options2);\n };\n self.getByTestId = (testId) => self.locator(getByTestIdSelector(injectedScript.testIdAttributeNameForStrictErrorAndConsoleCodegen(), testId));\n self.getByAltText = (text, options2) => self.locator(getByAltTextSelector(text, options2));\n self.getByLabel = (text, options2) => self.locator(getByLabelSelector(text, options2));\n self.getByPlaceholder = (text, options2) => self.locator(getByPlaceholderSelector(text, options2));\n self.getByText = (text, options2) => self.locator(getByTextSelector(text, options2));\n self.getByTitle = (text, options2) => self.locator(getByTitleSelector(text, options2));\n self.getByRole = (role, options2 = {}) => self.locator(getByRoleSelector(role, options2));\n self.filter = (options2) => new _Locator(injectedScript, selector, options2);\n self.first = () => self.locator(\"nth=0\");\n self.last = () => self.locator(\"nth=-1\");\n self.nth = (index) => self.locator(`nth=${index}`);\n self.and = (locator) => new _Locator(injectedScript, selectorBase + ` >> internal:and=` + JSON.stringify(locator[selectorSymbol]));\n self.or = (locator) => new _Locator(injectedScript, selectorBase + ` >> internal:or=` + JSON.stringify(locator[selectorSymbol]));\n }\n};\nselectorSymbol;\nvar Locator = _Locator;\nvar ConsoleAPI = class {\n constructor(injectedScript) {\n this._injectedScript = injectedScript;\n if (this._injectedScript.window.playwright)\n return;\n this._injectedScript.window.playwright = {\n $: (selector, strict) => this._querySelector(selector, !!strict),\n $$: (selector) => this._querySelectorAll(selector),\n inspect: (selector) => this._inspect(selector),\n selector: (element) => this._selector(element),\n generateLocator: (element, language) => this._generateLocator(element, language),\n ariaSnapshot: (element) => {\n const snapshot = this._injectedScript.ariaSnapshot(element || this._injectedScript.document.body);\n console.log(snapshot);\n },\n resume: () => this._resume(),\n ...new Locator(injectedScript, \"\")\n };\n delete this._injectedScript.window.playwright.filter;\n delete this._injectedScript.window.playwright.first;\n delete this._injectedScript.window.playwright.last;\n delete this._injectedScript.window.playwright.nth;\n delete this._injectedScript.window.playwright.and;\n delete this._injectedScript.window.playwright.or;\n }\n _querySelector(selector, strict) {\n if (typeof selector !== \"string\")\n throw new Error(`Usage: playwright.query('Playwright >> selector').`);\n const parsed = this._injectedScript.parseSelector(selector);\n return this._injectedScript.querySelector(parsed, this._injectedScript.document, strict);\n }\n _querySelectorAll(selector) {\n if (typeof selector !== \"string\")\n throw new Error(`Usage: playwright.$$('Playwright >> selector').`);\n const parsed = this._injectedScript.parseSelector(selector);\n return this._injectedScript.querySelectorAll(parsed, this._injectedScript.document);\n }\n _inspect(selector) {\n if (typeof selector !== \"string\")\n throw new Error(`Usage: playwright.inspect('Playwright >> selector').`);\n this._injectedScript.window.inspect(this._querySelector(selector, false));\n }\n _selector(element) {\n if (!(element instanceof Element))\n throw new Error(`Usage: playwright.selector(element).`);\n return this._injectedScript.generateSelectorSimple(element);\n }\n _generateLocator(element, language) {\n if (!(element instanceof Element))\n throw new Error(`Usage: playwright.locator(element).`);\n const selector = this._injectedScript.generateSelectorSimple(element);\n return asLocator(language || \"javascript\", selector);\n }\n _resume() {\n this._injectedScript.window.__pw_resume().catch(() => {\n });\n }\n};\nvar consoleApi_default = ConsoleAPI;\n"; \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/generated/injectedScriptSource.js b/priv/static/node_modules/playwright-core/lib/generated/injectedScriptSource.js index 5854bf3d..cd89c6b9 100644 --- a/priv/static/node_modules/playwright-core/lib/generated/injectedScriptSource.js +++ b/priv/static/node_modules/playwright-core/lib/generated/injectedScriptSource.js @@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.source = void 0; -const source = exports.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/playwright-core/src/server/injected/injectedScript.ts\nvar injectedScript_exports = {};\n__export(injectedScript_exports, {\n InjectedScript: () => InjectedScript\n});\nmodule.exports = __toCommonJS(injectedScript_exports);\n\n// packages/playwright-core/src/server/injected/xpathSelectorEngine.ts\nvar XPathEngine = {\n queryAll(root, selector) {\n if (selector.startsWith(\"/\") && root.nodeType !== Node.DOCUMENT_NODE)\n selector = \".\" + selector;\n const result = [];\n const document = root.ownerDocument || root;\n if (!document)\n return result;\n const it = document.evaluate(selector, root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE);\n for (let node = it.iterateNext(); node; node = it.iterateNext()) {\n if (node.nodeType === Node.ELEMENT_NODE)\n result.push(node);\n }\n return result;\n }\n};\n\n// packages/playwright-core/src/server/injected/domUtils.ts\nvar browserNameForWorkarounds = \"\";\nfunction setBrowserName(name) {\n browserNameForWorkarounds = name;\n}\nfunction isInsideScope(scope, element) {\n while (element) {\n if (scope.contains(element))\n return true;\n element = enclosingShadowHost(element);\n }\n return false;\n}\nfunction parentElementOrShadowHost(element) {\n if (element.parentElement)\n return element.parentElement;\n if (!element.parentNode)\n return;\n if (element.parentNode.nodeType === 11 && element.parentNode.host)\n return element.parentNode.host;\n}\nfunction enclosingShadowRootOrDocument(element) {\n let node = element;\n while (node.parentNode)\n node = node.parentNode;\n if (node.nodeType === 11 || node.nodeType === 9)\n return node;\n}\nfunction enclosingShadowHost(element) {\n while (element.parentElement)\n element = element.parentElement;\n return parentElementOrShadowHost(element);\n}\nfunction closestCrossShadow(element, css, scope) {\n while (element) {\n const closest = element.closest(css);\n if (scope && closest !== scope && (closest == null ? void 0 : closest.contains(scope)))\n return;\n if (closest)\n return closest;\n element = enclosingShadowHost(element);\n }\n}\nfunction getElementComputedStyle(element, pseudo) {\n return element.ownerDocument && element.ownerDocument.defaultView ? element.ownerDocument.defaultView.getComputedStyle(element, pseudo) : void 0;\n}\nfunction isElementStyleVisibilityVisible(element, style) {\n style = style != null ? style : getElementComputedStyle(element);\n if (!style)\n return true;\n if (Element.prototype.checkVisibility && browserNameForWorkarounds !== \"webkit\") {\n if (!element.checkVisibility({ checkOpacity: false, checkVisibilityCSS: false }))\n return false;\n } else {\n const detailsOrSummary = element.closest(\"details,summary\");\n if (detailsOrSummary !== element && (detailsOrSummary == null ? void 0 : detailsOrSummary.nodeName) === \"DETAILS\" && !detailsOrSummary.open)\n return false;\n }\n if (style.visibility !== \"visible\")\n return false;\n return true;\n}\nfunction isElementVisible(element) {\n const style = getElementComputedStyle(element);\n if (!style)\n return true;\n if (style.display === \"contents\") {\n for (let child = element.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === 1 && isElementVisible(child))\n return true;\n if (child.nodeType === 3 && isVisibleTextNode(child))\n return true;\n }\n return false;\n }\n if (!isElementStyleVisibilityVisible(element, style))\n return false;\n const rect = element.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0;\n}\nfunction isVisibleTextNode(node) {\n const range = node.ownerDocument.createRange();\n range.selectNode(node);\n const rect = range.getBoundingClientRect();\n return rect.width > 0 && rect.height > 0;\n}\nfunction elementSafeTagName(element) {\n if (element instanceof HTMLFormElement)\n return \"FORM\";\n return element.tagName.toUpperCase();\n}\n\n// packages/playwright-core/src/utils/isomorphic/stringUtils.ts\nfunction escapeWithQuotes(text, char = \"'\") {\n const stringified = JSON.stringify(text);\n const escapedText = stringified.substring(1, stringified.length - 1).replace(/\\\\\"/g, '\"');\n if (char === \"'\")\n return char + escapedText.replace(/[']/g, \"\\\\'\") + char;\n if (char === '\"')\n return char + escapedText.replace(/[\"]/g, '\\\\\"') + char;\n if (char === \"`\")\n return char + escapedText.replace(/[`]/g, \"`\") + char;\n throw new Error(\"Invalid escape char\");\n}\nfunction toTitleCase(name) {\n return name.charAt(0).toUpperCase() + name.substring(1);\n}\nfunction toSnakeCase(name) {\n return name.replace(/([a-z0-9])([A-Z])/g, \"$1_$2\").replace(/([A-Z])([A-Z][a-z])/g, \"$1_$2\").toLowerCase();\n}\nfunction cssEscape(s) {\n let result = \"\";\n for (let i = 0; i < s.length; i++)\n result += cssEscapeOne(s, i);\n return result;\n}\nfunction quoteCSSAttributeValue(text) {\n return `\"${cssEscape(text).replace(/\\\\ /g, \" \")}\"`;\n}\nfunction cssEscapeOne(s, i) {\n const c = s.charCodeAt(i);\n if (c === 0)\n return \"\\uFFFD\";\n if (c >= 1 && c <= 31 || c >= 48 && c <= 57 && (i === 0 || i === 1 && s.charCodeAt(0) === 45))\n return \"\\\\\" + c.toString(16) + \" \";\n if (i === 0 && c === 45 && s.length === 1)\n return \"\\\\\" + s.charAt(i);\n if (c >= 128 || c === 45 || c === 95 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122)\n return s.charAt(i);\n return \"\\\\\" + s.charAt(i);\n}\nfunction normalizeWhiteSpace(text) {\n return text.replace(/\\u200b/g, \"\").trim().replace(/\\s+/g, \" \");\n}\nfunction normalizeEscapedRegexQuotes(source) {\n return source.replace(/(^|[^\\\\])(\\\\\\\\)*\\\\(['\"`])/g, \"$1$2$3\");\n}\nfunction escapeRegexForSelector(re) {\n if (re.unicode || re.unicodeSets)\n return String(re);\n return String(re).replace(/(^|[^\\\\])(\\\\\\\\)*([\"'`])/g, \"$1$2\\\\$3\").replace(/>>/g, \"\\\\>\\\\>\");\n}\nfunction escapeForTextSelector(text, exact) {\n if (typeof text !== \"string\")\n return escapeRegexForSelector(text);\n return `${JSON.stringify(text)}${exact ? \"s\" : \"i\"}`;\n}\nfunction escapeForAttributeSelector(value, exact) {\n if (typeof value !== \"string\")\n return escapeRegexForSelector(value);\n return `\"${value.replace(/\\\\/g, \"\\\\\\\\\").replace(/[\"]/g, '\\\\\"')}\"${exact ? \"s\" : \"i\"}`;\n}\nfunction trimString(input, cap, suffix = \"\") {\n if (input.length <= cap)\n return input;\n const chars = [...input];\n if (chars.length > cap)\n return chars.slice(0, cap - suffix.length).join(\"\") + suffix;\n return chars.join(\"\");\n}\nfunction trimStringWithEllipsis(input, cap) {\n return trimString(input, cap, \"\\u2026\");\n}\nfunction escapeRegExp(s) {\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\n// packages/playwright-core/src/server/injected/roleUtils.ts\nfunction hasExplicitAccessibleName(e) {\n return e.hasAttribute(\"aria-label\") || e.hasAttribute(\"aria-labelledby\");\n}\nvar kAncestorPreventingLandmark = \"article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]\";\nvar kGlobalAriaAttributes = /* @__PURE__ */ new Map([\n [\"aria-atomic\", void 0],\n [\"aria-busy\", void 0],\n [\"aria-controls\", void 0],\n [\"aria-current\", void 0],\n [\"aria-describedby\", void 0],\n [\"aria-details\", void 0],\n // Global use deprecated in ARIA 1.2\n // ['aria-disabled', undefined],\n [\"aria-dropeffect\", void 0],\n // Global use deprecated in ARIA 1.2\n // ['aria-errormessage', undefined],\n [\"aria-flowto\", void 0],\n [\"aria-grabbed\", void 0],\n // Global use deprecated in ARIA 1.2\n // ['aria-haspopup', undefined],\n [\"aria-hidden\", void 0],\n // Global use deprecated in ARIA 1.2\n // ['aria-invalid', undefined],\n [\"aria-keyshortcuts\", void 0],\n [\"aria-label\", /* @__PURE__ */ new Set([\"caption\", \"code\", \"deletion\", \"emphasis\", \"generic\", \"insertion\", \"paragraph\", \"presentation\", \"strong\", \"subscript\", \"superscript\"])],\n [\"aria-labelledby\", /* @__PURE__ */ new Set([\"caption\", \"code\", \"deletion\", \"emphasis\", \"generic\", \"insertion\", \"paragraph\", \"presentation\", \"strong\", \"subscript\", \"superscript\"])],\n [\"aria-live\", void 0],\n [\"aria-owns\", void 0],\n [\"aria-relevant\", void 0],\n [\"aria-roledescription\", /* @__PURE__ */ new Set([\"generic\"])]\n]);\nfunction hasGlobalAriaAttribute(element, forRole) {\n return [...kGlobalAriaAttributes].some(([attr, prohibited]) => {\n return !(prohibited == null ? void 0 : prohibited.has(forRole || \"\")) && element.hasAttribute(attr);\n });\n}\nfunction hasTabIndex(element) {\n return !Number.isNaN(Number(String(element.getAttribute(\"tabindex\"))));\n}\nfunction isFocusable(element) {\n return !isNativelyDisabled(element) && (isNativelyFocusable(element) || hasTabIndex(element));\n}\nfunction isNativelyFocusable(element) {\n const tagName = elementSafeTagName(element);\n if ([\"BUTTON\", \"DETAILS\", \"SELECT\", \"TEXTAREA\"].includes(tagName))\n return true;\n if (tagName === \"A\" || tagName === \"AREA\")\n return element.hasAttribute(\"href\");\n if (tagName === \"INPUT\")\n return !element.hidden;\n return false;\n}\nvar kImplicitRoleByTagName = {\n \"A\": (e) => {\n return e.hasAttribute(\"href\") ? \"link\" : null;\n },\n \"AREA\": (e) => {\n return e.hasAttribute(\"href\") ? \"link\" : null;\n },\n \"ARTICLE\": () => \"article\",\n \"ASIDE\": () => \"complementary\",\n \"BLOCKQUOTE\": () => \"blockquote\",\n \"BUTTON\": () => \"button\",\n \"CAPTION\": () => \"caption\",\n \"CODE\": () => \"code\",\n \"DATALIST\": () => \"listbox\",\n \"DD\": () => \"definition\",\n \"DEL\": () => \"deletion\",\n \"DETAILS\": () => \"group\",\n \"DFN\": () => \"term\",\n \"DIALOG\": () => \"dialog\",\n \"DT\": () => \"term\",\n \"EM\": () => \"emphasis\",\n \"FIELDSET\": () => \"group\",\n \"FIGURE\": () => \"figure\",\n \"FOOTER\": (e) => closestCrossShadow(e, kAncestorPreventingLandmark) ? null : \"contentinfo\",\n \"FORM\": (e) => hasExplicitAccessibleName(e) ? \"form\" : null,\n \"H1\": () => \"heading\",\n \"H2\": () => \"heading\",\n \"H3\": () => \"heading\",\n \"H4\": () => \"heading\",\n \"H5\": () => \"heading\",\n \"H6\": () => \"heading\",\n \"HEADER\": (e) => closestCrossShadow(e, kAncestorPreventingLandmark) ? null : \"banner\",\n \"HR\": () => \"separator\",\n \"HTML\": () => \"document\",\n \"IMG\": (e) => e.getAttribute(\"alt\") === \"\" && !e.getAttribute(\"title\") && !hasGlobalAriaAttribute(e) && !hasTabIndex(e) ? \"presentation\" : \"img\",\n \"INPUT\": (e) => {\n const type = e.type.toLowerCase();\n if (type === \"search\")\n return e.hasAttribute(\"list\") ? \"combobox\" : \"searchbox\";\n if ([\"email\", \"tel\", \"text\", \"url\", \"\"].includes(type)) {\n const list = getIdRefs(e, e.getAttribute(\"list\"))[0];\n return list && elementSafeTagName(list) === \"DATALIST\" ? \"combobox\" : \"textbox\";\n }\n if (type === \"hidden\")\n return \"\";\n return {\n \"button\": \"button\",\n \"checkbox\": \"checkbox\",\n \"image\": \"button\",\n \"number\": \"spinbutton\",\n \"radio\": \"radio\",\n \"range\": \"slider\",\n \"reset\": \"button\",\n \"submit\": \"button\"\n }[type] || \"textbox\";\n },\n \"INS\": () => \"insertion\",\n \"LI\": () => \"listitem\",\n \"MAIN\": () => \"main\",\n \"MARK\": () => \"mark\",\n \"MATH\": () => \"math\",\n \"MENU\": () => \"list\",\n \"METER\": () => \"meter\",\n \"NAV\": () => \"navigation\",\n \"OL\": () => \"list\",\n \"OPTGROUP\": () => \"group\",\n \"OPTION\": () => \"option\",\n \"OUTPUT\": () => \"status\",\n \"P\": () => \"paragraph\",\n \"PROGRESS\": () => \"progressbar\",\n \"SECTION\": (e) => hasExplicitAccessibleName(e) ? \"region\" : null,\n \"SELECT\": (e) => e.hasAttribute(\"multiple\") || e.size > 1 ? \"listbox\" : \"combobox\",\n \"STRONG\": () => \"strong\",\n \"SUB\": () => \"subscript\",\n \"SUP\": () => \"superscript\",\n // For we default to Chrome behavior:\n // - Chrome reports 'img'.\n // - Firefox reports 'diagram' that is not in official ARIA spec yet.\n // - Safari reports 'no role', but still computes accessible name.\n \"SVG\": () => \"img\",\n \"TABLE\": () => \"table\",\n \"TBODY\": () => \"rowgroup\",\n \"TD\": (e) => {\n const table = closestCrossShadow(e, \"table\");\n const role = table ? getExplicitAriaRole(table) : \"\";\n return role === \"grid\" || role === \"treegrid\" ? \"gridcell\" : \"cell\";\n },\n \"TEXTAREA\": () => \"textbox\",\n \"TFOOT\": () => \"rowgroup\",\n \"TH\": (e) => {\n if (e.getAttribute(\"scope\") === \"col\")\n return \"columnheader\";\n if (e.getAttribute(\"scope\") === \"row\")\n return \"rowheader\";\n const table = closestCrossShadow(e, \"table\");\n const role = table ? getExplicitAriaRole(table) : \"\";\n return role === \"grid\" || role === \"treegrid\" ? \"gridcell\" : \"cell\";\n },\n \"THEAD\": () => \"rowgroup\",\n \"TIME\": () => \"time\",\n \"TR\": () => \"row\",\n \"UL\": () => \"list\"\n};\nvar kPresentationInheritanceParents = {\n \"DD\": [\"DL\", \"DIV\"],\n \"DIV\": [\"DL\"],\n \"DT\": [\"DL\", \"DIV\"],\n \"LI\": [\"OL\", \"UL\"],\n \"TBODY\": [\"TABLE\"],\n \"TD\": [\"TR\"],\n \"TFOOT\": [\"TABLE\"],\n \"TH\": [\"TR\"],\n \"THEAD\": [\"TABLE\"],\n \"TR\": [\"THEAD\", \"TBODY\", \"TFOOT\", \"TABLE\"]\n};\nfunction getImplicitAriaRole(element) {\n var _a;\n const implicitRole = ((_a = kImplicitRoleByTagName[elementSafeTagName(element)]) == null ? void 0 : _a.call(kImplicitRoleByTagName, element)) || \"\";\n if (!implicitRole)\n return null;\n let ancestor = element;\n while (ancestor) {\n const parent = parentElementOrShadowHost(ancestor);\n const parents = kPresentationInheritanceParents[elementSafeTagName(ancestor)];\n if (!parents || !parent || !parents.includes(elementSafeTagName(parent)))\n break;\n const parentExplicitRole = getExplicitAriaRole(parent);\n if ((parentExplicitRole === \"none\" || parentExplicitRole === \"presentation\") && !hasPresentationConflictResolution(parent, parentExplicitRole))\n return parentExplicitRole;\n ancestor = parent;\n }\n return implicitRole;\n}\nvar allRoles = [\n \"alert\",\n \"alertdialog\",\n \"application\",\n \"article\",\n \"banner\",\n \"blockquote\",\n \"button\",\n \"caption\",\n \"cell\",\n \"checkbox\",\n \"code\",\n \"columnheader\",\n \"combobox\",\n \"command\",\n \"complementary\",\n \"composite\",\n \"contentinfo\",\n \"definition\",\n \"deletion\",\n \"dialog\",\n \"directory\",\n \"document\",\n \"emphasis\",\n \"feed\",\n \"figure\",\n \"form\",\n \"generic\",\n \"grid\",\n \"gridcell\",\n \"group\",\n \"heading\",\n \"img\",\n \"input\",\n \"insertion\",\n \"landmark\",\n \"link\",\n \"list\",\n \"listbox\",\n \"listitem\",\n \"log\",\n \"main\",\n \"marquee\",\n \"math\",\n \"meter\",\n \"menu\",\n \"menubar\",\n \"menuitem\",\n \"menuitemcheckbox\",\n \"menuitemradio\",\n \"navigation\",\n \"none\",\n \"note\",\n \"option\",\n \"paragraph\",\n \"presentation\",\n \"progressbar\",\n \"radio\",\n \"radiogroup\",\n \"range\",\n \"region\",\n \"roletype\",\n \"row\",\n \"rowgroup\",\n \"rowheader\",\n \"scrollbar\",\n \"search\",\n \"searchbox\",\n \"section\",\n \"sectionhead\",\n \"select\",\n \"separator\",\n \"slider\",\n \"spinbutton\",\n \"status\",\n \"strong\",\n \"structure\",\n \"subscript\",\n \"superscript\",\n \"switch\",\n \"tab\",\n \"table\",\n \"tablist\",\n \"tabpanel\",\n \"term\",\n \"textbox\",\n \"time\",\n \"timer\",\n \"toolbar\",\n \"tooltip\",\n \"tree\",\n \"treegrid\",\n \"treeitem\",\n \"widget\",\n \"window\"\n];\nvar abstractRoles = [\"command\", \"composite\", \"input\", \"landmark\", \"range\", \"roletype\", \"section\", \"sectionhead\", \"select\", \"structure\", \"widget\", \"window\"];\nvar validRoles = allRoles.filter((role) => !abstractRoles.includes(role));\nfunction getExplicitAriaRole(element) {\n const roles = (element.getAttribute(\"role\") || \"\").split(\" \").map((role) => role.trim());\n return roles.find((role) => validRoles.includes(role)) || null;\n}\nfunction hasPresentationConflictResolution(element, role) {\n return hasGlobalAriaAttribute(element, role) || isFocusable(element);\n}\nfunction getAriaRole(element) {\n const explicitRole = getExplicitAriaRole(element);\n if (!explicitRole)\n return getImplicitAriaRole(element);\n if (explicitRole === \"none\" || explicitRole === \"presentation\") {\n const implicitRole = getImplicitAriaRole(element);\n if (hasPresentationConflictResolution(element, implicitRole))\n return implicitRole;\n }\n return explicitRole;\n}\nfunction getAriaBoolean(attr) {\n return attr === null ? void 0 : attr.toLowerCase() === \"true\";\n}\nfunction isElementHiddenForAria(element) {\n if ([\"STYLE\", \"SCRIPT\", \"NOSCRIPT\", \"TEMPLATE\"].includes(elementSafeTagName(element)))\n return true;\n const style = getElementComputedStyle(element);\n const isSlot = element.nodeName === \"SLOT\";\n if ((style == null ? void 0 : style.display) === \"contents\" && !isSlot) {\n for (let child = element.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === 1 && !isElementHiddenForAria(child))\n return false;\n if (child.nodeType === 3 && isVisibleTextNode(child))\n return false;\n }\n return true;\n }\n const isOptionInsideSelect = element.nodeName === \"OPTION\" && !!element.closest(\"select\");\n if (!isOptionInsideSelect && !isSlot && !isElementStyleVisibilityVisible(element, style))\n return true;\n return belongsToDisplayNoneOrAriaHiddenOrNonSlotted(element);\n}\nfunction belongsToDisplayNoneOrAriaHiddenOrNonSlotted(element) {\n let hidden = cacheIsHidden == null ? void 0 : cacheIsHidden.get(element);\n if (hidden === void 0) {\n hidden = false;\n if (element.parentElement && element.parentElement.shadowRoot && !element.assignedSlot)\n hidden = true;\n if (!hidden) {\n const style = getElementComputedStyle(element);\n hidden = !style || style.display === \"none\" || getAriaBoolean(element.getAttribute(\"aria-hidden\")) === true;\n }\n if (!hidden) {\n const parent = parentElementOrShadowHost(element);\n if (parent)\n hidden = belongsToDisplayNoneOrAriaHiddenOrNonSlotted(parent);\n }\n cacheIsHidden == null ? void 0 : cacheIsHidden.set(element, hidden);\n }\n return hidden;\n}\nfunction getIdRefs(element, ref) {\n if (!ref)\n return [];\n const root = enclosingShadowRootOrDocument(element);\n if (!root)\n return [];\n try {\n const ids = ref.split(\" \").filter((id) => !!id);\n const set = /* @__PURE__ */ new Set();\n for (const id of ids) {\n const firstElement = root.querySelector(\"#\" + CSS.escape(id));\n if (firstElement)\n set.add(firstElement);\n }\n return [...set];\n } catch (e) {\n return [];\n }\n}\nfunction trimFlatString(s) {\n return s.trim();\n}\nfunction asFlatString(s) {\n return s.split(\"\\xA0\").map((chunk) => chunk.replace(/\\r\\n/g, \"\\n\").replace(/\\s\\s*/g, \" \")).join(\"\\xA0\").trim();\n}\nfunction queryInAriaOwned(element, selector) {\n const result = [...element.querySelectorAll(selector)];\n for (const owned of getIdRefs(element, element.getAttribute(\"aria-owns\"))) {\n if (owned.matches(selector))\n result.push(owned);\n result.push(...owned.querySelectorAll(selector));\n }\n return result;\n}\nfunction getPseudoContent(element, pseudo) {\n const cache = pseudo === \"::before\" ? cachePseudoContentBefore : cachePseudoContentAfter;\n if (cache == null ? void 0 : cache.has(element))\n return (cache == null ? void 0 : cache.get(element)) || \"\";\n const pseudoStyle = getElementComputedStyle(element, pseudo);\n const content = getPseudoContentImpl(pseudoStyle);\n if (cache)\n cache.set(element, content);\n return content;\n}\nfunction getPseudoContentImpl(pseudoStyle) {\n if (!pseudoStyle)\n return \"\";\n const content = pseudoStyle.content;\n if (content[0] === \"'\" && content[content.length - 1] === \"'\" || content[0] === '\"' && content[content.length - 1] === '\"') {\n const unquoted = content.substring(1, content.length - 1);\n const display = pseudoStyle.display || \"inline\";\n if (display !== \"inline\")\n return \" \" + unquoted + \" \";\n return unquoted;\n }\n return \"\";\n}\nfunction getAriaLabelledByElements(element) {\n const ref = element.getAttribute(\"aria-labelledby\");\n if (ref === null)\n return null;\n return getIdRefs(element, ref);\n}\nfunction allowsNameFromContent(role, targetDescendant) {\n const alwaysAllowsNameFromContent = [\"button\", \"cell\", \"checkbox\", \"columnheader\", \"gridcell\", \"heading\", \"link\", \"menuitem\", \"menuitemcheckbox\", \"menuitemradio\", \"option\", \"radio\", \"row\", \"rowheader\", \"switch\", \"tab\", \"tooltip\", \"treeitem\"].includes(role);\n const descendantAllowsNameFromContent = targetDescendant && [\"\", \"caption\", \"code\", \"contentinfo\", \"definition\", \"deletion\", \"emphasis\", \"insertion\", \"list\", \"listitem\", \"mark\", \"none\", \"paragraph\", \"presentation\", \"region\", \"row\", \"rowgroup\", \"section\", \"strong\", \"subscript\", \"superscript\", \"table\", \"term\", \"time\"].includes(role);\n return alwaysAllowsNameFromContent || descendantAllowsNameFromContent;\n}\nfunction getElementAccessibleName(element, includeHidden) {\n const cache = includeHidden ? cacheAccessibleNameHidden : cacheAccessibleName;\n let accessibleName = cache == null ? void 0 : cache.get(element);\n if (accessibleName === void 0) {\n accessibleName = \"\";\n const elementProhibitsNaming = [\"caption\", \"code\", \"definition\", \"deletion\", \"emphasis\", \"generic\", \"insertion\", \"mark\", \"paragraph\", \"presentation\", \"strong\", \"subscript\", \"suggestion\", \"superscript\", \"term\", \"time\"].includes(getAriaRole(element) || \"\");\n if (!elementProhibitsNaming) {\n accessibleName = asFlatString(getTextAlternativeInternal(element, {\n includeHidden,\n visitedElements: /* @__PURE__ */ new Set(),\n embeddedInDescribedBy: void 0,\n embeddedInLabelledBy: void 0,\n embeddedInLabel: void 0,\n embeddedInNativeTextAlternative: void 0,\n embeddedInTargetElement: \"self\"\n }));\n }\n cache == null ? void 0 : cache.set(element, accessibleName);\n }\n return accessibleName;\n}\nfunction getElementAccessibleDescription(element, includeHidden) {\n const cache = includeHidden ? cacheAccessibleDescriptionHidden : cacheAccessibleDescription;\n let accessibleDescription = cache == null ? void 0 : cache.get(element);\n if (accessibleDescription === void 0) {\n accessibleDescription = \"\";\n if (element.hasAttribute(\"aria-describedby\")) {\n const describedBy = getIdRefs(element, element.getAttribute(\"aria-describedby\"));\n accessibleDescription = asFlatString(describedBy.map((ref) => getTextAlternativeInternal(ref, {\n includeHidden,\n visitedElements: /* @__PURE__ */ new Set(),\n embeddedInLabelledBy: void 0,\n embeddedInLabel: void 0,\n embeddedInNativeTextAlternative: void 0,\n embeddedInTargetElement: \"none\",\n embeddedInDescribedBy: { element: ref, hidden: isElementHiddenForAria(ref) }\n })).join(\" \"));\n } else if (element.hasAttribute(\"aria-description\")) {\n accessibleDescription = asFlatString(element.getAttribute(\"aria-description\") || \"\");\n } else {\n accessibleDescription = asFlatString(element.getAttribute(\"title\") || \"\");\n }\n cache == null ? void 0 : cache.set(element, accessibleDescription);\n }\n return accessibleDescription;\n}\nfunction getTextAlternativeInternal(element, options) {\n var _a, _b, _c, _d;\n if (options.visitedElements.has(element))\n return \"\";\n const childOptions = {\n ...options,\n embeddedInTargetElement: options.embeddedInTargetElement === \"self\" ? \"descendant\" : options.embeddedInTargetElement\n };\n if (!options.includeHidden && !((_a = options.embeddedInLabelledBy) == null ? void 0 : _a.hidden) && !((_b = options.embeddedInDescribedBy) == null ? void 0 : _b.hidden) && !((_c = options == null ? void 0 : options.embeddedInNativeTextAlternative) == null ? void 0 : _c.hidden) && !((_d = options == null ? void 0 : options.embeddedInLabel) == null ? void 0 : _d.hidden) && isElementHiddenForAria(element)) {\n options.visitedElements.add(element);\n return \"\";\n }\n const labelledBy = getAriaLabelledByElements(element);\n if (!options.embeddedInLabelledBy) {\n const accessibleName = (labelledBy || []).map((ref) => getTextAlternativeInternal(ref, {\n ...options,\n embeddedInLabelledBy: { element: ref, hidden: isElementHiddenForAria(ref) },\n embeddedInDescribedBy: void 0,\n embeddedInTargetElement: \"none\",\n embeddedInLabel: void 0,\n embeddedInNativeTextAlternative: void 0\n })).join(\" \");\n if (accessibleName)\n return accessibleName;\n }\n const role = getAriaRole(element) || \"\";\n const tagName = elementSafeTagName(element);\n if (!!options.embeddedInLabel || !!options.embeddedInLabelledBy || options.embeddedInTargetElement === \"descendant\") {\n const isOwnLabel = [...element.labels || []].includes(element);\n const isOwnLabelledBy = (labelledBy || []).includes(element);\n if (!isOwnLabel && !isOwnLabelledBy) {\n if (role === \"textbox\") {\n options.visitedElements.add(element);\n if (tagName === \"INPUT\" || tagName === \"TEXTAREA\")\n return element.value;\n return element.textContent || \"\";\n }\n if ([\"combobox\", \"listbox\"].includes(role)) {\n options.visitedElements.add(element);\n let selectedOptions;\n if (tagName === \"SELECT\") {\n selectedOptions = [...element.selectedOptions];\n if (!selectedOptions.length && element.options.length)\n selectedOptions.push(element.options[0]);\n } else {\n const listbox = role === \"combobox\" ? queryInAriaOwned(element, \"*\").find((e) => getAriaRole(e) === \"listbox\") : element;\n selectedOptions = listbox ? queryInAriaOwned(listbox, '[aria-selected=\"true\"]').filter((e) => getAriaRole(e) === \"option\") : [];\n }\n if (!selectedOptions.length && tagName === \"INPUT\") {\n return element.value;\n }\n return selectedOptions.map((option) => getTextAlternativeInternal(option, childOptions)).join(\" \");\n }\n if ([\"progressbar\", \"scrollbar\", \"slider\", \"spinbutton\", \"meter\"].includes(role)) {\n options.visitedElements.add(element);\n if (element.hasAttribute(\"aria-valuetext\"))\n return element.getAttribute(\"aria-valuetext\") || \"\";\n if (element.hasAttribute(\"aria-valuenow\"))\n return element.getAttribute(\"aria-valuenow\") || \"\";\n return element.getAttribute(\"value\") || \"\";\n }\n if ([\"menu\"].includes(role)) {\n options.visitedElements.add(element);\n return \"\";\n }\n }\n }\n const ariaLabel = element.getAttribute(\"aria-label\") || \"\";\n if (trimFlatString(ariaLabel)) {\n options.visitedElements.add(element);\n return ariaLabel;\n }\n if (![\"presentation\", \"none\"].includes(role)) {\n if (tagName === \"INPUT\" && [\"button\", \"submit\", \"reset\"].includes(element.type)) {\n options.visitedElements.add(element);\n const value = element.value || \"\";\n if (trimFlatString(value))\n return value;\n if (element.type === \"submit\")\n return \"Submit\";\n if (element.type === \"reset\")\n return \"Reset\";\n const title = element.getAttribute(\"title\") || \"\";\n return title;\n }\n if (tagName === \"INPUT\" && element.type === \"image\") {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length && !options.embeddedInLabelledBy)\n return getAccessibleNameFromAssociatedLabels(labels, options);\n const alt = element.getAttribute(\"alt\") || \"\";\n if (trimFlatString(alt))\n return alt;\n const title = element.getAttribute(\"title\") || \"\";\n if (trimFlatString(title))\n return title;\n return \"Submit\";\n }\n if (!labelledBy && tagName === \"BUTTON\") {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length)\n return getAccessibleNameFromAssociatedLabels(labels, options);\n }\n if (!labelledBy && tagName === \"OUTPUT\") {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length)\n return getAccessibleNameFromAssociatedLabels(labels, options);\n return element.getAttribute(\"title\") || \"\";\n }\n if (!labelledBy && (tagName === \"TEXTAREA\" || tagName === \"SELECT\" || tagName === \"INPUT\")) {\n options.visitedElements.add(element);\n const labels = element.labels || [];\n if (labels.length)\n return getAccessibleNameFromAssociatedLabels(labels, options);\n const usePlaceholder = tagName === \"INPUT\" && [\"text\", \"password\", \"search\", \"tel\", \"email\", \"url\"].includes(element.type) || tagName === \"TEXTAREA\";\n const placeholder = element.getAttribute(\"placeholder\") || \"\";\n const title = element.getAttribute(\"title\") || \"\";\n if (!usePlaceholder || title)\n return title;\n return placeholder;\n }\n if (!labelledBy && tagName === \"FIELDSET\") {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (elementSafeTagName(child) === \"LEGEND\") {\n return getTextAlternativeInternal(child, {\n ...childOptions,\n embeddedInNativeTextAlternative: { element: child, hidden: isElementHiddenForAria(child) }\n });\n }\n }\n const title = element.getAttribute(\"title\") || \"\";\n return title;\n }\n if (!labelledBy && tagName === \"FIGURE\") {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (elementSafeTagName(child) === \"FIGCAPTION\") {\n return getTextAlternativeInternal(child, {\n ...childOptions,\n embeddedInNativeTextAlternative: { element: child, hidden: isElementHiddenForAria(child) }\n });\n }\n }\n const title = element.getAttribute(\"title\") || \"\";\n return title;\n }\n if (tagName === \"IMG\") {\n options.visitedElements.add(element);\n const alt = element.getAttribute(\"alt\") || \"\";\n if (trimFlatString(alt))\n return alt;\n const title = element.getAttribute(\"title\") || \"\";\n return title;\n }\n if (tagName === \"TABLE\") {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (elementSafeTagName(child) === \"CAPTION\") {\n return getTextAlternativeInternal(child, {\n ...childOptions,\n embeddedInNativeTextAlternative: { element: child, hidden: isElementHiddenForAria(child) }\n });\n }\n }\n const summary = element.getAttribute(\"summary\") || \"\";\n if (summary)\n return summary;\n }\n if (tagName === \"AREA\") {\n options.visitedElements.add(element);\n const alt = element.getAttribute(\"alt\") || \"\";\n if (trimFlatString(alt))\n return alt;\n const title = element.getAttribute(\"title\") || \"\";\n return title;\n }\n if (tagName === \"SVG\" || element.ownerSVGElement) {\n options.visitedElements.add(element);\n for (let child = element.firstElementChild; child; child = child.nextElementSibling) {\n if (elementSafeTagName(child) === \"TITLE\" && child.ownerSVGElement) {\n return getTextAlternativeInternal(child, {\n ...childOptions,\n embeddedInLabelledBy: { element: child, hidden: isElementHiddenForAria(child) }\n });\n }\n }\n }\n if (element.ownerSVGElement && tagName === \"A\") {\n const title = element.getAttribute(\"xlink:title\") || \"\";\n if (trimFlatString(title)) {\n options.visitedElements.add(element);\n return title;\n }\n }\n }\n const shouldNameFromContentForSummary = tagName === \"SUMMARY\" && ![\"presentation\", \"none\"].includes(role);\n if (allowsNameFromContent(role, options.embeddedInTargetElement === \"descendant\") || shouldNameFromContentForSummary || !!options.embeddedInLabelledBy || !!options.embeddedInDescribedBy || !!options.embeddedInLabel || !!options.embeddedInNativeTextAlternative) {\n options.visitedElements.add(element);\n const tokens = [];\n const visit = (node, skipSlotted) => {\n var _a2;\n if (skipSlotted && node.assignedSlot)\n return;\n if (node.nodeType === 1) {\n const display = ((_a2 = getElementComputedStyle(node)) == null ? void 0 : _a2.display) || \"inline\";\n let token = getTextAlternativeInternal(node, childOptions);\n if (display !== \"inline\" || node.nodeName === \"BR\")\n token = \" \" + token + \" \";\n tokens.push(token);\n } else if (node.nodeType === 3) {\n tokens.push(node.textContent || \"\");\n }\n };\n tokens.push(getPseudoContent(element, \"::before\"));\n const assignedNodes = element.nodeName === \"SLOT\" ? element.assignedNodes() : [];\n if (assignedNodes.length) {\n for (const child of assignedNodes)\n visit(child, false);\n } else {\n for (let child = element.firstChild; child; child = child.nextSibling)\n visit(child, true);\n if (element.shadowRoot) {\n for (let child = element.shadowRoot.firstChild; child; child = child.nextSibling)\n visit(child, true);\n }\n for (const owned of getIdRefs(element, element.getAttribute(\"aria-owns\")))\n visit(owned, true);\n }\n tokens.push(getPseudoContent(element, \"::after\"));\n const accessibleName = tokens.join(\"\");\n const maybeTrimmedAccessibleName = options.embeddedInTargetElement === \"self\" ? trimFlatString(accessibleName) : accessibleName;\n if (maybeTrimmedAccessibleName)\n return accessibleName;\n }\n if (![\"presentation\", \"none\"].includes(role) || tagName === \"IFRAME\") {\n options.visitedElements.add(element);\n const title = element.getAttribute(\"title\") || \"\";\n if (trimFlatString(title))\n return title;\n }\n options.visitedElements.add(element);\n return \"\";\n}\nvar kAriaSelectedRoles = [\"gridcell\", \"option\", \"row\", \"tab\", \"rowheader\", \"columnheader\", \"treeitem\"];\nfunction getAriaSelected(element) {\n if (elementSafeTagName(element) === \"OPTION\")\n return element.selected;\n if (kAriaSelectedRoles.includes(getAriaRole(element) || \"\"))\n return getAriaBoolean(element.getAttribute(\"aria-selected\")) === true;\n return false;\n}\nvar kAriaCheckedRoles = [\"checkbox\", \"menuitemcheckbox\", \"option\", \"radio\", \"switch\", \"menuitemradio\", \"treeitem\"];\nfunction getAriaChecked(element) {\n const result = getChecked(element, true);\n return result === \"error\" ? false : result;\n}\nfunction getChecked(element, allowMixed) {\n const tagName = elementSafeTagName(element);\n if (allowMixed && tagName === \"INPUT\" && element.indeterminate)\n return \"mixed\";\n if (tagName === \"INPUT\" && [\"checkbox\", \"radio\"].includes(element.type))\n return element.checked;\n if (kAriaCheckedRoles.includes(getAriaRole(element) || \"\")) {\n const checked = element.getAttribute(\"aria-checked\");\n if (checked === \"true\")\n return true;\n if (allowMixed && checked === \"mixed\")\n return \"mixed\";\n return false;\n }\n return \"error\";\n}\nvar kAriaPressedRoles = [\"button\"];\nfunction getAriaPressed(element) {\n if (kAriaPressedRoles.includes(getAriaRole(element) || \"\")) {\n const pressed = element.getAttribute(\"aria-pressed\");\n if (pressed === \"true\")\n return true;\n if (pressed === \"mixed\")\n return \"mixed\";\n }\n return false;\n}\nvar kAriaExpandedRoles = [\"application\", \"button\", \"checkbox\", \"combobox\", \"gridcell\", \"link\", \"listbox\", \"menuitem\", \"row\", \"rowheader\", \"tab\", \"treeitem\", \"columnheader\", \"menuitemcheckbox\", \"menuitemradio\", \"rowheader\", \"switch\"];\nfunction getAriaExpanded(element) {\n if (elementSafeTagName(element) === \"DETAILS\")\n return element.open;\n if (kAriaExpandedRoles.includes(getAriaRole(element) || \"\")) {\n const expanded = element.getAttribute(\"aria-expanded\");\n if (expanded === null)\n return \"none\";\n if (expanded === \"true\")\n return true;\n return false;\n }\n return \"none\";\n}\nvar kAriaLevelRoles = [\"heading\", \"listitem\", \"row\", \"treeitem\"];\nfunction getAriaLevel(element) {\n const native = { \"H1\": 1, \"H2\": 2, \"H3\": 3, \"H4\": 4, \"H5\": 5, \"H6\": 6 }[elementSafeTagName(element)];\n if (native)\n return native;\n if (kAriaLevelRoles.includes(getAriaRole(element) || \"\")) {\n const attr = element.getAttribute(\"aria-level\");\n const value = attr === null ? Number.NaN : Number(attr);\n if (Number.isInteger(value) && value >= 1)\n return value;\n }\n return 0;\n}\nvar kAriaDisabledRoles = [\"application\", \"button\", \"composite\", \"gridcell\", \"group\", \"input\", \"link\", \"menuitem\", \"scrollbar\", \"separator\", \"tab\", \"checkbox\", \"columnheader\", \"combobox\", \"grid\", \"listbox\", \"menu\", \"menubar\", \"menuitemcheckbox\", \"menuitemradio\", \"option\", \"radio\", \"radiogroup\", \"row\", \"rowheader\", \"searchbox\", \"select\", \"slider\", \"spinbutton\", \"switch\", \"tablist\", \"textbox\", \"toolbar\", \"tree\", \"treegrid\", \"treeitem\"];\nfunction getAriaDisabled(element) {\n return isNativelyDisabled(element) || hasExplicitAriaDisabled(element);\n}\nfunction isNativelyDisabled(element) {\n const isNativeFormControl = [\"BUTTON\", \"INPUT\", \"SELECT\", \"TEXTAREA\", \"OPTION\", \"OPTGROUP\"].includes(element.tagName);\n return isNativeFormControl && (element.hasAttribute(\"disabled\") || belongsToDisabledFieldSet(element));\n}\nfunction belongsToDisabledFieldSet(element) {\n if (!element)\n return false;\n if (elementSafeTagName(element) === \"FIELDSET\" && element.hasAttribute(\"disabled\"))\n return true;\n return belongsToDisabledFieldSet(element.parentElement);\n}\nfunction hasExplicitAriaDisabled(element) {\n if (!element)\n return false;\n if (kAriaDisabledRoles.includes(getAriaRole(element) || \"\")) {\n const attribute = (element.getAttribute(\"aria-disabled\") || \"\").toLowerCase();\n if (attribute === \"true\")\n return true;\n if (attribute === \"false\")\n return false;\n }\n return hasExplicitAriaDisabled(parentElementOrShadowHost(element));\n}\nfunction getAccessibleNameFromAssociatedLabels(labels, options) {\n return [...labels].map((label) => getTextAlternativeInternal(label, {\n ...options,\n embeddedInLabel: { element: label, hidden: isElementHiddenForAria(label) },\n embeddedInNativeTextAlternative: void 0,\n embeddedInLabelledBy: void 0,\n embeddedInDescribedBy: void 0,\n embeddedInTargetElement: \"none\"\n })).filter((accessibleName) => !!accessibleName).join(\" \");\n}\nvar cacheAccessibleName;\nvar cacheAccessibleNameHidden;\nvar cacheAccessibleDescription;\nvar cacheAccessibleDescriptionHidden;\nvar cacheIsHidden;\nvar cachePseudoContentBefore;\nvar cachePseudoContentAfter;\nvar cachesCounter = 0;\nfunction beginAriaCaches() {\n ++cachesCounter;\n cacheAccessibleName != null ? cacheAccessibleName : cacheAccessibleName = /* @__PURE__ */ new Map();\n cacheAccessibleNameHidden != null ? cacheAccessibleNameHidden : cacheAccessibleNameHidden = /* @__PURE__ */ new Map();\n cacheAccessibleDescription != null ? cacheAccessibleDescription : cacheAccessibleDescription = /* @__PURE__ */ new Map();\n cacheAccessibleDescriptionHidden != null ? cacheAccessibleDescriptionHidden : cacheAccessibleDescriptionHidden = /* @__PURE__ */ new Map();\n cacheIsHidden != null ? cacheIsHidden : cacheIsHidden = /* @__PURE__ */ new Map();\n cachePseudoContentBefore != null ? cachePseudoContentBefore : cachePseudoContentBefore = /* @__PURE__ */ new Map();\n cachePseudoContentAfter != null ? cachePseudoContentAfter : cachePseudoContentAfter = /* @__PURE__ */ new Map();\n}\nfunction endAriaCaches() {\n if (!--cachesCounter) {\n cacheAccessibleName = void 0;\n cacheAccessibleNameHidden = void 0;\n cacheAccessibleDescription = void 0;\n cacheAccessibleDescriptionHidden = void 0;\n cacheIsHidden = void 0;\n cachePseudoContentBefore = void 0;\n cachePseudoContentAfter = void 0;\n }\n}\n\n// packages/playwright-core/src/server/injected/selectorUtils.ts\nfunction matchesComponentAttribute(obj, attr) {\n for (const token of attr.jsonPath) {\n if (obj !== void 0 && obj !== null)\n obj = obj[token];\n }\n return matchesAttributePart(obj, attr);\n}\nfunction matchesAttributePart(value, attr) {\n const objValue = typeof value === \"string\" && !attr.caseSensitive ? value.toUpperCase() : value;\n const attrValue = typeof attr.value === \"string\" && !attr.caseSensitive ? attr.value.toUpperCase() : attr.value;\n if (attr.op === \"\")\n return !!objValue;\n if (attr.op === \"=\") {\n if (attrValue instanceof RegExp)\n return typeof objValue === \"string\" && !!objValue.match(attrValue);\n return objValue === attrValue;\n }\n if (typeof objValue !== \"string\" || typeof attrValue !== \"string\")\n return false;\n if (attr.op === \"*=\")\n return objValue.includes(attrValue);\n if (attr.op === \"^=\")\n return objValue.startsWith(attrValue);\n if (attr.op === \"$=\")\n return objValue.endsWith(attrValue);\n if (attr.op === \"|=\")\n return objValue === attrValue || objValue.startsWith(attrValue + \"-\");\n if (attr.op === \"~=\")\n return objValue.split(\" \").includes(attrValue);\n return false;\n}\nfunction shouldSkipForTextMatching(element) {\n const document = element.ownerDocument;\n return element.nodeName === \"SCRIPT\" || element.nodeName === \"NOSCRIPT\" || element.nodeName === \"STYLE\" || document.head && document.head.contains(element);\n}\nfunction elementText(cache, root) {\n let value = cache.get(root);\n if (value === void 0) {\n value = { full: \"\", normalized: \"\", immediate: [] };\n if (!shouldSkipForTextMatching(root)) {\n let currentImmediate = \"\";\n if (root instanceof HTMLInputElement && (root.type === \"submit\" || root.type === \"button\")) {\n value = { full: root.value, normalized: normalizeWhiteSpace(root.value), immediate: [root.value] };\n } else {\n for (let child = root.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === Node.TEXT_NODE) {\n value.full += child.nodeValue || \"\";\n currentImmediate += child.nodeValue || \"\";\n } else {\n if (currentImmediate)\n value.immediate.push(currentImmediate);\n currentImmediate = \"\";\n if (child.nodeType === Node.ELEMENT_NODE)\n value.full += elementText(cache, child).full;\n }\n }\n if (currentImmediate)\n value.immediate.push(currentImmediate);\n if (root.shadowRoot)\n value.full += elementText(cache, root.shadowRoot).full;\n if (value.full)\n value.normalized = normalizeWhiteSpace(value.full);\n }\n }\n cache.set(root, value);\n }\n return value;\n}\nfunction elementMatchesText(cache, element, matcher) {\n if (shouldSkipForTextMatching(element))\n return \"none\";\n if (!matcher(elementText(cache, element)))\n return \"none\";\n for (let child = element.firstChild; child; child = child.nextSibling) {\n if (child.nodeType === Node.ELEMENT_NODE && matcher(elementText(cache, child)))\n return \"selfAndChildren\";\n }\n if (element.shadowRoot && matcher(elementText(cache, element.shadowRoot)))\n return \"selfAndChildren\";\n return \"self\";\n}\nfunction getElementLabels(textCache, element) {\n const labels = getAriaLabelledByElements(element);\n if (labels)\n return labels.map((label) => elementText(textCache, label));\n const ariaLabel = element.getAttribute(\"aria-label\");\n if (ariaLabel !== null && !!ariaLabel.trim())\n return [{ full: ariaLabel, normalized: normalizeWhiteSpace(ariaLabel), immediate: [ariaLabel] }];\n const isNonHiddenInput = element.nodeName === \"INPUT\" && element.type !== \"hidden\";\n if ([\"BUTTON\", \"METER\", \"OUTPUT\", \"PROGRESS\", \"SELECT\", \"TEXTAREA\"].includes(element.nodeName) || isNonHiddenInput) {\n const labels2 = element.labels;\n if (labels2)\n return [...labels2].map((label) => elementText(textCache, label));\n }\n return [];\n}\n\n// packages/playwright-core/src/utils/isomorphic/cssTokenizer.ts\nvar between = function(num, first, last) {\n return num >= first && num <= last;\n};\nfunction digit(code) {\n return between(code, 48, 57);\n}\nfunction hexdigit(code) {\n return digit(code) || between(code, 65, 70) || between(code, 97, 102);\n}\nfunction uppercaseletter(code) {\n return between(code, 65, 90);\n}\nfunction lowercaseletter(code) {\n return between(code, 97, 122);\n}\nfunction letter(code) {\n return uppercaseletter(code) || lowercaseletter(code);\n}\nfunction nonascii(code) {\n return code >= 128;\n}\nfunction namestartchar(code) {\n return letter(code) || nonascii(code) || code === 95;\n}\nfunction namechar(code) {\n return namestartchar(code) || digit(code) || code === 45;\n}\nfunction nonprintable(code) {\n return between(code, 0, 8) || code === 11 || between(code, 14, 31) || code === 127;\n}\nfunction newline(code) {\n return code === 10;\n}\nfunction whitespace(code) {\n return newline(code) || code === 9 || code === 32;\n}\nvar maximumallowedcodepoint = 1114111;\nvar InvalidCharacterError = class extends Error {\n constructor(message) {\n super(message);\n this.name = \"InvalidCharacterError\";\n }\n};\nfunction preprocess(str) {\n const codepoints = [];\n for (let i = 0; i < str.length; i++) {\n let code = str.charCodeAt(i);\n if (code === 13 && str.charCodeAt(i + 1) === 10) {\n code = 10;\n i++;\n }\n if (code === 13 || code === 12)\n code = 10;\n if (code === 0)\n code = 65533;\n if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {\n const lead = code - 55296;\n const trail = str.charCodeAt(i + 1) - 56320;\n code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;\n i++;\n }\n codepoints.push(code);\n }\n return codepoints;\n}\nfunction stringFromCode(code) {\n if (code <= 65535)\n return String.fromCharCode(code);\n code -= Math.pow(2, 16);\n const lead = Math.floor(code / Math.pow(2, 10)) + 55296;\n const trail = code % Math.pow(2, 10) + 56320;\n return String.fromCharCode(lead) + String.fromCharCode(trail);\n}\nfunction tokenize(str1) {\n const str = preprocess(str1);\n let i = -1;\n const tokens = [];\n let code;\n let line = 0;\n let column = 0;\n let lastLineLength = 0;\n const incrLineno = function() {\n line += 1;\n lastLineLength = column;\n column = 0;\n };\n const locStart = { line, column };\n const codepoint = function(i2) {\n if (i2 >= str.length)\n return -1;\n return str[i2];\n };\n const next = function(num) {\n if (num === void 0)\n num = 1;\n if (num > 3)\n throw \"Spec Error: no more than three codepoints of lookahead.\";\n return codepoint(i + num);\n };\n const consume = function(num) {\n if (num === void 0)\n num = 1;\n i += num;\n code = codepoint(i);\n if (newline(code))\n incrLineno();\n else\n column += num;\n return true;\n };\n const reconsume = function() {\n i -= 1;\n if (newline(code)) {\n line -= 1;\n column = lastLineLength;\n } else {\n column -= 1;\n }\n locStart.line = line;\n locStart.column = column;\n return true;\n };\n const eof = function(codepoint2) {\n if (codepoint2 === void 0)\n codepoint2 = code;\n return codepoint2 === -1;\n };\n const donothing = function() {\n };\n const parseerror = function() {\n };\n const consumeAToken = function() {\n consumeComments();\n consume();\n if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n return new WhitespaceToken();\n } else if (code === 34) {\n return consumeAStringToken();\n } else if (code === 35) {\n if (namechar(next()) || areAValidEscape(next(1), next(2))) {\n const token = new HashToken(\"\");\n if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n token.type = \"id\";\n token.value = consumeAName();\n return token;\n } else {\n return new DelimToken(code);\n }\n } else if (code === 36) {\n if (next() === 61) {\n consume();\n return new SuffixMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 39) {\n return consumeAStringToken();\n } else if (code === 40) {\n return new OpenParenToken();\n } else if (code === 41) {\n return new CloseParenToken();\n } else if (code === 42) {\n if (next() === 61) {\n consume();\n return new SubstringMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 43) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 44) {\n return new CommaToken();\n } else if (code === 45) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else if (next(1) === 45 && next(2) === 62) {\n consume(2);\n return new CDCToken();\n } else if (startsWithAnIdentifier()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 46) {\n if (startsWithANumber()) {\n reconsume();\n return consumeANumericToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 58) {\n return new ColonToken();\n } else if (code === 59) {\n return new SemicolonToken();\n } else if (code === 60) {\n if (next(1) === 33 && next(2) === 45 && next(3) === 45) {\n consume(3);\n return new CDOToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 64) {\n if (wouldStartAnIdentifier(next(1), next(2), next(3)))\n return new AtKeywordToken(consumeAName());\n else\n return new DelimToken(code);\n } else if (code === 91) {\n return new OpenSquareToken();\n } else if (code === 92) {\n if (startsWithAValidEscape()) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else {\n parseerror();\n return new DelimToken(code);\n }\n } else if (code === 93) {\n return new CloseSquareToken();\n } else if (code === 94) {\n if (next() === 61) {\n consume();\n return new PrefixMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 123) {\n return new OpenCurlyToken();\n } else if (code === 124) {\n if (next() === 61) {\n consume();\n return new DashMatchToken();\n } else if (next() === 124) {\n consume();\n return new ColumnToken();\n } else {\n return new DelimToken(code);\n }\n } else if (code === 125) {\n return new CloseCurlyToken();\n } else if (code === 126) {\n if (next() === 61) {\n consume();\n return new IncludeMatchToken();\n } else {\n return new DelimToken(code);\n }\n } else if (digit(code)) {\n reconsume();\n return consumeANumericToken();\n } else if (namestartchar(code)) {\n reconsume();\n return consumeAnIdentlikeToken();\n } else if (eof()) {\n return new EOFToken();\n } else {\n return new DelimToken(code);\n }\n };\n const consumeComments = function() {\n while (next(1) === 47 && next(2) === 42) {\n consume(2);\n while (true) {\n consume();\n if (code === 42 && next() === 47) {\n consume();\n break;\n } else if (eof()) {\n parseerror();\n return;\n }\n }\n }\n };\n const consumeANumericToken = function() {\n const num = consumeANumber();\n if (wouldStartAnIdentifier(next(1), next(2), next(3))) {\n const token = new DimensionToken();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n token.unit = consumeAName();\n return token;\n } else if (next() === 37) {\n consume();\n const token = new PercentageToken();\n token.value = num.value;\n token.repr = num.repr;\n return token;\n } else {\n const token = new NumberToken();\n token.value = num.value;\n token.repr = num.repr;\n token.type = num.type;\n return token;\n }\n };\n const consumeAnIdentlikeToken = function() {\n const str2 = consumeAName();\n if (str2.toLowerCase() === \"url\" && next() === 40) {\n consume();\n while (whitespace(next(1)) && whitespace(next(2)))\n consume();\n if (next() === 34 || next() === 39)\n return new FunctionToken(str2);\n else if (whitespace(next()) && (next(2) === 34 || next(2) === 39))\n return new FunctionToken(str2);\n else\n return consumeAURLToken();\n } else if (next() === 40) {\n consume();\n return new FunctionToken(str2);\n } else {\n return new IdentToken(str2);\n }\n };\n const consumeAStringToken = function(endingCodePoint) {\n if (endingCodePoint === void 0)\n endingCodePoint = code;\n let string = \"\";\n while (consume()) {\n if (code === endingCodePoint || eof()) {\n return new StringToken(string);\n } else if (newline(code)) {\n parseerror();\n reconsume();\n return new BadStringToken();\n } else if (code === 92) {\n if (eof(next()))\n donothing();\n else if (newline(next()))\n consume();\n else\n string += stringFromCode(consumeEscape());\n } else {\n string += stringFromCode(code);\n }\n }\n throw new Error(\"Internal error\");\n };\n const consumeAURLToken = function() {\n const token = new URLToken(\"\");\n while (whitespace(next()))\n consume();\n if (eof(next()))\n return token;\n while (consume()) {\n if (code === 41 || eof()) {\n return token;\n } else if (whitespace(code)) {\n while (whitespace(next()))\n consume();\n if (next() === 41 || eof(next())) {\n consume();\n return token;\n } else {\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n }\n } else if (code === 34 || code === 39 || code === 40 || nonprintable(code)) {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n } else if (code === 92) {\n if (startsWithAValidEscape()) {\n token.value += stringFromCode(consumeEscape());\n } else {\n parseerror();\n consumeTheRemnantsOfABadURL();\n return new BadURLToken();\n }\n } else {\n token.value += stringFromCode(code);\n }\n }\n throw new Error(\"Internal error\");\n };\n const consumeEscape = function() {\n consume();\n if (hexdigit(code)) {\n const digits = [code];\n for (let total = 0; total < 5; total++) {\n if (hexdigit(next())) {\n consume();\n digits.push(code);\n } else {\n break;\n }\n }\n if (whitespace(next()))\n consume();\n let value = parseInt(digits.map(function(x) {\n return String.fromCharCode(x);\n }).join(\"\"), 16);\n if (value > maximumallowedcodepoint)\n value = 65533;\n return value;\n } else if (eof()) {\n return 65533;\n } else {\n return code;\n }\n };\n const areAValidEscape = function(c1, c2) {\n if (c1 !== 92)\n return false;\n if (newline(c2))\n return false;\n return true;\n };\n const startsWithAValidEscape = function() {\n return areAValidEscape(code, next());\n };\n const wouldStartAnIdentifier = function(c1, c2, c3) {\n if (c1 === 45)\n return namestartchar(c2) || c2 === 45 || areAValidEscape(c2, c3);\n else if (namestartchar(c1))\n return true;\n else if (c1 === 92)\n return areAValidEscape(c1, c2);\n else\n return false;\n };\n const startsWithAnIdentifier = function() {\n return wouldStartAnIdentifier(code, next(1), next(2));\n };\n const wouldStartANumber = function(c1, c2, c3) {\n if (c1 === 43 || c1 === 45) {\n if (digit(c2))\n return true;\n if (c2 === 46 && digit(c3))\n return true;\n return false;\n } else if (c1 === 46) {\n if (digit(c2))\n return true;\n return false;\n } else if (digit(c1)) {\n return true;\n } else {\n return false;\n }\n };\n const startsWithANumber = function() {\n return wouldStartANumber(code, next(1), next(2));\n };\n const consumeAName = function() {\n let result = \"\";\n while (consume()) {\n if (namechar(code)) {\n result += stringFromCode(code);\n } else if (startsWithAValidEscape()) {\n result += stringFromCode(consumeEscape());\n } else {\n reconsume();\n return result;\n }\n }\n throw new Error(\"Internal parse error\");\n };\n const consumeANumber = function() {\n let repr = \"\";\n let type = \"integer\";\n if (next() === 43 || next() === 45) {\n consume();\n repr += stringFromCode(code);\n }\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n if (next(1) === 46 && digit(next(2))) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = \"number\";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n const c1 = next(1), c2 = next(2), c3 = next(3);\n if ((c1 === 69 || c1 === 101) && digit(c2)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = \"number\";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n } else if ((c1 === 69 || c1 === 101) && (c2 === 43 || c2 === 45) && digit(c3)) {\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n consume();\n repr += stringFromCode(code);\n type = \"number\";\n while (digit(next())) {\n consume();\n repr += stringFromCode(code);\n }\n }\n const value = convertAStringToANumber(repr);\n return { type, value, repr };\n };\n const convertAStringToANumber = function(string) {\n return +string;\n };\n const consumeTheRemnantsOfABadURL = function() {\n while (consume()) {\n if (code === 41 || eof()) {\n return;\n } else if (startsWithAValidEscape()) {\n consumeEscape();\n donothing();\n } else {\n donothing();\n }\n }\n };\n let iterationCount = 0;\n while (!eof(next())) {\n tokens.push(consumeAToken());\n iterationCount++;\n if (iterationCount > str.length * 2)\n throw new Error(\"I'm infinite-looping!\");\n }\n return tokens;\n}\nvar CSSParserToken = class {\n constructor() {\n this.tokenType = \"\";\n }\n toJSON() {\n return { token: this.tokenType };\n }\n toString() {\n return this.tokenType;\n }\n toSource() {\n return \"\" + this;\n }\n};\nvar BadStringToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"BADSTRING\";\n }\n};\nvar BadURLToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"BADURL\";\n }\n};\nvar WhitespaceToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"WHITESPACE\";\n }\n toString() {\n return \"WS\";\n }\n toSource() {\n return \" \";\n }\n};\nvar CDOToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"CDO\";\n }\n toSource() {\n return \"\";\n }\n};\nvar ColonToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \":\";\n }\n};\nvar SemicolonToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \";\";\n }\n};\nvar CommaToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \",\";\n }\n};\nvar GroupingToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.value = \"\";\n this.mirror = \"\";\n }\n};\nvar OpenCurlyToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"{\";\n this.value = \"{\";\n this.mirror = \"}\";\n }\n};\nvar CloseCurlyToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"}\";\n this.value = \"}\";\n this.mirror = \"{\";\n }\n};\nvar OpenSquareToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"[\";\n this.value = \"[\";\n this.mirror = \"]\";\n }\n};\nvar CloseSquareToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"]\";\n this.value = \"]\";\n this.mirror = \"[\";\n }\n};\nvar OpenParenToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \"(\";\n this.value = \"(\";\n this.mirror = \")\";\n }\n};\nvar CloseParenToken = class extends GroupingToken {\n constructor() {\n super();\n this.tokenType = \")\";\n this.value = \")\";\n this.mirror = \"(\";\n }\n};\nvar IncludeMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"~=\";\n }\n};\nvar DashMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"|=\";\n }\n};\nvar PrefixMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"^=\";\n }\n};\nvar SuffixMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"$=\";\n }\n};\nvar SubstringMatchToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"*=\";\n }\n};\nvar ColumnToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"||\";\n }\n};\nvar EOFToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.tokenType = \"EOF\";\n }\n toSource() {\n return \"\";\n }\n};\nvar DelimToken = class extends CSSParserToken {\n constructor(code) {\n super();\n this.tokenType = \"DELIM\";\n this.value = \"\";\n this.value = stringFromCode(code);\n }\n toString() {\n return \"DELIM(\" + this.value + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n }\n toSource() {\n if (this.value === \"\\\\\")\n return \"\\\\\\n\";\n else\n return this.value;\n }\n};\nvar StringValuedToken = class extends CSSParserToken {\n constructor() {\n super(...arguments);\n this.value = \"\";\n }\n ASCIIMatch(str) {\n return this.value.toLowerCase() === str.toLowerCase();\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n return json;\n }\n};\nvar IdentToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"IDENT\";\n this.value = val;\n }\n toString() {\n return \"IDENT(\" + this.value + \")\";\n }\n toSource() {\n return escapeIdent(this.value);\n }\n};\nvar FunctionToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"FUNCTION\";\n this.value = val;\n this.mirror = \")\";\n }\n toString() {\n return \"FUNCTION(\" + this.value + \")\";\n }\n toSource() {\n return escapeIdent(this.value) + \"(\";\n }\n};\nvar AtKeywordToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"AT-KEYWORD\";\n this.value = val;\n }\n toString() {\n return \"AT(\" + this.value + \")\";\n }\n toSource() {\n return \"@\" + escapeIdent(this.value);\n }\n};\nvar HashToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"HASH\";\n this.value = val;\n this.type = \"unrestricted\";\n }\n toString() {\n return \"HASH(\" + this.value + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n return json;\n }\n toSource() {\n if (this.type === \"id\")\n return \"#\" + escapeIdent(this.value);\n else\n return \"#\" + escapeHash(this.value);\n }\n};\nvar StringToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"STRING\";\n this.value = val;\n }\n toString() {\n return '\"' + escapeString(this.value) + '\"';\n }\n};\nvar URLToken = class extends StringValuedToken {\n constructor(val) {\n super();\n this.tokenType = \"URL\";\n this.value = val;\n }\n toString() {\n return \"URL(\" + this.value + \")\";\n }\n toSource() {\n return 'url(\"' + escapeString(this.value) + '\")';\n }\n};\nvar NumberToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = \"NUMBER\";\n this.type = \"integer\";\n this.repr = \"\";\n }\n toString() {\n if (this.type === \"integer\")\n return \"INT(\" + this.value + \")\";\n return \"NUMBER(\" + this.value + \")\";\n }\n toJSON() {\n const json = super.toJSON();\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n return json;\n }\n toSource() {\n return this.repr;\n }\n};\nvar PercentageToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = \"PERCENTAGE\";\n this.repr = \"\";\n }\n toString() {\n return \"PERCENTAGE(\" + this.value + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.repr = this.repr;\n return json;\n }\n toSource() {\n return this.repr + \"%\";\n }\n};\nvar DimensionToken = class extends CSSParserToken {\n constructor() {\n super();\n this.tokenType = \"DIMENSION\";\n this.type = \"integer\";\n this.repr = \"\";\n this.unit = \"\";\n }\n toString() {\n return \"DIM(\" + this.value + \",\" + this.unit + \")\";\n }\n toJSON() {\n const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);\n json.value = this.value;\n json.type = this.type;\n json.repr = this.repr;\n json.unit = this.unit;\n return json;\n }\n toSource() {\n const source = this.repr;\n let unit = escapeIdent(this.unit);\n if (unit[0].toLowerCase() === \"e\" && (unit[1] === \"-\" || between(unit.charCodeAt(1), 48, 57))) {\n unit = \"\\\\65 \" + unit.slice(1, unit.length);\n }\n return source + unit;\n }\n};\nfunction escapeIdent(string) {\n string = \"\" + string;\n let result = \"\";\n const firstcode = string.charCodeAt(0);\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");\n if (between(code, 1, 31) || code === 127 || i === 0 && between(code, 48, 57) || i === 1 && between(code, 48, 57) && firstcode === 45)\n result += \"\\\\\" + code.toString(16) + \" \";\n else if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n result += string[i];\n else\n result += \"\\\\\" + string[i];\n }\n return result;\n}\nfunction escapeHash(string) {\n string = \"\" + string;\n let result = \"\";\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");\n if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))\n result += string[i];\n else\n result += \"\\\\\" + code.toString(16) + \" \";\n }\n return result;\n}\nfunction escapeString(string) {\n string = \"\" + string;\n let result = \"\";\n for (let i = 0; i < string.length; i++) {\n const code = string.charCodeAt(i);\n if (code === 0)\n throw new InvalidCharacterError(\"Invalid character: the input contains U+0000.\");\n if (between(code, 1, 31) || code === 127)\n result += \"\\\\\" + code.toString(16) + \" \";\n else if (code === 34 || code === 92)\n result += \"\\\\\" + string[i];\n else\n result += string[i];\n }\n return result;\n}\n\n// packages/playwright-core/src/utils/isomorphic/cssParser.ts\nvar InvalidSelectorError = class extends Error {\n};\nfunction parseCSS(selector, customNames) {\n let tokens;\n try {\n tokens = tokenize(selector);\n if (!(tokens[tokens.length - 1] instanceof EOFToken))\n tokens.push(new EOFToken());\n } catch (e) {\n const newMessage = e.message + ` while parsing selector \"${selector}\"`;\n const index = (e.stack || \"\").indexOf(e.message);\n if (index !== -1)\n e.stack = e.stack.substring(0, index) + newMessage + e.stack.substring(index + e.message.length);\n e.message = newMessage;\n throw e;\n }\n const unsupportedToken = tokens.find((token) => {\n return token instanceof AtKeywordToken || token instanceof BadStringToken || token instanceof BadURLToken || token instanceof ColumnToken || token instanceof CDOToken || token instanceof CDCToken || token instanceof SemicolonToken || // TODO: Consider using these for something, e.g. to escape complex strings.\n // For example :xpath{ (//div/bar[@attr=\"foo\"])[2]/baz }\n // Or this way :xpath( {complex-xpath-goes-here(\"hello\")} )\n token instanceof OpenCurlyToken || token instanceof CloseCurlyToken || // TODO: Consider treating these as strings?\n token instanceof URLToken || token instanceof PercentageToken;\n });\n if (unsupportedToken)\n throw new InvalidSelectorError(`Unsupported token \"${unsupportedToken.toSource()}\" while parsing selector \"${selector}\"`);\n let pos = 0;\n const names = /* @__PURE__ */ new Set();\n function unexpected() {\n return new InvalidSelectorError(`Unexpected token \"${tokens[pos].toSource()}\" while parsing selector \"${selector}\"`);\n }\n function skipWhitespace() {\n while (tokens[pos] instanceof WhitespaceToken)\n pos++;\n }\n function isIdent(p = pos) {\n return tokens[p] instanceof IdentToken;\n }\n function isString(p = pos) {\n return tokens[p] instanceof StringToken;\n }\n function isNumber(p = pos) {\n return tokens[p] instanceof NumberToken;\n }\n function isComma(p = pos) {\n return tokens[p] instanceof CommaToken;\n }\n function isOpenParen(p = pos) {\n return tokens[p] instanceof OpenParenToken;\n }\n function isCloseParen(p = pos) {\n return tokens[p] instanceof CloseParenToken;\n }\n function isFunction(p = pos) {\n return tokens[p] instanceof FunctionToken;\n }\n function isStar(p = pos) {\n return tokens[p] instanceof DelimToken && tokens[p].value === \"*\";\n }\n function isEOF(p = pos) {\n return tokens[p] instanceof EOFToken;\n }\n function isClauseCombinator(p = pos) {\n return tokens[p] instanceof DelimToken && [\">\", \"+\", \"~\"].includes(tokens[p].value);\n }\n function isSelectorClauseEnd(p = pos) {\n return isComma(p) || isCloseParen(p) || isEOF(p) || isClauseCombinator(p) || tokens[p] instanceof WhitespaceToken;\n }\n function consumeFunctionArguments() {\n const result2 = [consumeArgument()];\n while (true) {\n skipWhitespace();\n if (!isComma())\n break;\n pos++;\n result2.push(consumeArgument());\n }\n return result2;\n }\n function consumeArgument() {\n skipWhitespace();\n if (isNumber())\n return tokens[pos++].value;\n if (isString())\n return tokens[pos++].value;\n return consumeComplexSelector();\n }\n function consumeComplexSelector() {\n const result2 = { simples: [] };\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples.push({ selector: { functions: [{ name: \"scope\", args: [] }] }, combinator: \"\" });\n } else {\n result2.simples.push({ selector: consumeSimpleSelector(), combinator: \"\" });\n }\n while (true) {\n skipWhitespace();\n if (isClauseCombinator()) {\n result2.simples[result2.simples.length - 1].combinator = tokens[pos++].value;\n skipWhitespace();\n } else if (isSelectorClauseEnd()) {\n break;\n }\n result2.simples.push({ combinator: \"\", selector: consumeSimpleSelector() });\n }\n return result2;\n }\n function consumeSimpleSelector() {\n let rawCSSString = \"\";\n const functions = [];\n while (!isSelectorClauseEnd()) {\n if (isIdent() || isStar()) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof HashToken) {\n rawCSSString += tokens[pos++].toSource();\n } else if (tokens[pos] instanceof DelimToken && tokens[pos].value === \".\") {\n pos++;\n if (isIdent())\n rawCSSString += \".\" + tokens[pos++].toSource();\n else\n throw unexpected();\n } else if (tokens[pos] instanceof ColonToken) {\n pos++;\n if (isIdent()) {\n if (!customNames.has(tokens[pos].value.toLowerCase())) {\n rawCSSString += \":\" + tokens[pos++].toSource();\n } else {\n const name = tokens[pos++].value.toLowerCase();\n functions.push({ name, args: [] });\n names.add(name);\n }\n } else if (isFunction()) {\n const name = tokens[pos++].value.toLowerCase();\n if (!customNames.has(name)) {\n rawCSSString += `:${name}(${consumeBuiltinFunctionArguments()})`;\n } else {\n functions.push({ name, args: consumeFunctionArguments() });\n names.add(name);\n }\n skipWhitespace();\n if (!isCloseParen())\n throw unexpected();\n pos++;\n } else {\n throw unexpected();\n }\n } else if (tokens[pos] instanceof OpenSquareToken) {\n rawCSSString += \"[\";\n pos++;\n while (!(tokens[pos] instanceof CloseSquareToken) && !isEOF())\n rawCSSString += tokens[pos++].toSource();\n if (!(tokens[pos] instanceof CloseSquareToken))\n throw unexpected();\n rawCSSString += \"]\";\n pos++;\n } else {\n throw unexpected();\n }\n }\n if (!rawCSSString && !functions.length)\n throw unexpected();\n return { css: rawCSSString || void 0, functions };\n }\n function consumeBuiltinFunctionArguments() {\n let s = \"\";\n let balance = 1;\n while (!isEOF()) {\n if (isOpenParen() || isFunction())\n balance++;\n if (isCloseParen())\n balance--;\n if (!balance)\n break;\n s += tokens[pos++].toSource();\n }\n return s;\n }\n const result = consumeFunctionArguments();\n if (!isEOF())\n throw unexpected();\n if (result.some((arg) => typeof arg !== \"object\" || !(\"simples\" in arg)))\n throw new InvalidSelectorError(`Error while parsing selector \"${selector}\"`);\n return { selector: result, names: Array.from(names) };\n}\n\n// packages/playwright-core/src/utils/isomorphic/selectorParser.ts\nvar kNestedSelectorNames = /* @__PURE__ */ new Set([\"internal:has\", \"internal:has-not\", \"internal:and\", \"internal:or\", \"internal:chain\", \"left-of\", \"right-of\", \"above\", \"below\", \"near\"]);\nvar kNestedSelectorNamesWithDistance = /* @__PURE__ */ new Set([\"left-of\", \"right-of\", \"above\", \"below\", \"near\"]);\nvar customCSSNames = /* @__PURE__ */ new Set([\"not\", \"is\", \"where\", \"has\", \"scope\", \"light\", \"visible\", \"text\", \"text-matches\", \"text-is\", \"has-text\", \"above\", \"below\", \"right-of\", \"left-of\", \"near\", \"nth-match\"]);\nfunction parseSelector(selector) {\n const parsedStrings = parseSelectorString(selector);\n const parts = [];\n for (const part of parsedStrings.parts) {\n if (part.name === \"css\" || part.name === \"css:light\") {\n if (part.name === \"css:light\")\n part.body = \":light(\" + part.body + \")\";\n const parsedCSS = parseCSS(part.body, customCSSNames);\n parts.push({\n name: \"css\",\n body: parsedCSS.selector,\n source: part.body\n });\n continue;\n }\n if (kNestedSelectorNames.has(part.name)) {\n let innerSelector;\n let distance;\n try {\n const unescaped = JSON.parse(\"[\" + part.body + \"]\");\n if (!Array.isArray(unescaped) || unescaped.length < 1 || unescaped.length > 2 || typeof unescaped[0] !== \"string\")\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n innerSelector = unescaped[0];\n if (unescaped.length === 2) {\n if (typeof unescaped[1] !== \"number\" || !kNestedSelectorNamesWithDistance.has(part.name))\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n distance = unescaped[1];\n }\n } catch (e) {\n throw new InvalidSelectorError(`Malformed selector: ${part.name}=` + part.body);\n }\n const nested = { name: part.name, source: part.body, body: { parsed: parseSelector(innerSelector), distance } };\n const lastFrame = [...nested.body.parsed.parts].reverse().find((part2) => part2.name === \"internal:control\" && part2.body === \"enter-frame\");\n const lastFrameIndex = lastFrame ? nested.body.parsed.parts.indexOf(lastFrame) : -1;\n if (lastFrameIndex !== -1 && selectorPartsEqual(nested.body.parsed.parts.slice(0, lastFrameIndex + 1), parts.slice(0, lastFrameIndex + 1)))\n nested.body.parsed.parts.splice(0, lastFrameIndex + 1);\n parts.push(nested);\n continue;\n }\n parts.push({ ...part, source: part.body });\n }\n if (kNestedSelectorNames.has(parts[0].name))\n throw new InvalidSelectorError(`\"${parts[0].name}\" selector cannot be first`);\n return {\n capture: parsedStrings.capture,\n parts\n };\n}\nfunction selectorPartsEqual(list1, list2) {\n return stringifySelector({ parts: list1 }) === stringifySelector({ parts: list2 });\n}\nfunction stringifySelector(selector, forceEngineName) {\n if (typeof selector === \"string\")\n return selector;\n return selector.parts.map((p, i) => {\n let includeEngine = true;\n if (!forceEngineName && i !== selector.capture) {\n if (p.name === \"css\")\n includeEngine = false;\n else if (p.name === \"xpath\" && p.source.startsWith(\"//\") || p.source.startsWith(\"..\"))\n includeEngine = false;\n }\n const prefix = includeEngine ? p.name + \"=\" : \"\";\n return `${i === selector.capture ? \"*\" : \"\"}${prefix}${p.source}`;\n }).join(\" >> \");\n}\nfunction visitAllSelectorParts(selector, visitor) {\n const visit = (selector2, nested) => {\n for (const part of selector2.parts) {\n visitor(part, nested);\n if (kNestedSelectorNames.has(part.name))\n visit(part.body.parsed, true);\n }\n };\n visit(selector, false);\n}\nfunction parseSelectorString(selector) {\n let index = 0;\n let quote;\n let start = 0;\n const result = { parts: [] };\n const append = () => {\n const part = selector.substring(start, index).trim();\n const eqIndex = part.indexOf(\"=\");\n let name;\n let body;\n if (eqIndex !== -1 && part.substring(0, eqIndex).trim().match(/^[a-zA-Z_0-9-+:*]+$/)) {\n name = part.substring(0, eqIndex).trim();\n body = part.substring(eqIndex + 1);\n } else if (part.length > 1 && part[0] === '\"' && part[part.length - 1] === '\"') {\n name = \"text\";\n body = part;\n } else if (part.length > 1 && part[0] === \"'\" && part[part.length - 1] === \"'\") {\n name = \"text\";\n body = part;\n } else if (/^\\(*\\/\\//.test(part) || part.startsWith(\"..\")) {\n name = \"xpath\";\n body = part;\n } else {\n name = \"css\";\n body = part;\n }\n let capture = false;\n if (name[0] === \"*\") {\n capture = true;\n name = name.substring(1);\n }\n result.parts.push({ name, body });\n if (capture) {\n if (result.capture !== void 0)\n throw new InvalidSelectorError(`Only one of the selectors can capture using * modifier`);\n result.capture = result.parts.length - 1;\n }\n };\n if (!selector.includes(\">>\")) {\n index = selector.length;\n append();\n return result;\n }\n const shouldIgnoreTextSelectorQuote = () => {\n const prefix = selector.substring(start, index);\n const match = prefix.match(/^\\s*text\\s*=(.*)$/);\n return !!match && !!match[1];\n };\n while (index < selector.length) {\n const c = selector[index];\n if (c === \"\\\\\" && index + 1 < selector.length) {\n index += 2;\n } else if (c === quote) {\n quote = void 0;\n index++;\n } else if (!quote && (c === '\"' || c === \"'\" || c === \"`\") && !shouldIgnoreTextSelectorQuote()) {\n quote = c;\n index++;\n } else if (!quote && c === \">\" && selector[index + 1] === \">\") {\n append();\n index += 2;\n start = index;\n } else {\n index++;\n }\n }\n append();\n return result;\n}\nfunction parseAttributeSelector(selector, allowUnquotedStrings) {\n let wp = 0;\n let EOL = selector.length === 0;\n const next = () => selector[wp] || \"\";\n const eat1 = () => {\n const result2 = next();\n ++wp;\n EOL = wp >= selector.length;\n return result2;\n };\n const syntaxError = (stage) => {\n if (EOL)\n throw new InvalidSelectorError(`Unexpected end of selector while parsing selector \\`${selector}\\``);\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - unexpected symbol \"${next()}\" at position ${wp}` + (stage ? \" during \" + stage : \"\"));\n };\n function skipSpaces() {\n while (!EOL && /\\s/.test(next()))\n eat1();\n }\n function isCSSNameChar(char) {\n return char >= \"\\x80\" || char >= \"0\" && char <= \"9\" || char >= \"A\" && char <= \"Z\" || char >= \"a\" && char <= \"z\" || char >= \"0\" && char <= \"9\" || char === \"_\" || char === \"-\";\n }\n function readIdentifier() {\n let result2 = \"\";\n skipSpaces();\n while (!EOL && isCSSNameChar(next()))\n result2 += eat1();\n return result2;\n }\n function readQuotedString(quote) {\n let result2 = eat1();\n if (result2 !== quote)\n syntaxError(\"parsing quoted string\");\n while (!EOL && next() !== quote) {\n if (next() === \"\\\\\")\n eat1();\n result2 += eat1();\n }\n if (next() !== quote)\n syntaxError(\"parsing quoted string\");\n result2 += eat1();\n return result2;\n }\n function readRegularExpression() {\n if (eat1() !== \"/\")\n syntaxError(\"parsing regular expression\");\n let source = \"\";\n let inClass = false;\n while (!EOL) {\n if (next() === \"\\\\\") {\n source += eat1();\n if (EOL)\n syntaxError(\"parsing regular expression\");\n } else if (inClass && next() === \"]\") {\n inClass = false;\n } else if (!inClass && next() === \"[\") {\n inClass = true;\n } else if (!inClass && next() === \"/\") {\n break;\n }\n source += eat1();\n }\n if (eat1() !== \"/\")\n syntaxError(\"parsing regular expression\");\n let flags = \"\";\n while (!EOL && next().match(/[dgimsuy]/))\n flags += eat1();\n try {\n return new RegExp(source, flags);\n } catch (e) {\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\`: ${e.message}`);\n }\n }\n function readAttributeToken() {\n let token = \"\";\n skipSpaces();\n if (next() === `'` || next() === `\"`)\n token = readQuotedString(next()).slice(1, -1);\n else\n token = readIdentifier();\n if (!token)\n syntaxError(\"parsing property path\");\n return token;\n }\n function readOperator() {\n skipSpaces();\n let op = \"\";\n if (!EOL)\n op += eat1();\n if (!EOL && op !== \"=\")\n op += eat1();\n if (![\"=\", \"*=\", \"^=\", \"$=\", \"|=\", \"~=\"].includes(op))\n syntaxError(\"parsing operator\");\n return op;\n }\n function readAttribute() {\n eat1();\n const jsonPath = [];\n jsonPath.push(readAttributeToken());\n skipSpaces();\n while (next() === \".\") {\n eat1();\n jsonPath.push(readAttributeToken());\n skipSpaces();\n }\n if (next() === \"]\") {\n eat1();\n return { name: jsonPath.join(\".\"), jsonPath, op: \"\", value: null, caseSensitive: false };\n }\n const operator = readOperator();\n let value = void 0;\n let caseSensitive = true;\n skipSpaces();\n if (next() === \"/\") {\n if (operator !== \"=\")\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with regular expression`);\n value = readRegularExpression();\n } else if (next() === `'` || next() === `\"`) {\n value = readQuotedString(next()).slice(1, -1);\n skipSpaces();\n if (next() === \"i\" || next() === \"I\") {\n caseSensitive = false;\n eat1();\n } else if (next() === \"s\" || next() === \"S\") {\n caseSensitive = true;\n eat1();\n }\n } else {\n value = \"\";\n while (!EOL && (isCSSNameChar(next()) || next() === \"+\" || next() === \".\"))\n value += eat1();\n if (value === \"true\") {\n value = true;\n } else if (value === \"false\") {\n value = false;\n } else {\n if (!allowUnquotedStrings) {\n value = +value;\n if (Number.isNaN(value))\n syntaxError(\"parsing attribute value\");\n }\n }\n }\n skipSpaces();\n if (next() !== \"]\")\n syntaxError(\"parsing attribute value\");\n eat1();\n if (operator !== \"=\" && typeof value !== \"string\")\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - cannot use ${operator} in attribute with non-string matching value - ${value}`);\n return { name: jsonPath.join(\".\"), jsonPath, op: operator, value, caseSensitive };\n }\n const result = {\n name: \"\",\n attributes: []\n };\n result.name = readIdentifier();\n skipSpaces();\n while (next() === \"[\") {\n result.attributes.push(readAttribute());\n skipSpaces();\n }\n if (!EOL)\n syntaxError(void 0);\n if (!result.name && !result.attributes.length)\n throw new InvalidSelectorError(`Error while parsing selector \\`${selector}\\` - selector cannot be empty`);\n return result;\n}\n\n// packages/playwright-core/src/server/injected/reactSelectorEngine.ts\nfunction getFunctionComponentName(component) {\n return component.displayName || component.name || \"Anonymous\";\n}\nfunction getComponentName(reactElement) {\n if (reactElement.type) {\n switch (typeof reactElement.type) {\n case \"function\":\n return getFunctionComponentName(reactElement.type);\n case \"string\":\n return reactElement.type;\n case \"object\":\n return reactElement.type.displayName || (reactElement.type.render ? getFunctionComponentName(reactElement.type.render) : \"\");\n }\n }\n if (reactElement._currentElement) {\n const elementType = reactElement._currentElement.type;\n if (typeof elementType === \"string\")\n return elementType;\n if (typeof elementType === \"function\")\n return elementType.displayName || elementType.name || \"Anonymous\";\n }\n return \"\";\n}\nfunction getComponentKey(reactElement) {\n var _a, _b;\n return (_b = reactElement.key) != null ? _b : (_a = reactElement._currentElement) == null ? void 0 : _a.key;\n}\nfunction getChildren(reactElement) {\n if (reactElement.child) {\n const children = [];\n for (let child = reactElement.child; child; child = child.sibling)\n children.push(child);\n return children;\n }\n if (!reactElement._currentElement)\n return [];\n const isKnownElement = (reactElement2) => {\n var _a;\n const elementType = (_a = reactElement2._currentElement) == null ? void 0 : _a.type;\n return typeof elementType === \"function\" || typeof elementType === \"string\";\n };\n if (reactElement._renderedComponent) {\n const child = reactElement._renderedComponent;\n return isKnownElement(child) ? [child] : [];\n }\n if (reactElement._renderedChildren)\n return [...Object.values(reactElement._renderedChildren)].filter(isKnownElement);\n return [];\n}\nfunction getProps(reactElement) {\n var _a;\n const props = (\n // React 16+\n reactElement.memoizedProps || // React 15\n ((_a = reactElement._currentElement) == null ? void 0 : _a.props)\n );\n if (!props || typeof props === \"string\")\n return props;\n const result = { ...props };\n delete result.children;\n return result;\n}\nfunction buildComponentsTree(reactElement) {\n var _a;\n const treeNode = {\n key: getComponentKey(reactElement),\n name: getComponentName(reactElement),\n children: getChildren(reactElement).map(buildComponentsTree),\n rootElements: [],\n props: getProps(reactElement)\n };\n const rootElement = (\n // React 16+\n // @see https://github.com/baruchvlz/resq/blob/5c15a5e04d3f7174087248f5a158c3d6dcc1ec72/src/utils.js#L29\n reactElement.stateNode || // React 15\n reactElement._hostNode || ((_a = reactElement._renderedComponent) == null ? void 0 : _a._hostNode)\n );\n if (rootElement instanceof Element) {\n treeNode.rootElements.push(rootElement);\n } else {\n for (const child of treeNode.children)\n treeNode.rootElements.push(...child.rootElements);\n }\n return treeNode;\n}\nfunction filterComponentsTree(treeNode, searchFn, result = []) {\n if (searchFn(treeNode))\n result.push(treeNode);\n for (const child of treeNode.children)\n filterComponentsTree(child, searchFn, result);\n return result;\n}\nfunction findReactRoots(root, roots = []) {\n const document = root.ownerDocument || root;\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);\n do {\n const node = walker.currentNode;\n const reactNode = node;\n const rootKey = Object.keys(reactNode).find((key) => key.startsWith(\"__reactContainer\") && reactNode[key] !== null);\n if (rootKey) {\n roots.push(reactNode[rootKey].stateNode.current);\n } else {\n const legacyRootKey = \"_reactRootContainer\";\n if (reactNode.hasOwnProperty(legacyRootKey) && reactNode[legacyRootKey] !== null) {\n roots.push(reactNode[legacyRootKey]._internalRoot.current);\n }\n }\n if (node instanceof Element && node.hasAttribute(\"data-reactroot\")) {\n for (const key of Object.keys(node)) {\n if (key.startsWith(\"__reactInternalInstance\") || key.startsWith(\"__reactFiber\"))\n roots.push(node[key]);\n }\n }\n const shadowRoot = node instanceof Element ? node.shadowRoot : null;\n if (shadowRoot)\n findReactRoots(shadowRoot, roots);\n } while (walker.nextNode());\n return roots;\n}\nvar ReactEngine = {\n queryAll(scope, selector) {\n const { name, attributes } = parseAttributeSelector(selector, false);\n const reactRoots = findReactRoots(scope.ownerDocument || scope);\n const trees = reactRoots.map((reactRoot) => buildComponentsTree(reactRoot));\n const treeNodes = trees.map((tree) => filterComponentsTree(tree, (treeNode) => {\n var _a;\n const props = (_a = treeNode.props) != null ? _a : {};\n if (treeNode.key !== void 0)\n props.key = treeNode.key;\n if (name && treeNode.name !== name)\n return false;\n if (treeNode.rootElements.some((domNode) => !isInsideScope(scope, domNode)))\n return false;\n for (const attr of attributes) {\n if (!matchesComponentAttribute(props, attr))\n return false;\n }\n return true;\n })).flat();\n const allRootElements = /* @__PURE__ */ new Set();\n for (const treeNode of treeNodes) {\n for (const domNode of treeNode.rootElements)\n allRootElements.add(domNode);\n }\n return [...allRootElements];\n }\n};\n\n// packages/playwright-core/src/server/injected/vueSelectorEngine.ts\nfunction basename(filename, ext) {\n const normalized = filename.replace(/^[a-zA-Z]:/, \"\").replace(/\\\\/g, \"/\");\n let result = normalized.substring(normalized.lastIndexOf(\"/\") + 1);\n if (ext && result.endsWith(ext))\n result = result.substring(0, result.length - ext.length);\n return result;\n}\nfunction toUpper(_, c) {\n return c ? c.toUpperCase() : \"\";\n}\nvar classifyRE = /(?:^|[-_/])(\\w)/g;\nvar classify = (str) => {\n return str && str.replace(classifyRE, toUpper);\n};\nfunction buildComponentsTreeVue3(instance) {\n function getComponentTypeName(options) {\n const name = options.name || options._componentTag || options.__playwright_guessedName;\n if (name)\n return name;\n const file = options.__file;\n if (file)\n return classify(basename(file, \".vue\"));\n }\n function saveComponentName(instance2, key) {\n instance2.type.__playwright_guessedName = key;\n return key;\n }\n function getInstanceName(instance2) {\n var _a, _b, _c, _d;\n const name = getComponentTypeName(instance2.type || {});\n if (name)\n return name;\n if (instance2.root === instance2)\n return \"Root\";\n for (const key in (_b = (_a = instance2.parent) == null ? void 0 : _a.type) == null ? void 0 : _b.components) {\n if (((_c = instance2.parent) == null ? void 0 : _c.type.components[key]) === instance2.type)\n return saveComponentName(instance2, key);\n }\n for (const key in (_d = instance2.appContext) == null ? void 0 : _d.components) {\n if (instance2.appContext.components[key] === instance2.type)\n return saveComponentName(instance2, key);\n }\n return \"Anonymous Component\";\n }\n function isBeingDestroyed(instance2) {\n return instance2._isBeingDestroyed || instance2.isUnmounted;\n }\n function isFragment(instance2) {\n return instance2.subTree.type.toString() === \"Symbol(Fragment)\";\n }\n function getInternalInstanceChildren(subTree) {\n const list = [];\n if (subTree.component)\n list.push(subTree.component);\n if (subTree.suspense)\n list.push(...getInternalInstanceChildren(subTree.suspense.activeBranch));\n if (Array.isArray(subTree.children)) {\n subTree.children.forEach((childSubTree) => {\n if (childSubTree.component)\n list.push(childSubTree.component);\n else\n list.push(...getInternalInstanceChildren(childSubTree));\n });\n }\n return list.filter((child) => {\n var _a;\n return !isBeingDestroyed(child) && !((_a = child.type.devtools) == null ? void 0 : _a.hide);\n });\n }\n function getRootElementsFromComponentInstance(instance2) {\n if (isFragment(instance2))\n return getFragmentRootElements(instance2.subTree);\n return [instance2.subTree.el];\n }\n function getFragmentRootElements(vnode) {\n if (!vnode.children)\n return [];\n const list = [];\n for (let i = 0, l = vnode.children.length; i < l; i++) {\n const childVnode = vnode.children[i];\n if (childVnode.component)\n list.push(...getRootElementsFromComponentInstance(childVnode.component));\n else if (childVnode.el)\n list.push(childVnode.el);\n }\n return list;\n }\n function buildComponentsTree2(instance2) {\n return {\n name: getInstanceName(instance2),\n children: getInternalInstanceChildren(instance2.subTree).map(buildComponentsTree2),\n rootElements: getRootElementsFromComponentInstance(instance2),\n props: instance2.props\n };\n }\n return buildComponentsTree2(instance);\n}\nfunction buildComponentsTreeVue2(instance) {\n function getComponentName2(options) {\n const name = options.displayName || options.name || options._componentTag;\n if (name)\n return name;\n const file = options.__file;\n if (file)\n return classify(basename(file, \".vue\"));\n }\n function getInstanceName(instance2) {\n const name = getComponentName2(instance2.$options || instance2.fnOptions || {});\n if (name)\n return name;\n return instance2.$root === instance2 ? \"Root\" : \"Anonymous Component\";\n }\n function getInternalInstanceChildren(instance2) {\n if (instance2.$children)\n return instance2.$children;\n if (Array.isArray(instance2.subTree.children))\n return instance2.subTree.children.filter((vnode) => !!vnode.component).map((vnode) => vnode.component);\n return [];\n }\n function buildComponentsTree2(instance2) {\n return {\n name: getInstanceName(instance2),\n children: getInternalInstanceChildren(instance2).map(buildComponentsTree2),\n rootElements: [instance2.$el],\n props: instance2._props\n };\n }\n return buildComponentsTree2(instance);\n}\nfunction filterComponentsTree2(treeNode, searchFn, result = []) {\n if (searchFn(treeNode))\n result.push(treeNode);\n for (const child of treeNode.children)\n filterComponentsTree2(child, searchFn, result);\n return result;\n}\nfunction findVueRoots(root, roots = []) {\n const document = root.ownerDocument || root;\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT);\n const vue2Roots = /* @__PURE__ */ new Set();\n do {\n const node = walker.currentNode;\n if (node.__vue__)\n vue2Roots.add(node.__vue__.$root);\n if (node.__vue_app__ && node._vnode && node._vnode.component)\n roots.push({ root: node._vnode.component, version: 3 });\n const shadowRoot = node instanceof Element ? node.shadowRoot : null;\n if (shadowRoot)\n findVueRoots(shadowRoot, roots);\n } while (walker.nextNode());\n for (const vue2root of vue2Roots) {\n roots.push({\n version: 2,\n root: vue2root\n });\n }\n return roots;\n}\nvar VueEngine = {\n queryAll(scope, selector) {\n const document = scope.ownerDocument || scope;\n const { name, attributes } = parseAttributeSelector(selector, false);\n const vueRoots = findVueRoots(document);\n const trees = vueRoots.map((vueRoot) => vueRoot.version === 3 ? buildComponentsTreeVue3(vueRoot.root) : buildComponentsTreeVue2(vueRoot.root));\n const treeNodes = trees.map((tree) => filterComponentsTree2(tree, (treeNode) => {\n if (name && treeNode.name !== name)\n return false;\n if (treeNode.rootElements.some((rootElement) => !isInsideScope(scope, rootElement)))\n return false;\n for (const attr of attributes) {\n if (!matchesComponentAttribute(treeNode.props, attr))\n return false;\n }\n return true;\n })).flat();\n const allRootElements = /* @__PURE__ */ new Set();\n for (const treeNode of treeNodes) {\n for (const rootElement of treeNode.rootElements)\n allRootElements.add(rootElement);\n }\n return [...allRootElements];\n }\n};\n\n// packages/playwright-core/src/server/injected/roleSelectorEngine.ts\nvar kSupportedAttributes = [\"selected\", \"checked\", \"pressed\", \"expanded\", \"level\", \"disabled\", \"name\", \"include-hidden\"];\nkSupportedAttributes.sort();\nfunction validateSupportedRole(attr, roles, role) {\n if (!roles.includes(role))\n throw new Error(`\"${attr}\" attribute is only supported for roles: ${roles.slice().sort().map((role2) => `\"${role2}\"`).join(\", \")}`);\n}\nfunction validateSupportedValues(attr, values) {\n if (attr.op !== \"\" && !values.includes(attr.value))\n throw new Error(`\"${attr.name}\" must be one of ${values.map((v) => JSON.stringify(v)).join(\", \")}`);\n}\nfunction validateSupportedOp(attr, ops) {\n if (!ops.includes(attr.op))\n throw new Error(`\"${attr.name}\" does not support \"${attr.op}\" matcher`);\n}\nfunction validateAttributes(attrs, role) {\n const options = { role };\n for (const attr of attrs) {\n switch (attr.name) {\n case \"checked\": {\n validateSupportedRole(attr.name, kAriaCheckedRoles, role);\n validateSupportedValues(attr, [true, false, \"mixed\"]);\n validateSupportedOp(attr, [\"\", \"=\"]);\n options.checked = attr.op === \"\" ? true : attr.value;\n break;\n }\n case \"pressed\": {\n validateSupportedRole(attr.name, kAriaPressedRoles, role);\n validateSupportedValues(attr, [true, false, \"mixed\"]);\n validateSupportedOp(attr, [\"\", \"=\"]);\n options.pressed = attr.op === \"\" ? true : attr.value;\n break;\n }\n case \"selected\": {\n validateSupportedRole(attr.name, kAriaSelectedRoles, role);\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, [\"\", \"=\"]);\n options.selected = attr.op === \"\" ? true : attr.value;\n break;\n }\n case \"expanded\": {\n validateSupportedRole(attr.name, kAriaExpandedRoles, role);\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, [\"\", \"=\"]);\n options.expanded = attr.op === \"\" ? true : attr.value;\n break;\n }\n case \"level\": {\n validateSupportedRole(attr.name, kAriaLevelRoles, role);\n if (typeof attr.value === \"string\")\n attr.value = +attr.value;\n if (attr.op !== \"=\" || typeof attr.value !== \"number\" || Number.isNaN(attr.value))\n throw new Error(`\"level\" attribute must be compared to a number`);\n options.level = attr.value;\n break;\n }\n case \"disabled\": {\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, [\"\", \"=\"]);\n options.disabled = attr.op === \"\" ? true : attr.value;\n break;\n }\n case \"name\": {\n if (attr.op === \"\")\n throw new Error(`\"name\" attribute must have a value`);\n if (typeof attr.value !== \"string\" && !(attr.value instanceof RegExp))\n throw new Error(`\"name\" attribute must be a string or a regular expression`);\n options.name = attr.value;\n options.nameOp = attr.op;\n options.exact = attr.caseSensitive;\n break;\n }\n case \"include-hidden\": {\n validateSupportedValues(attr, [true, false]);\n validateSupportedOp(attr, [\"\", \"=\"]);\n options.includeHidden = attr.op === \"\" ? true : attr.value;\n break;\n }\n default: {\n throw new Error(`Unknown attribute \"${attr.name}\", must be one of ${kSupportedAttributes.map((a) => `\"${a}\"`).join(\", \")}.`);\n }\n }\n }\n return options;\n}\nfunction queryRole(scope, options, internal) {\n const result = [];\n const match = (element) => {\n if (getAriaRole(element) !== options.role)\n return;\n if (options.selected !== void 0 && getAriaSelected(element) !== options.selected)\n return;\n if (options.checked !== void 0 && getAriaChecked(element) !== options.checked)\n return;\n if (options.pressed !== void 0 && getAriaPressed(element) !== options.pressed)\n return;\n if (options.expanded !== void 0 && getAriaExpanded(element) !== options.expanded)\n return;\n if (options.level !== void 0 && getAriaLevel(element) !== options.level)\n return;\n if (options.disabled !== void 0 && getAriaDisabled(element) !== options.disabled)\n return;\n if (!options.includeHidden) {\n const isHidden = isElementHiddenForAria(element);\n if (isHidden)\n return;\n }\n if (options.name !== void 0) {\n const accessibleName = normalizeWhiteSpace(getElementAccessibleName(element, !!options.includeHidden));\n if (typeof options.name === \"string\")\n options.name = normalizeWhiteSpace(options.name);\n if (internal && !options.exact && options.nameOp === \"=\")\n options.nameOp = \"*=\";\n if (!matchesAttributePart(accessibleName, { name: \"\", jsonPath: [], op: options.nameOp || \"=\", value: options.name, caseSensitive: !!options.exact }))\n return;\n }\n result.push(element);\n };\n const query = (root) => {\n const shadows = [];\n if (root.shadowRoot)\n shadows.push(root.shadowRoot);\n for (const element of root.querySelectorAll(\"*\")) {\n match(element);\n if (element.shadowRoot)\n shadows.push(element.shadowRoot);\n }\n shadows.forEach(query);\n };\n query(scope);\n return result;\n}\nfunction createRoleEngine(internal) {\n return {\n queryAll: (scope, selector) => {\n const parsed = parseAttributeSelector(selector, true);\n const role = parsed.name.toLowerCase();\n if (!role)\n throw new Error(`Role must not be empty`);\n const options = validateAttributes(parsed.attributes, role);\n beginAriaCaches();\n try {\n return queryRole(scope, options, internal);\n } finally {\n endAriaCaches();\n }\n }\n };\n}\n\n// packages/playwright-core/src/server/injected/layoutSelectorUtils.ts\nfunction boxRightOf(box1, box2, maxDistance) {\n const distance = box1.left - box2.right;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box2.bottom - box1.bottom, 0) + Math.max(box1.top - box2.top, 0);\n}\nfunction boxLeftOf(box1, box2, maxDistance) {\n const distance = box2.left - box1.right;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box2.bottom - box1.bottom, 0) + Math.max(box1.top - box2.top, 0);\n}\nfunction boxAbove(box1, box2, maxDistance) {\n const distance = box2.top - box1.bottom;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box1.left - box2.left, 0) + Math.max(box2.right - box1.right, 0);\n}\nfunction boxBelow(box1, box2, maxDistance) {\n const distance = box1.top - box2.bottom;\n if (distance < 0 || maxDistance !== void 0 && distance > maxDistance)\n return;\n return distance + Math.max(box1.left - box2.left, 0) + Math.max(box2.right - box1.right, 0);\n}\nfunction boxNear(box1, box2, maxDistance) {\n const kThreshold = maxDistance === void 0 ? 50 : maxDistance;\n let score = 0;\n if (box1.left - box2.right >= 0)\n score += box1.left - box2.right;\n if (box2.left - box1.right >= 0)\n score += box2.left - box1.right;\n if (box2.top - box1.bottom >= 0)\n score += box2.top - box1.bottom;\n if (box1.top - box2.bottom >= 0)\n score += box1.top - box2.bottom;\n return score > kThreshold ? void 0 : score;\n}\nvar kLayoutSelectorNames = [\"left-of\", \"right-of\", \"above\", \"below\", \"near\"];\nfunction layoutSelectorScore(name, element, inner, maxDistance) {\n const box = element.getBoundingClientRect();\n const scorer = { \"left-of\": boxLeftOf, \"right-of\": boxRightOf, \"above\": boxAbove, \"below\": boxBelow, \"near\": boxNear }[name];\n let bestScore;\n for (const e of inner) {\n if (e === element)\n continue;\n const score = scorer(box, e.getBoundingClientRect(), maxDistance);\n if (score === void 0)\n continue;\n if (bestScore === void 0 || score < bestScore)\n bestScore = score;\n }\n return bestScore;\n}\n\n// packages/playwright-core/src/server/injected/selectorEvaluator.ts\nvar SelectorEvaluatorImpl = class {\n constructor(extraEngines) {\n this._engines = /* @__PURE__ */ new Map();\n this._cacheQueryCSS = /* @__PURE__ */ new Map();\n this._cacheMatches = /* @__PURE__ */ new Map();\n this._cacheQuery = /* @__PURE__ */ new Map();\n this._cacheMatchesSimple = /* @__PURE__ */ new Map();\n this._cacheMatchesParents = /* @__PURE__ */ new Map();\n this._cacheCallMatches = /* @__PURE__ */ new Map();\n this._cacheCallQuery = /* @__PURE__ */ new Map();\n this._cacheQuerySimple = /* @__PURE__ */ new Map();\n this._cacheText = /* @__PURE__ */ new Map();\n this._retainCacheCounter = 0;\n for (const [name, engine] of extraEngines)\n this._engines.set(name, engine);\n this._engines.set(\"not\", notEngine);\n this._engines.set(\"is\", isEngine);\n this._engines.set(\"where\", isEngine);\n this._engines.set(\"has\", hasEngine);\n this._engines.set(\"scope\", scopeEngine);\n this._engines.set(\"light\", lightEngine);\n this._engines.set(\"visible\", visibleEngine);\n this._engines.set(\"text\", textEngine);\n this._engines.set(\"text-is\", textIsEngine);\n this._engines.set(\"text-matches\", textMatchesEngine);\n this._engines.set(\"has-text\", hasTextEngine);\n this._engines.set(\"right-of\", createLayoutEngine(\"right-of\"));\n this._engines.set(\"left-of\", createLayoutEngine(\"left-of\"));\n this._engines.set(\"above\", createLayoutEngine(\"above\"));\n this._engines.set(\"below\", createLayoutEngine(\"below\"));\n this._engines.set(\"near\", createLayoutEngine(\"near\"));\n this._engines.set(\"nth-match\", nthMatchEngine);\n const allNames = [...this._engines.keys()];\n allNames.sort();\n const parserNames = [...customCSSNames];\n parserNames.sort();\n if (allNames.join(\"|\") !== parserNames.join(\"|\"))\n throw new Error(`Please keep customCSSNames in sync with evaluator engines: ${allNames.join(\"|\")} vs ${parserNames.join(\"|\")}`);\n }\n begin() {\n ++this._retainCacheCounter;\n }\n end() {\n --this._retainCacheCounter;\n if (!this._retainCacheCounter) {\n this._cacheQueryCSS.clear();\n this._cacheMatches.clear();\n this._cacheQuery.clear();\n this._cacheMatchesSimple.clear();\n this._cacheMatchesParents.clear();\n this._cacheCallMatches.clear();\n this._cacheCallQuery.clear();\n this._cacheQuerySimple.clear();\n this._cacheText.clear();\n }\n }\n _cached(cache, main, rest, cb) {\n if (!cache.has(main))\n cache.set(main, []);\n const entries = cache.get(main);\n const entry = entries.find((e) => rest.every((value, index) => e.rest[index] === value));\n if (entry)\n return entry.result;\n const result = cb();\n entries.push({ rest, result });\n return result;\n }\n _checkSelector(s) {\n const wellFormed = typeof s === \"object\" && s && (Array.isArray(s) || \"simples\" in s && s.simples.length);\n if (!wellFormed)\n throw new Error(`Malformed selector \"${s}\"`);\n return s;\n }\n matches(element, s, context) {\n const selector = this._checkSelector(s);\n this.begin();\n try {\n return this._cached(this._cacheMatches, element, [selector, context.scope, context.pierceShadow, context.originalScope], () => {\n if (Array.isArray(selector))\n return this._matchesEngine(isEngine, element, selector, context);\n if (this._hasScopeClause(selector))\n context = this._expandContextForScopeMatching(context);\n if (!this._matchesSimple(element, selector.simples[selector.simples.length - 1].selector, context))\n return false;\n return this._matchesParents(element, selector, selector.simples.length - 2, context);\n });\n } finally {\n this.end();\n }\n }\n query(context, s) {\n const selector = this._checkSelector(s);\n this.begin();\n try {\n return this._cached(this._cacheQuery, selector, [context.scope, context.pierceShadow, context.originalScope], () => {\n if (Array.isArray(selector))\n return this._queryEngine(isEngine, context, selector);\n if (this._hasScopeClause(selector))\n context = this._expandContextForScopeMatching(context);\n const previousScoreMap = this._scoreMap;\n this._scoreMap = /* @__PURE__ */ new Map();\n let elements = this._querySimple(context, selector.simples[selector.simples.length - 1].selector);\n elements = elements.filter((element) => this._matchesParents(element, selector, selector.simples.length - 2, context));\n if (this._scoreMap.size) {\n elements.sort((a, b) => {\n const aScore = this._scoreMap.get(a);\n const bScore = this._scoreMap.get(b);\n if (aScore === bScore)\n return 0;\n if (aScore === void 0)\n return 1;\n if (bScore === void 0)\n return -1;\n return aScore - bScore;\n });\n }\n this._scoreMap = previousScoreMap;\n return elements;\n });\n } finally {\n this.end();\n }\n }\n _markScore(element, score) {\n if (this._scoreMap)\n this._scoreMap.set(element, score);\n }\n _hasScopeClause(selector) {\n return selector.simples.some((simple) => simple.selector.functions.some((f) => f.name === \"scope\"));\n }\n _expandContextForScopeMatching(context) {\n if (context.scope.nodeType !== 1)\n return context;\n const scope = parentElementOrShadowHost(context.scope);\n if (!scope)\n return context;\n return { ...context, scope, originalScope: context.originalScope || context.scope };\n }\n _matchesSimple(element, simple, context) {\n return this._cached(this._cacheMatchesSimple, element, [simple, context.scope, context.pierceShadow, context.originalScope], () => {\n if (element === context.scope)\n return false;\n if (simple.css && !this._matchesCSS(element, simple.css))\n return false;\n for (const func of simple.functions) {\n if (!this._matchesEngine(this._getEngine(func.name), element, func.args, context))\n return false;\n }\n return true;\n });\n }\n _querySimple(context, simple) {\n if (!simple.functions.length)\n return this._queryCSS(context, simple.css || \"*\");\n return this._cached(this._cacheQuerySimple, simple, [context.scope, context.pierceShadow, context.originalScope], () => {\n let css = simple.css;\n const funcs = simple.functions;\n if (css === \"*\" && funcs.length)\n css = void 0;\n let elements;\n let firstIndex = -1;\n if (css !== void 0) {\n elements = this._queryCSS(context, css);\n } else {\n firstIndex = funcs.findIndex((func) => this._getEngine(func.name).query !== void 0);\n if (firstIndex === -1)\n firstIndex = 0;\n elements = this._queryEngine(this._getEngine(funcs[firstIndex].name), context, funcs[firstIndex].args);\n }\n for (let i = 0; i < funcs.length; i++) {\n if (i === firstIndex)\n continue;\n const engine = this._getEngine(funcs[i].name);\n if (engine.matches !== void 0)\n elements = elements.filter((e) => this._matchesEngine(engine, e, funcs[i].args, context));\n }\n for (let i = 0; i < funcs.length; i++) {\n if (i === firstIndex)\n continue;\n const engine = this._getEngine(funcs[i].name);\n if (engine.matches === void 0)\n elements = elements.filter((e) => this._matchesEngine(engine, e, funcs[i].args, context));\n }\n return elements;\n });\n }\n _matchesParents(element, complex, index, context) {\n if (index < 0)\n return true;\n return this._cached(this._cacheMatchesParents, element, [complex, index, context.scope, context.pierceShadow, context.originalScope], () => {\n const { selector: simple, combinator } = complex.simples[index];\n if (combinator === \">\") {\n const parent = parentElementOrShadowHostInContext(element, context);\n if (!parent || !this._matchesSimple(parent, simple, context))\n return false;\n return this._matchesParents(parent, complex, index - 1, context);\n }\n if (combinator === \"+\") {\n const previousSibling = previousSiblingInContext(element, context);\n if (!previousSibling || !this._matchesSimple(previousSibling, simple, context))\n return false;\n return this._matchesParents(previousSibling, complex, index - 1, context);\n }\n if (combinator === \"\") {\n let parent = parentElementOrShadowHostInContext(element, context);\n while (parent) {\n if (this._matchesSimple(parent, simple, context)) {\n if (this._matchesParents(parent, complex, index - 1, context))\n return true;\n if (complex.simples[index - 1].combinator === \"\")\n break;\n }\n parent = parentElementOrShadowHostInContext(parent, context);\n }\n return false;\n }\n if (combinator === \"~\") {\n let previousSibling = previousSiblingInContext(element, context);\n while (previousSibling) {\n if (this._matchesSimple(previousSibling, simple, context)) {\n if (this._matchesParents(previousSibling, complex, index - 1, context))\n return true;\n if (complex.simples[index - 1].combinator === \"~\")\n break;\n }\n previousSibling = previousSiblingInContext(previousSibling, context);\n }\n return false;\n }\n if (combinator === \">=\") {\n let parent = element;\n while (parent) {\n if (this._matchesSimple(parent, simple, context)) {\n if (this._matchesParents(parent, complex, index - 1, context))\n return true;\n if (complex.simples[index - 1].combinator === \"\")\n break;\n }\n parent = parentElementOrShadowHostInContext(parent, context);\n }\n return false;\n }\n throw new Error(`Unsupported combinator \"${combinator}\"`);\n });\n }\n _matchesEngine(engine, element, args, context) {\n if (engine.matches)\n return this._callMatches(engine, element, args, context);\n if (engine.query)\n return this._callQuery(engine, args, context).includes(element);\n throw new Error(`Selector engine should implement \"matches\" or \"query\"`);\n }\n _queryEngine(engine, context, args) {\n if (engine.query)\n return this._callQuery(engine, args, context);\n if (engine.matches)\n return this._queryCSS(context, \"*\").filter((element) => this._callMatches(engine, element, args, context));\n throw new Error(`Selector engine should implement \"matches\" or \"query\"`);\n }\n _callMatches(engine, element, args, context) {\n return this._cached(this._cacheCallMatches, element, [engine, context.scope, context.pierceShadow, context.originalScope, ...args], () => {\n return engine.matches(element, args, context, this);\n });\n }\n _callQuery(engine, args, context) {\n return this._cached(this._cacheCallQuery, engine, [context.scope, context.pierceShadow, context.originalScope, ...args], () => {\n return engine.query(context, args, this);\n });\n }\n _matchesCSS(element, css) {\n return element.matches(css);\n }\n _queryCSS(context, css) {\n return this._cached(this._cacheQueryCSS, css, [context.scope, context.pierceShadow, context.originalScope], () => {\n let result = [];\n function query(root) {\n result = result.concat([...root.querySelectorAll(css)]);\n if (!context.pierceShadow)\n return;\n if (root.shadowRoot)\n query(root.shadowRoot);\n for (const element of root.querySelectorAll(\"*\")) {\n if (element.shadowRoot)\n query(element.shadowRoot);\n }\n }\n query(context.scope);\n return result;\n });\n }\n _getEngine(name) {\n const engine = this._engines.get(name);\n if (!engine)\n throw new Error(`Unknown selector engine \"${name}\"`);\n return engine;\n }\n};\nvar isEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0)\n throw new Error(`\"is\" engine expects non-empty selector list`);\n return args.some((selector) => evaluator.matches(element, selector, context));\n },\n query(context, args, evaluator) {\n if (args.length === 0)\n throw new Error(`\"is\" engine expects non-empty selector list`);\n let elements = [];\n for (const arg of args)\n elements = elements.concat(evaluator.query(context, arg));\n return args.length === 1 ? elements : sortInDOMOrder(elements);\n }\n};\nvar hasEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0)\n throw new Error(`\"has\" engine expects non-empty selector list`);\n return evaluator.query({ ...context, scope: element }, args).length > 0;\n }\n // TODO: we can implement efficient \"query\" by matching \"args\" and returning\n // all parents/descendants, just have to be careful with the \":scope\" matching.\n};\nvar scopeEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 0)\n throw new Error(`\"scope\" engine expects no arguments`);\n const actualScope = context.originalScope || context.scope;\n if (actualScope.nodeType === 9)\n return element === actualScope.documentElement;\n return element === actualScope;\n },\n query(context, args, evaluator) {\n if (args.length !== 0)\n throw new Error(`\"scope\" engine expects no arguments`);\n const actualScope = context.originalScope || context.scope;\n if (actualScope.nodeType === 9) {\n const root = actualScope.documentElement;\n return root ? [root] : [];\n }\n if (actualScope.nodeType === 1)\n return [actualScope];\n return [];\n }\n};\nvar notEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0)\n throw new Error(`\"not\" engine expects non-empty selector list`);\n return !evaluator.matches(element, args, context);\n }\n};\nvar lightEngine = {\n query(context, args, evaluator) {\n return evaluator.query({ ...context, pierceShadow: false }, args);\n },\n matches(element, args, context, evaluator) {\n return evaluator.matches(element, args, { ...context, pierceShadow: false });\n }\n};\nvar visibleEngine = {\n matches(element, args, context, evaluator) {\n if (args.length)\n throw new Error(`\"visible\" engine expects no arguments`);\n return isElementVisible(element);\n }\n};\nvar textEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 1 || typeof args[0] !== \"string\")\n throw new Error(`\"text\" engine expects a single string`);\n const text = normalizeWhiteSpace(args[0]).toLowerCase();\n const matcher = (elementText2) => elementText2.normalized.toLowerCase().includes(text);\n return elementMatchesText(evaluator._cacheText, element, matcher) === \"self\";\n }\n};\nvar textIsEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 1 || typeof args[0] !== \"string\")\n throw new Error(`\"text-is\" engine expects a single string`);\n const text = normalizeWhiteSpace(args[0]);\n const matcher = (elementText2) => {\n if (!text && !elementText2.immediate.length)\n return true;\n return elementText2.immediate.some((s) => normalizeWhiteSpace(s) === text);\n };\n return elementMatchesText(evaluator._cacheText, element, matcher) !== \"none\";\n }\n};\nvar textMatchesEngine = {\n matches(element, args, context, evaluator) {\n if (args.length === 0 || typeof args[0] !== \"string\" || args.length > 2 || args.length === 2 && typeof args[1] !== \"string\")\n throw new Error(`\"text-matches\" engine expects a regexp body and optional regexp flags`);\n const re = new RegExp(args[0], args.length === 2 ? args[1] : void 0);\n const matcher = (elementText2) => re.test(elementText2.full);\n return elementMatchesText(evaluator._cacheText, element, matcher) === \"self\";\n }\n};\nvar hasTextEngine = {\n matches(element, args, context, evaluator) {\n if (args.length !== 1 || typeof args[0] !== \"string\")\n throw new Error(`\"has-text\" engine expects a single string`);\n if (shouldSkipForTextMatching(element))\n return false;\n const text = normalizeWhiteSpace(args[0]).toLowerCase();\n const matcher = (elementText2) => elementText2.normalized.toLowerCase().includes(text);\n return matcher(elementText(evaluator._cacheText, element));\n }\n};\nfunction createLayoutEngine(name) {\n return {\n matches(element, args, context, evaluator) {\n const maxDistance = args.length && typeof args[args.length - 1] === \"number\" ? args[args.length - 1] : void 0;\n const queryArgs = maxDistance === void 0 ? args : args.slice(0, args.length - 1);\n if (args.length < 1 + (maxDistance === void 0 ? 0 : 1))\n throw new Error(`\"${name}\" engine expects a selector list and optional maximum distance in pixels`);\n const inner = evaluator.query(context, queryArgs);\n const score = layoutSelectorScore(name, element, inner, maxDistance);\n if (score === void 0)\n return false;\n evaluator._markScore(element, score);\n return true;\n }\n };\n}\nvar nthMatchEngine = {\n query(context, args, evaluator) {\n let index = args[args.length - 1];\n if (args.length < 2)\n throw new Error(`\"nth-match\" engine expects non-empty selector list and an index argument`);\n if (typeof index !== \"number\" || index < 1)\n throw new Error(`\"nth-match\" engine expects a one-based index as the last argument`);\n const elements = isEngine.query(context, args.slice(0, args.length - 1), evaluator);\n index--;\n return index < elements.length ? [elements[index]] : [];\n }\n};\nfunction parentElementOrShadowHostInContext(element, context) {\n if (element === context.scope)\n return;\n if (!context.pierceShadow)\n return element.parentElement || void 0;\n return parentElementOrShadowHost(element);\n}\nfunction previousSiblingInContext(element, context) {\n if (element === context.scope)\n return;\n return element.previousElementSibling || void 0;\n}\nfunction sortInDOMOrder(elements) {\n const elementToEntry = /* @__PURE__ */ new Map();\n const roots = [];\n const result = [];\n function append(element) {\n let entry = elementToEntry.get(element);\n if (entry)\n return entry;\n const parent = parentElementOrShadowHost(element);\n if (parent) {\n const parentEntry = append(parent);\n parentEntry.children.push(element);\n } else {\n roots.push(element);\n }\n entry = { children: [], taken: false };\n elementToEntry.set(element, entry);\n return entry;\n }\n for (const e of elements)\n append(e).taken = true;\n function visit(element) {\n const entry = elementToEntry.get(element);\n if (entry.taken)\n result.push(element);\n if (entry.children.length > 1) {\n const set = new Set(entry.children);\n entry.children = [];\n let child = element.firstElementChild;\n while (child && entry.children.length < set.size) {\n if (set.has(child))\n entry.children.push(child);\n child = child.nextElementSibling;\n }\n child = element.shadowRoot ? element.shadowRoot.firstElementChild : null;\n while (child && entry.children.length < set.size) {\n if (set.has(child))\n entry.children.push(child);\n child = child.nextElementSibling;\n }\n }\n entry.children.forEach(visit);\n }\n roots.forEach(visit);\n return result;\n}\n\n// packages/playwright-core/src/server/injected/selectorGenerator.ts\nvar cacheAllowText = /* @__PURE__ */ new Map();\nvar cacheDisallowText = /* @__PURE__ */ new Map();\nvar kTextScoreRange = 10;\nvar kExactPenalty = kTextScoreRange / 2;\nvar kTestIdScore = 1;\nvar kOtherTestIdScore = 2;\nvar kIframeByAttributeScore = 10;\nvar kBeginPenalizedScore = 50;\nvar kPlaceholderScore = 100;\nvar kLabelScore = 120;\nvar kRoleWithNameScore = 140;\nvar kAltTextScore = 160;\nvar kTextScore = 180;\nvar kTitleScore = 200;\nvar kTextScoreRegex = 250;\nvar kPlaceholderScoreExact = kPlaceholderScore + kExactPenalty;\nvar kLabelScoreExact = kLabelScore + kExactPenalty;\nvar kRoleWithNameScoreExact = kRoleWithNameScore + kExactPenalty;\nvar kAltTextScoreExact = kAltTextScore + kExactPenalty;\nvar kTextScoreExact = kTextScore + kExactPenalty;\nvar kTitleScoreExact = kTitleScore + kExactPenalty;\nvar kEndPenalizedScore = 300;\nvar kCSSIdScore = 500;\nvar kRoleWithoutNameScore = 510;\nvar kCSSInputTypeNameScore = 520;\nvar kCSSTagNameScore = 530;\nvar kNthScore = 1e4;\nvar kCSSFallbackScore = 1e7;\nvar kScoreThresholdForTextExpect = 1e3;\nfunction generateSelector(injectedScript, targetElement, options) {\n var _a;\n injectedScript._evaluator.begin();\n beginAriaCaches();\n try {\n let selectors = [];\n if (options.forTextExpect) {\n let targetTokens = cssFallback(injectedScript, targetElement.ownerDocument.documentElement, options);\n for (let element = targetElement; element; element = parentElementOrShadowHost(element)) {\n const tokens = generateSelectorFor(injectedScript, element, { ...options, noText: true });\n if (!tokens)\n continue;\n const score = combineScores(tokens);\n if (score <= kScoreThresholdForTextExpect) {\n targetTokens = tokens;\n break;\n }\n }\n selectors = [joinTokens(targetTokens)];\n } else {\n targetElement = closestCrossShadow(targetElement, \"button,select,input,[role=button],[role=checkbox],[role=radio],a,[role=link]\", options.root) || targetElement;\n if (options.multiple) {\n const withText = generateSelectorFor(injectedScript, targetElement, options);\n const withoutText = generateSelectorFor(injectedScript, targetElement, { ...options, noText: true });\n let tokens = [withText, withoutText];\n cacheAllowText.clear();\n cacheDisallowText.clear();\n if (withText && hasCSSIdToken(withText))\n tokens.push(generateSelectorFor(injectedScript, targetElement, { ...options, noCSSId: true }));\n if (withoutText && hasCSSIdToken(withoutText))\n tokens.push(generateSelectorFor(injectedScript, targetElement, { ...options, noText: true, noCSSId: true }));\n tokens = tokens.filter(Boolean);\n if (!tokens.length) {\n const css = cssFallback(injectedScript, targetElement, options);\n tokens.push(css);\n if (hasCSSIdToken(css))\n tokens.push(cssFallback(injectedScript, targetElement, { ...options, noCSSId: true }));\n }\n selectors = [...new Set(tokens.map((t) => joinTokens(t)))];\n } else {\n const targetTokens = generateSelectorFor(injectedScript, targetElement, options) || cssFallback(injectedScript, targetElement, options);\n selectors = [joinTokens(targetTokens)];\n }\n }\n const selector = selectors[0];\n const parsedSelector = injectedScript.parseSelector(selector);\n return {\n selector,\n selectors,\n elements: injectedScript.querySelectorAll(parsedSelector, (_a = options.root) != null ? _a : targetElement.ownerDocument)\n };\n } finally {\n cacheAllowText.clear();\n cacheDisallowText.clear();\n endAriaCaches();\n injectedScript._evaluator.end();\n }\n}\nfunction filterRegexTokens(textCandidates) {\n return textCandidates.filter((c) => c[0].selector[0] !== \"/\");\n}\nfunction generateSelectorFor(injectedScript, targetElement, options) {\n if (options.root && !isInsideScope(options.root, targetElement))\n throw new Error(`Target element must belong to the root's subtree`);\n if (targetElement === options.root)\n return [{ engine: \"css\", selector: \":scope\", score: 1 }];\n if (targetElement.ownerDocument.documentElement === targetElement)\n return [{ engine: \"css\", selector: \"html\", score: 1 }];\n const calculate = (element, allowText) => {\n var _a;\n const allowNthMatch = element === targetElement;\n let textCandidates = allowText ? buildTextCandidates(injectedScript, element, element === targetElement) : [];\n if (element !== targetElement) {\n textCandidates = filterRegexTokens(textCandidates);\n }\n const noTextCandidates = buildNoTextCandidates(injectedScript, element, options).filter((token) => !options.omitInternalEngines || !token.engine.startsWith(\"internal:\")).map((token) => [token]);\n let result = chooseFirstSelector(injectedScript, (_a = options.root) != null ? _a : targetElement.ownerDocument, element, [...textCandidates, ...noTextCandidates], allowNthMatch);\n textCandidates = filterRegexTokens(textCandidates);\n const checkWithText = (textCandidatesToUse) => {\n const allowParentText = allowText && !textCandidatesToUse.length;\n const candidates = [...textCandidatesToUse, ...noTextCandidates].filter((c) => {\n if (!result)\n return true;\n return combineScores(c) < combineScores(result);\n });\n let bestPossibleInParent = candidates[0];\n if (!bestPossibleInParent)\n return;\n for (let parent = parentElementOrShadowHost(element); parent && parent !== options.root; parent = parentElementOrShadowHost(parent)) {\n const parentTokens = calculateCached(parent, allowParentText);\n if (!parentTokens)\n continue;\n if (result && combineScores([...parentTokens, ...bestPossibleInParent]) >= combineScores(result))\n continue;\n bestPossibleInParent = chooseFirstSelector(injectedScript, parent, element, candidates, allowNthMatch);\n if (!bestPossibleInParent)\n return;\n const combined = [...parentTokens, ...bestPossibleInParent];\n if (!result || combineScores(combined) < combineScores(result))\n result = combined;\n }\n };\n checkWithText(textCandidates);\n if (element === targetElement && textCandidates.length)\n checkWithText([]);\n return result;\n };\n const calculateCached = (element, allowText) => {\n const cache = allowText ? cacheAllowText : cacheDisallowText;\n let value = cache.get(element);\n if (value === void 0) {\n value = calculate(element, allowText);\n cache.set(element, value);\n }\n return value;\n };\n return calculate(targetElement, !options.noText);\n}\nfunction buildNoTextCandidates(injectedScript, element, options) {\n const candidates = [];\n {\n for (const attr of [\"data-testid\", \"data-test-id\", \"data-test\"]) {\n if (attr !== options.testIdAttributeName && element.getAttribute(attr))\n candidates.push({ engine: \"css\", selector: `[${attr}=${quoteCSSAttributeValue(element.getAttribute(attr))}]`, score: kOtherTestIdScore });\n }\n if (!options.noCSSId) {\n const idAttr = element.getAttribute(\"id\");\n if (idAttr && !isGuidLike(idAttr))\n candidates.push({ engine: \"css\", selector: makeSelectorForId(idAttr), score: kCSSIdScore });\n }\n candidates.push({ engine: \"css\", selector: cssEscape(element.nodeName.toLowerCase()), score: kCSSTagNameScore });\n }\n if (element.nodeName === \"IFRAME\") {\n for (const attribute of [\"name\", \"title\"]) {\n if (element.getAttribute(attribute))\n candidates.push({ engine: \"css\", selector: `${cssEscape(element.nodeName.toLowerCase())}[${attribute}=${quoteCSSAttributeValue(element.getAttribute(attribute))}]`, score: kIframeByAttributeScore });\n }\n if (element.getAttribute(options.testIdAttributeName))\n candidates.push({ engine: \"css\", selector: `[${options.testIdAttributeName}=${quoteCSSAttributeValue(element.getAttribute(options.testIdAttributeName))}]`, score: kTestIdScore });\n penalizeScoreForLength([candidates]);\n return candidates;\n }\n if (element.getAttribute(options.testIdAttributeName))\n candidates.push({ engine: \"internal:testid\", selector: `[${options.testIdAttributeName}=${escapeForAttributeSelector(element.getAttribute(options.testIdAttributeName), true)}]`, score: kTestIdScore });\n if (element.nodeName === \"INPUT\" || element.nodeName === \"TEXTAREA\") {\n const input = element;\n if (input.placeholder) {\n candidates.push({ engine: \"internal:attr\", selector: `[placeholder=${escapeForAttributeSelector(input.placeholder, true)}]`, score: kPlaceholderScoreExact });\n for (const alternative of suitableTextAlternatives(input.placeholder))\n candidates.push({ engine: \"internal:attr\", selector: `[placeholder=${escapeForAttributeSelector(alternative.text, false)}]`, score: kPlaceholderScore - alternative.scoreBouns });\n }\n }\n const labels = getElementLabels(injectedScript._evaluator._cacheText, element);\n for (const label of labels) {\n const labelText = label.normalized;\n candidates.push({ engine: \"internal:label\", selector: escapeForTextSelector(labelText, true), score: kLabelScoreExact });\n for (const alternative of suitableTextAlternatives(labelText))\n candidates.push({ engine: \"internal:label\", selector: escapeForTextSelector(alternative.text, false), score: kLabelScore - alternative.scoreBouns });\n }\n const ariaRole = getAriaRole(element);\n if (ariaRole && ![\"none\", \"presentation\"].includes(ariaRole))\n candidates.push({ engine: \"internal:role\", selector: ariaRole, score: kRoleWithoutNameScore });\n if (element.getAttribute(\"name\") && [\"BUTTON\", \"FORM\", \"FIELDSET\", \"FRAME\", \"IFRAME\", \"INPUT\", \"KEYGEN\", \"OBJECT\", \"OUTPUT\", \"SELECT\", \"TEXTAREA\", \"MAP\", \"META\", \"PARAM\"].includes(element.nodeName))\n candidates.push({ engine: \"css\", selector: `${cssEscape(element.nodeName.toLowerCase())}[name=${quoteCSSAttributeValue(element.getAttribute(\"name\"))}]`, score: kCSSInputTypeNameScore });\n if ([\"INPUT\", \"TEXTAREA\"].includes(element.nodeName) && element.getAttribute(\"type\") !== \"hidden\") {\n if (element.getAttribute(\"type\"))\n candidates.push({ engine: \"css\", selector: `${cssEscape(element.nodeName.toLowerCase())}[type=${quoteCSSAttributeValue(element.getAttribute(\"type\"))}]`, score: kCSSInputTypeNameScore });\n }\n if ([\"INPUT\", \"TEXTAREA\", \"SELECT\"].includes(element.nodeName) && element.getAttribute(\"type\") !== \"hidden\")\n candidates.push({ engine: \"css\", selector: cssEscape(element.nodeName.toLowerCase()), score: kCSSInputTypeNameScore + 1 });\n penalizeScoreForLength([candidates]);\n return candidates;\n}\nfunction buildTextCandidates(injectedScript, element, isTargetNode) {\n if (element.nodeName === \"SELECT\")\n return [];\n const candidates = [];\n const title = element.getAttribute(\"title\");\n if (title) {\n candidates.push([{ engine: \"internal:attr\", selector: `[title=${escapeForAttributeSelector(title, true)}]`, score: kTitleScoreExact }]);\n for (const alternative of suitableTextAlternatives(title))\n candidates.push([{ engine: \"internal:attr\", selector: `[title=${escapeForAttributeSelector(alternative.text, false)}]`, score: kTitleScore - alternative.scoreBouns }]);\n }\n const alt = element.getAttribute(\"alt\");\n if (alt && [\"APPLET\", \"AREA\", \"IMG\", \"INPUT\"].includes(element.nodeName)) {\n candidates.push([{ engine: \"internal:attr\", selector: `[alt=${escapeForAttributeSelector(alt, true)}]`, score: kAltTextScoreExact }]);\n for (const alternative of suitableTextAlternatives(alt))\n candidates.push([{ engine: \"internal:attr\", selector: `[alt=${escapeForAttributeSelector(alternative.text, false)}]`, score: kAltTextScore - alternative.scoreBouns }]);\n }\n const text = elementText(injectedScript._evaluator._cacheText, element).normalized;\n if (text) {\n const alternatives = suitableTextAlternatives(text);\n if (isTargetNode) {\n if (text.length <= 80)\n candidates.push([{ engine: \"internal:text\", selector: escapeForTextSelector(text, true), score: kTextScoreExact }]);\n for (const alternative of alternatives)\n candidates.push([{ engine: \"internal:text\", selector: escapeForTextSelector(alternative.text, false), score: kTextScore - alternative.scoreBouns }]);\n }\n const cssToken = { engine: \"css\", selector: cssEscape(element.nodeName.toLowerCase()), score: kCSSTagNameScore };\n for (const alternative of alternatives)\n candidates.push([cssToken, { engine: \"internal:has-text\", selector: escapeForTextSelector(alternative.text, false), score: kTextScore - alternative.scoreBouns }]);\n if (text.length <= 80)\n candidates.push([cssToken, { engine: \"internal:has-text\", selector: \"/^\" + escapeRegExp(text) + \"$/\", score: kTextScoreRegex }]);\n }\n const ariaRole = getAriaRole(element);\n if (ariaRole && ![\"none\", \"presentation\"].includes(ariaRole)) {\n const ariaName = getElementAccessibleName(element, false);\n if (ariaName) {\n candidates.push([{ engine: \"internal:role\", selector: `${ariaRole}[name=${escapeForAttributeSelector(ariaName, true)}]`, score: kRoleWithNameScoreExact }]);\n for (const alternative of suitableTextAlternatives(ariaName))\n candidates.push([{ engine: \"internal:role\", selector: `${ariaRole}[name=${escapeForAttributeSelector(alternative.text, false)}]`, score: kRoleWithNameScore - alternative.scoreBouns }]);\n }\n }\n penalizeScoreForLength(candidates);\n return candidates;\n}\nfunction makeSelectorForId(id) {\n return /^[a-zA-Z][a-zA-Z0-9\\-\\_]+$/.test(id) ? \"#\" + id : `[id=\"${cssEscape(id)}\"]`;\n}\nfunction hasCSSIdToken(tokens) {\n return tokens.some((token) => token.engine === \"css\" && (token.selector.startsWith(\"#\") || token.selector.startsWith('[id=\"')));\n}\nfunction cssFallback(injectedScript, targetElement, options) {\n var _a;\n const root = (_a = options.root) != null ? _a : targetElement.ownerDocument;\n const tokens = [];\n function uniqueCSSSelector(prefix) {\n const path = tokens.slice();\n if (prefix)\n path.unshift(prefix);\n const selector = path.join(\" > \");\n const parsedSelector = injectedScript.parseSelector(selector);\n const node = injectedScript.querySelector(parsedSelector, root, false);\n return node === targetElement ? selector : void 0;\n }\n function makeStrict(selector) {\n const token = { engine: \"css\", selector, score: kCSSFallbackScore };\n const parsedSelector = injectedScript.parseSelector(selector);\n const elements = injectedScript.querySelectorAll(parsedSelector, root);\n if (elements.length === 1)\n return [token];\n const nth = { engine: \"nth\", selector: String(elements.indexOf(targetElement)), score: kNthScore };\n return [token, nth];\n }\n for (let element = targetElement; element && element !== root; element = parentElementOrShadowHost(element)) {\n const nodeName = element.nodeName.toLowerCase();\n let bestTokenForLevel = \"\";\n if (element.id && !options.noCSSId) {\n const token = makeSelectorForId(element.id);\n const selector = uniqueCSSSelector(token);\n if (selector)\n return makeStrict(selector);\n bestTokenForLevel = token;\n }\n const parent = element.parentNode;\n const classes = [...element.classList];\n for (let i = 0; i < classes.length; ++i) {\n const token = \".\" + cssEscape(classes.slice(0, i + 1).join(\".\"));\n const selector = uniqueCSSSelector(token);\n if (selector)\n return makeStrict(selector);\n if (!bestTokenForLevel && parent) {\n const sameClassSiblings = parent.querySelectorAll(token);\n if (sameClassSiblings.length === 1)\n bestTokenForLevel = token;\n }\n }\n if (parent) {\n const siblings = [...parent.children];\n const sameTagSiblings = siblings.filter((sibling) => sibling.nodeName.toLowerCase() === nodeName);\n const token = sameTagSiblings.indexOf(element) === 0 ? cssEscape(nodeName) : `${cssEscape(nodeName)}:nth-child(${1 + siblings.indexOf(element)})`;\n const selector = uniqueCSSSelector(token);\n if (selector)\n return makeStrict(selector);\n if (!bestTokenForLevel)\n bestTokenForLevel = token;\n } else if (!bestTokenForLevel) {\n bestTokenForLevel = cssEscape(nodeName);\n }\n tokens.unshift(bestTokenForLevel);\n }\n return makeStrict(uniqueCSSSelector());\n}\nfunction penalizeScoreForLength(groups) {\n for (const group of groups) {\n for (const token of group) {\n if (token.score > kBeginPenalizedScore && token.score < kEndPenalizedScore)\n token.score += Math.min(kTextScoreRange, token.selector.length / 10 | 0);\n }\n }\n}\nfunction joinTokens(tokens) {\n const parts = [];\n let lastEngine = \"\";\n for (const { engine, selector } of tokens) {\n if (parts.length && (lastEngine !== \"css\" || engine !== \"css\" || selector.startsWith(\":nth-match(\")))\n parts.push(\">>\");\n lastEngine = engine;\n if (engine === \"css\")\n parts.push(selector);\n else\n parts.push(`${engine}=${selector}`);\n }\n return parts.join(\" \");\n}\nfunction combineScores(tokens) {\n let score = 0;\n for (let i = 0; i < tokens.length; i++)\n score += tokens[i].score * (tokens.length - i);\n return score;\n}\nfunction chooseFirstSelector(injectedScript, scope, targetElement, selectors, allowNthMatch) {\n const joined = selectors.map((tokens) => ({ tokens, score: combineScores(tokens) }));\n joined.sort((a, b) => a.score - b.score);\n let bestWithIndex = null;\n for (const { tokens } of joined) {\n const parsedSelector = injectedScript.parseSelector(joinTokens(tokens));\n const result = injectedScript.querySelectorAll(parsedSelector, scope);\n if (result[0] === targetElement && result.length === 1) {\n return tokens;\n }\n const index = result.indexOf(targetElement);\n if (!allowNthMatch || bestWithIndex || index === -1 || result.length > 5)\n continue;\n const nth = { engine: \"nth\", selector: String(index), score: kNthScore };\n bestWithIndex = [...tokens, nth];\n }\n return bestWithIndex;\n}\nfunction isGuidLike(id) {\n let lastCharacterType;\n let transitionCount = 0;\n for (let i = 0; i < id.length; ++i) {\n const c = id[i];\n let characterType;\n if (c === \"-\" || c === \"_\")\n continue;\n if (c >= \"a\" && c <= \"z\")\n characterType = \"lower\";\n else if (c >= \"A\" && c <= \"Z\")\n characterType = \"upper\";\n else if (c >= \"0\" && c <= \"9\")\n characterType = \"digit\";\n else\n characterType = \"other\";\n if (characterType === \"lower\" && lastCharacterType === \"upper\") {\n lastCharacterType = characterType;\n continue;\n }\n if (lastCharacterType && lastCharacterType !== characterType)\n ++transitionCount;\n lastCharacterType = characterType;\n }\n return transitionCount >= id.length / 4;\n}\nfunction trimWordBoundary(text, maxLength) {\n if (text.length <= maxLength)\n return text;\n text = text.substring(0, maxLength);\n const match = text.match(/^(.*)\\b(.+?)$/);\n if (!match)\n return \"\";\n return match[1].trimEnd();\n}\nfunction suitableTextAlternatives(text) {\n let result = [];\n {\n const match = text.match(/^([\\d.,]+)[^.,\\w]/);\n const leadingNumberLength = match ? match[1].length : 0;\n if (leadingNumberLength) {\n const alt = text.substring(leadingNumberLength).trimStart();\n result.push({ text: alt, scoreBouns: alt.length <= 30 ? 2 : 1 });\n }\n }\n {\n const match = text.match(/[^.,\\w]([\\d.,]+)$/);\n const trailingNumberLength = match ? match[1].length : 0;\n if (trailingNumberLength) {\n const alt = text.substring(0, text.length - trailingNumberLength).trimEnd();\n result.push({ text: alt, scoreBouns: alt.length <= 30 ? 2 : 1 });\n }\n }\n if (text.length <= 30) {\n result.push({ text, scoreBouns: 0 });\n } else {\n result.push({ text: trimWordBoundary(text, 80), scoreBouns: 0 });\n result.push({ text: trimWordBoundary(text, 30), scoreBouns: 1 });\n }\n result = result.filter((r) => r.text);\n if (!result.length)\n result.push({ text: text.substring(0, 80), scoreBouns: 0 });\n return result;\n}\n\n// packages/playwright-core/src/utils/isomorphic/locatorGenerators.ts\nfunction asLocator(lang, selector, isFrameLocator = false) {\n return asLocators(lang, selector, isFrameLocator)[0];\n}\nfunction asLocators(lang, selector, isFrameLocator = false, maxOutputSize = 20, preferredQuote) {\n try {\n return innerAsLocators(new generators[lang](preferredQuote), parseSelector(selector), isFrameLocator, maxOutputSize);\n } catch (e) {\n return [selector];\n }\n}\nfunction innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize = 20) {\n const parts = [...parsed.parts];\n for (let index = 0; index < parts.length - 1; index++) {\n if (parts[index].name === \"nth\" && parts[index + 1].name === \"internal:control\" && parts[index + 1].body === \"enter-frame\") {\n const [nth] = parts.splice(index, 1);\n parts.splice(index + 1, 0, nth);\n }\n }\n const tokens = [];\n let nextBase = isFrameLocator ? \"frame-locator\" : \"page\";\n for (let index = 0; index < parts.length; index++) {\n const part = parts[index];\n const base = nextBase;\n nextBase = \"locator\";\n if (part.name === \"nth\") {\n if (part.body === \"0\")\n tokens.push([factory.generateLocator(base, \"first\", \"\"), factory.generateLocator(base, \"nth\", \"0\")]);\n else if (part.body === \"-1\")\n tokens.push([factory.generateLocator(base, \"last\", \"\"), factory.generateLocator(base, \"nth\", \"-1\")]);\n else\n tokens.push([factory.generateLocator(base, \"nth\", part.body)]);\n continue;\n }\n if (part.name === \"internal:text\") {\n const { exact, text } = detectExact(part.body);\n tokens.push([factory.generateLocator(base, \"text\", text, { exact })]);\n continue;\n }\n if (part.name === \"internal:has-text\") {\n const { exact, text } = detectExact(part.body);\n if (!exact) {\n tokens.push([factory.generateLocator(base, \"has-text\", text, { exact })]);\n continue;\n }\n }\n if (part.name === \"internal:has-not-text\") {\n const { exact, text } = detectExact(part.body);\n if (!exact) {\n tokens.push([factory.generateLocator(base, \"has-not-text\", text, { exact })]);\n continue;\n }\n }\n if (part.name === \"internal:has\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"has\", inner)));\n continue;\n }\n if (part.name === \"internal:has-not\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"hasNot\", inner)));\n continue;\n }\n if (part.name === \"internal:and\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"and\", inner)));\n continue;\n }\n if (part.name === \"internal:or\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"or\", inner)));\n continue;\n }\n if (part.name === \"internal:chain\") {\n const inners = innerAsLocators(factory, part.body.parsed, false, maxOutputSize);\n tokens.push(inners.map((inner) => factory.generateLocator(base, \"chain\", inner)));\n continue;\n }\n if (part.name === \"internal:label\") {\n const { exact, text } = detectExact(part.body);\n tokens.push([factory.generateLocator(base, \"label\", text, { exact })]);\n continue;\n }\n if (part.name === \"internal:role\") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const options = { attrs: [] };\n for (const attr of attrSelector.attributes) {\n if (attr.name === \"name\") {\n options.exact = attr.caseSensitive;\n options.name = attr.value;\n } else {\n if (attr.name === \"level\" && typeof attr.value === \"string\")\n attr.value = +attr.value;\n options.attrs.push({ name: attr.name === \"include-hidden\" ? \"includeHidden\" : attr.name, value: attr.value });\n }\n }\n tokens.push([factory.generateLocator(base, \"role\", attrSelector.name, options)]);\n continue;\n }\n if (part.name === \"internal:testid\") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const { value } = attrSelector.attributes[0];\n tokens.push([factory.generateLocator(base, \"test-id\", value)]);\n continue;\n }\n if (part.name === \"internal:attr\") {\n const attrSelector = parseAttributeSelector(part.body, true);\n const { name, value, caseSensitive } = attrSelector.attributes[0];\n const text = value;\n const exact = !!caseSensitive;\n if (name === \"placeholder\") {\n tokens.push([factory.generateLocator(base, \"placeholder\", text, { exact })]);\n continue;\n }\n if (name === \"alt\") {\n tokens.push([factory.generateLocator(base, \"alt\", text, { exact })]);\n continue;\n }\n if (name === \"title\") {\n tokens.push([factory.generateLocator(base, \"title\", text, { exact })]);\n continue;\n }\n }\n let locatorType = \"default\";\n const nextPart = parts[index + 1];\n if (nextPart && nextPart.name === \"internal:control\" && nextPart.body === \"enter-frame\") {\n locatorType = \"frame\";\n nextBase = \"frame-locator\";\n index++;\n }\n const selectorPart = stringifySelector({ parts: [part] });\n const locatorPart = factory.generateLocator(base, locatorType, selectorPart);\n if (locatorType === \"default\" && nextPart && [\"internal:has-text\", \"internal:has-not-text\"].includes(nextPart.name)) {\n const { exact, text } = detectExact(nextPart.body);\n if (!exact) {\n const nextLocatorPart = factory.generateLocator(\"locator\", nextPart.name === \"internal:has-text\" ? \"has-text\" : \"has-not-text\", text, { exact });\n const options = {};\n if (nextPart.name === \"internal:has-text\")\n options.hasText = text;\n else\n options.hasNotText = text;\n const combinedPart = factory.generateLocator(base, \"default\", selectorPart, options);\n tokens.push([factory.chainLocators([locatorPart, nextLocatorPart]), combinedPart]);\n index++;\n continue;\n }\n }\n let locatorPartWithEngine;\n if ([\"xpath\", \"css\"].includes(part.name)) {\n const selectorPart2 = stringifySelector(\n { parts: [part] },\n /* forceEngineName */\n true\n );\n locatorPartWithEngine = factory.generateLocator(base, locatorType, selectorPart2);\n }\n tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean));\n }\n return combineTokens(factory, tokens, maxOutputSize);\n}\nfunction combineTokens(factory, tokens, maxOutputSize) {\n const currentTokens = tokens.map(() => \"\");\n const result = [];\n const visit = (index) => {\n if (index === tokens.length) {\n result.push(factory.chainLocators(currentTokens));\n return currentTokens.length < maxOutputSize;\n }\n for (const taken of tokens[index]) {\n currentTokens[index] = taken;\n if (!visit(index + 1))\n return false;\n }\n return true;\n };\n visit(0);\n return result;\n}\nfunction detectExact(text) {\n let exact = false;\n const match = text.match(/^\\/(.*)\\/([igm]*)$/);\n if (match)\n return { text: new RegExp(match[1], match[2]) };\n if (text.endsWith('\"')) {\n text = JSON.parse(text);\n exact = true;\n } else if (text.endsWith('\"s')) {\n text = JSON.parse(text.substring(0, text.length - 1));\n exact = true;\n } else if (text.endsWith('\"i')) {\n text = JSON.parse(text.substring(0, text.length - 1));\n exact = false;\n }\n return { exact, text };\n}\nvar JavaScriptLocatorFactory = class {\n constructor(preferredQuote) {\n this.preferredQuote = preferredQuote;\n }\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, { hasText: ${this.toHasText(options.hasText)} })`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, { hasNotText: ${this.toHasText(options.hasNotText)} })`;\n return `locator(${this.quote(body)})`;\n case \"frame\":\n return `frameLocator(${this.quote(body)})`;\n case \"nth\":\n return `nth(${body})`;\n case \"first\":\n return `first()`;\n case \"last\":\n return `last()`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`name: ${this.regexToSourceString(options.name)}`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`name: ${this.quote(options.name)}`);\n if (options.exact)\n attrs.push(`exact: true`);\n }\n for (const { name, value } of options.attrs)\n attrs.push(`${name}: ${typeof value === \"string\" ? this.quote(value) : value}`);\n const attrString = attrs.length ? `, { ${attrs.join(\", \")} }` : \"\";\n return `getByRole(${this.quote(body)}${attrString})`;\n case \"has-text\":\n return `filter({ hasText: ${this.toHasText(body)} })`;\n case \"has-not-text\":\n return `filter({ hasNotText: ${this.toHasText(body)} })`;\n case \"has\":\n return `filter({ has: ${body} })`;\n case \"hasNot\":\n return `filter({ hasNot: ${body} })`;\n case \"and\":\n return `and(${body})`;\n case \"or\":\n return `or(${body})`;\n case \"chain\":\n return `locator(${body})`;\n case \"test-id\":\n return `getByTestId(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(\"getByText\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(\"getByAltText\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(\"getByPlaceholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(\"getByLabel\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(\"getByTitle\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToSourceString(re) {\n return normalizeEscapedRegexQuotes(String(re));\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToSourceString(body)})`;\n return exact ? `${method}(${this.quote(body)}, { exact: true })` : `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToSourceString(body);\n return this.quote(body);\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToSourceString(value);\n return this.quote(value);\n }\n quote(text) {\n var _a;\n return escapeWithQuotes(text, (_a = this.preferredQuote) != null ? _a : \"'\");\n }\n};\nvar PythonLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, has_text=${this.toHasText(options.hasText)})`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, has_not_text=${this.toHasText(options.hasNotText)})`;\n return `locator(${this.quote(body)})`;\n case \"frame\":\n return `frame_locator(${this.quote(body)})`;\n case \"nth\":\n return `nth(${body})`;\n case \"first\":\n return `first`;\n case \"last\":\n return `last`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`name=${this.regexToString(options.name)}`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`name=${this.quote(options.name)}`);\n if (options.exact)\n attrs.push(`exact=True`);\n }\n for (const { name, value } of options.attrs) {\n let valueString = typeof value === \"string\" ? this.quote(value) : value;\n if (typeof value === \"boolean\")\n valueString = value ? \"True\" : \"False\";\n attrs.push(`${toSnakeCase(name)}=${valueString}`);\n }\n const attrString = attrs.length ? `, ${attrs.join(\", \")}` : \"\";\n return `get_by_role(${this.quote(body)}${attrString})`;\n case \"has-text\":\n return `filter(has_text=${this.toHasText(body)})`;\n case \"has-not-text\":\n return `filter(has_not_text=${this.toHasText(body)})`;\n case \"has\":\n return `filter(has=${body})`;\n case \"hasNot\":\n return `filter(has_not=${body})`;\n case \"and\":\n return `and_(${body})`;\n case \"or\":\n return `or_(${body})`;\n case \"chain\":\n return `locator(${body})`;\n case \"test-id\":\n return `get_by_test_id(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(\"get_by_text\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(\"get_by_alt_text\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(\"get_by_placeholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(\"get_by_label\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(\"get_by_title\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToString(body) {\n const suffix = body.flags.includes(\"i\") ? \", re.IGNORECASE\" : \"\";\n return `re.compile(r\"${normalizeEscapedRegexQuotes(body.source).replace(/\\\\\\//, \"/\").replace(/\"/g, '\\\\\"')}\"${suffix})`;\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, exact=True)`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToString(body);\n return `${this.quote(body)}`;\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n quote(text) {\n return escapeWithQuotes(text, '\"');\n }\n};\nvar JavaLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n let clazz;\n switch (base) {\n case \"page\":\n clazz = \"Page\";\n break;\n case \"frame-locator\":\n clazz = \"FrameLocator\";\n break;\n case \"locator\":\n clazz = \"Locator\";\n break;\n }\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasText(${this.toHasText(options.hasText)}))`;\n if (options.hasNotText !== void 0)\n return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasNotText(${this.toHasText(options.hasNotText)}))`;\n return `locator(${this.quote(body)})`;\n case \"frame\":\n return `frameLocator(${this.quote(body)})`;\n case \"nth\":\n return `nth(${body})`;\n case \"first\":\n return `first()`;\n case \"last\":\n return `last()`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`.setName(${this.regexToString(options.name)})`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`.setName(${this.quote(options.name)})`);\n if (options.exact)\n attrs.push(`.setExact(true)`);\n }\n for (const { name, value } of options.attrs)\n attrs.push(`.set${toTitleCase(name)}(${typeof value === \"string\" ? this.quote(value) : value})`);\n const attrString = attrs.length ? `, new ${clazz}.GetByRoleOptions()${attrs.join(\"\")}` : \"\";\n return `getByRole(AriaRole.${toSnakeCase(body).toUpperCase()}${attrString})`;\n case \"has-text\":\n return `filter(new ${clazz}.FilterOptions().setHasText(${this.toHasText(body)}))`;\n case \"has-not-text\":\n return `filter(new ${clazz}.FilterOptions().setHasNotText(${this.toHasText(body)}))`;\n case \"has\":\n return `filter(new ${clazz}.FilterOptions().setHas(${body}))`;\n case \"hasNot\":\n return `filter(new ${clazz}.FilterOptions().setHasNot(${body}))`;\n case \"and\":\n return `and(${body})`;\n case \"or\":\n return `or(${body})`;\n case \"chain\":\n return `locator(${body})`;\n case \"test-id\":\n return `getByTestId(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(clazz, \"getByText\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(clazz, \"getByAltText\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(clazz, \"getByPlaceholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(clazz, \"getByLabel\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(clazz, \"getByTitle\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToString(body) {\n const suffix = body.flags.includes(\"i\") ? \", Pattern.CASE_INSENSITIVE\" : \"\";\n return `Pattern.compile(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n }\n toCallWithExact(clazz, method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, new ${clazz}.${toTitleCase(method)}Options().setExact(true))`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return this.regexToString(body);\n return this.quote(body);\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n quote(text) {\n return escapeWithQuotes(text, '\"');\n }\n};\nvar CSharpLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n switch (kind) {\n case \"default\":\n if (options.hasText !== void 0)\n return `Locator(${this.quote(body)}, new() { ${this.toHasText(options.hasText)} })`;\n if (options.hasNotText !== void 0)\n return `Locator(${this.quote(body)}, new() { ${this.toHasNotText(options.hasNotText)} })`;\n return `Locator(${this.quote(body)})`;\n case \"frame\":\n return `FrameLocator(${this.quote(body)})`;\n case \"nth\":\n return `Nth(${body})`;\n case \"first\":\n return `First`;\n case \"last\":\n return `Last`;\n case \"role\":\n const attrs = [];\n if (isRegExp(options.name)) {\n attrs.push(`NameRegex = ${this.regexToString(options.name)}`);\n } else if (typeof options.name === \"string\") {\n attrs.push(`Name = ${this.quote(options.name)}`);\n if (options.exact)\n attrs.push(`Exact = true`);\n }\n for (const { name, value } of options.attrs)\n attrs.push(`${toTitleCase(name)} = ${typeof value === \"string\" ? this.quote(value) : value}`);\n const attrString = attrs.length ? `, new() { ${attrs.join(\", \")} }` : \"\";\n return `GetByRole(AriaRole.${toTitleCase(body)}${attrString})`;\n case \"has-text\":\n return `Filter(new() { ${this.toHasText(body)} })`;\n case \"has-not-text\":\n return `Filter(new() { ${this.toHasNotText(body)} })`;\n case \"has\":\n return `Filter(new() { Has = ${body} })`;\n case \"hasNot\":\n return `Filter(new() { HasNot = ${body} })`;\n case \"and\":\n return `And(${body})`;\n case \"or\":\n return `Or(${body})`;\n case \"chain\":\n return `Locator(${body})`;\n case \"test-id\":\n return `GetByTestId(${this.toTestIdValue(body)})`;\n case \"text\":\n return this.toCallWithExact(\"GetByText\", body, !!options.exact);\n case \"alt\":\n return this.toCallWithExact(\"GetByAltText\", body, !!options.exact);\n case \"placeholder\":\n return this.toCallWithExact(\"GetByPlaceholder\", body, !!options.exact);\n case \"label\":\n return this.toCallWithExact(\"GetByLabel\", body, !!options.exact);\n case \"title\":\n return this.toCallWithExact(\"GetByTitle\", body, !!options.exact);\n default:\n throw new Error(\"Unknown selector kind \" + kind);\n }\n }\n chainLocators(locators) {\n return locators.join(\".\");\n }\n regexToString(body) {\n const suffix = body.flags.includes(\"i\") ? \", RegexOptions.IgnoreCase\" : \"\";\n return `new Regex(${this.quote(normalizeEscapedRegexQuotes(body.source))}${suffix})`;\n }\n toCallWithExact(method, body, exact) {\n if (isRegExp(body))\n return `${method}(${this.regexToString(body)})`;\n if (exact)\n return `${method}(${this.quote(body)}, new() { Exact = true })`;\n return `${method}(${this.quote(body)})`;\n }\n toHasText(body) {\n if (isRegExp(body))\n return `HasTextRegex = ${this.regexToString(body)}`;\n return `HasText = ${this.quote(body)}`;\n }\n toTestIdValue(value) {\n if (isRegExp(value))\n return this.regexToString(value);\n return this.quote(value);\n }\n toHasNotText(body) {\n if (isRegExp(body))\n return `HasNotTextRegex = ${this.regexToString(body)}`;\n return `HasNotText = ${this.quote(body)}`;\n }\n quote(text) {\n return escapeWithQuotes(text, '\"');\n }\n};\nvar JsonlLocatorFactory = class {\n generateLocator(base, kind, body, options = {}) {\n return JSON.stringify({\n kind,\n body,\n options\n });\n }\n chainLocators(locators) {\n const objects = locators.map((l) => JSON.parse(l));\n for (let i = 0; i < objects.length - 1; ++i)\n objects[i].next = objects[i + 1];\n return JSON.stringify(objects[0]);\n }\n};\nvar generators = {\n javascript: JavaScriptLocatorFactory,\n python: PythonLocatorFactory,\n java: JavaLocatorFactory,\n csharp: CSharpLocatorFactory,\n jsonl: JsonlLocatorFactory\n};\nfunction isRegExp(obj) {\n return obj instanceof RegExp;\n}\n\n// packages/playwright-core/src/server/injected/highlight.css?inline\nvar highlight_default = \":host{font-size:13px;font-family:system-ui,Ubuntu,Droid Sans,sans-serif;color:#333}svg{position:absolute;height:0}x-pw-tooltip{backdrop-filter:blur(5px);background-color:#fff;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:none;font-size:12.8px;font-weight:400;left:0;line-height:1.5;max-width:600px;position:absolute;top:0;padding:0;flex-direction:column;overflow:hidden}x-pw-tooltip-line{display:flex;max-width:600px;padding:6px;user-select:none;cursor:pointer}x-pw-tooltip-line.selectable:hover{background-color:#f2f2f2;overflow:hidden}x-pw-tooltip-footer{display:flex;max-width:600px;padding:6px;user-select:none;color:#777}x-pw-dialog{background-color:#fff;pointer-events:auto;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:flex;flex-direction:column;position:absolute;width:400px;height:150px;z-index:10;font-size:13px}x-pw-dialog-body{display:flex;flex-direction:column;flex:auto}x-pw-dialog-body label{margin:5px 8px;display:flex;flex-direction:row;align-items:center}x-pw-highlight{position:absolute;top:0;left:0;width:0;height:0}x-pw-action-point{position:absolute;width:20px;height:20px;background:red;border-radius:10px;margin:-10px 0 0 -10px;z-index:2}x-pw-separator{height:1px;margin:6px 9px;background:rgb(148 148 148 / 90%)}x-pw-tool-gripper{height:28px;width:24px;margin:2px 0;cursor:grab}x-pw-tool-gripper:active{cursor:grabbing}x-pw-tool-gripper>x-div{width:16px;height:16px;margin:6px 4px;clip-path:url(#icon-gripper);background-color:#555}x-pw-tools-list>label{display:flex;align-items:center;margin:0 10px;user-select:none}x-pw-tools-list{display:flex;width:100%;border-bottom:1px solid #dddddd}x-pw-tool-item{pointer-events:auto;cursor:pointer;height:28px;width:28px;border-radius:3px}x-pw-tool-item:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.active{background-color:#8acae480}x-pw-tool-item.active:not(.disabled):hover{background-color:#8acae4c4}x-pw-tool-item>x-div{width:16px;height:16px;margin:6px;background-color:#3a3a3a}x-pw-tool-item.disabled>x-div{background-color:#61616180;cursor:default}x-pw-tool-item.record.active{background-color:transparent}x-pw-tool-item.record.active:hover{background-color:#dbdbdb}x-pw-tool-item.record.active>x-div{background-color:#a1260d}x-pw-tool-item.accept>x-div{background-color:#388a34}x-pw-tool-item.record>x-div{clip-path:url(#icon-circle-large-filled)}x-pw-tool-item.pick-locator>x-div{clip-path:url(#icon-inspect)}x-pw-tool-item.text>x-div{clip-path:url(#icon-whole-word)}x-pw-tool-item.visibility>x-div{clip-path:url(#icon-eye)}x-pw-tool-item.value>x-div{clip-path:url(#icon-symbol-constant)}x-pw-tool-item.accept>x-div{clip-path:url(#icon-check)}x-pw-tool-item.cancel>x-div{clip-path:url(#icon-close)}x-pw-tool-item.succeeded>x-div{clip-path:url(#icon-pass);background-color:#388a34!important}x-pw-overlay{position:absolute;top:0;max-width:min-content;z-index:2147483647;background:transparent;pointer-events:auto}x-pw-overlay x-pw-tools-list{background-color:#fffd;box-shadow:#0000001a 0 5px 5px;border-radius:3px;border-bottom:none}x-pw-overlay x-pw-tool-item{margin:2px}textarea.text-editor{font-family:system-ui,Ubuntu,Droid Sans,sans-serif;flex:auto;border:none;margin:6px 10px;color:#333;outline:1px solid transparent!important;resize:none;padding:0;font-size:13px}textarea.text-editor.does-not-match{outline:1px solid red!important}x-div{display:block}x-spacer{flex:auto}*{box-sizing:border-box}*[hidden]{display:none!important}x-locator-editor{flex:none;width:100%;height:60px;padding:4px;border-bottom:1px solid #dddddd;outline:1px solid transparent}x-locator-editor.does-not-match{outline:1px solid red}.CodeMirror{width:100%!important;height:100%!important}\\n\";\n\n// packages/playwright-core/src/server/injected/highlight.ts\nvar Highlight = class {\n constructor(injectedScript) {\n this._highlightEntries = [];\n this._highlightOptions = {};\n this._language = \"javascript\";\n this._injectedScript = injectedScript;\n const document = injectedScript.document;\n this._isUnderTest = injectedScript.isUnderTest;\n this._glassPaneElement = document.createElement(\"x-pw-glass\");\n this._glassPaneElement.popover = \"manual\";\n this._glassPaneElement.style.position = \"fixed\";\n this._glassPaneElement.style.top = \"0\";\n this._glassPaneElement.style.right = \"0\";\n this._glassPaneElement.style.bottom = \"0\";\n this._glassPaneElement.style.left = \"0\";\n this._glassPaneElement.style.zIndex = \"2147483646\";\n this._glassPaneElement.style.pointerEvents = \"none\";\n this._glassPaneElement.style.display = \"flex\";\n this._glassPaneElement.style.backgroundColor = \"transparent\";\n this._glassPaneElement.style.width = \"inherit\";\n this._glassPaneElement.style.height = \"inherit\";\n this._glassPaneElement.style.padding = \"0\";\n this._glassPaneElement.style.margin = \"0\";\n this._glassPaneElement.style.border = \"none\";\n this._glassPaneElement.style.overflow = \"hidden\";\n for (const eventName of [\"click\", \"auxclick\", \"dragstart\", \"input\", \"keydown\", \"keyup\", \"pointerdown\", \"pointerup\", \"mousedown\", \"mouseup\", \"mouseleave\", \"focus\", \"scroll\"]) {\n this._glassPaneElement.addEventListener(eventName, (e) => {\n e.stopPropagation();\n e.stopImmediatePropagation();\n if (e.type === \"click\" && e.button === 0 && this._highlightOptions.tooltipListItemSelected)\n this._highlightOptions.tooltipListItemSelected(void 0);\n });\n }\n this._actionPointElement = document.createElement(\"x-pw-action-point\");\n this._actionPointElement.setAttribute(\"hidden\", \"true\");\n this._glassPaneShadow = this._glassPaneElement.attachShadow({ mode: this._isUnderTest ? \"open\" : \"closed\" });\n if (typeof this._glassPaneShadow.adoptedStyleSheets.push === \"function\") {\n const sheet = new this._injectedScript.window.CSSStyleSheet();\n sheet.replaceSync(highlight_default);\n this._glassPaneShadow.adoptedStyleSheets.push(sheet);\n } else {\n const styleElement = this._injectedScript.document.createElement(\"style\");\n styleElement.textContent = highlight_default;\n this._glassPaneShadow.appendChild(styleElement);\n }\n this._glassPaneShadow.appendChild(this._actionPointElement);\n }\n install() {\n var _a, _b;\n this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);\n (_b = (_a = this._glassPaneElement).showPopover) == null ? void 0 : _b.call(_a);\n }\n setLanguage(language) {\n this._language = language;\n }\n runHighlightOnRaf(selector) {\n if (this._rafRequest)\n cancelAnimationFrame(this._rafRequest);\n this.updateHighlight(this._injectedScript.querySelectorAll(selector, this._injectedScript.document.documentElement), { tooltipText: asLocator(this._language, stringifySelector(selector)) });\n this._rafRequest = requestAnimationFrame(() => this.runHighlightOnRaf(selector));\n }\n uninstall() {\n var _a, _b;\n if (this._rafRequest)\n cancelAnimationFrame(this._rafRequest);\n (_b = (_a = this._glassPaneElement).hidePopover) == null ? void 0 : _b.call(_a);\n this._glassPaneElement.remove();\n }\n showActionPoint(x, y) {\n this._actionPointElement.style.top = y + \"px\";\n this._actionPointElement.style.left = x + \"px\";\n this._actionPointElement.hidden = false;\n }\n hideActionPoint() {\n this._actionPointElement.hidden = true;\n }\n clearHighlight() {\n var _a, _b;\n for (const entry of this._highlightEntries) {\n (_a = entry.highlightElement) == null ? void 0 : _a.remove();\n (_b = entry.tooltipElement) == null ? void 0 : _b.remove();\n }\n this._highlightEntries = [];\n this._highlightOptions = {};\n this._glassPaneElement.style.pointerEvents = \"none\";\n }\n updateHighlight(elements, options) {\n this._innerUpdateHighlight(elements, options);\n }\n maskElements(elements, color) {\n this._innerUpdateHighlight(elements, { color });\n }\n _innerUpdateHighlight(elements, options) {\n let color = options.color;\n if (!color)\n color = elements.length > 1 ? \"#f6b26b7f\" : \"#6fa8dc7f\";\n if (this._highlightIsUpToDate(elements, options))\n return;\n this.clearHighlight();\n this._highlightOptions = options;\n this._glassPaneElement.style.pointerEvents = options.tooltipListItemSelected ? \"initial\" : \"none\";\n for (let i = 0; i < elements.length; ++i) {\n const highlightElement = this._createHighlightElement();\n this._glassPaneShadow.appendChild(highlightElement);\n let tooltipElement;\n if (options.tooltipList || options.tooltipText || options.tooltipFooter) {\n tooltipElement = this._injectedScript.document.createElement(\"x-pw-tooltip\");\n this._glassPaneShadow.appendChild(tooltipElement);\n tooltipElement.style.top = \"0\";\n tooltipElement.style.left = \"0\";\n tooltipElement.style.display = \"flex\";\n let lines = [];\n if (options.tooltipList) {\n lines = options.tooltipList;\n } else if (options.tooltipText) {\n const suffix = elements.length > 1 ? ` [${i + 1} of ${elements.length}]` : \"\";\n lines = [options.tooltipText + suffix];\n }\n for (let index = 0; index < lines.length; index++) {\n const element = this._injectedScript.document.createElement(\"x-pw-tooltip-line\");\n element.textContent = lines[index];\n tooltipElement.appendChild(element);\n if (options.tooltipListItemSelected) {\n element.classList.add(\"selectable\");\n element.addEventListener(\"click\", () => {\n var _a;\n return (_a = options.tooltipListItemSelected) == null ? void 0 : _a.call(options, index);\n });\n }\n }\n if (options.tooltipFooter) {\n const footer = this._injectedScript.document.createElement(\"x-pw-tooltip-footer\");\n footer.textContent = options.tooltipFooter;\n tooltipElement.appendChild(footer);\n }\n }\n this._highlightEntries.push({ targetElement: elements[i], tooltipElement, highlightElement });\n }\n for (const entry of this._highlightEntries) {\n entry.box = entry.targetElement.getBoundingClientRect();\n if (!entry.tooltipElement)\n continue;\n const { anchorLeft, anchorTop } = this.tooltipPosition(entry.box, entry.tooltipElement);\n entry.tooltipTop = anchorTop;\n entry.tooltipLeft = anchorLeft;\n }\n for (const entry of this._highlightEntries) {\n if (entry.tooltipElement) {\n entry.tooltipElement.style.top = entry.tooltipTop + \"px\";\n entry.tooltipElement.style.left = entry.tooltipLeft + \"px\";\n }\n const box = entry.box;\n entry.highlightElement.style.backgroundColor = color;\n entry.highlightElement.style.left = box.x + \"px\";\n entry.highlightElement.style.top = box.y + \"px\";\n entry.highlightElement.style.width = box.width + \"px\";\n entry.highlightElement.style.height = box.height + \"px\";\n entry.highlightElement.style.display = \"block\";\n if (this._isUnderTest)\n console.error(\"Highlight box for test: \" + JSON.stringify({ x: box.x, y: box.y, width: box.width, height: box.height }));\n }\n }\n firstBox() {\n var _a;\n return (_a = this._highlightEntries[0]) == null ? void 0 : _a.box;\n }\n tooltipPosition(box, tooltipElement) {\n const tooltipWidth = tooltipElement.offsetWidth;\n const tooltipHeight = tooltipElement.offsetHeight;\n const totalWidth = this._glassPaneElement.offsetWidth;\n const totalHeight = this._glassPaneElement.offsetHeight;\n let anchorLeft = box.left;\n if (anchorLeft + tooltipWidth > totalWidth - 5)\n anchorLeft = totalWidth - tooltipWidth - 5;\n let anchorTop = box.bottom + 5;\n if (anchorTop + tooltipHeight > totalHeight - 5) {\n if (box.top > tooltipHeight + 5) {\n anchorTop = box.top - tooltipHeight - 5;\n } else {\n anchorTop = totalHeight - 5 - tooltipHeight;\n }\n }\n return { anchorLeft, anchorTop };\n }\n _highlightIsUpToDate(elements, options) {\n var _a, _b;\n if (options.tooltipText !== this._highlightOptions.tooltipText)\n return false;\n if (options.tooltipListItemSelected !== this._highlightOptions.tooltipListItemSelected)\n return false;\n if (options.tooltipFooter !== this._highlightOptions.tooltipFooter)\n return false;\n if (((_a = options.tooltipList) == null ? void 0 : _a.length) !== ((_b = this._highlightOptions.tooltipList) == null ? void 0 : _b.length))\n return false;\n if (options.tooltipList && this._highlightOptions.tooltipList) {\n for (let i = 0; i < options.tooltipList.length; i++) {\n if (options.tooltipList[i] !== this._highlightOptions.tooltipList[i])\n return false;\n }\n }\n if (elements.length !== this._highlightEntries.length)\n return false;\n for (let i = 0; i < this._highlightEntries.length; ++i) {\n if (elements[i] !== this._highlightEntries[i].targetElement)\n return false;\n const oldBox = this._highlightEntries[i].box;\n if (!oldBox)\n return false;\n const box = elements[i].getBoundingClientRect();\n if (box.top !== oldBox.top || box.right !== oldBox.right || box.bottom !== oldBox.bottom || box.left !== oldBox.left)\n return false;\n }\n return true;\n }\n _createHighlightElement() {\n return this._injectedScript.document.createElement(\"x-pw-highlight\");\n }\n appendChild(element) {\n this._glassPaneShadow.appendChild(element);\n }\n};\n\n// packages/playwright-core/src/server/injected/injectedScript.ts\nvar InjectedScript = class {\n // eslint-disable-next-line no-restricted-globals\n constructor(window, isUnderTest, sdkLanguage, testIdAttributeNameForStrictErrorAndConsoleCodegen, stableRafCount, browserName, customEngines) {\n this.onGlobalListenersRemoved = /* @__PURE__ */ new Set();\n this._testIdAttributeNameForStrictErrorAndConsoleCodegen = \"data-testid\";\n this.utils = { isInsideScope, elementText, asLocator, normalizeWhiteSpace };\n this.window = window;\n this.document = window.document;\n this.isUnderTest = isUnderTest;\n this._sdkLanguage = sdkLanguage;\n this._testIdAttributeNameForStrictErrorAndConsoleCodegen = testIdAttributeNameForStrictErrorAndConsoleCodegen;\n this._evaluator = new SelectorEvaluatorImpl(/* @__PURE__ */ new Map());\n this._engines = /* @__PURE__ */ new Map();\n this._engines.set(\"xpath\", XPathEngine);\n this._engines.set(\"xpath:light\", XPathEngine);\n this._engines.set(\"_react\", ReactEngine);\n this._engines.set(\"_vue\", VueEngine);\n this._engines.set(\"role\", createRoleEngine(false));\n this._engines.set(\"text\", this._createTextEngine(true, false));\n this._engines.set(\"text:light\", this._createTextEngine(false, false));\n this._engines.set(\"id\", this._createAttributeEngine(\"id\", true));\n this._engines.set(\"id:light\", this._createAttributeEngine(\"id\", false));\n this._engines.set(\"data-testid\", this._createAttributeEngine(\"data-testid\", true));\n this._engines.set(\"data-testid:light\", this._createAttributeEngine(\"data-testid\", false));\n this._engines.set(\"data-test-id\", this._createAttributeEngine(\"data-test-id\", true));\n this._engines.set(\"data-test-id:light\", this._createAttributeEngine(\"data-test-id\", false));\n this._engines.set(\"data-test\", this._createAttributeEngine(\"data-test\", true));\n this._engines.set(\"data-test:light\", this._createAttributeEngine(\"data-test\", false));\n this._engines.set(\"css\", this._createCSSEngine());\n this._engines.set(\"nth\", { queryAll: () => [] });\n this._engines.set(\"visible\", this._createVisibleEngine());\n this._engines.set(\"internal:control\", this._createControlEngine());\n this._engines.set(\"internal:has\", this._createHasEngine());\n this._engines.set(\"internal:has-not\", this._createHasNotEngine());\n this._engines.set(\"internal:and\", { queryAll: () => [] });\n this._engines.set(\"internal:or\", { queryAll: () => [] });\n this._engines.set(\"internal:chain\", this._createInternalChainEngine());\n this._engines.set(\"internal:label\", this._createInternalLabelEngine());\n this._engines.set(\"internal:text\", this._createTextEngine(true, true));\n this._engines.set(\"internal:has-text\", this._createInternalHasTextEngine());\n this._engines.set(\"internal:has-not-text\", this._createInternalHasNotTextEngine());\n this._engines.set(\"internal:attr\", this._createNamedAttributeEngine());\n this._engines.set(\"internal:testid\", this._createNamedAttributeEngine());\n this._engines.set(\"internal:role\", createRoleEngine(true));\n for (const { name, engine } of customEngines)\n this._engines.set(name, engine);\n this._stableRafCount = stableRafCount;\n this._browserName = browserName;\n setBrowserName(browserName);\n this._setupGlobalListenersRemovalDetection();\n this._setupHitTargetInterceptors();\n if (isUnderTest)\n this.window.__injectedScript = this;\n }\n eval(expression) {\n return this.window.eval(expression);\n }\n testIdAttributeNameForStrictErrorAndConsoleCodegen() {\n return this._testIdAttributeNameForStrictErrorAndConsoleCodegen;\n }\n parseSelector(selector) {\n const result = parseSelector(selector);\n visitAllSelectorParts(result, (part) => {\n if (!this._engines.has(part.name))\n throw this.createStacklessError(`Unknown engine \"${part.name}\" while parsing selector ${selector}`);\n });\n return result;\n }\n generateSelector(targetElement, options) {\n return generateSelector(this, targetElement, options);\n }\n generateSelectorSimple(targetElement, options) {\n return generateSelector(this, targetElement, { ...options, testIdAttributeName: this._testIdAttributeNameForStrictErrorAndConsoleCodegen }).selector;\n }\n querySelector(selector, root, strict) {\n const result = this.querySelectorAll(selector, root);\n if (strict && result.length > 1)\n throw this.strictModeViolationError(selector, result);\n return result[0];\n }\n _queryNth(elements, part) {\n const list = [...elements];\n let nth = +part.body;\n if (nth === -1)\n nth = list.length - 1;\n return new Set(list.slice(nth, nth + 1));\n }\n _queryLayoutSelector(elements, part, originalRoot) {\n const name = part.name;\n const body = part.body;\n const result = [];\n const inner = this.querySelectorAll(body.parsed, originalRoot);\n for (const element of elements) {\n const score = layoutSelectorScore(name, element, inner, body.distance);\n if (score !== void 0)\n result.push({ element, score });\n }\n result.sort((a, b) => a.score - b.score);\n return new Set(result.map((r) => r.element));\n }\n querySelectorAll(selector, root) {\n if (selector.capture !== void 0) {\n if (selector.parts.some((part) => part.name === \"nth\"))\n throw this.createStacklessError(`Can't query n-th element in a request with the capture.`);\n const withHas = { parts: selector.parts.slice(0, selector.capture + 1) };\n if (selector.capture < selector.parts.length - 1) {\n const parsed = { parts: selector.parts.slice(selector.capture + 1) };\n const has = { name: \"internal:has\", body: { parsed }, source: stringifySelector(parsed) };\n withHas.parts.push(has);\n }\n return this.querySelectorAll(withHas, root);\n }\n if (!root[\"querySelectorAll\"])\n throw this.createStacklessError(\"Node is not queryable.\");\n if (selector.capture !== void 0) {\n throw this.createStacklessError(\"Internal error: there should not be a capture in the selector.\");\n }\n if (root.nodeType === 11 && selector.parts.length === 1 && selector.parts[0].name === \"css\" && selector.parts[0].source === \":scope\")\n return [root];\n this._evaluator.begin();\n try {\n let roots = /* @__PURE__ */ new Set([root]);\n for (const part of selector.parts) {\n if (part.name === \"nth\") {\n roots = this._queryNth(roots, part);\n } else if (part.name === \"internal:and\") {\n const andElements = this.querySelectorAll(part.body.parsed, root);\n roots = new Set(andElements.filter((e) => roots.has(e)));\n } else if (part.name === \"internal:or\") {\n const orElements = this.querySelectorAll(part.body.parsed, root);\n roots = new Set(sortInDOMOrder(/* @__PURE__ */ new Set([...roots, ...orElements])));\n } else if (kLayoutSelectorNames.includes(part.name)) {\n roots = this._queryLayoutSelector(roots, part, root);\n } else {\n const next = /* @__PURE__ */ new Set();\n for (const root2 of roots) {\n const all = this._queryEngineAll(part, root2);\n for (const one of all)\n next.add(one);\n }\n roots = next;\n }\n }\n return [...roots];\n } finally {\n this._evaluator.end();\n }\n }\n _queryEngineAll(part, root) {\n const result = this._engines.get(part.name).queryAll(root, part.body);\n for (const element of result) {\n if (!(\"nodeName\" in element))\n throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(element)}`);\n }\n return result;\n }\n _createAttributeEngine(attribute, shadow) {\n const toCSS = (selector) => {\n const css = `[${attribute}=${JSON.stringify(selector)}]`;\n return [{ simples: [{ selector: { css, functions: [] }, combinator: \"\" }] }];\n };\n return {\n queryAll: (root, selector) => {\n return this._evaluator.query({ scope: root, pierceShadow: shadow }, toCSS(selector));\n }\n };\n }\n _createCSSEngine() {\n return {\n queryAll: (root, body) => {\n return this._evaluator.query({ scope: root, pierceShadow: true }, body);\n }\n };\n }\n _createTextEngine(shadow, internal) {\n const queryAll = (root, selector) => {\n const { matcher, kind } = createTextMatcher(selector, internal);\n const result = [];\n let lastDidNotMatchSelf = null;\n const appendElement = (element) => {\n if (kind === \"lax\" && lastDidNotMatchSelf && lastDidNotMatchSelf.contains(element))\n return false;\n const matches = elementMatchesText(this._evaluator._cacheText, element, matcher);\n if (matches === \"none\")\n lastDidNotMatchSelf = element;\n if (matches === \"self\" || matches === \"selfAndChildren\" && kind === \"strict\" && !internal)\n result.push(element);\n };\n if (root.nodeType === Node.ELEMENT_NODE)\n appendElement(root);\n const elements = this._evaluator._queryCSS({ scope: root, pierceShadow: shadow }, \"*\");\n for (const element of elements)\n appendElement(element);\n return result;\n };\n return { queryAll };\n }\n _createInternalHasTextEngine() {\n return {\n queryAll: (root, selector) => {\n if (root.nodeType !== 1)\n return [];\n const element = root;\n const text = elementText(this._evaluator._cacheText, element);\n const { matcher } = createTextMatcher(selector, true);\n return matcher(text) ? [element] : [];\n }\n };\n }\n _createInternalHasNotTextEngine() {\n return {\n queryAll: (root, selector) => {\n if (root.nodeType !== 1)\n return [];\n const element = root;\n const text = elementText(this._evaluator._cacheText, element);\n const { matcher } = createTextMatcher(selector, true);\n return matcher(text) ? [] : [element];\n }\n };\n }\n _createInternalLabelEngine() {\n return {\n queryAll: (root, selector) => {\n const { matcher } = createTextMatcher(selector, true);\n const allElements = this._evaluator._queryCSS({ scope: root, pierceShadow: true }, \"*\");\n return allElements.filter((element) => {\n return getElementLabels(this._evaluator._cacheText, element).some((label) => matcher(label));\n });\n }\n };\n }\n _createNamedAttributeEngine() {\n const queryAll = (root, selector) => {\n const parsed = parseAttributeSelector(selector, true);\n if (parsed.name || parsed.attributes.length !== 1)\n throw new Error(\"Malformed attribute selector: \" + selector);\n const { name, value, caseSensitive } = parsed.attributes[0];\n const lowerCaseValue = caseSensitive ? null : value.toLowerCase();\n let matcher;\n if (value instanceof RegExp)\n matcher = (s) => !!s.match(value);\n else if (caseSensitive)\n matcher = (s) => s === value;\n else\n matcher = (s) => s.toLowerCase().includes(lowerCaseValue);\n const elements = this._evaluator._queryCSS({ scope: root, pierceShadow: true }, `[${name}]`);\n return elements.filter((e) => matcher(e.getAttribute(name)));\n };\n return { queryAll };\n }\n _createControlEngine() {\n return {\n queryAll(root, body) {\n if (body === \"enter-frame\")\n return [];\n if (body === \"return-empty\")\n return [];\n if (body === \"component\") {\n if (root.nodeType !== 1)\n return [];\n return [root.childElementCount === 1 ? root.firstElementChild : root];\n }\n throw new Error(`Internal error, unknown internal:control selector ${body}`);\n }\n };\n }\n _createHasEngine() {\n const queryAll = (root, body) => {\n if (root.nodeType !== 1)\n return [];\n const has = !!this.querySelector(body.parsed, root, false);\n return has ? [root] : [];\n };\n return { queryAll };\n }\n _createHasNotEngine() {\n const queryAll = (root, body) => {\n if (root.nodeType !== 1)\n return [];\n const has = !!this.querySelector(body.parsed, root, false);\n return has ? [] : [root];\n };\n return { queryAll };\n }\n _createVisibleEngine() {\n const queryAll = (root, body) => {\n if (root.nodeType !== 1)\n return [];\n return isElementVisible(root) === Boolean(body) ? [root] : [];\n };\n return { queryAll };\n }\n _createInternalChainEngine() {\n const queryAll = (root, body) => {\n return this.querySelectorAll(body.parsed, root);\n };\n return { queryAll };\n }\n extend(source, params) {\n const constrFunction = this.window.eval(`\n (() => {\n const module = {};\n ${source}\n return module.exports.default();\n })()`);\n return new constrFunction(this, params);\n }\n isVisible(element) {\n return isElementVisible(element);\n }\n async viewportRatio(element) {\n return await new Promise((resolve) => {\n const observer = new IntersectionObserver((entries) => {\n resolve(entries[0].intersectionRatio);\n observer.disconnect();\n });\n observer.observe(element);\n requestAnimationFrame(() => {\n });\n });\n }\n getElementBorderWidth(node) {\n if (node.nodeType !== Node.ELEMENT_NODE || !node.ownerDocument || !node.ownerDocument.defaultView)\n return { left: 0, top: 0 };\n const style = node.ownerDocument.defaultView.getComputedStyle(node);\n return { left: parseInt(style.borderLeftWidth || \"\", 10), top: parseInt(style.borderTopWidth || \"\", 10) };\n }\n describeIFrameStyle(iframe) {\n if (!iframe.ownerDocument || !iframe.ownerDocument.defaultView)\n return \"error:notconnected\";\n const defaultView = iframe.ownerDocument.defaultView;\n for (let e = iframe; e; e = parentElementOrShadowHost(e)) {\n if (defaultView.getComputedStyle(e).transform !== \"none\")\n return \"transformed\";\n }\n const iframeStyle = defaultView.getComputedStyle(iframe);\n return {\n left: parseInt(iframeStyle.borderLeftWidth || \"\", 10) + parseInt(iframeStyle.paddingLeft || \"\", 10),\n top: parseInt(iframeStyle.borderTopWidth || \"\", 10) + parseInt(iframeStyle.paddingTop || \"\", 10)\n };\n }\n retarget(node, behavior) {\n let element = node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;\n if (!element)\n return null;\n if (behavior === \"none\")\n return element;\n if (!element.matches(\"input, textarea, select\") && !element.isContentEditable) {\n if (behavior === \"button-link\")\n element = element.closest(\"button, [role=button], a, [role=link]\") || element;\n else\n element = element.closest(\"button, [role=button], [role=checkbox], [role=radio]\") || element;\n }\n if (behavior === \"follow-label\") {\n if (!element.matches(\"input, textarea, button, select, [role=button], [role=checkbox], [role=radio]\") && !element.isContentEditable) {\n element = element.closest(\"label\") || element;\n }\n if (element.nodeName === \"LABEL\")\n element = element.control || element;\n }\n return element;\n }\n async checkElementStates(node, states) {\n if (states.includes(\"stable\")) {\n const stableResult = await this._checkElementIsStable(node);\n if (stableResult === false)\n return { missingState: \"stable\" };\n if (stableResult === \"error:notconnected\")\n return stableResult;\n }\n for (const state of states) {\n if (state !== \"stable\") {\n const result = this.elementState(node, state);\n if (result === false)\n return { missingState: state };\n if (result === \"error:notconnected\")\n return result;\n }\n }\n }\n async _checkElementIsStable(node) {\n const continuePolling = Symbol(\"continuePolling\");\n let lastRect;\n let stableRafCounter = 0;\n let lastTime = 0;\n const check = () => {\n const element = this.retarget(node, \"no-follow-label\");\n if (!element)\n return \"error:notconnected\";\n const time = performance.now();\n if (this._stableRafCount > 1 && time - lastTime < 15)\n return continuePolling;\n lastTime = time;\n const clientRect = element.getBoundingClientRect();\n const rect = { x: clientRect.top, y: clientRect.left, width: clientRect.width, height: clientRect.height };\n if (lastRect) {\n const samePosition = rect.x === lastRect.x && rect.y === lastRect.y && rect.width === lastRect.width && rect.height === lastRect.height;\n if (!samePosition)\n return false;\n if (++stableRafCounter >= this._stableRafCount)\n return true;\n }\n lastRect = rect;\n return continuePolling;\n };\n let fulfill;\n let reject;\n const result = new Promise((f, r) => {\n fulfill = f;\n reject = r;\n });\n const raf = () => {\n try {\n const success = check();\n if (success !== continuePolling)\n fulfill(success);\n else\n requestAnimationFrame(raf);\n } catch (e) {\n reject(e);\n }\n };\n requestAnimationFrame(raf);\n return result;\n }\n elementState(node, state) {\n const element = this.retarget(node, [\"stable\", \"visible\", \"hidden\"].includes(state) ? \"none\" : \"follow-label\");\n if (!element || !element.isConnected) {\n if (state === \"hidden\")\n return true;\n return \"error:notconnected\";\n }\n if (state === \"visible\")\n return this.isVisible(element);\n if (state === \"hidden\")\n return !this.isVisible(element);\n const disabled = getAriaDisabled(element);\n if (state === \"disabled\")\n return disabled;\n if (state === \"enabled\")\n return !disabled;\n const editable = !([\"INPUT\", \"TEXTAREA\", \"SELECT\"].includes(element.nodeName) && element.hasAttribute(\"readonly\"));\n if (state === \"editable\")\n return !disabled && editable;\n if (state === \"checked\" || state === \"unchecked\") {\n const need = state === \"checked\";\n const checked = getChecked(element, false);\n if (checked === \"error\")\n throw this.createStacklessError(\"Not a checkbox or radio button\");\n return need === checked;\n }\n throw this.createStacklessError(`Unexpected element state \"${state}\"`);\n }\n selectOptions(node, optionsToSelect) {\n const element = this.retarget(node, \"follow-label\");\n if (!element)\n return \"error:notconnected\";\n if (element.nodeName.toLowerCase() !== \"select\")\n throw this.createStacklessError(\"Element is not a
'); + if ((internalTLS === null || internalTLS === void 0 ? void 0 : internalTLS.alpnProtocol) === 'h2') { + // This method is available only in Node.js 20+ + if ('performServerHandshake' in _http.default) { + // In case of an 'error' event on the target connection, we still need to perform the http2 handshake on the browser side. + // This is an async operation, so we need to remove the listener to prevent the socket from being closed too early. + // This means we call this._targetCloseEventListener manually. + this.target.removeListener('close', this._targetCloseEventListener); + // @ts-expect-error + const session = _http.default.performServerHandshake(internalTLS); + session.on('error', () => { + this.target.destroy(); + this._targetCloseEventListener(); + }); + session.once('stream', stream => { + stream.respond({ + 'content-type': 'text/html', + [_http.default.constants.HTTP2_HEADER_STATUS]: 503 + }); + const cleanup = () => { + session.close(); + this.target.destroy(); + this._targetCloseEventListener(); + }; + stream.end(responseBody, cleanup); + stream.once('error', cleanup); + }); + } else { + this.target.destroy(); + } + } else { + internalTLS.end(['HTTP/1.1 503 Internal Server Error', 'Content-Type: text/html; charset=utf-8', 'Content-Length: ' + Buffer.byteLength(responseBody), '', responseBody].join('\r\n')); + this.target.destroy(); + } + }; + if (this._closed) { + internalTLS.destroy(); + return; + } + targetTLS = _tls.default.connect({ + socket: this.target, + host: this.host, + port: this.port, + rejectUnauthorized: !this.socksProxy.ignoreHTTPSErrors, + ALPNProtocols: [internalTLS.alpnProtocol || 'http/1.1'], + servername: !_net.default.isIP(this.host) ? this.host : undefined, + secureContext: this.socksProxy.secureContextMap.get(new URL(`https://${this.host}:${this.port}`).origin) + }); + targetTLS.once('secureConnect', () => { + internalTLS.pipe(targetTLS); + targetTLS.pipe(internalTLS); + }); + internalTLS.once('error', () => this.target.destroy()); + targetTLS.once('error', handleError); + }); + }); + } +} +class ClientCertificatesProxy { + constructor(contextOptions) { + this._socksProxy = void 0; + this._connections = new Map(); + this.ignoreHTTPSErrors = void 0; + this.secureContextMap = new Map(); + this.alpnCache = void 0; + this.proxyAgentFromOptions = void 0; + (0, _browserContext.verifyClientCertificates)(contextOptions.clientCertificates); + this.alpnCache = new ALPNCache(); + this.ignoreHTTPSErrors = contextOptions.ignoreHTTPSErrors; + this.proxyAgentFromOptions = contextOptions.proxy ? (0, _fetch.createProxyAgent)(contextOptions.proxy) : undefined; + this._initSecureContexts(contextOptions.clientCertificates); + this._socksProxy = new _socksProxy.SocksProxy(); + this._socksProxy.setPattern('*'); + this._socksProxy.addListener(_socksProxy.SocksProxy.Events.SocksRequested, async payload => { + try { + const connection = new SocksProxyConnection(this, payload.uid, payload.host, payload.port); + await connection.connect(); + this._connections.set(payload.uid, connection); + } catch (error) { + this._socksProxy.socketFailed({ + uid: payload.uid, + errorCode: error.code + }); + } + }); + this._socksProxy.addListener(_socksProxy.SocksProxy.Events.SocksData, async payload => { + var _this$_connections$ge; + (_this$_connections$ge = this._connections.get(payload.uid)) === null || _this$_connections$ge === void 0 || _this$_connections$ge.onData(payload.data); + }); + this._socksProxy.addListener(_socksProxy.SocksProxy.Events.SocksClosed, payload => { + var _this$_connections$ge2; + (_this$_connections$ge2 = this._connections.get(payload.uid)) === null || _this$_connections$ge2 === void 0 || _this$_connections$ge2.onClose(); + this._connections.delete(payload.uid); + }); + loadDummyServerCertsIfNeeded(); + } + _initSecureContexts(clientCertificates) { + // Step 1. Group certificates by origin. + const origin2certs = new Map(); + for (const cert of clientCertificates || []) { + const origin = normalizeOrigin(cert.origin); + const certs = origin2certs.get(origin) || []; + certs.push(cert); + origin2certs.set(origin, certs); + } + + // Step 2. Create secure contexts for each origin. + for (const [origin, certs] of origin2certs) { + try { + this.secureContextMap.set(origin, _tls.default.createSecureContext(convertClientCertificatesToTLSOptions(certs))); + } catch (error) { + error = rewriteOpenSSLErrorIfNeeded(error); + throw (0, _utils.rewriteErrorMessage)(error, `Failed to load client certificate: ${error.message}`); + } + } + } + async listen() { + const port = await this._socksProxy.listen(0, '127.0.0.1'); + return { + server: `socks5://127.0.0.1:${port}` + }; + } + async close() { + await this._socksProxy.close(); + } +} +exports.ClientCertificatesProxy = ClientCertificatesProxy; +function normalizeOrigin(origin) { + try { + return new URL(origin).origin; + } catch (error) { + return origin; + } +} +function convertClientCertificatesToTLSOptions(clientCertificates) { + if (!clientCertificates || !clientCertificates.length) return; + const tlsOptions = { + pfx: [], + key: [], + cert: [] + }; + for (const cert of clientCertificates) { + if (cert.cert) tlsOptions.cert.push(cert.cert); + if (cert.key) tlsOptions.key.push({ + pem: cert.key, + passphrase: cert.passphrase + }); + if (cert.pfx) tlsOptions.pfx.push({ + buf: cert.pfx, + passphrase: cert.passphrase + }); + } + return tlsOptions; +} +function getMatchingTLSOptionsForOrigin(clientCertificates, origin) { + const matchingCerts = clientCertificates === null || clientCertificates === void 0 ? void 0 : clientCertificates.filter(c => normalizeOrigin(c.origin) === origin); + return convertClientCertificatesToTLSOptions(matchingCerts); +} +function rewriteToLocalhostIfNeeded(host) { + return host === 'local.playwright' ? 'localhost' : host; +} +function rewriteOpenSSLErrorIfNeeded(error) { + if (error.message !== 'unsupported' && error.code !== 'ERR_CRYPTO_UNSUPPORTED_OPERATION') return error; + return (0, _utils.rewriteErrorMessage)(error, ['Unsupported TLS certificate.', 'Most likely, the security algorithm of the given certificate was deprecated by OpenSSL.', 'For more details, see https://github.com/openssl/openssl/blob/master/README-PROVIDERS.md#the-legacy-provider', 'You could probably modernize the certificate by following the steps at https://github.com/nodejs/node/issues/40672#issuecomment-1243648223'].join('\n')); +} \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js b/priv/static/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js index 41abbd7f..581fa894 100644 --- a/priv/static/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +++ b/priv/static/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js @@ -81,21 +81,10 @@ class Snapshotter { dispose() { _eventsHelper.eventsHelper.removeEventListeners(this._eventListeners); } - async captureSnapshot(page, callId, snapshotName, element) { + async captureSnapshot(page, callId, snapshotName) { // Prepare expression synchronously. const expression = `window["${this._snapshotStreamer}"].captureSnapshot(${JSON.stringify(snapshotName)})`; - // In a best-effort manner, without waiting for it, mark target element. - element === null || element === void 0 || element.callFunctionNoReply((element, callId) => { - const customEvent = new CustomEvent('__playwright_target__', { - bubbles: true, - cancelable: true, - detail: callId, - composed: true - }); - element.dispatchEvent(customEvent); - }, callId); - // In each frame, in a non-stalling manner, capture the snapshots. const snapshots = page.frames().map(async frame => { const data = await frame.nonStallingRawEvaluateInExistingMainContext(expression).catch(e => _debugLogger.debugLogger.log('error', e)); @@ -111,6 +100,7 @@ class Snapshotter { html: data.html, viewport: data.viewport, timestamp: (0, _utils.monotonicTime)(), + wallTime: data.wallTime, collectionTime: data.collectionTime, resourceOverrides: [], isMainFrame: page.mainFrame() === frame diff --git a/priv/static/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js b/priv/static/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js index 8bc2dfda..ccd043b6 100644 --- a/priv/static/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +++ b/priv/static/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js @@ -35,6 +35,7 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) { const kTargetAttribute = '__playwright_target__'; const kCustomElementsAttribute = '__playwright_custom_elements__'; const kCurrentSrcAttribute = '__playwright_current_src__'; + const kBoundingRectAttribute = '__playwright_bounding_rect__'; // Symbols for our own info on Nodes/StyleSheets. const kSnapshotFrameId = Symbol('__playwright_snapshot_frameid_'); @@ -112,11 +113,16 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) { }); } _refreshListeners() { - document.addEventListener('__playwright_target__', event => { + document.addEventListener('__playwright_mark_target__', event => { if (!event.detail) return; const callId = event.detail; event.composedPath()[0].__playwright_target__ = callId; }); + document.addEventListener('__playwright_unmark_target__', event => { + if (!event.detail) return; + const callId = event.detail; + if (event.composedPath()[0].__playwright_target__ === callId) delete event.composedPath()[0].__playwright_target__; + }); } _interceptNativeMethod(obj, method, cb) { const native = obj[method]; @@ -348,6 +354,18 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) { expectValue(value); attrs[kSelectedAttribute] = value; } + if (nodeName === 'CANVAS') { + const boundingRect = element.getBoundingClientRect(); + const value = JSON.stringify({ + left: boundingRect.left / window.innerWidth, + top: boundingRect.top / window.innerHeight, + right: boundingRect.right / window.innerWidth, + bottom: boundingRect.bottom / window.innerHeight + }); + expectValue(kBoundingRectAttribute); + expectValue(value); + attrs[kBoundingRectAttribute] = value; + } if (element.scrollTop) { expectValue(kScrollTopAttribute); expectValue(element.scrollTop); @@ -467,7 +485,7 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) { height: window.innerHeight }, url: location.href, - timestamp, + wallTime: Date.now(), collectionTime: 0 }; for (const sheet of this._staleStyleSheets) { @@ -485,7 +503,7 @@ function frameSnapshotStreamer(snapshotStreamer, removeNoScript) { contentType: 'text/css' }); } - result.collectionTime = performance.now() - result.timestamp; + result.collectionTime = performance.now() - timestamp; return result; } } diff --git a/priv/static/node_modules/playwright-core/lib/server/trace/recorder/tracing.js b/priv/static/node_modules/playwright-core/lib/server/trace/recorder/tracing.js index 2fbb3da6..7778ab3f 100644 --- a/priv/static/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +++ b/priv/static/node_modules/playwright-core/lib/server/trace/recorder/tracing.js @@ -9,17 +9,13 @@ var _fs = _interopRequireDefault(require("fs")); var _os = _interopRequireDefault(require("os")); var _path = _interopRequireDefault(require("path")); var _debug = require("../../../protocol/debug"); -var _manualPromise = require("../../../utils/manualPromise"); -var _eventsHelper = require("../../../utils/eventsHelper"); var _utils = require("../../../utils"); -var _fileUtils = require("../../../utils/fileUtils"); var _artifact = require("../../artifact"); var _browserContext = require("../../browserContext"); var _instrumentation = require("../../instrumentation"); var _page = require("../../page"); var _harTracer = require("../../har/harTracer"); var _snapshotter = require("./snapshotter"); -var _zipBundle = require("../../../zipBundle"); var _dispatcher = require("../../dispatchers/dispatcher"); var _errors = require("../../errors"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -39,7 +35,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * limitations under the License. */ -const version = 6; +const version = 7; const kScreencastOptions = { width: 800, height: 600, @@ -48,7 +44,7 @@ const kScreencastOptions = { class Tracing extends _instrumentation.SdkObject { constructor(context, tracesDir) { super(context, 'tracing'); - this._fs = new SerializedFS(); + this._fs = new _utils.SerializedFS(); this._snapshotter = void 0; this._harTracer = void 0; this._screencastListeners = []; @@ -74,10 +70,12 @@ class Tracing extends _instrumentation.SdkObject { this._contextCreatedEvent = { version, type: 'context-options', + origin: 'library', browserName: '', options: {}, platform: process.platform, wallTime: 0, + monotonicTime: 0, sdkLanguage: context.attribution.playwright.options.sdkLanguage, testIdAttributeName }; @@ -122,7 +120,8 @@ class Tracing extends _instrumentation.SdkObject { traceSha1s: new Set(), networkSha1s: new Set(), recording: false, - callIds: new Set() + callIds: new Set(), + groupStack: [] }; this._fs.mkdir(this._state.resourcesDir); this._fs.writeFile(this._state.networkFile, ''); @@ -145,24 +144,71 @@ class Tracing extends _instrumentation.SdkObject { const event = { ...this._contextCreatedEvent, title: options.title, - wallTime: Date.now() + wallTime: Date.now(), + monotonicTime: (0, _utils.monotonicTime)() }; - this._fs.appendFile(this._state.traceFile, JSON.stringify(event) + '\n'); + this._appendTraceEvent(event); this._context.instrumentation.addListener(this, this._context); - this._eventListeners.push(_eventsHelper.eventsHelper.addEventListener(this._context, _browserContext.BrowserContext.Events.Console, this._onConsoleMessage.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._context, _browserContext.BrowserContext.Events.PageError, this._onPageError.bind(this))); + this._eventListeners.push(_utils.eventsHelper.addEventListener(this._context, _browserContext.BrowserContext.Events.Console, this._onConsoleMessage.bind(this)), _utils.eventsHelper.addEventListener(this._context, _browserContext.BrowserContext.Events.PageError, this._onPageError.bind(this))); if (this._state.options.screenshots) this._startScreencast(); if (this._state.options.snapshots) await ((_this$_snapshotter2 = this._snapshotter) === null || _this$_snapshotter2 === void 0 ? void 0 : _this$_snapshotter2.start()); return { traceName: this._state.traceName }; } + _currentGroupId() { + var _this$_state; + return (_this$_state = this._state) !== null && _this$_state !== void 0 && _this$_state.groupStack.length ? this._state.groupStack[this._state.groupStack.length - 1] : undefined; + } + async group(name, location, metadata) { + var _ref; + if (!this._state) return; + const stackFrames = []; + const { + file, + line, + column + } = (_ref = location !== null && location !== void 0 ? location : metadata.location) !== null && _ref !== void 0 ? _ref : {}; + if (file) { + stackFrames.push({ + file, + line: line !== null && line !== void 0 ? line : 0, + column: column !== null && column !== void 0 ? column : 0 + }); + } + const event = { + type: 'before', + callId: metadata.id, + startTime: metadata.startTime, + apiName: name, + class: 'Tracing', + method: 'tracingGroup', + params: {}, + stepId: metadata.stepId, + stack: stackFrames + }; + if (this._currentGroupId()) event.parentId = this._currentGroupId(); + this._state.groupStack.push(event.callId); + this._appendTraceEvent(event); + } + groupEnd() { + if (!this._state) return; + const callId = this._state.groupStack.pop(); + if (!callId) return; + const event = { + type: 'after', + callId, + endTime: (0, _utils.monotonicTime)() + }; + this._appendTraceEvent(event); + } _startScreencast() { if (!(this._context instanceof _browserContext.BrowserContext)) return; for (const page of this._context.pages()) this._startScreencastInPage(page); - this._screencastListeners.push(_eventsHelper.eventsHelper.addEventListener(this._context, _browserContext.BrowserContext.Events.Page, this._startScreencastInPage.bind(this))); + this._screencastListeners.push(_utils.eventsHelper.addEventListener(this._context, _browserContext.BrowserContext.Events.Page, this._startScreencastInPage.bind(this))); } _stopScreencast() { - _eventsHelper.eventsHelper.removeEventListeners(this._screencastListeners); + _utils.eventsHelper.removeEventListeners(this._screencastListeners); if (!(this._context instanceof _browserContext.BrowserContext)) return; for (const page of this._context.pages()) page.setScreencastOptions(null); } @@ -185,13 +231,14 @@ class Tracing extends _instrumentation.SdkObject { if (!this._state) return; if (this._isStopping) throw new Error(`Tracing is already stopping`); if (this._state.recording) throw new Error(`Must stop trace file before stopping tracing`); + this._closeAllGroups(); this._harTracer.stop(); this.flushHarEntries(); await this._fs.syncAndGetError(); this._state = undefined; } async deleteTmpTracesDir() { - if (this._tracesTmpDir) await (0, _fileUtils.removeFolders)([this._tracesTmpDir]); + if (this._tracesTmpDir) await (0, _utils.removeFolders)([this._tracesTmpDir]); } _createTracesDirIfNeeded() { if (this._precreatedTracesDir) return this._precreatedTracesDir; @@ -207,6 +254,9 @@ class Tracing extends _instrumentation.SdkObject { this.abort(); await this._fs.syncAndGetError(); } + _closeAllGroups() { + while (this._currentGroupId()) this.groupEnd(); + } async stopChunk(params) { var _this$_snapshotter4; if (this._isStopping) throw new Error(`Tracing is already stopping`); @@ -216,8 +266,9 @@ class Tracing extends _instrumentation.SdkObject { if (params.mode !== 'discard') throw new Error(`Must start tracing before stopping`); return {}; } + this._closeAllGroups(); this._context.instrumentation.removeListener(this); - _eventsHelper.eventsHelper.removeEventListeners(this._eventListeners); + _utils.eventsHelper.removeEventListeners(this._eventListeners); if (this._state.options.screenshots) this._stopScreencast(); if (this._state.options.snapshots) await ((_this$_snapshotter4 = this._snapshotter) === null || _this$_snapshotter4 === void 0 ? void 0 : _this$_snapshotter4.stop()); this.flushHarEntries(); @@ -276,34 +327,34 @@ class Tracing extends _instrumentation.SdkObject { artifact }; } - async _captureSnapshot(snapshotName, sdkObject, metadata, element) { + async _captureSnapshot(snapshotName, sdkObject, metadata) { if (!this._snapshotter) return; if (!sdkObject.attribution.page) return; if (!this._snapshotter.started()) return; if (!shouldCaptureSnapshot(metadata)) return; - await this._snapshotter.captureSnapshot(sdkObject.attribution.page, metadata.id, snapshotName, element).catch(() => {}); + await this._snapshotter.captureSnapshot(sdkObject.attribution.page, metadata.id, snapshotName).catch(() => {}); } onBeforeCall(sdkObject, metadata) { - var _sdkObject$attributio, _this$_state; + var _sdkObject$attributio, _this$_state2; // IMPORTANT: no awaits before this._appendTraceEvent in this method. - const event = createBeforeActionTraceEvent(metadata); + const event = createBeforeActionTraceEvent(metadata, this._currentGroupId()); if (!event) return Promise.resolve(); (_sdkObject$attributio = sdkObject.attribution.page) === null || _sdkObject$attributio === void 0 || _sdkObject$attributio.temporarilyDisableTracingScreencastThrottling(); event.beforeSnapshot = `before@${metadata.id}`; - (_this$_state = this._state) === null || _this$_state === void 0 || _this$_state.callIds.add(metadata.id); + (_this$_state2 = this._state) === null || _this$_state2 === void 0 || _this$_state2.callIds.add(metadata.id); this._appendTraceEvent(event); return this._captureSnapshot(event.beforeSnapshot, sdkObject, metadata); } - onBeforeInputAction(sdkObject, metadata, element) { - var _this$_state2, _sdkObject$attributio2; - if (!((_this$_state2 = this._state) !== null && _this$_state2 !== void 0 && _this$_state2.callIds.has(metadata.id))) return Promise.resolve(); + onBeforeInputAction(sdkObject, metadata) { + var _this$_state3, _sdkObject$attributio2; + if (!((_this$_state3 = this._state) !== null && _this$_state3 !== void 0 && _this$_state3.callIds.has(metadata.id))) return Promise.resolve(); // IMPORTANT: no awaits before this._appendTraceEvent in this method. const event = createInputActionTraceEvent(metadata); if (!event) return Promise.resolve(); (_sdkObject$attributio2 = sdkObject.attribution.page) === null || _sdkObject$attributio2 === void 0 || _sdkObject$attributio2.temporarilyDisableTracingScreencastThrottling(); event.inputSnapshot = `input@${metadata.id}`; this._appendTraceEvent(event); - return this._captureSnapshot(event.inputSnapshot, sdkObject, metadata, element); + return this._captureSnapshot(event.inputSnapshot, sdkObject, metadata); } onCallLog(sdkObject, metadata, logName, message) { if (metadata.isServerSide || metadata.internal) return; @@ -312,9 +363,9 @@ class Tracing extends _instrumentation.SdkObject { if (event) this._appendTraceEvent(event); } async onAfterCall(sdkObject, metadata) { - var _this$_state3, _this$_state4, _sdkObject$attributio3; - if (!((_this$_state3 = this._state) !== null && _this$_state3 !== void 0 && _this$_state3.callIds.has(metadata.id))) return; - (_this$_state4 = this._state) === null || _this$_state4 === void 0 || _this$_state4.callIds.delete(metadata.id); + var _this$_state4, _this$_state5, _sdkObject$attributio3; + if (!((_this$_state4 = this._state) !== null && _this$_state4 !== void 0 && _this$_state4.callIds.has(metadata.id))) return; + (_this$_state5 = this._state) === null || _this$_state5 === void 0 || _this$_state5.callIds.delete(metadata.id); const event = createAfterActionTraceEvent(metadata); if (!event) return; (_sdkObject$attributio3 = sdkObject.attribution.page) === null || _sdkObject$attributio3 === void 0 || _sdkObject$attributio3.temporarilyDisableTracingScreencastThrottling(); @@ -375,6 +426,61 @@ class Tracing extends _instrumentation.SdkObject { }; this._appendTraceEvent(event); } + onDialog(dialog) { + const event = { + type: 'event', + time: (0, _utils.monotonicTime)(), + class: 'BrowserContext', + method: 'dialog', + params: { + pageId: dialog.page().guid, + type: dialog.type(), + message: dialog.message(), + defaultValue: dialog.defaultValue() + } + }; + this._appendTraceEvent(event); + } + onDownload(page, download) { + const event = { + type: 'event', + time: (0, _utils.monotonicTime)(), + class: 'BrowserContext', + method: 'download', + params: { + pageId: page.guid, + url: download.url, + suggestedFilename: download.suggestedFilename() + } + }; + this._appendTraceEvent(event); + } + onPageOpen(page) { + var _page$opener; + const event = { + type: 'event', + time: (0, _utils.monotonicTime)(), + class: 'BrowserContext', + method: 'page', + params: { + pageId: page.guid, + openerPageId: (_page$opener = page.opener()) === null || _page$opener === void 0 ? void 0 : _page$opener.guid + } + }; + this._appendTraceEvent(event); + } + onPageClose(page) { + const event = { + type: 'event', + time: (0, _utils.monotonicTime)(), + class: 'BrowserContext', + method: 'pageClosed', + params: { + pageId: page.guid + } + }; + this._appendTraceEvent(event); + } _onPageError(error, page) { const event = { type: 'event', @@ -391,7 +497,7 @@ class Tracing extends _instrumentation.SdkObject { _startScreencastInPage(page) { page.setScreencastOptions(kScreencastOptions); const prefix = page.guid; - this._screencastListeners.push(_eventsHelper.eventsHelper.addEventListener(page, _page.Page.Events.ScreencastFrame, params => { + this._screencastListeners.push(_utils.eventsHelper.addEventListener(page, _page.Page.Events.ScreencastFrame, params => { const suffix = params.timestamp || Date.now(); const sha1 = `${prefix}-${suffix}.jpeg`; const event = { @@ -400,7 +506,8 @@ class Tracing extends _instrumentation.SdkObject { sha1, width: params.width, height: params.height, - timestamp: (0, _utils.monotonicTime)() + timestamp: (0, _utils.monotonicTime)(), + frameSwapWallTime: params.frameSwapWallTime }; // Make sure to write the screencast frame before adding a reference to it. this._appendResource(sha1, params.buffer); @@ -442,9 +549,9 @@ function visitTraceEvent(object, sha1s) { function shouldCaptureSnapshot(metadata) { return _debug.commandsWithTracingSnapshots.has(metadata.type + '.' + metadata.method); } -function createBeforeActionTraceEvent(metadata) { +function createBeforeActionTraceEvent(metadata, parentId) { if (metadata.internal || metadata.method.startsWith('tracing')) return null; - return { + const event = { type: 'before', callId: metadata.id, startTime: metadata.startTime, @@ -452,9 +559,11 @@ function createBeforeActionTraceEvent(metadata) { class: metadata.type, method: metadata.method, params: metadata.params, - wallTime: metadata.wallTime, + stepId: metadata.stepId, pageId: metadata.pageId }; + if (parentId) event.parentId = parentId; + return event; } function createInputActionTraceEvent(metadata) { if (metadata.internal || metadata.method.startsWith('tracing')) return null; @@ -484,78 +593,4 @@ function createAfterActionTraceEvent(metadata) { result: metadata.result, point: metadata.point }; -} -class SerializedFS { - constructor() { - this._writeChain = Promise.resolve(); - this._buffers = new Map(); - // Should never be accessed from within appendOperation. - this._error = void 0; - } - mkdir(dir) { - this._appendOperation(() => _fs.default.promises.mkdir(dir, { - recursive: true - })); - } - writeFile(file, content, skipIfExists) { - this._buffers.delete(file); // No need to flush the buffer since we'll overwrite anyway. - - // Note: 'wx' flag only writes when the file does not exist. - // See https://nodejs.org/api/fs.html#file-system-flags. - // This way tracing never have to write the same resource twice. - this._appendOperation(async () => { - if (skipIfExists) await _fs.default.promises.writeFile(file, content, { - flag: 'wx' - }).catch(() => {});else await _fs.default.promises.writeFile(file, content); - }); - } - appendFile(file, text, flush) { - if (!this._buffers.has(file)) this._buffers.set(file, []); - this._buffers.get(file).push(text); - if (flush) this._flushFile(file); - } - _flushFile(file) { - const buffer = this._buffers.get(file); - if (buffer === undefined) return; - const text = buffer.join(''); - this._buffers.delete(file); - this._appendOperation(() => _fs.default.promises.appendFile(file, text)); - } - copyFile(from, to) { - this._flushFile(from); - this._buffers.delete(to); // No need to flush the buffer since we'll overwrite anyway. - this._appendOperation(() => _fs.default.promises.copyFile(from, to)); - } - async syncAndGetError() { - for (const file of this._buffers.keys()) this._flushFile(file); - await this._writeChain; - return this._error; - } - zip(entries, zipFileName) { - for (const file of this._buffers.keys()) this._flushFile(file); - - // Chain the export operation against write operations, - // so that files do not change during the export. - this._appendOperation(async () => { - const zipFile = new _zipBundle.yazl.ZipFile(); - const result = new _manualPromise.ManualPromise(); - zipFile.on('error', error => result.reject(error)); - for (const entry of entries) zipFile.addFile(entry.value, entry.name); - zipFile.end(); - zipFile.outputStream.pipe(_fs.default.createWriteStream(zipFileName)).on('close', () => result.resolve()).on('error', error => result.reject(error)); - await result; - }); - } - _appendOperation(cb) { - // This method serializes all writes to the trace. - this._writeChain = this._writeChain.then(async () => { - // Ignore all operations after the first error. - if (this._error) return; - try { - await cb(); - } catch (e) { - this._error = e; - } - }); - } } \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js b/priv/static/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js index c7819f18..47b7fab0 100644 --- a/priv/static/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js +++ b/priv/static/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js @@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.InMemorySnapshotter = void 0; -var _snapshotStorage = require("../../../../../trace-viewer/src/snapshotStorage"); +var _snapshotStorage = require("../../../../../trace-viewer/src/sw/snapshotStorage"); var _snapshotter = require("../recorder/snapshotter"); var _harTracer = require("../../har/harTracer"); var _utils = require("../../../utils"); @@ -60,9 +60,9 @@ class InMemorySnapshotter { await this._harTracer.flush(); this._harTracer.stop(); } - async captureSnapshot(page, callId, snapshotName, element) { + async captureSnapshot(page, callId, snapshotName) { if (this._snapshotReadyPromises.has(snapshotName)) throw new Error('Duplicate snapshot name: ' + snapshotName); - this._snapshotter.captureSnapshot(page, callId, snapshotName, element).catch(() => {}); + this._snapshotter.captureSnapshot(page, callId, snapshotName).catch(() => {}); const promise = new _utils.ManualPromise(); this._snapshotReadyPromises.set(snapshotName, promise); return promise; @@ -80,7 +80,7 @@ class InMemorySnapshotter { onFrameSnapshot(snapshot) { var _this$_snapshotReadyP; ++this._snapshotCount; - const renderer = this._storage.addFrameSnapshot(snapshot); + const renderer = this._storage.addFrameSnapshot(snapshot, []); (_this$_snapshotReadyP = this._snapshotReadyPromises.get(snapshot.snapshotName || '')) === null || _this$_snapshotReadyP === void 0 || _this$_snapshotReadyP.resolve(renderer); } async resourceContentForTest(sha1) { diff --git a/priv/static/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js b/priv/static/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js index 241c4c4d..98211737 100644 --- a/priv/static/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +++ b/priv/static/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js @@ -84,6 +84,7 @@ async function startTraceViewerServer(options) { } async function installRootRedirect(server, traceUrls, options) { const params = new URLSearchParams(); + if (_path.default.sep !== _path.default.posix.sep) params.set('pathSeparator', _path.default.sep); for (const traceUrl of traceUrls) params.append('trace', traceUrl); if (server.wsGuid()) params.append('ws', server.wsGuid()); if (options !== null && options !== void 0 && options.isServer) params.append('isServer', ''); @@ -92,11 +93,8 @@ async function installRootRedirect(server, traceUrls, options) { if (options.grep) params.append('grep', options.grep); if (options.grepInvert) params.append('grepInvert', options.grepInvert); for (const project of options.project || []) params.append('project', project); - if (options.workers) params.append('workers', String(options.workers)); - if (options.timeout) params.append('timeout', String(options.timeout)); - if (options.headed) params.append('headed', ''); for (const reporter of options.reporter || []) params.append('reporter', reporter); - const urlPath = `/trace/${options.webApp || 'index.html'}?${params.toString()}`; + const urlPath = `./trace/${options.webApp || 'index.html'}?${params.toString()}`; server.routePath('/', (_, response) => { response.statusCode = 302; response.setHeader('Location', urlPath); @@ -108,7 +106,7 @@ async function runTraceViewerApp(traceUrls, browserName, options, exitOnClose) { validateTraceUrls(traceUrls); const server = await startTraceViewerServer(options); await installRootRedirect(server, traceUrls, options); - const page = await openTraceViewerApp(server.urlPrefix(), browserName, options); + const page = await openTraceViewerApp(server.urlPrefix('precise'), browserName, options); if (exitOnClose) page.on('close', () => (0, _utils.gracefullyProcessExitDoNotHang)(0)); return page; } @@ -116,7 +114,7 @@ async function runTraceInBrowser(traceUrls, options) { validateTraceUrls(traceUrls); const server = await startTraceViewerServer(options); await installRootRedirect(server, traceUrls, options); - await openTraceInBrowser(server.urlPrefix()); + await openTraceInBrowser(server.urlPrefix('human-readable')); } async function openTraceViewerApp(url, browserName, options) { const traceViewerPlaywright = (0, _playwright.createPlaywright)({ @@ -137,7 +135,8 @@ async function openTraceViewerApp(url, browserName, options) { persistentContextOptions: { ...(options === null || options === void 0 ? void 0 : options.persistentContextOptions), useWebSocket: (0, _utils.isUnderTest)(), - headless: !!(options !== null && options !== void 0 && options.headless) + headless: !!(options !== null && options !== void 0 && options.headless), + colorScheme: (0, _utils.isUnderTest)() ? 'light' : undefined } }); const controller = new _progress.ProgressController((0, _instrumentation.serverSideCallMetadata)(), context._browser); @@ -170,6 +169,7 @@ class StdinServer { }); process.stdin.on('close', () => (0, _utils.gracefullyProcessExitDoNotHang)(0)); } + onconnect() {} async dispatch(method, params) { if (method === 'initialize') { if (this._traceUrl) this._loadTrace(this._traceUrl); diff --git a/priv/static/node_modules/playwright-core/lib/server/webkit/webkit.js b/priv/static/node_modules/playwright-core/lib/server/webkit/webkit.js index 6a021fd1..3cbe077a 100644 --- a/priv/static/node_modules/playwright-core/lib/server/webkit/webkit.js +++ b/priv/static/node_modules/playwright-core/lib/server/webkit/webkit.js @@ -31,31 +31,30 @@ class WebKit extends _browserType.BrowserType { constructor(parent) { super(parent, 'webkit'); } - _connectToTransport(transport, options) { + connectToTransport(transport, options) { return _wkBrowser.WKBrowser.connect(this.attribution.playwright, transport, options); } - _amendEnvironment(env, userDataDir, executable, browserArguments) { + amendEnvironment(env, userDataDir, executable, browserArguments) { return { ...env, CURL_COOKIE_JAR_PATH: _path.default.join(userDataDir, 'cookiejar.db') }; } - _doRewriteStartupLog(error) { + doRewriteStartupLog(error) { if (!error.logs) return error; if (error.logs.includes('cannot open display')) error.logs = '\n' + (0, _utils.wrapInASCIIBox)(_browserType.kNoXServerRunningError, 1); return error; } - _attemptToGracefullyCloseBrowser(transport) { + attemptToGracefullyCloseBrowser(transport) { transport.send({ method: 'Playwright.close', params: {}, id: _wkConnection.kBrowserCloseMessageId }); } - _defaultArgs(options, isPersistent, userDataDir) { + defaultArgs(options, isPersistent, userDataDir) { const { args = [], - proxy, headless } = options; const userDataDirArg = args.find(arg => arg.startsWith('--user-data-dir')); @@ -65,6 +64,7 @@ class WebKit extends _browserType.BrowserType { if (process.platform === 'win32') webkitArguments.push('--disable-accelerated-compositing'); if (headless) webkitArguments.push('--headless'); if (isPersistent) webkitArguments.push(`--user-data-dir=${userDataDir}`);else webkitArguments.push(`--no-startup-window`); + const proxy = options.proxyOverride || options.proxy; if (proxy) { if (process.platform === 'darwin') { webkitArguments.push(`--proxy=${proxy.server}`); diff --git a/priv/static/node_modules/playwright-core/lib/server/webkit/wkBrowser.js b/priv/static/node_modules/playwright-core/lib/server/webkit/wkBrowser.js index 95ddc507..108feff7 100644 --- a/priv/static/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +++ b/priv/static/node_modules/playwright-core/lib/server/webkit/wkBrowser.js @@ -7,7 +7,6 @@ exports.WKBrowserContext = exports.WKBrowser = void 0; var _browser = require("../browser"); var _browserContext = require("../browserContext"); var _utils = require("../../utils"); -var _eventsHelper = require("../../utils/eventsHelper"); var network = _interopRequireWildcard(require("../network")); var _wkConnection = require("./wkConnection"); var _wkPage = require("./wkPage"); @@ -31,8 +30,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; * limitations under the License. */ -const DEFAULT_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15'; -const BROWSER_VERSION = '17.4'; +const DEFAULT_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15'; +const BROWSER_VERSION = '18.2'; class WKBrowser extends _browser.Browser { static async connect(parent, transport, options) { const browser = new WKBrowser(parent, transport, options); @@ -53,10 +52,17 @@ class WKBrowser extends _browser.Browser { this._browserSession = void 0; this._contexts = new Map(); this._wkPages = new Map(); - this._eventListeners = void 0; this._connection = new _wkConnection.WKConnection(transport, this._onDisconnect.bind(this), options.protocolLogger, options.browserLogsCollector); this._browserSession = this._connection.browserSession; - this._eventListeners = [_eventsHelper.eventsHelper.addEventListener(this._browserSession, 'Playwright.pageProxyCreated', this._onPageProxyCreated.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._browserSession, 'Playwright.pageProxyDestroyed', this._onPageProxyDestroyed.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._browserSession, 'Playwright.provisionalLoadFailed', event => this._onProvisionalLoadFailed(event)), _eventsHelper.eventsHelper.addEventListener(this._browserSession, 'Playwright.windowOpen', event => this._onWindowOpen(event)), _eventsHelper.eventsHelper.addEventListener(this._browserSession, 'Playwright.downloadCreated', this._onDownloadCreated.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._browserSession, 'Playwright.downloadFilenameSuggested', this._onDownloadFilenameSuggested.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._browserSession, 'Playwright.downloadFinished', this._onDownloadFinished.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._browserSession, 'Playwright.screencastFinished', this._onScreencastFinished.bind(this)), _eventsHelper.eventsHelper.addEventListener(this._browserSession, _wkConnection.kPageProxyMessageReceived, this._onPageProxyMessageReceived.bind(this))]; + this._browserSession.on('Playwright.pageProxyCreated', this._onPageProxyCreated.bind(this)); + this._browserSession.on('Playwright.pageProxyDestroyed', this._onPageProxyDestroyed.bind(this)); + this._browserSession.on('Playwright.provisionalLoadFailed', event => this._onProvisionalLoadFailed(event)); + this._browserSession.on('Playwright.windowOpen', event => this._onWindowOpen(event)); + this._browserSession.on('Playwright.downloadCreated', this._onDownloadCreated.bind(this)); + this._browserSession.on('Playwright.downloadFilenameSuggested', this._onDownloadFilenameSuggested.bind(this)); + this._browserSession.on('Playwright.downloadFinished', this._onDownloadFinished.bind(this)); + this._browserSession.on('Playwright.screencastFinished', this._onScreencastFinished.bind(this)); + this._browserSession.on(_wkConnection.kPageProxyMessageReceived, this._onPageProxyMessageReceived.bind(this)); } _onDisconnect() { for (const wkPage of this._wkPages.values()) wkPage.didClose(); @@ -66,11 +72,12 @@ class WKBrowser extends _browser.Browser { this._didClose(); } async doCreateNewContext(options) { - const createOptions = options.proxy ? { - // Enable socks5 hostname resolution on Windows. Workaround can be removed once fixed upstream. + const proxy = options.proxyOverride || options.proxy; + const createOptions = proxy ? { + // Enable socks5 hostname resolution on Windows. // See https://github.com/microsoft/playwright/issues/20451 - proxyServer: process.platform === 'win32' ? options.proxy.server.replace(/^socks5:\/\//, 'socks5h://') : options.proxy.server, - proxyBypassList: options.proxy.bypass + proxyServer: process.platform === 'win32' ? proxy.server.replace(/^socks5:\/\//, 'socks5h://') : proxy.server, + proxyBypassList: proxy.bypass } : undefined; const { browserContextId @@ -186,7 +193,7 @@ class WKBrowserContext extends _browserContext.BrowserContext { downloadPath: this._browser.options.downloadsPath, browserContextId })); - if (this._options.ignoreHTTPSErrors) promises.push(this._browser._browserSession.send('Playwright.setIgnoreCertificateErrors', { + if (this._options.ignoreHTTPSErrors || this._options.internalIgnoreHTTPSErrors) promises.push(this._browser._browserSession.send('Playwright.setIgnoreCertificateErrors', { browserContextId, ignore: true })); @@ -279,18 +286,12 @@ class WKBrowserContext extends _browserContext.BrowserContext { this._options.httpCredentials = httpCredentials; for (const page of this.pages()) await page._delegate.updateHttpCredentials(); } - async doAddInitScript(source) { + async doAddInitScript(initScript) { for (const page of this.pages()) await page._delegate._updateBootstrapScript(); } - async doRemoveInitScripts() { + async doRemoveNonInternalInitScripts() { for (const page of this.pages()) await page._delegate._updateBootstrapScript(); } - async doExposeBinding(binding) { - for (const page of this.pages()) await page._delegate.exposeBinding(binding); - } - async doRemoveExposedBindings() { - for (const page of this.pages()) await page._delegate.removeExposedBindings(); - } async doUpdateRequestInterception() { for (const page of this.pages()) await page._delegate.updateRequestInterception(); } diff --git a/priv/static/node_modules/playwright-core/lib/server/webkit/wkConnection.js b/priv/static/node_modules/playwright-core/lib/server/webkit/wkConnection.js index efeb99ee..0e235f90 100644 --- a/priv/static/node_modules/playwright-core/lib/server/webkit/wkConnection.js +++ b/priv/static/node_modules/playwright-core/lib/server/webkit/wkConnection.js @@ -32,7 +32,7 @@ const kBrowserCloseMessageId = exports.kBrowserCloseMessageId = -9999; // We emulate kPageProxyMessageReceived message to unify it with Browser.pageProxyCreated // and Browser.pageProxyDestroyed for easier management. -const kPageProxyMessageReceived = exports.kPageProxyMessageReceived = 'kPageProxyMessageReceived'; +const kPageProxyMessageReceived = exports.kPageProxyMessageReceived = Symbol('kPageProxyMessageReceived'); class WKConnection { constructor(transport, onDisconnect, protocolLogger, browserLogsCollector) { this._transport = void 0; diff --git a/priv/static/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js b/priv/static/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js index 2fbc05dd..f04a8cd6 100644 --- a/priv/static/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +++ b/priv/static/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js @@ -59,19 +59,6 @@ class WKExecutionContext { throw rewriteError(error); } } - rawCallFunctionNoReply(func, ...args) { - this._session.send('Runtime.callFunctionOn', { - functionDeclaration: func.toString(), - objectId: args.find(a => a instanceof js.JSHandle)._objectId, - arguments: args.map(a => a instanceof js.JSHandle ? { - objectId: a._objectId - } : { - value: a - }), - returnByValue: true, - emulateUserGesture: true - }).catch(() => {}); - } async evaluateWithArguments(expression, returnByValue, utilityScript, values, objectIds) { try { const response = await this._session.send('Runtime.callFunctionOn', { @@ -116,9 +103,6 @@ class WKExecutionContext { objectId }); } - objectCount(objectId) { - throw new Error('Method not implemented in WebKit.'); - } } exports.WKExecutionContext = WKExecutionContext; function potentiallyUnserializableValue(remoteObject) { diff --git a/priv/static/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js b/priv/static/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js index 115a5e22..e9800b09 100644 --- a/priv/static/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +++ b/priv/static/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js @@ -44,8 +44,8 @@ const errorReasons = { class WKInterceptableRequest { constructor(session, frame, event, redirectedFrom, documentId) { this._session = void 0; - this.request = void 0; this._requestId = void 0; + this.request = void 0; this._timestamp = void 0; this._wallTime = void 0; this._session = session; @@ -57,6 +57,10 @@ class WKInterceptableRequest { if (event.request.postData) postDataBuffer = Buffer.from(event.request.postData, 'base64'); this.request = new network.Request(frame._page._browserContext, frame, null, (redirectedFrom === null || redirectedFrom === void 0 ? void 0 : redirectedFrom.request) || null, documentId, event.request.url, resourceType, event.request.method, postDataBuffer, (0, _utils.headersObjectToArray)(event.request.headers)); } + adoptRequestFromNewProcess(newSession, requestId) { + this._session = newSession; + this._requestId = requestId; + } createResponse(responsePayload) { const getResponseBody = async () => { const response = await this._session.send('Network.getResponseBody', { @@ -75,7 +79,7 @@ class WKInterceptableRequest { requestStart: timingPayload ? wkMillisToRoundishMillis(timingPayload.requestStart) : -1, responseStart: timingPayload ? wkMillisToRoundishMillis(timingPayload.responseStart) : -1 }; - const setCookieSeparator = process.platform === 'darwin' ? ',' : '\n'; + const setCookieSeparator = process.platform === 'darwin' ? ',' : 'playwright-set-cookie-separator'; const response = new network.Response(this.request, responsePayload.status, responsePayload.statusText, (0, _utils.headersObjectToArray)(responsePayload.headers, ',', setCookieSeparator), timing, getResponseBody, responsePayload.source === 'service-worker'); // No raw response headers in WebKit, use "provisional" ones. @@ -125,14 +129,14 @@ class WKRouteImpl { await this._session.sendMayFail('Network.interceptRequestWithResponse', { requestId: this._requestId, status: response.status, - statusText: network.STATUS_TEXTS[String(response.status)], + statusText: network.statusText(response.status), mimeType, headers, base64Encoded: response.isBase64, content: response.body }); } - async continue(request, overrides) { + async continue(overrides) { // In certain cases, protocol will return error if the request was already canceled // or the page was closed. We should tolerate these errors. await this._session.sendMayFail('Network.interceptWithRequest', { diff --git a/priv/static/node_modules/playwright-core/lib/server/webkit/wkPage.js b/priv/static/node_modules/playwright-core/lib/server/webkit/wkPage.js index 52809c98..2b9f915d 100644 --- a/priv/static/node_modules/playwright-core/lib/server/webkit/wkPage.js +++ b/priv/static/node_modules/playwright-core/lib/server/webkit/wkPage.js @@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.WKPage = void 0; var _path = _interopRequireDefault(require("path")); +var _os = _interopRequireDefault(require("os")); var _utilsBundle = require("../../utilsBundle"); var _stackTrace = require("../../utils/stackTrace"); var _utils = require("../../utils"); @@ -159,7 +160,9 @@ class WKPage { resourceTreeHandler(frameTree); const promises = [ // Resource tree should be received before first execution context. - session.send('Runtime.enable'), session.send('Page.createUserWorld', { + session.send('Runtime.enable'), session.send('Runtime.addBinding', { + name: _page.PageBinding.kPlaywrightBinding + }), session.send('Page.createUserWorld', { name: UTILITY_WORLD_NAME }).catch(_ => {}), // Worlds are per-process @@ -185,9 +188,6 @@ class WKPage { if (contextOptions.userAgent) promises.push(this.updateUserAgent()); const emulatedMedia = this._page.emulatedMedia(); if (emulatedMedia.media || emulatedMedia.colorScheme || emulatedMedia.reducedMotion || emulatedMedia.forcedColors) promises.push(WKPage._setEmulateMedia(session, emulatedMedia.media, emulatedMedia.colorScheme, emulatedMedia.reducedMotion, emulatedMedia.forcedColors)); - for (const binding of this._page.allBindings()) promises.push(session.send('Runtime.addBinding', { - name: binding.name - })); const bootstrapScript = this._calculateBootstrapScript(); if (bootstrapScript.length) promises.push(session.send('Page.setBootstrapScript', { source: bootstrapScript @@ -247,6 +247,10 @@ class WKPage { setting: 'InputTypeWeekEnabled', value: contextOptions.isMobile })); + promises.push(session.send('Page.overrideSetting', { + setting: 'FixedBackgroundsPaintRelativeToDocument', + value: contextOptions.isMobile + })); await Promise.all(promises); } _onDidCommitProvisionalTarget(event) { @@ -269,6 +273,7 @@ class WKPage { crashed } = event; if (this._provisionalPage && this._provisionalPage._session.sessionId === targetId) { + this._maybeCancelCoopNavigationRequest(this._provisionalPage); this._provisionalPage._session.dispose(); this._provisionalPage.dispose(); this._provisionalPage = null; @@ -565,6 +570,8 @@ class WKPage { } _onDialog(event) { this._page.emitOnContext(_browserContext.BrowserContext.Events.Dialog, new dialog.Dialog(this._page, event.type, event.message, async (accept, promptText) => { + // TODO: this should actually be a RDP event that notifies about a cancelled navigation attempt. + if (event.type === 'beforeunload' && !accept) this._page._frameManager.frameAbortedNavigation(this._page.mainFrame()._id, 'navigation cancelled by beforeunload dialog'); await this._pageProxySession.send('Dialog.handleJavaScriptDialog', { accept, promptText @@ -685,7 +692,11 @@ class WKPage { })]; if (options.isMobile) { const angle = viewportSize.width > viewportSize.height ? 90 : 0; - promises.push(this._session.send('Page.setOrientationOverride', { + // Special handling for macOS 12. + const useLegacySetOrientationOverrideMethod = _os.default.platform() === 'darwin' && parseInt(_os.default.release().split('.')[0], 10) <= 21; + if (useLegacySetOrientationOverrideMethod) promises.push(this._session.send('Page.setOrientationOverride', { + angle + }));else promises.push(this._pageProxySession.send('Emulation.setOrientationOverride', { angle })); } @@ -741,20 +752,13 @@ class WKPage { throw error; }); } - async exposeBinding(binding) { - this._session.send('Runtime.addBinding', { - name: binding.name - }); - await this._updateBootstrapScript(); - await Promise.all(this._page.frames().map(frame => frame.evaluateExpression(binding.source).catch(e => {}))); - } - async removeExposedBindings() { - await this._updateBootstrapScript(); + async requestGC() { + await this._session.send('Heap.gc'); } - async addInitScript(script) { + async addInitScript(initScript) { await this._updateBootstrapScript(); } - async removeInitScripts() { + async removeNonInternalInitScripts() { await this._updateBootstrapScript(); } _calculateBootstrapScript() { @@ -766,9 +770,7 @@ class WKPage { } scripts.push('if (!window.safari) window.safari = { pushNotification: { toString() { return "[object SafariRemoteNotification]"; } } };'); scripts.push('if (!window.GestureEvent) window.GestureEvent = function GestureEvent() {};'); - for (const binding of this._page.allBindings()) scripts.push(binding.source); - scripts.push(...this._browserContext.initScripts); - scripts.push(...this._page.initScripts); + scripts.push(...this._page.allInitScripts().map(script => script.source)); return scripts.join(';\n'); } async _updateBootstrapScript() { @@ -979,6 +981,31 @@ class WKPage { if (!result || result.object.subtype === 'null') throw new Error('Frame has been detached.'); return context.createHandle(result.object); } + _maybeCancelCoopNavigationRequest(provisionalPage) { + const navigationRequest = provisionalPage.coopNavigationRequest(); + for (const [requestId, request] of this._requestIdToRequest) { + if (request.request === navigationRequest) { + // Make sure the request completes if the provisional navigation is canceled. + this._onLoadingFailed(provisionalPage._session, { + requestId: requestId, + errorText: 'Provisiolal navigation canceled.', + timestamp: request._timestamp, + canceled: true + }); + return; + } + } + } + _adoptRequestFromNewProcess(navigationRequest, newSession, newRequestId) { + for (const [requestId, request] of this._requestIdToRequest) { + if (request.request === navigationRequest) { + this._requestIdToRequest.delete(requestId); + request.adoptRequestFromNewProcess(newSession, newRequestId); + this._requestIdToRequest.set(newRequestId, request); + return; + } + } + } _onRequestWillBeSent(session, event) { if (event.request.url.startsWith('data:')) return; @@ -991,7 +1018,7 @@ class WKPage { const request = this._requestIdToRequest.get(event.requestId); // If we connect late to the target, we could have missed the requestWillBeSent event. if (request) { - this._handleRequestRedirect(request, event.redirectResponse, event.timestamp); + this._handleRequestRedirect(request, event.requestId, event.redirectResponse, event.timestamp); redirectedFrom = request; } } @@ -1006,7 +1033,7 @@ class WKPage { const request = new _wkInterceptableRequest.WKInterceptableRequest(session, frame, event, redirectedFrom, documentId); let route; if (intercepted) { - route = new _wkInterceptableRequest.WKRouteImpl(session, request._requestId); + route = new _wkInterceptableRequest.WKRouteImpl(session, event.requestId); // There is no point in waiting for the raw headers in Network.responseReceived when intercepting. // Use provisional headers as raw headers, so that client can call allHeaders() from the route handler. request.request.setRawRequestHeaders(null); @@ -1014,14 +1041,14 @@ class WKPage { this._requestIdToRequest.set(event.requestId, request); this._page._frameManager.requestStarted(request.request, route); } - _handleRequestRedirect(request, responsePayload, timestamp) { + _handleRequestRedirect(request, requestId, responsePayload, timestamp) { const response = request.createResponse(responsePayload); response._securityDetailsFinished(); response._serverAddrFinished(); response.setResponseHeadersSize(null); response.setEncodedBodySize(null); response._requestFinished(responsePayload.timing ? _helper.helper.secondsToRoundishMillis(timestamp - request._timestamp) : -1); - this._requestIdToRequest.delete(request._requestId); + this._requestIdToRequest.delete(requestId); this._page._frameManager.requestReceivedResponse(response); this._page._frameManager.reportRequestFinished(request.request, response); } @@ -1049,10 +1076,10 @@ class WKPage { const request = this._requestIdToRequest.get(event.requestId); // FileUpload sends a response without a matching request. if (!request) return; - this._requestIdToResponseReceivedPayloadEvent.set(request._requestId, event); + this._requestIdToResponseReceivedPayloadEvent.set(event.requestId, event); const response = request.createResponse(event.response); this._page._frameManager.requestReceivedResponse(response); - if (response.status() === 204) { + if (response.status() === 204 && request.request.isNavigationRequest()) { this._onLoadingFailed(session, { requestId: event.requestId, errorText: 'Aborted: 204 No Content', @@ -1071,7 +1098,7 @@ class WKPage { const response = request.request._existingResponse(); if (response) { var _event$metrics, _event$metrics2, _responseReceivedPayl, _responseReceivedPayl2, _responseReceivedPayl3, _event$metrics3, _event$metrics$respon, _event$metrics4, _event$metrics$respon2, _event$metrics5; - const responseReceivedPayload = this._requestIdToResponseReceivedPayloadEvent.get(request._requestId); + const responseReceivedPayload = this._requestIdToResponseReceivedPayloadEvent.get(event.requestId); response._serverAddrFinished(parseRemoteAddress(event === null || event === void 0 || (_event$metrics = event.metrics) === null || _event$metrics === void 0 ? void 0 : _event$metrics.remoteAddress)); response._securityDetailsFinished({ protocol: isLoadedSecurely(response.url(), response.timing()) ? (_event$metrics2 = event.metrics) === null || _event$metrics2 === void 0 || (_event$metrics2 = _event$metrics2.securityConnection) === null || _event$metrics2 === void 0 ? void 0 : _event$metrics2.protocol : undefined, @@ -1087,8 +1114,8 @@ class WKPage { // Use provisional headers if we didn't have the response with raw headers. request.request.setRawRequestHeaders(null); } - this._requestIdToResponseReceivedPayloadEvent.delete(request._requestId); - this._requestIdToRequest.delete(request._requestId); + this._requestIdToResponseReceivedPayloadEvent.delete(event.requestId); + this._requestIdToRequest.delete(event.requestId); this._page._frameManager.reportRequestFinished(request.request, response); } _onLoadingFailed(session, event) { @@ -1114,12 +1141,12 @@ class WKPage { // Use provisional headers if we didn't have the response with raw headers. request.request.setRawRequestHeaders(null); } - this._requestIdToRequest.delete(request._requestId); + this._requestIdToRequest.delete(event.requestId); request.request._setFailureText(event.errorText); this._page._frameManager.requestFailed(request.request, event.errorText.includes('cancelled')); } async _grantPermissions(origin, permissions) { - const webPermissionToProtocol = new Map([['geolocation', 'geolocation'], ['clipboard-read', 'clipboard-read']]); + const webPermissionToProtocol = new Map([['geolocation', 'geolocation'], ['notifications', 'notifications'], ['clipboard-read', 'clipboard-read']]); const filtered = permissions.map(permission => { const protocolPermission = webPermissionToProtocol.get(permission); if (!protocolPermission) throw new Error('Unknown permission: ' + permission); diff --git a/priv/static/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js b/priv/static/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js index 4f8cd900..e0b26ae6 100644 --- a/priv/static/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +++ b/priv/static/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js @@ -24,13 +24,25 @@ var _utils = require("../../utils"); class WKProvisionalPage { constructor(session, page) { + var _page$_page$mainFrame; this._session = void 0; this._wkPage = void 0; + this._coopNavigationRequest = void 0; this._sessionListeners = []; this._mainFrameId = null; this.initializationPromise = void 0; this._session = session; this._wkPage = page; + // Cross-Origin-Opener-Policy (COOP) request starts in one process and once response headers + // have been received, continues in another. + // + // Network.requestWillBeSent and requestIntercepted (if intercepting) from the original web process + // will always come before a provisional page is created based on the response COOP headers. + // Thereafter we'll receive targetCreated (provisional) and later on in some order loadingFailed from the + // original process and requestWillBeSent from the provisional one. We should ignore loadingFailed + // as the original request continues in the provisional process. But if the provisional load is later + // canceled we should dispatch loadingFailed to the client. + this._coopNavigationRequest = (_page$_page$mainFrame = page._page.mainFrame().pendingDocument()) === null || _page$_page$mainFrame === void 0 ? void 0 : _page$_page$mainFrame.request; const overrideFrameId = handler => { return payload => { // Pretend that the events happened in the same process. @@ -39,11 +51,14 @@ class WKProvisionalPage { }; }; const wkPage = this._wkPage; - this._sessionListeners = [_eventsHelper.eventsHelper.addEventListener(session, 'Network.requestWillBeSent', overrideFrameId(e => wkPage._onRequestWillBeSent(session, e))), _eventsHelper.eventsHelper.addEventListener(session, 'Network.requestIntercepted', overrideFrameId(e => wkPage._onRequestIntercepted(session, e))), _eventsHelper.eventsHelper.addEventListener(session, 'Network.responseReceived', overrideFrameId(e => wkPage._onResponseReceived(session, e))), _eventsHelper.eventsHelper.addEventListener(session, 'Network.loadingFinished', overrideFrameId(e => wkPage._onLoadingFinished(e))), _eventsHelper.eventsHelper.addEventListener(session, 'Network.loadingFailed', overrideFrameId(e => wkPage._onLoadingFailed(session, e)))]; + this._sessionListeners = [_eventsHelper.eventsHelper.addEventListener(session, 'Network.requestWillBeSent', overrideFrameId(e => this._onRequestWillBeSent(e))), _eventsHelper.eventsHelper.addEventListener(session, 'Network.requestIntercepted', overrideFrameId(e => wkPage._onRequestIntercepted(session, e))), _eventsHelper.eventsHelper.addEventListener(session, 'Network.responseReceived', overrideFrameId(e => wkPage._onResponseReceived(session, e))), _eventsHelper.eventsHelper.addEventListener(session, 'Network.loadingFinished', overrideFrameId(e => this._onLoadingFinished(e))), _eventsHelper.eventsHelper.addEventListener(session, 'Network.loadingFailed', overrideFrameId(e => this._onLoadingFailed(e)))]; this.initializationPromise = this._wkPage._initializeSession(session, true, ({ frameTree }) => this._handleFrameTree(frameTree)); } + coopNavigationRequest() { + return this._coopNavigationRequest; + } dispose() { _eventsHelper.eventsHelper.removeEventListeners(this._sessionListeners); } @@ -51,6 +66,26 @@ class WKProvisionalPage { (0, _utils.assert)(this._mainFrameId); this._wkPage._onFrameAttached(this._mainFrameId, null); } + _onRequestWillBeSent(event) { + if (this._coopNavigationRequest && this._coopNavigationRequest.url() === event.request.url) { + // If it's a continuation of the main frame navigation request after COOP headers were received, + // take over original request, and replace its request id with the new one. + this._wkPage._adoptRequestFromNewProcess(this._coopNavigationRequest, this._session, event.requestId); + // Simply ignore this event as it has already been dispatched from the original process + // and there will ne no requestIntercepted event from the provisional process as it resumes + // existing network load (that has already received reponse headers). + return; + } + this._wkPage._onRequestWillBeSent(this._session, event); + } + _onLoadingFinished(event) { + this._coopNavigationRequest = undefined; + this._wkPage._onLoadingFinished(event); + } + _onLoadingFailed(event) { + this._coopNavigationRequest = undefined; + this._wkPage._onLoadingFailed(this._session, event); + } _handleFrameTree(frameTree) { (0, _utils.assert)(!frameTree.frame.parentId); this._mainFrameId = frameTree.frame.id; diff --git a/priv/static/node_modules/playwright-core/lib/third_party/diff_match_patch.js b/priv/static/node_modules/playwright-core/lib/third_party/diff_match_patch.js deleted file mode 100644 index ba0df0f6..00000000 --- a/priv/static/node_modules/playwright-core/lib/third_party/diff_match_patch.js +++ /dev/null @@ -1,2222 +0,0 @@ -/** - * Diff Match and Patch - * Copyright 2018 The diff-match-patch Authors. - * https://github.com/google/diff-match-patch - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @fileoverview Computes the difference between two texts to create a patch. - * Applies the patch onto another text, allowing for errors. - * @author fraser@google.com (Neil Fraser) - */ - -/** - * Class containing the diff, match and patch methods. - * @constructor - */ -var diff_match_patch = function() { - - // Defaults. - // Redefine these in your program to override the defaults. - - // Number of seconds to map a diff before giving up (0 for infinity). - this.Diff_Timeout = 1.0; - // Cost of an empty edit operation in terms of edit characters. - this.Diff_EditCost = 4; - // At what point is no match declared (0.0 = perfection, 1.0 = very loose). - this.Match_Threshold = 0.5; - // How far to search for a match (0 = exact location, 1000+ = broad match). - // A match this many characters away from the expected location will add - // 1.0 to the score (0.0 is a perfect match). - this.Match_Distance = 1000; - // When deleting a large block of text (over ~64 characters), how close do - // the contents have to be to match the expected contents. (0.0 = perfection, - // 1.0 = very loose). Note that Match_Threshold controls how closely the - // end points of a delete need to match. - this.Patch_DeleteThreshold = 0.5; - // Chunk size for context length. - this.Patch_Margin = 4; - - // The number of bits in an int. - this.Match_MaxBits = 32; -}; - - -// DIFF FUNCTIONS - - -/** - * The data structure representing a diff is an array of tuples: - * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] - * which means: delete 'Hello', add 'Goodbye' and keep ' world.' - */ -var DIFF_DELETE = -1; -var DIFF_INSERT = 1; -var DIFF_EQUAL = 0; - -/** - * Class representing one diff tuple. - * Attempts to look like a two-element array (which is what this used to be). - * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL. - * @param {string} text Text to be deleted, inserted, or retained. - * @constructor - */ -diff_match_patch.Diff = function(op, text) { - this[0] = op; - this[1] = text; -}; - -diff_match_patch.Diff.prototype.length = 2; - -/** - * Emulate the output of a two-element array. - * @return {string} Diff operation as a string. - */ -diff_match_patch.Diff.prototype.toString = function() { - return this[0] + ',' + this[1]; -}; - - -/** - * Find the differences between two texts. Simplifies the problem by stripping - * any common prefix or suffix off the texts before diffing. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {boolean=} opt_checklines Optional speedup flag. If present and false, - * then don't run a line-level diff first to identify the changed areas. - * Defaults to true, which does a faster, slightly less optimal diff. - * @param {number=} opt_deadline Optional time when the diff should be complete - * by. Used internally for recursive calls. Users should set DiffTimeout - * instead. - * @return {!Array.} Array of diff tuples. - */ -diff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines, - opt_deadline) { - // Set a deadline by which time the diff must be complete. - if (typeof opt_deadline == 'undefined') { - if (this.Diff_Timeout <= 0) { - opt_deadline = Number.MAX_VALUE; - } else { - opt_deadline = (new Date).getTime() + this.Diff_Timeout * 1000; - } - } - var deadline = opt_deadline; - - // Check for null inputs. - if (text1 == null || text2 == null) { - throw new Error('Null input. (diff_main)'); - } - - // Check for equality (speedup). - if (text1 == text2) { - if (text1) { - return [new diff_match_patch.Diff(DIFF_EQUAL, text1)]; - } - return []; - } - - if (typeof opt_checklines == 'undefined') { - opt_checklines = true; - } - var checklines = opt_checklines; - - // Trim off common prefix (speedup). - var commonlength = this.diff_commonPrefix(text1, text2); - var commonprefix = text1.substring(0, commonlength); - text1 = text1.substring(commonlength); - text2 = text2.substring(commonlength); - - // Trim off common suffix (speedup). - commonlength = this.diff_commonSuffix(text1, text2); - var commonsuffix = text1.substring(text1.length - commonlength); - text1 = text1.substring(0, text1.length - commonlength); - text2 = text2.substring(0, text2.length - commonlength); - - // Compute the diff on the middle block. - var diffs = this.diff_compute_(text1, text2, checklines, deadline); - - // Restore the prefix and suffix. - if (commonprefix) { - diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, commonprefix)); - } - if (commonsuffix) { - diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, commonsuffix)); - } - this.diff_cleanupMerge(diffs); - return diffs; -}; - - -/** - * Find the differences between two texts. Assumes that the texts do not - * have any common prefix or suffix. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {boolean} checklines Speedup flag. If false, then don't run a - * line-level diff first to identify the changed areas. - * If true, then run a faster, slightly less optimal diff. - * @param {number} deadline Time when the diff should be complete by. - * @return {!Array.} Array of diff tuples. - * @private - */ -diff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines, - deadline) { - var diffs; - - if (!text1) { - // Just add some text (speedup). - return [new diff_match_patch.Diff(DIFF_INSERT, text2)]; - } - - if (!text2) { - // Just delete some text (speedup). - return [new diff_match_patch.Diff(DIFF_DELETE, text1)]; - } - - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - var i = longtext.indexOf(shorttext); - if (i != -1) { - // Shorter text is inside the longer text (speedup). - diffs = [new diff_match_patch.Diff(DIFF_INSERT, longtext.substring(0, i)), - new diff_match_patch.Diff(DIFF_EQUAL, shorttext), - new diff_match_patch.Diff(DIFF_INSERT, - longtext.substring(i + shorttext.length))]; - // Swap insertions for deletions if diff is reversed. - if (text1.length > text2.length) { - diffs[0][0] = diffs[2][0] = DIFF_DELETE; - } - return diffs; - } - - if (shorttext.length == 1) { - // Single character string. - // After the previous speedup, the character can't be an equality. - return [new diff_match_patch.Diff(DIFF_DELETE, text1), - new diff_match_patch.Diff(DIFF_INSERT, text2)]; - } - - // Check to see if the problem can be split in two. - var hm = this.diff_halfMatch_(text1, text2); - if (hm) { - // A half-match was found, sort out the return data. - var text1_a = hm[0]; - var text1_b = hm[1]; - var text2_a = hm[2]; - var text2_b = hm[3]; - var mid_common = hm[4]; - // Send both pairs off for separate processing. - var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline); - var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline); - // Merge the results. - return diffs_a.concat([new diff_match_patch.Diff(DIFF_EQUAL, mid_common)], - diffs_b); - } - - if (checklines && text1.length > 100 && text2.length > 100) { - return this.diff_lineMode_(text1, text2, deadline); - } - - return this.diff_bisect_(text1, text2, deadline); -}; - - -/** - * Do a quick line-level diff on both strings, then rediff the parts for - * greater accuracy. - * This speedup can produce non-minimal diffs. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {number} deadline Time when the diff should be complete by. - * @return {!Array.} Array of diff tuples. - * @private - */ -diff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) { - // Scan the text on a line-by-line basis first. - var a = this.diff_linesToChars_(text1, text2); - text1 = a.chars1; - text2 = a.chars2; - var linearray = a.lineArray; - - var diffs = this.diff_main(text1, text2, false, deadline); - - // Convert the diff back to original text. - this.diff_charsToLines_(diffs, linearray); - // Eliminate freak matches (e.g. blank lines) - this.diff_cleanupSemantic(diffs); - - // Rediff any replacement blocks, this time character-by-character. - // Add a dummy entry at the end. - diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, '')); - var pointer = 0; - var count_delete = 0; - var count_insert = 0; - var text_delete = ''; - var text_insert = ''; - while (pointer < diffs.length) { - switch (diffs[pointer][0]) { - case DIFF_INSERT: - count_insert++; - text_insert += diffs[pointer][1]; - break; - case DIFF_DELETE: - count_delete++; - text_delete += diffs[pointer][1]; - break; - case DIFF_EQUAL: - // Upon reaching an equality, check for prior redundancies. - if (count_delete >= 1 && count_insert >= 1) { - // Delete the offending records and add the merged ones. - diffs.splice(pointer - count_delete - count_insert, - count_delete + count_insert); - pointer = pointer - count_delete - count_insert; - var subDiff = - this.diff_main(text_delete, text_insert, false, deadline); - for (var j = subDiff.length - 1; j >= 0; j--) { - diffs.splice(pointer, 0, subDiff[j]); - } - pointer = pointer + subDiff.length; - } - count_insert = 0; - count_delete = 0; - text_delete = ''; - text_insert = ''; - break; - } - pointer++; - } - diffs.pop(); // Remove the dummy entry at the end. - - return diffs; -}; - - -/** - * Find the 'middle snake' of a diff, split the problem in two - * and return the recursively constructed diff. - * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {number} deadline Time at which to bail if not yet complete. - * @return {!Array.} Array of diff tuples. - * @private - */ -diff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) { - // Cache the text lengths to prevent multiple calls. - var text1_length = text1.length; - var text2_length = text2.length; - var max_d = Math.ceil((text1_length + text2_length) / 2); - var v_offset = max_d; - var v_length = 2 * max_d; - var v1 = new Array(v_length); - var v2 = new Array(v_length); - // Setting all elements to -1 is faster in Chrome & Firefox than mixing - // integers and undefined. - for (var x = 0; x < v_length; x++) { - v1[x] = -1; - v2[x] = -1; - } - v1[v_offset + 1] = 0; - v2[v_offset + 1] = 0; - var delta = text1_length - text2_length; - // If the total number of characters is odd, then the front path will collide - // with the reverse path. - var front = (delta % 2 != 0); - // Offsets for start and end of k loop. - // Prevents mapping of space beyond the grid. - var k1start = 0; - var k1end = 0; - var k2start = 0; - var k2end = 0; - for (var d = 0; d < max_d; d++) { - // Bail out if deadline is reached. - if ((new Date()).getTime() > deadline) { - break; - } - - // Walk the front path one step. - for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { - var k1_offset = v_offset + k1; - var x1; - if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { - x1 = v1[k1_offset + 1]; - } else { - x1 = v1[k1_offset - 1] + 1; - } - var y1 = x1 - k1; - while (x1 < text1_length && y1 < text2_length && - text1.charAt(x1) == text2.charAt(y1)) { - x1++; - y1++; - } - v1[k1_offset] = x1; - if (x1 > text1_length) { - // Ran off the right of the graph. - k1end += 2; - } else if (y1 > text2_length) { - // Ran off the bottom of the graph. - k1start += 2; - } else if (front) { - var k2_offset = v_offset + delta - k1; - if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { - // Mirror x2 onto top-left coordinate system. - var x2 = text1_length - v2[k2_offset]; - if (x1 >= x2) { - // Overlap detected. - return this.diff_bisectSplit_(text1, text2, x1, y1, deadline); - } - } - } - } - - // Walk the reverse path one step. - for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { - var k2_offset = v_offset + k2; - var x2; - if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { - x2 = v2[k2_offset + 1]; - } else { - x2 = v2[k2_offset - 1] + 1; - } - var y2 = x2 - k2; - while (x2 < text1_length && y2 < text2_length && - text1.charAt(text1_length - x2 - 1) == - text2.charAt(text2_length - y2 - 1)) { - x2++; - y2++; - } - v2[k2_offset] = x2; - if (x2 > text1_length) { - // Ran off the left of the graph. - k2end += 2; - } else if (y2 > text2_length) { - // Ran off the top of the graph. - k2start += 2; - } else if (!front) { - var k1_offset = v_offset + delta - k2; - if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) { - var x1 = v1[k1_offset]; - var y1 = v_offset + x1 - k1_offset; - // Mirror x2 onto top-left coordinate system. - x2 = text1_length - x2; - if (x1 >= x2) { - // Overlap detected. - return this.diff_bisectSplit_(text1, text2, x1, y1, deadline); - } - } - } - } - } - // Diff took too long and hit the deadline or - // number of diffs equals number of characters, no commonality at all. - return [new diff_match_patch.Diff(DIFF_DELETE, text1), - new diff_match_patch.Diff(DIFF_INSERT, text2)]; -}; - - -/** - * Given the location of the 'middle snake', split the diff in two parts - * and recurse. - * @param {string} text1 Old string to be diffed. - * @param {string} text2 New string to be diffed. - * @param {number} x Index of split point in text1. - * @param {number} y Index of split point in text2. - * @param {number} deadline Time at which to bail if not yet complete. - * @return {!Array.} Array of diff tuples. - * @private - */ -diff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y, - deadline) { - var text1a = text1.substring(0, x); - var text2a = text2.substring(0, y); - var text1b = text1.substring(x); - var text2b = text2.substring(y); - - // Compute both diffs serially. - var diffs = this.diff_main(text1a, text2a, false, deadline); - var diffsb = this.diff_main(text1b, text2b, false, deadline); - - return diffs.concat(diffsb); -}; - - -/** - * Split two texts into an array of strings. Reduce the texts to a string of - * hashes where each Unicode character represents one line. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {{chars1: string, chars2: string, lineArray: !Array.}} - * An object containing the encoded text1, the encoded text2 and - * the array of unique strings. - * The zeroth element of the array of unique strings is intentionally blank. - * @private - */ -diff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) { - var lineArray = []; // e.g. lineArray[4] == 'Hello\n' - var lineHash = {}; // e.g. lineHash['Hello\n'] == 4 - - // '\x00' is a valid character, but various debuggers don't like it. - // So we'll insert a junk entry to avoid generating a null character. - lineArray[0] = ''; - - /** - * Split a text into an array of strings. Reduce the texts to a string of - * hashes where each Unicode character represents one line. - * Modifies linearray and linehash through being a closure. - * @param {string} text String to encode. - * @return {string} Encoded string. - * @private - */ - function diff_linesToCharsMunge_(text) { - var chars = ''; - // Walk the text, pulling out a substring for each line. - // text.split('\n') would would temporarily double our memory footprint. - // Modifying text would create many large strings to garbage collect. - var lineStart = 0; - var lineEnd = -1; - // Keeping our own length variable is faster than looking it up. - var lineArrayLength = lineArray.length; - while (lineEnd < text.length - 1) { - lineEnd = text.indexOf('\n', lineStart); - if (lineEnd == -1) { - lineEnd = text.length - 1; - } - var line = text.substring(lineStart, lineEnd + 1); - - if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : - (lineHash[line] !== undefined)) { - chars += String.fromCharCode(lineHash[line]); - } else { - if (lineArrayLength == maxLines) { - // Bail out at 65535 because - // String.fromCharCode(65536) == String.fromCharCode(0) - line = text.substring(lineStart); - lineEnd = text.length; - } - chars += String.fromCharCode(lineArrayLength); - lineHash[line] = lineArrayLength; - lineArray[lineArrayLength++] = line; - } - lineStart = lineEnd + 1; - } - return chars; - } - // Allocate 2/3rds of the space for text1, the rest for text2. - var maxLines = 40000; - var chars1 = diff_linesToCharsMunge_(text1); - maxLines = 65535; - var chars2 = diff_linesToCharsMunge_(text2); - return {chars1: chars1, chars2: chars2, lineArray: lineArray}; -}; - - -/** - * Rehydrate the text in a diff from a string of line hashes to real lines of - * text. - * @param {!Array.} diffs Array of diff tuples. - * @param {!Array.} lineArray Array of unique strings. - * @private - */ -diff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) { - for (var i = 0; i < diffs.length; i++) { - var chars = diffs[i][1]; - var text = []; - for (var j = 0; j < chars.length; j++) { - text[j] = lineArray[chars.charCodeAt(j)]; - } - diffs[i][1] = text.join(''); - } -}; - - -/** - * Determine the common prefix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the start of each - * string. - */ -diff_match_patch.prototype.diff_commonPrefix = function(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { - return 0; - } - // Binary search. - // Performance analysis: https://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerstart = 0; - while (pointermin < pointermid) { - if (text1.substring(pointerstart, pointermid) == - text2.substring(pointerstart, pointermid)) { - pointermin = pointermid; - pointerstart = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - return pointermid; -}; - - -/** - * Determine the common suffix of two strings. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the end of each string. - */ -diff_match_patch.prototype.diff_commonSuffix = function(text1, text2) { - // Quick check for common null cases. - if (!text1 || !text2 || - text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { - return 0; - } - // Binary search. - // Performance analysis: https://neil.fraser.name/news/2007/10/09/ - var pointermin = 0; - var pointermax = Math.min(text1.length, text2.length); - var pointermid = pointermax; - var pointerend = 0; - while (pointermin < pointermid) { - if (text1.substring(text1.length - pointermid, text1.length - pointerend) == - text2.substring(text2.length - pointermid, text2.length - pointerend)) { - pointermin = pointermid; - pointerend = pointermin; - } else { - pointermax = pointermid; - } - pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); - } - return pointermid; -}; - - -/** - * Determine if the suffix of one string is the prefix of another. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {number} The number of characters common to the end of the first - * string and the start of the second string. - * @private - */ -diff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) { - // Cache the text lengths to prevent multiple calls. - var text1_length = text1.length; - var text2_length = text2.length; - // Eliminate the null case. - if (text1_length == 0 || text2_length == 0) { - return 0; - } - // Truncate the longer string. - if (text1_length > text2_length) { - text1 = text1.substring(text1_length - text2_length); - } else if (text1_length < text2_length) { - text2 = text2.substring(0, text1_length); - } - var text_length = Math.min(text1_length, text2_length); - // Quick check for the worst case. - if (text1 == text2) { - return text_length; - } - - // Start by looking for a single character match - // and increase length until no match is found. - // Performance analysis: https://neil.fraser.name/news/2010/11/04/ - var best = 0; - var length = 1; - while (true) { - var pattern = text1.substring(text_length - length); - var found = text2.indexOf(pattern); - if (found == -1) { - return best; - } - length += found; - if (found == 0 || text1.substring(text_length - length) == - text2.substring(0, length)) { - best = length; - length++; - } - } -}; - - -/** - * Do the two texts share a substring which is at least half the length of the - * longer text? - * This speedup can produce non-minimal diffs. - * @param {string} text1 First string. - * @param {string} text2 Second string. - * @return {Array.} Five element Array, containing the prefix of - * text1, the suffix of text1, the prefix of text2, the suffix of - * text2 and the common middle. Or null if there was no match. - * @private - */ -diff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) { - if (this.Diff_Timeout <= 0) { - // Don't risk returning a non-optimal diff if we have unlimited time. - return null; - } - var longtext = text1.length > text2.length ? text1 : text2; - var shorttext = text1.length > text2.length ? text2 : text1; - if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { - return null; // Pointless. - } - var dmp = this; // 'this' becomes 'window' in a closure. - - /** - * Does a substring of shorttext exist within longtext such that the substring - * is at least half the length of longtext? - * Closure, but does not reference any external variables. - * @param {string} longtext Longer string. - * @param {string} shorttext Shorter string. - * @param {number} i Start index of quarter length substring within longtext. - * @return {Array.} Five element Array, containing the prefix of - * longtext, the suffix of longtext, the prefix of shorttext, the suffix - * of shorttext and the common middle. Or null if there was no match. - * @private - */ - function diff_halfMatchI_(longtext, shorttext, i) { - // Start with a 1/4 length substring at position i as a seed. - var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); - var j = -1; - var best_common = ''; - var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; - while ((j = shorttext.indexOf(seed, j + 1)) != -1) { - var prefixLength = dmp.diff_commonPrefix(longtext.substring(i), - shorttext.substring(j)); - var suffixLength = dmp.diff_commonSuffix(longtext.substring(0, i), - shorttext.substring(0, j)); - if (best_common.length < suffixLength + prefixLength) { - best_common = shorttext.substring(j - suffixLength, j) + - shorttext.substring(j, j + prefixLength); - best_longtext_a = longtext.substring(0, i - suffixLength); - best_longtext_b = longtext.substring(i + prefixLength); - best_shorttext_a = shorttext.substring(0, j - suffixLength); - best_shorttext_b = shorttext.substring(j + prefixLength); - } - } - if (best_common.length * 2 >= longtext.length) { - return [best_longtext_a, best_longtext_b, - best_shorttext_a, best_shorttext_b, best_common]; - } else { - return null; - } - } - - // First check if the second quarter is the seed for a half-match. - var hm1 = diff_halfMatchI_(longtext, shorttext, - Math.ceil(longtext.length / 4)); - // Check again based on the third quarter. - var hm2 = diff_halfMatchI_(longtext, shorttext, - Math.ceil(longtext.length / 2)); - var hm; - if (!hm1 && !hm2) { - return null; - } else if (!hm2) { - hm = hm1; - } else if (!hm1) { - hm = hm2; - } else { - // Both matched. Select the longest. - hm = hm1[4].length > hm2[4].length ? hm1 : hm2; - } - - // A half-match was found, sort out the return data. - var text1_a, text1_b, text2_a, text2_b; - if (text1.length > text2.length) { - text1_a = hm[0]; - text1_b = hm[1]; - text2_a = hm[2]; - text2_b = hm[3]; - } else { - text2_a = hm[0]; - text2_b = hm[1]; - text1_a = hm[2]; - text1_b = hm[3]; - } - var mid_common = hm[4]; - return [text1_a, text1_b, text2_a, text2_b, mid_common]; -}; - - -/** - * Reduce the number of edits by eliminating semantically trivial equalities. - * @param {!Array.} diffs Array of diff tuples. - */ -diff_match_patch.prototype.diff_cleanupSemantic = function(diffs) { - var changes = false; - var equalities = []; // Stack of indices where equalities are found. - var equalitiesLength = 0; // Keeping our own length var is faster in JS. - /** @type {?string} */ - var lastEquality = null; - // Always equal to diffs[equalities[equalitiesLength - 1]][1] - var pointer = 0; // Index of current position. - // Number of characters that changed prior to the equality. - var length_insertions1 = 0; - var length_deletions1 = 0; - // Number of characters that changed after the equality. - var length_insertions2 = 0; - var length_deletions2 = 0; - while (pointer < diffs.length) { - if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found. - equalities[equalitiesLength++] = pointer; - length_insertions1 = length_insertions2; - length_deletions1 = length_deletions2; - length_insertions2 = 0; - length_deletions2 = 0; - lastEquality = diffs[pointer][1]; - } else { // An insertion or deletion. - if (diffs[pointer][0] == DIFF_INSERT) { - length_insertions2 += diffs[pointer][1].length; - } else { - length_deletions2 += diffs[pointer][1].length; - } - // Eliminate an equality that is smaller or equal to the edits on both - // sides of it. - if (lastEquality && (lastEquality.length <= - Math.max(length_insertions1, length_deletions1)) && - (lastEquality.length <= Math.max(length_insertions2, - length_deletions2))) { - // Duplicate record. - diffs.splice(equalities[equalitiesLength - 1], 0, - new diff_match_patch.Diff(DIFF_DELETE, lastEquality)); - // Change second copy to insert. - diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; - // Throw away the equality we just deleted. - equalitiesLength--; - // Throw away the previous equality (it needs to be reevaluated). - equalitiesLength--; - pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1; - length_insertions1 = 0; // Reset the counters. - length_deletions1 = 0; - length_insertions2 = 0; - length_deletions2 = 0; - lastEquality = null; - changes = true; - } - } - pointer++; - } - - // Normalize the diff. - if (changes) { - this.diff_cleanupMerge(diffs); - } - this.diff_cleanupSemanticLossless(diffs); - - // Find any overlaps between deletions and insertions. - // e.g: abcxxxxxxdef - // -> abcxxxdef - // e.g: xxxabcdefxxx - // -> defxxxabc - // Only extract an overlap if it is as big as the edit ahead or behind it. - pointer = 1; - while (pointer < diffs.length) { - if (diffs[pointer - 1][0] == DIFF_DELETE && - diffs[pointer][0] == DIFF_INSERT) { - var deletion = diffs[pointer - 1][1]; - var insertion = diffs[pointer][1]; - var overlap_length1 = this.diff_commonOverlap_(deletion, insertion); - var overlap_length2 = this.diff_commonOverlap_(insertion, deletion); - if (overlap_length1 >= overlap_length2) { - if (overlap_length1 >= deletion.length / 2 || - overlap_length1 >= insertion.length / 2) { - // Overlap found. Insert an equality and trim the surrounding edits. - diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL, - insertion.substring(0, overlap_length1))); - diffs[pointer - 1][1] = - deletion.substring(0, deletion.length - overlap_length1); - diffs[pointer + 1][1] = insertion.substring(overlap_length1); - pointer++; - } - } else { - if (overlap_length2 >= deletion.length / 2 || - overlap_length2 >= insertion.length / 2) { - // Reverse overlap found. - // Insert an equality and swap and trim the surrounding edits. - diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL, - deletion.substring(0, overlap_length2))); - diffs[pointer - 1][0] = DIFF_INSERT; - diffs[pointer - 1][1] = - insertion.substring(0, insertion.length - overlap_length2); - diffs[pointer + 1][0] = DIFF_DELETE; - diffs[pointer + 1][1] = - deletion.substring(overlap_length2); - pointer++; - } - } - pointer++; - } - pointer++; - } -}; - - -/** - * Look for single edits surrounded on both sides by equalities - * which can be shifted sideways to align the edit to a word boundary. - * e.g: The cat came. -> The cat came. - * @param {!Array.} diffs Array of diff tuples. - */ -diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) { - /** - * Given two strings, compute a score representing whether the internal - * boundary falls on logical boundaries. - * Scores range from 6 (best) to 0 (worst). - * Closure, but does not reference any external variables. - * @param {string} one First string. - * @param {string} two Second string. - * @return {number} The score. - * @private - */ - function diff_cleanupSemanticScore_(one, two) { - if (!one || !two) { - // Edges are the best. - return 6; - } - - // Each port of this function behaves slightly differently due to - // subtle differences in each language's definition of things like - // 'whitespace'. Since this function's purpose is largely cosmetic, - // the choice has been made to use each language's native features - // rather than force total conformity. - var char1 = one.charAt(one.length - 1); - var char2 = two.charAt(0); - var nonAlphaNumeric1 = char1.match(diff_match_patch.nonAlphaNumericRegex_); - var nonAlphaNumeric2 = char2.match(diff_match_patch.nonAlphaNumericRegex_); - var whitespace1 = nonAlphaNumeric1 && - char1.match(diff_match_patch.whitespaceRegex_); - var whitespace2 = nonAlphaNumeric2 && - char2.match(diff_match_patch.whitespaceRegex_); - var lineBreak1 = whitespace1 && - char1.match(diff_match_patch.linebreakRegex_); - var lineBreak2 = whitespace2 && - char2.match(diff_match_patch.linebreakRegex_); - var blankLine1 = lineBreak1 && - one.match(diff_match_patch.blanklineEndRegex_); - var blankLine2 = lineBreak2 && - two.match(diff_match_patch.blanklineStartRegex_); - - if (blankLine1 || blankLine2) { - // Five points for blank lines. - return 5; - } else if (lineBreak1 || lineBreak2) { - // Four points for line breaks. - return 4; - } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) { - // Three points for end of sentences. - return 3; - } else if (whitespace1 || whitespace2) { - // Two points for whitespace. - return 2; - } else if (nonAlphaNumeric1 || nonAlphaNumeric2) { - // One point for non-alphanumeric. - return 1; - } - return 0; - } - - var pointer = 1; - // Intentionally ignore the first and last element (don't need checking). - while (pointer < diffs.length - 1) { - if (diffs[pointer - 1][0] == DIFF_EQUAL && - diffs[pointer + 1][0] == DIFF_EQUAL) { - // This is a single edit surrounded by equalities. - var equality1 = diffs[pointer - 1][1]; - var edit = diffs[pointer][1]; - var equality2 = diffs[pointer + 1][1]; - - // First, shift the edit as far left as possible. - var commonOffset = this.diff_commonSuffix(equality1, edit); - if (commonOffset) { - var commonString = edit.substring(edit.length - commonOffset); - equality1 = equality1.substring(0, equality1.length - commonOffset); - edit = commonString + edit.substring(0, edit.length - commonOffset); - equality2 = commonString + equality2; - } - - // Second, step character by character right, looking for the best fit. - var bestEquality1 = equality1; - var bestEdit = edit; - var bestEquality2 = equality2; - var bestScore = diff_cleanupSemanticScore_(equality1, edit) + - diff_cleanupSemanticScore_(edit, equality2); - while (edit.charAt(0) === equality2.charAt(0)) { - equality1 += edit.charAt(0); - edit = edit.substring(1) + equality2.charAt(0); - equality2 = equality2.substring(1); - var score = diff_cleanupSemanticScore_(equality1, edit) + - diff_cleanupSemanticScore_(edit, equality2); - // The >= encourages trailing rather than leading whitespace on edits. - if (score >= bestScore) { - bestScore = score; - bestEquality1 = equality1; - bestEdit = edit; - bestEquality2 = equality2; - } - } - - if (diffs[pointer - 1][1] != bestEquality1) { - // We have an improvement, save it back to the diff. - if (bestEquality1) { - diffs[pointer - 1][1] = bestEquality1; - } else { - diffs.splice(pointer - 1, 1); - pointer--; - } - diffs[pointer][1] = bestEdit; - if (bestEquality2) { - diffs[pointer + 1][1] = bestEquality2; - } else { - diffs.splice(pointer + 1, 1); - pointer--; - } - } - } - pointer++; - } -}; - -// Define some regex patterns for matching boundaries. -diff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/; -diff_match_patch.whitespaceRegex_ = /\s/; -diff_match_patch.linebreakRegex_ = /[\r\n]/; -diff_match_patch.blanklineEndRegex_ = /\n\r?\n$/; -diff_match_patch.blanklineStartRegex_ = /^\r?\n\r?\n/; - -/** - * Reduce the number of edits by eliminating operationally trivial equalities. - * @param {!Array.} diffs Array of diff tuples. - */ -diff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) { - var changes = false; - var equalities = []; // Stack of indices where equalities are found. - var equalitiesLength = 0; // Keeping our own length var is faster in JS. - /** @type {?string} */ - var lastEquality = null; - // Always equal to diffs[equalities[equalitiesLength - 1]][1] - var pointer = 0; // Index of current position. - // Is there an insertion operation before the last equality. - var pre_ins = false; - // Is there a deletion operation before the last equality. - var pre_del = false; - // Is there an insertion operation after the last equality. - var post_ins = false; - // Is there a deletion operation after the last equality. - var post_del = false; - while (pointer < diffs.length) { - if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found. - if (diffs[pointer][1].length < this.Diff_EditCost && - (post_ins || post_del)) { - // Candidate found. - equalities[equalitiesLength++] = pointer; - pre_ins = post_ins; - pre_del = post_del; - lastEquality = diffs[pointer][1]; - } else { - // Not a candidate, and can never become one. - equalitiesLength = 0; - lastEquality = null; - } - post_ins = post_del = false; - } else { // An insertion or deletion. - if (diffs[pointer][0] == DIFF_DELETE) { - post_del = true; - } else { - post_ins = true; - } - /* - * Five types to be split: - * ABXYCD - * AXCD - * ABXC - * AXCD - * ABXC - */ - if (lastEquality && ((pre_ins && pre_del && post_ins && post_del) || - ((lastEquality.length < this.Diff_EditCost / 2) && - (pre_ins + pre_del + post_ins + post_del) == 3))) { - // Duplicate record. - diffs.splice(equalities[equalitiesLength - 1], 0, - new diff_match_patch.Diff(DIFF_DELETE, lastEquality)); - // Change second copy to insert. - diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; - equalitiesLength--; // Throw away the equality we just deleted; - lastEquality = null; - if (pre_ins && pre_del) { - // No changes made which could affect previous entry, keep going. - post_ins = post_del = true; - equalitiesLength = 0; - } else { - equalitiesLength--; // Throw away the previous equality. - pointer = equalitiesLength > 0 ? - equalities[equalitiesLength - 1] : -1; - post_ins = post_del = false; - } - changes = true; - } - } - pointer++; - } - - if (changes) { - this.diff_cleanupMerge(diffs); - } -}; - - -/** - * Reorder and merge like edit sections. Merge equalities. - * Any edit section can move as long as it doesn't cross an equality. - * @param {!Array.} diffs Array of diff tuples. - */ -diff_match_patch.prototype.diff_cleanupMerge = function(diffs) { - // Add a dummy entry at the end. - diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, '')); - var pointer = 0; - var count_delete = 0; - var count_insert = 0; - var text_delete = ''; - var text_insert = ''; - var commonlength; - while (pointer < diffs.length) { - switch (diffs[pointer][0]) { - case DIFF_INSERT: - count_insert++; - text_insert += diffs[pointer][1]; - pointer++; - break; - case DIFF_DELETE: - count_delete++; - text_delete += diffs[pointer][1]; - pointer++; - break; - case DIFF_EQUAL: - // Upon reaching an equality, check for prior redundancies. - if (count_delete + count_insert > 1) { - if (count_delete !== 0 && count_insert !== 0) { - // Factor out any common prefixies. - commonlength = this.diff_commonPrefix(text_insert, text_delete); - if (commonlength !== 0) { - if ((pointer - count_delete - count_insert) > 0 && - diffs[pointer - count_delete - count_insert - 1][0] == - DIFF_EQUAL) { - diffs[pointer - count_delete - count_insert - 1][1] += - text_insert.substring(0, commonlength); - } else { - diffs.splice(0, 0, new diff_match_patch.Diff(DIFF_EQUAL, - text_insert.substring(0, commonlength))); - pointer++; - } - text_insert = text_insert.substring(commonlength); - text_delete = text_delete.substring(commonlength); - } - // Factor out any common suffixies. - commonlength = this.diff_commonSuffix(text_insert, text_delete); - if (commonlength !== 0) { - diffs[pointer][1] = text_insert.substring(text_insert.length - - commonlength) + diffs[pointer][1]; - text_insert = text_insert.substring(0, text_insert.length - - commonlength); - text_delete = text_delete.substring(0, text_delete.length - - commonlength); - } - } - // Delete the offending records and add the merged ones. - pointer -= count_delete + count_insert; - diffs.splice(pointer, count_delete + count_insert); - if (text_delete.length) { - diffs.splice(pointer, 0, - new diff_match_patch.Diff(DIFF_DELETE, text_delete)); - pointer++; - } - if (text_insert.length) { - diffs.splice(pointer, 0, - new diff_match_patch.Diff(DIFF_INSERT, text_insert)); - pointer++; - } - pointer++; - } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { - // Merge this equality with the previous one. - diffs[pointer - 1][1] += diffs[pointer][1]; - diffs.splice(pointer, 1); - } else { - pointer++; - } - count_insert = 0; - count_delete = 0; - text_delete = ''; - text_insert = ''; - break; - } - } - if (diffs[diffs.length - 1][1] === '') { - diffs.pop(); // Remove the dummy entry at the end. - } - - // Second pass: look for single edits surrounded on both sides by equalities - // which can be shifted sideways to eliminate an equality. - // e.g: ABAC -> ABAC - var changes = false; - pointer = 1; - // Intentionally ignore the first and last element (don't need checking). - while (pointer < diffs.length - 1) { - if (diffs[pointer - 1][0] == DIFF_EQUAL && - diffs[pointer + 1][0] == DIFF_EQUAL) { - // This is a single edit surrounded by equalities. - if (diffs[pointer][1].substring(diffs[pointer][1].length - - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { - // Shift the edit over the previous equality. - diffs[pointer][1] = diffs[pointer - 1][1] + - diffs[pointer][1].substring(0, diffs[pointer][1].length - - diffs[pointer - 1][1].length); - diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; - diffs.splice(pointer - 1, 1); - changes = true; - } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == - diffs[pointer + 1][1]) { - // Shift the edit over the next equality. - diffs[pointer - 1][1] += diffs[pointer + 1][1]; - diffs[pointer][1] = - diffs[pointer][1].substring(diffs[pointer + 1][1].length) + - diffs[pointer + 1][1]; - diffs.splice(pointer + 1, 1); - changes = true; - } - } - pointer++; - } - // If shifts were made, the diff needs reordering and another shift sweep. - if (changes) { - this.diff_cleanupMerge(diffs); - } -}; - - -/** - * loc is a location in text1, compute and return the equivalent location in - * text2. - * e.g. 'The cat' vs 'The big cat', 1->1, 5->8 - * @param {!Array.} diffs Array of diff tuples. - * @param {number} loc Location within text1. - * @return {number} Location within text2. - */ -diff_match_patch.prototype.diff_xIndex = function(diffs, loc) { - var chars1 = 0; - var chars2 = 0; - var last_chars1 = 0; - var last_chars2 = 0; - var x; - for (x = 0; x < diffs.length; x++) { - if (diffs[x][0] !== DIFF_INSERT) { // Equality or deletion. - chars1 += diffs[x][1].length; - } - if (diffs[x][0] !== DIFF_DELETE) { // Equality or insertion. - chars2 += diffs[x][1].length; - } - if (chars1 > loc) { // Overshot the location. - break; - } - last_chars1 = chars1; - last_chars2 = chars2; - } - // Was the location was deleted? - if (diffs.length != x && diffs[x][0] === DIFF_DELETE) { - return last_chars2; - } - // Add the remaining character length. - return last_chars2 + (loc - last_chars1); -}; - - -/** - * Convert a diff array into a pretty HTML report. - * @param {!Array.} diffs Array of diff tuples. - * @return {string} HTML representation. - */ -diff_match_patch.prototype.diff_prettyHtml = function(diffs) { - var html = []; - var pattern_amp = /&/g; - var pattern_lt = //g; - var pattern_para = /\n/g; - for (var x = 0; x < diffs.length; x++) { - var op = diffs[x][0]; // Operation (insert, delete, equal) - var data = diffs[x][1]; // Text of change. - var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<') - .replace(pattern_gt, '>').replace(pattern_para, '¶
'); - switch (op) { - case DIFF_INSERT: - html[x] = '' + text + ''; - break; - case DIFF_DELETE: - html[x] = '' + text + ''; - break; - case DIFF_EQUAL: - html[x] = '' + text + ''; - break; - } - } - return html.join(''); -}; - - -/** - * Compute and return the source text (all equalities and deletions). - * @param {!Array.} diffs Array of diff tuples. - * @return {string} Source text. - */ -diff_match_patch.prototype.diff_text1 = function(diffs) { - var text = []; - for (var x = 0; x < diffs.length; x++) { - if (diffs[x][0] !== DIFF_INSERT) { - text[x] = diffs[x][1]; - } - } - return text.join(''); -}; - - -/** - * Compute and return the destination text (all equalities and insertions). - * @param {!Array.} diffs Array of diff tuples. - * @return {string} Destination text. - */ -diff_match_patch.prototype.diff_text2 = function(diffs) { - var text = []; - for (var x = 0; x < diffs.length; x++) { - if (diffs[x][0] !== DIFF_DELETE) { - text[x] = diffs[x][1]; - } - } - return text.join(''); -}; - - -/** - * Compute the Levenshtein distance; the number of inserted, deleted or - * substituted characters. - * @param {!Array.} diffs Array of diff tuples. - * @return {number} Number of changes. - */ -diff_match_patch.prototype.diff_levenshtein = function(diffs) { - var levenshtein = 0; - var insertions = 0; - var deletions = 0; - for (var x = 0; x < diffs.length; x++) { - var op = diffs[x][0]; - var data = diffs[x][1]; - switch (op) { - case DIFF_INSERT: - insertions += data.length; - break; - case DIFF_DELETE: - deletions += data.length; - break; - case DIFF_EQUAL: - // A deletion and an insertion is one substitution. - levenshtein += Math.max(insertions, deletions); - insertions = 0; - deletions = 0; - break; - } - } - levenshtein += Math.max(insertions, deletions); - return levenshtein; -}; - - -/** - * Crush the diff into an encoded string which describes the operations - * required to transform text1 into text2. - * E.g. =3\t-2\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'. - * Operations are tab-separated. Inserted text is escaped using %xx notation. - * @param {!Array.} diffs Array of diff tuples. - * @return {string} Delta text. - */ -diff_match_patch.prototype.diff_toDelta = function(diffs) { - var text = []; - for (var x = 0; x < diffs.length; x++) { - switch (diffs[x][0]) { - case DIFF_INSERT: - text[x] = '+' + encodeURI(diffs[x][1]); - break; - case DIFF_DELETE: - text[x] = '-' + diffs[x][1].length; - break; - case DIFF_EQUAL: - text[x] = '=' + diffs[x][1].length; - break; - } - } - return text.join('\t').replace(/%20/g, ' '); -}; - - -/** - * Given the original text1, and an encoded string which describes the - * operations required to transform text1 into text2, compute the full diff. - * @param {string} text1 Source string for the diff. - * @param {string} delta Delta text. - * @return {!Array.} Array of diff tuples. - * @throws {!Error} If invalid input. - */ -diff_match_patch.prototype.diff_fromDelta = function(text1, delta) { - var diffs = []; - var diffsLength = 0; // Keeping our own length var is faster in JS. - var pointer = 0; // Cursor in text1 - var tokens = delta.split(/\t/g); - for (var x = 0; x < tokens.length; x++) { - // Each token begins with a one character parameter which specifies the - // operation of this token (delete, insert, equality). - var param = tokens[x].substring(1); - switch (tokens[x].charAt(0)) { - case '+': - try { - diffs[diffsLength++] = - new diff_match_patch.Diff(DIFF_INSERT, decodeURI(param)); - } catch (ex) { - // Malformed URI sequence. - throw new Error('Illegal escape in diff_fromDelta: ' + param); - } - break; - case '-': - // Fall through. - case '=': - var n = parseInt(param, 10); - if (isNaN(n) || n < 0) { - throw new Error('Invalid number in diff_fromDelta: ' + param); - } - var text = text1.substring(pointer, pointer += n); - if (tokens[x].charAt(0) == '=') { - diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_EQUAL, text); - } else { - diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_DELETE, text); - } - break; - default: - // Blank tokens are ok (from a trailing \t). - // Anything else is an error. - if (tokens[x]) { - throw new Error('Invalid diff operation in diff_fromDelta: ' + - tokens[x]); - } - } - } - if (pointer != text1.length) { - throw new Error('Delta length (' + pointer + - ') does not equal source text length (' + text1.length + ').'); - } - return diffs; -}; - - -// MATCH FUNCTIONS - - -/** - * Locate the best instance of 'pattern' in 'text' near 'loc'. - * @param {string} text The text to search. - * @param {string} pattern The pattern to search for. - * @param {number} loc The location to search around. - * @return {number} Best match index or -1. - */ -diff_match_patch.prototype.match_main = function(text, pattern, loc) { - // Check for null inputs. - if (text == null || pattern == null || loc == null) { - throw new Error('Null input. (match_main)'); - } - - loc = Math.max(0, Math.min(loc, text.length)); - if (text == pattern) { - // Shortcut (potentially not guaranteed by the algorithm) - return 0; - } else if (!text.length) { - // Nothing to match. - return -1; - } else if (text.substring(loc, loc + pattern.length) == pattern) { - // Perfect match at the perfect spot! (Includes case of null pattern) - return loc; - } else { - // Do a fuzzy compare. - return this.match_bitap_(text, pattern, loc); - } -}; - - -/** - * Locate the best instance of 'pattern' in 'text' near 'loc' using the - * Bitap algorithm. - * @param {string} text The text to search. - * @param {string} pattern The pattern to search for. - * @param {number} loc The location to search around. - * @return {number} Best match index or -1. - * @private - */ -diff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) { - if (pattern.length > this.Match_MaxBits) { - throw new Error('Pattern too long for this browser.'); - } - - // Initialise the alphabet. - var s = this.match_alphabet_(pattern); - - var dmp = this; // 'this' becomes 'window' in a closure. - - /** - * Compute and return the score for a match with e errors and x location. - * Accesses loc and pattern through being a closure. - * @param {number} e Number of errors in match. - * @param {number} x Location of match. - * @return {number} Overall score for match (0.0 = good, 1.0 = bad). - * @private - */ - function match_bitapScore_(e, x) { - var accuracy = e / pattern.length; - var proximity = Math.abs(loc - x); - if (!dmp.Match_Distance) { - // Dodge divide by zero error. - return proximity ? 1.0 : accuracy; - } - return accuracy + (proximity / dmp.Match_Distance); - } - - // Highest score beyond which we give up. - var score_threshold = this.Match_Threshold; - // Is there a nearby exact match? (speedup) - var best_loc = text.indexOf(pattern, loc); - if (best_loc != -1) { - score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold); - // What about in the other direction? (speedup) - best_loc = text.lastIndexOf(pattern, loc + pattern.length); - if (best_loc != -1) { - score_threshold = - Math.min(match_bitapScore_(0, best_loc), score_threshold); - } - } - - // Initialise the bit arrays. - var matchmask = 1 << (pattern.length - 1); - best_loc = -1; - - var bin_min, bin_mid; - var bin_max = pattern.length + text.length; - var last_rd; - for (var d = 0; d < pattern.length; d++) { - // Scan for the best match; each iteration allows for one more error. - // Run a binary search to determine how far from 'loc' we can stray at this - // error level. - bin_min = 0; - bin_mid = bin_max; - while (bin_min < bin_mid) { - if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) { - bin_min = bin_mid; - } else { - bin_max = bin_mid; - } - bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min); - } - // Use the result from this iteration as the maximum for the next. - bin_max = bin_mid; - var start = Math.max(1, loc - bin_mid + 1); - var finish = Math.min(loc + bin_mid, text.length) + pattern.length; - - var rd = Array(finish + 2); - rd[finish + 1] = (1 << d) - 1; - for (var j = finish; j >= start; j--) { - // The alphabet (s) is a sparse hash, so the following line generates - // warnings. - var charMatch = s[text.charAt(j - 1)]; - if (d === 0) { // First pass: exact match. - rd[j] = ((rd[j + 1] << 1) | 1) & charMatch; - } else { // Subsequent passes: fuzzy match. - rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) | - (((last_rd[j + 1] | last_rd[j]) << 1) | 1) | - last_rd[j + 1]; - } - if (rd[j] & matchmask) { - var score = match_bitapScore_(d, j - 1); - // This match will almost certainly be better than any existing match. - // But check anyway. - if (score <= score_threshold) { - // Told you so. - score_threshold = score; - best_loc = j - 1; - if (best_loc > loc) { - // When passing loc, don't exceed our current distance from loc. - start = Math.max(1, 2 * loc - best_loc); - } else { - // Already passed loc, downhill from here on in. - break; - } - } - } - } - // No hope for a (better) match at greater error levels. - if (match_bitapScore_(d + 1, loc) > score_threshold) { - break; - } - last_rd = rd; - } - return best_loc; -}; - - -/** - * Initialise the alphabet for the Bitap algorithm. - * @param {string} pattern The text to encode. - * @return {!Object} Hash of character locations. - * @private - */ -diff_match_patch.prototype.match_alphabet_ = function(pattern) { - var s = {}; - for (var i = 0; i < pattern.length; i++) { - s[pattern.charAt(i)] = 0; - } - for (var i = 0; i < pattern.length; i++) { - s[pattern.charAt(i)] |= 1 << (pattern.length - i - 1); - } - return s; -}; - - -// PATCH FUNCTIONS - - -/** - * Increase the context until it is unique, - * but don't let the pattern expand beyond Match_MaxBits. - * @param {!diff_match_patch.patch_obj} patch The patch to grow. - * @param {string} text Source text. - * @private - */ -diff_match_patch.prototype.patch_addContext_ = function(patch, text) { - if (text.length == 0) { - return; - } - if (patch.start2 === null) { - throw Error('patch not initialized'); - } - var pattern = text.substring(patch.start2, patch.start2 + patch.length1); - var padding = 0; - - // Look for the first and last matches of pattern in text. If two different - // matches are found, increase the pattern length. - while (text.indexOf(pattern) != text.lastIndexOf(pattern) && - pattern.length < this.Match_MaxBits - this.Patch_Margin - - this.Patch_Margin) { - padding += this.Patch_Margin; - pattern = text.substring(patch.start2 - padding, - patch.start2 + patch.length1 + padding); - } - // Add one chunk for good luck. - padding += this.Patch_Margin; - - // Add the prefix. - var prefix = text.substring(patch.start2 - padding, patch.start2); - if (prefix) { - patch.diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, prefix)); - } - // Add the suffix. - var suffix = text.substring(patch.start2 + patch.length1, - patch.start2 + patch.length1 + padding); - if (suffix) { - patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, suffix)); - } - - // Roll back the start points. - patch.start1 -= prefix.length; - patch.start2 -= prefix.length; - // Extend the lengths. - patch.length1 += prefix.length + suffix.length; - patch.length2 += prefix.length + suffix.length; -}; - - -/** - * Compute a list of patches to turn text1 into text2. - * Use diffs if provided, otherwise compute it ourselves. - * There are four ways to call this function, depending on what data is - * available to the caller: - * Method 1: - * a = text1, b = text2 - * Method 2: - * a = diffs - * Method 3 (optimal): - * a = text1, b = diffs - * Method 4 (deprecated, use method 3): - * a = text1, b = text2, c = diffs - * - * @param {string|!Array.} a text1 (methods 1,3,4) or - * Array of diff tuples for text1 to text2 (method 2). - * @param {string|!Array.=} opt_b text2 (methods 1,4) or - * Array of diff tuples for text1 to text2 (method 3) or undefined (method 2). - * @param {string|!Array.=} opt_c Array of diff tuples - * for text1 to text2 (method 4) or undefined (methods 1,2,3). - * @return {!Array.} Array of Patch objects. - */ -diff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) { - var text1, diffs; - if (typeof a == 'string' && typeof opt_b == 'string' && - typeof opt_c == 'undefined') { - // Method 1: text1, text2 - // Compute diffs from text1 and text2. - text1 = /** @type {string} */(a); - diffs = this.diff_main(text1, /** @type {string} */(opt_b), true); - if (diffs.length > 2) { - this.diff_cleanupSemantic(diffs); - this.diff_cleanupEfficiency(diffs); - } - } else if (a && typeof a == 'object' && typeof opt_b == 'undefined' && - typeof opt_c == 'undefined') { - // Method 2: diffs - // Compute text1 from diffs. - diffs = /** @type {!Array.} */(a); - text1 = this.diff_text1(diffs); - } else if (typeof a == 'string' && opt_b && typeof opt_b == 'object' && - typeof opt_c == 'undefined') { - // Method 3: text1, diffs - text1 = /** @type {string} */(a); - diffs = /** @type {!Array.} */(opt_b); - } else if (typeof a == 'string' && typeof opt_b == 'string' && - opt_c && typeof opt_c == 'object') { - // Method 4: text1, text2, diffs - // text2 is not used. - text1 = /** @type {string} */(a); - diffs = /** @type {!Array.} */(opt_c); - } else { - throw new Error('Unknown call format to patch_make.'); - } - - if (diffs.length === 0) { - return []; // Get rid of the null case. - } - var patches = []; - var patch = new diff_match_patch.patch_obj(); - var patchDiffLength = 0; // Keeping our own length var is faster in JS. - var char_count1 = 0; // Number of characters into the text1 string. - var char_count2 = 0; // Number of characters into the text2 string. - // Start with text1 (prepatch_text) and apply the diffs until we arrive at - // text2 (postpatch_text). We recreate the patches one by one to determine - // context info. - var prepatch_text = text1; - var postpatch_text = text1; - for (var x = 0; x < diffs.length; x++) { - var diff_type = diffs[x][0]; - var diff_text = diffs[x][1]; - - if (!patchDiffLength && diff_type !== DIFF_EQUAL) { - // A new patch starts here. - patch.start1 = char_count1; - patch.start2 = char_count2; - } - - switch (diff_type) { - case DIFF_INSERT: - patch.diffs[patchDiffLength++] = diffs[x]; - patch.length2 += diff_text.length; - postpatch_text = postpatch_text.substring(0, char_count2) + diff_text + - postpatch_text.substring(char_count2); - break; - case DIFF_DELETE: - patch.length1 += diff_text.length; - patch.diffs[patchDiffLength++] = diffs[x]; - postpatch_text = postpatch_text.substring(0, char_count2) + - postpatch_text.substring(char_count2 + - diff_text.length); - break; - case DIFF_EQUAL: - if (diff_text.length <= 2 * this.Patch_Margin && - patchDiffLength && diffs.length != x + 1) { - // Small equality inside a patch. - patch.diffs[patchDiffLength++] = diffs[x]; - patch.length1 += diff_text.length; - patch.length2 += diff_text.length; - } else if (diff_text.length >= 2 * this.Patch_Margin) { - // Time for a new patch. - if (patchDiffLength) { - this.patch_addContext_(patch, prepatch_text); - patches.push(patch); - patch = new diff_match_patch.patch_obj(); - patchDiffLength = 0; - // Unlike Unidiff, our patch lists have a rolling context. - // https://github.com/google/diff-match-patch/wiki/Unidiff - // Update prepatch text & pos to reflect the application of the - // just completed patch. - prepatch_text = postpatch_text; - char_count1 = char_count2; - } - } - break; - } - - // Update the current character count. - if (diff_type !== DIFF_INSERT) { - char_count1 += diff_text.length; - } - if (diff_type !== DIFF_DELETE) { - char_count2 += diff_text.length; - } - } - // Pick up the leftover patch if not empty. - if (patchDiffLength) { - this.patch_addContext_(patch, prepatch_text); - patches.push(patch); - } - - return patches; -}; - - -/** - * Given an array of patches, return another array that is identical. - * @param {!Array.} patches Array of Patch objects. - * @return {!Array.} Array of Patch objects. - */ -diff_match_patch.prototype.patch_deepCopy = function(patches) { - // Making deep copies is hard in JavaScript. - var patchesCopy = []; - for (var x = 0; x < patches.length; x++) { - var patch = patches[x]; - var patchCopy = new diff_match_patch.patch_obj(); - patchCopy.diffs = []; - for (var y = 0; y < patch.diffs.length; y++) { - patchCopy.diffs[y] = - new diff_match_patch.Diff(patch.diffs[y][0], patch.diffs[y][1]); - } - patchCopy.start1 = patch.start1; - patchCopy.start2 = patch.start2; - patchCopy.length1 = patch.length1; - patchCopy.length2 = patch.length2; - patchesCopy[x] = patchCopy; - } - return patchesCopy; -}; - - -/** - * Merge a set of patches onto the text. Return a patched text, as well - * as a list of true/false values indicating which patches were applied. - * @param {!Array.} patches Array of Patch objects. - * @param {string} text Old text. - * @return {!Array.>} Two element Array, containing the - * new text and an array of boolean values. - */ -diff_match_patch.prototype.patch_apply = function(patches, text) { - if (patches.length == 0) { - return [text, []]; - } - - // Deep copy the patches so that no changes are made to originals. - patches = this.patch_deepCopy(patches); - - var nullPadding = this.patch_addPadding(patches); - text = nullPadding + text + nullPadding; - - this.patch_splitMax(patches); - // delta keeps track of the offset between the expected and actual location - // of the previous patch. If there are patches expected at positions 10 and - // 20, but the first patch was found at 12, delta is 2 and the second patch - // has an effective expected position of 22. - var delta = 0; - var results = []; - for (var x = 0; x < patches.length; x++) { - var expected_loc = patches[x].start2 + delta; - var text1 = this.diff_text1(patches[x].diffs); - var start_loc; - var end_loc = -1; - if (text1.length > this.Match_MaxBits) { - // patch_splitMax will only provide an oversized pattern in the case of - // a monster delete. - start_loc = this.match_main(text, text1.substring(0, this.Match_MaxBits), - expected_loc); - if (start_loc != -1) { - end_loc = this.match_main(text, - text1.substring(text1.length - this.Match_MaxBits), - expected_loc + text1.length - this.Match_MaxBits); - if (end_loc == -1 || start_loc >= end_loc) { - // Can't find valid trailing context. Drop this patch. - start_loc = -1; - } - } - } else { - start_loc = this.match_main(text, text1, expected_loc); - } - if (start_loc == -1) { - // No match found. :( - results[x] = false; - // Subtract the delta for this failed patch from subsequent patches. - delta -= patches[x].length2 - patches[x].length1; - } else { - // Found a match. :) - results[x] = true; - delta = start_loc - expected_loc; - var text2; - if (end_loc == -1) { - text2 = text.substring(start_loc, start_loc + text1.length); - } else { - text2 = text.substring(start_loc, end_loc + this.Match_MaxBits); - } - if (text1 == text2) { - // Perfect match, just shove the replacement text in. - text = text.substring(0, start_loc) + - this.diff_text2(patches[x].diffs) + - text.substring(start_loc + text1.length); - } else { - // Imperfect match. Run a diff to get a framework of equivalent - // indices. - var diffs = this.diff_main(text1, text2, false); - if (text1.length > this.Match_MaxBits && - this.diff_levenshtein(diffs) / text1.length > - this.Patch_DeleteThreshold) { - // The end points match, but the content is unacceptably bad. - results[x] = false; - } else { - this.diff_cleanupSemanticLossless(diffs); - var index1 = 0; - var index2; - for (var y = 0; y < patches[x].diffs.length; y++) { - var mod = patches[x].diffs[y]; - if (mod[0] !== DIFF_EQUAL) { - index2 = this.diff_xIndex(diffs, index1); - } - if (mod[0] === DIFF_INSERT) { // Insertion - text = text.substring(0, start_loc + index2) + mod[1] + - text.substring(start_loc + index2); - } else if (mod[0] === DIFF_DELETE) { // Deletion - text = text.substring(0, start_loc + index2) + - text.substring(start_loc + this.diff_xIndex(diffs, - index1 + mod[1].length)); - } - if (mod[0] !== DIFF_DELETE) { - index1 += mod[1].length; - } - } - } - } - } - } - // Strip the padding off. - text = text.substring(nullPadding.length, text.length - nullPadding.length); - return [text, results]; -}; - - -/** - * Add some padding on text start and end so that edges can match something. - * Intended to be called only from within patch_apply. - * @param {!Array.} patches Array of Patch objects. - * @return {string} The padding string added to each side. - */ -diff_match_patch.prototype.patch_addPadding = function(patches) { - var paddingLength = this.Patch_Margin; - var nullPadding = ''; - for (var x = 1; x <= paddingLength; x++) { - nullPadding += String.fromCharCode(x); - } - - // Bump all the patches forward. - for (var x = 0; x < patches.length; x++) { - patches[x].start1 += paddingLength; - patches[x].start2 += paddingLength; - } - - // Add some padding on start of first diff. - var patch = patches[0]; - var diffs = patch.diffs; - if (diffs.length == 0 || diffs[0][0] != DIFF_EQUAL) { - // Add nullPadding equality. - diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding)); - patch.start1 -= paddingLength; // Should be 0. - patch.start2 -= paddingLength; // Should be 0. - patch.length1 += paddingLength; - patch.length2 += paddingLength; - } else if (paddingLength > diffs[0][1].length) { - // Grow first equality. - var extraLength = paddingLength - diffs[0][1].length; - diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1]; - patch.start1 -= extraLength; - patch.start2 -= extraLength; - patch.length1 += extraLength; - patch.length2 += extraLength; - } - - // Add some padding on end of last diff. - patch = patches[patches.length - 1]; - diffs = patch.diffs; - if (diffs.length == 0 || diffs[diffs.length - 1][0] != DIFF_EQUAL) { - // Add nullPadding equality. - diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding)); - patch.length1 += paddingLength; - patch.length2 += paddingLength; - } else if (paddingLength > diffs[diffs.length - 1][1].length) { - // Grow last equality. - var extraLength = paddingLength - diffs[diffs.length - 1][1].length; - diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength); - patch.length1 += extraLength; - patch.length2 += extraLength; - } - - return nullPadding; -}; - - -/** - * Look through the patches and break up any which are longer than the maximum - * limit of the match algorithm. - * Intended to be called only from within patch_apply. - * @param {!Array.} patches Array of Patch objects. - */ -diff_match_patch.prototype.patch_splitMax = function(patches) { - var patch_size = this.Match_MaxBits; - for (var x = 0; x < patches.length; x++) { - if (patches[x].length1 <= patch_size) { - continue; - } - var bigpatch = patches[x]; - // Remove the big old patch. - patches.splice(x--, 1); - var start1 = bigpatch.start1; - var start2 = bigpatch.start2; - var precontext = ''; - while (bigpatch.diffs.length !== 0) { - // Create one of several smaller patches. - var patch = new diff_match_patch.patch_obj(); - var empty = true; - patch.start1 = start1 - precontext.length; - patch.start2 = start2 - precontext.length; - if (precontext !== '') { - patch.length1 = patch.length2 = precontext.length; - patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, precontext)); - } - while (bigpatch.diffs.length !== 0 && - patch.length1 < patch_size - this.Patch_Margin) { - var diff_type = bigpatch.diffs[0][0]; - var diff_text = bigpatch.diffs[0][1]; - if (diff_type === DIFF_INSERT) { - // Insertions are harmless. - patch.length2 += diff_text.length; - start2 += diff_text.length; - patch.diffs.push(bigpatch.diffs.shift()); - empty = false; - } else if (diff_type === DIFF_DELETE && patch.diffs.length == 1 && - patch.diffs[0][0] == DIFF_EQUAL && - diff_text.length > 2 * patch_size) { - // This is a large deletion. Let it pass in one chunk. - patch.length1 += diff_text.length; - start1 += diff_text.length; - empty = false; - patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text)); - bigpatch.diffs.shift(); - } else { - // Deletion or equality. Only take as much as we can stomach. - diff_text = diff_text.substring(0, - patch_size - patch.length1 - this.Patch_Margin); - patch.length1 += diff_text.length; - start1 += diff_text.length; - if (diff_type === DIFF_EQUAL) { - patch.length2 += diff_text.length; - start2 += diff_text.length; - } else { - empty = false; - } - patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text)); - if (diff_text == bigpatch.diffs[0][1]) { - bigpatch.diffs.shift(); - } else { - bigpatch.diffs[0][1] = - bigpatch.diffs[0][1].substring(diff_text.length); - } - } - } - // Compute the head context for the next patch. - precontext = this.diff_text2(patch.diffs); - precontext = - precontext.substring(precontext.length - this.Patch_Margin); - // Append the end context for this patch. - var postcontext = this.diff_text1(bigpatch.diffs) - .substring(0, this.Patch_Margin); - if (postcontext !== '') { - patch.length1 += postcontext.length; - patch.length2 += postcontext.length; - if (patch.diffs.length !== 0 && - patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) { - patch.diffs[patch.diffs.length - 1][1] += postcontext; - } else { - patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, postcontext)); - } - } - if (!empty) { - patches.splice(++x, 0, patch); - } - } - } -}; - - -/** - * Take a list of patches and return a textual representation. - * @param {!Array.} patches Array of Patch objects. - * @return {string} Text representation of patches. - */ -diff_match_patch.prototype.patch_toText = function(patches) { - var text = []; - for (var x = 0; x < patches.length; x++) { - text[x] = patches[x]; - } - return text.join(''); -}; - - -/** - * Parse a textual representation of patches and return a list of Patch objects. - * @param {string} textline Text representation of patches. - * @return {!Array.} Array of Patch objects. - * @throws {!Error} If invalid input. - */ -diff_match_patch.prototype.patch_fromText = function(textline) { - var patches = []; - if (!textline) { - return patches; - } - var text = textline.split('\n'); - var textPointer = 0; - var patchHeader = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/; - while (textPointer < text.length) { - var m = text[textPointer].match(patchHeader); - if (!m) { - throw new Error('Invalid patch string: ' + text[textPointer]); - } - var patch = new diff_match_patch.patch_obj(); - patches.push(patch); - patch.start1 = parseInt(m[1], 10); - if (m[2] === '') { - patch.start1--; - patch.length1 = 1; - } else if (m[2] == '0') { - patch.length1 = 0; - } else { - patch.start1--; - patch.length1 = parseInt(m[2], 10); - } - - patch.start2 = parseInt(m[3], 10); - if (m[4] === '') { - patch.start2--; - patch.length2 = 1; - } else if (m[4] == '0') { - patch.length2 = 0; - } else { - patch.start2--; - patch.length2 = parseInt(m[4], 10); - } - textPointer++; - - while (textPointer < text.length) { - var sign = text[textPointer].charAt(0); - try { - var line = decodeURI(text[textPointer].substring(1)); - } catch (ex) { - // Malformed URI sequence. - throw new Error('Illegal escape in patch_fromText: ' + line); - } - if (sign == '-') { - // Deletion. - patch.diffs.push(new diff_match_patch.Diff(DIFF_DELETE, line)); - } else if (sign == '+') { - // Insertion. - patch.diffs.push(new diff_match_patch.Diff(DIFF_INSERT, line)); - } else if (sign == ' ') { - // Minor equality. - patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, line)); - } else if (sign == '@') { - // Start of next patch. - break; - } else if (sign === '') { - // Blank line? Whatever. - } else { - // WTF? - throw new Error('Invalid patch mode "' + sign + '" in: ' + line); - } - textPointer++; - } - } - return patches; -}; - - -/** - * Class representing one patch operation. - * @constructor - */ -diff_match_patch.patch_obj = function() { - /** @type {!Array.} */ - this.diffs = []; - /** @type {?number} */ - this.start1 = null; - /** @type {?number} */ - this.start2 = null; - /** @type {number} */ - this.length1 = 0; - /** @type {number} */ - this.length2 = 0; -}; - - -/** - * Emulate GNU diff's format. - * Header: @@ -382,8 +481,9 @@ - * Indices are printed as 1-based, not 0-based. - * @return {string} The GNU diff string. - */ -diff_match_patch.patch_obj.prototype.toString = function() { - var coords1, coords2; - if (this.length1 === 0) { - coords1 = this.start1 + ',0'; - } else if (this.length1 == 1) { - coords1 = this.start1 + 1; - } else { - coords1 = (this.start1 + 1) + ',' + this.length1; - } - if (this.length2 === 0) { - coords2 = this.start2 + ',0'; - } else if (this.length2 == 1) { - coords2 = this.start2 + 1; - } else { - coords2 = (this.start2 + 1) + ',' + this.length2; - } - var text = ['@@ -' + coords1 + ' +' + coords2 + ' @@\n']; - var op; - // Escape the body of the patch with %xx notation. - for (var x = 0; x < this.diffs.length; x++) { - switch (this.diffs[x][0]) { - case DIFF_INSERT: - op = '+'; - break; - case DIFF_DELETE: - op = '-'; - break; - case DIFF_EQUAL: - op = ' '; - break; - } - text[x + 1] = op + encodeURI(this.diffs[x][1]) + '\n'; - } - return text.join('').replace(/%20/g, ' '); -}; - -module.exports = { diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL }; diff --git a/priv/static/node_modules/playwright-core/lib/utils/comparators.js b/priv/static/node_modules/playwright-core/lib/utils/comparators.js index 20b71300..a0388a55 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/comparators.js +++ b/priv/static/node_modules/playwright-core/lib/utils/comparators.js @@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.getComparator = getComparator; var _utilsBundle = require("../utilsBundle"); +var _pixelmatch = _interopRequireDefault(require("../third_party/pixelmatch")); var _compare = require("../image_tools/compare"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Copyright 2017 Google Inc. All rights reserved. * Modifications copyright (c) Microsoft Corporation. @@ -23,13 +25,8 @@ var _compare = require("../image_tools/compare"); * limitations under the License. */ -const pixelmatch = require('../third_party/pixelmatch'); -const { - diff_match_patch, - DIFF_INSERT, - DIFF_DELETE, - DIFF_EQUAL -} = require('../third_party/diff_match_patch'); +// @ts-ignore + function getComparator(mimeType) { if (mimeType === 'image/png') return compareImages.bind(null, 'image/png'); if (mimeType === 'image/jpeg') return compareImages.bind(null, 'image/jpeg'); @@ -83,7 +80,7 @@ function compareImages(mimeType, actualBuffer, expectedBuffer, options = {}) { }); } else if (((_options$comparator = options.comparator) !== null && _options$comparator !== void 0 ? _options$comparator : 'pixelmatch') === 'pixelmatch') { var _options$threshold; - count = pixelmatch(expected.data, actual.data, diff.data, size.width, size.height, { + count = (0, _pixelmatch.default)(expected.data, actual.data, diff.data, size.width, size.height, { threshold: (_options$threshold = options.threshold) !== null && _options$threshold !== void 0 ? _options$threshold : 0.2 }); } else { @@ -116,32 +113,17 @@ function compareText(actual, expectedBuffer) { }; const expected = expectedBuffer.toString('utf-8'); if (expected === actual) return null; - const dmp = new diff_match_patch(); - const d = dmp.diff_main(expected, actual); - dmp.diff_cleanupSemantic(d); + const diffs = _utilsBundle.diff.diffChars(expected, actual); return { - errorMessage: diff_prettyTerminal(d) + errorMessage: diff_prettyTerminal(diffs) }; } function diff_prettyTerminal(diffs) { - const html = []; - for (let x = 0; x < diffs.length; x++) { - const op = diffs[x][0]; // Operation (insert, delete, equal) - const data = diffs[x][1]; // Text of change. - const text = data; - switch (op) { - case DIFF_INSERT: - html[x] = _utilsBundle.colors.green(text); - break; - case DIFF_DELETE: - html[x] = _utilsBundle.colors.reset(_utilsBundle.colors.strikethrough(_utilsBundle.colors.red(text))); - break; - case DIFF_EQUAL: - html[x] = text; - break; - } - } - return html.join(''); + const result = diffs.map(part => { + const text = part.value; + if (part.added) return _utilsBundle.colors.green(text);else if (part.removed) return _utilsBundle.colors.reset(_utilsBundle.colors.strikethrough(_utilsBundle.colors.red(text)));else return text; + }); + return result.join(''); } function resizeImage(image, size) { if (image.width === size.width && image.height === size.height) return image; diff --git a/priv/static/node_modules/playwright-core/lib/utils/crypto.js b/priv/static/node_modules/playwright-core/lib/utils/crypto.js index c192c780..6b55e178 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/crypto.js +++ b/priv/static/node_modules/playwright-core/lib/utils/crypto.js @@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.calculateSha1 = calculateSha1; exports.createGuid = createGuid; +exports.generateSelfSignedCertificate = generateSelfSignedCertificate; var _crypto = _interopRequireDefault(require("crypto")); +var _debug = require("./debug"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Copyright (c) Microsoft Corporation. @@ -30,4 +32,140 @@ function calculateSha1(buffer) { const hash = _crypto.default.createHash('sha1'); hash.update(buffer); return hash.digest('hex'); +} + +// Variable-length quantity encoding aka. base-128 encoding +function encodeBase128(value) { + const bytes = []; + do { + let byte = value & 0x7f; + value >>>= 7; + if (bytes.length > 0) byte |= 0x80; + bytes.push(byte); + } while (value > 0); + return Buffer.from(bytes.reverse()); +} + +// ASN1/DER Speficiation: https://www.itu.int/rec/T-REC-X.680-X.693-202102-I/en +class DER { + static encodeSequence(data) { + return this._encode(0x30, Buffer.concat(data)); + } + static encodeInteger(data) { + (0, _debug.assert)(data >= -128 && data <= 127); + return this._encode(0x02, Buffer.from([data])); + } + static encodeObjectIdentifier(oid) { + const parts = oid.split('.').map(v => Number(v)); + // Encode the second part, which could be large, using base-128 encoding if necessary + const output = [encodeBase128(40 * parts[0] + parts[1])]; + for (let i = 2; i < parts.length; i++) output.push(encodeBase128(parts[i])); + return this._encode(0x06, Buffer.concat(output)); + } + static encodeNull() { + return Buffer.from([0x05, 0x00]); + } + static encodeSet(data) { + (0, _debug.assert)(data.length === 1, 'Only one item in the set is supported. We\'d need to sort the data to support more.'); + // We expect the data to be already sorted. + return this._encode(0x31, Buffer.concat(data)); + } + static encodeExplicitContextDependent(tag, data) { + return this._encode(0xa0 + tag, data); + } + static encodePrintableString(data) { + return this._encode(0x13, Buffer.from(data)); + } + static encodeBitString(data) { + // The first byte of the content is the number of unused bits at the end + const unusedBits = 0; // Assuming all bits are used + const content = Buffer.concat([Buffer.from([unusedBits]), data]); + return this._encode(0x03, content); + } + static encodeDate(date) { + const year = date.getUTCFullYear(); + const isGeneralizedTime = year >= 2050; + const parts = [isGeneralizedTime ? year.toString() : year.toString().slice(-2), (date.getUTCMonth() + 1).toString().padStart(2, '0'), date.getUTCDate().toString().padStart(2, '0'), date.getUTCHours().toString().padStart(2, '0'), date.getUTCMinutes().toString().padStart(2, '0'), date.getUTCSeconds().toString().padStart(2, '0')]; + const encodedDate = parts.join('') + 'Z'; + const tag = isGeneralizedTime ? 0x18 : 0x17; // 0x18 for GeneralizedTime, 0x17 for UTCTime + return this._encode(tag, Buffer.from(encodedDate)); + } + static _encode(tag, data) { + const lengthBytes = this._encodeLength(data.length); + return Buffer.concat([Buffer.from([tag]), lengthBytes, data]); + } + static _encodeLength(length) { + if (length < 128) { + return Buffer.from([length]); + } else { + const lengthBytes = []; + while (length > 0) { + lengthBytes.unshift(length & 0xFF); + length >>= 8; + } + return Buffer.from([0x80 | lengthBytes.length, ...lengthBytes]); + } + } +} + +// X.509 Specification: https://datatracker.ietf.org/doc/html/rfc2459#section-4.1 +function generateSelfSignedCertificate() { + const { + privateKey, + publicKey + } = _crypto.default.generateKeyPairSync('rsa', { + modulusLength: 2048 + }); + const publicKeyDer = publicKey.export({ + type: 'pkcs1', + format: 'der' + }); + const oneYearInMilliseconds = 365 * 24 * 60 * 60 * 1_000; + const notBefore = new Date(new Date().getTime() - oneYearInMilliseconds); + const notAfter = new Date(new Date().getTime() + oneYearInMilliseconds); + + // List of fields / structure: https://datatracker.ietf.org/doc/html/rfc2459#section-4.1 + const tbsCertificate = DER.encodeSequence([DER.encodeExplicitContextDependent(0, DER.encodeInteger(1)), + // version + DER.encodeInteger(1), + // serialNumber + DER.encodeSequence([DER.encodeObjectIdentifier('1.2.840.113549.1.1.11'), + // sha256WithRSAEncryption PKCS #1 + DER.encodeNull()]), + // signature + DER.encodeSequence([DER.encodeSet([DER.encodeSequence([DER.encodeObjectIdentifier('2.5.4.3'), + // commonName X.520 DN component + DER.encodePrintableString('localhost')])]), DER.encodeSet([DER.encodeSequence([DER.encodeObjectIdentifier('2.5.4.10'), + // organizationName X.520 DN component + DER.encodePrintableString('Playwright Client Certificate Support')])])]), + // issuer + DER.encodeSequence([DER.encodeDate(notBefore), + // notBefore + DER.encodeDate(notAfter) // notAfter + ]), + // validity + DER.encodeSequence([DER.encodeSet([DER.encodeSequence([DER.encodeObjectIdentifier('2.5.4.3'), + // commonName X.520 DN component + DER.encodePrintableString('localhost')])]), DER.encodeSet([DER.encodeSequence([DER.encodeObjectIdentifier('2.5.4.10'), + // organizationName X.520 DN component + DER.encodePrintableString('Playwright Client Certificate Support')])])]), + // subject + DER.encodeSequence([DER.encodeSequence([DER.encodeObjectIdentifier('1.2.840.113549.1.1.1'), + // rsaEncryption PKCS #1 + DER.encodeNull()]), DER.encodeBitString(publicKeyDer)]) // SubjectPublicKeyInfo + ]); + const signature = _crypto.default.sign('sha256', tbsCertificate, privateKey); + const certificate = DER.encodeSequence([tbsCertificate, DER.encodeSequence([DER.encodeObjectIdentifier('1.2.840.113549.1.1.11'), + // sha256WithRSAEncryption PKCS #1 + DER.encodeNull()]), DER.encodeBitString(signature)]); + const certPem = ['-----BEGIN CERTIFICATE-----', + // Split the base64 string into lines of 64 characters + certificate.toString('base64').match(/.{1,64}/g).join('\n'), '-----END CERTIFICATE-----'].join('\n'); + return { + cert: certPem, + key: privateKey.export({ + type: 'pkcs1', + format: 'pem' + }) + }; } \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/debugLogger.js b/priv/static/node_modules/playwright-core/lib/utils/debugLogger.js index 1e4fe75d..3056e84b 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/debugLogger.js +++ b/priv/static/node_modules/playwright-core/lib/utils/debugLogger.js @@ -36,6 +36,8 @@ const debugLoggerColorMap = { // reset 'socks': 92, // purple + 'client-certificates': 92, + // purple 'error': 160, // red, 'channel': 33, diff --git a/priv/static/node_modules/playwright-core/lib/utils/env.js b/priv/static/node_modules/playwright-core/lib/utils/env.js index eca3634f..ef893618 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/env.js +++ b/priv/static/node_modules/playwright-core/lib/utils/env.js @@ -29,9 +29,11 @@ function getFromENV(name) { value = value === undefined ? process.env[`npm_package_config_${name.toLowerCase()}`] : value; return value; } -function getAsBooleanFromENV(name) { +function getAsBooleanFromENV(name, defaultValue) { const value = getFromENV(name); - return !!value && value !== 'false' && value !== '0'; + if (value === 'false' || value === '0') return false; + if (value) return true; + return !!defaultValue; } function getPackageManager() { const env = process.env.npm_config_user_agent || ''; diff --git a/priv/static/node_modules/playwright-core/lib/utils/expectUtils.js b/priv/static/node_modules/playwright-core/lib/utils/expectUtils.js new file mode 100644 index 00000000..be8503d8 --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/utils/expectUtils.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.serializeExpectedTextValues = serializeExpectedTextValues; +var _rtti = require("./rtti"); +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function serializeExpectedTextValues(items, options = {}) { + return items.map(i => ({ + string: (0, _rtti.isString)(i) ? i : undefined, + regexSource: (0, _rtti.isRegExp)(i) ? i.source : undefined, + regexFlags: (0, _rtti.isRegExp)(i) ? i.flags : undefined, + matchSubstring: options.matchSubstring, + ignoreCase: options.ignoreCase, + normalizeWhiteSpace: options.normalizeWhiteSpace + })); +} \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/fileUtils.js b/priv/static/node_modules/playwright-core/lib/utils/fileUtils.js index 87e36753..56e31f80 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/fileUtils.js +++ b/priv/static/node_modules/playwright-core/lib/utils/fileUtils.js @@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); +exports.SerializedFS = void 0; exports.canAccessFile = canAccessFile; exports.copyFileAndMakeWritable = copyFileAndMakeWritable; exports.fileUploadSizeLimit = exports.existsAsync = void 0; @@ -12,6 +13,8 @@ exports.sanitizeForFilePath = sanitizeForFilePath; exports.toPosixPath = toPosixPath; var _fs = _interopRequireDefault(require("fs")); var _path = _interopRequireDefault(require("path")); +var _manualPromise = require("./manualPromise"); +var _zipBundle = require("../zipBundle"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Copyright (c) Microsoft Corporation. @@ -63,4 +66,140 @@ function sanitizeForFilePath(s) { } function toPosixPath(aPath) { return aPath.split(_path.default.sep).join(_path.default.posix.sep); -} \ No newline at end of file +} +class SerializedFS { + constructor() { + this._buffers = new Map(); + // Should never be accessed from within appendOperation. + this._error = void 0; + this._operations = []; + this._operationsDone = void 0; + this._operationsDone = new _manualPromise.ManualPromise(); + this._operationsDone.resolve(); // No operations scheduled yet. + } + mkdir(dir) { + this._appendOperation({ + op: 'mkdir', + dir + }); + } + writeFile(file, content, skipIfExists) { + this._buffers.delete(file); // No need to flush the buffer since we'll overwrite anyway. + this._appendOperation({ + op: 'writeFile', + file, + content, + skipIfExists + }); + } + appendFile(file, text, flush) { + if (!this._buffers.has(file)) this._buffers.set(file, []); + this._buffers.get(file).push(text); + if (flush) this._flushFile(file); + } + _flushFile(file) { + const buffer = this._buffers.get(file); + if (buffer === undefined) return; + const content = buffer.join(''); + this._buffers.delete(file); + this._appendOperation({ + op: 'appendFile', + file, + content + }); + } + copyFile(from, to) { + this._flushFile(from); + this._buffers.delete(to); // No need to flush the buffer since we'll overwrite anyway. + this._appendOperation({ + op: 'copyFile', + from, + to + }); + } + async syncAndGetError() { + for (const file of this._buffers.keys()) this._flushFile(file); + await this._operationsDone; + return this._error; + } + zip(entries, zipFileName) { + for (const file of this._buffers.keys()) this._flushFile(file); + + // Chain the export operation against write operations, + // so that files do not change during the export. + this._appendOperation({ + op: 'zip', + entries, + zipFileName + }); + } + + // This method serializes all writes to the trace. + _appendOperation(op) { + const last = this._operations[this._operations.length - 1]; + if ((last === null || last === void 0 ? void 0 : last.op) === 'appendFile' && op.op === 'appendFile' && last.file === op.file) { + // Merge pending appendFile operations for performance. + last.content += op.content; + return; + } + this._operations.push(op); + if (this._operationsDone.isDone()) this._performOperations(); + } + async _performOperations() { + this._operationsDone = new _manualPromise.ManualPromise(); + while (this._operations.length) { + const op = this._operations.shift(); + // Ignore all operations after the first error. + if (this._error) continue; + try { + await this._performOperation(op); + } catch (e) { + this._error = e; + } + } + this._operationsDone.resolve(); + } + async _performOperation(op) { + switch (op.op) { + case 'mkdir': + { + await _fs.default.promises.mkdir(op.dir, { + recursive: true + }); + return; + } + case 'writeFile': + { + // Note: 'wx' flag only writes when the file does not exist. + // See https://nodejs.org/api/fs.html#file-system-flags. + // This way tracing never have to write the same resource twice. + if (op.skipIfExists) await _fs.default.promises.writeFile(op.file, op.content, { + flag: 'wx' + }).catch(() => {});else await _fs.default.promises.writeFile(op.file, op.content); + return; + } + case 'copyFile': + { + await _fs.default.promises.copyFile(op.from, op.to); + return; + } + case 'appendFile': + { + await _fs.default.promises.appendFile(op.file, op.content); + return; + } + case 'zip': + { + const zipFile = new _zipBundle.yazl.ZipFile(); + const result = new _manualPromise.ManualPromise(); + zipFile.on('error', error => result.reject(error)); + for (const entry of op.entries) zipFile.addFile(entry.value, entry.name); + zipFile.end(); + zipFile.outputStream.pipe(_fs.default.createWriteStream(op.zipFileName)).on('close', () => result.resolve()).on('error', error => result.reject(error)); + await result; + return; + } + } + } +} +exports.SerializedFS = SerializedFS; \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/happy-eyeballs.js b/priv/static/node_modules/playwright-core/lib/utils/happy-eyeballs.js index e810f60e..661960d0 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/happy-eyeballs.js +++ b/priv/static/node_modules/playwright-core/lib/utils/happy-eyeballs.js @@ -3,14 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); +exports.createConnectionAsync = createConnectionAsync; exports.createSocket = createSocket; +exports.createTLSSocket = createTLSSocket; exports.httpsHappyEyeballsAgent = exports.httpHappyEyeballsAgent = void 0; +exports.timingForSocket = timingForSocket; var dns = _interopRequireWildcard(require("dns")); var http = _interopRequireWildcard(require("http")); var https = _interopRequireWildcard(require("https")); var net = _interopRequireWildcard(require("net")); var tls = _interopRequireWildcard(require("tls")); var _manualPromise = require("./manualPromise"); +var _debug = require("./debug"); +var _time = require("./time"); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } /** @@ -34,6 +39,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; // Same as in Chromium (https://source.chromium.org/chromium/chromium/src/+/5666ff4f5077a7e2f72902f3a95f5d553ea0d88d:net/socket/transport_connect_job.cc;l=102) const connectionAttemptDelayMs = 300; +const kDNSLookupAt = Symbol('kDNSLookupAt'); +const kTCPConnectionAt = Symbol('kTCPConnectionAt'); class HttpHappyEyeballsAgent extends http.Agent { createConnection(options, oncreate) { // There is no ambiguity in case of IP address. @@ -48,8 +55,14 @@ class HttpsHappyEyeballsAgent extends https.Agent { createConnectionAsync(options, oncreate, /* useTLS */true).catch(err => oncreate === null || oncreate === void 0 ? void 0 : oncreate(err)); } } -const httpsHappyEyeballsAgent = exports.httpsHappyEyeballsAgent = new HttpsHappyEyeballsAgent(); -const httpHappyEyeballsAgent = exports.httpHappyEyeballsAgent = new HttpHappyEyeballsAgent(); + +// These options are aligned with the default Node.js globalAgent options. +const httpsHappyEyeballsAgent = exports.httpsHappyEyeballsAgent = new HttpsHappyEyeballsAgent({ + keepAlive: true +}); +const httpHappyEyeballsAgent = exports.httpHappyEyeballsAgent = new HttpHappyEyeballsAgent({ + keepAlive: true +}); async function createSocket(host, port) { return new Promise((resolve, reject) => { if (net.isIP(host)) { @@ -70,10 +83,29 @@ async function createSocket(host, port) { } }); } +async function createTLSSocket(options) { + return new Promise((resolve, reject) => { + (0, _debug.assert)(options.host, 'host is required'); + if (net.isIP(options.host)) { + const socket = tls.connect(options); + socket.on('secureConnect', () => resolve(socket)); + socket.on('error', error => reject(error)); + } else { + createConnectionAsync(options, (err, socket) => { + if (err) reject(err); + if (socket) { + socket.on('secureConnect', () => resolve(socket)); + socket.on('error', error => reject(error)); + } + }, true).catch(err => reject(err)); + } + }); +} async function createConnectionAsync(options, oncreate, useTLS) { const lookup = options.__testHookLookup || lookupAddresses; const hostname = clientRequestArgsToHostName(options); const addresses = await lookup(hostname); + const dnsLookupAt = (0, _time.monotonicTime)(); const sockets = new Set(); let firstError; let errorCount = 0; @@ -98,10 +130,12 @@ async function createConnectionAsync(options, oncreate, useTLS) { port: options.port, host: address }); + socket[kDNSLookupAt] = dnsLookupAt; // Each socket may fire only one of 'connect', 'timeout' or 'error' events. // None of these events are fired after socket.destroy() is called. socket.on('connect', () => { + socket[kTCPConnectionAt] = (0, _time.monotonicTime)(); connected.resolve(); oncreate === null || oncreate === void 0 || oncreate(null, socket); // TODO: Cache the result? @@ -151,4 +185,10 @@ function clientRequestArgsToHostName(options) { if (options.hostname) return options.hostname; if (options.host) return options.host; throw new Error('Either options.hostname or options.host must be provided'); +} +function timingForSocket(socket) { + return { + dnsLookupAt: socket[kDNSLookupAt], + tcpConnectionAt: socket[kTCPConnectionAt] + }; } \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/hostPlatform.js b/priv/static/node_modules/playwright-core/lib/utils/hostPlatform.js index 79687477..d121493d 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/hostPlatform.js +++ b/priv/static/node_modules/playwright-core/lib/utils/hostPlatform.js @@ -24,6 +24,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de */ function calculatePlatform() { + if (process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE) { + return { + hostPlatform: process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE, + isOfficiallySupportedPlatform: false + }; + } const platform = _os.default.platform(); if (platform === 'darwin') { const ver = _os.default.release().split('.').map(a => parseInt(a, 10)); @@ -37,9 +43,9 @@ function calculatePlatform() { macVersion = 'mac10.15'; } else { // ver[0] >= 20 - const LAST_STABLE_MAC_MAJOR_VERSION = 14; + const LAST_STABLE_MACOS_MAJOR_VERSION = 15; // Best-effort support for MacOS beta versions. - macVersion = 'mac' + Math.min(ver[0] - 9, LAST_STABLE_MAC_MAJOR_VERSION); + macVersion = 'mac' + Math.min(ver[0] - 9, LAST_STABLE_MACOS_MAJOR_VERSION); // BigSur is the first version that might run on Apple Silicon. if (_os.default.cpus().some(cpu => cpu.model.includes('Apple'))) macVersion += '-arm64'; } @@ -69,21 +75,30 @@ function calculatePlatform() { hostPlatform: 'ubuntu20.04' + archSuffix, isOfficiallySupportedPlatform }; - return { + if (parseInt(distroInfo.version, 10) <= 22) return { hostPlatform: 'ubuntu22.04' + archSuffix, isOfficiallySupportedPlatform }; + return { + hostPlatform: 'ubuntu24.04' + archSuffix, + isOfficiallySupportedPlatform + }; } // Linux Mint is ubuntu-based but does not have the same versions if ((distroInfo === null || distroInfo === void 0 ? void 0 : distroInfo.id) === 'linuxmint') { - if (parseInt(distroInfo.version, 10) <= 20) return { + const mintMajor = parseInt(distroInfo.version, 10); + if (mintMajor <= 20) return { hostPlatform: 'ubuntu20.04' + archSuffix, isOfficiallySupportedPlatform: false }; - return { + if (mintMajor === 21) return { hostPlatform: 'ubuntu22.04' + archSuffix, isOfficiallySupportedPlatform: false }; + return { + hostPlatform: 'ubuntu24.04' + archSuffix, + isOfficiallySupportedPlatform: false + }; } if ((distroInfo === null || distroInfo === void 0 ? void 0 : distroInfo.id) === 'debian' || (distroInfo === null || distroInfo === void 0 ? void 0 : distroInfo.id) === 'raspbian') { const isOfficiallySupportedPlatform = (distroInfo === null || distroInfo === void 0 ? void 0 : distroInfo.id) === 'debian'; diff --git a/priv/static/node_modules/playwright-core/lib/utils/httpServer.js b/priv/static/node_modules/playwright-core/lib/utils/httpServer.js index 39112f00..3dc01b22 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/httpServer.js +++ b/priv/static/node_modules/playwright-core/lib/utils/httpServer.js @@ -29,14 +29,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de */ class HttpServer { - constructor(address = '') { + constructor() { this._server = void 0; - this._urlPrefix = void 0; + this._urlPrefixPrecise = ''; + this._urlPrefixHumanReadable = ''; this._port = 0; this._started = false; this._routes = []; this._wsGuid = void 0; - this._urlPrefix = address; this._server = (0, _network.createHttpServer)(this._onRequest.bind(this)); } server() { @@ -76,6 +76,7 @@ class HttpServer { path: '/' + this._wsGuid }); wss.on('connection', ws => { + transport.onconnect(); transport.sendEvent = (method, params) => ws.send(JSON.stringify({ method, params @@ -123,22 +124,21 @@ class HttpServer { } const address = this._server.address(); (0, _debug.assert)(address, 'Could not bind server socket'); - if (!this._urlPrefix) { - if (typeof address === 'string') { - this._urlPrefix = address; - } else { - this._port = address.port; - const resolvedHost = address.family === 'IPv4' ? address.address : `[${address.address}]`; - this._urlPrefix = `http://${resolvedHost}:${address.port}`; - } + if (typeof address === 'string') { + this._urlPrefixPrecise = address; + this._urlPrefixHumanReadable = address; + } else { + this._port = address.port; + const resolvedHost = address.family === 'IPv4' ? address.address : `[${address.address}]`; + this._urlPrefixPrecise = `http://${resolvedHost}:${address.port}`; + this._urlPrefixHumanReadable = `http://${host}:${address.port}`; } - return this._urlPrefix; } async stop() { await new Promise(cb => this._server.close(cb)); } - urlPrefix() { - return this._urlPrefix; + urlPrefix(purpose) { + return purpose === 'human-readable' ? this._urlPrefixHumanReadable : this._urlPrefixPrecise; } serveFile(request, response, absoluteFilePath, headers) { try { diff --git a/priv/static/node_modules/playwright-core/lib/utils/index.js b/priv/static/node_modules/playwright-core/lib/utils/index.js index 63ff5ee6..58dae33b 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/index.js +++ b/priv/static/node_modules/playwright-core/lib/utils/index.js @@ -47,6 +47,17 @@ Object.keys(_debug).forEach(function (key) { } }); }); +var _debugLogger = require("./debugLogger"); +Object.keys(_debugLogger).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _debugLogger[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _debugLogger[key]; + } + }); +}); var _env = require("./env"); Object.keys(_env).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -69,25 +80,25 @@ Object.keys(_eventsHelper).forEach(function (key) { } }); }); -var _fileUtils = require("./fileUtils"); -Object.keys(_fileUtils).forEach(function (key) { +var _expectUtils = require("./expectUtils"); +Object.keys(_expectUtils).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _fileUtils[key]) return; + if (key in exports && exports[key] === _expectUtils[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { - return _fileUtils[key]; + return _expectUtils[key]; } }); }); -var _glob = require("./glob"); -Object.keys(_glob).forEach(function (key) { +var _fileUtils = require("./fileUtils"); +Object.keys(_fileUtils).forEach(function (key) { if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _glob[key]) return; + if (key in exports && exports[key] === _fileUtils[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { - return _glob[key]; + return _fileUtils[key]; } }); }); @@ -135,7 +146,18 @@ Object.keys(_manualPromise).forEach(function (key) { } }); }); -var _mimeType = require("./mimeType"); +var _locatorGenerators = require("./isomorphic/locatorGenerators"); +Object.keys(_locatorGenerators).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _locatorGenerators[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _locatorGenerators[key]; + } + }); +}); +var _mimeType = require("./isomorphic/mimeType"); Object.keys(_mimeType).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _mimeType[key]) return; @@ -146,6 +168,28 @@ Object.keys(_mimeType).forEach(function (key) { } }); }); +var _stringUtils = require("./isomorphic/stringUtils"); +Object.keys(_stringUtils).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _stringUtils[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _stringUtils[key]; + } + }); +}); +var _urlMatch = require("./isomorphic/urlMatch"); +Object.keys(_urlMatch).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _urlMatch[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _urlMatch[key]; + } + }); +}); var _multimap = require("./multimap"); Object.keys(_multimap).forEach(function (key) { if (key === "default" || key === "__esModule") return; @@ -321,26 +365,4 @@ Object.keys(_zones).forEach(function (key) { return _zones[key]; } }); -}); -var _locatorGenerators = require("./isomorphic/locatorGenerators"); -Object.keys(_locatorGenerators).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _locatorGenerators[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _locatorGenerators[key]; - } - }); -}); -var _stringUtils = require("./isomorphic/stringUtils"); -Object.keys(_stringUtils).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (key in exports && exports[key] === _stringUtils[key]) return; - Object.defineProperty(exports, key, { - enumerable: true, - get: function () { - return _stringUtils[key]; - } - }); }); \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js new file mode 100644 index 00000000..3c8db395 --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js @@ -0,0 +1,267 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AriaKeyError = void 0; +exports.parseAriaKey = parseAriaKey; +exports.parseYamlTemplate = parseYamlTemplate; +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// https://www.w3.org/TR/wai-aria-1.2/#role_definitions + +function parseYamlTemplate(fragment) { + const result = { + kind: 'role', + role: 'fragment' + }; + populateNode(result, fragment); + if (result.children && result.children.length === 1) return result.children[0]; + return result; +} +function populateNode(node, container) { + for (const object of container) { + if (typeof object === 'string') { + const childNode = KeyParser.parse(object); + node.children = node.children || []; + node.children.push(childNode); + continue; + } + for (const key of Object.keys(object)) { + node.children = node.children || []; + const value = object[key]; + if (key === 'text') { + node.children.push({ + kind: 'text', + text: valueOrRegex(value) + }); + continue; + } + const childNode = KeyParser.parse(key); + if (childNode.kind === 'text') { + node.children.push({ + kind: 'text', + text: valueOrRegex(value) + }); + continue; + } + if (typeof value === 'string') { + node.children.push({ + ...childNode, + children: [{ + kind: 'text', + text: valueOrRegex(value) + }] + }); + continue; + } + node.children.push(childNode); + populateNode(childNode, value); + } + } +} +function normalizeWhitespace(text) { + return text.replace(/[\r\n\s\t]+/g, ' ').trim(); +} +function valueOrRegex(value) { + return value.startsWith('/') && value.endsWith('/') ? new RegExp(value.slice(1, -1)) : normalizeWhitespace(value); +} +class KeyParser { + static parse(input) { + return new KeyParser(input)._parse(); + } + constructor(input) { + this._input = void 0; + this._pos = void 0; + this._length = void 0; + this._input = input; + this._pos = 0; + this._length = input.length; + } + _peek() { + return this._input[this._pos] || ''; + } + _next() { + if (this._pos < this._length) return this._input[this._pos++]; + return null; + } + _eof() { + return this._pos >= this._length; + } + _isWhitespace() { + return !this._eof() && /\s/.test(this._peek()); + } + _skipWhitespace() { + while (this._isWhitespace()) this._pos++; + } + _readIdentifier(type) { + if (this._eof()) this._throwError(`Unexpected end of input when expecting ${type}`); + const start = this._pos; + while (!this._eof() && /[a-zA-Z]/.test(this._peek())) this._pos++; + return this._input.slice(start, this._pos); + } + _readString() { + let result = ''; + let escaped = false; + while (!this._eof()) { + const ch = this._next(); + if (escaped) { + result += ch; + escaped = false; + } else if (ch === '\\') { + escaped = true; + } else if (ch === '"') { + return result; + } else { + result += ch; + } + } + this._throwError('Unterminated string'); + } + _throwError(message, pos) { + throw new AriaKeyError(message, this._input, pos || this._pos); + } + _readRegex() { + let result = ''; + let escaped = false; + let insideClass = false; + while (!this._eof()) { + const ch = this._next(); + if (escaped) { + result += ch; + escaped = false; + } else if (ch === '\\') { + escaped = true; + result += ch; + } else if (ch === '/' && !insideClass) { + return result; + } else if (ch === '[') { + insideClass = true; + result += ch; + } else if (ch === ']' && insideClass) { + result += ch; + insideClass = false; + } else { + result += ch; + } + } + this._throwError('Unterminated regex'); + } + _readStringOrRegex() { + const ch = this._peek(); + if (ch === '"') { + this._next(); + return this._readString(); + } + if (ch === '/') { + this._next(); + return new RegExp(this._readRegex()); + } + return null; + } + _readAttributes(result) { + let errorPos = this._pos; + while (true) { + this._skipWhitespace(); + if (this._peek() === '[') { + this._next(); + this._skipWhitespace(); + errorPos = this._pos; + const flagName = this._readIdentifier('attribute'); + this._skipWhitespace(); + let flagValue = ''; + if (this._peek() === '=') { + this._next(); + this._skipWhitespace(); + errorPos = this._pos; + while (this._peek() !== ']' && !this._isWhitespace() && !this._eof()) flagValue += this._next(); + } + this._skipWhitespace(); + if (this._peek() !== ']') this._throwError('Expected ]'); + this._next(); // Consume ']' + this._applyAttribute(result, flagName, flagValue || 'true', errorPos); + } else { + break; + } + } + } + _parse() { + this._skipWhitespace(); + const role = this._readIdentifier('role'); + this._skipWhitespace(); + const name = this._readStringOrRegex() || ''; + const result = { + kind: 'role', + role, + name + }; + this._readAttributes(result); + this._skipWhitespace(); + if (!this._eof()) this._throwError('Unexpected input'); + return result; + } + _applyAttribute(node, key, value, errorPos) { + if (key === 'checked') { + this._assert(value === 'true' || value === 'false' || value === 'mixed', 'Value of "checked\" attribute must be a boolean or "mixed"', errorPos); + node.checked = value === 'true' ? true : value === 'false' ? false : 'mixed'; + return; + } + if (key === 'disabled') { + this._assert(value === 'true' || value === 'false', 'Value of "disabled" attribute must be a boolean', errorPos); + node.disabled = value === 'true'; + return; + } + if (key === 'expanded') { + this._assert(value === 'true' || value === 'false', 'Value of "expanded" attribute must be a boolean', errorPos); + node.expanded = value === 'true'; + return; + } + if (key === 'level') { + this._assert(!isNaN(Number(value)), 'Value of "level" attribute must be a number', errorPos); + node.level = Number(value); + return; + } + if (key === 'pressed') { + this._assert(value === 'true' || value === 'false' || value === 'mixed', 'Value of "pressed" attribute must be a boolean or "mixed"', errorPos); + node.pressed = value === 'true' ? true : value === 'false' ? false : 'mixed'; + return; + } + if (key === 'selected') { + this._assert(value === 'true' || value === 'false', 'Value of "selected" attribute must be a boolean', errorPos); + node.selected = value === 'true'; + return; + } + this._assert(false, `Unsupported attribute [${key}]`, errorPos); + } + _assert(value, message, valuePos) { + if (!value) this._throwError(message || 'Assertion error', valuePos); + } +} +function parseAriaKey(key) { + return KeyParser.parse(key); +} +class AriaKeyError extends Error { + constructor(message, input, pos) { + super(message + ':\n\n' + input + '\n' + ' '.repeat(pos) + '^\n'); + this.shortMessage = void 0; + this.pos = void 0; + this.shortMessage = message; + this.pos = pos; + this.stack = undefined; + } +} +exports.AriaKeyError = AriaKeyError; \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js index 65b4d488..97fe651e 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +++ b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js @@ -387,7 +387,7 @@ function tokenize(str1) { throw new Error('Internal error'); }; const consumeEscape = function () { - // Assume the the current character is the \ + // Assume the current character is the \ // and the next code point is not a newline. consume(); if (hexdigit(code)) { diff --git a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js index 7a797f20..128830e2 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +++ b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js @@ -37,15 +37,6 @@ function asLocators(lang, selector, isFrameLocator = false, maxOutputSize = 20, } function innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize = 20) { const parts = [...parsed.parts]; - // frameLocator('iframe').first is actually "iframe >> nth=0 >> internal:control=enter-frame" - // To make it easier to parse, we turn it into "iframe >> internal:control=enter-frame >> nth=0" - for (let index = 0; index < parts.length - 1; index++) { - if (parts[index].name === 'nth' && parts[index + 1].name === 'internal:control' && parts[index + 1].body === 'enter-frame') { - // Swap nth and enter-frame. - const [nth] = parts.splice(index, 1); - parts.splice(index + 1, 0, nth); - } - } const tokens = []; let nextBase = isFrameLocator ? 'frame-locator' : 'page'; for (let index = 0; index < parts.length; index++) { @@ -183,18 +174,28 @@ function innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize continue; } } - let locatorType = 'default'; - const nextPart = parts[index + 1]; - if (nextPart && nextPart.name === 'internal:control' && nextPart.body === 'enter-frame') { - locatorType = 'frame'; + if (part.name === 'internal:control' && part.body === 'enter-frame') { + // transform last tokens from `${selector}` into `${selector}.contentFrame()` and `frameLocator(${selector})` + const lastTokens = tokens[tokens.length - 1]; + const lastPart = parts[index - 1]; + const transformed = lastTokens.map(token => factory.chainLocators([token, factory.generateLocator(base, 'frame', '')])); + if (['xpath', 'css'].includes(lastPart.name)) { + transformed.push(factory.generateLocator(base, 'frame-locator', (0, _selectorParser.stringifySelector)({ + parts: [lastPart] + })), factory.generateLocator(base, 'frame-locator', (0, _selectorParser.stringifySelector)({ + parts: [lastPart] + }, true))); + } + lastTokens.splice(0, lastTokens.length, ...transformed); nextBase = 'frame-locator'; - index++; + continue; } + const nextPart = parts[index + 1]; const selectorPart = (0, _selectorParser.stringifySelector)({ parts: [part] }); - const locatorPart = factory.generateLocator(base, locatorType, selectorPart); - if (locatorType === 'default' && nextPart && ['internal:has-text', 'internal:has-not-text'].includes(nextPart.name)) { + const locatorPart = factory.generateLocator(base, 'default', selectorPart); + if (nextPart && ['internal:has-text', 'internal:has-not-text'].includes(nextPart.name)) { const { exact, text @@ -222,7 +223,7 @@ function innerAsLocators(factory, parsed, isFrameLocator = false, maxOutputSize const selectorPart = (0, _selectorParser.stringifySelector)({ parts: [part] }, /* forceEngineName */true); - locatorPartWithEngine = factory.generateLocator(base, locatorType, selectorPart); + locatorPartWithEngine = factory.generateLocator(base, 'default', selectorPart); } tokens.push([locatorPart, locatorPartWithEngine].filter(Boolean)); } @@ -276,8 +277,10 @@ class JavaScriptLocatorFactory { if (options.hasText !== undefined) return `locator(${this.quote(body)}, { hasText: ${this.toHasText(options.hasText)} })`; if (options.hasNotText !== undefined) return `locator(${this.quote(body)}, { hasNotText: ${this.toHasText(options.hasNotText)} })`; return `locator(${this.quote(body)})`; - case 'frame': + case 'frame-locator': return `frameLocator(${this.quote(body)})`; + case 'frame': + return `contentFrame()`; case 'nth': return `nth(${body})`; case 'first': @@ -359,8 +362,10 @@ class PythonLocatorFactory { if (options.hasText !== undefined) return `locator(${this.quote(body)}, has_text=${this.toHasText(options.hasText)})`; if (options.hasNotText !== undefined) return `locator(${this.quote(body)}, has_not_text=${this.toHasText(options.hasNotText)})`; return `locator(${this.quote(body)})`; - case 'frame': + case 'frame-locator': return `frame_locator(${this.quote(body)})`; + case 'frame': + return `content_frame`; case 'nth': return `nth(${body})`; case 'first': @@ -459,8 +464,10 @@ class JavaLocatorFactory { if (options.hasText !== undefined) return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasText(${this.toHasText(options.hasText)}))`; if (options.hasNotText !== undefined) return `locator(${this.quote(body)}, new ${clazz}.LocatorOptions().setHasNotText(${this.toHasText(options.hasNotText)}))`; return `locator(${this.quote(body)})`; - case 'frame': + case 'frame-locator': return `frameLocator(${this.quote(body)})`; + case 'frame': + return `contentFrame()`; case 'nth': return `nth(${body})`; case 'first': @@ -543,8 +550,10 @@ class CSharpLocatorFactory { if (options.hasText !== undefined) return `Locator(${this.quote(body)}, new() { ${this.toHasText(options.hasText)} })`; if (options.hasNotText !== undefined) return `Locator(${this.quote(body)}, new() { ${this.toHasNotText(options.hasNotText)} })`; return `Locator(${this.quote(body)})`; - case 'frame': + case 'frame-locator': return `FrameLocator(${this.quote(body)})`; + case 'frame': + return `ContentFrame`; case 'nth': return `Nth(${body})`; case 'first': diff --git a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js index c3a72f77..969b2032 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +++ b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js @@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.locatorOrSelectorAsSelector = locatorOrSelectorAsSelector; -var _stringUtils = require("../../utils/isomorphic/stringUtils"); +var _stringUtils = require("./stringUtils"); var _locatorGenerators = require("./locatorGenerators"); var _selectorParser = require("./selectorParser"); /** @@ -63,7 +63,7 @@ function parseLocator(locator, testIdAttributeName) { } // Equalize languages. - template = template.toLowerCase().replace(/get_by_alt_text/g, 'getbyalttext').replace(/get_by_test_id/g, 'getbytestid').replace(/get_by_([\w]+)/g, 'getby$1').replace(/has_not_text/g, 'hasnottext').replace(/has_text/g, 'hastext').replace(/has_not/g, 'hasnot').replace(/frame_locator/g, 'framelocator').replace(/[{}\s]/g, '').replace(/new\(\)/g, '').replace(/new[\w]+\.[\w]+options\(\)/g, '').replace(/\.set/g, ',set').replace(/\.or_\(/g, 'or(') // Python has "or_" instead of "or". + template = template.toLowerCase().replace(/get_by_alt_text/g, 'getbyalttext').replace(/get_by_test_id/g, 'getbytestid').replace(/get_by_([\w]+)/g, 'getby$1').replace(/has_not_text/g, 'hasnottext').replace(/has_text/g, 'hastext').replace(/has_not/g, 'hasnot').replace(/frame_locator/g, 'framelocator').replace(/content_frame/g, 'contentframe').replace(/[{}\s]/g, '').replace(/new\(\)/g, '').replace(/new[\w]+\.[\w]+options\(\)/g, '').replace(/\.set/g, ',set').replace(/\.or_\(/g, 'or(') // Python has "or_" instead of "or". .replace(/\.and_\(/g, 'and(') // Python has "and_" instead of "and". .replace(/:/g, '=').replace(/,re\.ignorecase/g, 'i').replace(/,pattern.case_insensitive/g, 'i').replace(/,regexoptions.ignorecase/g, 'i').replace(/re.compile\(([^)]+)\)/g, '$1') // Python has regex strings as r"foo" .replace(/pattern.compile\(([^)]+)\)/g, 'r$1').replace(/newregex\(([^)]+)\)/g, 'r$1').replace(/string=/g, '=').replace(/regex=/g, '=').replace(/,,/g, ','); @@ -123,7 +123,7 @@ function transform(template, params, testIdAttributeName) { } // Transform to selector engines. - template = template.replace(/\,set([\w]+)\(([^)]+)\)/g, (_, group1, group2) => ',' + group1.toLowerCase() + '=' + group2.toLowerCase()).replace(/framelocator\(([^)]+)\)/g, '$1.internal:control=enter-frame').replace(/locator\(([^)]+),hastext=([^),]+)\)/g, 'locator($1).internal:has-text=$2').replace(/locator\(([^)]+),hasnottext=([^),]+)\)/g, 'locator($1).internal:has-not-text=$2').replace(/locator\(([^)]+),hastext=([^),]+)\)/g, 'locator($1).internal:has-text=$2').replace(/locator\(([^)]+)\)/g, '$1').replace(/getbyrole\(([^)]+)\)/g, 'internal:role=$1').replace(/getbytext\(([^)]+)\)/g, 'internal:text=$1').replace(/getbylabel\(([^)]+)\)/g, 'internal:label=$1').replace(/getbytestid\(([^)]+)\)/g, `internal:testid=[${testIdAttributeName}=$1]`).replace(/getby(placeholder|alt|title)(?:text)?\(([^)]+)\)/g, 'internal:attr=[$1=$2]').replace(/first(\(\))?/g, 'nth=0').replace(/last(\(\))?/g, 'nth=-1').replace(/nth\(([^)]+)\)/g, 'nth=$1').replace(/filter\(,?hastext=([^)]+)\)/g, 'internal:has-text=$1').replace(/filter\(,?hasnottext=([^)]+)\)/g, 'internal:has-not-text=$1').replace(/filter\(,?has2=([^)]+)\)/g, 'internal:has=$1').replace(/filter\(,?hasnot2=([^)]+)\)/g, 'internal:has-not=$1').replace(/,exact=false/g, '').replace(/,exact=true/g, 's').replace(/\,/g, ']['); + template = template.replace(/\,set([\w]+)\(([^)]+)\)/g, (_, group1, group2) => ',' + group1.toLowerCase() + '=' + group2.toLowerCase()).replace(/framelocator\(([^)]+)\)/g, '$1.internal:control=enter-frame').replace(/contentframe(\(\))?/g, 'internal:control=enter-frame').replace(/locator\(([^)]+),hastext=([^),]+)\)/g, 'locator($1).internal:has-text=$2').replace(/locator\(([^)]+),hasnottext=([^),]+)\)/g, 'locator($1).internal:has-not-text=$2').replace(/locator\(([^)]+),hastext=([^),]+)\)/g, 'locator($1).internal:has-text=$2').replace(/locator\(([^)]+)\)/g, '$1').replace(/getbyrole\(([^)]+)\)/g, 'internal:role=$1').replace(/getbytext\(([^)]+)\)/g, 'internal:text=$1').replace(/getbylabel\(([^)]+)\)/g, 'internal:label=$1').replace(/getbytestid\(([^)]+)\)/g, `internal:testid=[${testIdAttributeName}=$1]`).replace(/getby(placeholder|alt|title)(?:text)?\(([^)]+)\)/g, 'internal:attr=[$1=$2]').replace(/first(\(\))?/g, 'nth=0').replace(/last(\(\))?/g, 'nth=-1').replace(/nth\(([^)]+)\)/g, 'nth=$1').replace(/filter\(,?hastext=([^)]+)\)/g, 'internal:has-text=$1').replace(/filter\(,?hasnottext=([^)]+)\)/g, 'internal:has-not-text=$1').replace(/filter\(,?has2=([^)]+)\)/g, 'internal:has=$1').replace(/filter\(,?hasnot2=([^)]+)\)/g, 'internal:has-not=$1').replace(/,exact=false/g, '').replace(/,exact=true/g, 's').replace(/\,/g, ']['); const parts = template.split('.'); // Turn "internal:control=enter-frame >> nth=0" into "nth=0 >> internal:control=enter-frame" // because these are swapped in locators vs selectors. diff --git a/priv/static/node_modules/playwright-core/lib/utils/mimeType.js b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js similarity index 100% rename from priv/static/node_modules/playwright-core/lib/utils/mimeType.js rename to priv/static/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js diff --git a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/recorderUtils.js b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/recorderUtils.js new file mode 100644 index 00000000..d9d0a5c4 --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/recorderUtils.js @@ -0,0 +1,227 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.buildFullSelector = buildFullSelector; +exports.toKeyboardModifiers = toKeyboardModifiers; +exports.traceParamsForAction = traceParamsForAction; +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function buildFullSelector(framePath, selector) { + return [...framePath, selector].join(' >> internal:control=enter-frame >> '); +} +const kDefaultTimeout = 5_000; +function traceParamsForAction(actionInContext) { + const { + action + } = actionInContext; + switch (action.name) { + case 'navigate': + { + const params = { + url: action.url + }; + return { + method: 'goto', + apiName: 'page.goto', + params + }; + } + case 'openPage': + case 'closePage': + throw new Error('Not reached'); + } + const selector = buildFullSelector(actionInContext.frame.framePath, action.selector); + switch (action.name) { + case 'click': + { + const params = { + selector, + strict: true, + modifiers: toKeyboardModifiers(action.modifiers), + button: action.button, + clickCount: action.clickCount, + position: action.position + }; + return { + method: 'click', + apiName: 'locator.click', + params + }; + } + case 'press': + { + const params = { + selector, + strict: true, + key: [...toKeyboardModifiers(action.modifiers), action.key].join('+') + }; + return { + method: 'press', + apiName: 'locator.press', + params + }; + } + case 'fill': + { + const params = { + selector, + strict: true, + value: action.text + }; + return { + method: 'fill', + apiName: 'locator.fill', + params + }; + } + case 'setInputFiles': + { + const params = { + selector, + strict: true, + localPaths: action.files + }; + return { + method: 'setInputFiles', + apiName: 'locator.setInputFiles', + params + }; + } + case 'check': + { + const params = { + selector, + strict: true + }; + return { + method: 'check', + apiName: 'locator.check', + params + }; + } + case 'uncheck': + { + const params = { + selector, + strict: true + }; + return { + method: 'uncheck', + apiName: 'locator.uncheck', + params + }; + } + case 'select': + { + const params = { + selector, + strict: true, + options: action.options.map(option => ({ + value: option + })) + }; + return { + method: 'selectOption', + apiName: 'locator.selectOption', + params + }; + } + case 'assertChecked': + { + const params = { + selector: action.selector, + expression: 'to.be.checked', + isNot: !action.checked, + timeout: kDefaultTimeout + }; + return { + method: 'expect', + apiName: 'expect.toBeChecked', + params + }; + } + case 'assertText': + { + const params = { + selector, + expression: 'to.have.text', + expectedText: [], + isNot: false, + timeout: kDefaultTimeout + }; + return { + method: 'expect', + apiName: 'expect.toContainText', + params + }; + } + case 'assertValue': + { + const params = { + selector, + expression: 'to.have.value', + expectedValue: undefined, + isNot: false, + timeout: kDefaultTimeout + }; + return { + method: 'expect', + apiName: 'expect.toHaveValue', + params + }; + } + case 'assertVisible': + { + const params = { + selector, + expression: 'to.be.visible', + isNot: false, + timeout: kDefaultTimeout + }; + return { + method: 'expect', + apiName: 'expect.toBeVisible', + params + }; + } + case 'assertSnapshot': + { + const params = { + selector, + expression: 'to.match.snapshot', + expectedText: [], + isNot: false, + timeout: kDefaultTimeout + }; + return { + method: 'expect', + apiName: 'expect.toMatchAriaSnapshot', + params + }; + } + } +} +function toKeyboardModifiers(modifiers) { + const result = []; + if (modifiers & 1) result.push('Alt'); + if (modifiers & 2) result.push('ControlOrMeta'); + if (modifiers & 4) result.push('ControlOrMeta'); + if (modifiers & 8) result.push('Shift'); + return result; +} \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js index 8ef433c5..1bc6009b 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +++ b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js @@ -3,12 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true }); +exports.cacheNormalizedWhitespaces = cacheNormalizedWhitespaces; exports.cssEscape = cssEscape; exports.escapeForAttributeSelector = escapeForAttributeSelector; exports.escapeForTextSelector = escapeForTextSelector; +exports.escapeHTML = escapeHTML; +exports.escapeHTMLAttribute = escapeHTMLAttribute; exports.escapeRegExp = escapeRegExp; +exports.escapeTemplateString = escapeTemplateString; exports.escapeWithQuotes = escapeWithQuotes; exports.isString = isString; +exports.longestCommonSubstring = longestCommonSubstring; exports.normalizeEscapedRegexQuotes = normalizeEscapedRegexQuotes; exports.normalizeWhiteSpace = normalizeWhiteSpace; exports.quoteCSSAttributeValue = quoteCSSAttributeValue; @@ -41,6 +46,9 @@ function escapeWithQuotes(text, char = '\'') { if (char === '`') return char + escapedText.replace(/[`]/g, '`') + char; throw new Error('Invalid escape char'); } +function escapeTemplateString(text) { + return text.replace(/\\/g, '\\\\').replace(/`/g, '\\`').replace(/\$\{/g, '\\${'); +} function isString(obj) { return typeof obj === 'string' || obj instanceof String; } @@ -68,8 +76,19 @@ function cssEscapeOne(s, i) { if (c >= 0x0080 || c === 0x002d || c === 0x005f || c >= 0x0030 && c <= 0x0039 || c >= 0x0041 && c <= 0x005a || c >= 0x0061 && c <= 0x007a) return s.charAt(i); return '\\' + s.charAt(i); } +let normalizedWhitespaceCache; +function cacheNormalizedWhitespaces() { + normalizedWhitespaceCache = new Map(); +} function normalizeWhiteSpace(text) { - return text.replace(/\u200b/g, '').trim().replace(/\s+/g, ' '); + var _normalizedWhitespace; + let result = (_normalizedWhitespace = normalizedWhitespaceCache) === null || _normalizedWhitespace === void 0 ? void 0 : _normalizedWhitespace.get(text); + if (result === undefined) { + var _normalizedWhitespace2; + result = text.replace(/\u200b/g, '').trim().replace(/\s+/g, ' '); + (_normalizedWhitespace2 = normalizedWhitespaceCache) === null || _normalizedWhitespace2 === void 0 || _normalizedWhitespace2.set(text, result); + } + return result; } function normalizeEscapedRegexQuotes(source) { // This function reverses the effect of escapeRegexForSelector below. @@ -109,4 +128,42 @@ function trimStringWithEllipsis(input, cap) { function escapeRegExp(s) { // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string +} +const escaped = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''' +}; +function escapeHTMLAttribute(s) { + return s.replace(/[&<>"']/ug, char => escaped[char]); +} +function escapeHTML(s) { + return s.replace(/[&<]/ug, char => escaped[char]); +} +function longestCommonSubstring(s1, s2) { + const n = s1.length; + const m = s2.length; + let maxLen = 0; + let endingIndex = 0; + + // Initialize a 2D array with zeros + const dp = Array(n + 1).fill(null).map(() => Array(m + 1).fill(0)); + + // Build the dp table + for (let i = 1; i <= n; i++) { + for (let j = 1; j <= m; j++) { + if (s1[i - 1] === s2[j - 1]) { + dp[i][j] = dp[i - 1][j - 1] + 1; + if (dp[i][j] > maxLen) { + maxLen = dp[i][j]; + endingIndex = i; + } + } + } + } + + // Extract the longest common substring + return s1.slice(endingIndex - maxLen, endingIndex); } \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/glob.js b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js similarity index 59% rename from priv/static/node_modules/playwright-core/lib/utils/glob.js rename to priv/static/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js index 331209cd..e1db1ca5 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/glob.js +++ b/priv/static/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js @@ -3,7 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); +exports.constructURLBasedOnBaseURL = constructURLBasedOnBaseURL; exports.globToRegex = globToRegex; +exports.urlMatches = urlMatches; +exports.urlMatchesEqual = urlMatchesEqual; +var _stringUtils = require("./stringUtils"); /** * Copyright (c) Microsoft Corporation. * @@ -80,4 +84,41 @@ function globToRegex(glob) { } tokens.push('$'); return new RegExp(tokens.join('')); +} +function isRegExp(obj) { + return obj instanceof RegExp || Object.prototype.toString.call(obj) === '[object RegExp]'; +} +function urlMatchesEqual(match1, match2) { + if (isRegExp(match1) && isRegExp(match2)) return match1.source === match2.source && match1.flags === match2.flags; + return match1 === match2; +} +function urlMatches(baseURL, urlString, match) { + if (match === undefined || match === '') return true; + if ((0, _stringUtils.isString)(match) && !match.startsWith('*')) { + // Allow http(s) baseURL to match ws(s) urls. + if (baseURL && /^https?:\/\//.test(baseURL) && /^wss?:\/\//.test(urlString)) baseURL = baseURL.replace(/^http/, 'ws'); + match = constructURLBasedOnBaseURL(baseURL, match); + } + if ((0, _stringUtils.isString)(match)) match = globToRegex(match); + if (isRegExp(match)) return match.test(urlString); + if (typeof match === 'string' && match === urlString) return true; + const url = parsedURL(urlString); + if (!url) return false; + if (typeof match === 'string') return url.pathname === match; + if (typeof match !== 'function') throw new Error('url parameter should be string, RegExp or function'); + return match(url); +} +function parsedURL(url) { + try { + return new URL(url); + } catch (e) { + return null; + } +} +function constructURLBasedOnBaseURL(baseURL, givenURL) { + try { + return new URL(givenURL, baseURL).toString(); + } catch (e) { + return givenURL; + } } \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/network.js b/priv/static/node_modules/playwright-core/lib/utils/network.js index f6762ae3..0e1fb22a 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/network.js +++ b/priv/static/node_modules/playwright-core/lib/utils/network.js @@ -4,20 +4,17 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.NET_DEFAULT_TIMEOUT = void 0; -exports.constructURLBasedOnBaseURL = constructURLBasedOnBaseURL; +exports.createHttp2Server = createHttp2Server; exports.createHttpServer = createHttpServer; exports.createHttpsServer = createHttpsServer; exports.fetchData = fetchData; exports.httpRequest = httpRequest; exports.isURLAvailable = isURLAvailable; -exports.urlMatches = urlMatches; -exports.urlMatchesEqual = urlMatchesEqual; var _http = _interopRequireDefault(require("http")); var _https = _interopRequireDefault(require("https")); +var _http2 = _interopRequireDefault(require("http2")); var _utilsBundle = require("../utilsBundle"); var _url = _interopRequireDefault(require("url")); -var _rtti = require("./rtti"); -var _glob = require("./glob"); var _happyEyeballs = require("./happy-eyeballs"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** @@ -50,7 +47,7 @@ function httpRequest(params, onResponse, onError) { const timeout = (_params$timeout = params.timeout) !== null && _params$timeout !== void 0 ? _params$timeout : NET_DEFAULT_TIMEOUT; const proxyURL = (0, _utilsBundle.getProxyForUrl)(params.url); if (proxyURL) { - const parsedProxyURL = _url.default.parse(proxyURL); + const parsedProxyURL = new URL(proxyURL); if (params.url.startsWith('http:')) { options = { path: parsedUrl.href, @@ -102,36 +99,6 @@ function fetchData(params, onError) { }, reject); }); } -function urlMatchesEqual(match1, match2) { - if ((0, _rtti.isRegExp)(match1) && (0, _rtti.isRegExp)(match2)) return match1.source === match2.source && match1.flags === match2.flags; - return match1 === match2; -} -function urlMatches(baseURL, urlString, match) { - if (match === undefined || match === '') return true; - if ((0, _rtti.isString)(match) && !match.startsWith('*')) match = constructURLBasedOnBaseURL(baseURL, match); - if ((0, _rtti.isString)(match)) match = (0, _glob.globToRegex)(match); - if ((0, _rtti.isRegExp)(match)) return match.test(urlString); - if (typeof match === 'string' && match === urlString) return true; - const url = parsedURL(urlString); - if (!url) return false; - if (typeof match === 'string') return url.pathname === match; - if (typeof match !== 'function') throw new Error('url parameter should be string, RegExp or function'); - return match(url); -} -function parsedURL(url) { - try { - return new URL(url); - } catch (e) { - return null; - } -} -function constructURLBasedOnBaseURL(baseURL, givenURL) { - try { - return new URL(givenURL, baseURL).toString(); - } catch (e) { - return givenURL; - } -} function createHttpServer(...args) { const server = _http.default.createServer(...args); decorateServer(server); @@ -142,6 +109,11 @@ function createHttpsServer(...args) { decorateServer(server); return server; } +function createHttp2Server(...args) { + const server = _http2.default.createSecureServer(...args); + decorateServer(server); + return server; +} async function isURLAvailable(url, ignoreHTTPSErrors, onLog, onStdErr) { let statusCode = await httpStatusCode(url, ignoreHTTPSErrors, onLog, onStdErr); if (statusCode === 404 && url.pathname === '/') { diff --git a/priv/static/node_modules/playwright-core/lib/utils/sequence.js b/priv/static/node_modules/playwright-core/lib/utils/sequence.js new file mode 100644 index 00000000..c4891d5a --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/utils/sequence.js @@ -0,0 +1,64 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.findRepeatedSubsequences = findRepeatedSubsequences; +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function findRepeatedSubsequences(s) { + const n = s.length; + const result = []; + let i = 0; + const arraysEqual = (a1, a2) => { + if (a1.length !== a2.length) return false; + for (let j = 0; j < a1.length; j++) { + if (a1[j] !== a2[j]) return false; + } + return true; + }; + while (i < n) { + let maxRepeatCount = 1; + let maxRepeatSubstr = [s[i]]; // Initialize with the element at index i + let maxRepeatLength = 1; + + // Try substrings of length from 1 to the remaining length of the array + for (let p = 1; p <= n - i; p++) { + const substr = s.slice(i, i + p); // Extract substring as array + let k = 1; + + // Count how many times the substring repeats consecutively + while (i + p * k <= n && arraysEqual(s.slice(i + p * (k - 1), i + p * k), substr)) k += 1; + k -= 1; // Adjust k since it increments one extra time in the loop + + // Update the maximal repeating substring if necessary + if (k > 1 && k * p > maxRepeatCount * maxRepeatLength) { + maxRepeatCount = k; + maxRepeatSubstr = substr; + maxRepeatLength = p; + } + } + + // Record the substring and its count + result.push({ + sequence: maxRepeatSubstr, + count: maxRepeatCount + }); + i += maxRepeatLength * maxRepeatCount; // Move index forward + } + return result; +} \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/stackTrace.js b/priv/static/node_modules/playwright-core/lib/utils/stackTrace.js index 3f2077da..b183d6a5 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/stackTrace.js +++ b/priv/static/node_modules/playwright-core/lib/utils/stackTrace.js @@ -7,13 +7,14 @@ exports.addInternalStackPrefix = void 0; exports.captureLibraryStackText = captureLibraryStackText; exports.captureLibraryStackTrace = captureLibraryStackTrace; exports.captureRawStack = captureRawStack; +exports.compressCallLog = compressCallLog; exports.formatCallLog = formatCallLog; exports.rewriteErrorMessage = rewriteErrorMessage; exports.splitErrorMessage = splitErrorMessage; exports.stringifyStackFrames = stringifyStackFrames; var _path = _interopRequireDefault(require("path")); var _utilsBundle = require("../utilsBundle"); -var _ = require("./"); +var _sequence = require("./sequence"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Copyright (c) Microsoft Corporation. @@ -53,7 +54,6 @@ function captureRawStack() { } function captureLibraryStackTrace() { const stack = captureRawStack(); - const isTesting = (0, _.isUnderTest)(); let parsedFrames = stack.map(line => { const frame = (0, _utilsBundle.parseStackTraceLine)(line); if (!frame || !frame.file) return null; @@ -116,6 +116,19 @@ function formatCallLog(log) { if (!log || !log.some(l => !!l)) return ''; return ` Call log: - ${_utilsBundle.colors.dim('- ' + (log || []).join('\n - '))} +${_utilsBundle.colors.dim(log.join('\n'))} `; +} +function compressCallLog(log) { + const lines = []; + for (const block of (0, _sequence.findRepeatedSubsequences)(log)) { + for (let i = 0; i < block.sequence.length; i++) { + const line = block.sequence[i]; + const leadingWhitespace = line.match(/^\s*/); + const whitespacePrefix = ' ' + (leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace[0]) || ''; + const countPrefix = `${block.count} × `; + if (block.count > 1 && i === 0) lines.push(whitespacePrefix + countPrefix + line.trim());else if (block.count > 1) lines.push(whitespacePrefix + ' '.repeat(countPrefix.length - 2) + '- ' + line.trim());else lines.push(whitespacePrefix + '- ' + line.trim()); + } + } + return lines; } \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utils/zones.js b/priv/static/node_modules/playwright-core/lib/utils/zones.js index 87bdf90c..e57e52ec 100644 --- a/priv/static/node_modules/playwright-core/lib/utils/zones.js +++ b/priv/static/node_modules/playwright-core/lib/utils/zones.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.zones = void 0; +exports.zones = exports.Zone = void 0; var _async_hooks = require("async_hooks"); /** * Copyright (c) Microsoft Corporation. @@ -26,37 +26,46 @@ class ZoneManager { this._asyncLocalStorage = new _async_hooks.AsyncLocalStorage(); } run(type, data, func) { - const previous = this._asyncLocalStorage.getStore(); - const zone = new Zone(previous, type, data); + const zone = Zone._createWithData(this._asyncLocalStorage, type, data); return this._asyncLocalStorage.run(zone, func); } zoneData(type) { - for (let zone = this._asyncLocalStorage.getStore(); zone; zone = zone.previous) { - if (zone.type === type) return zone.data; - } - return undefined; + const zone = this._asyncLocalStorage.getStore(); + return zone === null || zone === void 0 ? void 0 : zone.get(type); + } + currentZone() { + var _this$_asyncLocalStor; + return (_this$_asyncLocalStor = this._asyncLocalStorage.getStore()) !== null && _this$_asyncLocalStor !== void 0 ? _this$_asyncLocalStor : Zone._createEmpty(this._asyncLocalStorage); } exitZones(func) { return this._asyncLocalStorage.run(undefined, func); } - printZones() { - const zones = []; - for (let zone = this._asyncLocalStorage.getStore(); zone; zone = zone.previous) { - let str = zone.type; - if (zone.type === 'apiZone') str += `(${zone.data.apiName})`; - zones.push(str); - } - console.log('zones: ', zones.join(' -> ')); - } } class Zone { - constructor(previous, type, data) { - this.type = void 0; - this.data = void 0; - this.previous = void 0; - this.type = type; - this.data = data; - this.previous = previous; + static _createWithData(asyncLocalStorage, type, data) { + var _asyncLocalStorage$ge; + const store = new Map((_asyncLocalStorage$ge = asyncLocalStorage.getStore()) === null || _asyncLocalStorage$ge === void 0 ? void 0 : _asyncLocalStorage$ge._data); + store.set(type, data); + return new Zone(asyncLocalStorage, store); + } + static _createEmpty(asyncLocalStorage) { + return new Zone(asyncLocalStorage, new Map()); + } + constructor(asyncLocalStorage, store) { + this._asyncLocalStorage = void 0; + this._data = void 0; + this._asyncLocalStorage = asyncLocalStorage; + this._data = store; + } + run(func) { + // Reset apiZone and expectZone, but restore stepZone. + const entries = [...this._data.entries()].filter(([type]) => type !== 'apiZone' && type !== 'expectZone'); + const resetZone = new Zone(this._asyncLocalStorage, new Map(entries)); + return this._asyncLocalStorage.run(resetZone, func); + } + get(type) { + return this._data.get(type); } } +exports.Zone = Zone; const zones = exports.zones = new ZoneManager(); \ No newline at end of file diff --git a/priv/static/node_modules/playwright-core/lib/utilsBundle.js b/priv/static/node_modules/playwright-core/lib/utilsBundle.js index 5a28601f..9d4258e5 100644 --- a/priv/static/node_modules/playwright-core/lib/utilsBundle.js +++ b/priv/static/node_modules/playwright-core/lib/utilsBundle.js @@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.minimatch = exports.mime = exports.lockfile = exports.jpegjs = exports.getProxyForUrl = exports.debug = exports.colors = exports.SocksProxyAgent = exports.PNG = exports.HttpsProxyAgent = void 0; +exports.minimatch = exports.mime = exports.lockfile = exports.jpegjs = exports.getProxyForUrl = exports.dotenv = exports.diff = exports.debug = exports.colors = exports.SocksProxyAgent = exports.PNG = exports.HttpsProxyAgent = void 0; exports.ms = ms; exports.open = void 0; exports.parseStackTraceLine = parseStackTraceLine; -exports.wsServer = exports.wsSender = exports.wsReceiver = exports.ws = exports.progress = exports.program = void 0; +exports.yaml = exports.wsServer = exports.wsSender = exports.wsReceiver = exports.ws = exports.progress = exports.program = void 0; var _url = _interopRequireDefault(require("url")); var _path = _interopRequireDefault(require("path")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -29,6 +29,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const colors = exports.colors = require('./utilsBundleImpl').colors; const debug = exports.debug = require('./utilsBundleImpl').debug; +const diff = exports.diff = require('./utilsBundleImpl').diff; +const dotenv = exports.dotenv = require('./utilsBundleImpl').dotenv; const getProxyForUrl = exports.getProxyForUrl = require('./utilsBundleImpl').getProxyForUrl; const HttpsProxyAgent = exports.HttpsProxyAgent = require('./utilsBundleImpl').HttpsProxyAgent; const jpegjs = exports.jpegjs = require('./utilsBundleImpl').jpegjs; @@ -40,6 +42,7 @@ const PNG = exports.PNG = require('./utilsBundleImpl').PNG; const program = exports.program = require('./utilsBundleImpl').program; const progress = exports.progress = require('./utilsBundleImpl').progress; const SocksProxyAgent = exports.SocksProxyAgent = require('./utilsBundleImpl').SocksProxyAgent; +const yaml = exports.yaml = require('./utilsBundleImpl').yaml; const ws = exports.ws = require('./utilsBundleImpl').ws; const wsServer = exports.wsServer = require('./utilsBundleImpl').wsServer; const wsReceiver = exports.wsReceiver = require('./utilsBundleImpl').wsReceiver; @@ -48,11 +51,8 @@ const StackUtils = require('./utilsBundleImpl').StackUtils; const stackUtils = new StackUtils({ internals: StackUtils.nodeInternals() }); -const nodeInternals = StackUtils.nodeInternals(); -const nodeMajorVersion = +process.versions.node.split('.')[0]; function parseStackTraceLine(line) { var _frame$file, _frame$file2; - if (!process.env.PWDEBUGIMPL && nodeMajorVersion < 16 && nodeInternals.some(internal => internal.test(line))) return null; const frame = stackUtils.parseLine(line); if (!frame) return null; if (!process.env.PWDEBUGIMPL && ((_frame$file = frame.file) !== null && _frame$file !== void 0 && _frame$file.startsWith('internal') || (_frame$file2 = frame.file) !== null && _frame$file2 !== void 0 && _frame$file2.startsWith('node:'))) return null; diff --git a/priv/static/node_modules/playwright-core/lib/utilsBundleImpl/index.js b/priv/static/node_modules/playwright-core/lib/utilsBundleImpl/index.js index c7687093..16ffee26 100644 --- a/priv/static/node_modules/playwright-core/lib/utilsBundleImpl/index.js +++ b/priv/static/node_modules/playwright-core/lib/utilsBundleImpl/index.js @@ -1,45 +1,204 @@ -"use strict";var cf=Object.create;var Ui=Object.defineProperty;var uf=Object.getOwnPropertyDescriptor;var ff=Object.getOwnPropertyNames;var hf=Object.getPrototypeOf,pf=Object.prototype.hasOwnProperty;var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),df=(t,e)=>{for(var i in e)Ui(t,i,{get:e[i],enumerable:!0})},Fs=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ff(e))!pf.call(t,n)&&n!==i&&Ui(t,n,{get:()=>e[n],enumerable:!(r=uf(e,n))||r.enumerable});return t};var Te=(t,e,i)=>(i=t!=null?cf(hf(t)):{},Fs(e||!t||!t.__esModule?Ui(i,"default",{value:t,enumerable:!0}):i,t)),mf=t=>Fs(Ui({},"__esModule",{value:!0}),t);var Ds=y((X0,Us)=>{var Ms={};Us.exports=Ms;var Ns={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(Ns).forEach(function(t){var e=Ns[t],i=Ms[t]=[];i.open="\x1B["+e[0]+"m",i.close="\x1B["+e[1]+"m"})});var qs=y((J0,js)=>{"use strict";js.exports=function(t,e){e=e||process.argv;var i=e.indexOf("--"),r=/^-{1,2}/.test(t)?"":"--",n=e.indexOf(r+t);return n!==-1&&(i===-1?!0:n{"use strict";var gf=require("os"),Qe=qs(),je=process.env,Mt=void 0;Qe("no-color")||Qe("no-colors")||Qe("color=false")?Mt=!1:(Qe("color")||Qe("colors")||Qe("color=true")||Qe("color=always"))&&(Mt=!0);"FORCE_COLOR"in je&&(Mt=je.FORCE_COLOR.length===0||parseInt(je.FORCE_COLOR,10)!==0);function vf(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function xf(t){if(Mt===!1)return 0;if(Qe("color=16m")||Qe("color=full")||Qe("color=truecolor"))return 3;if(Qe("color=256"))return 2;if(t&&!t.isTTY&&Mt!==!0)return 0;var e=Mt?1:0;if(process.platform==="win32"){var i=gf.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in je)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(n){return n in je})||je.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in je)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(je.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in je){var r=parseInt((je.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(je.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(je.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(je.TERM)||"COLORTERM"in je?1:(je.TERM==="dumb",e)}function br(t){var e=xf(t);return vf(e)}Hs.exports={supportsColor:br,stdout:br(process.stdout),stderr:br(process.stderr)}});var Gs=y((eg,$s)=>{$s.exports=function(e,i){var r="";e=e||"Run the trap, drop the bass",e=e.split("");var n={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(s){s=s.toLowerCase();var o=n[s]||[" "],l=Math.floor(Math.random()*o.length);typeof n[s]!="undefined"?r+=n[s][l]:r+=s}),r}});var Ws=y((tg,zs)=>{zs.exports=function(e,i){e=e||" he is here ";var r={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},n=[].concat(r.up,r.down,r.mid);function s(a){var c=Math.floor(Math.random()*a);return c}function o(a){var c=!1;return n.filter(function(u){c=u===a}),c}function l(a,c){var u="",f,h;c=c||{},c.up=typeof c.up!="undefined"?c.up:!0,c.mid=typeof c.mid!="undefined"?c.mid:!0,c.down=typeof c.down!="undefined"?c.down:!0,c.size=typeof c.size!="undefined"?c.size:"maxi",a=a.split("");for(h in a)if(!o(h)){switch(u=u+a[h],f={up:0,down:0,mid:0},c.size){case"mini":f.up=s(8),f.mid=s(2),f.down=s(8);break;case"maxi":f.up=s(16)+3,f.mid=s(4)+1,f.down=s(64)+3;break;default:f.up=s(8)+1,f.mid=s(6)/2,f.down=s(8)+1;break}var p=["up","mid","down"];for(var d in p)for(var m=p[d],v=0;v<=f[m];v++)c[m]&&(u=u+r[m][s(r[m].length)])}return u}return l(e,i)}});var Ks=y((ig,Ys)=>{Ys.exports=function(t){return function(e,i,r){if(e===" ")return e;switch(i%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var Xs=y((rg,Zs)=>{Zs.exports=function(t){return function(e,i,r){return i%2===0?e:t.inverse(e)}}});var Qs=y((ng,Js)=>{Js.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(i,r,n){return i===" "?i:t[e[r++%e.length]](i)}}});var to=y((sg,eo)=>{eo.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(i,r,n){return i===" "?i:t[e[Math.round(Math.random()*(e.length-2))]](i)}}});var ao=y((ag,oo)=>{var oe={};oo.exports=oe;oe.themes={};var _f=require("util"),bt=oe.styles=Ds(),ro=Object.defineProperties,yf=new RegExp(/[\r\n]+/g);oe.supportsColor=Vs().supportsColor;typeof oe.enabled=="undefined"&&(oe.enabled=oe.supportsColor()!==!1);oe.enable=function(){oe.enabled=!0};oe.disable=function(){oe.enabled=!1};oe.stripColors=oe.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var og=oe.stylize=function(e,i){if(!oe.enabled)return e+"";var r=bt[i];return!r&&i in oe?oe[i](e):r.open+e+r.close},bf=/[|\\{}()[\]^$+*?.]/g,wf=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(bf,"\\$&")};function no(t){var e=function i(){return Sf.apply(i,arguments)};return e._styles=t,e.__proto__=Ef,e}var so=function(){var t={};return bt.grey=bt.gray,Object.keys(bt).forEach(function(e){bt[e].closeRe=new RegExp(wf(bt[e].close),"g"),t[e]={get:function(){return no(this._styles.concat(e))}}}),t}(),Ef=ro(function(){},so);function Sf(){var t=Array.prototype.slice.call(arguments),e=t.map(function(o){return o!=null&&o.constructor===String?o:_f.inspect(o)}).join(" ");if(!oe.enabled||!e)return e;for(var i=e.indexOf(` -`)!=-1,r=this._styles,n=r.length;n--;){var s=bt[r[n]];e=s.open+e.replace(s.closeRe,s.open)+s.close,i&&(e=e.replace(yf,function(o){return s.close+o+s.open}))}return e}oe.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(i){oe[i]=function(r){if(typeof t[i]=="object"){var n=r;for(var s in t[i])n=oe[t[i][s]](n);return n}return oe[t[i]](r)}})(e)};function kf(){var t={};return Object.keys(so).forEach(function(e){t[e]={get:function(){return no([e])}}}),t}var Cf=function(e,i){var r=i.split("");return r=r.map(e),r.join("")};oe.trap=Gs();oe.zalgo=Ws();oe.maps={};oe.maps.america=Ks()(oe);oe.maps.zebra=Xs()(oe);oe.maps.rainbow=Qs()(oe);oe.maps.random=to()(oe);for(io in oe.maps)(function(t){oe[t]=function(e){return Cf(oe.maps[t],e)}})(io);var io;ro(oe,kf())});var co=y((lg,lo)=>{var Of=ao();lo.exports=Of});var fo=y((cg,uo)=>{var Ut=1e3,Dt=Ut*60,jt=Dt*60,wt=jt*24,If=wt*7,Tf=wt*365.25;uo.exports=function(t,e){e=e||{};var i=typeof t;if(i==="string"&&t.length>0)return Af(t);if(i==="number"&&isFinite(t))return e.long?Bf(t):Rf(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Af(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var i=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return i*Tf;case"weeks":case"week":case"w":return i*If;case"days":case"day":case"d":return i*wt;case"hours":case"hour":case"hrs":case"hr":case"h":return i*jt;case"minutes":case"minute":case"mins":case"min":case"m":return i*Dt;case"seconds":case"second":case"secs":case"sec":case"s":return i*Ut;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function Rf(t){var e=Math.abs(t);return e>=wt?Math.round(t/wt)+"d":e>=jt?Math.round(t/jt)+"h":e>=Dt?Math.round(t/Dt)+"m":e>=Ut?Math.round(t/Ut)+"s":t+"ms"}function Bf(t){var e=Math.abs(t);return e>=wt?Di(t,e,wt,"day"):e>=jt?Di(t,e,jt,"hour"):e>=Dt?Di(t,e,Dt,"minute"):e>=Ut?Di(t,e,Ut,"second"):t+" ms"}function Di(t,e,i,r){var n=e>=i*1.5;return Math.round(t/i)+" "+r+(n?"s":"")}});var wr=y((ug,ho)=>{function Lf(t){i.debug=i,i.default=i,i.coerce=a,i.disable=s,i.enable=n,i.enabled=o,i.humanize=fo(),i.destroy=c,Object.keys(t).forEach(u=>{i[u]=t[u]}),i.names=[],i.skips=[],i.formatters={};function e(u){let f=0;for(let h=0;h{if($==="%%")return"%";C++;let U=i.formatters[k];if(typeof U=="function"){let b=v[C];$=U.call(E,b),v.splice(C,1),C--}return $}),i.formatArgs.call(E,v),(E.log||i.log).apply(E,v)}return m.namespace=u,m.useColors=i.useColors(),m.color=i.selectColor(u),m.extend=r,m.destroy=i.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==i.namespaces&&(p=i.namespaces,d=i.enabled(u)),d),set:v=>{h=v}}),typeof i.init=="function"&&i.init(m),m}function r(u,f){let h=i(this.namespace+(typeof f=="undefined"?":":f)+u);return h.log=this.log,h}function n(u){i.save(u),i.namespaces=u,i.names=[],i.skips=[];let f,h=(typeof u=="string"?u:"").split(/[\s,]+/),p=h.length;for(f=0;f"-"+f)].join(",");return i.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let f,h;for(f=0,h=i.skips.length;f{$e.formatArgs=Ff;$e.save=Nf;$e.load=Mf;$e.useColors=Pf;$e.storage=Uf();$e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();$e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Pf(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Ff(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+ji.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let i=0,r=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(i++,n==="%c"&&(r=i))}),t.splice(r,0,e)}$e.log=console.debug||console.log||(()=>{});function Nf(t){try{t?$e.storage.setItem("debug",t):$e.storage.removeItem("debug")}catch{}}function Mf(){let t;try{t=$e.storage.getItem("debug")}catch{}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function Uf(){try{return localStorage}catch{}}ji.exports=wr()($e);var{formatters:Df}=ji.exports;Df.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var go=y((fg,mo)=>{"use strict";mo.exports=(t,e)=>{e=e||process.argv;let i=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(i+t),n=e.indexOf("--");return r!==-1&&(n===-1?!0:r{"use strict";var jf=require("os"),et=go(),Me=process.env,qt;et("no-color")||et("no-colors")||et("color=false")?qt=!1:(et("color")||et("colors")||et("color=true")||et("color=always"))&&(qt=!0);"FORCE_COLOR"in Me&&(qt=Me.FORCE_COLOR.length===0||parseInt(Me.FORCE_COLOR,10)!==0);function qf(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Hf(t){if(qt===!1)return 0;if(et("color=16m")||et("color=full")||et("color=truecolor"))return 3;if(et("color=256"))return 2;if(t&&!t.isTTY&&qt!==!0)return 0;let e=qt?1:0;if(process.platform==="win32"){let i=jf.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in Me)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(i=>i in Me)||Me.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Me)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Me.TEAMCITY_VERSION)?1:0;if(Me.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Me){let i=parseInt((Me.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Me.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Me.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Me.TERM)||"COLORTERM"in Me?1:(Me.TERM==="dumb",e)}function Er(t){let e=Hf(t);return qf(e)}vo.exports={supportsColor:Er,stdout:Er(process.stdout),stderr:Er(process.stderr)}});var yo=y((Pe,Hi)=>{var Vf=require("tty"),qi=require("util");Pe.init=Zf;Pe.log=Wf;Pe.formatArgs=Gf;Pe.save=Yf;Pe.load=Kf;Pe.useColors=$f;Pe.destroy=qi.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Pe.colors=[6,2,3,4,5,1];try{let t=xo();t&&(t.stderr||t).level>=2&&(Pe.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Pe.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let i=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[i]=r,t},{});function $f(){return"colors"in Pe.inspectOpts?!!Pe.inspectOpts.colors:Vf.isatty(process.stderr.fd)}function Gf(t){let{namespace:e,useColors:i}=this;if(i){let r=this.color,n="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${n};1m${e} \x1B[0m`;t[0]=s+t[0].split(` +"use strict";var Fb=Object.create;var ms=Object.defineProperty;var Db=Object.getOwnPropertyDescriptor;var jb=Object.getOwnPropertyNames;var Ub=Object.getPrototypeOf,$b=Object.prototype.hasOwnProperty;var w=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gf=(t,e)=>{for(var i in e)ms(t,i,{get:e[i],enumerable:!0})},vf=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of jb(e))!$b.call(t,n)&&n!==i&&ms(t,n,{get:()=>e[n],enumerable:!(r=Db(e,n))||r.enumerable});return t};var De=(t,e,i)=>(i=t!=null?Fb(Ub(t)):{},vf(e||!t||!t.__esModule?ms(i,"default",{value:t,enumerable:!0}):i,t)),Vb=t=>vf(ms({},"__esModule",{value:!0}),t);var wf=w((kI,_f)=>{var bf={};_f.exports=bf;var yf={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(yf).forEach(function(t){var e=yf[t],i=bf[t]=[];i.open="\x1B["+e[0]+"m",i.close="\x1B["+e[1]+"m"})});var Sf=w((OI,xf)=>{"use strict";xf.exports=function(t,e){e=e||process.argv;var i=e.indexOf("--"),r=/^-{1,2}/.test(t)?"":"--",n=e.indexOf(r+t);return n!==-1&&(i===-1?!0:n{"use strict";var Hb=require("os"),Dt=Sf(),ot=process.env,vr=void 0;Dt("no-color")||Dt("no-colors")||Dt("color=false")?vr=!1:(Dt("color")||Dt("colors")||Dt("color=true")||Dt("color=always"))&&(vr=!0);"FORCE_COLOR"in ot&&(vr=ot.FORCE_COLOR.length===0||parseInt(ot.FORCE_COLOR,10)!==0);function Gb(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Yb(t){if(vr===!1)return 0;if(Dt("color=16m")||Dt("color=full")||Dt("color=truecolor"))return 3;if(Dt("color=256"))return 2;if(t&&!t.isTTY&&vr!==!0)return 0;var e=vr?1:0;if(process.platform==="win32"){var i=Hb.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in ot)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(n){return n in ot})||ot.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in ot)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ot.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in ot){var r=parseInt((ot.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ot.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ot.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(ot.TERM)||"COLORTERM"in ot?1:(ot.TERM==="dumb",e)}function Sa(t){var e=Yb(t);return Gb(e)}Ef.exports={supportsColor:Sa,stdout:Sa(process.stdout),stderr:Sa(process.stderr)}});var Cf=w((TI,Of)=>{Of.exports=function(e,i){var r="";e=e||"Run the trap, drop the bass",e=e.split("");var n={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(s){s=s.toLowerCase();var o=n[s]||[" "],a=Math.floor(Math.random()*o.length);typeof n[s]!="undefined"?r+=n[s][a]:r+=s}),r}});var Af=w((AI,Tf)=>{Tf.exports=function(e,i){e=e||" he is here ";var r={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},n=[].concat(r.up,r.down,r.mid);function s(l){var c=Math.floor(Math.random()*l);return c}function o(l){var c=!1;return n.filter(function(u){c=u===l}),c}function a(l,c){var u="",f,d;c=c||{},c.up=typeof c.up!="undefined"?c.up:!0,c.mid=typeof c.mid!="undefined"?c.mid:!0,c.down=typeof c.down!="undefined"?c.down:!0,c.size=typeof c.size!="undefined"?c.size:"maxi",l=l.split("");for(d in l)if(!o(d)){switch(u=u+l[d],f={up:0,down:0,mid:0},c.size){case"mini":f.up=s(8),f.mid=s(2),f.down=s(8);break;case"maxi":f.up=s(16)+3,f.mid=s(4)+1,f.down=s(64)+3;break;default:f.up=s(8)+1,f.mid=s(6)/2,f.down=s(8)+1;break}var g=["up","mid","down"];for(var m in g)for(var v=g[m],b=0;b<=f[v];b++)c[v]&&(u=u+r[v][s(r[v].length)])}return u}return a(e,i)}});var Nf=w((II,If)=>{If.exports=function(t){return function(e,i,r){if(e===" ")return e;switch(i%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var Bf=w((NI,Lf)=>{Lf.exports=function(t){return function(e,i,r){return i%2===0?e:t.inverse(e)}}});var Pf=w((LI,Rf)=>{Rf.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(i,r,n){return i===" "?i:t[e[r++%e.length]](i)}}});var qf=w((BI,Mf)=>{Mf.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(i,r,n){return i===" "?i:t[e[Math.round(Math.random()*(e.length-2))]](i)}}});var Vf=w((PI,$f)=>{var ye={};$f.exports=ye;ye.themes={};var Wb=require("util"),Hi=ye.styles=wf(),Df=Object.defineProperties,zb=new RegExp(/[\r\n]+/g);ye.supportsColor=kf().supportsColor;typeof ye.enabled=="undefined"&&(ye.enabled=ye.supportsColor()!==!1);ye.enable=function(){ye.enabled=!0};ye.disable=function(){ye.enabled=!1};ye.stripColors=ye.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var RI=ye.stylize=function(e,i){if(!ye.enabled)return e+"";var r=Hi[i];return!r&&i in ye?ye[i](e):r.open+e+r.close},Kb=/[|\\{}()[\]^$+*?.]/g,Jb=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(Kb,"\\$&")};function jf(t){var e=function i(){return Qb.apply(i,arguments)};return e._styles=t,e.__proto__=Zb,e}var Uf=function(){var t={};return Hi.grey=Hi.gray,Object.keys(Hi).forEach(function(e){Hi[e].closeRe=new RegExp(Jb(Hi[e].close),"g"),t[e]={get:function(){return jf(this._styles.concat(e))}}}),t}(),Zb=Df(function(){},Uf);function Qb(){var t=Array.prototype.slice.call(arguments),e=t.map(function(o){return o!=null&&o.constructor===String?o:Wb.inspect(o)}).join(" ");if(!ye.enabled||!e)return e;for(var i=e.indexOf(` +`)!=-1,r=this._styles,n=r.length;n--;){var s=Hi[r[n]];e=s.open+e.replace(s.closeRe,s.open)+s.close,i&&(e=e.replace(zb,function(o){return s.close+o+s.open}))}return e}ye.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(i){ye[i]=function(r){if(typeof t[i]=="object"){var n=r;for(var s in t[i])n=ye[t[i][s]](n);return n}return ye[t[i]](r)}})(e)};function Xb(){var t={};return Object.keys(Uf).forEach(function(e){t[e]={get:function(){return jf([e])}}}),t}var e_=function(e,i){var r=i.split("");return r=r.map(e),r.join("")};ye.trap=Cf();ye.zalgo=Af();ye.maps={};ye.maps.america=Nf()(ye);ye.maps.zebra=Bf()(ye);ye.maps.rainbow=Pf()(ye);ye.maps.random=qf()(ye);for(Ff in ye.maps)(function(t){ye[t]=function(e){return e_(ye.maps[t],e)}})(Ff);var Ff;Df(ye,Xb())});var Gf=w((MI,Hf)=>{var t_=Vf();Hf.exports=t_});var Wf=w((qI,Yf)=>{var yr=1e3,br=yr*60,_r=br*60,Gi=_r*24,i_=Gi*7,r_=Gi*365.25;Yf.exports=function(t,e){e=e||{};var i=typeof t;if(i==="string"&&t.length>0)return n_(t);if(i==="number"&&isFinite(t))return e.long?o_(t):s_(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function n_(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var i=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return i*r_;case"weeks":case"week":case"w":return i*i_;case"days":case"day":case"d":return i*Gi;case"hours":case"hour":case"hrs":case"hr":case"h":return i*_r;case"minutes":case"minute":case"mins":case"min":case"m":return i*br;case"seconds":case"second":case"secs":case"sec":case"s":return i*yr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function s_(t){var e=Math.abs(t);return e>=Gi?Math.round(t/Gi)+"d":e>=_r?Math.round(t/_r)+"h":e>=br?Math.round(t/br)+"m":e>=yr?Math.round(t/yr)+"s":t+"ms"}function o_(t){var e=Math.abs(t);return e>=Gi?gs(t,e,Gi,"day"):e>=_r?gs(t,e,_r,"hour"):e>=br?gs(t,e,br,"minute"):e>=yr?gs(t,e,yr,"second"):t+" ms"}function gs(t,e,i,r){var n=e>=i*1.5;return Math.round(t/i)+" "+r+(n?"s":"")}});var Ea=w((FI,zf)=>{function a_(t){i.debug=i,i.default=i,i.coerce=l,i.disable=s,i.enable=n,i.enabled=o,i.humanize=Wf(),i.destroy=c,Object.keys(t).forEach(u=>{i[u]=t[u]}),i.names=[],i.skips=[],i.formatters={};function e(u){let f=0;for(let d=0;d{if(R==="%%")return"%";k++;let A=i.formatters[T];if(typeof A=="function"){let C=b[k];R=A.call(_,C),b.splice(k,1),k--}return R}),i.formatArgs.call(_,b),(_.log||i.log).apply(_,b)}return v.namespace=u,v.useColors=i.useColors(),v.color=i.selectColor(u),v.extend=r,v.destroy=i.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==i.namespaces&&(g=i.namespaces,m=i.enabled(u)),m),set:b=>{d=b}}),typeof i.init=="function"&&i.init(v),v}function r(u,f){let d=i(this.namespace+(typeof f=="undefined"?":":f)+u);return d.log=this.log,d}function n(u){i.save(u),i.namespaces=u,i.names=[],i.skips=[];let f,d=(typeof u=="string"?u:"").split(/[\s,]+/),g=d.length;for(f=0;f"-"+f)].join(",");return i.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let f,d;for(f=0,d=i.skips.length;f{wt.formatArgs=c_;wt.save=u_;wt.load=f_;wt.useColors=l_;wt.storage=h_();wt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();wt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function l_(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function c_(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+vs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let i=0,r=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(i++,n==="%c"&&(r=i))}),t.splice(r,0,e)}wt.log=console.debug||console.log||(()=>{});function u_(t){try{t?wt.storage.setItem("debug",t):wt.storage.removeItem("debug")}catch{}}function f_(){let t;try{t=wt.storage.getItem("debug")}catch{}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function h_(){try{return localStorage}catch{}}vs.exports=Ea()(wt);var{formatters:p_}=vs.exports;p_.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Zf=w((DI,Jf)=>{"use strict";Jf.exports=(t,e)=>{e=e||process.argv;let i=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(i+t),n=e.indexOf("--");return r!==-1&&(n===-1?!0:r{"use strict";var d_=require("os"),jt=Zf(),tt=process.env,wr;jt("no-color")||jt("no-colors")||jt("color=false")?wr=!1:(jt("color")||jt("colors")||jt("color=true")||jt("color=always"))&&(wr=!0);"FORCE_COLOR"in tt&&(wr=tt.FORCE_COLOR.length===0||parseInt(tt.FORCE_COLOR,10)!==0);function m_(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function g_(t){if(wr===!1)return 0;if(jt("color=16m")||jt("color=full")||jt("color=truecolor"))return 3;if(jt("color=256"))return 2;if(t&&!t.isTTY&&wr!==!0)return 0;let e=wr?1:0;if(process.platform==="win32"){let i=d_.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(i=>i in tt)||tt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(tt.TEAMCITY_VERSION)?1:0;if(tt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in tt){let i=parseInt((tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(tt.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(tt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(tt.TERM)||"COLORTERM"in tt?1:(tt.TERM==="dumb",e)}function ka(t){let e=g_(t);return m_(e)}Qf.exports={supportsColor:ka,stdout:ka(process.stdout),stderr:ka(process.stderr)}});var th=w((Ze,bs)=>{var v_=require("tty"),ys=require("util");Ze.init=E_;Ze.log=w_;Ze.formatArgs=b_;Ze.save=x_;Ze.load=S_;Ze.useColors=y_;Ze.destroy=ys.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Ze.colors=[6,2,3,4,5,1];try{let t=Xf();t&&(t.stderr||t).level>=2&&(Ze.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Ze.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let i=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[i]=r,t},{});function y_(){return"colors"in Ze.inspectOpts?!!Ze.inspectOpts.colors:v_.isatty(process.stderr.fd)}function b_(t){let{namespace:e,useColors:i}=this;if(i){let r=this.color,n="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${n};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(n+"m+"+Hi.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=zf()+e+" "+t[0]}function zf(){return Pe.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Wf(...t){return process.stderr.write(qi.format(...t)+` -`)}function Yf(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Kf(){return process.env.DEBUG}function Zf(t){t.inspectOpts={};let e=Object.keys(Pe.inspectOpts);for(let i=0;ie.trim()).join(" ")};_o.O=function(t){return this.inspectOpts.colors=this.useColors,qi.inspect(t,this.inspectOpts)}});var Ht=y((pg,Sr)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?Sr.exports=po():Sr.exports=yo()});var wo=y(bo=>{"use strict";var Xf=require("url").parse,Jf={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},Qf=String.prototype.endsWith||function(t){return t.length<=this.length&&this.indexOf(t,this.length-t.length)!==-1};function eh(t){var e=typeof t=="string"?Xf(t):t||{},i=e.protocol,r=e.host,n=e.port;if(typeof r!="string"||!r||typeof i!="string"||(i=i.split(":",1)[0],r=r.replace(/:\d*$/,""),n=parseInt(n)||Jf[i]||0,!th(r,n)))return"";var s=Vt("npm_config_"+i+"_proxy")||Vt(i+"_proxy")||Vt("npm_config_proxy")||Vt("all_proxy");return s&&s.indexOf("://")===-1&&(s=i+"://"+s),s}function th(t,e){var i=(Vt("npm_config_no_proxy")||Vt("no_proxy")).toLowerCase();return i?i==="*"?!1:i.split(/[,\s]/).every(function(r){if(!r)return!0;var n=r.match(/^(.+):(\d+)$/),s=n?n[1]:r,o=n?parseInt(n[2]):0;return o&&o!==e?!0:/^[.*]/.test(s)?(s.charAt(0)==="*"&&(s=s.slice(1)),!Qf.call(t,s)):t!==s}):!0}function Vt(t){return process.env[t.toLowerCase()]||process.env[t.toUpperCase()]||""}bo.getProxyForUrl=eh});var Eo=y(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});function ih(t){return function(e,i){return new Promise((r,n)=>{t.call(this,e,i,(s,o)=>{s?n(s):r(o)})})}}kr.default=ih});var Ir=y((Or,ko)=>{"use strict";var So=Or&&Or.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},rh=require("events"),nh=So(Ht()),sh=So(Eo()),gi=nh.default("agent-base");function oh(t){return!!t&&typeof t.addRequest=="function"}function Cr(){let{stack:t}=new Error;return typeof t!="string"?!1:t.split(` -`).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function Vi(t,e){return new Vi.Agent(t,e)}(function(t){class e extends rh.EventEmitter{constructor(r,n){super();let s=n;typeof r=="function"?this.callback=r:r&&(s=r),this.timeout=null,s&&typeof s.timeout=="number"&&(this.timeout=s.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:Cr()?443:80}set defaultPort(r){this.explicitDefaultPort=r}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:Cr()?"https:":"http:"}set protocol(r){this.explicitProtocol=r}callback(r,n,s){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(r,n){let s=Object.assign({},n);typeof s.secureEndpoint!="boolean"&&(s.secureEndpoint=Cr()),s.host==null&&(s.host="localhost"),s.port==null&&(s.port=s.secureEndpoint?443:80),s.protocol==null&&(s.protocol=s.secureEndpoint?"https:":"http:"),s.host&&s.path&&delete s.path,delete s.agent,delete s.hostname,delete s._defaultAgent,delete s.defaultPort,delete s.createConnection,r._last=!0,r.shouldKeepAlive=!1;let o=!1,l=null,a=s.timeout||this.timeout,c=p=>{r._hadError||(r.emit("error",p),r._hadError=!0)},u=()=>{l=null,o=!0;let p=new Error(`A "socket" was not created for HTTP request before ${a}ms`);p.code="ETIMEOUT",c(p)},f=p=>{o||(l!==null&&(clearTimeout(l),l=null),c(p))},h=p=>{if(o)return;if(l!=null&&(clearTimeout(l),l=null),oh(p)){gi("Callback returned another Agent instance %o",p.constructor.name),p.addRequest(r,s);return}if(p){p.once("free",()=>{this.freeSocket(p,s)}),r.onSocket(p);return}let d=new Error(`no Duplex stream was returned to agent-base for \`${r.method} ${r.path}\``);c(d)};if(typeof this.callback!="function"){c(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(gi("Converting legacy callback function to promise"),this.promisifiedCallback=sh.default(this.callback)):this.promisifiedCallback=this.callback),typeof a=="number"&&a>0&&(l=setTimeout(u,a)),"port"in s&&typeof s.port!="number"&&(s.port=Number(s.port));try{gi("Resolving socket for %o request: %o",s.protocol,`${r.method} ${r.path}`),Promise.resolve(this.promisifiedCallback(r,s)).then(h,f)}catch(p){Promise.reject(p).catch(f)}}freeSocket(r,n){gi("Freeing socket %o %o",r.constructor.name,n),r.destroy()}destroy(){gi("Destroying agent %o",this.constructor.name)}}t.Agent=e,t.prototype=t.Agent.prototype})(Vi||(Vi={}));ko.exports=Vi});var Co=y(xi=>{"use strict";var ah=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xi,"__esModule",{value:!0});var lh=ah(Ht()),vi=lh.default("https-proxy-agent:parse-proxy-response");function ch(t){return new Promise((e,i)=>{let r=0,n=[];function s(){let f=t.read();f?u(f):t.once("readable",s)}function o(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("close",l),t.removeListener("readable",s)}function l(f){vi("onclose had error %o",f)}function a(){vi("onend")}function c(f){o(),vi("onerror %o",f),i(f)}function u(f){n.push(f),r+=f.length;let h=Buffer.concat(n,r);if(h.indexOf(`\r +`+s),t.push(n+"m+"+bs.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=__()+e+" "+t[0]}function __(){return Ze.inspectOpts.hideDate?"":new Date().toISOString()+" "}function w_(...t){return process.stderr.write(ys.format(...t)+` +`)}function x_(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function S_(){return process.env.DEBUG}function E_(t){t.inspectOpts={};let e=Object.keys(Ze.inspectOpts);for(let i=0;ie.trim()).join(" ")};eh.O=function(t){return this.inspectOpts.colors=this.useColors,ys.inspect(t,this.inspectOpts)}});var rn=w((UI,Oa)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?Oa.exports=Kf():Oa.exports=th()});var Oh=w(($I,ow)=>{ow.exports={name:"dotenv",version:"16.4.5",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec","test:coverage":"tap --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Ih=w((VI,ai)=>{var Ma=require("fs"),qa=require("path"),aw=require("os"),lw=require("crypto"),cw=Oh(),Fa=cw.version,uw=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function fw(t){let e={},i=t.toString();i=i.replace(/\r\n?/mg,` +`);let r;for(;(r=uw.exec(i))!=null;){let n=r[1],s=r[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(s=s.replace(/\\n/g,` +`),s=s.replace(/\\r/g,"\r")),e[n]=s}return e}function hw(t){let e=Ah(t),i=$e.configDotenv({path:e});if(!i.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw o.code="MISSING_DATA",o}let r=Th(t).split(","),n=r.length,s;for(let o=0;o=n)throw a}return $e.parse(s)}function pw(t){console.log(`[dotenv@${Fa}][INFO] ${t}`)}function dw(t){console.log(`[dotenv@${Fa}][WARN] ${t}`)}function Ts(t){console.log(`[dotenv@${Fa}][DEBUG] ${t}`)}function Th(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function mw(t,e){let i;try{i=new URL(e)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let r=i.password;if(!r){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let n=i.searchParams.get("environment");if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let s=`DOTENV_VAULT_${n.toUpperCase()}`,o=t.parsed[s];if(!o){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${s} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:o,key:r}}function Ah(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let i of t.path)Ma.existsSync(i)&&(e=i.endsWith(".vault")?i:`${i}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=qa.resolve(process.cwd(),".env.vault");return Ma.existsSync(e)?e:null}function Ch(t){return t[0]==="~"?qa.join(aw.homedir(),t.slice(1)):t}function gw(t){pw("Loading env from encrypted .env.vault");let e=$e._parseVault(t),i=process.env;return t&&t.processEnv!=null&&(i=t.processEnv),$e.populate(i,e,t),{parsed:e}}function vw(t){let e=qa.resolve(process.cwd(),".env"),i="utf8",r=!!(t&&t.debug);t&&t.encoding?i=t.encoding:r&&Ts("No encoding is specified. UTF-8 is used by default");let n=[e];if(t&&t.path)if(!Array.isArray(t.path))n=[Ch(t.path)];else{n=[];for(let l of t.path)n.push(Ch(l))}let s,o={};for(let l of n)try{let c=$e.parse(Ma.readFileSync(l,{encoding:i}));$e.populate(o,c,t)}catch(c){r&&Ts(`Failed to load ${l} ${c.message}`),s=c}let a=process.env;return t&&t.processEnv!=null&&(a=t.processEnv),$e.populate(a,o,t),s?{parsed:o,error:s}:{parsed:o}}function yw(t){if(Th(t).length===0)return $e.configDotenv(t);let e=Ah(t);return e?$e._configVault(t):(dw(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),$e.configDotenv(t))}function bw(t,e){let i=Buffer.from(e.slice(-64),"hex"),r=Buffer.from(t,"base64"),n=r.subarray(0,12),s=r.subarray(-16);r=r.subarray(12,-16);try{let o=lw.createDecipheriv("aes-256-gcm",i,n);return o.setAuthTag(s),`${o.update(r)}${o.final()}`}catch(o){let a=o instanceof RangeError,l=o.message==="Invalid key length",c=o.message==="Unsupported state or unable to authenticate data";if(a||l){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(c){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw o}}function _w(t,e,i={}){let r=!!(i&&i.debug),n=!!(i&&i.override);if(typeof e!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(e))Object.prototype.hasOwnProperty.call(t,s)?(n===!0&&(t[s]=e[s]),r&&Ts(n===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):t[s]=e[s]}var $e={configDotenv:vw,_configVault:gw,_parseVault:hw,config:yw,decrypt:bw,parse:fw,populate:_w};ai.exports.configDotenv=$e.configDotenv;ai.exports._configVault=$e._configVault;ai.exports._parseVault=$e._parseVault;ai.exports.config=$e.config;ai.exports.decrypt=$e.decrypt;ai.exports.parse=$e.parse;ai.exports.populate=$e.populate;ai.exports=$e});var Lh=w(Nh=>{"use strict";var ww=require("url").parse,xw={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},Sw=String.prototype.endsWith||function(t){return t.length<=this.length&&this.indexOf(t,this.length-t.length)!==-1};function Ew(t){var e=typeof t=="string"?ww(t):t||{},i=e.protocol,r=e.host,n=e.port;if(typeof r!="string"||!r||typeof i!="string"||(i=i.split(":",1)[0],r=r.replace(/:\d*$/,""),n=parseInt(n)||xw[i]||0,!kw(r,n)))return"";var s=Sr("npm_config_"+i+"_proxy")||Sr(i+"_proxy")||Sr("npm_config_proxy")||Sr("all_proxy");return s&&s.indexOf("://")===-1&&(s=i+"://"+s),s}function kw(t,e){var i=(Sr("npm_config_no_proxy")||Sr("no_proxy")).toLowerCase();return i?i==="*"?!1:i.split(/[,\s]/).every(function(r){if(!r)return!0;var n=r.match(/^(.+):(\d+)$/),s=n?n[1]:r,o=n?parseInt(n[2]):0;return o&&o!==e?!0:/^[.*]/.test(s)?(s.charAt(0)==="*"&&(s=s.slice(1)),!Sw.call(t,s)):t!==s}):!0}function Sr(t){return process.env[t.toLowerCase()]||process.env[t.toUpperCase()]||""}Nh.getProxyForUrl=Ew});var Ph=w(dt=>{"use strict";var Ow=dt&&dt.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),Cw=dt&&dt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Bh=dt&&dt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&Ow(e,t,i);return Cw(e,t),e};Object.defineProperty(dt,"__esModule",{value:!0});dt.req=dt.json=dt.toBuffer=void 0;var Tw=Bh(require("http")),Aw=Bh(require("https"));async function Rh(t){let e=0,i=[];for await(let r of t)e+=r.length,i.push(r);return Buffer.concat(i,e)}dt.toBuffer=Rh;async function Iw(t){let i=(await Rh(t)).toString("utf8");try{return JSON.parse(i)}catch(r){let n=r;throw n.message+=` (input: ${i})`,n}}dt.json=Iw;function Nw(t,e={}){let r=((typeof t=="string"?t:t.href).startsWith("https:")?Aw:Tw).request(t,e),n=new Promise((s,o)=>{r.once("response",s).once("error",o).end()});return r.then=n.then.bind(n),r}dt.req=Nw});var ja=w(xt=>{"use strict";var qh=xt&&xt.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),Lw=xt&&xt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Fh=xt&&xt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&qh(e,t,i);return Lw(e,t),e},Bw=xt&&xt.__exportStar||function(t,e){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&qh(e,t,i)};Object.defineProperty(xt,"__esModule",{value:!0});xt.Agent=void 0;var Rw=Fh(require("net")),Mh=Fh(require("http")),Pw=require("https");Bw(Ph(),xt);var Wt=Symbol("AgentBaseInternalState"),Da=class extends Mh.Agent{constructor(e){super(e),this[Wt]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:i}=new Error;return typeof i!="string"?!1:i.split(` +`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let i=new Rw.Socket({writable:!1});return this.sockets[e].push(i),this.totalSocketCount++,i}decrementSockets(e,i){if(!this.sockets[e]||i===null)return;let r=this.sockets[e],n=r.indexOf(i);n!==-1&&(r.splice(n,1),this.totalSocketCount--,r.length===0&&delete this.sockets[e])}getName(e){return(typeof e.secureEndpoint=="boolean"?e.secureEndpoint:this.isSecureEndpoint(e))?Pw.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,i,r){let n={...i,secureEndpoint:this.isSecureEndpoint(i)},s=this.getName(n),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,n)).then(a=>{if(this.decrementSockets(s,o),a instanceof Mh.Agent)return a.addRequest(e,n);this[Wt].currentSocket=a,super.createSocket(e,i,r)},a=>{this.decrementSockets(s,o),r(a)})}createConnection(){let e=this[Wt].currentSocket;if(this[Wt].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){var e;return(e=this[Wt].defaultPort)!=null?e:this.protocol==="https:"?443:80}set defaultPort(e){this[Wt]&&(this[Wt].defaultPort=e)}get protocol(){var e;return(e=this[Wt].protocol)!=null?e:this.isSecureEndpoint()?"https:":"http:"}set protocol(e){this[Wt]&&(this[Wt].protocol=e)}};xt.Agent=Da});var Dh=w(Er=>{"use strict";var Mw=Er&&Er.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Er,"__esModule",{value:!0});Er.parseProxyResponse=void 0;var qw=Mw(rn()),As=(0,qw.default)("https-proxy-agent:parse-proxy-response");function Fw(t){return new Promise((e,i)=>{let r=0,n=[];function s(){let u=t.read();u?c(u):t.once("readable",s)}function o(){t.removeListener("end",a),t.removeListener("error",l),t.removeListener("readable",s)}function a(){o(),As("onend"),i(new Error("Proxy connection ended before receiving CONNECT response"))}function l(u){o(),As("onerror %o",u),i(u)}function c(u){n.push(u),r+=u.length;let f=Buffer.concat(n,r),d=f.indexOf(`\r \r -`)===-1){vi("have not received end of HTTP headers yet..."),s();return}let d=h.toString("ascii",0,h.indexOf(`\r -`)),m=+d.split(" ")[1];vi("got proxy server response: %o",d),e({statusCode:m,buffered:h})}t.on("error",c),t.on("close",l),t.on("end",a),s()})}xi.default=ch});var To=y(Et=>{"use strict";var uh=Et&&Et.__awaiter||function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(u){try{c(r.next(u))}catch(f){o(f)}}function a(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):n(u.value).then(l,a)}c((r=r.apply(t,e||[])).next())})},$t=Et&&Et.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Et,"__esModule",{value:!0});var Oo=$t(require("net")),Io=$t(require("tls")),fh=$t(require("url")),hh=$t(require("assert")),ph=$t(Ht()),dh=Ir(),mh=$t(Co()),_i=ph.default("https-proxy-agent:agent"),Tr=class extends dh.Agent{constructor(e){let i;if(typeof e=="string"?i=fh.default.parse(e):i=e,!i)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");_i("creating new HttpsProxyAgent instance: %o",i),super(i);let r=Object.assign({},i);this.secureProxy=i.secureProxy||xh(r.protocol),r.host=r.hostname||r.host,typeof r.port=="string"&&(r.port=parseInt(r.port,10)),!r.port&&r.host&&(r.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in r)&&(r.ALPNProtocols=["http 1.1"]),r.host&&r.path&&(delete r.path,delete r.pathname),this.proxy=r}callback(e,i){return uh(this,void 0,void 0,function*(){let{proxy:r,secureProxy:n}=this,s;n?(_i("Creating `tls.Socket`: %o",r),s=Io.default.connect(r)):(_i("Creating `net.Socket`: %o",r),s=Oo.default.connect(r));let o=Object.assign({},r.headers),a=`CONNECT ${`${i.host}:${i.port}`} HTTP/1.1\r -`;r.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(r.auth).toString("base64")}`);let{host:c,port:u,secureEndpoint:f}=i;vh(u,f)||(c+=`:${u}`),o.Host=c,o.Connection="close";for(let v of Object.keys(o))a+=`${v}: ${o[v]}\r -`;let h=mh.default(s);s.write(`${a}\r -`);let{statusCode:p,buffered:d}=yield h;if(p===200){if(e.once("socket",gh),i.secureEndpoint){let v=i.servername||i.host;if(!v)throw new Error('Could not determine "servername"');return _i("Upgrading socket connection to TLS"),Io.default.connect(Object.assign(Object.assign({},_h(i,"host","hostname","path","port")),{socket:s,servername:v}))}return s}s.destroy();let m=new Oo.default.Socket;return m.readable=!0,e.once("socket",v=>{_i("replaying proxy buffer for failed request"),hh.default(v.listenerCount("data")>0),v.push(d),v.push(null)}),m})}};Et.default=Tr;function gh(t){t.resume()}function vh(t,e){return!!(!e&&t===80||e&&t===443)}function xh(t){return typeof t=="string"?/^https:?$/i.test(t):!1}function _h(t,...e){let i={},r;for(r in t)e.includes(r)||(i[r]=t[r]);return i}});var Ro=y((Br,Ao)=>{"use strict";var yh=Br&&Br.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Ar=yh(To());function Rr(t){return new Ar.default(t)}(function(t){t.HttpsProxyAgent=Ar.default,t.prototype=Ar.default.prototype})(Rr||(Rr={}));Ao.exports=Rr});var Po=y((xg,$i)=>{var Lo=Lo||function(t){return Buffer.from(t).toString("base64")};function bh(t){var e=this,i=Math.round,r=Math.floor,n=new Array(64),s=new Array(64),o=new Array(64),l=new Array(64),a,c,u,f,h=new Array(65535),p=new Array(65535),d=new Array(64),m=new Array(64),v=[],E=0,I=7,w=new Array(64),C=new Array(64),_=new Array(64),$=new Array(256),k=new Array(2048),U,b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],T=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],B=[0,1,2,3,4,5,6,7,8,9,10,11],G=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],L=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],X=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],N=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],q=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function z(g){for(var j=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],W=0;W<64;W++){var V=r((j[W]*g+50)/100);V<1?V=1:V>255&&(V=255),n[b[W]]=V}for(var J=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],Q=0;Q<64;Q++){var fe=r((J[Q]*g+50)/100);fe<1?fe=1:fe>255&&(fe=255),s[b[Q]]=fe}for(var he=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Se=0,xe=0;xe<8;xe++)for(var O=0;O<8;O++)o[Se]=1/(n[b[Se]]*he[xe]*he[O]*8),l[Se]=1/(s[b[Se]]*he[xe]*he[O]*8),Se++}function P(g,j){for(var W=0,V=0,J=new Array,Q=1;Q<=16;Q++){for(var fe=1;fe<=g[Q];fe++)J[j[V]]=[],J[j[V]][0]=W,J[j[V]][1]=Q,V++,W++;W*=2}return J}function be(){a=P(T,B),c=P(X,R),u=P(G,L),f=P(N,q)}function le(){for(var g=1,j=2,W=1;W<=15;W++){for(var V=g;V>0]=38470*g,k[g+512>>0]=7471*g+32768,k[g+768>>0]=-11059*g,k[g+1024>>0]=-21709*g,k[g+1280>>0]=32768*g+8421375,k[g+1536>>0]=-27439*g,k[g+1792>>0]=-5329*g}function re(g){for(var j=g[0],W=g[1]-1;W>=0;)j&1<>8&255),x(g&255)}function de(g,j){var W,V,J,Q,fe,he,Se,xe,O=0,M,Z=8,we=64;for(M=0;M0?Mi+.5|0:Mi-.5|0;return d}function me(){H(65504),H(16),x(74),x(70),x(73),x(70),x(0),x(1),x(1),x(0),H(1),H(1),x(0),x(0)}function ce(g){if(g){H(65505),g[0]===69&&g[1]===120&&g[2]===105&&g[3]===102?H(g.length+2):(H(g.length+5+2),x(69),x(120),x(105),x(102),x(0));for(var j=0;j{if(typeof j=="string"){H(65534);var W=j.length;H(W+2);var V;for(V=0;V0&&m[ee]==0;ee--);if(ee==0)return re(Q),W;for(var ae=1,ge;ae<=ee;){for(var Y=ae;m[ae]==0&&ae<=ee;++ae);var pe=ae-Y;if(pe>=Se){ge=pe>>4;for(var Le=1;Le<=ge;++Le)re(fe);pe=pe&15}he=32767+m[ae],re(J[(pe<<4)+p[he]]),re(h[he]),ae++}return ee!=xe&&re(Q),W}function se(){for(var g=String.fromCharCode,j=0;j<256;j++)$[j]=g(j)}this.encode=function(g,j){var W=new Date().getTime();j&&We(j),v=new Array,E=0,I=7,H(65496),me(),A(g.comments),ce(g.exifBuffer),ne(),ue(g.width,g.height),F(),ve();var V=0,J=0,Q=0;E=0,I=7,this.encode.displayName="_encode_";for(var fe=g.data,he=g.width,Se=g.height,xe=he*4,O=he*3,M,Z=0,we,ee,ae,ge,Y,pe,Le,ye;Z>3,pe=(ye&7)*4,Y=ge+Le*xe+pe,Z+Le>=Se&&(Y-=xe*(Z+1+Le-Se)),M+pe>=xe&&(Y-=M+pe-xe+4),we=fe[Y++],ee=fe[Y++],ae=fe[Y++],w[ye]=(k[we]+k[ee+256>>0]+k[ae+512>>0]>>16)-128,C[ye]=(k[we+768>>0]+k[ee+1024>>0]+k[ae+1280>>0]>>16)-128,_[ye]=(k[we+1280>>0]+k[ee+1536>>0]+k[ae+1792>>0]>>16)-128;V=K(w,o,V,a,u),J=K(C,l,J,c,f),Q=K(_,l,Q,c,f),M+=32}Z+=8}if(I>=0){var Ye=[];Ye[1]=I+1,Ye[0]=(1<100&&(g=100),U!=g){var j=0;g<50?j=Math.floor(5e3/g):j=Math.floor(200-g*2),z(j),U=g}}function Je(){var g=new Date().getTime();t||(t=50),se(),be(),le(),ie(),We(t);var j=new Date().getTime()-g}Je()}typeof $i!="undefined"?$i.exports=Bo:typeof window!="undefined"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=Bo);function Bo(t,e){typeof e=="undefined"&&(e=50);var i=new bh(e),r=i.encode(t,e);return{data:r,width:t.width,height:t.height}}});var No=y((_g,Pr)=>{var Lr=function(){"use strict";var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),i=4017,r=799,n=3406,s=2276,o=1567,l=3784,a=5793,c=2896;function u(){}function f(I,w){for(var C=0,_=[],$,k,U=16;U>0&&!I[U-1];)U--;_.push({children:[],index:0});var b=_[0],T;for($=0;$0;){if(_.length===0)throw new Error("Could not recreate Huffman Table");b=_.pop()}for(b.index++,_.push(b);_.length<=$;)_.push(T={children:[],index:0}),b.children[b.index]=T.children,b=T;C++}$+10)return le--,be>>le&1;if(be=I[w++],be==255){var O=I[w++];if(O)throw new Error("unexpected marker: "+(be<<8|O).toString(16))}return le=7,be>>>7}function re(O){for(var M=O,Z;(Z=ie())!==null;){if(M=M[Z],typeof M=="number")return M;if(typeof M!="object")throw new Error("invalid huffman sequence")}return null}function x(O){for(var M=0;O>0;){var Z=ie();if(Z===null)return;M=M<<1|Z,O--}return M}function H(O){var M=x(O);return M>=1<>4;if(ge===0){if(Y<15)break;ee+=16;continue}ee+=Y;var pe=e[ee];M[pe]=H(ge),ee++}}function me(O,M){var Z=re(O.huffmanTableDC),we=Z===0?0:H(Z)<0){ue--;return}for(var Z=k,we=U;Z<=we;){var ee=re(O.huffmanTableAC),ae=ee&15,ge=ee>>4;if(ae===0){if(ge<15){ue=x(ge)+(1<>4;if(pe===0)ee<15?(ue=x(ee)+(1<=65488&&fe<=65495)w+=2;else break}return w-P}function p(I,w){var C=[],_=w.blocksPerLine,$=w.blocksPerColumn,k=_<<3,U=new Int32Array(64),b=new Uint8Array(64);function T(P,be,le){var ie=w.quantizationTable,re,x,H,de,me,ce,ue,ne,F,A=le,ve;for(ve=0;ve<64;ve++)A[ve]=P[ve]*ie[ve];for(ve=0;ve<8;++ve){var K=8*ve;if(A[1+K]==0&&A[2+K]==0&&A[3+K]==0&&A[4+K]==0&&A[5+K]==0&&A[6+K]==0&&A[7+K]==0){F=a*A[0+K]+512>>10,A[0+K]=F,A[1+K]=F,A[2+K]=F,A[3+K]=F,A[4+K]=F,A[5+K]=F,A[6+K]=F,A[7+K]=F;continue}re=a*A[0+K]+128>>8,x=a*A[4+K]+128>>8,H=A[2+K],de=A[6+K],me=c*(A[1+K]-A[7+K])+128>>8,ne=c*(A[1+K]+A[7+K])+128>>8,ce=A[3+K]<<4,ue=A[5+K]<<4,F=re-x+1>>1,re=re+x+1>>1,x=F,F=H*l+de*o+128>>8,H=H*o-de*l+128>>8,de=F,F=me-ue+1>>1,me=me+ue+1>>1,ue=F,F=ne+ce+1>>1,ce=ne-ce+1>>1,ne=F,F=re-de+1>>1,re=re+de+1>>1,de=F,F=x-H+1>>1,x=x+H+1>>1,H=F,F=me*s+ne*n+2048>>12,me=me*n-ne*s+2048>>12,ne=F,F=ce*r+ue*i+2048>>12,ce=ce*i-ue*r+2048>>12,ue=F,A[0+K]=re+ne,A[7+K]=re-ne,A[1+K]=x+ue,A[6+K]=x-ue,A[2+K]=H+ce,A[5+K]=H-ce,A[3+K]=de+me,A[4+K]=de-me}for(ve=0;ve<8;++ve){var se=ve;if(A[8+se]==0&&A[16+se]==0&&A[24+se]==0&&A[32+se]==0&&A[40+se]==0&&A[48+se]==0&&A[56+se]==0){F=a*le[ve+0]+8192>>14,A[0+se]=F,A[8+se]=F,A[16+se]=F,A[24+se]=F,A[32+se]=F,A[40+se]=F,A[48+se]=F,A[56+se]=F;continue}re=a*A[0+se]+2048>>12,x=a*A[32+se]+2048>>12,H=A[16+se],de=A[48+se],me=c*(A[8+se]-A[56+se])+2048>>12,ne=c*(A[8+se]+A[56+se])+2048>>12,ce=A[24+se],ue=A[40+se],F=re-x+1>>1,re=re+x+1>>1,x=F,F=H*l+de*o+2048>>12,H=H*o-de*l+2048>>12,de=F,F=me-ue+1>>1,me=me+ue+1>>1,ue=F,F=ne+ce+1>>1,ce=ne-ce+1>>1,ne=F,F=re-de+1>>1,re=re+de+1>>1,de=F,F=x-H+1>>1,x=x+H+1>>1,H=F,F=me*s+ne*n+2048>>12,me=me*n-ne*s+2048>>12,ne=F,F=ce*r+ue*i+2048>>12,ce=ce*i-ue*r+2048>>12,ue=F,A[0+se]=re+ne,A[56+se]=re-ne,A[8+se]=x+ue,A[48+se]=x-ue,A[16+se]=H+ce,A[40+se]=H-ce,A[24+se]=de+me,A[32+se]=de-me}for(ve=0;ve<64;++ve){var We=128+(A[ve]+8>>4);be[ve]=We<0?0:We>255?255:We}}E(k*$*8);for(var B,G,L=0;L<$;L++){var X=L<<3;for(B=0;B<8;B++)C.push(new Uint8Array(k));for(var R=0;R<_;R++){T(w.blocks[L][R],b,U);var N=0,q=R<<3;for(G=0;G<8;G++){var z=C[X+G];for(B=0;B<8;B++)z[q+B]=b[N++]}}}return C}function d(I){return I<0?0:I>255?255:I}u.prototype={load:function(w){var C=new XMLHttpRequest;C.open("GET",w,!0),C.responseType="arraybuffer",C.onload=function(){var _=new Uint8Array(C.response||C.mozResponseArrayBuffer);this.parse(_),this.onload&&this.onload()}.bind(this),C.send(null)},parse:function(w){var C=this.opts.maxResolutionInMP*1e3*1e3,_=0,$=w.length;function k(){var Y=w[_]<<8|w[_+1];return _+=2,Y}function U(){var Y=k(),pe=w.subarray(_,_+Y-2);return _+=pe.length,pe}function b(Y){var pe=1,Le=1,ye,Ye;for(Ye in Y.components)Y.components.hasOwnProperty(Ye)&&(ye=Y.components[Ye],pe>4)if(ce>>4===1)for(ie=0;ie<64;ie++){var ne=e[ie];ue[ne]=k()}else throw new Error("DQT: invalid table spec");else for(ie=0;ie<64;ie++){var ne=e[ie];ue[ne]=w[_++]}R[ce&15]=ue}break;case 65472:case 65473:case 65474:k(),L={},L.extended=P===65473,L.progressive=P===65474,L.precision=w[_++],L.scanLines=k(),L.samplesPerLine=k(),L.components={},L.componentsOrder=[];var F=L.scanLines*L.samplesPerLine;if(F>C){var A=Math.ceil((F-C)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${A}MP`)}var ve=w[_++],K,se=0,We=0;for(le=0;le>4,g=w[_+1]&15,j=w[_+2];if(Je<=0||g<=0)throw new Error("Invalid sampling factor, expected values above 0");L.componentsOrder.push(K),L.components[K]={h:Je,v:g,quantizationIdx:j},_+=3}b(L),N.push(L);break;case 65476:var W=k();for(le=2;le>4?q:z)[V&15]=f(J,fe)}break;case 65501:k(),X=k();break;case 65500:k(),k();break;case 65498:var he=k(),Se=w[_++],xe=[],O;for(le=0;le>4],O.huffmanTableAC=q[M&15],xe.push(O)}var Z=w[_++],we=w[_++],ee=w[_++],ae=h(w,_,L,xe,X,Z,we,ee>>4,ee&15,this.opts);_+=ae;break;case 65535:w[_]!==255&&_--;break;default:if(w[_-3]==255&&w[_-2]>=192&&w[_-2]<=254){_-=3;break}else if(P===224||P==225){if(be!==-1)throw new Error(`first unknown JPEG marker at offset ${be.toString(16)}, second unknown JPEG marker ${P.toString(16)} at offset ${(_-1).toString(16)}`);be=_-1;let Y=k();if(w[_+Y-2]===255){_+=Y-2;break}}throw new Error("unknown JPEG marker "+P.toString(16))}P=k()}if(N.length!=1)throw new Error("only single frame JPEGs supported");for(var le=0;lev){var C=Math.ceil((w-v)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${C}MB`)}m=w}return u.resetMaxMemoryUsage=function(I){m=0,v=I},u.getBytesAllocated=function(){return m},u.requestMemoryAllocation=E,u}();typeof Pr!="undefined"?Pr.exports=Fo:typeof window!="undefined"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=Fo);function Fo(t,e={}){var i={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},r={...i,...e},n=new Uint8Array(t),s=new Lr;s.opts=r,Lr.resetMaxMemoryUsage(r.maxMemoryUsageInMB*1024*1024),s.parse(n);var o=r.formatAsRGBA?4:3,l=s.width*s.height*o;try{Lr.requestMemoryAllocation(l);var a={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:r.useTArray?new Uint8Array(l):Buffer.alloc(l)};s.comments.length>0&&(a.comments=s.comments)}catch(c){throw c instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+l):c instanceof ReferenceError&&c.message==="Buffer is not defined"?new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true"):c}return s.copyToImageData(a,r.formatAsRGBA),a}});var Uo=y((yg,Mo)=>{var wh=Po(),Eh=No();Mo.exports={encode:wh,decode:Eh}});var jo=y((bg,Do)=>{"use strict";function Gi(){this._types=Object.create(null),this._extensions=Object.create(null);for(let t=0;t{qo.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}});var $o=y((Eg,Vo)=>{Vo.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}});var zo=y((Sg,Go)=>{"use strict";var Sh=jo();Go.exports=new Sh(Ho(),$o())});var Yo=y((kg,Wo)=>{Wo.exports=function(t,e){for(var i=[],r=0;r{"use strict";Jo.exports=Zo;function Zo(t,e,i){t instanceof RegExp&&(t=Ko(t,i)),e instanceof RegExp&&(e=Ko(e,i));var r=Xo(t,e,i);return r&&{start:r[0],end:r[1],pre:i.slice(0,r[0]),body:i.slice(r[0]+t.length,r[1]),post:i.slice(r[1]+e.length)}}function Ko(t,e){var i=e.match(t);return i?i[0]:null}Zo.range=Xo;function Xo(t,e,i){var r,n,s,o,l,a=i.indexOf(t),c=i.indexOf(e,a+1),u=a;if(a>=0&&c>0){if(t===e)return[a,c];for(r=[],s=i.length;u>=0&&!l;)u==a?(r.push(u),a=i.indexOf(t,u+1)):r.length==1?l=[r.pop(),c]:(n=r.pop(),n=0?a:c;r.length&&(l=[s,o])}return l}});var aa=y((Og,oa)=>{var Ch=Yo(),ea=Qo();oa.exports=Th;var ta="\0SLASH"+Math.random()+"\0",ia="\0OPEN"+Math.random()+"\0",Nr="\0CLOSE"+Math.random()+"\0",ra="\0COMMA"+Math.random()+"\0",na="\0PERIOD"+Math.random()+"\0";function Fr(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function Oh(t){return t.split("\\\\").join(ta).split("\\{").join(ia).split("\\}").join(Nr).split("\\,").join(ra).split("\\.").join(na)}function Ih(t){return t.split(ta).join("\\").split(ia).join("{").split(Nr).join("}").split(ra).join(",").split(na).join(".")}function sa(t){if(!t)return[""];var e=[],i=ea("{","}",t);if(!i)return t.split(",");var r=i.pre,n=i.body,s=i.post,o=r.split(",");o[o.length-1]+="{"+n+"}";var l=sa(s);return s.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),e.push.apply(e,o),e}function Th(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),Gt(Oh(t),!0).map(Ih)):[]}function Ah(t){return"{"+t+"}"}function Rh(t){return/^-?0\d/.test(t)}function Bh(t,e){return t<=e}function Lh(t,e){return t>=e}function Gt(t,e){var i=[],r=ea("{","}",t);if(!r||/\$$/.test(r.pre))return[t];var n=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),o=n||s,l=r.body.indexOf(",")>=0;if(!o&&!l)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+Nr+r.post,Gt(t)):[t];var a;if(o)a=r.body.split(/\.\./);else if(a=sa(r.body),a.length===1&&(a=Gt(a[0],!1).map(Ah),a.length===1)){var u=r.post.length?Gt(r.post,!1):[""];return u.map(function(B){return r.pre+a[0]+B})}var c=r.pre,u=r.post.length?Gt(r.post,!1):[""],f;if(o){var h=Fr(a[0]),p=Fr(a[1]),d=Math.max(a[0].length,a[1].length),m=a.length==3?Math.abs(Fr(a[2])):1,v=Bh,E=p0){var $=new Array(_+1).join("0");w<0?C="-"+$+C.slice(1):C=$+C}}f.push(C)}}else f=Ch(a,function(T){return Gt(T,!1)});for(var k=0;k{ha.exports=Ge;Ge.Minimatch=Fe;var yi=function(){try{return require("path")}catch{}}()||{sep:"/"};Ge.sep=yi.sep;var Dr=Ge.GLOBSTAR=Fe.GLOBSTAR={},Ph=aa(),la={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Mr="[^/]",Ur=Mr+"*?",Fh="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Nh="(?:(?!(?:\\/|^)\\.).)*?",ca=Mh("().*{}+?[]^$\\!");function Mh(t){return t.split("").reduce(function(e,i){return e[i]=!0,e},{})}var ua=/\/+/;Ge.filter=Uh;function Uh(t,e){return e=e||{},function(i,r,n){return Ge(i,t,e)}}function ft(t,e){e=e||{};var i={};return Object.keys(t).forEach(function(r){i[r]=t[r]}),Object.keys(e).forEach(function(r){i[r]=e[r]}),i}Ge.defaults=function(t){if(!t||typeof t!="object"||!Object.keys(t).length)return Ge;var e=Ge,i=function(n,s,o){return e(n,s,ft(t,o))};return i.Minimatch=function(n,s){return new e.Minimatch(n,ft(t,s))},i.Minimatch.defaults=function(n){return e.defaults(ft(t,n)).Minimatch},i.filter=function(n,s){return e.filter(n,ft(t,s))},i.defaults=function(n){return e.defaults(ft(t,n))},i.makeRe=function(n,s){return e.makeRe(n,ft(t,s))},i.braceExpand=function(n,s){return e.braceExpand(n,ft(t,s))},i.match=function(r,n,s){return e.match(r,n,ft(t,s))},i};Fe.defaults=function(t){return Ge.defaults(t).Minimatch};function Ge(t,e,i){return Wi(e),i||(i={}),!i.nocomment&&e.charAt(0)==="#"?!1:new Fe(e,i).match(t)}function Fe(t,e){if(!(this instanceof Fe))return new Fe(t,e);Wi(t),e||(e={}),t=t.trim(),!e.allowWindowsEscape&&yi.sep!=="/"&&(t=t.split(yi.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}Fe.prototype.debug=function(){};Fe.prototype.make=Dh;function Dh(){var t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate();var i=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,i),i=this.globParts=i.map(function(r){return r.split(ua)}),this.debug(this.pattern,i),i=i.map(function(r,n,s){return r.map(this.parse,this)},this),this.debug(this.pattern,i),i=i.filter(function(r){return r.indexOf(!1)===-1}),this.debug(this.pattern,i),this.set=i}Fe.prototype.parseNegate=jh;function jh(){var t=this.pattern,e=!1,i=this.options,r=0;if(!i.nonegate){for(var n=0,s=t.length;nqh)throw new TypeError("pattern is too long")};Fe.prototype.parse=Hh;var zi={};function Hh(t,e){Wi(t);var i=this.options;if(t==="**")if(i.noglobstar)t="*";else return Dr;if(t==="")return"";var r="",n=!!i.nocase,s=!1,o=[],l=[],a,c=!1,u=-1,f=-1,h=t.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",p=this;function d(){if(a){switch(a){case"*":r+=Ur,n=!0;break;case"?":r+=Mr,n=!0;break;default:r+="\\"+a;break}p.debug("clearStateChar %j %j",a,r),a=!1}}for(var m=0,v=t.length,E;m-1;U--){var b=l[U],T=r.slice(0,b.reStart),B=r.slice(b.reStart,b.reEnd-8),G=r.slice(b.reEnd-8,b.reEnd),L=r.slice(b.reEnd);G+=L;var X=T.split("(").length-1,R=L;for(m=0;m=0&&(s=e[o],!s);o--);for(o=0;o>> no match, partial?`,t,u,e,f),u===o))}var p;if(typeof a=="string"?(p=c===a,this.debug("string match",a,c,p)):(p=c.match(a),this.debug("pattern match",a,c,p)),!p)return!1}if(n===o&&s===l)return!0;if(n===o)return i;if(s===l)return n===o-1&&t[n]==="";throw new Error("wtf?")};function $h(t){return t.replace(/\\(.)/g,"$1")}function Gh(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var qr=y((Tg,ma)=>{"use strict";var da=require("fs"),jr;function zh(){try{return da.statSync("/.dockerenv"),!0}catch{return!1}}function Wh(){try{return da.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}ma.exports=()=>(jr===void 0&&(jr=zh()||Wh()),jr)});var xa=y((Ag,Hr)=>{"use strict";var Yh=require("os"),Kh=require("fs"),ga=qr(),va=()=>{if(process.platform!=="linux")return!1;if(Yh.release().toLowerCase().includes("microsoft"))return!ga();try{return Kh.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ga():!1}catch{return!1}};process.env.__IS_WSL_TEST__?Hr.exports=va:Hr.exports=va()});var ya=y((Rg,_a)=>{"use strict";_a.exports=(t,e,i)=>{let r=n=>Object.defineProperty(t,e,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let n=i();return r(n),n},set(n){r(n)}}),t}});var Oa=y((Bg,Ca)=>{var Zh=require("path"),Xh=require("child_process"),{promises:Vr,constants:ka}=require("fs"),Yi=xa(),Jh=qr(),$r=ya(),ba=Zh.join(__dirname,"xdg-open"),{platform:zt,arch:wa}=process,Qh=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let i="/etc/wsl.conf",r=!1;try{await Vr.access(i,ka.F_OK),r=!0}catch{}if(!r)return t;let n=await Vr.readFile(i,{encoding:"utf8"}),s=/(?.*)/g.exec(n);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),Ea=async(t,e)=>{let i;for(let r of t)try{return await e(r)}catch(n){i=n}throw i},Ki=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return Ea(t.app,l=>Ki({...t,app:l}));let{name:e,arguments:i=[]}=t.app||{};if(i=[...i],Array.isArray(e))return Ea(e,l=>Ki({...t,app:{name:l,arguments:i}}));let r,n=[],s={};if(zt==="darwin")r="open",t.wait&&n.push("--wait-apps"),t.background&&n.push("--background"),t.newInstance&&n.push("--new"),e&&n.push("-a",e);else if(zt==="win32"||Yi&&!Jh()){let l=await Qh();r=Yi?`${l}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,n.push("-NoProfile","-NonInteractive","\u2013ExecutionPolicy","Bypass","-EncodedCommand"),Yi||(s.windowsVerbatimArguments=!0);let a=["Start"];t.wait&&a.push("-Wait"),e?(a.push(`"\`"${e}\`""`,"-ArgumentList"),t.target&&i.unshift(t.target)):t.target&&a.push(`"${t.target}"`),i.length>0&&(i=i.map(c=>`"\`"${c}\`""`),a.push(i.join(","))),t.target=Buffer.from(a.join(" "),"utf16le").toString("base64")}else{if(e)r=e;else{let l=!__dirname||__dirname==="/",a=!1;try{await Vr.access(ba,ka.X_OK),a=!0}catch{}r=process.versions.electron||zt==="android"||l||!a?"xdg-open":ba}i.length>0&&n.push(...i),t.wait||(s.stdio="ignore",s.detached=!0)}t.target&&n.push(t.target),zt==="darwin"&&i.length>0&&n.push("--args",...i);let o=Xh.spawn(r,n,s);return t.wait?new Promise((l,a)=>{o.once("error",a),o.once("close",c=>{if(t.allowNonzeroExitCode&&c>0){a(new Error(`Exited with code ${c}`));return}l(o)})}):(o.unref(),o)},Gr=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return Ki({...e,target:t})},ep=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `name`");let{arguments:i=[]}=e||{};if(i!=null&&!Array.isArray(i))throw new TypeError("Expected `appArguments` as Array type");return Ki({...e,app:{name:t,arguments:i}})};function Sa(t){if(typeof t=="string"||Array.isArray(t))return t;let{[wa]:e}=t;if(!e)throw new Error(`${wa} is not supported`);return e}function zr({[zt]:t},{wsl:e}){if(e&&Yi)return Sa(e);if(!t)throw new Error(`${zt} is not supported`);return Sa(t)}var Zi={};$r(Zi,"chrome",()=>zr({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));$r(Zi,"firefox",()=>zr({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));$r(Zi,"edge",()=>zr({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Gr.apps=Zi;Gr.openApp=ep;Ca.exports=Gr});var Wr=y((Lg,Ta)=>{"use strict";var tp=require("util"),Ia=require("stream"),tt=Ta.exports=function(){Ia.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};tp.inherits(tt,Ia);tt.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))};tt.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let i;return Buffer.isBuffer(t)?i=t:i=Buffer.from(t,e||this._encoding),this._buffers.push(i),this._buffered+=i.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused};tt.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(this._buffers.length===0?this._end():(this._buffers.push(null),this._process()))};tt.prototype.destroySoon=tt.prototype.end;tt.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};tt.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};tt.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))};tt.prototype._processRead=function(t){this._reads.shift();let e=0,i=0,r=Buffer.alloc(t.length);for(;e0&&this._buffers.splice(0,i),this._buffered-=t.length,t.func.call(this,r)};tt.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else if(this._buffered>=t.length)this._processRead(t);else break}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}}});var Kr=y(Yr=>{"use strict";var ht=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];Yr.getImagePasses=function(t,e){let i=[],r=t%8,n=e%8,s=(t-r)/8,o=(e-n)/8;for(let l=0;l0&&u>0&&i.push({width:c,height:u,index:l})}return i};Yr.getInterlaceIterator=function(t){return function(e,i,r){let n=e%ht[r].x.length,s=(e-n)/ht[r].x.length*8+ht[r].x[n],o=i%ht[r].y.length,l=(i-o)/ht[r].y.length*8+ht[r].y[o];return s*4+l*t*4}}});var Zr=y((Fg,Aa)=>{"use strict";Aa.exports=function(e,i,r){let n=e+i-r,s=Math.abs(n-e),o=Math.abs(n-i),l=Math.abs(n-r);return s<=o&&s<=l?e:o<=l?i:r}});var Xr=y((Ng,Ba)=>{"use strict";var ip=Kr(),rp=Zr();function Ra(t,e,i){let r=t*e;return i!==8&&(r=Math.ceil(r/(8/i))),r}var Wt=Ba.exports=function(t,e){let i=t.width,r=t.height,n=t.interlace,s=t.bpp,o=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],n){let l=ip.getImagePasses(i,r);for(let a=0;an?e[s-r]:0;e[s]=o+l}};Wt.prototype._unFilterType2=function(t,e,i){let r=this._lastLine;for(let n=0;nn?e[o-r]:0,u=Math.floor((c+a)/2);e[o]=l+u}};Wt.prototype._unFilterType4=function(t,e,i){let r=this._xComparison,n=r-1,s=this._lastLine;for(let o=0;on?e[o-r]:0,u=o>n&&s?s[o-r]:0,f=rp(c,a,u);e[o]=l+f}};Wt.prototype._reverseFilterLine=function(t){let e=t[0],i,r=this._images[this._imageIndex],n=r.byteWidth;if(e===0)i=t.slice(1,n+1);else switch(i=Buffer.alloc(n),e){case 1:this._unFilterType1(t,i,n);break;case 2:this._unFilterType2(t,i,n);break;case 3:this._unFilterType3(t,i,n);break;case 4:this._unFilterType4(t,i,n);break;default:throw new Error("Unrecognised filter type - "+e)}this.write(i),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=i,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}});var Fa=y((Mg,Pa)=>{"use strict";var np=require("util"),La=Wr(),sp=Xr(),op=Pa.exports=function(t){La.call(this);let e=[],i=this;this._filter=new sp(t,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){i.emit("complete",Buffer.concat(e))}}),this._filter.start()};np.inherits(op,La)});var Yt=y((Ug,Na)=>{"use strict";Na.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}});var en=y((Dg,Ma)=>{"use strict";var Jr=[];(function(){for(let t=0;t<256;t++){let e=t;for(let i=0;i<8;i++)e&1?e=3988292384^e>>>1:e=e>>>1;Jr[t]=e}})();var Qr=Ma.exports=function(){this._crc=-1};Qr.prototype.write=function(t){for(let e=0;e>>8;return!0};Qr.prototype.crc32=function(){return this._crc^-1};Qr.crc32=function(t){let e=-1;for(let i=0;i>>8;return e^-1}});var tn=y((jg,Ua)=>{"use strict";var Oe=Yt(),ap=en(),Ae=Ua.exports=function(t,e){this._options=t,t.checkCRC=t.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[Oe.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[Oe.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[Oe.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[Oe.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[Oe.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[Oe.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};Ae.prototype.start=function(){this.read(Oe.PNG_SIGNATURE.length,this._parseSignature.bind(this))};Ae.prototype._parseSignature=function(t){let e=Oe.PNG_SIGNATURE;for(let i=0;ithis._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let e=0;e0?this._handleIDAT(i):this._handleChunkEnd()};Ae.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};Ae.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var rn=y(ja=>{"use strict";var Da=Kr(),lp=[function(){},function(t,e,i,r){if(r===e.length)throw new Error("Ran out of data");let n=e[r];t[i]=n,t[i+1]=n,t[i+2]=n,t[i+3]=255},function(t,e,i,r){if(r+1>=e.length)throw new Error("Ran out of data");let n=e[r];t[i]=n,t[i+1]=n,t[i+2]=n,t[i+3]=e[r+1]},function(t,e,i,r){if(r+2>=e.length)throw new Error("Ran out of data");t[i]=e[r],t[i+1]=e[r+1],t[i+2]=e[r+2],t[i+3]=255},function(t,e,i,r){if(r+3>=e.length)throw new Error("Ran out of data");t[i]=e[r],t[i+1]=e[r+1],t[i+2]=e[r+2],t[i+3]=e[r+3]}],cp=[function(){},function(t,e,i,r){let n=e[0];t[i]=n,t[i+1]=n,t[i+2]=n,t[i+3]=r},function(t,e,i){let r=e[0];t[i]=r,t[i+1]=r,t[i+2]=r,t[i+3]=e[1]},function(t,e,i,r){t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=r},function(t,e,i){t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=e[3]}];function up(t,e){let i=[],r=0;function n(){if(r===t.length)throw new Error("Ran out of data");let s=t[r];r++;let o,l,a,c,u,f,h,p;switch(e){default:throw new Error("unrecognised depth");case 16:h=t[r],r++,i.push((s<<8)+h);break;case 4:h=s&15,p=s>>4,i.push(p,h);break;case 2:u=s&3,f=s>>2&3,h=s>>4&3,p=s>>6&3,i.push(p,h,f,u);break;case 1:o=s&1,l=s>>1&1,a=s>>2&1,c=s>>3&1,u=s>>4&1,f=s>>5&1,h=s>>6&1,p=s>>7&1,i.push(p,h,f,u,c,a,l,o);break}}return{get:function(s){for(;i.length{"use strict";function pp(t,e,i,r,n){let s=0;for(let o=0;o{"use strict";var gp=require("util"),sn=require("zlib"),Ha=Wr(),vp=Fa(),xp=tn(),_p=rn(),yp=nn(),st=Va.exports=function(t){Ha.call(this),this._parser=new xp(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};gp.inherits(st,Ha);st.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0};st.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=sn.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let i=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,r=Math.max(i,sn.Z_MIN_CHUNK);this._inflate=sn.createInflate({chunkSize:r});let n=i,s=this.emit.bind(this,"error");this._inflate.on("error",function(l){n&&s(l)}),this._filter.on("complete",this._complete.bind(this));let o=this._filter.write.bind(this._filter);this._inflate.on("data",function(l){n&&(l.length>n&&(l=l.slice(0,n)),n-=l.length,o(l))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)};st.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new vp(this._bitmapInfo)};st.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};st.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};st.prototype._simpleTransparency=function(){this._metaData.alpha=!0};st.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};st.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};st.prototype._complete=function(t){if(this.errord)return;let e;try{let i=_p.dataToBitMap(t,this._bitmapInfo);e=yp(i,this._bitmapInfo,this._options.skipRescale),i=null}catch(i){this._handleError(i);return}this.emit("parsed",e)}});var za=y(($g,Ga)=>{"use strict";var Ke=Yt();Ga.exports=function(t,e,i,r){let n=[Ke.COLORTYPE_COLOR_ALPHA,Ke.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let d=function(){let m=new ArrayBuffer(2);return new DataView(m).setInt16(0,256,!0),new Int16Array(m)[0]!==256}();if(r.bitDepth===8||r.bitDepth===16&&d)return t}let s=r.bitDepth!==16?t:new Uint16Array(t.buffer),o=255,l=Ke.COLORTYPE_TO_BPP_MAP[r.inputColorType];l===4&&!r.inputHasAlpha&&(l=3);let a=Ke.COLORTYPE_TO_BPP_MAP[r.colorType];r.bitDepth===16&&(o=65535,a*=2);let c=Buffer.alloc(e*i*a),u=0,f=0,h=r.bgColor||{};h.red===void 0&&(h.red=o),h.green===void 0&&(h.green=o),h.blue===void 0&&(h.blue=o);function p(){let d,m,v,E=o;switch(r.inputColorType){case Ke.COLORTYPE_COLOR_ALPHA:E=s[u+3],d=s[u],m=s[u+1],v=s[u+2];break;case Ke.COLORTYPE_COLOR:d=s[u],m=s[u+1],v=s[u+2];break;case Ke.COLORTYPE_ALPHA:E=s[u+1],d=s[u],m=d,v=d;break;case Ke.COLORTYPE_GRAYSCALE:d=s[u],m=d,v=d;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(n||(E/=o,d=Math.min(Math.max(Math.round((1-E)*h.red+E*d),0),o),m=Math.min(Math.max(Math.round((1-E)*h.green+E*m),0),o),v=Math.min(Math.max(Math.round((1-E)*h.blue+E*v),0),o))),{red:d,green:m,blue:v,alpha:E}}for(let d=0;d{"use strict";var Wa=Zr();function bp(t,e,i,r,n){for(let s=0;s=s?t[e+o-s]:0,a=t[e+o]-l;r[n+o]=a}}function Sp(t,e,i,r){let n=0;for(let s=0;s=r?t[e+s-r]:0,l=t[e+s]-o;n+=Math.abs(l)}return n}function kp(t,e,i,r,n){for(let s=0;s0?t[e+s-i]:0,l=t[e+s]-o;r[n+s]=l}}function Cp(t,e,i){let r=0,n=e+i;for(let s=e;s0?t[s-i]:0,l=t[s]-o;r+=Math.abs(l)}return r}function Op(t,e,i,r,n,s){for(let o=0;o=s?t[e+o-s]:0,a=e>0?t[e+o-i]:0,c=t[e+o]-(l+a>>1);r[n+o]=c}}function Ip(t,e,i,r){let n=0;for(let s=0;s=r?t[e+s-r]:0,l=e>0?t[e+s-i]:0,a=t[e+s]-(o+l>>1);n+=Math.abs(a)}return n}function Tp(t,e,i,r,n,s){for(let o=0;o=s?t[e+o-s]:0,a=e>0?t[e+o-i]:0,c=e>0&&o>=s?t[e+o-(i+s)]:0,u=t[e+o]-Wa(l,a,c);r[n+o]=u}}function Ap(t,e,i,r){let n=0;for(let s=0;s=r?t[e+s-r]:0,l=e>0?t[e+s-i]:0,a=e>0&&s>=r?t[e+s-(i+r)]:0,c=t[e+s]-Wa(o,l,a);n+=Math.abs(c)}return n}var Rp={0:bp,1:Ep,2:kp,3:Op,4:Tp},Bp={0:wp,1:Sp,2:Cp,3:Ip,4:Ap};Ya.exports=function(t,e,i,r,n){let s;if(!("filterType"in r)||r.filterType===-1)s=[0,1,2,3,4];else if(typeof r.filterType=="number")s=[r.filterType];else throw new Error("unrecognised filter types");r.bitDepth===16&&(n*=2);let o=e*n,l=0,a=0,c=Buffer.alloc((o+1)*i),u=s[0];for(let f=0;f1){let h=1/0;for(let p=0;p{"use strict";var Ue=Yt(),Lp=en(),Pp=za(),Fp=Ka(),Np=require("zlib"),pt=Za.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32*1024,t.deflateLevel=t.deflateLevel!=null?t.deflateLevel:9,t.deflateStrategy=t.deflateStrategy!=null?t.deflateStrategy:3,t.inputHasAlpha=t.inputHasAlpha!=null?t.inputHasAlpha:!0,t.deflateFactory=t.deflateFactory||Np.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType=typeof t.colorType=="number"?t.colorType:Ue.COLORTYPE_COLOR_ALPHA,t.inputColorType=typeof t.inputColorType=="number"?t.inputColorType:Ue.COLORTYPE_COLOR_ALPHA,[Ue.COLORTYPE_GRAYSCALE,Ue.COLORTYPE_COLOR,Ue.COLORTYPE_COLOR_ALPHA,Ue.COLORTYPE_ALPHA].indexOf(t.colorType)===-1)throw new Error("option color type:"+t.colorType+" is not supported at present");if([Ue.COLORTYPE_GRAYSCALE,Ue.COLORTYPE_COLOR,Ue.COLORTYPE_COLOR_ALPHA,Ue.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1)throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(t.bitDepth!==8&&t.bitDepth!==16)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};pt.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};pt.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};pt.prototype.filterData=function(t,e,i){let r=Pp(t,e,i,this._options),n=Ue.COLORTYPE_TO_BPP_MAP[this._options.colorType];return Fp(r,e,i,this._options,n)};pt.prototype._packChunk=function(t,e){let i=e?e.length:0,r=Buffer.alloc(i+12);return r.writeUInt32BE(i,0),r.writeUInt32BE(t,4),e&&e.copy(r,8),r.writeInt32BE(Lp.crc32(r.slice(4,r.length-4)),r.length-4),r};pt.prototype.packGAMA=function(t){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(t*Ue.GAMMA_DIVISION),0),this._packChunk(Ue.TYPE_gAMA,e)};pt.prototype.packIHDR=function(t,e){let i=Buffer.alloc(13);return i.writeUInt32BE(t,0),i.writeUInt32BE(e,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(Ue.TYPE_IHDR,i)};pt.prototype.packIDAT=function(t){return this._packChunk(Ue.TYPE_IDAT,t)};pt.prototype.packIEND=function(){return this._packChunk(Ue.TYPE_IEND,null)}});var el=y((Wg,Qa)=>{"use strict";var Mp=require("util"),Xa=require("stream"),Up=Yt(),Dp=on(),Ja=Qa.exports=function(t){Xa.call(this);let e=t||{};this._packer=new Dp(e),this._deflate=this._packer.createDeflate(),this.readable=!0};Mp.inherits(Ja,Xa);Ja.prototype.pack=function(t,e,i,r){this.emit("data",Buffer.from(Up.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,i)),r&&this.emit("data",this._packer.packGAMA(r));let n=this._packer.filterData(t,e,i);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(s){this.emit("data",this._packer.packIDAT(s))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(n)}});var ol=y((bi,sl)=>{"use strict";var tl=require("assert").ok,Kt=require("zlib"),jp=require("util"),il=require("buffer").kMaxLength;function St(t){if(!(this instanceof St))return new St(t);t&&t.chunkSize=0,"have should not go down"),v>0){let E=r._buffer.slice(r._offset,r._offset+v);if(r._offset+=v,E.length>o&&(E=E.slice(0,o)),a.push(E),c+=E.length,o-=E.length,o===0)return!1}return(m===0||r._offset>=r._chunkSize)&&(s=r._chunkSize,r._offset=0,r._buffer=Buffer.allocUnsafe(r._chunkSize)),m===0?(l+=n-d,n=d,!0):!1}tl(this._handle,"zlib binding closed");let h;do h=this._handle.writeSync(e,t,l,n,this._buffer,this._offset,s),h=h||this._writeState;while(!this._hadError&&f(h[0],h[1]));if(this._hadError)throw u;if(c>=il)throw rl(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+il.toString(16)+" bytes");let p=Buffer.concat(a,c);return rl(this),p};jp.inherits(St,Kt.Inflate);function Hp(t,e){if(typeof e=="string"&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let i=t._finishFlushFlag;return i==null&&(i=Kt.Z_FINISH),t._processChunk(e,i)}function nl(t,e){return Hp(new St(e),t)}sl.exports=bi=nl;bi.Inflate=St;bi.createInflate=qp;bi.inflateSync=nl});var an=y((Yg,ll)=>{"use strict";var al=ll.exports=function(t){this._buffer=t,this._reads=[]};al.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};al.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(this._buffer.length&&(this._buffer.length>=t.length||t.allowLess)){this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}else break}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}});var ul=y(cl=>{"use strict";var Vp=an(),$p=Xr();cl.process=function(t,e){let i=[],r=new Vp(t);return new $p(e,{read:r.read.bind(r),write:function(s){i.push(s)},complete:function(){}}).start(),r.process(),Buffer.concat(i)}});var dl=y((Zg,pl)=>{"use strict";var fl=!0,hl=require("zlib"),Gp=ol();hl.deflateSync||(fl=!1);var zp=an(),Wp=ul(),Yp=tn(),Kp=rn(),Zp=nn();pl.exports=function(t,e){if(!fl)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i;function r(C){i=C}let n;function s(C){n=C}function o(C){n.transColor=C}function l(C){n.palette=C}function a(){n.alpha=!0}let c;function u(C){c=C}let f=[];function h(C){f.push(C)}let p=new zp(t);if(new Yp(e,{read:p.read.bind(p),error:r,metadata:s,gamma:u,palette:l,transColor:o,inflateData:h,simpleTransparency:a}).start(),p.process(),i)throw i;let m=Buffer.concat(f);f.length=0;let v;if(n.interlace)v=hl.inflateSync(m);else{let _=((n.width*n.bpp*n.depth+7>>3)+1)*n.height;v=Gp(m,{chunkSize:_,maxLength:_})}if(m=null,!v||!v.length)throw new Error("bad png - invalid inflate data response");let E=Wp.process(v,n);m=null;let I=Kp.dataToBitMap(E,n);E=null;let w=Zp(I,n,e.skipRescale);return n.data=w,n.gamma=c||0,n}});var xl=y((Xg,vl)=>{"use strict";var ml=!0,gl=require("zlib");gl.deflateSync||(ml=!1);var Xp=Yt(),Jp=on();vl.exports=function(t,e){if(!ml)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i=e||{},r=new Jp(i),n=[];n.push(Buffer.from(Xp.PNG_SIGNATURE)),n.push(r.packIHDR(t.width,t.height)),t.gamma&&n.push(r.packGAMA(t.gamma));let s=r.filterData(t.data,t.width,t.height),o=gl.deflateSync(s,r.getDeflateOptions());if(s=null,!o||!o.length)throw new Error("bad png - invalid compressed data response");return n.push(r.packIDAT(o)),n.push(r.packIEND()),Buffer.concat(n)}});var _l=y(ln=>{"use strict";var Qp=dl(),ed=xl();ln.read=function(t,e){return Qp(t,e||{})};ln.write=function(t,e){return ed(t,e)}});var wl=y(bl=>{"use strict";var td=require("util"),yl=require("stream"),id=$a(),rd=el(),nd=_l(),qe=bl.PNG=function(t){yl.call(this),t=t||{},this.width=t.width|0,this.height=t.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new id(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new rd(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};td.inherits(qe,yl);qe.sync=nd;qe.prototype.pack=function(){return!this.data||!this.data.length?(this.emit("error","No data provided"),this):(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this)};qe.prototype.parse=function(t,e){if(e){let i,r;i=function(n){this.removeListener("error",r),this.data=n,e(null,this)}.bind(this),r=function(n){this.removeListener("parsed",i),e(n,null)}.bind(this),this.once("parsed",i),this.once("error",r)}return this.end(t),this};qe.prototype.write=function(t){return this._parser.write(t),!0};qe.prototype.end=function(t){this._parser.end(t)};qe.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)};qe.prototype._gamma=function(t){this.gamma=t};qe.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};qe.bitblt=function(t,e,i,r,n,s,o,l){if(i|=0,r|=0,n|=0,s|=0,o|=0,l|=0,i>t.width||r>t.height||i+n>t.width||r+s>t.height)throw new Error("bitblt reading outside image");if(o>e.width||l>e.height||o+n>e.width||l+s>e.height)throw new Error("bitblt writing outside image");for(let a=0;a{var Xi=class extends Error{constructor(e,i,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=e,this.nestedError=void 0}},cn=class extends Xi{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};un.CommanderError=Xi;un.InvalidArgumentError=cn});var Ji=y(hn=>{var{InvalidArgumentError:sd}=wi(),fn=class{constructor(e,i){switch(this.description=i||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,i){return i===this.defaultValue||!Array.isArray(i)?[e]:i.concat(e)}default(e,i){return this.defaultValue=e,this.defaultValueDescription=i,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e,this.parseArg=(i,r)=>{if(!e.includes(i))throw new sd(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(i,r):i},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function od(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}hn.Argument=fn;hn.humanReadableArgName=od});var dn=y(El=>{var{humanReadableArgName:ad}=Ji(),pn=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){let i=e.commands.filter(r=>!r._hidden);if(e._hasImplicitHelpCommand()){let[,r,n]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),s=e.createCommand(r).helpOption(!1);s.description(e._helpCommandDescription),n&&s.arguments(n),i.push(s)}return this.sortSubcommands&&i.sort((r,n)=>r.name().localeCompare(n.name())),i}visibleOptions(e){let i=e.options.filter(s=>!s.hidden),r=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),n=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(r||n){let s;r?n?s=e.createOption(e._helpFlags,e._helpDescription):s=e.createOption(e._helpShortFlag,e._helpDescription):s=e.createOption(e._helpLongFlag,e._helpDescription),i.push(s)}if(this.sortOptions){let s=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");i.sort((o,l)=>s(o).localeCompare(s(l)))}return i}visibleArguments(e){return e._argsDescription&&e._args.forEach(i=>{i.description=i.description||e._argsDescription[i.name()]||""}),e._args.find(i=>i.description)?e._args:[]}subcommandTerm(e){let i=e._args.map(r=>ad(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(i?" "+i:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,i){return i.visibleCommands(e).reduce((r,n)=>Math.max(r,i.subcommandTerm(n).length),0)}longestOptionTermLength(e,i){return i.visibleOptions(e).reduce((r,n)=>Math.max(r,i.optionTerm(n).length),0)}longestArgumentTermLength(e,i){return i.visibleArguments(e).reduce((r,n)=>Math.max(r,i.argumentTerm(n).length),0)}commandUsage(e){let i=e._name;e._aliases[0]&&(i=i+"|"+e._aliases[0]);let r="";for(let n=e.parent;n;n=n.parent)r=n.name()+" "+r;return r+i+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.description()}optionDescription(e){let i=[];return e.argChoices&&!e.negate&&i.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&!e.negate&&i.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.envVar!==void 0&&i.push(`env: ${e.envVar}`),i.length>0?`${e.description} (${i.join(", ")})`:e.description}argumentDescription(e){let i=[];if(e.argChoices&&i.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&i.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),i.length>0){let r=`(${i.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,i){let r=i.padWidth(e,i),n=i.helpWidth||80,s=2,o=2;function l(d,m){if(m){let v=`${d.padEnd(r+o)}${m}`;return i.wrap(v,n-s,r+o)}return d}function a(d){return d.join(` -`).replace(/^/gm," ".repeat(s))}let c=[`Usage: ${i.commandUsage(e)}`,""],u=i.commandDescription(e);u.length>0&&(c=c.concat([u,""]));let f=i.visibleArguments(e).map(d=>l(i.argumentTerm(d),i.argumentDescription(d)));f.length>0&&(c=c.concat(["Arguments:",a(f),""]));let h=i.visibleOptions(e).map(d=>l(i.optionTerm(d),i.optionDescription(d)));h.length>0&&(c=c.concat(["Options:",a(h),""]));let p=i.visibleCommands(e).map(d=>l(i.subcommandTerm(d),i.subcommandDescription(d)));return p.length>0&&(c=c.concat(["Commands:",a(p),""])),c.join(` -`)}padWidth(e,i){return Math.max(i.longestOptionTermLength(e,i),i.longestSubcommandTermLength(e,i),i.longestArgumentTermLength(e,i))}wrap(e,i,r,n=40){if(e.match(/[\n]\s+/))return e;let s=i-r;if(s(f.slice(-1)===` -`&&(f=f.slice(0,f.length-1)),(h>0?a:"")+f.trimRight())).join(` -`)}};El.Help=pn});var vn=y(gn=>{var{InvalidArgumentError:ld}=wi(),mn=class{constructor(e,i){this.flags=e,this.description=i||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=Sl(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0}default(e,i){return this.defaultValue=e,this.defaultValueDescription=i,this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,i){return i===this.defaultValue||!Array.isArray(i)?[e]:i.concat(e)}choices(e){return this.argChoices=e,this.parseArg=(i,r)=>{if(!e.includes(i))throw new ld(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(i,r):i},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return cd(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}};function cd(t){return t.split("-").reduce((e,i)=>e+i[0].toUpperCase()+i.slice(1))}function Sl(t){let e,i,r=t.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(e=r.shift()),i=r.shift(),!e&&/^-[^-]$/.test(i)&&(e=i,i=void 0),{shortFlag:e,longFlag:i}}gn.Option=mn;gn.splitOptionFlags=Sl});var Cl=y(kl=>{function ud(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let i=[];for(let r=0;r<=t.length;r++)i[r]=[r];for(let r=0;r<=e.length;r++)i[0][r]=r;for(let r=1;r<=e.length;r++)for(let n=1;n<=t.length;n++){let s=1;t[n-1]===e[r-1]?s=0:s=1,i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+s),n>1&&r>1&&t[n-1]===e[r-2]&&t[n-2]===e[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+1))}return i[t.length][e.length]}function fd(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let i=t.startsWith("--");i&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let r=[],n=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let l=ud(t,o),a=Math.max(t.length,o.length);(a-l)/a>s&&(lo.localeCompare(l)),i&&(r=r.map(o=>`--${o}`)),r.length>1?` +`);if(d===-1){As("have not received end of HTTP headers yet..."),s();return}let g=f.slice(0,d).toString("ascii").split(`\r +`),m=g.shift();if(!m)return t.destroy(),i(new Error("No header received from proxy CONNECT response"));let v=m.split(" "),b=+v[1],_=v.slice(2).join(" "),S={};for(let O of g){if(!O)continue;let k=O.indexOf(":");if(k===-1)return t.destroy(),i(new Error(`Invalid header from proxy CONNECT response: "${O}"`));let E=O.slice(0,k).toLowerCase(),R=O.slice(k+1).trimStart(),T=S[E];typeof T=="string"?S[E]=[T,R]:Array.isArray(T)?T.push(R):S[E]=R}As("got proxy server response: %o %o",m,S),o(),e({connect:{statusCode:b,statusText:_,headers:S},buffered:f})}t.on("error",l),t.on("end",a),s()})}Er.parseProxyResponse=Fw});var Hh=w(At=>{"use strict";var Dw=At&&At.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),jw=At&&At.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$h=At&&At.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&Dw(e,t,i);return jw(e,t),e},Vh=At&&At.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(At,"__esModule",{value:!0});At.HttpsProxyAgent=void 0;var Ua=$h(require("net")),jh=$h(require("tls")),Uw=Vh(require("assert")),$w=Vh(rn()),Vw=ja(),Hw=require("url"),Gw=Dh(),an=(0,$w.default)("https-proxy-agent"),Is=class extends Vw.Agent{constructor(e,i){var s;super(i),this.options={path:void 0},this.proxy=typeof e=="string"?new Hw.URL(e):e,this.proxyHeaders=(s=i==null?void 0:i.headers)!=null?s:{},an("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),n=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...i?Uh(i,"headers"):null,host:r,port:n}}async connect(e,i){let{proxy:r}=this;if(!i.host)throw new TypeError('No "host" provided');let n;if(r.protocol==="https:"){an("Creating `tls.Socket`: %o",this.connectOpts);let d=this.connectOpts.servername||this.connectOpts.host;n=jh.connect({...this.connectOpts,servername:d})}else an("Creating `net.Socket`: %o",this.connectOpts),n=Ua.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=Ua.isIPv6(i.host)?`[${i.host}]`:i.host,a=`CONNECT ${o}:${i.port} HTTP/1.1\r +`;if(r.username||r.password){let d=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}s.Host=`${o}:${i.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(s))a+=`${d}: ${s[d]}\r +`;let l=(0,Gw.parseProxyResponse)(n);n.write(`${a}\r +`);let{connect:c,buffered:u}=await l;if(e.emit("proxyConnect",c),this.emit("proxyConnect",c,e),c.statusCode===200){if(e.once("socket",Yw),i.secureEndpoint){an("Upgrading socket connection to TLS");let d=i.servername||i.host;return jh.connect({...Uh(i,"host","path","port"),socket:n,servername:d})}return n}n.destroy();let f=new Ua.Socket({writable:!1});return f.readable=!0,e.once("socket",d=>{an("Replaying proxy buffer for failed request"),(0,Uw.default)(d.listenerCount("data")>0),d.push(u),d.push(null)}),f}};Is.protocols=["http","https"];At.HttpsProxyAgent=Is;function Yw(t){t.resume()}function Uh(t,...e){let i={},r;for(r in t)e.includes(r)||(i[r]=t[r]);return i}});var Wh=w((KI,Ns)=>{var Yh=Yh||function(t){return Buffer.from(t).toString("base64")};function Ww(t){var e=this,i=Math.round,r=Math.floor,n=new Array(64),s=new Array(64),o=new Array(64),a=new Array(64),l,c,u,f,d=new Array(65535),g=new Array(65535),m=new Array(64),v=new Array(64),b=[],_=0,S=7,O=new Array(64),k=new Array(64),E=new Array(64),R=new Array(256),T=new Array(2048),A,C=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],L=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],P=[0,1,2,3,4,5,6,7,8,9,10,11],U=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],F=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],H=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],j=[0,1,2,3,4,5,6,7,8,9,10,11],V=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Q(I){for(var Z=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],te=0;te<64;te++){var ee=r((Z[te]*I+50)/100);ee<1?ee=1:ee>255&&(ee=255),n[C[te]]=ee}for(var le=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],ce=0;ce<64;ce++){var _e=r((le[ce]*I+50)/100);_e<1?_e=1:_e>255&&(_e=255),s[C[ce]]=_e}for(var we=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Be=0,Te=0;Te<8;Te++)for(var D=0;D<8;D++)o[Be]=1/(n[C[Be]]*we[Te]*we[D]*8),a[Be]=1/(s[C[Be]]*we[Te]*we[D]*8),Be++}function Y(I,Z){for(var te=0,ee=0,le=new Array,ce=1;ce<=16;ce++){for(var _e=1;_e<=I[ce];_e++)le[Z[ee]]=[],le[Z[ee]][0]=te,le[Z[ee]][1]=ce,ee++,te++;te*=2}return le}function de(){l=Y(L,P),c=Y(H,j),u=Y(U,F),f=Y(V,W)}function ae(){for(var I=1,Z=2,te=1;te<=15;te++){for(var ee=I;ee>0]=38470*I,T[I+512>>0]=7471*I+32768,T[I+768>>0]=-11059*I,T[I+1024>>0]=-21709*I,T[I+1280>>0]=32768*I+8421375,T[I+1536>>0]=-27439*I,T[I+1792>>0]=-5329*I}function ue(I){for(var Z=I[0],te=I[1]-1;te>=0;)Z&1<>8&255),N(I&255)}function ke(I,Z){var te,ee,le,ce,_e,we,Be,Te,D=0,J,se=8,Ie=64;for(J=0;J0?gr+.5|0:gr-.5|0;return m}function be(){X(65504),X(16),N(74),N(70),N(73),N(70),N(0),N(1),N(1),N(0),X(1),X(1),N(0),N(0)}function ge(I){if(I){X(65505),I[0]===69&&I[1]===120&&I[2]===105&&I[3]===102?X(I.length+2):(X(I.length+5+2),N(69),N(120),N(105),N(102),N(0));for(var Z=0;Z{if(typeof Z=="string"){X(65534);var te=Z.length;X(te+2);var ee;for(ee=0;ee0&&v[oe]==0;oe--);if(oe==0)return ue(ce),te;for(var me=1,Ee;me<=oe;){for(var ie=me;v[me]==0&&me<=oe;++me);var xe=me-ie;if(xe>=Be){Ee=xe>>4;for(var Ue=1;Ue<=Ee;++Ue)ue(_e);xe=xe&15}we=32767+v[me],ue(le[(xe<<4)+g[we]]),ue(d[we]),me++}return oe!=Te&&ue(ce),te}function he(){for(var I=String.fromCharCode,Z=0;Z<256;Z++)R[Z]=I(Z)}this.encode=function(I,Z){var te=new Date().getTime();Z&&ft(Z),b=new Array,_=0,S=7,X(65496),be(),$(I.comments),ge(I.exifBuffer),fe(),ve(I.width,I.height),K(),Ce();var ee=0,le=0,ce=0;_=0,S=7,this.encode.displayName="_encode_";for(var _e=I.data,we=I.width,Be=I.height,Te=we*4,D=we*3,J,se=0,Ie,oe,me,Ee,ie,xe,Ue,Ae;se>3,xe=(Ae&7)*4,ie=Ee+Ue*Te+xe,se+Ue>=Be&&(ie-=Te*(se+1+Ue-Be)),J+xe>=Te&&(ie-=J+xe-Te+4),Ie=_e[ie++],oe=_e[ie++],me=_e[ie++],O[Ae]=(T[Ie]+T[oe+256>>0]+T[me+512>>0]>>16)-128,k[Ae]=(T[Ie+768>>0]+T[oe+1024>>0]+T[me+1280>>0]>>16)-128,E[Ae]=(T[Ie+1280>>0]+T[oe+1536>>0]+T[me+1792>>0]>>16)-128;ee=re(O,o,ee,l,u),le=re(k,a,le,c,f),ce=re(E,a,ce,c,f),J+=32}se+=8}if(S>=0){var ht=[];ht[1]=S+1,ht[0]=(1<100&&(I=100),A!=I){var Z=0;I<50?Z=Math.floor(5e3/I):Z=Math.floor(200-I*2),Q(Z),A=I}}function yt(){var I=new Date().getTime();t||(t=50),he(),de(),ae(),ne(),ft(t);var Z=new Date().getTime()-I}yt()}typeof Ns!="undefined"?Ns.exports=Gh:typeof window!="undefined"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=Gh);function Gh(t,e){typeof e=="undefined"&&(e=50);var i=new Ww(e),r=i.encode(t,e);return{data:r,width:t.width,height:t.height}}});var Kh=w((JI,Va)=>{var $a=function(){"use strict";var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),i=4017,r=799,n=3406,s=2276,o=1567,a=3784,l=5793,c=2896;function u(){}function f(S,O){for(var k=0,E=[],R,T,A=16;A>0&&!S[A-1];)A--;E.push({children:[],index:0});var C=E[0],L;for(R=0;R0;){if(E.length===0)throw new Error("Could not recreate Huffman Table");C=E.pop()}for(C.index++,E.push(C);E.length<=R;)E.push(L={children:[],index:0}),C.children[C.index]=L.children,C=L;k++}R+10)return ae--,de>>ae&1;if(de=S[O++],de==255){var D=S[O++];if(D)throw new Error("unexpected marker: "+(de<<8|D).toString(16))}return ae=7,de>>>7}function ue(D){for(var J=D,se;(se=ne())!==null;){if(J=J[se],typeof J=="number")return J;if(typeof J!="object")throw new Error("invalid huffman sequence")}return null}function N(D){for(var J=0;D>0;){var se=ne();if(se===null)return;J=J<<1|se,D--}return J}function X(D){var J=N(D);return J>=1<>4;if(Ee===0){if(ie<15)break;oe+=16;continue}oe+=ie;var xe=e[oe];J[xe]=X(Ee),oe++}}function be(D,J){var se=ue(D.huffmanTableDC),Ie=se===0?0:X(se)<0){ve--;return}for(var se=T,Ie=A;se<=Ie;){var oe=ue(D.huffmanTableAC),me=oe&15,Ee=oe>>4;if(me===0){if(Ee<15){ve=N(Ee)+(1<>4;if(xe===0)oe<15?(ve=N(oe)+(1<=65488&&_e<=65495)O+=2;else break}return O-Y}function g(S,O){var k=[],E=O.blocksPerLine,R=O.blocksPerColumn,T=E<<3,A=new Int32Array(64),C=new Uint8Array(64);function L(Y,de,ae){var ne=O.quantizationTable,ue,N,X,ke,be,ge,ve,fe,K,$=ae,Ce;for(Ce=0;Ce<64;Ce++)$[Ce]=Y[Ce]*ne[Ce];for(Ce=0;Ce<8;++Ce){var re=8*Ce;if($[1+re]==0&&$[2+re]==0&&$[3+re]==0&&$[4+re]==0&&$[5+re]==0&&$[6+re]==0&&$[7+re]==0){K=l*$[0+re]+512>>10,$[0+re]=K,$[1+re]=K,$[2+re]=K,$[3+re]=K,$[4+re]=K,$[5+re]=K,$[6+re]=K,$[7+re]=K;continue}ue=l*$[0+re]+128>>8,N=l*$[4+re]+128>>8,X=$[2+re],ke=$[6+re],be=c*($[1+re]-$[7+re])+128>>8,fe=c*($[1+re]+$[7+re])+128>>8,ge=$[3+re]<<4,ve=$[5+re]<<4,K=ue-N+1>>1,ue=ue+N+1>>1,N=K,K=X*a+ke*o+128>>8,X=X*o-ke*a+128>>8,ke=K,K=be-ve+1>>1,be=be+ve+1>>1,ve=K,K=fe+ge+1>>1,ge=fe-ge+1>>1,fe=K,K=ue-ke+1>>1,ue=ue+ke+1>>1,ke=K,K=N-X+1>>1,N=N+X+1>>1,X=K,K=be*s+fe*n+2048>>12,be=be*n-fe*s+2048>>12,fe=K,K=ge*r+ve*i+2048>>12,ge=ge*i-ve*r+2048>>12,ve=K,$[0+re]=ue+fe,$[7+re]=ue-fe,$[1+re]=N+ve,$[6+re]=N-ve,$[2+re]=X+ge,$[5+re]=X-ge,$[3+re]=ke+be,$[4+re]=ke-be}for(Ce=0;Ce<8;++Ce){var he=Ce;if($[8+he]==0&&$[16+he]==0&&$[24+he]==0&&$[32+he]==0&&$[40+he]==0&&$[48+he]==0&&$[56+he]==0){K=l*ae[Ce+0]+8192>>14,$[0+he]=K,$[8+he]=K,$[16+he]=K,$[24+he]=K,$[32+he]=K,$[40+he]=K,$[48+he]=K,$[56+he]=K;continue}ue=l*$[0+he]+2048>>12,N=l*$[32+he]+2048>>12,X=$[16+he],ke=$[48+he],be=c*($[8+he]-$[56+he])+2048>>12,fe=c*($[8+he]+$[56+he])+2048>>12,ge=$[24+he],ve=$[40+he],K=ue-N+1>>1,ue=ue+N+1>>1,N=K,K=X*a+ke*o+2048>>12,X=X*o-ke*a+2048>>12,ke=K,K=be-ve+1>>1,be=be+ve+1>>1,ve=K,K=fe+ge+1>>1,ge=fe-ge+1>>1,fe=K,K=ue-ke+1>>1,ue=ue+ke+1>>1,ke=K,K=N-X+1>>1,N=N+X+1>>1,X=K,K=be*s+fe*n+2048>>12,be=be*n-fe*s+2048>>12,fe=K,K=ge*r+ve*i+2048>>12,ge=ge*i-ve*r+2048>>12,ve=K,$[0+he]=ue+fe,$[56+he]=ue-fe,$[8+he]=N+ve,$[48+he]=N-ve,$[16+he]=X+ge,$[40+he]=X-ge,$[24+he]=ke+be,$[32+he]=ke-be}for(Ce=0;Ce<64;++Ce){var ft=128+($[Ce]+8>>4);de[Ce]=ft<0?0:ft>255?255:ft}}_(T*R*8);for(var P,U,F=0;F255?255:S}u.prototype={load:function(O){var k=new XMLHttpRequest;k.open("GET",O,!0),k.responseType="arraybuffer",k.onload=function(){var E=new Uint8Array(k.response||k.mozResponseArrayBuffer);this.parse(E),this.onload&&this.onload()}.bind(this),k.send(null)},parse:function(O){var k=this.opts.maxResolutionInMP*1e3*1e3,E=0,R=O.length;function T(){var ie=O[E]<<8|O[E+1];return E+=2,ie}function A(){var ie=T(),xe=O.subarray(E,E+ie-2);return E+=xe.length,xe}function C(ie){var xe=1,Ue=1,Ae,ht;for(ht in ie.components)ie.components.hasOwnProperty(ht)&&(Ae=ie.components[ht],xe>4)if(ge>>4===1)for(ne=0;ne<64;ne++){var fe=e[ne];ve[fe]=T()}else throw new Error("DQT: invalid table spec");else for(ne=0;ne<64;ne++){var fe=e[ne];ve[fe]=O[E++]}j[ge&15]=ve}break;case 65472:case 65473:case 65474:T(),F={},F.extended=Y===65473,F.progressive=Y===65474,F.precision=O[E++],F.scanLines=T(),F.samplesPerLine=T(),F.components={},F.componentsOrder=[];var K=F.scanLines*F.samplesPerLine;if(K>k){var $=Math.ceil((K-k)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${$}MP`)}var Ce=O[E++],re,he=0,ft=0;for(ae=0;ae>4,I=O[E+1]&15,Z=O[E+2];if(yt<=0||I<=0)throw new Error("Invalid sampling factor, expected values above 0");F.componentsOrder.push(re),F.components[re]={h:yt,v:I,quantizationIdx:Z},E+=3}C(F),V.push(F);break;case 65476:var te=T();for(ae=2;ae>4?W:Q)[ee&15]=f(le,_e)}break;case 65501:T(),H=T();break;case 65500:T(),T();break;case 65498:var we=T(),Be=O[E++],Te=[],D;for(ae=0;ae>4],D.huffmanTableAC=W[J&15],Te.push(D)}var se=O[E++],Ie=O[E++],oe=O[E++],me=d(O,E,F,Te,H,se,Ie,oe>>4,oe&15,this.opts);E+=me;break;case 65535:O[E]!==255&&E--;break;default:if(O[E-3]==255&&O[E-2]>=192&&O[E-2]<=254){E-=3;break}else if(Y===224||Y==225){if(de!==-1)throw new Error(`first unknown JPEG marker at offset ${de.toString(16)}, second unknown JPEG marker ${Y.toString(16)} at offset ${(E-1).toString(16)}`);de=E-1;let ie=T();if(O[E+ie-2]===255){E+=ie-2;break}}throw new Error("unknown JPEG marker "+Y.toString(16))}Y=T()}if(V.length!=1)throw new Error("only single frame JPEGs supported");for(var ae=0;aeb){var k=Math.ceil((O-b)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${k}MB`)}v=O}return u.resetMaxMemoryUsage=function(S){v=0,b=S},u.getBytesAllocated=function(){return v},u.requestMemoryAllocation=_,u}();typeof Va!="undefined"?Va.exports=zh:typeof window!="undefined"&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=zh);function zh(t,e={}){var i={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},r={...i,...e},n=new Uint8Array(t),s=new $a;s.opts=r,$a.resetMaxMemoryUsage(r.maxMemoryUsageInMB*1024*1024),s.parse(n);var o=r.formatAsRGBA?4:3,a=s.width*s.height*o;try{$a.requestMemoryAllocation(a);var l={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:r.useTArray?new Uint8Array(a):Buffer.alloc(a)};s.comments.length>0&&(l.comments=s.comments)}catch(c){throw c instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+a):c instanceof ReferenceError&&c.message==="Buffer is not defined"?new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true"):c}return s.copyToImageData(l,r.formatAsRGBA),l}});var Zh=w((ZI,Jh)=>{var zw=Wh(),Kw=Kh();Jh.exports={encode:zw,decode:Kw}});var Xh=w((QI,Qh)=>{"use strict";function Ls(){this._types=Object.create(null),this._extensions=Object.create(null);for(let t=0;t{ep.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}});var rp=w((e2,ip)=>{ip.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}});var sp=w((t2,np)=>{"use strict";var Jw=Xh();np.exports=new Jw(tp(),rp())});var ap=w((i2,op)=>{op.exports=function(t,e){for(var i=[],r=0;r{"use strict";fp.exports=cp;function cp(t,e,i){t instanceof RegExp&&(t=lp(t,i)),e instanceof RegExp&&(e=lp(e,i));var r=up(t,e,i);return r&&{start:r[0],end:r[1],pre:i.slice(0,r[0]),body:i.slice(r[0]+t.length,r[1]),post:i.slice(r[1]+e.length)}}function lp(t,e){var i=e.match(t);return i?i[0]:null}cp.range=up;function up(t,e,i){var r,n,s,o,a,l=i.indexOf(t),c=i.indexOf(e,l+1),u=l;if(l>=0&&c>0){if(t===e)return[l,c];for(r=[],s=i.length;u>=0&&!a;)u==l?(r.push(u),l=i.indexOf(t,u+1)):r.length==1?a=[r.pop(),c]:(n=r.pop(),n=0?l:c;r.length&&(a=[s,o])}return a}});var _p=w((n2,bp)=>{var Qw=ap(),pp=hp();bp.exports=t1;var dp="\0SLASH"+Math.random()+"\0",mp="\0OPEN"+Math.random()+"\0",Ga="\0CLOSE"+Math.random()+"\0",gp="\0COMMA"+Math.random()+"\0",vp="\0PERIOD"+Math.random()+"\0";function Ha(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function Xw(t){return t.split("\\\\").join(dp).split("\\{").join(mp).split("\\}").join(Ga).split("\\,").join(gp).split("\\.").join(vp)}function e1(t){return t.split(dp).join("\\").split(mp).join("{").split(Ga).join("}").split(gp).join(",").split(vp).join(".")}function yp(t){if(!t)return[""];var e=[],i=pp("{","}",t);if(!i)return t.split(",");var r=i.pre,n=i.body,s=i.post,o=r.split(",");o[o.length-1]+="{"+n+"}";var a=yp(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function t1(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),kr(Xw(t),!0).map(e1)):[]}function i1(t){return"{"+t+"}"}function r1(t){return/^-?0\d/.test(t)}function n1(t,e){return t<=e}function s1(t,e){return t>=e}function kr(t,e){var i=[],r=pp("{","}",t);if(!r||/\$$/.test(r.pre))return[t];var n=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),s=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),o=n||s,a=r.body.indexOf(",")>=0;if(!o&&!a)return r.post.match(/,.*\}/)?(t=r.pre+"{"+r.body+Ga+r.post,kr(t)):[t];var l;if(o)l=r.body.split(/\.\./);else if(l=yp(r.body),l.length===1&&(l=kr(l[0],!1).map(i1),l.length===1)){var u=r.post.length?kr(r.post,!1):[""];return u.map(function(P){return r.pre+l[0]+P})}var c=r.pre,u=r.post.length?kr(r.post,!1):[""],f;if(o){var d=Ha(l[0]),g=Ha(l[1]),m=Math.max(l[0].length,l[1].length),v=l.length==3?Math.abs(Ha(l[2])):1,b=n1,_=g0){var R=new Array(E+1).join("0");O<0?k="-"+R+k.slice(1):k=R+k}}f.push(k)}}else f=Qw(l,function(L){return kr(L,!1)});for(var T=0;T{kp.exports=St;St.Minimatch=Qe;var ln=function(){try{return require("path")}catch{}}()||{sep:"/"};St.sep=ln.sep;var za=St.GLOBSTAR=Qe.GLOBSTAR={},o1=_p(),wp={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},Ya="[^/]",Wa=Ya+"*?",a1="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",l1="(?:(?!(?:\\/|^)\\.).)*?",xp=c1("().*{}+?[]^$\\!");function c1(t){return t.split("").reduce(function(e,i){return e[i]=!0,e},{})}var Sp=/\/+/;St.filter=u1;function u1(t,e){return e=e||{},function(i,r,n){return St(i,t,e)}}function yi(t,e){e=e||{};var i={};return Object.keys(t).forEach(function(r){i[r]=t[r]}),Object.keys(e).forEach(function(r){i[r]=e[r]}),i}St.defaults=function(t){if(!t||typeof t!="object"||!Object.keys(t).length)return St;var e=St,i=function(n,s,o){return e(n,s,yi(t,o))};return i.Minimatch=function(n,s){return new e.Minimatch(n,yi(t,s))},i.Minimatch.defaults=function(n){return e.defaults(yi(t,n)).Minimatch},i.filter=function(n,s){return e.filter(n,yi(t,s))},i.defaults=function(n){return e.defaults(yi(t,n))},i.makeRe=function(n,s){return e.makeRe(n,yi(t,s))},i.braceExpand=function(n,s){return e.braceExpand(n,yi(t,s))},i.match=function(r,n,s){return e.match(r,n,yi(t,s))},i};Qe.defaults=function(t){return St.defaults(t).Minimatch};function St(t,e,i){return Rs(e),i||(i={}),!i.nocomment&&e.charAt(0)==="#"?!1:new Qe(e,i).match(t)}function Qe(t,e){if(!(this instanceof Qe))return new Qe(t,e);Rs(t),e||(e={}),t=t.trim(),!e.allowWindowsEscape&&ln.sep!=="/"&&(t=t.split(ln.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}Qe.prototype.debug=function(){};Qe.prototype.make=f1;function f1(){var t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate();var i=this.globSet=this.braceExpand();e.debug&&(this.debug=function(){console.error.apply(console,arguments)}),this.debug(this.pattern,i),i=this.globParts=i.map(function(r){return r.split(Sp)}),this.debug(this.pattern,i),i=i.map(function(r,n,s){return r.map(this.parse,this)},this),this.debug(this.pattern,i),i=i.filter(function(r){return r.indexOf(!1)===-1}),this.debug(this.pattern,i),this.set=i}Qe.prototype.parseNegate=h1;function h1(){var t=this.pattern,e=!1,i=this.options,r=0;if(!i.nonegate){for(var n=0,s=t.length;np1)throw new TypeError("pattern is too long")};Qe.prototype.parse=d1;var Bs={};function d1(t,e){Rs(t);var i=this.options;if(t==="**")if(i.noglobstar)t="*";else return za;if(t==="")return"";var r="",n=!!i.nocase,s=!1,o=[],a=[],l,c=!1,u=-1,f=-1,d=t.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",g=this;function m(){if(l){switch(l){case"*":r+=Wa,n=!0;break;case"?":r+=Ya,n=!0;break;default:r+="\\"+l;break}g.debug("clearStateChar %j %j",l,r),l=!1}}for(var v=0,b=t.length,_;v-1;A--){var C=a[A],L=r.slice(0,C.reStart),P=r.slice(C.reStart,C.reEnd-8),U=r.slice(C.reEnd-8,C.reEnd),F=r.slice(C.reEnd);U+=F;var H=L.split("(").length-1,j=F;for(v=0;v=0&&(s=e[o],!s);o--);for(o=0;o>> no match, partial?`,t,u,e,f),u===o))}var g;if(typeof l=="string"?(g=c===l,this.debug("string match",l,c,g)):(g=c.match(l),this.debug("pattern match",l,c,g)),!g)return!1}if(n===o&&s===a)return!0;if(n===o)return i;if(s===a)return n===o-1&&t[n]==="";throw new Error("wtf?")};function g1(t){return t.replace(/\\(.)/g,"$1")}function v1(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var Ja=w((o2,Tp)=>{"use strict";var Cp=require("fs"),Ka;function y1(){try{return Cp.statSync("/.dockerenv"),!0}catch{return!1}}function b1(){try{return Cp.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}Tp.exports=()=>(Ka===void 0&&(Ka=y1()||b1()),Ka)});var Np=w((a2,Za)=>{"use strict";var _1=require("os"),w1=require("fs"),Ap=Ja(),Ip=()=>{if(process.platform!=="linux")return!1;if(_1.release().toLowerCase().includes("microsoft"))return!Ap();try{return w1.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Ap():!1}catch{return!1}};process.env.__IS_WSL_TEST__?Za.exports=Ip:Za.exports=Ip()});var Bp=w((l2,Lp)=>{"use strict";Lp.exports=(t,e,i)=>{let r=n=>Object.defineProperty(t,e,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let n=i();return r(n),n},set(n){r(n)}}),t}});var jp=w((c2,Dp)=>{var x1=require("path"),S1=require("child_process"),{promises:Qa,constants:Fp}=require("fs"),Ps=Np(),E1=Ja(),Xa=Bp(),Rp=x1.join(__dirname,"xdg-open"),{platform:Or,arch:Pp}=process,k1=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let i="/etc/wsl.conf",r=!1;try{await Qa.access(i,Fp.F_OK),r=!0}catch{}if(!r)return t;let n=await Qa.readFile(i,{encoding:"utf8"}),s=/(?.*)/g.exec(n);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),Mp=async(t,e)=>{let i;for(let r of t)try{return await e(r)}catch(n){i=n}throw i},Ms=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return Mp(t.app,a=>Ms({...t,app:a}));let{name:e,arguments:i=[]}=t.app||{};if(i=[...i],Array.isArray(e))return Mp(e,a=>Ms({...t,app:{name:a,arguments:i}}));let r,n=[],s={};if(Or==="darwin")r="open",t.wait&&n.push("--wait-apps"),t.background&&n.push("--background"),t.newInstance&&n.push("--new"),e&&n.push("-a",e);else if(Or==="win32"||Ps&&!E1()){let a=await k1();r=Ps?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,n.push("-NoProfile","-NonInteractive","\u2013ExecutionPolicy","Bypass","-EncodedCommand"),Ps||(s.windowsVerbatimArguments=!0);let l=["Start"];t.wait&&l.push("-Wait"),e?(l.push(`"\`"${e}\`""`,"-ArgumentList"),t.target&&i.unshift(t.target)):t.target&&l.push(`"${t.target}"`),i.length>0&&(i=i.map(c=>`"\`"${c}\`""`),l.push(i.join(","))),t.target=Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)r=e;else{let a=!__dirname||__dirname==="/",l=!1;try{await Qa.access(Rp,Fp.X_OK),l=!0}catch{}r=process.versions.electron||Or==="android"||a||!l?"xdg-open":Rp}i.length>0&&n.push(...i),t.wait||(s.stdio="ignore",s.detached=!0)}t.target&&n.push(t.target),Or==="darwin"&&i.length>0&&n.push("--args",...i);let o=S1.spawn(r,n,s);return t.wait?new Promise((a,l)=>{o.once("error",l),o.once("close",c=>{if(t.allowNonzeroExitCode&&c>0){l(new Error(`Exited with code ${c}`));return}a(o)})}):(o.unref(),o)},el=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return Ms({...e,target:t})},O1=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `name`");let{arguments:i=[]}=e||{};if(i!=null&&!Array.isArray(i))throw new TypeError("Expected `appArguments` as Array type");return Ms({...e,app:{name:t,arguments:i}})};function qp(t){if(typeof t=="string"||Array.isArray(t))return t;let{[Pp]:e}=t;if(!e)throw new Error(`${Pp} is not supported`);return e}function tl({[Or]:t},{wsl:e}){if(e&&Ps)return qp(e);if(!t)throw new Error(`${Or} is not supported`);return qp(t)}var qs={};Xa(qs,"chrome",()=>tl({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Xa(qs,"firefox",()=>tl({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Xa(qs,"edge",()=>tl({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));el.apps=qs;el.openApp=O1;Dp.exports=el});var il=w((u2,$p)=>{"use strict";var C1=require("util"),Up=require("stream"),Ut=$p.exports=function(){Up.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};C1.inherits(Ut,Up);Ut.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))};Ut.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let i;return Buffer.isBuffer(t)?i=t:i=Buffer.from(t,e||this._encoding),this._buffers.push(i),this._buffered+=i.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused};Ut.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(this._buffers.length===0?this._end():(this._buffers.push(null),this._process()))};Ut.prototype.destroySoon=Ut.prototype.end;Ut.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()};Ut.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))};Ut.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))};Ut.prototype._processRead=function(t){this._reads.shift();let e=0,i=0,r=Buffer.alloc(t.length);for(;e0&&this._buffers.splice(0,i),this._buffered-=t.length,t.func.call(this,r)};Ut.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else if(this._buffered>=t.length)this._processRead(t);else break}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}}});var nl=w(rl=>{"use strict";var bi=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];rl.getImagePasses=function(t,e){let i=[],r=t%8,n=e%8,s=(t-r)/8,o=(e-n)/8;for(let a=0;a0&&u>0&&i.push({width:c,height:u,index:a})}return i};rl.getInterlaceIterator=function(t){return function(e,i,r){let n=e%bi[r].x.length,s=(e-n)/bi[r].x.length*8+bi[r].x[n],o=i%bi[r].y.length,a=(i-o)/bi[r].y.length*8+bi[r].y[o];return s*4+a*t*4}}});var sl=w((h2,Vp)=>{"use strict";Vp.exports=function(e,i,r){let n=e+i-r,s=Math.abs(n-e),o=Math.abs(n-i),a=Math.abs(n-r);return s<=o&&s<=a?e:o<=a?i:r}});var ol=w((p2,Gp)=>{"use strict";var T1=nl(),A1=sl();function Hp(t,e,i){let r=t*e;return i!==8&&(r=Math.ceil(r/(8/i))),r}var Cr=Gp.exports=function(t,e){let i=t.width,r=t.height,n=t.interlace,s=t.bpp,o=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],n){let a=T1.getImagePasses(i,r);for(let l=0;ln?e[s-r]:0;e[s]=o+a}};Cr.prototype._unFilterType2=function(t,e,i){let r=this._lastLine;for(let n=0;nn?e[o-r]:0,u=Math.floor((c+l)/2);e[o]=a+u}};Cr.prototype._unFilterType4=function(t,e,i){let r=this._xComparison,n=r-1,s=this._lastLine;for(let o=0;on?e[o-r]:0,u=o>n&&s?s[o-r]:0,f=A1(c,l,u);e[o]=a+f}};Cr.prototype._reverseFilterLine=function(t){let e=t[0],i,r=this._images[this._imageIndex],n=r.byteWidth;if(e===0)i=t.slice(1,n+1);else switch(i=Buffer.alloc(n),e){case 1:this._unFilterType1(t,i,n);break;case 2:this._unFilterType2(t,i,n);break;case 3:this._unFilterType3(t,i,n);break;case 4:this._unFilterType4(t,i,n);break;default:throw new Error("Unrecognised filter type - "+e)}this.write(i),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=i,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}});var zp=w((d2,Wp)=>{"use strict";var I1=require("util"),Yp=il(),N1=ol(),L1=Wp.exports=function(t){Yp.call(this);let e=[],i=this;this._filter=new N1(t,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){i.emit("complete",Buffer.concat(e))}}),this._filter.start()};I1.inherits(L1,Yp)});var Tr=w((m2,Kp)=>{"use strict";Kp.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}});var cl=w((g2,Jp)=>{"use strict";var al=[];(function(){for(let t=0;t<256;t++){let e=t;for(let i=0;i<8;i++)e&1?e=3988292384^e>>>1:e=e>>>1;al[t]=e}})();var ll=Jp.exports=function(){this._crc=-1};ll.prototype.write=function(t){for(let e=0;e>>8;return!0};ll.prototype.crc32=function(){return this._crc^-1};ll.crc32=function(t){let e=-1;for(let i=0;i>>8;return e^-1}});var ul=w((v2,Zp)=>{"use strict";var Ve=Tr(),B1=cl(),We=Zp.exports=function(t,e){this._options=t,t.checkCRC=t.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[Ve.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[Ve.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[Ve.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[Ve.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[Ve.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[Ve.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};We.prototype.start=function(){this.read(Ve.PNG_SIGNATURE.length,this._parseSignature.bind(this))};We.prototype._parseSignature=function(t){let e=Ve.PNG_SIGNATURE;for(let i=0;ithis._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let e=0;e0?this._handleIDAT(i):this._handleChunkEnd()};We.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))};We.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}});var fl=w(Xp=>{"use strict";var Qp=nl(),R1=[function(){},function(t,e,i,r){if(r===e.length)throw new Error("Ran out of data");let n=e[r];t[i]=n,t[i+1]=n,t[i+2]=n,t[i+3]=255},function(t,e,i,r){if(r+1>=e.length)throw new Error("Ran out of data");let n=e[r];t[i]=n,t[i+1]=n,t[i+2]=n,t[i+3]=e[r+1]},function(t,e,i,r){if(r+2>=e.length)throw new Error("Ran out of data");t[i]=e[r],t[i+1]=e[r+1],t[i+2]=e[r+2],t[i+3]=255},function(t,e,i,r){if(r+3>=e.length)throw new Error("Ran out of data");t[i]=e[r],t[i+1]=e[r+1],t[i+2]=e[r+2],t[i+3]=e[r+3]}],P1=[function(){},function(t,e,i,r){let n=e[0];t[i]=n,t[i+1]=n,t[i+2]=n,t[i+3]=r},function(t,e,i){let r=e[0];t[i]=r,t[i+1]=r,t[i+2]=r,t[i+3]=e[1]},function(t,e,i,r){t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=r},function(t,e,i){t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=e[3]}];function M1(t,e){let i=[],r=0;function n(){if(r===t.length)throw new Error("Ran out of data");let s=t[r];r++;let o,a,l,c,u,f,d,g;switch(e){default:throw new Error("unrecognised depth");case 16:d=t[r],r++,i.push((s<<8)+d);break;case 4:d=s&15,g=s>>4,i.push(g,d);break;case 2:u=s&3,f=s>>2&3,d=s>>4&3,g=s>>6&3,i.push(g,d,f,u);break;case 1:o=s&1,a=s>>1&1,l=s>>2&1,c=s>>3&1,u=s>>4&1,f=s>>5&1,d=s>>6&1,g=s>>7&1,i.push(g,d,f,u,c,l,a,o);break}}return{get:function(s){for(;i.length{"use strict";function D1(t,e,i,r,n){let s=0;for(let o=0;o{"use strict";var $1=require("util"),pl=require("zlib"),td=il(),V1=zp(),H1=ul(),G1=fl(),Y1=hl(),zt=id.exports=function(t){td.call(this),this._parser=new H1(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};$1.inherits(zt,td);zt.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0};zt.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=pl.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let i=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,r=Math.max(i,pl.Z_MIN_CHUNK);this._inflate=pl.createInflate({chunkSize:r});let n=i,s=this.emit.bind(this,"error");this._inflate.on("error",function(a){n&&s(a)}),this._filter.on("complete",this._complete.bind(this));let o=this._filter.write.bind(this._filter);this._inflate.on("data",function(a){n&&(a.length>n&&(a=a.slice(0,n)),n-=a.length,o(a))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)};zt.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new V1(this._bitmapInfo)};zt.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t};zt.prototype._handlePalette=function(t){this._bitmapInfo.palette=t};zt.prototype._simpleTransparency=function(){this._metaData.alpha=!0};zt.prototype._headersFinished=function(){this.emit("metadata",this._metaData)};zt.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))};zt.prototype._complete=function(t){if(this.errord)return;let e;try{let i=G1.dataToBitMap(t,this._bitmapInfo);e=Y1(i,this._bitmapInfo,this._options.skipRescale),i=null}catch(i){this._handleError(i);return}this.emit("parsed",e)}});var sd=w((w2,nd)=>{"use strict";var It=Tr();nd.exports=function(t,e,i,r){let n=[It.COLORTYPE_COLOR_ALPHA,It.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let m=function(){let v=new ArrayBuffer(2);return new DataView(v).setInt16(0,256,!0),new Int16Array(v)[0]!==256}();if(r.bitDepth===8||r.bitDepth===16&&m)return t}let s=r.bitDepth!==16?t:new Uint16Array(t.buffer),o=255,a=It.COLORTYPE_TO_BPP_MAP[r.inputColorType];a===4&&!r.inputHasAlpha&&(a=3);let l=It.COLORTYPE_TO_BPP_MAP[r.colorType];r.bitDepth===16&&(o=65535,l*=2);let c=Buffer.alloc(e*i*l),u=0,f=0,d=r.bgColor||{};d.red===void 0&&(d.red=o),d.green===void 0&&(d.green=o),d.blue===void 0&&(d.blue=o);function g(){let m,v,b,_=o;switch(r.inputColorType){case It.COLORTYPE_COLOR_ALPHA:_=s[u+3],m=s[u],v=s[u+1],b=s[u+2];break;case It.COLORTYPE_COLOR:m=s[u],v=s[u+1],b=s[u+2];break;case It.COLORTYPE_ALPHA:_=s[u+1],m=s[u],v=m,b=m;break;case It.COLORTYPE_GRAYSCALE:m=s[u],v=m,b=m;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(n||(_/=o,m=Math.min(Math.max(Math.round((1-_)*d.red+_*m),0),o),v=Math.min(Math.max(Math.round((1-_)*d.green+_*v),0),o),b=Math.min(Math.max(Math.round((1-_)*d.blue+_*b),0),o))),{red:m,green:v,blue:b,alpha:_}}for(let m=0;m{"use strict";var od=sl();function W1(t,e,i,r,n){for(let s=0;s=s?t[e+o-s]:0,l=t[e+o]-a;r[n+o]=l}}function J1(t,e,i,r){let n=0;for(let s=0;s=r?t[e+s-r]:0,a=t[e+s]-o;n+=Math.abs(a)}return n}function Z1(t,e,i,r,n){for(let s=0;s0?t[e+s-i]:0,a=t[e+s]-o;r[n+s]=a}}function Q1(t,e,i){let r=0,n=e+i;for(let s=e;s0?t[s-i]:0,a=t[s]-o;r+=Math.abs(a)}return r}function X1(t,e,i,r,n,s){for(let o=0;o=s?t[e+o-s]:0,l=e>0?t[e+o-i]:0,c=t[e+o]-(a+l>>1);r[n+o]=c}}function ex(t,e,i,r){let n=0;for(let s=0;s=r?t[e+s-r]:0,a=e>0?t[e+s-i]:0,l=t[e+s]-(o+a>>1);n+=Math.abs(l)}return n}function tx(t,e,i,r,n,s){for(let o=0;o=s?t[e+o-s]:0,l=e>0?t[e+o-i]:0,c=e>0&&o>=s?t[e+o-(i+s)]:0,u=t[e+o]-od(a,l,c);r[n+o]=u}}function ix(t,e,i,r){let n=0;for(let s=0;s=r?t[e+s-r]:0,a=e>0?t[e+s-i]:0,l=e>0&&s>=r?t[e+s-(i+r)]:0,c=t[e+s]-od(o,a,l);n+=Math.abs(c)}return n}var rx={0:W1,1:K1,2:Z1,3:X1,4:tx},nx={0:z1,1:J1,2:Q1,3:ex,4:ix};ad.exports=function(t,e,i,r,n){let s;if(!("filterType"in r)||r.filterType===-1)s=[0,1,2,3,4];else if(typeof r.filterType=="number")s=[r.filterType];else throw new Error("unrecognised filter types");r.bitDepth===16&&(n*=2);let o=e*n,a=0,l=0,c=Buffer.alloc((o+1)*i),u=s[0];for(let f=0;f1){let d=1/0;for(let g=0;g{"use strict";var it=Tr(),sx=cl(),ox=sd(),ax=ld(),lx=require("zlib"),_i=cd.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32*1024,t.deflateLevel=t.deflateLevel!=null?t.deflateLevel:9,t.deflateStrategy=t.deflateStrategy!=null?t.deflateStrategy:3,t.inputHasAlpha=t.inputHasAlpha!=null?t.inputHasAlpha:!0,t.deflateFactory=t.deflateFactory||lx.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType=typeof t.colorType=="number"?t.colorType:it.COLORTYPE_COLOR_ALPHA,t.inputColorType=typeof t.inputColorType=="number"?t.inputColorType:it.COLORTYPE_COLOR_ALPHA,[it.COLORTYPE_GRAYSCALE,it.COLORTYPE_COLOR,it.COLORTYPE_COLOR_ALPHA,it.COLORTYPE_ALPHA].indexOf(t.colorType)===-1)throw new Error("option color type:"+t.colorType+" is not supported at present");if([it.COLORTYPE_GRAYSCALE,it.COLORTYPE_COLOR,it.COLORTYPE_COLOR_ALPHA,it.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1)throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(t.bitDepth!==8&&t.bitDepth!==16)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};_i.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}};_i.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())};_i.prototype.filterData=function(t,e,i){let r=ox(t,e,i,this._options),n=it.COLORTYPE_TO_BPP_MAP[this._options.colorType];return ax(r,e,i,this._options,n)};_i.prototype._packChunk=function(t,e){let i=e?e.length:0,r=Buffer.alloc(i+12);return r.writeUInt32BE(i,0),r.writeUInt32BE(t,4),e&&e.copy(r,8),r.writeInt32BE(sx.crc32(r.slice(4,r.length-4)),r.length-4),r};_i.prototype.packGAMA=function(t){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(t*it.GAMMA_DIVISION),0),this._packChunk(it.TYPE_gAMA,e)};_i.prototype.packIHDR=function(t,e){let i=Buffer.alloc(13);return i.writeUInt32BE(t,0),i.writeUInt32BE(e,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(it.TYPE_IHDR,i)};_i.prototype.packIDAT=function(t){return this._packChunk(it.TYPE_IDAT,t)};_i.prototype.packIEND=function(){return this._packChunk(it.TYPE_IEND,null)}});var pd=w((E2,hd)=>{"use strict";var cx=require("util"),ud=require("stream"),ux=Tr(),fx=dl(),fd=hd.exports=function(t){ud.call(this);let e=t||{};this._packer=new fx(e),this._deflate=this._packer.createDeflate(),this.readable=!0};cx.inherits(fd,ud);fd.prototype.pack=function(t,e,i,r){this.emit("data",Buffer.from(ux.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,i)),r&&this.emit("data",this._packer.packGAMA(r));let n=this._packer.filterData(t,e,i);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(s){this.emit("data",this._packer.packIDAT(s))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(n)}});var bd=w((cn,yd)=>{"use strict";var dd=require("assert").ok,Ar=require("zlib"),hx=require("util"),md=require("buffer").kMaxLength;function Wi(t){if(!(this instanceof Wi))return new Wi(t);t&&t.chunkSize=0,"have should not go down"),b>0){let _=r._buffer.slice(r._offset,r._offset+b);if(r._offset+=b,_.length>o&&(_=_.slice(0,o)),l.push(_),c+=_.length,o-=_.length,o===0)return!1}return(v===0||r._offset>=r._chunkSize)&&(s=r._chunkSize,r._offset=0,r._buffer=Buffer.allocUnsafe(r._chunkSize)),v===0?(a+=n-m,n=m,!0):!1}dd(this._handle,"zlib binding closed");let d;do d=this._handle.writeSync(e,t,a,n,this._buffer,this._offset,s),d=d||this._writeState;while(!this._hadError&&f(d[0],d[1]));if(this._hadError)throw u;if(c>=md)throw gd(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+md.toString(16)+" bytes");let g=Buffer.concat(l,c);return gd(this),g};hx.inherits(Wi,Ar.Inflate);function dx(t,e){if(typeof e=="string"&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let i=t._finishFlushFlag;return i==null&&(i=Ar.Z_FINISH),t._processChunk(e,i)}function vd(t,e){return dx(new Wi(e),t)}yd.exports=cn=vd;cn.Inflate=Wi;cn.createInflate=px;cn.inflateSync=vd});var ml=w((k2,wd)=>{"use strict";var _d=wd.exports=function(t){this._buffer=t,this._reads=[]};_d.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})};_d.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(this._buffer.length&&(this._buffer.length>=t.length||t.allowLess)){this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}else break}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}});var Sd=w(xd=>{"use strict";var mx=ml(),gx=ol();xd.process=function(t,e){let i=[],r=new mx(t);return new gx(e,{read:r.read.bind(r),write:function(s){i.push(s)},complete:function(){}}).start(),r.process(),Buffer.concat(i)}});var Cd=w((C2,Od)=>{"use strict";var Ed=!0,kd=require("zlib"),vx=bd();kd.deflateSync||(Ed=!1);var yx=ml(),bx=Sd(),_x=ul(),wx=fl(),xx=hl();Od.exports=function(t,e){if(!Ed)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i;function r(k){i=k}let n;function s(k){n=k}function o(k){n.transColor=k}function a(k){n.palette=k}function l(){n.alpha=!0}let c;function u(k){c=k}let f=[];function d(k){f.push(k)}let g=new yx(t);if(new _x(e,{read:g.read.bind(g),error:r,metadata:s,gamma:u,palette:a,transColor:o,inflateData:d,simpleTransparency:l}).start(),g.process(),i)throw i;let v=Buffer.concat(f);f.length=0;let b;if(n.interlace)b=kd.inflateSync(v);else{let E=((n.width*n.bpp*n.depth+7>>3)+1)*n.height;b=vx(v,{chunkSize:E,maxLength:E})}if(v=null,!b||!b.length)throw new Error("bad png - invalid inflate data response");let _=bx.process(b,n);v=null;let S=wx.dataToBitMap(_,n);_=null;let O=xx(S,n,e.skipRescale);return n.data=O,n.gamma=c||0,n}});var Nd=w((T2,Id)=>{"use strict";var Td=!0,Ad=require("zlib");Ad.deflateSync||(Td=!1);var Sx=Tr(),Ex=dl();Id.exports=function(t,e){if(!Td)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let i=e||{},r=new Ex(i),n=[];n.push(Buffer.from(Sx.PNG_SIGNATURE)),n.push(r.packIHDR(t.width,t.height)),t.gamma&&n.push(r.packGAMA(t.gamma));let s=r.filterData(t.data,t.width,t.height),o=Ad.deflateSync(s,r.getDeflateOptions());if(s=null,!o||!o.length)throw new Error("bad png - invalid compressed data response");return n.push(r.packIDAT(o)),n.push(r.packIEND()),Buffer.concat(n)}});var Ld=w(gl=>{"use strict";var kx=Cd(),Ox=Nd();gl.read=function(t,e){return kx(t,e||{})};gl.write=function(t,e){return Ox(t,e)}});var Pd=w(Rd=>{"use strict";var Cx=require("util"),Bd=require("stream"),Tx=rd(),Ax=pd(),Ix=Ld(),at=Rd.PNG=function(t){Bd.call(this),t=t||{},this.width=t.width|0,this.height=t.height|0,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new Tx(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new Ax(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};Cx.inherits(at,Bd);at.sync=Ix;at.prototype.pack=function(){return!this.data||!this.data.length?(this.emit("error","No data provided"),this):(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this)};at.prototype.parse=function(t,e){if(e){let i,r;i=function(n){this.removeListener("error",r),this.data=n,e(null,this)}.bind(this),r=function(n){this.removeListener("parsed",i),e(n,null)}.bind(this),this.once("parsed",i),this.once("error",r)}return this.end(t),this};at.prototype.write=function(t){return this._parser.write(t),!0};at.prototype.end=function(t){this._parser.end(t)};at.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)};at.prototype._gamma=function(t){this.gamma=t};at.prototype._handleClose=function(){!this._parser.writable&&!this._packer.readable&&this.emit("close")};at.bitblt=function(t,e,i,r,n,s,o,a){if(i|=0,r|=0,n|=0,s|=0,o|=0,a|=0,i>t.width||r>t.height||i+n>t.width||r+s>t.height)throw new Error("bitblt reading outside image");if(o>e.width||a>e.height||o+n>e.width||a+s>e.height)throw new Error("bitblt writing outside image");for(let l=0;l{var Fs=class extends Error{constructor(e,i,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=e,this.nestedError=void 0}},vl=class extends Fs{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};yl.CommanderError=Fs;yl.InvalidArgumentError=vl});var Ds=w(_l=>{var{InvalidArgumentError:Nx}=un(),bl=class{constructor(e,i){switch(this.description=i||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,i){return i===this.defaultValue||!Array.isArray(i)?[e]:i.concat(e)}default(e,i){return this.defaultValue=e,this.defaultValueDescription=i,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e,this.parseArg=(i,r)=>{if(!e.includes(i))throw new Nx(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(i,r):i},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Lx(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}_l.Argument=bl;_l.humanReadableArgName=Lx});var xl=w(Md=>{var{humanReadableArgName:Bx}=Ds(),wl=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){let i=e.commands.filter(r=>!r._hidden);if(e._hasImplicitHelpCommand()){let[,r,n]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),s=e.createCommand(r).helpOption(!1);s.description(e._helpCommandDescription),n&&s.arguments(n),i.push(s)}return this.sortSubcommands&&i.sort((r,n)=>r.name().localeCompare(n.name())),i}visibleOptions(e){let i=e.options.filter(s=>!s.hidden),r=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),n=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(r||n){let s;r?n?s=e.createOption(e._helpFlags,e._helpDescription):s=e.createOption(e._helpShortFlag,e._helpDescription):s=e.createOption(e._helpLongFlag,e._helpDescription),i.push(s)}if(this.sortOptions){let s=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");i.sort((o,a)=>s(o).localeCompare(s(a)))}return i}visibleArguments(e){return e._argsDescription&&e._args.forEach(i=>{i.description=i.description||e._argsDescription[i.name()]||""}),e._args.find(i=>i.description)?e._args:[]}subcommandTerm(e){let i=e._args.map(r=>Bx(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(i?" "+i:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,i){return i.visibleCommands(e).reduce((r,n)=>Math.max(r,i.subcommandTerm(n).length),0)}longestOptionTermLength(e,i){return i.visibleOptions(e).reduce((r,n)=>Math.max(r,i.optionTerm(n).length),0)}longestArgumentTermLength(e,i){return i.visibleArguments(e).reduce((r,n)=>Math.max(r,i.argumentTerm(n).length),0)}commandUsage(e){let i=e._name;e._aliases[0]&&(i=i+"|"+e._aliases[0]);let r="";for(let n=e.parent;n;n=n.parent)r=n.name()+" "+r;return r+i+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.description()}optionDescription(e){let i=[];return e.argChoices&&!e.negate&&i.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&!e.negate&&i.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.envVar!==void 0&&i.push(`env: ${e.envVar}`),i.length>0?`${e.description} (${i.join(", ")})`:e.description}argumentDescription(e){let i=[];if(e.argChoices&&i.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&i.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),i.length>0){let r=`(${i.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,i){let r=i.padWidth(e,i),n=i.helpWidth||80,s=2,o=2;function a(m,v){if(v){let b=`${m.padEnd(r+o)}${v}`;return i.wrap(b,n-s,r+o)}return m}function l(m){return m.join(` +`).replace(/^/gm," ".repeat(s))}let c=[`Usage: ${i.commandUsage(e)}`,""],u=i.commandDescription(e);u.length>0&&(c=c.concat([u,""]));let f=i.visibleArguments(e).map(m=>a(i.argumentTerm(m),i.argumentDescription(m)));f.length>0&&(c=c.concat(["Arguments:",l(f),""]));let d=i.visibleOptions(e).map(m=>a(i.optionTerm(m),i.optionDescription(m)));d.length>0&&(c=c.concat(["Options:",l(d),""]));let g=i.visibleCommands(e).map(m=>a(i.subcommandTerm(m),i.subcommandDescription(m)));return g.length>0&&(c=c.concat(["Commands:",l(g),""])),c.join(` +`)}padWidth(e,i){return Math.max(i.longestOptionTermLength(e,i),i.longestSubcommandTermLength(e,i),i.longestArgumentTermLength(e,i))}wrap(e,i,r,n=40){if(e.match(/[\n]\s+/))return e;let s=i-r;if(s(f.slice(-1)===` +`&&(f=f.slice(0,f.length-1)),(d>0?l:"")+f.trimRight())).join(` +`)}};Md.Help=wl});var kl=w(El=>{var{InvalidArgumentError:Rx}=un(),Sl=class{constructor(e,i){this.flags=e,this.description=i||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=qd(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0}default(e,i){return this.defaultValue=e,this.defaultValueDescription=i,this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,i){return i===this.defaultValue||!Array.isArray(i)?[e]:i.concat(e)}choices(e){return this.argChoices=e,this.parseArg=(i,r)=>{if(!e.includes(i))throw new Rx(`Allowed choices are ${e.join(", ")}.`);return this.variadic?this._concatValue(i,r):i},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return Px(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}};function Px(t){return t.split("-").reduce((e,i)=>e+i[0].toUpperCase()+i.slice(1))}function qd(t){let e,i,r=t.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(e=r.shift()),i=r.shift(),!e&&/^-[^-]$/.test(i)&&(e=i,i=void 0),{shortFlag:e,longFlag:i}}El.Option=Sl;El.splitOptionFlags=qd});var Dd=w(Fd=>{function Mx(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let i=[];for(let r=0;r<=t.length;r++)i[r]=[r];for(let r=0;r<=e.length;r++)i[0][r]=r;for(let r=1;r<=e.length;r++)for(let n=1;n<=t.length;n++){let s=1;t[n-1]===e[r-1]?s=0:s=1,i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+s),n>1&&r>1&&t[n-1]===e[r-2]&&t[n-2]===e[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+1))}return i[t.length][e.length]}function qx(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let i=t.startsWith("--");i&&(t=t.slice(2),e=e.map(o=>o.slice(2)));let r=[],n=3,s=.4;return e.forEach(o=>{if(o.length<=1)return;let a=Mx(t,o),l=Math.max(t.length,o.length);(l-a)/l>s&&(ao.localeCompare(a)),i&&(r=r.map(o=>`--${o}`)),r.length>1?` (Did you mean one of ${r.join(", ")}?)`:r.length===1?` -(Did you mean ${r[0]}?)`:""}kl.suggestSimilar=fd});var Rl=y(Al=>{var hd=require("events").EventEmitter,xn=require("child_process"),kt=require("path"),_n=require("fs"),{Argument:pd,humanReadableArgName:dd}=Ji(),{CommanderError:yn}=wi(),{Help:md}=dn(),{Option:gd,splitOptionFlags:vd}=vn(),{suggestSimilar:Ol}=Cl(),wn=class t extends hd{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!1,this._outputConfiguration={writeOut:i=>process.stdout.write(i),writeErr:i=>process.stderr.write(i),getOutHelpWidth:()=>process.stdout.isTTY?process.stdout.columns:void 0,getErrHelpWidth:()=>process.stderr.isTTY?process.stderr.columns:void 0,outputError:(i,r)=>r(i)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,i,r){let n=i,s=r;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,l]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(o);return n&&(a.description(n),a._executableHandler=!0),s.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(s.noHelp||s.hidden),a._executableFile=s.executableFile||null,l&&a.arguments(l),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),n?this:a}createCommand(e){return new t(e)}createHelp(){return Object.assign(new md,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,i){if(!e._name)throw new Error("Command passed to .addCommand() must have a name");function r(n){n.forEach(s=>{if(s._executableHandler&&!s._executableFile)throw new Error(`Must specify executableFile for deeply nested executable: ${s.name()}`);r(s.commands)})}return r(e.commands),i=i||{},i.isDefault&&(this._defaultCommandName=e._name),(i.noHelp||i.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,i){return new pd(e,i)}argument(e,i,r,n){let s=this.createArgument(e,i);return typeof r=="function"?s.default(n).argParser(r):s.default(r),this.addArgument(s),this}arguments(e){return e.split(/ +/).forEach(i=>{this.argument(i)}),this}addArgument(e){let i=this._args.slice(-1)[0];if(i&&i.variadic)throw new Error(`only the last argument can be variadic '${i.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,i){return e===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof e=="string"&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=i||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,i){let r=["preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. -Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(i):this._lifeCycleHooks[e]=[i],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=i=>{if(i.code!=="commander.executeSubCommandAsync")throw i},this}_exit(e,i,r){this._exitCallback&&this._exitCallback(new yn(e,i,r)),process.exit(e)}action(e){let i=r=>{let n=this._args.length,s=r.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=i,this}createOption(e,i){return new gd(e,i)}addOption(e){let i=e.name(),r=e.attributeName(),n=e.defaultValue;if(e.negate||e.optional||e.required||typeof n=="boolean"){if(e.negate){let o=e.long.replace(/^--no-/,"--");n=this._findOption(o)?this.getOptionValue(r):!0}n!==void 0&&this.setOptionValueWithSource(r,n,"default")}this.options.push(e);let s=(o,l,a)=>{let c=this.getOptionValue(r);if(o!==null&&e.parseArg)try{o=e.parseArg(o,c===void 0?n:c)}catch(u){if(u.code==="commander.invalidArgument"){let f=`${l} ${u.message}`;this._displayError(u.exitCode,u.code,f)}throw u}else o!==null&&e.variadic&&(o=e._concatValue(o,c));typeof c=="boolean"||typeof c=="undefined"?o==null?this.setOptionValueWithSource(r,e.negate?!1:n||!0,a):this.setOptionValueWithSource(r,o,a):o!==null&&this.setOptionValueWithSource(r,e.negate?!1:o,a)};return this.on("option:"+i,o=>{let l=`error: option '${e.flags}' argument '${o}' is invalid.`;s(o,l,"cli")}),e.envVar&&this.on("optionEnv:"+i,o=>{let l=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;s(o,l,"env")}),this}_optionEx(e,i,r,n,s){let o=this.createOption(i,r);if(o.makeOptionMandatory(!!e.mandatory),typeof n=="function")o.default(s).argParser(n);else if(n instanceof RegExp){let l=n;n=(a,c)=>{let u=l.exec(a);return u?u[0]:c},o.default(s).argParser(n)}else o.default(n);return this.addOption(o)}option(e,i,r,n){return this._optionEx({},e,i,r,n)}requiredOption(e,i,r,n){return this._optionEx({mandatory:!0},e,i,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,i){return this._storeOptionsAsProperties?this[e]=i:this._optionValues[e]=i,this}setOptionValueWithSource(e,i,r){return this.setOptionValue(e,i),this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,i){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");i=i||{},e===void 0&&(e=process.argv,process.versions&&process.versions.electron&&(i.from="electron")),this.rawArgs=e.slice();let r;switch(i.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":process.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${i.from}' }`)}return!this._scriptPath&&require.main&&(this._scriptPath=require.main.filename),this._name=this._name||this._scriptPath&&kt.basename(this._scriptPath,kt.extname(this._scriptPath)),r}parse(e,i){let r=this._prepareUserArgs(e,i);return this._parseCommand([],r),this}async parseAsync(e,i){let r=this._prepareUserArgs(e,i);return await this._parseCommand([],r),this}_executeSubCommand(e,i){i=i.slice();let r=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];this._checkForMissingMandatoryOptions();let s=this._scriptPath;!s&&require.main&&(s=require.main.filename);let o;try{let h=_n.realpathSync(s);o=kt.dirname(h)}catch{o="."}let l=kt.basename(s,kt.extname(s))+"-"+e._name;e._executableFile&&(l=e._executableFile);let a=kt.join(o,l);_n.existsSync(a)?l=a:n.forEach(h=>{_n.existsSync(`${a}${h}`)&&(l=`${a}${h}`)}),r=n.includes(kt.extname(l));let c;process.platform!=="win32"?r?(i.unshift(l),i=Tl(process.execArgv).concat(i),c=xn.spawn(process.argv[0],i,{stdio:"inherit"})):c=xn.spawn(l,i,{stdio:"inherit"}):(i.unshift(l),i=Tl(process.execArgv).concat(i),c=xn.spawn(process.execPath,i,{stdio:"inherit"})),["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(h=>{process.on(h,()=>{c.killed===!1&&c.exitCode===null&&c.kill(h)})});let f=this._exitCallback;f?c.on("close",()=>{f(new yn(process.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):c.on("close",process.exit.bind(process)),c.on("error",h=>{if(h.code==="ENOENT"){let p=`'${l}' does not exist +(Did you mean ${r[0]}?)`:""}Fd.suggestSimilar=qx});var Hd=w(Vd=>{var Fx=require("events").EventEmitter,Ol=require("child_process"),zi=require("path"),Cl=require("fs"),{Argument:Dx,humanReadableArgName:jx}=Ds(),{CommanderError:Tl}=un(),{Help:Ux}=xl(),{Option:$x,splitOptionFlags:Vx}=kl(),{suggestSimilar:jd}=Dd(),Il=class t extends Fx{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!1,this._outputConfiguration={writeOut:i=>process.stdout.write(i),writeErr:i=>process.stderr.write(i),getOutHelpWidth:()=>process.stdout.isTTY?process.stdout.columns:void 0,getErrHelpWidth:()=>process.stderr.isTTY?process.stderr.columns:void 0,outputError:(i,r)=>r(i)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,i,r){let n=i,s=r;typeof n=="object"&&n!==null&&(s=n,n=null),s=s||{};let[,o,a]=e.match(/([^ ]+) *(.*)/),l=this.createCommand(o);return n&&(l.description(n),l._executableHandler=!0),s.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(s.noHelp||s.hidden),l._executableFile=s.executableFile||null,a&&l.arguments(a),this.commands.push(l),l.parent=this,l.copyInheritedSettings(this),n?this:l}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Ux,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,i){if(!e._name)throw new Error("Command passed to .addCommand() must have a name");function r(n){n.forEach(s=>{if(s._executableHandler&&!s._executableFile)throw new Error(`Must specify executableFile for deeply nested executable: ${s.name()}`);r(s.commands)})}return r(e.commands),i=i||{},i.isDefault&&(this._defaultCommandName=e._name),(i.noHelp||i.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,i){return new Dx(e,i)}argument(e,i,r,n){let s=this.createArgument(e,i);return typeof r=="function"?s.default(n).argParser(r):s.default(r),this.addArgument(s),this}arguments(e){return e.split(/ +/).forEach(i=>{this.argument(i)}),this}addArgument(e){let i=this._args.slice(-1)[0];if(i&&i.variadic)throw new Error(`only the last argument can be variadic '${i.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,i){return e===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof e=="string"&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=i||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,i){let r=["preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. +Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(i):this._lifeCycleHooks[e]=[i],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=i=>{if(i.code!=="commander.executeSubCommandAsync")throw i},this}_exit(e,i,r){this._exitCallback&&this._exitCallback(new Tl(e,i,r)),process.exit(e)}action(e){let i=r=>{let n=this._args.length,s=r.slice(0,n);return this._storeOptionsAsProperties?s[n]=this:s[n]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=i,this}createOption(e,i){return new $x(e,i)}addOption(e){let i=e.name(),r=e.attributeName(),n=e.defaultValue;if(e.negate||e.optional||e.required||typeof n=="boolean"){if(e.negate){let o=e.long.replace(/^--no-/,"--");n=this._findOption(o)?this.getOptionValue(r):!0}n!==void 0&&this.setOptionValueWithSource(r,n,"default")}this.options.push(e);let s=(o,a,l)=>{let c=this.getOptionValue(r);if(o!==null&&e.parseArg)try{o=e.parseArg(o,c===void 0?n:c)}catch(u){if(u.code==="commander.invalidArgument"){let f=`${a} ${u.message}`;this._displayError(u.exitCode,u.code,f)}throw u}else o!==null&&e.variadic&&(o=e._concatValue(o,c));typeof c=="boolean"||typeof c=="undefined"?o==null?this.setOptionValueWithSource(r,e.negate?!1:n||!0,l):this.setOptionValueWithSource(r,o,l):o!==null&&this.setOptionValueWithSource(r,e.negate?!1:o,l)};return this.on("option:"+i,o=>{let a=`error: option '${e.flags}' argument '${o}' is invalid.`;s(o,a,"cli")}),e.envVar&&this.on("optionEnv:"+i,o=>{let a=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;s(o,a,"env")}),this}_optionEx(e,i,r,n,s){let o=this.createOption(i,r);if(o.makeOptionMandatory(!!e.mandatory),typeof n=="function")o.default(s).argParser(n);else if(n instanceof RegExp){let a=n;n=(l,c)=>{let u=a.exec(l);return u?u[0]:c},o.default(s).argParser(n)}else o.default(n);return this.addOption(o)}option(e,i,r,n){return this._optionEx({},e,i,r,n)}requiredOption(e,i,r,n){return this._optionEx({mandatory:!0},e,i,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,i){return this._storeOptionsAsProperties?this[e]=i:this._optionValues[e]=i,this}setOptionValueWithSource(e,i,r){return this.setOptionValue(e,i),this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,i){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");i=i||{},e===void 0&&(e=process.argv,process.versions&&process.versions.electron&&(i.from="electron")),this.rawArgs=e.slice();let r;switch(i.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":process.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${i.from}' }`)}return!this._scriptPath&&require.main&&(this._scriptPath=require.main.filename),this._name=this._name||this._scriptPath&&zi.basename(this._scriptPath,zi.extname(this._scriptPath)),r}parse(e,i){let r=this._prepareUserArgs(e,i);return this._parseCommand([],r),this}async parseAsync(e,i){let r=this._prepareUserArgs(e,i);return await this._parseCommand([],r),this}_executeSubCommand(e,i){i=i.slice();let r=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];this._checkForMissingMandatoryOptions();let s=this._scriptPath;!s&&require.main&&(s=require.main.filename);let o;try{let d=Cl.realpathSync(s);o=zi.dirname(d)}catch{o="."}let a=zi.basename(s,zi.extname(s))+"-"+e._name;e._executableFile&&(a=e._executableFile);let l=zi.join(o,a);Cl.existsSync(l)?a=l:n.forEach(d=>{Cl.existsSync(`${l}${d}`)&&(a=`${l}${d}`)}),r=n.includes(zi.extname(a));let c;process.platform!=="win32"?r?(i.unshift(a),i=$d(process.execArgv).concat(i),c=Ol.spawn(process.argv[0],i,{stdio:"inherit"})):c=Ol.spawn(a,i,{stdio:"inherit"}):(i.unshift(a),i=$d(process.execArgv).concat(i),c=Ol.spawn(process.execPath,i,{stdio:"inherit"})),["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{process.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let f=this._exitCallback;f?c.on("close",()=>{f(new Tl(process.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):c.on("close",process.exit.bind(process)),c.on("error",d=>{if(d.code==="ENOENT"){let g=`'${a}' does not exist - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - - if the default executable name is not suitable, use the executableFile option to supply a custom name`;throw new Error(p)}else if(h.code==="EACCES")throw new Error(`'${l}' not executable`);if(!f)process.exit(1);else{let p=new yn(1,"commander.executeSubCommandAsync","(error)");p.nestedError=h,f(p)}}),this.runningCommand=c}_dispatchSubcommand(e,i,r){let n=this._findCommand(e);if(n||this.help({error:!0}),n._executableHandler)this._executeSubCommand(n,i.concat(r));else return n._parseCommand(i,r)}_checkNumberOfArguments(){this._args.forEach((e,i)=>{e.required&&this.args[i]==null&&this.missingArgument(e.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){let e=(r,n,s)=>{let o=n;if(n!==null&&r.parseArg)try{o=r.parseArg(n,s)}catch(l){if(l.code==="commander.invalidArgument"){let a=`error: command-argument value '${n}' is invalid for argument '${r.name()}'. ${l.message}`;this._displayError(l.exitCode,l.code,a)}throw l}return o};this._checkNumberOfArguments();let i=[];this._args.forEach((r,n)=>{let s=r.defaultValue;r.variadic?ne(r,l,o),r.defaultValue))):s===void 0&&(s=[]):ni()):i()}_chainOrCallHooks(e,i){let r=e,n=[];return bn(this).reverse().filter(s=>s._lifeCycleHooks[i]!==void 0).forEach(s=>{s._lifeCycleHooks[i].forEach(o=>{n.push({hookedCommand:s,callback:o})})}),i==="postAction"&&n.reverse(),n.forEach(s=>{r=this._chainOrCall(r,()=>s.callback(s.hookedCommand,this))}),r}_parseCommand(e,i){let r=this.parseOptions(i);if(this._parseOptionsEnv(),e=e.concat(r.operands),i=r.unknown,this.args=e.concat(i),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),i);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return e.length===1&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return Il(this,i),this._dispatchSubcommand(this._defaultCommandName,e,i);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),Il(this,r.unknown),this._checkForMissingMandatoryOptions();let n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&this.parent.emit(s,e,i),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,i);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,i);this.listenerCount("command:*")?this.emit("command:*",e,i):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(i=>i._name===e||i._aliases.includes(e))}_findOption(e){return this.options.find(i=>i.is(e))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach(i=>{i.mandatory&&e.getOptionValue(i.attributeName())===void 0&&e.missingMandatoryOptionValue(i)})}parseOptions(e){let i=[],r=[],n=i,s=e.slice();function o(a){return a.length>1&&a[0]==="-"}let l=null;for(;s.length;){let a=s.shift();if(a==="--"){n===r&&n.push(a),n.push(...s);break}if(l&&!o(a)){this.emit(`option:${l.name()}`,a);continue}if(l=null,o(a)){let c=this._findOption(a);if(c){if(c.required){let u=s.shift();u===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,u)}else if(c.optional){let u=null;s.length>0&&!o(s[0])&&(u=s.shift()),this.emit(`option:${c.name()}`,u)}else this.emit(`option:${c.name()}`);l=c.variadic?c:null;continue}}if(a.length>2&&a[0]==="-"&&a[1]!=="-"){let c=this._findOption(`-${a[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,a.slice(2)):(this.emit(`option:${c.name()}`),s.unshift(`-${a.slice(2)}`));continue}}if(/^--[^=]+=/.test(a)){let c=a.indexOf("="),u=this._findOption(a.slice(0,c));if(u&&(u.required||u.optional)){this.emit(`option:${u.name()}`,a.slice(c+1));continue}}if(o(a)&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&i.length===0&&r.length===0){if(this._findCommand(a)){i.push(a),s.length>0&&r.push(...s);break}else if(a===this._helpCommandName&&this._hasImplicitHelpCommand()){i.push(a),s.length>0&&i.push(...s);break}else if(this._defaultCommandName){r.push(a),s.length>0&&r.push(...s);break}}if(this._passThroughOptions){n.push(a),s.length>0&&n.push(...s);break}n.push(a)}return{operands:i,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},i=this.options.length;for(let r=0;r{e.required&&this.args[i]==null&&this.missingArgument(e.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){let e=(r,n,s)=>{let o=n;if(n!==null&&r.parseArg)try{o=r.parseArg(n,s)}catch(a){if(a.code==="commander.invalidArgument"){let l=`error: command-argument value '${n}' is invalid for argument '${r.name()}'. ${a.message}`;this._displayError(a.exitCode,a.code,l)}throw a}return o};this._checkNumberOfArguments();let i=[];this._args.forEach((r,n)=>{let s=r.defaultValue;r.variadic?ne(r,a,o),r.defaultValue))):s===void 0&&(s=[]):ni()):i()}_chainOrCallHooks(e,i){let r=e,n=[];return Al(this).reverse().filter(s=>s._lifeCycleHooks[i]!==void 0).forEach(s=>{s._lifeCycleHooks[i].forEach(o=>{n.push({hookedCommand:s,callback:o})})}),i==="postAction"&&n.reverse(),n.forEach(s=>{r=this._chainOrCall(r,()=>s.callback(s.hookedCommand,this))}),r}_parseCommand(e,i){let r=this.parseOptions(i);if(this._parseOptionsEnv(),e=e.concat(r.operands),i=r.unknown,this.args=e.concat(i),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),i);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return e.length===1&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return Ud(this,i),this._dispatchSubcommand(this._defaultCommandName,e,i);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),Ud(this,r.unknown),this._checkForMissingMandatoryOptions();let n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&this.parent.emit(s,e,i),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,i);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,i);this.listenerCount("command:*")?this.emit("command:*",e,i):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(i=>i._name===e||i._aliases.includes(e))}_findOption(e){return this.options.find(i=>i.is(e))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach(i=>{i.mandatory&&e.getOptionValue(i.attributeName())===void 0&&e.missingMandatoryOptionValue(i)})}parseOptions(e){let i=[],r=[],n=i,s=e.slice();function o(l){return l.length>1&&l[0]==="-"}let a=null;for(;s.length;){let l=s.shift();if(l==="--"){n===r&&n.push(l),n.push(...s);break}if(a&&!o(l)){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let c=this._findOption(l);if(c){if(c.required){let u=s.shift();u===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,u)}else if(c.optional){let u=null;s.length>0&&!o(s[0])&&(u=s.shift()),this.emit(`option:${c.name()}`,u)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let c=this._findOption(`-${l[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,l.slice(2)):(this.emit(`option:${c.name()}`),s.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let c=l.indexOf("="),u=this._findOption(l.slice(0,c));if(u&&(u.required||u.optional)){this.emit(`option:${u.name()}`,l.slice(c+1));continue}}if(o(l)&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&i.length===0&&r.length===0){if(this._findCommand(l)){i.push(l),s.length>0&&r.push(...s);break}else if(l===this._helpCommandName&&this._hasImplicitHelpCommand()){i.push(l),s.length>0&&i.push(...s);break}else if(this._defaultCommandName){r.push(l),s.length>0&&r.push(...s);break}}if(this._passThroughOptions){n.push(l),s.length>0&&n.push(...s);break}n.push(l)}return{operands:i,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},i=this.options.length;for(let r=0;r{if(e.envVar&&e.envVar in process.env){let i=e.attributeName();(this.getOptionValue(i)===void 0||["default","config","env"].includes(this.getOptionValueSource(i)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,process.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}missingArgument(e){let i=`error: missing required argument '${e}'`;this._displayError(1,"commander.missingArgument",i)}optionMissingArgument(e){let i=`error: option '${e.flags}' argument missing`;this._displayError(1,"commander.optionMissingArgument",i)}missingMandatoryOptionValue(e){let i=`error: required option '${e.flags}' not specified`;this._displayError(1,"commander.missingMandatoryOptionValue",i)}unknownOption(e){if(this._allowUnknownOption)return;let i="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(l=>l.long).map(l=>l.long);n=n.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);i=Ol(e,n)}let r=`error: unknown option '${e}'${i}`;this._displayError(1,"commander.unknownOption",r)}_excessArguments(e){if(this._allowExcessArguments)return;let i=this._args.length,r=i===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${i} argument${r} but got ${e.length}.`;this._displayError(1,"commander.excessArguments",s)}unknownCommand(){let e=this.args[0],i="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),i=Ol(e,n)}let r=`error: unknown command '${e}'${i}`;this._displayError(1,"commander.unknownCommand",r)}version(e,i,r){if(e===void 0)return this._version;this._version=e,i=i||"-V, --version",r=r||"output the version number";let n=this.createOption(i,r);return this._versionOptionName=n.attributeName(),this.options.push(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e} -`),this._exit(0,"commander.version",e)}),this}description(e,i){return e===void 0&&i===void 0?this._description:(this._description=e,i&&(this._argsDescription=i),this)}alias(e){if(e===void 0)return this._aliases[0];let i=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(i=this.commands[this.commands.length-1]),e===i._name)throw new Error("Command alias can't be the same as its name");return i._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(i=>this.alias(i)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let i=this._args.map(r=>dd(r));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?i:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpInformation(e){let i=this.createHelp();return i.helpWidth===void 0&&(i.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),i.formatHelp(this,i)}_getHelpContext(e){e=e||{};let i={error:!!e.error},r;return i.error?r=n=>this._outputConfiguration.writeErr(n):r=n=>this._outputConfiguration.writeOut(n),i.write=e.write||r,i.command=this,i}outputHelp(e){let i;typeof e=="function"&&(i=e,e=void 0);let r=this._getHelpContext(e);bn(this).reverse().forEach(s=>s.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let n=this.helpInformation(r);if(i&&(n=i(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(n),this.emit(this._helpLongFlag),this.emit("afterHelp",r),bn(this).forEach(s=>s.emit("afterAllHelp",r))}helpOption(e,i){if(typeof e=="boolean")return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=i||this._helpDescription;let r=vd(this._helpFlags);return this._helpShortFlag=r.shortFlag,this._helpLongFlag=r.longFlag,this}help(e){this.outputHelp(e);let i=process.exitCode||0;i===0&&e&&typeof e!="function"&&e.error&&(i=1),this._exit(i,"commander.help","(outputHelp)")}addHelpText(e,i){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText. +`),this.outputHelp({error:!0})),this._exit(e,i,r)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in process.env){let i=e.attributeName();(this.getOptionValue(i)===void 0||["default","config","env"].includes(this.getOptionValueSource(i)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,process.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}missingArgument(e){let i=`error: missing required argument '${e}'`;this._displayError(1,"commander.missingArgument",i)}optionMissingArgument(e){let i=`error: option '${e.flags}' argument missing`;this._displayError(1,"commander.optionMissingArgument",i)}missingMandatoryOptionValue(e){let i=`error: required option '${e.flags}' not specified`;this._displayError(1,"commander.missingMandatoryOptionValue",i)}unknownOption(e){if(this._allowUnknownOption)return;let i="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);n=n.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);i=jd(e,n)}let r=`error: unknown option '${e}'${i}`;this._displayError(1,"commander.unknownOption",r)}_excessArguments(e){if(this._allowExcessArguments)return;let i=this._args.length,r=i===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${i} argument${r} but got ${e.length}.`;this._displayError(1,"commander.excessArguments",s)}unknownCommand(){let e=this.args[0],i="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(s=>{n.push(s.name()),s.alias()&&n.push(s.alias())}),i=jd(e,n)}let r=`error: unknown command '${e}'${i}`;this._displayError(1,"commander.unknownCommand",r)}version(e,i,r){if(e===void 0)return this._version;this._version=e,i=i||"-V, --version",r=r||"output the version number";let n=this.createOption(i,r);return this._versionOptionName=n.attributeName(),this.options.push(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e} +`),this._exit(0,"commander.version",e)}),this}description(e,i){return e===void 0&&i===void 0?this._description:(this._description=e,i&&(this._argsDescription=i),this)}alias(e){if(e===void 0)return this._aliases[0];let i=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(i=this.commands[this.commands.length-1]),e===i._name)throw new Error("Command alias can't be the same as its name");return i._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(i=>this.alias(i)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let i=this._args.map(r=>jx(r));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?i:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpInformation(e){let i=this.createHelp();return i.helpWidth===void 0&&(i.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),i.formatHelp(this,i)}_getHelpContext(e){e=e||{};let i={error:!!e.error},r;return i.error?r=n=>this._outputConfiguration.writeErr(n):r=n=>this._outputConfiguration.writeOut(n),i.write=e.write||r,i.command=this,i}outputHelp(e){let i;typeof e=="function"&&(i=e,e=void 0);let r=this._getHelpContext(e);Al(this).reverse().forEach(s=>s.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let n=this.helpInformation(r);if(i&&(n=i(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(n),this.emit(this._helpLongFlag),this.emit("afterHelp",r),Al(this).forEach(s=>s.emit("afterAllHelp",r))}helpOption(e,i){if(typeof e=="boolean")return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=i||this._helpDescription;let r=Vx(this._helpFlags);return this._helpShortFlag=r.shortFlag,this._helpLongFlag=r.longFlag,this}help(e){this.outputHelp(e);let i=process.exitCode||0;i===0&&e&&typeof e!="function"&&e.error&&(i=1),this._exit(i,"commander.help","(outputHelp)")}addHelpText(e,i){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${r.join("', '")}'`);let n=`${e}Help`;return this.on(n,s=>{let o;typeof i=="function"?o=i({error:s.error,command:s.command}):o=i,o&&s.write(`${o} -`)}),this}};function Il(t,e){t._hasHelpOption&&e.find(r=>r===t._helpLongFlag||r===t._helpShortFlag)&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function Tl(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let i,r="127.0.0.1",n="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?i=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(i=s[1],/^\d+$/.test(s[3])?n=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(i=s[1],r=s[3],n=s[4]),i&&n!=="0"?`${i}=${r}:${parseInt(n)+1}`:e})}function bn(t){let e=[];for(let i=t;i;i=i.parent)e.push(i);return e}Al.Command=wn});var Fl=y((it,Pl)=>{var{Argument:xd}=Ji(),{Command:Bl}=Rl(),{CommanderError:_d,InvalidArgumentError:Ll}=wi(),{Help:yd}=dn(),{Option:bd}=vn();it=Pl.exports=new Bl;it.program=it;it.Argument=xd;it.Command=Bl;it.CommanderError=_d;it.Help=yd;it.InvalidArgumentError=Ll;it.InvalidOptionArgumentError=Ll;it.Option=bd});var Ul=y((Nl,Ml)=>{Nl=Ml.exports=Zt;function Zt(t,e){if(this.stream=e.stream||process.stderr,typeof e=="number"){var i=e;e={},e.total=i}else{if(e=e||{},typeof t!="string")throw new Error("format required");if(typeof e.total!="number")throw new Error("total required")}this.fmt=t,this.curr=e.curr||0,this.total=e.total,this.width=e.width||this.total,this.clear=e.clear,this.chars={complete:e.complete||"=",incomplete:e.incomplete||"-",head:e.head||e.complete||"="},this.renderThrottle=e.renderThrottle!==0?e.renderThrottle||16:0,this.lastRender=-1/0,this.callback=e.callback||function(){},this.tokens={},this.lastDraw=""}Zt.prototype.tick=function(t,e){if(t!==0&&(t=t||1),typeof t=="object"&&(e=t,t=1),e&&(this.tokens=e),this.curr==0&&(this.start=new Date),this.curr+=t,this.render(),this.curr>=this.total){this.render(void 0,!0),this.complete=!0,this.terminate(),this.callback(this);return}};Zt.prototype.render=function(t,e){if(e=e!==void 0?e:!1,t&&(this.tokens=t),!!this.stream.isTTY){var i=Date.now(),r=i-this.lastRender;if(!(!e&&r0&&(l=l.slice(0,-1)+this.chars.head),h=h.replace(":bar",l+o),this.tokens)for(var m in this.tokens)h=h.replace(":"+m,this.tokens[m]);this.lastDraw!==h&&(this.stream.cursorTo(0),this.stream.write(h),this.stream.clearLine(1),this.lastDraw=h)}}};Zt.prototype.update=function(t,e){var i=Math.floor(t*this.total),r=i-this.curr;this.tick(r,e)};Zt.prototype.interrupt=function(t){this.stream.clearLine(),this.stream.cursorTo(0),this.stream.write(t),this.stream.write(` -`),this.stream.write(this.lastDraw)};Zt.prototype.terminate=function(){this.clear?this.stream.clearLine&&(this.stream.clearLine(),this.stream.cursorTo(0)):this.stream.write(` -`)}});var jl=y((ov,Dl)=>{Dl.exports=Ul()});var Hl=y(ql=>{var D=ql,{Buffer:Qi}=require("buffer"),wd=require("os");D.toBuffer=function(t,e,i){i=~~i;let r;if(this.isV4Format(t))r=e||Qi.alloc(i+4),t.split(/\./g).map(n=>{r[i++]=parseInt(n,10)&255});else if(this.isV6Format(t)){let n=t.split(":",8),s;for(s=0;s0;s--)o.push("0");n.splice(...o)}for(r=e||Qi.alloc(i+16),s=0;s>8&255,r[i++]=o&255}}if(!r)throw Error(`Invalid ip address: ${t}`);return r};D.toString=function(t,e,i){e=~~e,i=i||t.length-e;let r=[];if(i===4){for(let n=0;n32?e="ipv6":e=Ei(e);let i=4;e==="ipv6"&&(i=16);let r=Qi.alloc(i);for(let n=0,s=r.length;n>o)&255}return D.toString(r)};D.mask=function(t,e){t=D.toBuffer(t),e=D.toBuffer(e);let i=Qi.alloc(Math.max(t.length,e.length)),r;if(t.length===e.length)for(r=0;rt.length&&(i=e,r=t);let n=i.length-r.length;for(let s=n;sEi(s.family)===e);return n.length===0?void 0:n[0].address}let r=Object.keys(i).map(n=>{let s=i[n].filter(o=>(o.family=Ei(o.family),o.family!==e||D.isLoopback(o.address)?!1:t?t==="public"?D.isPrivate(o.address):D.isPublic(o.address):!0));return s.length?s[0].address:void 0}).filter(Boolean);return r.length?r[0]:D.loopback(e)};D.toLong=function(t){let e=0;return t.split(".").forEach(i=>{e<<=8,e+=parseInt(i)}),e>>>0};D.fromLong=function(t){return`${t>>>24}.${t>>16&255}.${t>>8&255}.${t&255}`};D.normalizeToLong=function(t){let e=t.split(".").map(n=>n.startsWith("0x")||n.startsWith("0X")?parseInt(n,16):n.startsWith("0")&&n!=="0"&&/^[0-7]+$/.test(n)?parseInt(n,8):/^[1-9]\d*$/.test(n)||n==="0"?parseInt(n,10):NaN);if(e.some(isNaN))return-1;let i=0;switch(e.length){case 1:i=e[0];break;case 2:if(e[0]>255||e[1]>16777215)return-1;i=e[0]<<24|e[1]&16777215;break;case 3:if(e[0]>255||e[1]>255||e[2]>65535)return-1;i=e[0]<<24|e[1]<<16|e[2]&65535;break;case 4:if(e.some(n=>n>255))return-1;i=e[0]<<24|e[1]<<16|e[2]<<8|e[3];break;default:return-1}return i>>>0}});var zl=y(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});var Vl=require("buffer"),Ct={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};at.ERRORS=Ct;function kd(t){if(!Vl.Buffer.isEncoding(t))throw new Error(Ct.INVALID_ENCODING)}at.checkEncoding=kd;function $l(t){return typeof t=="number"&&isFinite(t)&&Td(t)}at.isFiniteInteger=$l;function Gl(t,e){if(typeof t=="number"){if(!$l(t)||t<0)throw new Error(e?Ct.INVALID_OFFSET:Ct.INVALID_LENGTH)}else throw new Error(e?Ct.INVALID_OFFSET_NON_NUMBER:Ct.INVALID_LENGTH_NON_NUMBER)}function Cd(t){Gl(t,!1)}at.checkLengthValue=Cd;function Od(t){Gl(t,!0)}at.checkOffsetValue=Od;function Id(t,e){if(t<0||t>e.length)throw new Error(Ct.INVALID_TARGET_OFFSET)}at.checkTargetOffset=Id;function Td(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}function Ad(t){if(typeof BigInt=="undefined")throw new Error("Platform does not support JS BigInt type.");if(typeof Vl.Buffer.prototype[t]=="undefined")throw new Error(`Platform does not support Buffer.prototype.${t}.`)}at.bigIntAndBufferInt64Check=Ad});var Yl=y(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var te=zl(),Wl=4096,Rd="utf8",En=class t{constructor(e){if(this.length=0,this._encoding=Rd,this._writeOffset=0,this._readOffset=0,t.isSmartBufferOptions(e))if(e.encoding&&(te.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(te.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(te.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(e.buff)if(Buffer.isBuffer(e.buff))this._buff=e.buff,this.length=e.buff.length;else throw new Error(te.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(Wl);else{if(typeof e!="undefined")throw new Error(te.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(Wl)}}static fromSize(e,i){return new this({size:e,encoding:i})}static fromBuffer(e,i){return new this({buff:e,encoding:i})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let i=e;return i&&(i.encoding!==void 0||i.size!==void 0||i.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return te.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return te.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,i){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,i),this}insertInt8(e,i){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,i)}writeInt16BE(e,i){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,i)}insertInt16BE(e,i){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,i)}writeInt16LE(e,i){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,i)}insertInt16LE(e,i){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,i)}writeInt32BE(e,i){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,i)}insertInt32BE(e,i){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,i)}writeInt32LE(e,i){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,i)}insertInt32LE(e,i){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,i)}writeBigInt64BE(e,i){return te.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,i)}insertBigInt64BE(e,i){return te.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,i)}writeBigInt64LE(e,i){return te.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,i)}insertBigInt64LE(e,i){return te.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,i)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return te.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return te.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,i)}insertUInt8(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,i)}writeUInt16BE(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,i)}insertUInt16BE(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,i)}writeUInt16LE(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,i)}insertUInt16LE(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,i)}writeUInt32BE(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,i)}insertUInt32BE(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,i)}writeUInt32LE(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,i)}insertUInt32LE(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,i)}writeBigUInt64BE(e,i){return te.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,i)}insertBigUInt64BE(e,i){return te.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,i)}writeBigUInt64LE(e,i){return te.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,i)}insertBigUInt64LE(e,i){return te.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,i)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,i){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,i)}insertFloatBE(e,i){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,i)}writeFloatLE(e,i){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,i)}insertFloatLE(e,i){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,i)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,i){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,i)}insertDoubleBE(e,i){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,i)}writeDoubleLE(e,i){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,i)}insertDoubleLE(e,i){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,i)}readString(e,i){let r;typeof e=="number"?(te.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(i=e,r=this.length-this._readOffset),typeof i!="undefined"&&te.checkEncoding(i);let n=this._buff.slice(this._readOffset,this._readOffset+r).toString(i||this._encoding);return this._readOffset+=r,n}insertString(e,i,r){return te.checkOffsetValue(i),this._handleString(e,!0,i,r)}writeString(e,i,r){return this._handleString(e,!1,i,r)}readStringNT(e){typeof e!="undefined"&&te.checkEncoding(e);let i=this.length;for(let n=this._readOffset;nthis.length)throw new Error(te.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,i){te.checkOffsetValue(i),this._ensureCapacity(this.length+e),ithis.length?this.length=i+e:this.length+=e}_ensureWriteable(e,i){let r=typeof i=="number"?i:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let i=this._buff.length;if(e>i){let r=this._buff,n=i*3/2+1;n{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.SOCKS5_NO_ACCEPTABLE_AUTH=_e.SOCKS5_CUSTOM_AUTH_END=_e.SOCKS5_CUSTOM_AUTH_START=_e.SOCKS_INCOMING_PACKET_SIZES=_e.SocksClientState=_e.Socks5Response=_e.Socks5HostType=_e.Socks5Auth=_e.Socks4Response=_e.SocksCommand=_e.ERRORS=_e.DEFAULT_TIMEOUT=void 0;var Bd=3e4;_e.DEFAULT_TIMEOUT=Bd;var Ld={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};_e.ERRORS=Ld;var Pd={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:t=>t+7,Socks4Response:8};_e.SOCKS_INCOMING_PACKET_SIZES=Pd;var kn;(function(t){t[t.connect=1]="connect",t[t.bind=2]="bind",t[t.associate=3]="associate"})(kn||(kn={}));_e.SocksCommand=kn;var Cn;(function(t){t[t.Granted=90]="Granted",t[t.Failed=91]="Failed",t[t.Rejected=92]="Rejected",t[t.RejectedIdent=93]="RejectedIdent"})(Cn||(Cn={}));_e.Socks4Response=Cn;var On;(function(t){t[t.NoAuth=0]="NoAuth",t[t.GSSApi=1]="GSSApi",t[t.UserPass=2]="UserPass"})(On||(On={}));_e.Socks5Auth=On;var Fd=128;_e.SOCKS5_CUSTOM_AUTH_START=Fd;var Nd=254;_e.SOCKS5_CUSTOM_AUTH_END=Nd;var Md=255;_e.SOCKS5_NO_ACCEPTABLE_AUTH=Md;var In;(function(t){t[t.Granted=0]="Granted",t[t.Failure=1]="Failure",t[t.NotAllowed=2]="NotAllowed",t[t.NetworkUnreachable=3]="NetworkUnreachable",t[t.HostUnreachable=4]="HostUnreachable",t[t.ConnectionRefused=5]="ConnectionRefused",t[t.TTLExpired=6]="TTLExpired",t[t.CommandNotSupported=7]="CommandNotSupported",t[t.AddressNotSupported=8]="AddressNotSupported"})(In||(In={}));_e.Socks5Response=In;var Tn;(function(t){t[t.IPv4=1]="IPv4",t[t.Hostname=3]="Hostname",t[t.IPv6=4]="IPv6"})(Tn||(Tn={}));_e.Socks5HostType=Tn;var An;(function(t){t[t.Created=0]="Created",t[t.Connecting=1]="Connecting",t[t.Connected=2]="Connected",t[t.SentInitialHandshake=3]="SentInitialHandshake",t[t.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",t[t.SentAuthentication=5]="SentAuthentication",t[t.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",t[t.SentFinalHandshake=7]="SentFinalHandshake",t[t.ReceivedFinalResponse=8]="ReceivedFinalResponse",t[t.BoundWaitingForConnection=9]="BoundWaitingForConnection",t[t.Established=10]="Established",t[t.Disconnected=11]="Disconnected",t[t.Error=99]="Error"})(An||(An={}));_e.SocksClientState=An});var Ln=y(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.shuffleArray=Xt.SocksClientError=void 0;var Bn=class extends Error{constructor(e,i){super(e),this.options=i}};Xt.SocksClientError=Bn;function Ud(t){for(let e=t.length-1;e>0;e--){let i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}}Xt.shuffleArray=Ud});var Ql=y(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.validateSocksClientChainOptions=Jt.validateSocksClientOptions=void 0;var He=Ln(),Re=Rn(),Dd=require("stream");function jd(t,e=["connect","bind","associate"]){if(!Re.SocksCommand[t.command])throw new He.SocksClientError(Re.ERRORS.InvalidSocksCommand,t);if(e.indexOf(t.command)===-1)throw new He.SocksClientError(Re.ERRORS.InvalidSocksCommandForOperation,t);if(!Zl(t.destination))throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsDestination,t);if(!Xl(t.proxy))throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsProxy,t);if(Kl(t.proxy,t),t.timeout&&!Jl(t.timeout))throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsTimeout,t);if(t.existing_socket&&!(t.existing_socket instanceof Dd.Duplex))throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsExistingSocket,t)}Jt.validateSocksClientOptions=jd;function qd(t){if(t.command!=="connect")throw new He.SocksClientError(Re.ERRORS.InvalidSocksCommandChain,t);if(!Zl(t.destination))throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsDestination,t);if(!(t.proxies&&Array.isArray(t.proxies)&&t.proxies.length>=2))throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsProxiesLength,t);if(t.proxies.forEach(e=>{if(!Xl(e))throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsProxy,t);Kl(e,t)}),t.timeout&&!Jl(t.timeout))throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsTimeout,t)}Jt.validateSocksClientChainOptions=qd;function Kl(t,e){if(t.custom_auth_method!==void 0){if(t.custom_auth_methodRe.SOCKS5_CUSTOM_AUTH_END)throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(t.custom_auth_request_handler===void 0||typeof t.custom_auth_request_handler!="function")throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(t.custom_auth_response_size===void 0)throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(t.custom_auth_response_handler===void 0||typeof t.custom_auth_response_handler!="function")throw new He.SocksClientError(Re.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}function Zl(t){return t&&typeof t.host=="string"&&typeof t.port=="number"&&t.port>=0&&t.port<=65535}function Xl(t){return t&&(typeof t.host=="string"||typeof t.ipaddress=="string")&&typeof t.port=="number"&&t.port>=0&&t.port<=65535&&(t.type===4||t.type===5)}function Jl(t){return typeof t=="number"&&t>0}});var ec=y(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.ReceiveBuffer=void 0;var Pn=class{constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let i=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),i.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let i=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(i),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,i}};er.ReceiveBuffer=Pn});var tc=y(dt=>{"use strict";var Qt=dt&&dt.__awaiter||function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(u){try{c(r.next(u))}catch(f){o(f)}}function a(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):n(u.value).then(l,a)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(dt,"__esModule",{value:!0});dt.SocksClientError=dt.SocksClient=void 0;var Hd=require("events"),ei=require("net"),ze=Hl(),Ve=Yl(),S=Rn(),Fn=Ql(),Vd=ec(),Nn=Ln();Object.defineProperty(dt,"SocksClientError",{enumerable:!0,get:function(){return Nn.SocksClientError}});var Mn=class t extends Hd.EventEmitter{constructor(e){super(),this.options=Object.assign({},e),(0,Fn.validateSocksClientOptions)(e),this.setState(S.SocksClientState.Created)}static createConnection(e,i){return new Promise((r,n)=>{try{(0,Fn.validateSocksClientOptions)(e,["connect"])}catch(o){return typeof i=="function"?(i(o),r(o)):n(o)}let s=new t(e);s.connect(e.existing_socket),s.once("established",o=>{s.removeAllListeners(),typeof i=="function"&&i(null,o),r(o)}),s.once("error",o=>{s.removeAllListeners(),typeof i=="function"?(i(o),r(o)):n(o)})})}static createConnectionChain(e,i){return new Promise((r,n)=>Qt(this,void 0,void 0,function*(){try{(0,Fn.validateSocksClientChainOptions)(e)}catch(o){return typeof i=="function"?(i(o),r(o)):n(o)}let s;e.randomizeChain&&(0,Nn.shuffleArray)(e.proxies);try{for(let o=0;othis.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let i=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||S.DEFAULT_TIMEOUT);i.unref&&typeof i.unref=="function"&&i.unref(),e?this.socket=e:this.socket=new ei.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(S.SocksClientState.Connecting),this.receiveBuffer=new Vd.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let n=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",n)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==S.SocksClientState.Established&&this.state!==S.SocksClientState.BoundWaitingForConnection&&this.closeSocket(S.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(S.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(S.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==S.SocksClientState.Established&&this.state!==S.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===S.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===S.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===S.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===S.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(S.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(S.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==S.SocksClientState.Error&&(this.setState(S.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new Nn.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",i=new Ve.SmartBuffer;i.writeUInt8(4),i.writeUInt8(S.SocksCommand[this.options.command]),i.writeUInt16BE(this.options.destination.port),ei.isIPv4(this.options.destination.host)?(i.writeBuffer(ze.toBuffer(this.options.destination.host)),i.writeStringNT(e)):(i.writeUInt8(0),i.writeUInt8(0),i.writeUInt8(0),i.writeUInt8(1),i.writeStringNT(e),i.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=S.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(i.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==S.Socks4Response.Granted)this.closeSocket(`${S.ERRORS.Socks4ProxyRejectedConnection} - (${S.Socks4Response[e[1]]})`);else if(S.SocksCommand[this.options.command]===S.SocksCommand.bind){let i=Ve.SmartBuffer.fromBuffer(e);i.readOffset=2;let r={port:i.readUInt16BE(),host:ze.fromLong(i.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(S.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(S.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==S.Socks4Response.Granted)this.closeSocket(`${S.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${S.Socks4Response[e[1]]})`);else{let i=Ve.SmartBuffer.fromBuffer(e);i.readOffset=2;let r={port:i.readUInt16BE(),host:ze.fromLong(i.readUInt32BE())};this.setState(S.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new Ve.SmartBuffer,i=[S.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&i.push(S.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&i.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(i.length);for(let r of i)e.writeUInt8(r);this.nextRequiredPacketBufferSize=S.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(S.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(S.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===S.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(S.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===S.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=S.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===S.Socks5Auth.UserPass?(this.socks5ChosenAuthType=S.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(S.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",i=this.options.proxy.password||"",r=new Ve.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(i)),r.writeString(i),this.nextRequiredPacketBufferSize=S.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(S.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return Qt(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(S.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return Qt(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return Qt(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return Qt(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return Qt(this,void 0,void 0,function*(){this.setState(S.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===S.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===S.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(S.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new Ve.SmartBuffer;e.writeUInt8(5),e.writeUInt8(S.SocksCommand[this.options.command]),e.writeUInt8(0),ei.isIPv4(this.options.destination.host)?(e.writeUInt8(S.Socks5HostType.IPv4),e.writeBuffer(ze.toBuffer(this.options.destination.host))):ei.isIPv6(this.options.destination.host)?(e.writeUInt8(S.Socks5HostType.IPv6),e.writeBuffer(ze.toBuffer(this.options.destination.host))):(e.writeUInt8(S.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=S.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(S.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==S.Socks5Response.Granted)this.closeSocket(`${S.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${S.Socks5Response[e[1]]}`);else{let i=e[3],r,n;if(i===S.Socks5HostType.IPv4){let s=S.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length{"use strict";var $d=Ot&&Ot.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),Gd=Ot&&Ot.__exportStar||function(t,e){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&$d(e,t,i)};Object.defineProperty(Ot,"__esModule",{value:!0});Gd(tc(),Ot)});var rc=y(It=>{"use strict";var zd=It&&It.__awaiter||function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(u){try{c(r.next(u))}catch(f){o(f)}}function a(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):n(u.value).then(l,a)}c((r=r.apply(t,e||[])).next())})},tr=It&&It.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(It,"__esModule",{value:!0});var Wd=tr(require("dns")),Yd=tr(require("tls")),Kd=tr(require("url")),Zd=tr(Ht()),Xd=Ir(),Jd=ic(),Un=Zd.default("socks-proxy-agent");function Qd(t){return new Promise((e,i)=>{Wd.default.lookup(t,(r,n)=>{r?i(r):e(n)})})}function em(t){let e=0,i=!1,r=5,n=t.hostname||t.host;if(!n)throw new TypeError('No "host"');if(typeof t.port=="number"?e=t.port:typeof t.port=="string"&&(e=parseInt(t.port,10)),e||(e=1080),t.protocol)switch(t.protocol.replace(":","")){case"socks4":i=!0;case"socks4a":r=4;break;case"socks5":i=!0;case"socks":case"socks5h":r=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${t.protocol}`)}if(typeof t.type!="undefined")if(t.type===4||t.type===5)r=t.type;else throw new TypeError(`"type" must be 4 or 5, got: ${t.type}`);let s={host:n,port:e,type:r},o=t.userId||t.username,l=t.password;if(t.auth){let a=t.auth.split(":");o=a[0],l=a[1]}return o&&Object.defineProperty(s,"userId",{value:o,enumerable:!1}),l&&Object.defineProperty(s,"password",{value:l,enumerable:!1}),{lookup:i,proxy:s}}var Dn=class extends Xd.Agent{constructor(e){let i;if(typeof e=="string"?i=Kd.default.parse(e):i=e,!i)throw new TypeError("a SOCKS proxy server `host` and `port` must be specified!");super(i);let r=em(i);this.lookup=r.lookup,this.proxy=r.proxy,this.tlsConnectionOptions=i.tls||{}}callback(e,i){return zd(this,void 0,void 0,function*(){let{lookup:r,proxy:n}=this,{host:s,port:o,timeout:l}=i;if(!s)throw new Error("No `host` defined!");r&&(s=yield Qd(s));let a={proxy:n,destination:{host:s,port:o},command:"connect",timeout:l};Un("Creating socks proxy connection: %o",a);let{socket:c}=yield Jd.SocksClient.createConnection(a);if(Un("Successfully created socks proxy connection"),i.secureEndpoint){Un("Upgrading socket connection to TLS");let u=i.servername||i.host;return Yd.default.connect(Object.assign(Object.assign(Object.assign({},tm(i,"host","hostname","path","port")),{socket:c,servername:u}),this.tlsConnectionOptions))}return c})}};It.default=Dn;function tm(t,...e){let i={},r;for(r in t)e.includes(r)||(i[r]=t[r]);return i}});var sc=y((Hn,nc)=>{"use strict";var im=Hn&&Hn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},jn=im(rc());function qn(t){return new jn.default(t)}(function(t){t.SocksProxyAgent=jn.default,t.prototype=jn.default.prototype})(qn||(qn={}));nc.exports=qn});var ac=y((vv,oc)=>{"use strict";var rm=/[|\\{}()[\]^$+*?.-]/g;oc.exports=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(rm,"\\$&")}});var fc=y((xv,uc)=>{"use strict";var nm=ac(),sm=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",cc=[].concat(require("module").builtinModules,"bootstrap_node","node").map(t=>new RegExp(`(?:\\((?:node:)?${t}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${t}(?:\\.js)?:\\d+:\\d+$)`));cc.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var Vn=class t{constructor(e){e={ignoredPackages:[],...e},"internals"in e||(e.internals=t.nodeInternals()),"cwd"in e||(e.cwd=sm),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,om(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...cc]}clean(e,i=0){i=" ".repeat(i),Array.isArray(e)||(e=e.split(` -`)),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let r=!1,n=null,s=[];return e.forEach(o=>{if(o=o.replace(/\\/g,"/"),this._internals.some(a=>a.test(o)))return;let l=/^\s*at /.test(o);r?o=o.trimEnd().replace(/^(\s+)at /,"$1"):(o=o.trim(),l&&(o=o.slice(3))),o=o.replace(`${this._cwd}/`,""),o&&(l?(n&&(s.push(n),n=null),s.push(o)):(r=!0,n=o))}),s.map(o=>`${i}${o} -`).join("")}captureString(e,i=this.captureString){typeof e=="function"&&(i=e,e=1/0);let{stackTraceLimit:r}=Error;e&&(Error.stackTraceLimit=e);let n={};Error.captureStackTrace(n,i);let{stack:s}=n;return Error.stackTraceLimit=r,this.clean(s)}capture(e,i=this.capture){typeof e=="function"&&(i=e,e=1/0);let{prepareStackTrace:r,stackTraceLimit:n}=Error;Error.prepareStackTrace=(l,a)=>this._wrapCallSite?a.map(this._wrapCallSite):a,e&&(Error.stackTraceLimit=e);let s={};Error.captureStackTrace(s,i);let{stack:o}=s;return Object.assign(Error,{prepareStackTrace:r,stackTraceLimit:n}),o}at(e=this.at){let[i]=this.capture(1,e);if(!i)return{};let r={line:i.getLineNumber(),column:i.getColumnNumber()};lc(r,i.getFileName(),this._cwd),i.isConstructor()&&(r.constructor=!0),i.isEval()&&(r.evalOrigin=i.getEvalOrigin()),i.isNative()&&(r.native=!0);let n;try{n=i.getTypeName()}catch{}n&&n!=="Object"&&n!=="[object Object]"&&(r.type=n);let s=i.getFunctionName();s&&(r.function=s);let o=i.getMethodName();return o&&s!==o&&(r.method=o),r}parseLine(e){let i=e&&e.match(am);if(!i)return null;let r=i[1]==="new",n=i[2],s=i[3],o=i[4],l=Number(i[5]),a=Number(i[6]),c=i[7],u=i[8],f=i[9],h=i[10]==="native",p=i[11]===")",d,m={};if(u&&(m.line=Number(u)),f&&(m.column=Number(f)),p&&c){let v=0;for(let E=c.length-1;E>0;E--)if(c.charAt(E)===")")v++;else if(c.charAt(E)==="("&&c.charAt(E-1)===" "&&(v--,v===-1&&c.charAt(E-1)===" ")){let I=c.slice(0,E-1);c=c.slice(E+1),n+=` (${I}`;break}}if(n){let v=n.match(lm);v&&(n=v[1],d=v[2])}return lc(m,c,this._cwd),r&&(m.constructor=!0),s&&(m.evalOrigin=s,m.evalLine=l,m.evalColumn=a,m.evalFile=o&&o.replace(/\\/g,"/")),h&&(m.native=!0),n&&(m.function=n),d&&n!==d&&(m.method=d),m}};function lc(t,e,i){e&&(e=e.replace(/\\/g,"/"),e.startsWith(`${i}/`)&&(e=e.slice(i.length+1)),t.file=e)}function om(t){if(t.length===0)return[];let e=t.map(i=>nm(i));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${e.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var am=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),lm=/^(.*?) \[as (.*?)\]$/;uc.exports=Vn});var mc=y((_v,dc)=>{"use strict";var{Duplex:cm}=require("stream");function hc(t){t.emit("close")}function um(){!this.destroyed&&this._writableState.finished&&this.destroy()}function pc(t){this.removeListener("error",pc),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function fm(t,e){let i=!0,r=new cm({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(s,o){let l=!o&&r._readableState.objectMode?s.toString():s;r.push(l)||t.pause()}),t.once("error",function(s){r.destroyed||(i=!1,r.destroy(s))}),t.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(n,s){if(t.readyState===t.CLOSED){s(n),process.nextTick(hc,r);return}let o=!1;t.once("error",function(a){o=!0,s(a)}),t.once("close",function(){o||s(n),process.nextTick(hc,r)}),i&&t.terminate()},r._final=function(n){if(t.readyState===t.CONNECTING){t.once("open",function(){r._final(n)});return}t._socket!==null&&(t._socket._writableState.finished?(n(),r._readableState.endEmitted&&r.destroy()):(t._socket.once("finish",function(){n()}),t.close()))},r._read=function(){t.isPaused&&t.resume()},r._write=function(n,s,o){if(t.readyState===t.CONNECTING){t.once("open",function(){r._write(n,s,o)});return}t.send(n,o)},r.on("end",um),r.on("error",pc),r}dc.exports=fm});var mt=y((yv,gc)=>{"use strict";gc.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Si=y((bv,$n)=>{"use strict";var{EMPTY_BUFFER:hm}=mt();function vc(t,e){if(t.length===0)return hm;if(t.length===1)return t[0];let i=Buffer.allocUnsafe(e),r=0;for(let n=0;n{"use strict";var bc=Symbol("kDone"),Gn=Symbol("kRun"),zn=class{constructor(e){this[bc]=()=>{this.pending--,this[Gn]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Gn]()}[Gn](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[bc])}}};wc.exports=zn});var Oi=y((Ev,Oc)=>{"use strict";var ki=require("zlib"),Sc=Si(),pm=Ec(),{kStatusCode:kc}=mt(),dm=Buffer.from([0,0,255,255]),sr=Symbol("permessage-deflate"),lt=Symbol("total-length"),Ci=Symbol("callback"),gt=Symbol("buffers"),nr=Symbol("error"),rr,Wn=class{constructor(e,i,r){if(this._maxPayload=r|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!i,this._deflate=null,this._inflate=null,this.params=null,!rr){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;rr=new pm(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[Ci];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let i=this._options,r=e.find(n=>!(i.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(i.serverMaxWindowBits===!1||typeof i.serverMaxWindowBits=="number"&&i.serverMaxWindowBits>n.server_max_window_bits)||typeof i.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return i.serverNoContextTakeover&&(r.server_no_context_takeover=!0),i.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof i.serverMaxWindowBits=="number"&&(r.server_max_window_bits=i.serverMaxWindowBits),typeof i.clientMaxWindowBits=="number"?r.client_max_window_bits=i.clientMaxWindowBits:(r.client_max_window_bits===!0||i.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(e){let i=e[0];if(this._options.clientNoContextTakeover===!1&&i.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!i.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(i.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&i.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return i}normalizeParams(e){return e.forEach(i=>{Object.keys(i).forEach(r=>{let n=i[r];if(n.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(n=n[0],r==="client_max_window_bits"){if(n!==!0){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else if(r==="server_max_window_bits"){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else throw new Error(`Unknown parameter "${r}"`);i[r]=n})}),e}decompress(e,i,r){rr.add(n=>{this._decompress(e,i,(s,o)=>{n(),r(s,o)})})}compress(e,i,r){rr.add(n=>{this._compress(e,i,(s,o)=>{n(),r(s,o)})})}_decompress(e,i,r){let n=this._isServer?"client":"server";if(!this._inflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?ki.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=ki.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[sr]=this,this._inflate[lt]=0,this._inflate[gt]=[],this._inflate.on("error",gm),this._inflate.on("data",Cc)}this._inflate[Ci]=r,this._inflate.write(e),i&&this._inflate.write(dm),this._inflate.flush(()=>{let s=this._inflate[nr];if(s){this._inflate.close(),this._inflate=null,r(s);return}let o=Sc.concat(this._inflate[gt],this._inflate[lt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[lt]=0,this._inflate[gt]=[],i&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,i,r){let n=this._isServer?"server":"client";if(!this._deflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?ki.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=ki.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[lt]=0,this._deflate[gt]=[],this._deflate.on("data",mm)}this._deflate[Ci]=r,this._deflate.write(e),this._deflate.flush(ki.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Sc.concat(this._deflate[gt],this._deflate[lt]);i&&(s=s.slice(0,s.length-4)),this._deflate[Ci]=null,this._deflate[lt]=0,this._deflate[gt]=[],i&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};Oc.exports=Wn;function mm(t){this[gt].push(t),this[lt]+=t.length}function Cc(t){if(this[lt]+=t.length,this[sr]._maxPayload<1||this[lt]<=this[sr]._maxPayload){this[gt].push(t);return}this[nr]=new RangeError("Max payload size exceeded"),this[nr].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[nr][kc]=1009,this.removeListener("data",Cc),this.reset()}function gm(t){this[sr]._inflate=null,t[kc]=1007,this[Ci](t)}});var Ii=y((Sv,Yn)=>{"use strict";var Ic=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Tc(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Ac(t){let e=t.length,i=0;for(;i=e||(t[i+1]&192)!==128||(t[i+2]&192)!==128||t[i]===224&&(t[i+1]&224)===128||t[i]===237&&(t[i+1]&224)===160)return!1;i+=3}else if((t[i]&248)===240){if(i+3>=e||(t[i+1]&192)!==128||(t[i+2]&192)!==128||(t[i+3]&192)!==128||t[i]===240&&(t[i+1]&240)===128||t[i]===244&&t[i+1]>143||t[i]>244)return!1;i+=4}else return!1;return!0}try{let t=require("utf-8-validate");Yn.exports={isValidStatusCode:Tc,isValidUTF8(e){return e.length<150?Ac(e):t(e)},tokenChars:Ic}}catch{Yn.exports={isValidStatusCode:Tc,isValidUTF8:Ac,tokenChars:Ic}}});var Jn=y((kv,Mc)=>{"use strict";var{Writable:vm}=require("stream"),Rc=Oi(),{BINARY_TYPES:xm,EMPTY_BUFFER:Bc,kStatusCode:_m,kWebSocket:ym}=mt(),{concat:Kn,toArrayBuffer:bm,unmask:wm}=Si(),{isValidStatusCode:Em,isValidUTF8:Lc}=Ii(),Ti=0,Pc=1,Fc=2,Nc=3,Zn=4,Sm=5,Xn=class extends vm{constructor(e={}){super(),this._binaryType=e.binaryType||xm[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[ym]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=Ti,this._loop=!1}_write(e,i,r){if(this._opcode===8&&this._state==Ti)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e=r.length?i.set(this._buffers.shift(),n):(i.set(new Uint8Array(r.buffer,r.byteOffset,e),n),this._buffers[0]=r.slice(e)),e-=r.length}while(e>0);return i}startLoop(e){let i;this._loop=!0;do switch(this._state){case Ti:i=this.getInfo();break;case Pc:i=this.getPayloadLength16();break;case Fc:i=this.getPayloadLength64();break;case Nc:this.getMask();break;case Zn:i=this.getData(e);break;default:this._loop=!1;return}while(this._loop);e(i)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let e=this.consume(2);if(e[0]&48)return this._loop=!1,Ie(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let i=(e[0]&64)===64;if(i&&!this._extensions[Rc.extensionName])return this._loop=!1,Ie(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(e[0]&128)===128,this._opcode=e[0]&15,this._payloadLength=e[1]&127,this._opcode===0){if(i)return this._loop=!1,Ie(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Ie(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,Ie(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,Ie(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(i)return this._loop=!1,Ie(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,Ie(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,Ie(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(e[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,Ie(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Ie(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=Pc;else if(this._payloadLength===127)this._state=Fc;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let e=this.consume(8),i=e.readUInt32BE(0);return i>Math.pow(2,53-32)-1?(this._loop=!1,Ie(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=i*Math.pow(2,32)+e.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,Ie(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=Nc:this._state=Zn}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Zn}getData(e){let i=Bc;if(this._payloadLength){if(this._bufferedBytes7)return this.controlMessage(i);if(this._compressed){this._state=Sm,this.decompress(i,e);return}return i.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(i)),this.dataMessage()}decompress(e,i){this._extensions[Rc.extensionName].decompress(e,this._fin,(n,s)=>{if(n)return i(n);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return i(Ie(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(s)}let o=this.dataMessage();if(o)return i(o);this.startLoop(i)})}dataMessage(){if(this._fin){let e=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;this._binaryType==="nodebuffer"?r=Kn(i,e):this._binaryType==="arraybuffer"?r=bm(Kn(i,e)):r=i,this.emit("message",r,!0)}else{let r=Kn(i,e);if(!this._skipUTF8Validation&&!Lc(r))return this._loop=!1,Ie(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",r,!1)}}this._state=Ti}controlMessage(e){if(this._opcode===8)if(this._loop=!1,e.length===0)this.emit("conclude",1005,Bc),this.end();else{if(e.length===1)return Ie(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{let i=e.readUInt16BE(0);if(!Em(i))return Ie(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let r=e.slice(2);if(!this._skipUTF8Validation&&!Lc(r))return Ie(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",i,r),this.end()}}else this._opcode===9?this.emit("ping",e):this.emit("pong",e);this._state=Ti}};Mc.exports=Xn;function Ie(t,e,i,r,n){let s=new t(i?`Invalid WebSocket frame: ${e}`:e);return Error.captureStackTrace(s,Ie),s.code=n,s[_m]=r,s}});var es=y((Iv,jc)=>{"use strict";var Cv=require("net"),Ov=require("tls"),{randomFillSync:km}=require("crypto"),Uc=Oi(),{EMPTY_BUFFER:Cm}=mt(),{isValidStatusCode:Om}=Ii(),{mask:Dc,toBuffer:ti}=Si(),rt=Symbol("kByteLength"),Im=Buffer.alloc(4),Qn=class t{constructor(e,i,r){this._extensions=i||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,i){let r,n=!1,s=2,o=!1;i.mask&&(r=i.maskBuffer||Im,i.generateMask?i.generateMask(r):km(r,0,4),o=(r[0]|r[1]|r[2]|r[3])===0,s=6);let l;typeof e=="string"?(!i.mask||o)&&i[rt]!==void 0?l=i[rt]:(e=Buffer.from(e),l=e.length):(l=e.length,n=i.mask&&i.readOnly&&!o);let a=l;l>=65536?(s+=8,a=127):l>125&&(s+=2,a=126);let c=Buffer.allocUnsafe(n?l+s:s);return c[0]=i.fin?i.opcode|128:i.opcode,i.rsv1&&(c[0]|=64),c[1]=a,a===126?c.writeUInt16BE(l,2):a===127&&(c[2]=c[3]=0,c.writeUIntBE(l,4,6)),i.mask?(c[1]|=128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o?[c,e]:n?(Dc(e,r,c,s,l),[c]):(Dc(e,r,e,0,l),[c,e])):[c,e]}close(e,i,r,n){let s;if(e===void 0)s=Cm;else{if(typeof e!="number"||!Om(e))throw new TypeError("First argument must be a valid error code number");if(i===void 0||!i.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let l=Buffer.byteLength(i);if(l>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+l),s.writeUInt16BE(e,0),typeof i=="string"?s.write(i,2):s.set(i,2)}}let o={[rt]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,s,!1,o,n]):this.sendFrame(t.frame(s,o),n)}ping(e,i,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):(e=ti(e),n=e.length,s=ti.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[rt]:n,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}pong(e,i,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):(e=ti(e),n=e.length,s=ti.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[rt]:n,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}send(e,i,r){let n=this._extensions[Uc.extensionName],s=i.binary?2:1,o=i.compress,l,a;if(typeof e=="string"?(l=Buffer.byteLength(e),a=!1):(e=ti(e),l=e.length,a=ti.readOnly),this._firstFragment?(this._firstFragment=!1,o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=l>=n._threshold),this._compress=o):(o=!1,s=0),i.fin&&(this._firstFragment=!0),n){let c={[rt]:l,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:a,rsv1:o};this._deflating?this.enqueue([this.dispatch,e,this._compress,c,r]):this.dispatch(e,this._compress,c,r)}else this.sendFrame(t.frame(e,{[rt]:l,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:a,rsv1:!1}),r)}dispatch(e,i,r,n){if(!i){this.sendFrame(t.frame(e,r),n);return}let s=this._extensions[Uc.extensionName];this._bufferedBytes+=r[rt],this._deflating=!0,s.compress(e,r.fin,(o,l)=>{if(this._socket.destroyed){let a=new Error("The socket was closed while data was being compressed");typeof n=="function"&&n(a);for(let c=0;c{"use strict";var{kForOnEventAttribute:ts,kListener:qc}=mt(),Hc=Symbol("kCode"),Vc=Symbol("kData"),$c=Symbol("kError"),Gc=Symbol("kMessage"),zc=Symbol("kReason"),ii=Symbol("kTarget"),Wc=Symbol("kType"),Yc=Symbol("kWasClean"),ct=class{constructor(e){this[ii]=null,this[Wc]=e}get target(){return this[ii]}get type(){return this[Wc]}};Object.defineProperty(ct.prototype,"target",{enumerable:!0});Object.defineProperty(ct.prototype,"type",{enumerable:!0});var Tt=class extends ct{constructor(e,i={}){super(e),this[Hc]=i.code===void 0?0:i.code,this[zc]=i.reason===void 0?"":i.reason,this[Yc]=i.wasClean===void 0?!1:i.wasClean}get code(){return this[Hc]}get reason(){return this[zc]}get wasClean(){return this[Yc]}};Object.defineProperty(Tt.prototype,"code",{enumerable:!0});Object.defineProperty(Tt.prototype,"reason",{enumerable:!0});Object.defineProperty(Tt.prototype,"wasClean",{enumerable:!0});var ri=class extends ct{constructor(e,i={}){super(e),this[$c]=i.error===void 0?null:i.error,this[Gc]=i.message===void 0?"":i.message}get error(){return this[$c]}get message(){return this[Gc]}};Object.defineProperty(ri.prototype,"error",{enumerable:!0});Object.defineProperty(ri.prototype,"message",{enumerable:!0});var Ai=class extends ct{constructor(e,i={}){super(e),this[Vc]=i.data===void 0?null:i.data}get data(){return this[Vc]}};Object.defineProperty(Ai.prototype,"data",{enumerable:!0});var Tm={addEventListener(t,e,i={}){let r;if(t==="message")r=function(s,o){let l=new Ai("message",{data:o?s:s.toString()});l[ii]=this,e.call(this,l)};else if(t==="close")r=function(s,o){let l=new Tt("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});l[ii]=this,e.call(this,l)};else if(t==="error")r=function(s){let o=new ri("error",{error:s,message:s.message});o[ii]=this,e.call(this,o)};else if(t==="open")r=function(){let s=new ct("open");s[ii]=this,e.call(this,s)};else return;r[ts]=!!i[ts],r[qc]=e,i.once?this.once(t,r):this.on(t,r)},removeEventListener(t,e){for(let i of this.listeners(t))if(i[qc]===e&&!i[ts]){this.removeListener(t,i);break}}};Kc.exports={CloseEvent:Tt,ErrorEvent:ri,Event:ct,EventTarget:Tm,MessageEvent:Ai}});var is=y((Av,Xc)=>{"use strict";var{tokenChars:Ri}=Ii();function ot(t,e,i){t[e]===void 0?t[e]=[i]:t[e].push(i)}function Am(t){let e=Object.create(null),i=Object.create(null),r=!1,n=!1,s=!1,o,l,a=-1,c=-1,u=-1,f=0;for(;f{let i=t[e];return Array.isArray(i)||(i=[i]),i.map(r=>[e].concat(Object.keys(r).map(n=>{let s=r[n];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?n:`${n}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Xc.exports={format:Rm,parse:Am}});var ls=y((Bv,au)=>{"use strict";var Bm=require("events"),Lm=require("https"),Pm=require("http"),eu=require("net"),Fm=require("tls"),{randomBytes:Nm,createHash:Mm}=require("crypto"),{Readable:Rv}=require("stream"),{URL:rs}=require("url"),vt=Oi(),Um=Jn(),Dm=es(),{BINARY_TYPES:Jc,EMPTY_BUFFER:or,GUID:jm,kForOnEventAttribute:ns,kListener:qm,kStatusCode:Hm,kWebSocket:De,NOOP:tu}=mt(),{EventTarget:{addEventListener:Vm,removeEventListener:$m}}=Zc(),{format:Gm,parse:zm}=is(),{toBuffer:Wm}=Si(),ut=["CONNECTING","OPEN","CLOSING","CLOSED"],Ym=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,ss=[8,13],Km=30*1e3,Ce=class t extends Bm{constructor(e,i,r){super(),this._binaryType=Jc[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=or,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,i===void 0?i=[]:Array.isArray(i)||(typeof i=="object"&&i!==null?(r=i,i=[]):i=[i]),iu(this,e,i,r)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(e){Jc.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,i,r){let n=new Um({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation});this._sender=new Dm(e,this._extensions,r.generateMask),this._receiver=n,this._socket=e,n[De]=this,e[De]=this,n.on("conclude",Jm),n.on("drain",Qm),n.on("error",e0),n.on("message",t0),n.on("ping",i0),n.on("pong",r0),e.setTimeout(0),e.setNoDelay(),i.length>0&&e.unshift(i),e.on("close",nu),e.on("data",ar),e.on("end",su),e.on("error",ou),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[vt.extensionName]&&this._extensions[vt.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,i){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){let r="WebSocket was closed before the connection was established";return Ze(this,this._req,r)}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,i,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),Km)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,i,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=i=void 0):typeof i=="function"&&(r=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){as(this,e,r);return}i===void 0&&(i=!this._isServer),this._sender.ping(e||or,i,r)}pong(e,i,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=i=void 0):typeof i=="function"&&(r=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){as(this,e,r);return}i===void 0&&(i=!this._isServer),this._sender.pong(e||or,i,r)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,i,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof i=="function"&&(r=i,i={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){as(this,e,r);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...i};this._extensions[vt.extensionName]||(n.compress=!1),this._sender.send(e||or,n,r)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){let e="WebSocket was closed before the connection was established";return Ze(this,this._req,e)}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ce,"CONNECTING",{enumerable:!0,value:ut.indexOf("CONNECTING")});Object.defineProperty(Ce.prototype,"CONNECTING",{enumerable:!0,value:ut.indexOf("CONNECTING")});Object.defineProperty(Ce,"OPEN",{enumerable:!0,value:ut.indexOf("OPEN")});Object.defineProperty(Ce.prototype,"OPEN",{enumerable:!0,value:ut.indexOf("OPEN")});Object.defineProperty(Ce,"CLOSING",{enumerable:!0,value:ut.indexOf("CLOSING")});Object.defineProperty(Ce.prototype,"CLOSING",{enumerable:!0,value:ut.indexOf("CLOSING")});Object.defineProperty(Ce,"CLOSED",{enumerable:!0,value:ut.indexOf("CLOSED")});Object.defineProperty(Ce.prototype,"CLOSED",{enumerable:!0,value:ut.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(Ce.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(Ce.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[ns])return e[qm];return null},set(e){for(let i of this.listeners(t))if(i[ns]){this.removeListener(t,i);break}typeof e=="function"&&this.addEventListener(t,e,{[ns]:!0})}})});Ce.prototype.addEventListener=Vm;Ce.prototype.removeEventListener=$m;au.exports=Ce;function iu(t,e,i,r){let n={protocolVersion:ss[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!ss.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${ss.join(", ")})`);let s;if(e instanceof rs)s=e,t._url=e.href;else{try{s=new rs(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}t._url=e}let o=s.protocol==="wss:",l=s.protocol==="ws+unix:",a;if(s.protocol!=="ws:"&&!o&&!l?a=`The URL's protocol must be one of "ws:", "wss:", or "ws+unix:"`:l&&!s.pathname?a="The URL's pathname is empty":s.hash&&(a="The URL contains a fragment identifier"),a){let m=new SyntaxError(a);if(t._redirects===0)throw m;os(t,m);return}let c=o?443:80,u=Nm(16).toString("base64"),f=o?Lm.get:Pm.get,h=new Set,p;if(n.createConnection=o?Xm:Zm,n.defaultPort=n.defaultPort||c,n.port=s.port||c,n.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,n.headers={"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket",...n.headers},n.path=s.pathname+s.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(p=new vt(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=Gm({[vt.extensionName]:p.offer()})),i.length){for(let m of i){if(typeof m!="string"||!Ym.test(m)||h.has(m))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(m)}n.headers["Sec-WebSocket-Protocol"]=i.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(s.username||s.password)&&(n.auth=`${s.username}:${s.password}`),l){let m=n.path.split(":");n.socketPath=m[0],n.path=m[1]}let d=t._req=f(n);n.timeout&&d.on("timeout",()=>{Ze(t,d,"Opening handshake has timed out")}),d.on("error",m=>{d===null||d.aborted||(d=t._req=null,os(t,m))}),d.on("response",m=>{let v=m.headers.location,E=m.statusCode;if(v&&n.followRedirects&&E>=300&&E<400){if(++t._redirects>n.maxRedirects){Ze(t,d,"Maximum redirects exceeded");return}d.abort();let I;try{I=new rs(v,e)}catch{let C=new SyntaxError(`Invalid URL: ${v}`);os(t,C);return}iu(t,I,i,r)}else t.emit("unexpected-response",d,m)||Ze(t,d,`Unexpected server response: ${m.statusCode}`)}),d.on("upgrade",(m,v,E)=>{if(t.emit("upgrade",m),t.readyState!==Ce.CONNECTING)return;d=t._req=null;let I=Mm("sha1").update(u+jm).digest("base64");if(m.headers["sec-websocket-accept"]!==I){Ze(t,v,"Invalid Sec-WebSocket-Accept header");return}let w=m.headers["sec-websocket-protocol"],C;if(w!==void 0?h.size?h.has(w)||(C="Server sent an invalid subprotocol"):C="Server sent a subprotocol but none was requested":h.size&&(C="Server sent no subprotocol"),C){Ze(t,v,C);return}w&&(t._protocol=w);let _=m.headers["sec-websocket-extensions"];if(_!==void 0){if(!p){Ze(t,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let $;try{$=zm(_)}catch{Ze(t,v,"Invalid Sec-WebSocket-Extensions header");return}let k=Object.keys($);if(k.length!==1||k[0]!==vt.extensionName){Ze(t,v,"Server indicated an extension that was not requested");return}try{p.accept($[vt.extensionName])}catch{Ze(t,v,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[vt.extensionName]=p}t.setSocket(v,E,{generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})})}function os(t,e){t._readyState=Ce.CLOSING,t.emit("error",e),t.emitClose()}function Zm(t){return t.path=t.socketPath,eu.connect(t)}function Xm(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=eu.isIP(t.host)?"":t.host),Fm.connect(t)}function Ze(t,e,i){t._readyState=Ce.CLOSING;let r=new Error(i);Error.captureStackTrace(r,Ze),e.setHeader?(e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),e.once("abort",t.emitClose.bind(t)),t.emit("error",r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function as(t,e,i){if(e){let r=Wm(e).length;t._socket?t._sender._bufferedBytes+=r:t._bufferedAmount+=r}if(i){let r=new Error(`WebSocket is not open: readyState ${t.readyState} (${ut[t.readyState]})`);i(r)}}function Jm(t,e){let i=this[De];i._closeFrameReceived=!0,i._closeMessage=e,i._closeCode=t,i._socket[De]!==void 0&&(i._socket.removeListener("data",ar),process.nextTick(ru,i._socket),t===1005?i.close():i.close(t,e))}function Qm(){let t=this[De];t.isPaused||t._socket.resume()}function e0(t){let e=this[De];e._socket[De]!==void 0&&(e._socket.removeListener("data",ar),process.nextTick(ru,e._socket),e.close(t[Hm])),e.emit("error",t)}function Qc(){this[De].emitClose()}function t0(t,e){this[De].emit("message",t,e)}function i0(t){let e=this[De];e.pong(t,!e._isServer,tu),e.emit("ping",t)}function r0(t){this[De].emit("pong",t)}function ru(t){t.resume()}function nu(){let t=this[De];this.removeListener("close",nu),this.removeListener("data",ar),this.removeListener("end",su),t._readyState=Ce.CLOSING;let e;!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&(e=t._socket.read())!==null&&t._receiver.write(e),t._receiver.end(),this[De]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",Qc),t._receiver.on("finish",Qc))}function ar(t){this[De]._receiver.write(t)||this.pause()}function su(){let t=this[De];t._readyState=Ce.CLOSING,t._receiver.end(),this.end()}function ou(){let t=this[De];this.removeListener("error",ou),this.on("error",tu),t&&(t._readyState=Ce.CLOSING,this.destroy())}});var cu=y((Lv,lu)=>{"use strict";var{tokenChars:n0}=Ii();function s0(t){let e=new Set,i=-1,r=-1,n=0;for(n;n{"use strict";var o0=require("events"),lr=require("http"),Pv=require("https"),Fv=require("net"),Nv=require("tls"),{createHash:a0}=require("crypto"),uu=is(),At=Oi(),l0=cu(),c0=ls(),{GUID:u0,kWebSocket:f0}=mt(),h0=/^[+/0-9A-Za-z]{22}==$/,fu=0,hu=1,pu=2,cs=class extends o0{constructor(e,i){if(super(),e={maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=lr.createServer((r,n)=>{let s=lr.STATUS_CODES[426];n.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),n.end(s)}),this._server.listen(e.port,e.host,e.backlog,i)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=p0(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,s,o)=>{this.handleUpgrade(n,s,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=fu}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===pu){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Bi,this);return}if(e&&this.once("close",e),this._state!==hu)if(this._state=hu,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Bi,this):process.nextTick(Bi,this);else{let i=this._server;this._removeListeners(),this._removeListeners=this._server=null,i.close(()=>{Bi(this)})}}shouldHandle(e){if(this.options.path){let i=e.url.indexOf("?");if((i!==-1?e.url.slice(0,i):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,i,r,n){i.on("error",us);let s=e.headers["sec-websocket-key"]!==void 0?e.headers["sec-websocket-key"]:!1,o=+e.headers["sec-websocket-version"];if(e.method!=="GET"||e.headers.upgrade.toLowerCase()!=="websocket"||!s||!h0.test(s)||o!==8&&o!==13||!this.shouldHandle(e))return ni(i,400);let l=e.headers["sec-websocket-protocol"],a=new Set;if(l!==void 0)try{a=l0.parse(l)}catch{return ni(i,400)}let c=e.headers["sec-websocket-extensions"],u={};if(this.options.perMessageDeflate&&c!==void 0){let f=new At(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let h=uu.parse(c);h[At.extensionName]&&(f.accept(h[At.extensionName]),u[At.extensionName]=f)}catch{return ni(i,400)}}if(this.options.verifyClient){let f={origin:e.headers[`${o===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(h,p,d,m)=>{if(!h)return ni(i,p||401,d,m);this.completeUpgrade(u,s,a,e,i,r,n)});return}if(!this.options.verifyClient(f))return ni(i,401)}this.completeUpgrade(u,s,a,e,i,r,n)}completeUpgrade(e,i,r,n,s,o,l){if(!s.readable||!s.writable)return s.destroy();if(s[f0])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>fu)return ni(s,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${a0("sha1").update(i+u0).digest("base64")}`],u=new c0(null);if(r.size){let f=this.options.handleProtocols?this.options.handleProtocols(r,n):r.values().next().value;f&&(c.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[At.extensionName]){let f=e[At.extensionName].params,h=uu.format({[At.extensionName]:[f]});c.push(`Sec-WebSocket-Extensions: ${h}`),u._extensions=e}this.emit("headers",c,n),s.write(c.concat(`\r +`)}),this}};function Ud(t,e){t._hasHelpOption&&e.find(r=>r===t._helpLongFlag||r===t._helpShortFlag)&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function $d(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let i,r="127.0.0.1",n="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?i=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(i=s[1],/^\d+$/.test(s[3])?n=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(i=s[1],r=s[3],n=s[4]),i&&n!=="0"?`${i}=${r}:${parseInt(n)+1}`:e})}function Al(t){let e=[];for(let i=t;i;i=i.parent)e.push(i);return e}Vd.Command=Il});var zd=w(($t,Wd)=>{var{Argument:Hx}=Ds(),{Command:Gd}=Hd(),{CommanderError:Gx,InvalidArgumentError:Yd}=un(),{Help:Yx}=xl(),{Option:Wx}=kl();$t=Wd.exports=new Gd;$t.program=$t;$t.Argument=Hx;$t.Command=Gd;$t.CommanderError=Gx;$t.Help=Yx;$t.InvalidArgumentError=Yd;$t.InvalidOptionArgumentError=Yd;$t.Option=Wx});var Zd=w((Kd,Jd)=>{Kd=Jd.exports=Ir;function Ir(t,e){if(this.stream=e.stream||process.stderr,typeof e=="number"){var i=e;e={},e.total=i}else{if(e=e||{},typeof t!="string")throw new Error("format required");if(typeof e.total!="number")throw new Error("total required")}this.fmt=t,this.curr=e.curr||0,this.total=e.total,this.width=e.width||this.total,this.clear=e.clear,this.chars={complete:e.complete||"=",incomplete:e.incomplete||"-",head:e.head||e.complete||"="},this.renderThrottle=e.renderThrottle!==0?e.renderThrottle||16:0,this.lastRender=-1/0,this.callback=e.callback||function(){},this.tokens={},this.lastDraw=""}Ir.prototype.tick=function(t,e){if(t!==0&&(t=t||1),typeof t=="object"&&(e=t,t=1),e&&(this.tokens=e),this.curr==0&&(this.start=new Date),this.curr+=t,this.render(),this.curr>=this.total){this.render(void 0,!0),this.complete=!0,this.terminate(),this.callback(this);return}};Ir.prototype.render=function(t,e){if(e=e!==void 0?e:!1,t&&(this.tokens=t),!!this.stream.isTTY){var i=Date.now(),r=i-this.lastRender;if(!(!e&&r0&&(a=a.slice(0,-1)+this.chars.head),d=d.replace(":bar",a+o),this.tokens)for(var v in this.tokens)d=d.replace(":"+v,this.tokens[v]);this.lastDraw!==d&&(this.stream.cursorTo(0),this.stream.write(d),this.stream.clearLine(1),this.lastDraw=d)}}};Ir.prototype.update=function(t,e){var i=Math.floor(t*this.total),r=i-this.curr;this.tick(r,e)};Ir.prototype.interrupt=function(t){this.stream.clearLine(),this.stream.cursorTo(0),this.stream.write(t),this.stream.write(` +`),this.stream.write(this.lastDraw)};Ir.prototype.terminate=function(){this.clear?this.stream.clearLine&&(this.stream.clearLine(),this.stream.cursorTo(0)):this.stream.write(` +`)}});var Xd=w((q2,Qd)=>{Qd.exports=Zd()});var rm=w(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});var em=require("buffer"),Ki={INVALID_ENCODING:"Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.",INVALID_SMARTBUFFER_SIZE:"Invalid size provided. Size must be a valid integer greater than zero.",INVALID_SMARTBUFFER_BUFFER:"Invalid Buffer provided in SmartBufferOptions.",INVALID_SMARTBUFFER_OBJECT:"Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.",INVALID_OFFSET:"An invalid offset value was provided.",INVALID_OFFSET_NON_NUMBER:"An invalid offset value was provided. A numeric value is required.",INVALID_LENGTH:"An invalid length value was provided.",INVALID_LENGTH_NON_NUMBER:"An invalid length value was provived. A numeric value is required.",INVALID_TARGET_OFFSET:"Target offset is beyond the bounds of the internal SmartBuffer data.",INVALID_TARGET_LENGTH:"Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.",INVALID_READ_BEYOND_BOUNDS:"Attempted to read beyond the bounds of the managed data.",INVALID_WRITE_BEYOND_BOUNDS:"Attempted to write beyond the bounds of the managed data."};li.ERRORS=Ki;function zx(t){if(!em.Buffer.isEncoding(t))throw new Error(Ki.INVALID_ENCODING)}li.checkEncoding=zx;function tm(t){return typeof t=="number"&&isFinite(t)&&Qx(t)}li.isFiniteInteger=tm;function im(t,e){if(typeof t=="number"){if(!tm(t)||t<0)throw new Error(e?Ki.INVALID_OFFSET:Ki.INVALID_LENGTH)}else throw new Error(e?Ki.INVALID_OFFSET_NON_NUMBER:Ki.INVALID_LENGTH_NON_NUMBER)}function Kx(t){im(t,!1)}li.checkLengthValue=Kx;function Jx(t){im(t,!0)}li.checkOffsetValue=Jx;function Zx(t,e){if(t<0||t>e.length)throw new Error(Ki.INVALID_TARGET_OFFSET)}li.checkTargetOffset=Zx;function Qx(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}function Xx(t){if(typeof BigInt=="undefined")throw new Error("Platform does not support JS BigInt type.");if(typeof em.Buffer.prototype[t]=="undefined")throw new Error(`Platform does not support Buffer.prototype.${t}.`)}li.bigIntAndBufferInt64Check=Xx});var sm=w(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var pe=rm(),nm=4096,eS="utf8",Nl=class t{constructor(e){if(this.length=0,this._encoding=eS,this._writeOffset=0,this._readOffset=0,t.isSmartBufferOptions(e))if(e.encoding&&(pe.checkEncoding(e.encoding),this._encoding=e.encoding),e.size)if(pe.isFiniteInteger(e.size)&&e.size>0)this._buff=Buffer.allocUnsafe(e.size);else throw new Error(pe.ERRORS.INVALID_SMARTBUFFER_SIZE);else if(e.buff)if(Buffer.isBuffer(e.buff))this._buff=e.buff,this.length=e.buff.length;else throw new Error(pe.ERRORS.INVALID_SMARTBUFFER_BUFFER);else this._buff=Buffer.allocUnsafe(nm);else{if(typeof e!="undefined")throw new Error(pe.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(nm)}}static fromSize(e,i){return new this({size:e,encoding:i})}static fromBuffer(e,i){return new this({buff:e,encoding:i})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){let i=e;return i&&(i.encoding!==void 0||i.size!==void 0||i.buff!==void 0)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){return pe.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){return pe.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,i){return this._writeNumberValue(Buffer.prototype.writeInt8,1,e,i),this}insertInt8(e,i){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,i)}writeInt16BE(e,i){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,i)}insertInt16BE(e,i){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,i)}writeInt16LE(e,i){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,i)}insertInt16LE(e,i){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,i)}writeInt32BE(e,i){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,i)}insertInt32BE(e,i){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,i)}writeInt32LE(e,i){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,i)}insertInt32LE(e,i){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,i)}writeBigInt64BE(e,i){return pe.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,i)}insertBigInt64BE(e,i){return pe.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,i)}writeBigInt64LE(e,i){return pe.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,i)}insertBigInt64LE(e,i){return pe.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,i)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){return pe.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){return pe.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,i)}insertUInt8(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,i)}writeUInt16BE(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,i)}insertUInt16BE(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,e,i)}writeUInt16LE(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,e,i)}insertUInt16LE(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,e,i)}writeUInt32BE(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,e,i)}insertUInt32BE(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,e,i)}writeUInt32LE(e,i){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,e,i)}insertUInt32LE(e,i){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,e,i)}writeBigUInt64BE(e,i){return pe.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,i)}insertBigUInt64BE(e,i){return pe.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,e,i)}writeBigUInt64LE(e,i){return pe.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,i)}insertBigUInt64LE(e,i){return pe.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,e,i)}readFloatBE(e){return this._readNumberValue(Buffer.prototype.readFloatBE,4,e)}readFloatLE(e){return this._readNumberValue(Buffer.prototype.readFloatLE,4,e)}writeFloatBE(e,i){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,e,i)}insertFloatBE(e,i){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,e,i)}writeFloatLE(e,i){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,e,i)}insertFloatLE(e,i){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,e,i)}readDoubleBE(e){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,e)}readDoubleLE(e){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,e)}writeDoubleBE(e,i){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,e,i)}insertDoubleBE(e,i){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,e,i)}writeDoubleLE(e,i){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,e,i)}insertDoubleLE(e,i){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,e,i)}readString(e,i){let r;typeof e=="number"?(pe.checkLengthValue(e),r=Math.min(e,this.length-this._readOffset)):(i=e,r=this.length-this._readOffset),typeof i!="undefined"&&pe.checkEncoding(i);let n=this._buff.slice(this._readOffset,this._readOffset+r).toString(i||this._encoding);return this._readOffset+=r,n}insertString(e,i,r){return pe.checkOffsetValue(i),this._handleString(e,!0,i,r)}writeString(e,i,r){return this._handleString(e,!1,i,r)}readStringNT(e){typeof e!="undefined"&&pe.checkEncoding(e);let i=this.length;for(let n=this._readOffset;nthis.length)throw new Error(pe.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(e,i){pe.checkOffsetValue(i),this._ensureCapacity(this.length+e),ithis.length?this.length=i+e:this.length+=e}_ensureWriteable(e,i){let r=typeof i=="number"?i:this._writeOffset;this._ensureCapacity(r+e),r+e>this.length&&(this.length=r+e)}_ensureCapacity(e){let i=this._buff.length;if(e>i){let r=this._buff,n=i*3/2+1;n{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.SOCKS5_NO_ACCEPTABLE_AUTH=Ne.SOCKS5_CUSTOM_AUTH_END=Ne.SOCKS5_CUSTOM_AUTH_START=Ne.SOCKS_INCOMING_PACKET_SIZES=Ne.SocksClientState=Ne.Socks5Response=Ne.Socks5HostType=Ne.Socks5Auth=Ne.Socks4Response=Ne.SocksCommand=Ne.ERRORS=Ne.DEFAULT_TIMEOUT=void 0;var tS=3e4;Ne.DEFAULT_TIMEOUT=tS;var iS={InvalidSocksCommand:"An invalid SOCKS command was provided. Valid options are connect, bind, and associate.",InvalidSocksCommandForOperation:"An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.",InvalidSocksCommandChain:"An invalid SOCKS command was provided. Chaining currently only supports the connect command.",InvalidSocksClientOptionsDestination:"An invalid destination host was provided.",InvalidSocksClientOptionsExistingSocket:"An invalid existing socket was provided. This should be an instance of stream.Duplex.",InvalidSocksClientOptionsProxy:"Invalid SOCKS proxy details were provided.",InvalidSocksClientOptionsTimeout:"An invalid timeout value was provided. Please enter a value above 0 (in ms).",InvalidSocksClientOptionsProxiesLength:"At least two socks proxies must be provided for chaining.",InvalidSocksClientOptionsCustomAuthRange:"Custom auth must be a value between 0x80 and 0xFE.",InvalidSocksClientOptionsCustomAuthOptions:"When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.",NegotiationError:"Negotiation error",SocketClosed:"Socket closed",ProxyConnectionTimedOut:"Proxy connection timed out",InternalError:"SocksClient internal error (this should not happen)",InvalidSocks4HandshakeResponse:"Received invalid Socks4 handshake response",Socks4ProxyRejectedConnection:"Socks4 Proxy rejected connection",InvalidSocks4IncomingConnectionResponse:"Socks4 invalid incoming connection response",Socks4ProxyRejectedIncomingBoundConnection:"Socks4 Proxy rejected incoming bound connection",InvalidSocks5InitialHandshakeResponse:"Received invalid Socks5 initial handshake response",InvalidSocks5IntiailHandshakeSocksVersion:"Received invalid Socks5 initial handshake (invalid socks version)",InvalidSocks5InitialHandshakeNoAcceptedAuthType:"Received invalid Socks5 initial handshake (no accepted authentication type)",InvalidSocks5InitialHandshakeUnknownAuthType:"Received invalid Socks5 initial handshake (unknown authentication type)",Socks5AuthenticationFailed:"Socks5 Authentication failed",InvalidSocks5FinalHandshake:"Received invalid Socks5 final handshake response",InvalidSocks5FinalHandshakeRejected:"Socks5 proxy rejected connection",InvalidSocks5IncomingConnectionResponse:"Received invalid Socks5 incoming connection response",Socks5ProxyRejectedIncomingBoundConnection:"Socks5 Proxy rejected incoming bound connection"};Ne.ERRORS=iS;var rS={Socks5InitialHandshakeResponse:2,Socks5UserPassAuthenticationResponse:2,Socks5ResponseHeader:5,Socks5ResponseIPv4:10,Socks5ResponseIPv6:22,Socks5ResponseHostname:t=>t+7,Socks4Response:8};Ne.SOCKS_INCOMING_PACKET_SIZES=rS;var om;(function(t){t[t.connect=1]="connect",t[t.bind=2]="bind",t[t.associate=3]="associate"})(om||(Ne.SocksCommand=om={}));var am;(function(t){t[t.Granted=90]="Granted",t[t.Failed=91]="Failed",t[t.Rejected=92]="Rejected",t[t.RejectedIdent=93]="RejectedIdent"})(am||(Ne.Socks4Response=am={}));var lm;(function(t){t[t.NoAuth=0]="NoAuth",t[t.GSSApi=1]="GSSApi",t[t.UserPass=2]="UserPass"})(lm||(Ne.Socks5Auth=lm={}));var nS=128;Ne.SOCKS5_CUSTOM_AUTH_START=nS;var sS=254;Ne.SOCKS5_CUSTOM_AUTH_END=sS;var oS=255;Ne.SOCKS5_NO_ACCEPTABLE_AUTH=oS;var cm;(function(t){t[t.Granted=0]="Granted",t[t.Failure=1]="Failure",t[t.NotAllowed=2]="NotAllowed",t[t.NetworkUnreachable=3]="NetworkUnreachable",t[t.HostUnreachable=4]="HostUnreachable",t[t.ConnectionRefused=5]="ConnectionRefused",t[t.TTLExpired=6]="TTLExpired",t[t.CommandNotSupported=7]="CommandNotSupported",t[t.AddressNotSupported=8]="AddressNotSupported"})(cm||(Ne.Socks5Response=cm={}));var um;(function(t){t[t.IPv4=1]="IPv4",t[t.Hostname=3]="Hostname",t[t.IPv6=4]="IPv6"})(um||(Ne.Socks5HostType=um={}));var fm;(function(t){t[t.Created=0]="Created",t[t.Connecting=1]="Connecting",t[t.Connected=2]="Connected",t[t.SentInitialHandshake=3]="SentInitialHandshake",t[t.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",t[t.SentAuthentication=5]="SentAuthentication",t[t.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",t[t.SentFinalHandshake=7]="SentFinalHandshake",t[t.ReceivedFinalResponse=8]="ReceivedFinalResponse",t[t.BoundWaitingForConnection=9]="BoundWaitingForConnection",t[t.Established=10]="Established",t[t.Disconnected=11]="Disconnected",t[t.Error=99]="Error"})(fm||(Ne.SocksClientState=fm={}))});var Pl=w(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.shuffleArray=Nr.SocksClientError=void 0;var Rl=class extends Error{constructor(e,i){super(e),this.options=i}};Nr.SocksClientError=Rl;function aS(t){for(let e=t.length-1;e>0;e--){let i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}}Nr.shuffleArray=aS});var Ml=w(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.isCorrect=Lr.isInSubnet=void 0;function lS(t){return this.subnetMask{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.RE_SUBNET_STRING=Kt.RE_ADDRESS=Kt.GROUPS=Kt.BITS=void 0;Kt.BITS=32;Kt.GROUPS=4;Kt.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g;Kt.RE_SUBNET_STRING=/\/\d{1,2}$/});var Us=w(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.AddressError=void 0;var Fl=class extends Error{constructor(e,i){super(e),this.name="AddressError",i!==null&&(this.parseMessage=i)}};js.AddressError=Fl});var Dl=w(($s,hm)=>{(function(){var t,e=0xdeadbeefcafe,i=(e&16777215)==15715070;function r(h,p,y){h!=null&&(typeof h=="number"?this.fromNumber(h,p,y):p==null&&typeof h!="string"?this.fromString(h,256):this.fromString(h,p))}function n(){return new r(null)}function s(h,p,y,x,B,M){for(;--M>=0;){var G=p*this[h++]+y[x]+B;B=Math.floor(G/67108864),y[x++]=G&67108863}return B}function o(h,p,y,x,B,M){for(var G=p&32767,z=p>>15;--M>=0;){var Re=this[h]&32767,Ye=this[h++]>>15,Ct=z*Re+Ye*G;Re=G*Re+((Ct&32767)<<15)+y[x]+(B&1073741823),B=(Re>>>30)+(Ct>>>15)+z*Ye+(B>>>30),y[x++]=Re&1073741823}return B}function a(h,p,y,x,B,M){for(var G=p&16383,z=p>>14;--M>=0;){var Re=this[h]&16383,Ye=this[h++]>>14,Ct=z*Re+Ye*G;Re=G*Re+((Ct&16383)<<14)+y[x]+B,B=(Re>>28)+(Ct>>14)+z*Ye,y[x++]=Re&268435455}return B}var l=typeof navigator!="undefined";l&&i&&navigator.appName=="Microsoft Internet Explorer"?(r.prototype.am=o,t=30):l&&i&&navigator.appName!="Netscape"?(r.prototype.am=s,t=26):(r.prototype.am=a,t=28),r.prototype.DB=t,r.prototype.DM=(1<=0;--p)h[p]=this[p];h.t=this.t,h.s=this.s}function _(h){this.t=1,this.s=h<0?-1:0,h>0?this[0]=h:h<-1?this[0]=h+this.DV:this.t=0}function S(h){var p=n();return p.fromInt(h),p}function O(h,p){var y;if(p==16)y=4;else if(p==8)y=3;else if(p==256)y=8;else if(p==2)y=1;else if(p==32)y=5;else if(p==4)y=2;else{this.fromRadix(h,p);return}this.t=0,this.s=0;for(var x=h.length,B=!1,M=0;--x>=0;){var G=y==8?h[x]&255:v(h,x);if(G<0){h.charAt(x)=="-"&&(B=!0);continue}B=!1,M==0?this[this.t++]=G:M+y>this.DB?(this[this.t-1]|=(G&(1<>this.DB-M):this[this.t-1]|=G<=this.DB&&(M-=this.DB)}y==8&&h[0]&128&&(this.s=-1,M>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==h;)--this.t}function E(h){if(this.s<0)return"-"+this.negate().toString(h);var p;if(h==16)p=4;else if(h==8)p=3;else if(h==2)p=1;else if(h==32)p=5;else if(h==4)p=2;else return this.toRadix(h);var y=(1<0)for(z>z)>0&&(B=!0,M=m(x));G>=0;)z>(z+=this.DB-p)):(x=this[G]>>(z-=p)&y,z<=0&&(z+=this.DB,--G)),x>0&&(B=!0),B&&(M+=m(x));return B?M:"0"}function R(){var h=n();return r.ZERO.subTo(this,h),h}function T(){return this.s<0?this.negate():this}function A(h){var p=this.s-h.s;if(p!=0)return p;var y=this.t;if(p=y-h.t,p!=0)return this.s<0?-p:p;for(;--y>=0;)if((p=this[y]-h[y])!=0)return p;return 0}function C(h){var p=1,y;return(y=h>>>16)!=0&&(h=y,p+=16),(y=h>>8)!=0&&(h=y,p+=8),(y=h>>4)!=0&&(h=y,p+=4),(y=h>>2)!=0&&(h=y,p+=2),(y=h>>1)!=0&&(h=y,p+=1),p}function L(){return this.t<=0?0:this.DB*(this.t-1)+C(this[this.t-1]^this.s&this.DM)}function P(h,p){var y;for(y=this.t-1;y>=0;--y)p[y+h]=this[y];for(y=h-1;y>=0;--y)p[y]=0;p.t=this.t+h,p.s=this.s}function U(h,p){for(var y=h;y=0;--z)p[z+M+1]=this[z]>>x|G,G=(this[z]&B)<=0;--z)p[z]=0;p[M]=G,p.t=this.t+M+1,p.s=this.s,p.clamp()}function H(h,p){p.s=this.s;var y=Math.floor(h/this.DB);if(y>=this.t){p.t=0;return}var x=h%this.DB,B=this.DB-x,M=(1<>x;for(var G=y+1;G>x;x>0&&(p[this.t-y-1]|=(this.s&M)<>=this.DB;if(h.t>=this.DB;x+=this.s}else{for(x+=this.s;y>=this.DB;x-=h.s}p.s=x<0?-1:0,x<-1?p[y++]=this.DV+x:x>0&&(p[y++]=x),p.t=y,p.clamp()}function V(h,p){var y=this.abs(),x=h.abs(),B=y.t;for(p.t=B+x.t;--B>=0;)p[B]=0;for(B=0;B=0;)h[y]=0;for(y=0;y=p.DV&&(h[y+p.t]-=p.DV,h[y+p.t+1]=1)}h.t>0&&(h[h.t-1]+=p.am(y,p[y],h,2*y,0,1)),h.s=0,h.clamp()}function Q(h,p,y){var x=h.abs();if(!(x.t<=0)){var B=this.abs();if(B.t0?(x.lShiftTo(Re,M),B.lShiftTo(Re,y)):(x.copyTo(M),B.copyTo(y));var Ye=M.t,Ct=M[Ye-1];if(Ct!=0){var _t=Ct*(1<1?M[Ye-2]>>this.F2:0),si=this.FV/_t,ps=(1<=0&&(y[y.t++]=1,y.subTo(vi,y)),r.ONE.dlShiftTo(Ye,vi),vi.subTo(M,M);M.t=0;){var xa=y[--Ft]==Ct?this.DM:Math.floor(y[Ft]*si+(y[Ft-1]+qt)*ps);if((y[Ft]+=M.am(0,xa,y,ds,0,Ye))0&&y.rShiftTo(Re,y),G<0&&r.ZERO.subTo(y,y)}}}function Y(h){var p=n();return this.abs().divRemTo(h,null,p),this.s<0&&p.compareTo(r.ZERO)>0&&h.subTo(p,p),p}function de(h){this.m=h}function ae(h){return h.s<0||h.compareTo(this.m)>=0?h.mod(this.m):h}function ne(h){return h}function ue(h){h.divRemTo(this.m,null,h)}function N(h,p,y){h.multiplyTo(p,y),this.reduce(y)}function X(h,p){h.squareTo(p),this.reduce(p)}de.prototype.convert=ae,de.prototype.revert=ne,de.prototype.reduce=ue,de.prototype.mulTo=N,de.prototype.sqrTo=X;function ke(){if(this.t<1)return 0;var h=this[0];if(!(h&1))return 0;var p=h&3;return p=p*(2-(h&15)*p)&15,p=p*(2-(h&255)*p)&255,p=p*(2-((h&65535)*p&65535))&65535,p=p*(2-h*p%this.DV)%this.DV,p>0?this.DV-p:-p}function be(h){this.m=h,this.mp=h.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(p,p),p}function ve(h){var p=n();return h.copyTo(p),this.reduce(p),p}function fe(h){for(;h.t<=this.mt2;)h[h.t++]=0;for(var p=0;p>15)*this.mpl&this.um)<<15)&h.DM;for(y=p+this.m.t,h[y]+=this.m.am(0,x,h,p,0,this.m.t);h[y]>=h.DV;)h[y]-=h.DV,h[++y]++}h.clamp(),h.drShiftTo(this.m.t,h),h.compareTo(this.m)>=0&&h.subTo(this.m,h)}function K(h,p){h.squareTo(p),this.reduce(p)}function $(h,p,y){h.multiplyTo(p,y),this.reduce(y)}be.prototype.convert=ge,be.prototype.revert=ve,be.prototype.reduce=fe,be.prototype.mulTo=$,be.prototype.sqrTo=K;function Ce(){return(this.t>0?this[0]&1:this.s)==0}function re(h,p){if(h>4294967295||h<1)return r.ONE;var y=n(),x=n(),B=p.convert(this),M=C(h)-1;for(B.copyTo(y);--M>=0;)if(p.sqrTo(y,x),(h&1<0)p.mulTo(x,B,y);else{var G=y;y=x,x=G}return p.revert(y)}function he(h,p){var y;return h<256||p.isEven()?y=new de(p):y=new be(p),this.exp(h,y)}r.prototype.copyTo=b,r.prototype.fromInt=_,r.prototype.fromString=O,r.prototype.clamp=k,r.prototype.dlShiftTo=P,r.prototype.drShiftTo=U,r.prototype.lShiftTo=F,r.prototype.rShiftTo=H,r.prototype.subTo=j,r.prototype.multiplyTo=V,r.prototype.squareTo=W,r.prototype.divRemTo=Q,r.prototype.invDigit=ke,r.prototype.isEven=Ce,r.prototype.exp=re,r.prototype.toString=E,r.prototype.negate=R,r.prototype.abs=T,r.prototype.compareTo=A,r.prototype.bitLength=L,r.prototype.mod=Y,r.prototype.modPowInt=he,r.ZERO=S(0),r.ONE=S(1);function ft(){var h=n();return this.copyTo(h),h}function yt(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function Z(){return this.t==0?this.s:this[0]<<16>>16}function te(h){return Math.floor(Math.LN2*this.DB/Math.log(h))}function ee(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function le(h){if(h==null&&(h=10),this.signum()==0||h<2||h>36)return"0";var p=this.chunkSize(h),y=Math.pow(h,p),x=S(y),B=n(),M=n(),G="";for(this.divRemTo(x,B,M);B.signum()>0;)G=(y+M.intValue()).toString(h).substr(1)+G,B.divRemTo(x,B,M);return M.intValue().toString(h)+G}function ce(h,p){this.fromInt(0),p==null&&(p=10);for(var y=this.chunkSize(p),x=Math.pow(p,y),B=!1,M=0,G=0,z=0;z=y&&(this.dMultiply(x),this.dAddOffset(G,0),M=0,G=0)}M>0&&(this.dMultiply(Math.pow(p,M)),this.dAddOffset(G,0)),B&&r.ZERO.subTo(this,this)}function _e(h,p,y){if(typeof p=="number")if(h<2)this.fromInt(1);else for(this.fromNumber(h,y),this.testBit(h-1)||this.bitwiseTo(r.ONE.shiftLeft(h-1),oe,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(p);)this.dAddOffset(2,0),this.bitLength()>h&&this.subTo(r.ONE.shiftLeft(h-1),this);else{var x=new Array,B=h&7;x.length=(h>>3)+1,p.nextBytes(x),B>0?x[0]&=(1<0)for(y>y)!=(this.s&this.DM)>>y&&(p[B++]=x|this.s<=0;)y<8?(x=(this[h]&(1<>(y+=this.DB-8)):(x=this[h]>>(y-=8)&255,y<=0&&(y+=this.DB,--h)),x&128&&(x|=-256),B==0&&(this.s&128)!=(x&128)&&++B,(B>0||x!=this.s)&&(p[B++]=x);return p}function Be(h){return this.compareTo(h)==0}function Te(h){return this.compareTo(h)<0?this:h}function D(h){return this.compareTo(h)>0?this:h}function J(h,p,y){var x,B,M=Math.min(h.t,this.t);for(x=0;x>=16,p+=16),h&255||(h>>=8,p+=8),h&15||(h>>=4,p+=4),h&3||(h>>=2,p+=2),h&1||++p,p}function mi(){for(var h=0;h=this.t?this.s!=0:(this[p]&1<>=this.DB;if(h.t>=this.DB;x+=this.s}else{for(x+=this.s;y>=this.DB;x+=h.s}p.s=x<0?-1:0,x>0?p[y++]=x:x<-1&&(p[y++]=this.DV+x),p.t=y,p.clamp()}function es(h){var p=n();return this.addTo(h,p),p}function tn(h){var p=n();return this.subTo(h,p),p}function ts(h){var p=n();return this.multiplyTo(h,p),p}function is(){var h=n();return this.squareTo(h),h}function rs(h){var p=n();return this.divRemTo(h,p,null),p}function ns(h){var p=n();return this.divRemTo(h,null,p),p}function ss(h){var p=n(),y=n();return this.divRemTo(h,p,y),new Array(p,y)}function ya(h){this[this.t]=this.am(0,h-1,this,0,0,this.t),++this.t,this.clamp()}function $i(h,p){if(h!=0){for(;this.t<=p;)this[this.t++]=0;for(this[p]+=h;this[p]>=this.DV;)this[p]-=this.DV,++p>=this.t&&(this[this.t++]=0),++this[p]}}function ni(){}function Vi(h){return h}function mr(h,p,y){h.multiplyTo(p,y)}function os(h,p){h.squareTo(p)}ni.prototype.convert=Vi,ni.prototype.revert=Vi,ni.prototype.mulTo=mr,ni.prototype.sqrTo=os;function as(h){return this.exp(h,new ni)}function ls(h,p,y){var x=Math.min(this.t+h.t,p);for(y.s=0,y.t=x;x>0;)y[--x]=0;var B;for(B=y.t-this.t;x=0;)y[x]=0;for(x=Math.max(p-this.t,0);x2*this.m.t)return h.mod(this.m);if(h.compareTo(this.m)<0)return h;var p=n();return h.copyTo(p),this.reduce(p),p}function fs(h){return h}function gr(h){for(h.drShiftTo(this.m.t-1,this.r2),h.t>this.m.t+1&&(h.t=this.m.t+1,h.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);h.compareTo(this.r2)<0;)h.dAddOffset(1,this.m.t+1);for(h.subTo(this.r2,h);h.compareTo(this.m)>=0;)h.subTo(this.m,h)}function Sb(h,p){h.squareTo(p),this.reduce(p)}function Eb(h,p,y){h.multiplyTo(p,y),this.reduce(y)}Yt.prototype.convert=us,Yt.prototype.revert=fs,Yt.prototype.reduce=gr,Yt.prototype.mulTo=Eb,Yt.prototype.sqrTo=Sb;function kb(h,p){var y=h.bitLength(),x,B=S(1),M;if(y<=0)return B;y<18?x=1:y<48?x=3:y<144?x=4:y<768?x=5:x=6,y<8?M=new de(p):p.isEven()?M=new Yt(p):M=new be(p);var G=new Array,z=3,Re=x-1,Ye=(1<1){var Ct=n();for(M.sqrTo(G[1],Ct);z<=Ye;)G[z]=n(),M.mulTo(Ct,G[z-2],G[z]),z+=2}var _t=h.t-1,si,ps=!0,qt=n(),Ft;for(y=C(h[_t])-1;_t>=0;){for(y>=Re?si=h[_t]>>y-Re&Ye:(si=(h[_t]&(1<0&&(si|=h[_t-1]>>this.DB+y-Re)),z=x;!(si&1);)si>>=1,--z;if((y-=z)<0&&(y+=this.DB,--_t),ps)G[si].copyTo(B),ps=!1;else{for(;z>1;)M.sqrTo(B,qt),M.sqrTo(qt,B),z-=2;z>0?M.sqrTo(B,qt):(Ft=B,B=qt,qt=Ft),M.mulTo(qt,G[si],B)}for(;_t>=0&&!(h[_t]&1<0&&(p.rShiftTo(M,p),y.rShiftTo(M,y));p.signum()>0;)(B=p.getLowestSetBit())>0&&p.rShiftTo(B,p),(B=y.getLowestSetBit())>0&&y.rShiftTo(B,y),p.compareTo(y)>=0?(p.subTo(y,p),p.rShiftTo(1,p)):(y.subTo(p,y),y.rShiftTo(1,y));return M>0&&y.lShiftTo(M,y),y}function Cb(h){if(h<=0)return 0;var p=this.DV%h,y=this.s<0?h-1:0;if(this.t>0)if(p==0)y=this[0]%h;else for(var x=this.t-1;x>=0;--x)y=(p*y+this[x])%h;return y}function Tb(h){var p=h.isEven();if(this.isEven()&&p||h.signum()==0)return r.ZERO;for(var y=h.clone(),x=this.clone(),B=S(1),M=S(0),G=S(0),z=S(1);y.signum()!=0;){for(;y.isEven();)y.rShiftTo(1,y),p?((!B.isEven()||!M.isEven())&&(B.addTo(this,B),M.subTo(h,M)),B.rShiftTo(1,B)):M.isEven()||M.subTo(h,M),M.rShiftTo(1,M);for(;x.isEven();)x.rShiftTo(1,x),p?((!G.isEven()||!z.isEven())&&(G.addTo(this,G),z.subTo(h,z)),G.rShiftTo(1,G)):z.isEven()||z.subTo(h,z),z.rShiftTo(1,z);y.compareTo(x)>=0?(y.subTo(x,y),p&&B.subTo(G,B),M.subTo(z,M)):(x.subTo(y,x),p&&G.subTo(B,G),z.subTo(M,z))}if(x.compareTo(r.ONE)!=0)return r.ZERO;if(z.compareTo(h)>=0)return z.subtract(h);if(z.signum()<0)z.addTo(h,z);else return z;return z.signum()<0?z.add(h):z}var st=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ab=(1<<26)/st[st.length-1];function Ib(h){var p,y=this.abs();if(y.t==1&&y[0]<=st[st.length-1]){for(p=0;p>1,h>st.length&&(h=st.length);for(var B=n(),M=0;M>8&255,bt[Ge++]^=h>>16&255,bt[Ge++]^=h>>24&255,Ge>=wa&&(Ge-=wa)}function pf(){Lb(new Date().getTime())}if(bt==null){bt=new Array,Ge=0;var Mt;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var df=new Uint8Array(32);for(window.crypto.getRandomValues(df),Mt=0;Mt<32;++Mt)bt[Ge++]=df[Mt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var mf=window.crypto.random(32);for(Mt=0;Mt>>8,bt[Ge++]=Mt&255;Ge=0,pf()}function Bb(){if(hs==null){for(pf(),hs=qb(),hs.init(bt),Ge=0;Ge{(function(){"use strict";var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(o){return r(s(o),arguments)}function i(o,a){return e.apply(null,[o].concat(a||[]))}function r(o,a){var l=1,c=o.length,u,f="",d,g,m,v,b,_,S,O;for(d=0;d=0),m.type){case"b":u=parseInt(u,10).toString(2);break;case"c":u=String.fromCharCode(parseInt(u,10));break;case"d":case"i":u=parseInt(u,10);break;case"j":u=JSON.stringify(u,null,m.width?parseInt(m.width):0);break;case"e":u=m.precision?parseFloat(u).toExponential(m.precision):parseFloat(u).toExponential();break;case"f":u=m.precision?parseFloat(u).toFixed(m.precision):parseFloat(u);break;case"g":u=m.precision?String(Number(u.toPrecision(m.precision))):parseFloat(u);break;case"o":u=(parseInt(u,10)>>>0).toString(8);break;case"s":u=String(u),u=m.precision?u.substring(0,m.precision):u;break;case"t":u=String(!!u),u=m.precision?u.substring(0,m.precision):u;break;case"T":u=Object.prototype.toString.call(u).slice(8,-1).toLowerCase(),u=m.precision?u.substring(0,m.precision):u;break;case"u":u=parseInt(u,10)>>>0;break;case"v":u=u.valueOf(),u=m.precision?u.substring(0,m.precision):u;break;case"x":u=(parseInt(u,10)>>>0).toString(16);break;case"X":u=(parseInt(u,10)>>>0).toString(16).toUpperCase();break}t.json.test(m.type)?f+=u:(t.number.test(m.type)&&(!S||m.sign)?(O=S?"+":"-",u=u.toString().replace(t.sign,"")):O="",b=m.pad_char?m.pad_char==="0"?"0":m.pad_char.charAt(1):" ",_=m.width-(O+u).length,v=m.width&&_>0?b.repeat(_):"",f+=m.align?O+u+v:b==="0"?O+v+u:v+O+u)}return f}var n=Object.create(null);function s(o){if(n[o])return n[o];for(var a=o,l,c=[],u=0;a;){if((l=t.text.exec(a))!==null)c.push(l[0]);else if((l=t.modulo.exec(a))!==null)c.push("%");else if((l=t.placeholder.exec(a))!==null){if(l[2]){u|=1;var f=[],d=l[2],g=[];if((g=t.key.exec(d))!==null)for(f.push(g[1]);(d=d.substring(g[0].length))!=="";)if((g=t.key_access.exec(d))!==null)f.push(g[1]);else if((g=t.index_access.exec(d))!==null)f.push(g[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=f}else u|=2;if(u===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");c.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");a=a.substring(l[0].length)}return n[o]=c}typeof Vs!="undefined"&&(Vs.sprintf=e,Vs.vsprintf=i),typeof window!="undefined"&&(window.sprintf=e,window.vsprintf=i,typeof define=="function"&&define.amd&&define(function(){return{sprintf:e,vsprintf:i}}))})()});var Ul=w(Jt=>{"use strict";var uS=Jt&&Jt.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),fS=Jt&&Jt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mm=Jt&&Jt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&uS(e,t,i);return fS(e,t),e};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.Address4=void 0;var pm=mm(Ml()),Vt=mm(ql()),dm=Us(),hn=Dl(),Br=fn(),jl=class t{constructor(e){this.groups=Vt.GROUPS,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=pm.isCorrect(Vt.BITS),this.isInSubnet=pm.isInSubnet,this.address=e;let i=Vt.RE_SUBNET_STRING.exec(e);if(i){if(this.parsedSubnet=i[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>Vt.BITS)throw new dm.AddressError("Invalid subnet mask.");e=e.replace(Vt.RE_SUBNET_STRING,"")}this.addressMinusSuffix=e,this.parsedAddress=this.parse(e)}static isValid(e){try{return new t(e),!0}catch{return!1}}parse(e){let i=e.split(".");if(!e.match(Vt.RE_ADDRESS))throw new dm.AddressError("Invalid IPv4 address.");return i}correctForm(){return this.parsedAddress.map(e=>parseInt(e,10)).join(".")}static fromHex(e){let i=e.replace(/:/g,"").padStart(8,"0"),r=[],n;for(n=0;n<8;n+=2){let s=i.slice(n,n+2);r.push(parseInt(s,16))}return new t(r.join("."))}static fromInteger(e){return t.fromHex(e.toString(16))}static fromArpa(e){let r=e.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new t(r)}toHex(){return this.parsedAddress.map(e=>(0,Br.sprintf)("%02x",parseInt(e,10))).join(":")}toArray(){return this.parsedAddress.map(e=>parseInt(e,10))}toGroup6(){let e=[],i;for(i=0;i(0,Br.sprintf)("%02x",parseInt(e,10))).join(""),16)}_startAddress(){return new hn.BigInteger(this.mask()+"0".repeat(Vt.BITS-this.subnetMask),2)}startAddress(){return t.fromBigInteger(this._startAddress())}startAddressExclusive(){let e=new hn.BigInteger("1");return t.fromBigInteger(this._startAddress().add(e))}_endAddress(){return new hn.BigInteger(this.mask()+"1".repeat(Vt.BITS-this.subnetMask),2)}endAddress(){return t.fromBigInteger(this._endAddress())}endAddressExclusive(){let e=new hn.BigInteger("1");return t.fromBigInteger(this._endAddress().subtract(e))}static fromBigInteger(e){return t.fromInteger(parseInt(e.toString(),10))}mask(e){return e===void 0&&(e=this.subnetMask),this.getBitsBase2(0,e)}getBitsBase2(e,i){return this.binaryZeroPad().slice(e,i)}reverseForm(e){e||(e={});let i=this.correctForm().split(".").reverse().join(".");return e.omitSuffix?i:(0,Br.sprintf)("%s.in-addr.arpa.",i)}isMulticast(){return this.isInSubnet(new t("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(Vt.BITS,"0")}groupForV6(){let e=this.parsedAddress;return this.address.replace(Vt.RE_ADDRESS,(0,Br.sprintf)('%s.%s',e.slice(0,2).join("."),e.slice(2,4).join(".")))}};Jt.Address4=jl});var $l=w(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.RE_URL_WITH_PORT=qe.RE_URL=qe.RE_ZONE_STRING=qe.RE_SUBNET_STRING=qe.RE_BAD_ADDRESS=qe.RE_BAD_CHARACTERS=qe.TYPES=qe.SCOPES=qe.GROUPS=qe.BITS=void 0;qe.BITS=128;qe.GROUPS=8;qe.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"};qe.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"};qe.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi;qe.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi;qe.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/;qe.RE_ZONE_STRING=/%.*$/;qe.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/);qe.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)});var Vl=w(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.simpleGroup=Zt.spanLeadingZeroes=Zt.spanAll=Zt.spanAllZeroes=void 0;var gm=fn();function vm(t){return t.replace(/(0+)/g,'$1')}Zt.spanAllZeroes=vm;function hS(t,e=0){return t.split("").map((r,n)=>(0,gm.sprintf)('%s',r,n+e,vm(r))).join("")}Zt.spanAll=hS;function ym(t){return t.replace(/^(0+)/,'$1')}function pS(t){return t.split(":").map(i=>ym(i)).join(":")}Zt.spanLeadingZeroes=pS;function dS(t,e=0){return t.split(":").map((r,n)=>/group-v4/.test(r)?r:(0,gm.sprintf)('%s',n+e,ym(r)))}Zt.simpleGroup=dS});var bm=w(ze=>{"use strict";var mS=ze&&ze.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),gS=ze&&ze.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vS=ze&&ze.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&mS(e,t,i);return gS(e,t),e};Object.defineProperty(ze,"__esModule",{value:!0});ze.possibleElisions=ze.simpleRegularExpression=ze.ADDRESS_BOUNDARY=ze.padGroup=ze.groupPossibilities=void 0;var yS=vS($l()),Rr=fn();function Gs(t){return(0,Rr.sprintf)("(%s)",t.join("|"))}ze.groupPossibilities=Gs;function Hs(t){return t.length<4?(0,Rr.sprintf)("0{0,%d}%s",4-t.length,t):t}ze.padGroup=Hs;ze.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]";function bS(t){let e=[];t.forEach((r,n)=>{parseInt(r,16)===0&&e.push(n)});let i=e.map(r=>t.map((n,s)=>{if(s===r){let o=s===0||s===yS.GROUPS-1?":":"";return Gs([Hs(n),o])}return Hs(n)}).join(":"));return i.push(t.map(Hs).join(":")),Gs(i)}ze.simpleRegularExpression=bS;function _S(t,e,i){let r=e?"":":",n=i?"":":",s=[];!e&&!i&&s.push("::"),e&&i&&s.push(""),(i&&!e||!i&&e)&&s.push(":"),s.push((0,Rr.sprintf)("%s(:0{1,4}){1,%d}",r,t-1)),s.push((0,Rr.sprintf)("(0{1,4}:){1,%d}%s",t-1,n)),s.push((0,Rr.sprintf)("(0{1,4}:){%d}0{1,4}",t-1));for(let o=1;o{"use strict";var wS=Qt&&Qt.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),xS=Qt&&Qt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ws=Qt&&Qt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&wS(e,t,i);return xS(e,t),e};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Address6=void 0;var _m=Ws(Ml()),Hl=Ws(ql()),Le=Ws($l()),Gl=Ws(Vl()),Ji=Ul(),Zi=bm(),ci=Us(),lt=Dl(),ct=fn();function Ys(t){if(!t)throw new Error("Assertion failed.")}function SS(t){let e=/(\d+)(\d{3})/;for(;e.test(t);)t=t.replace(e,"$1,$2");return t}function ES(t){return t=t.replace(/^(0{1,})([1-9]+)$/,'$1$2'),t=t.replace(/^(0{1,})(0)$/,'$1$2'),t}function kS(t,e){let i=[],r=[],n;for(n=0;ne[1]&&r.push(t[n]);return i.concat(["compact"]).concat(r)}function wm(t){return(0,ct.sprintf)("%04x",parseInt(t,16))}function xm(t){return t&255}var Yl=class t{constructor(e,i){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=_m.isInSubnet,this.isCorrect=_m.isCorrect(Le.BITS),i===void 0?this.groups=Le.GROUPS:this.groups=i,this.address=e;let r=Le.RE_SUBNET_STRING.exec(e);if(r){if(this.parsedSubnet=r[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>Le.BITS)throw new ci.AddressError("Invalid subnet mask.");e=e.replace(Le.RE_SUBNET_STRING,"")}else if(/\//.test(e))throw new ci.AddressError("Invalid subnet mask.");let n=Le.RE_ZONE_STRING.exec(e);n&&(this.zone=n[0],e=e.replace(Le.RE_ZONE_STRING,"")),this.addressMinusSuffix=e,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(e){try{return new t(e),!0}catch{return!1}}static fromBigInteger(e){let i=e.toString(16).padStart(32,"0"),r=[],n;for(n=0;n65536)&&(r=null)):r=null,{address:new t(i),port:r}}static fromAddress4(e){let i=new Ji.Address4(e),r=Le.BITS-(Hl.BITS-i.subnetMask);return new t(`::ffff:${i.correctForm()}/${r}`)}static fromArpa(e){let i=e.replace(/(\.ip6\.arpa)?\.$/,""),r=7;if(i.length!==63)throw new ci.AddressError("Invalid 'ip6.arpa' form.");let n=i.split(".").reverse();for(let s=r;s>0;s--){let o=s*4;n.splice(o,0,":")}return i=n.join(""),new t(i)}microsoftTranscription(){return(0,ct.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(e=this.subnetMask){return this.getBitsBase2(0,e)}possibleSubnets(e=128){let i=Le.BITS-this.subnetMask,r=Math.abs(e-Le.BITS),n=i-r;return n<0?"0":SS(new lt.BigInteger("2",10).pow(n).toString(10))}_startAddress(){return new lt.BigInteger(this.mask()+"0".repeat(Le.BITS-this.subnetMask),2)}startAddress(){return t.fromBigInteger(this._startAddress())}startAddressExclusive(){let e=new lt.BigInteger("1");return t.fromBigInteger(this._startAddress().add(e))}_endAddress(){return new lt.BigInteger(this.mask()+"1".repeat(Le.BITS-this.subnetMask),2)}endAddress(){return t.fromBigInteger(this._endAddress())}endAddressExclusive(){let e=new lt.BigInteger("1");return t.fromBigInteger(this._endAddress().subtract(e))}getScope(){let e=Le.SCOPES[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&e!=="Link local"&&(e="Global"),e||"Unknown"}getType(){for(let e of Object.keys(Le.TYPES))if(this.isInSubnet(new t(e)))return Le.TYPES[e];return"Global unicast"}getBits(e,i){return new lt.BigInteger(this.getBitsBase2(e,i),2)}getBitsBase2(e,i){return this.binaryZeroPad().slice(e,i)}getBitsBase16(e,i){let r=i-e;if(r%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(e,i).toString(16).padStart(r/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,Le.BITS)}reverseForm(e){e||(e={});let i=Math.floor(this.subnetMask/4),r=this.canonicalForm().replace(/:/g,"").split("").slice(0,i).reverse().join(".");return i>0?e.omitSuffix?r:(0,ct.sprintf)("%s.ip6.arpa.",r):e.omitSuffix?"":"ip6.arpa."}correctForm(){let e,i=[],r=0,n=[];for(e=0;e0&&(r>1&&n.push([e-r,e-1]),r=0)}r>1&&n.push([this.parsedAddress.length-r,this.parsedAddress.length-1]);let s=n.map(a=>a[1]-a[0]+1);if(n.length>0){let a=s.indexOf(Math.max(...s));i=kS(this.parsedAddress,n[a])}else i=this.parsedAddress;for(e=0;e1?"s":"",i.join("")),e.replace(Le.RE_BAD_CHARACTERS,'$1'));let r=e.match(Le.RE_BAD_ADDRESS);if(r)throw new ci.AddressError((0,ct.sprintf)("Address failed regex: %s",r.join("")),e.replace(Le.RE_BAD_ADDRESS,'$1'));let n=[],s=e.split("::");if(s.length===2){let o=s[0].split(":"),a=s[1].split(":");o.length===1&&o[0]===""&&(o=[]),a.length===1&&a[0]===""&&(a=[]);let l=this.groups-(o.length+a.length);if(!l)throw new ci.AddressError("Error parsing groups");this.elidedGroups=l,this.elisionBegin=o.length,this.elisionEnd=o.length+this.elidedGroups,n=n.concat(o);for(let c=0;c(0,ct.sprintf)("%x",parseInt(o,16))),n.length!==this.groups)throw new ci.AddressError("Incorrect number of groups found");return n}canonicalForm(){return this.parsedAddress.map(wm).join(":")}decimal(){return this.parsedAddress.map(e=>(0,ct.sprintf)("%05d",parseInt(e,16))).join(":")}bigInteger(){return new lt.BigInteger(this.parsedAddress.map(wm).join(""),16)}to4(){let e=this.binaryZeroPad().split("");return Ji.Address4.fromHex(new lt.BigInteger(e.slice(96,128).join(""),2).toString(16))}to4in6(){let e=this.to4(),r=new t(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),n="";return/:$/.test(r)||(n=":"),r+n+e.address}inspectTeredo(){let e=this.getBitsBase16(0,32),i=this.getBits(80,96).xor(new lt.BigInteger("ffff",16)).toString(),r=Ji.Address4.fromHex(this.getBitsBase16(32,64)),n=Ji.Address4.fromHex(this.getBits(96,128).xor(new lt.BigInteger("ffffffff",16)).toString(16)),s=this.getBits(64,80),o=this.getBitsBase2(64,80),a=s.testBit(15),l=s.testBit(14),c=s.testBit(8),u=s.testBit(9),f=new lt.BigInteger(o.slice(2,6)+o.slice(8,16),2).toString(10);return{prefix:(0,ct.sprintf)("%s:%s",e.slice(0,4),e.slice(4,8)),server4:r.address,client4:n.address,flags:o,coneNat:a,microsoft:{reserved:l,universalLocal:u,groupIndividual:c,nonce:f},udpPort:i}}inspect6to4(){let e=this.getBitsBase16(0,16),i=Ji.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:(0,ct.sprintf)("%s",e.slice(0,4)),gateway:i.address}}to6to4(){if(!this.is4())return null;let e=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new t(e)}toByteArray(){let e=this.bigInteger().toByteArray();return e.length===17&&e[0]===0?e.slice(1):e}toUnsignedByteArray(){return this.toByteArray().map(xm)}static fromByteArray(e){return this.fromUnsignedByteArray(e.map(xm))}static fromUnsignedByteArray(e){let i=new lt.BigInteger("256",10),r=new lt.BigInteger("0",10),n=new lt.BigInteger("1",10);for(let s=e.length-1;s>=0;s--)r=r.add(n.multiply(new lt.BigInteger(e[s].toString(10),10))),n=n.multiply(i);return t.fromBigInteger(r)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new t("2001::/32"))}is6to4(){return this.isInSubnet(new t("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(e){return e===void 0?e="":e=(0,ct.sprintf)(":%s",e),(0,ct.sprintf)("http://[%s]%s/",this.correctForm(),e)}link(e){e||(e={}),e.className===void 0&&(e.className=""),e.prefix===void 0&&(e.prefix="/#address="),e.v4===void 0&&(e.v4=!1);let i=this.correctForm;return e.v4&&(i=this.to4in6),e.className?(0,ct.sprintf)('%2$s',e.prefix,i.call(this),e.className):(0,ct.sprintf)('%2$s',e.prefix,i.call(this))}group(){if(this.elidedGroups===0)return Gl.simpleGroup(this.address).join(":");Ys(typeof this.elidedGroups=="number"),Ys(typeof this.elisionBegin=="number");let e=[],[i,r]=this.address.split("::");i.length?e.push(...Gl.simpleGroup(i)):e.push("");let n=["hover-group"];for(let s=this.elisionBegin;s',n.join(" "))),r.length?e.push(...Gl.simpleGroup(r,this.elisionEnd)):e.push(""),this.is4()&&(Ys(this.address4 instanceof Ji.Address4),e.pop(),e.push(this.address4.groupForV6())),e.join(":")}regularExpressionString(e=!1){let i=[],r=new t(this.correctForm());if(r.elidedGroups===0)i.push((0,Zi.simpleRegularExpression)(r.parsedAddress));else if(r.elidedGroups===Le.GROUPS)i.push((0,Zi.possibleElisions)(Le.GROUPS));else{let n=r.address.split("::");n[0].length&&i.push((0,Zi.simpleRegularExpression)(n[0].split(":"))),Ys(typeof r.elidedGroups=="number"),i.push((0,Zi.possibleElisions)(r.elidedGroups,n[0].length!==0,n[1].length!==0)),n[1].length&&i.push((0,Zi.simpleRegularExpression)(n[1].split(":"))),i=[i.join(":")]}return e||(i=["(?=^|",Zi.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...i,")(?=[^\\w\\:]|",Zi.ADDRESS_BOUNDARY,"|$)"]),i.join("")}regularExpression(e=!1){return new RegExp(this.regularExpressionString(e),"i")}};Qt.Address6=Yl});var Wl=w(rt=>{"use strict";var OS=rt&&rt.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),CS=rt&&rt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),TS=rt&&rt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&OS(e,t,i);return CS(e,t),e};Object.defineProperty(rt,"__esModule",{value:!0});rt.v6=rt.AddressError=rt.Address6=rt.Address4=void 0;var AS=Ul();Object.defineProperty(rt,"Address4",{enumerable:!0,get:function(){return AS.Address4}});var IS=Sm();Object.defineProperty(rt,"Address6",{enumerable:!0,get:function(){return IS.Address6}});var NS=Us();Object.defineProperty(rt,"AddressError",{enumerable:!0,get:function(){return NS.AddressError}});var LS=TS(Vl());rt.v6={helpers:LS}});var Am=w(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.ipToBuffer=Nt.int32ToIpv4=Nt.ipv4ToInt32=Nt.validateSocksClientChainOptions=Nt.validateSocksClientOptions=void 0;var ut=Pl(),Ke=Bl(),BS=require("stream"),zl=Wl(),Em=require("net");function RS(t,e=["connect","bind","associate"]){if(!Ke.SocksCommand[t.command])throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksCommand,t);if(e.indexOf(t.command)===-1)throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksCommandForOperation,t);if(!Om(t.destination))throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsDestination,t);if(!Cm(t.proxy))throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsProxy,t);if(km(t.proxy,t),t.timeout&&!Tm(t.timeout))throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsTimeout,t);if(t.existing_socket&&!(t.existing_socket instanceof BS.Duplex))throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsExistingSocket,t)}Nt.validateSocksClientOptions=RS;function PS(t){if(t.command!=="connect")throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksCommandChain,t);if(!Om(t.destination))throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsDestination,t);if(!(t.proxies&&Array.isArray(t.proxies)&&t.proxies.length>=2))throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsProxiesLength,t);if(t.proxies.forEach(e=>{if(!Cm(e))throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsProxy,t);km(e,t)}),t.timeout&&!Tm(t.timeout))throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsTimeout,t)}Nt.validateSocksClientChainOptions=PS;function km(t,e){if(t.custom_auth_method!==void 0){if(t.custom_auth_methodKe.SOCKS5_CUSTOM_AUTH_END)throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(t.custom_auth_request_handler===void 0||typeof t.custom_auth_request_handler!="function")throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(t.custom_auth_response_size===void 0)throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(t.custom_auth_response_handler===void 0||typeof t.custom_auth_response_handler!="function")throw new ut.SocksClientError(Ke.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}function Om(t){return t&&typeof t.host=="string"&&typeof t.port=="number"&&t.port>=0&&t.port<=65535}function Cm(t){return t&&(typeof t.host=="string"||typeof t.ipaddress=="string")&&typeof t.port=="number"&&t.port>=0&&t.port<=65535&&(t.type===4||t.type===5)}function Tm(t){return typeof t=="number"&&t>0}function MS(t){return new zl.Address4(t).toArray().reduce((i,r)=>(i<<8)+r,0)}Nt.ipv4ToInt32=MS;function qS(t){let e=t>>>24&255,i=t>>>16&255,r=t>>>8&255,n=t&255;return[e,i,r,n].join(".")}Nt.int32ToIpv4=qS;function FS(t){if(Em.isIPv4(t)){let e=new zl.Address4(t);return Buffer.from(e.toArray())}else if(Em.isIPv6(t)){let e=new zl.Address6(t);return Buffer.from(e.canonicalForm().split(":").map(i=>i.padStart(4,"0")).join(""),"hex")}else throw new Error("Invalid IP address format")}Nt.ipToBuffer=FS});var Im=w(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.ReceiveBuffer=void 0;var Kl=class{constructor(e=4096){this.buffer=Buffer.allocUnsafe(e),this.offset=0,this.originalSize=e}get length(){return this.offset}append(e){if(!Buffer.isBuffer(e))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+e.length>=this.buffer.length){let i=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+e.length)),i.copy(this.buffer)}return e.copy(this.buffer,this.offset),this.offset+=e.length}peek(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,e)}get(e){if(e>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");let i=Buffer.allocUnsafe(e);return this.buffer.slice(0,e).copy(i),this.buffer.copyWithin(0,e,e+this.offset-e),this.offset-=e,i}};zs.ReceiveBuffer=Kl});var Nm=w(wi=>{"use strict";var Pr=wi&&wi.__awaiter||function(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?s(u.value):n(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})};Object.defineProperty(wi,"__esModule",{value:!0});wi.SocksClientError=wi.SocksClient=void 0;var DS=require("events"),Mr=require("net"),mt=sm(),q=Bl(),Et=Am(),jS=Im(),Zl=Pl();Object.defineProperty(wi,"SocksClientError",{enumerable:!0,get:function(){return Zl.SocksClientError}});var Jl=Wl(),Ql=class t extends DS.EventEmitter{constructor(e){super(),this.options=Object.assign({},e),(0,Et.validateSocksClientOptions)(e),this.setState(q.SocksClientState.Created)}static createConnection(e,i){return new Promise((r,n)=>{try{(0,Et.validateSocksClientOptions)(e,["connect"])}catch(o){return typeof i=="function"?(i(o),r(o)):n(o)}let s=new t(e);s.connect(e.existing_socket),s.once("established",o=>{s.removeAllListeners(),typeof i=="function"&&i(null,o),r(o)}),s.once("error",o=>{s.removeAllListeners(),typeof i=="function"?(i(o),r(o)):n(o)})})}static createConnectionChain(e,i){return new Promise((r,n)=>Pr(this,void 0,void 0,function*(){try{(0,Et.validateSocksClientChainOptions)(e)}catch(s){return typeof i=="function"?(i(s),r(s)):n(s)}e.randomizeChain&&(0,Zl.shuffleArray)(e.proxies);try{let s;for(let o=0;othis.onDataReceivedHandler(r),this.onClose=()=>this.onCloseHandler(),this.onError=r=>this.onErrorHandler(r),this.onConnect=()=>this.onConnectHandler();let i=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||q.DEFAULT_TIMEOUT);i.unref&&typeof i.unref=="function"&&i.unref(),e?this.socket=e:this.socket=new Mr.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(q.SocksClientState.Connecting),this.receiveBuffer=new jS.ReceiveBuffer,e?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),this.options.set_tcp_nodelay!==void 0&&this.options.set_tcp_nodelay!==null&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",r=>{setImmediate(()=>{if(this.receiveBuffer.length>0){let n=this.receiveBuffer.get(this.receiveBuffer.length);r.socket.emit("data",n)}r.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==q.SocksClientState.Established&&this.state!==q.SocksClientState.BoundWaitingForConnection&&this.closeSocket(q.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(q.SocksClientState.Connected),this.options.proxy.type===4?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(q.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(e){this.receiveBuffer.append(e),this.processData()}processData(){for(;this.state!==q.SocksClientState.Established&&this.state!==q.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===q.SocksClientState.SentInitialHandshake)this.options.proxy.type===4?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===q.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===q.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else if(this.state===q.SocksClientState.BoundWaitingForConnection)this.options.proxy.type===4?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse();else{this.closeSocket(q.ERRORS.InternalError);break}}onCloseHandler(){this.closeSocket(q.ERRORS.SocketClosed)}onErrorHandler(e){this.closeSocket(e.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(e){this.state!==q.SocksClientState.Error&&(this.setState(q.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new Zl.SocksClientError(e,this.options)))}sendSocks4InitialHandshake(){let e=this.options.proxy.userId||"",i=new mt.SmartBuffer;i.writeUInt8(4),i.writeUInt8(q.SocksCommand[this.options.command]),i.writeUInt16BE(this.options.destination.port),Mr.isIPv4(this.options.destination.host)?(i.writeBuffer((0,Et.ipToBuffer)(this.options.destination.host)),i.writeStringNT(e)):(i.writeUInt8(0),i.writeUInt8(0),i.writeUInt8(0),i.writeUInt8(1),i.writeStringNT(e),i.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=q.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(i.toBuffer())}handleSocks4FinalHandshakeResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==q.Socks4Response.Granted)this.closeSocket(`${q.ERRORS.Socks4ProxyRejectedConnection} - (${q.Socks4Response[e[1]]})`);else if(q.SocksCommand[this.options.command]===q.SocksCommand.bind){let i=mt.SmartBuffer.fromBuffer(e);i.readOffset=2;let r={port:i.readUInt16BE(),host:(0,Et.int32ToIpv4)(i.readUInt32BE())};r.host==="0.0.0.0"&&(r.host=this.options.proxy.ipaddress),this.setState(q.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:r,socket:this.socket})}else this.setState(q.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){let e=this.receiveBuffer.get(8);if(e[1]!==q.Socks4Response.Granted)this.closeSocket(`${q.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${q.Socks4Response[e[1]]})`);else{let i=mt.SmartBuffer.fromBuffer(e);i.readOffset=2;let r={port:i.readUInt16BE(),host:(0,Et.int32ToIpv4)(i.readUInt32BE())};this.setState(q.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:r,socket:this.socket})}}sendSocks5InitialHandshake(){let e=new mt.SmartBuffer,i=[q.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&i.push(q.Socks5Auth.UserPass),this.options.proxy.custom_auth_method!==void 0&&i.push(this.options.proxy.custom_auth_method),e.writeUInt8(5),e.writeUInt8(i.length);for(let r of i)e.writeUInt8(r);this.nextRequiredPacketBufferSize=q.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(e.toBuffer()),this.setState(q.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){let e=this.receiveBuffer.get(2);e[0]!==5?this.closeSocket(q.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):e[1]===q.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(q.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):e[1]===q.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=q.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):e[1]===q.Socks5Auth.UserPass?(this.socks5ChosenAuthType=q.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):e[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(q.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){let e=this.options.proxy.userId||"",i=this.options.proxy.password||"",r=new mt.SmartBuffer;r.writeUInt8(1),r.writeUInt8(Buffer.byteLength(e)),r.writeString(e),r.writeUInt8(Buffer.byteLength(i)),r.writeString(i),this.nextRequiredPacketBufferSize=q.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(r.toBuffer()),this.setState(q.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return Pr(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(q.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(e){return Pr(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(e)})}handleSocks5AuthenticationNoAuthHandshakeResponse(e){return Pr(this,void 0,void 0,function*(){return e[1]===0})}handleSocks5AuthenticationUserPassHandshakeResponse(e){return Pr(this,void 0,void 0,function*(){return e[1]===0})}handleInitialSocks5AuthenticationHandshakeResponse(){return Pr(this,void 0,void 0,function*(){this.setState(q.SocksClientState.ReceivedAuthenticationResponse);let e=!1;this.socks5ChosenAuthType===q.Socks5Auth.NoAuth?e=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===q.Socks5Auth.UserPass?e=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(e=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),e?this.sendSocks5CommandRequest():this.closeSocket(q.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){let e=new mt.SmartBuffer;e.writeUInt8(5),e.writeUInt8(q.SocksCommand[this.options.command]),e.writeUInt8(0),Mr.isIPv4(this.options.destination.host)?(e.writeUInt8(q.Socks5HostType.IPv4),e.writeBuffer((0,Et.ipToBuffer)(this.options.destination.host))):Mr.isIPv6(this.options.destination.host)?(e.writeUInt8(q.Socks5HostType.IPv6),e.writeBuffer((0,Et.ipToBuffer)(this.options.destination.host))):(e.writeUInt8(q.Socks5HostType.Hostname),e.writeUInt8(this.options.destination.host.length),e.writeString(this.options.destination.host)),e.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(e.toBuffer()),this.setState(q.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){let e=this.receiveBuffer.peek(5);if(e[0]!==5||e[1]!==q.Socks5Response.Granted)this.closeSocket(`${q.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${q.Socks5Response[e[1]]}`);else{let i=e[3],r,n;if(i===q.Socks5HostType.IPv4){let s=q.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.length{"use strict";var US=Qi&&Qi.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),$S=Qi&&Qi.__exportStar||function(t,e){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&US(e,t,i)};Object.defineProperty(Qi,"__esModule",{value:!0});$S(Nm(),Qi)});var Rm=w(Lt=>{"use strict";var VS=Lt&&Lt.__createBinding||(Object.create?function(t,e,i,r){r===void 0&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){r===void 0&&(r=i),t[r]=e[i]}),HS=Lt&&Lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Bm=Lt&&Lt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&VS(e,t,i);return HS(e,t),e},GS=Lt&&Lt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.SocksProxyAgent=void 0;var YS=Lm(),WS=ja(),zS=GS(rn()),KS=Bm(require("dns")),JS=Bm(require("tls")),ZS=require("url"),Ks=(0,zS.default)("socks-proxy-agent");function QS(t){let e=!1,i=5,r=t.hostname,n=parseInt(t.port,10)||1080;switch(t.protocol.replace(":","")){case"socks4":e=!0,i=4;break;case"socks4a":i=4;break;case"socks5":e=!0,i=5;break;case"socks":i=5;break;case"socks5h":i=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${String(t.protocol)}`)}let s={host:r,port:n,type:i};return t.username&&Object.defineProperty(s,"userId",{value:decodeURIComponent(t.username),enumerable:!1}),t.password!=null&&Object.defineProperty(s,"password",{value:decodeURIComponent(t.password),enumerable:!1}),{lookup:e,proxy:s}}var Js=class extends WS.Agent{constructor(e,i){var o,a;super(i);let r=typeof e=="string"?new ZS.URL(e):e,{proxy:n,lookup:s}=QS(r);this.shouldLookup=s,this.proxy=n,this.timeout=(o=i==null?void 0:i.timeout)!=null?o:null,this.socketOptions=(a=i==null?void 0:i.socketOptions)!=null?a:null}async connect(e,i){var d;let{shouldLookup:r,proxy:n,timeout:s}=this;if(!i.host)throw new Error("No `host` defined!");let{host:o}=i,{port:a,lookup:l=KS.lookup}=i;r&&(o=await new Promise((g,m)=>{l(o,{},(v,b)=>{v?m(v):g(b)})}));let c={proxy:n,destination:{host:o,port:typeof a=="number"?a:parseInt(a,10)},command:"connect",timeout:s!=null?s:void 0,socket_options:(d=this.socketOptions)!=null?d:void 0},u=g=>{e.destroy(),f.destroy(),g&&g.destroy()};Ks("Creating socks proxy connection: %o",c);let{socket:f}=await YS.SocksClient.createConnection(c);if(Ks("Successfully created socks proxy connection"),s!==null&&(f.setTimeout(s),f.on("timeout",()=>u())),i.secureEndpoint){Ks("Upgrading socket connection to TLS");let g=i.servername||i.host,m=JS.connect({...XS(i,"host","path","port"),socket:f,servername:g});return m.once("error",v=>{Ks("Socket TLS error",v.message),u(m)}),m}return f}};Js.protocols=["socks","socks4","socks4a","socks5","socks5h"];Lt.SocksProxyAgent=Js;function XS(t,...e){let i={},r;for(r in t)e.includes(r)||(i[r]=t[r]);return i}});var Mm=w((rN,Pm)=>{"use strict";var eE=/[|\\{}()[\]^$+*?.-]/g;Pm.exports=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(eE,"\\$&")}});var jm=w((nN,Dm)=>{"use strict";var tE=Mm(),iE=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",Fm=[].concat(require("module").builtinModules,"bootstrap_node","node").map(t=>new RegExp(`(?:\\((?:node:)?${t}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${t}(?:\\.js)?:\\d+:\\d+$)`));Fm.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var Xl=class t{constructor(e){e={ignoredPackages:[],...e},"internals"in e||(e.internals=t.nodeInternals()),"cwd"in e||(e.cwd=iE),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,rE(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...Fm]}clean(e,i=0){i=" ".repeat(i),Array.isArray(e)||(e=e.split(` +`)),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let r=!1,n=null,s=[];return e.forEach(o=>{if(o=o.replace(/\\/g,"/"),this._internals.some(l=>l.test(o)))return;let a=/^\s*at /.test(o);r?o=o.trimEnd().replace(/^(\s+)at /,"$1"):(o=o.trim(),a&&(o=o.slice(3))),o=o.replace(`${this._cwd}/`,""),o&&(a?(n&&(s.push(n),n=null),s.push(o)):(r=!0,n=o))}),s.map(o=>`${i}${o} +`).join("")}captureString(e,i=this.captureString){typeof e=="function"&&(i=e,e=1/0);let{stackTraceLimit:r}=Error;e&&(Error.stackTraceLimit=e);let n={};Error.captureStackTrace(n,i);let{stack:s}=n;return Error.stackTraceLimit=r,this.clean(s)}capture(e,i=this.capture){typeof e=="function"&&(i=e,e=1/0);let{prepareStackTrace:r,stackTraceLimit:n}=Error;Error.prepareStackTrace=(a,l)=>this._wrapCallSite?l.map(this._wrapCallSite):l,e&&(Error.stackTraceLimit=e);let s={};Error.captureStackTrace(s,i);let{stack:o}=s;return Object.assign(Error,{prepareStackTrace:r,stackTraceLimit:n}),o}at(e=this.at){let[i]=this.capture(1,e);if(!i)return{};let r={line:i.getLineNumber(),column:i.getColumnNumber()};qm(r,i.getFileName(),this._cwd),i.isConstructor()&&(r.constructor=!0),i.isEval()&&(r.evalOrigin=i.getEvalOrigin()),i.isNative()&&(r.native=!0);let n;try{n=i.getTypeName()}catch{}n&&n!=="Object"&&n!=="[object Object]"&&(r.type=n);let s=i.getFunctionName();s&&(r.function=s);let o=i.getMethodName();return o&&s!==o&&(r.method=o),r}parseLine(e){let i=e&&e.match(nE);if(!i)return null;let r=i[1]==="new",n=i[2],s=i[3],o=i[4],a=Number(i[5]),l=Number(i[6]),c=i[7],u=i[8],f=i[9],d=i[10]==="native",g=i[11]===")",m,v={};if(u&&(v.line=Number(u)),f&&(v.column=Number(f)),g&&c){let b=0;for(let _=c.length-1;_>0;_--)if(c.charAt(_)===")")b++;else if(c.charAt(_)==="("&&c.charAt(_-1)===" "&&(b--,b===-1&&c.charAt(_-1)===" ")){let S=c.slice(0,_-1);c=c.slice(_+1),n+=` (${S}`;break}}if(n){let b=n.match(sE);b&&(n=b[1],m=b[2])}return qm(v,c,this._cwd),r&&(v.constructor=!0),s&&(v.evalOrigin=s,v.evalLine=a,v.evalColumn=l,v.evalFile=o&&o.replace(/\\/g,"/")),d&&(v.native=!0),n&&(v.function=n),m&&n!==m&&(v.method=m),v}};function qm(t,e,i){e&&(e=e.replace(/\\/g,"/"),e.startsWith(`${i}/`)&&(e=e.slice(i.length+1)),t.file=e)}function rE(t){if(t.length===0)return[];let e=t.map(i=>tE(i));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${e.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var nE=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),sE=/^(.*?) \[as (.*?)\]$/;Dm.exports=Xl});var Se=w(Xe=>{"use strict";var ec=Symbol.for("yaml.alias"),Um=Symbol.for("yaml.document"),Zs=Symbol.for("yaml.map"),$m=Symbol.for("yaml.pair"),tc=Symbol.for("yaml.scalar"),Qs=Symbol.for("yaml.seq"),ui=Symbol.for("yaml.node.type"),oE=t=>!!t&&typeof t=="object"&&t[ui]===ec,aE=t=>!!t&&typeof t=="object"&&t[ui]===Um,lE=t=>!!t&&typeof t=="object"&&t[ui]===Zs,cE=t=>!!t&&typeof t=="object"&&t[ui]===$m,Vm=t=>!!t&&typeof t=="object"&&t[ui]===tc,uE=t=>!!t&&typeof t=="object"&&t[ui]===Qs;function Hm(t){if(t&&typeof t=="object")switch(t[ui]){case Zs:case Qs:return!0}return!1}function fE(t){if(t&&typeof t=="object")switch(t[ui]){case ec:case Zs:case tc:case Qs:return!0}return!1}var hE=t=>(Vm(t)||Hm(t))&&!!t.anchor;Xe.ALIAS=ec;Xe.DOC=Um;Xe.MAP=Zs;Xe.NODE_TYPE=ui;Xe.PAIR=$m;Xe.SCALAR=tc;Xe.SEQ=Qs;Xe.hasAnchor=hE;Xe.isAlias=oE;Xe.isCollection=Hm;Xe.isDocument=aE;Xe.isMap=lE;Xe.isNode=fE;Xe.isPair=cE;Xe.isScalar=Vm;Xe.isSeq=uE});var pn=w(ic=>{"use strict";var He=Se(),gt=Symbol("break visit"),Gm=Symbol("skip children"),Xt=Symbol("remove node");function Xs(t,e){let i=Ym(e);He.isDocument(t)?qr(null,t.contents,i,Object.freeze([t]))===Xt&&(t.contents=null):qr(null,t,i,Object.freeze([]))}Xs.BREAK=gt;Xs.SKIP=Gm;Xs.REMOVE=Xt;function qr(t,e,i,r){let n=Wm(t,e,i,r);if(He.isNode(n)||He.isPair(n))return zm(t,r,n),qr(t,n,i,r);if(typeof n!="symbol"){if(He.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s{"use strict";var Km=Se(),pE=pn(),dE={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},mE=t=>t.replace(/[!,[\]{}]/g,e=>dE[e]),dn=class t{constructor(e,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,i)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,i){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),n=r.shift();switch(n){case"%TAG":{if(r.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return i(6,`Unsupported YAML version ${s}`,o),!1}}default:return i(0,`Unknown directive ${n}`,!0),!1}}tagName(e,i){if(e==="!")return"!";if(e[0]!=="!")return i(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(i(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&i("Verbatim tags must end with a >"),o)}let[,r,n]=e.match(/^(.*!)([^!]*)$/s);n||i(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(n)}catch(o){return i(String(o)),null}return r==="!"?e:(i(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[i,r]of Object.entries(this.tags))if(e.startsWith(r))return i+mE(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),n;if(e&&r.length>0&&Km.isNode(e.contents)){let s={};pE.visit(e.contents,(o,a)=>{Km.isNode(a)&&a.tag&&(s[a.tag]=!0)}),n=Object.keys(s)}else n=[];for(let[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(a=>a.startsWith(o)))&&i.push(`%TAG ${s} ${o}`);return i.join(` +`)}};dn.defaultYaml={explicit:!1,version:"1.2"};dn.defaultTags={"!!":"tag:yaml.org,2002:"};Jm.Directives=dn});var to=w(mn=>{"use strict";var Zm=Se(),gE=pn();function vE(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(i)}return!0}function Qm(t){let e=new Set;return gE.visit(t,{Value(i,r){r.anchor&&e.add(r.anchor)}}),e}function Xm(t,e){for(let i=1;;++i){let r=`${t}${i}`;if(!e.has(r))return r}}function yE(t,e){let i=[],r=new Map,n=null;return{onAnchor:s=>{i.push(s),n||(n=Qm(t));let o=Xm(e,n);return n.add(o),o},setAnchors:()=>{for(let s of i){let o=r.get(s);if(typeof o=="object"&&o.anchor&&(Zm.isScalar(o.node)||Zm.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:r}}mn.anchorIsValid=vE;mn.anchorNames=Qm;mn.createNodeAnchors=yE;mn.findNewAnchor=Xm});var nc=w(eg=>{"use strict";function gn(t,e,i,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let n=0,s=r.length;n{"use strict";var bE=Se();function tg(t,e,i){if(Array.isArray(t))return t.map((r,n)=>tg(r,String(n),i));if(t&&typeof t.toJSON=="function"){if(!i||!bE.hasAnchor(t))return t.toJSON(e,i);let r={aliasCount:0,count:1,res:void 0};i.anchors.set(t,r),i.onCreate=s=>{r.res=s,delete i.onCreate};let n=t.toJSON(e,i);return i.onCreate&&i.onCreate(n),n}return typeof t=="bigint"&&!(i!=null&&i.keep)?Number(t):t}ig.toJS=tg});var io=w(ng=>{"use strict";var _E=nc(),rg=Se(),wE=xi(),sc=class{constructor(e){Object.defineProperty(this,rg.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:r,onAnchor:n,reviver:s}={}){if(!rg.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=wE.toJS(this,"",o);if(typeof n=="function")for(let{count:l,res:c}of o.anchors.values())n(c,l);return typeof s=="function"?_E.applyReviver(s,{"":a},"",a):a}};ng.NodeBase=sc});var vn=w(og=>{"use strict";var xE=to(),sg=pn(),ro=Se(),SE=io(),EE=xi(),oc=class extends SE.NodeBase{constructor(e){super(ro.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let i;return sg.visit(e,{Node:(r,n)=>{if(n===this)return sg.visit.BREAK;n.anchor===this.source&&(i=n)}}),i}toJSON(e,i){if(!i)return{source:this.source};let{anchors:r,doc:n,maxAliasCount:s}=i,o=this.resolve(n);if(!o){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(EE.toJS(o,null,i),a=r.get(o)),!a||a.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=no(n,o,r)),a.count*a.aliasCount>s)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,i,r){let n=`*${this.source}`;if(e){if(xE.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${n} `}return n}};function no(t,e,i){if(ro.isAlias(e)){let r=e.resolve(t),n=i&&r&&i.get(r);return n?n.count*n.aliasCount:0}else if(ro.isCollection(e)){let r=0;for(let n of e.items){let s=no(t,n,i);s>r&&(r=s)}return r}else if(ro.isPair(e)){let r=no(t,e.key,i),n=no(t,e.value,i);return Math.max(r,n)}return 1}og.Alias=oc});var je=w(ac=>{"use strict";var kE=Se(),OE=io(),CE=xi(),TE=t=>!t||typeof t!="function"&&typeof t!="object",Si=class extends OE.NodeBase{constructor(e){super(kE.SCALAR),this.value=e}toJSON(e,i){return i!=null&&i.keep?this.value:CE.toJS(this.value,e,i)}toString(){return String(this.value)}};Si.BLOCK_FOLDED="BLOCK_FOLDED";Si.BLOCK_LITERAL="BLOCK_LITERAL";Si.PLAIN="PLAIN";Si.QUOTE_DOUBLE="QUOTE_DOUBLE";Si.QUOTE_SINGLE="QUOTE_SINGLE";ac.Scalar=Si;ac.isScalarValue=TE});var yn=w(lg=>{"use strict";var AE=vn(),Xi=Se(),ag=je(),IE="tag:yaml.org,2002:";function NE(t,e,i){var r;if(e){let n=i.filter(o=>o.tag===e),s=(r=n.find(o=>!o.format))!=null?r:n[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return i.find(n=>{var s;return((s=n.identify)==null?void 0:s.call(n,t))&&!n.format})}function LE(t,e,i){var f,d,g;if(Xi.isDocument(t)&&(t=t.contents),Xi.isNode(t))return t;if(Xi.isPair(t)){let m=(d=(f=i.schema[Xi.MAP]).createNode)==null?void 0:d.call(f,i.schema,null,i);return m.items.push(t),m}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt!="undefined"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:n,onTagObj:s,schema:o,sourceObjects:a}=i,l;if(r&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor||(l.anchor=n(t)),new AE.Alias(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=IE+e.slice(2));let c=NE(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let m=new ag.Scalar(t);return l&&(l.node=m),m}c=t instanceof Map?o[Xi.MAP]:Symbol.iterator in Object(t)?o[Xi.SEQ]:o[Xi.MAP]}s&&(s(c),delete i.onTagObj);let u=c!=null&&c.createNode?c.createNode(i.schema,t,i):typeof((g=c==null?void 0:c.nodeClass)==null?void 0:g.from)=="function"?c.nodeClass.from(i.schema,t,i):new ag.Scalar(t);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}lg.createNode=LE});var oo=w(so=>{"use strict";var BE=yn(),ei=Se(),RE=io();function lc(t,e,i){let r=i;for(let n=e.length-1;n>=0;--n){let s=e[n];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return BE.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var cg=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,cc=class extends RE.NodeBase{constructor(e,i){super(e),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(e){let i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(i.schema=e),i.items=i.items.map(r=>ei.isNode(r)||ei.isPair(r)?r.clone(e):r),this.range&&(i.range=this.range.slice()),i}addIn(e,i){if(cg(e))this.add(i);else{let[r,...n]=e,s=this.get(r,!0);if(ei.isCollection(s))s.addIn(n,i);else if(s===void 0&&this.schema)this.set(r,lc(this.schema,n,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}deleteIn(e){let[i,...r]=e;if(r.length===0)return this.delete(i);let n=this.get(i,!0);if(ei.isCollection(n))return n.deleteIn(r);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}getIn(e,i){let[r,...n]=e,s=this.get(r,!0);return n.length===0?!i&&ei.isScalar(s)?s.value:s:ei.isCollection(s)?s.getIn(n,i):void 0}hasAllNullValues(e){return this.items.every(i=>{if(!ei.isPair(i))return!1;let r=i.value;return r==null||e&&ei.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[i,...r]=e;if(r.length===0)return this.has(i);let n=this.get(i,!0);return ei.isCollection(n)?n.hasIn(r):!1}setIn(e,i){let[r,...n]=e;if(n.length===0)this.set(r,i);else{let s=this.get(r,!0);if(ei.isCollection(s))s.setIn(n,i);else if(s===void 0&&this.schema)this.set(r,lc(this.schema,n,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}}};so.Collection=cc;so.collectionFromPath=lc;so.isEmptyPath=cg});var bn=w(ao=>{"use strict";var PE=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function uc(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var ME=(t,e,i)=>t.endsWith(` +`)?uc(i,e):i.includes(` +`)?` +`+uc(i,e):(t.endsWith(" ")?"":" ")+i;ao.indentComment=uc;ao.lineComment=ME;ao.stringifyComment=PE});var fg=w(_n=>{"use strict";var qE="flow",fc="block",lo="quoted";function FE(t,e,i="flow",{indentAtStart:r,lineWidth:n=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!n||n<0)return t;nn-Math.max(2,s)?c.push(0):f=n-r);let d,g,m=!1,v=-1,b=-1,_=-1;i===fc&&(v=ug(t,v,e.length),v!==-1&&(f=v+l));for(let O;O=t[v+=1];){if(i===lo&&O==="\\"){switch(b=v,t[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}_=v}if(O===` +`)i===fc&&(v=ug(t,v,e.length)),f=v+e.length+l,d=void 0;else{if(O===" "&&g&&g!==" "&&g!==` +`&&g!==" "){let k=t[v+1];k&&k!==" "&&k!==` +`&&k!==" "&&(d=v)}if(v>=f)if(d)c.push(d),f=d+l,d=void 0;else if(i===lo){for(;g===" "||g===" ";)g=O,O=t[v+=1],m=!0;let k=v>_+1?v-2:b-1;if(u[k])return t;c.push(k),u[k]=!0,f=k+l,d=void 0}else m=!0}g=O}if(m&&a&&a(),c.length===0)return t;o&&o();let S=t.slice(0,c[0]);for(let O=0;O{"use strict";var ti=je(),Ei=fg(),uo=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),fo=t=>/^(%|---|\.\.\.)/m.test(t);function DE(t,e,i){if(!e||e<0)return!1;let r=e-i,n=t.length;if(n<=r)return!1;for(let s=0,o=0;sr)return!0;if(o=s+1,n-o<=r)return!1}return!0}function wn(t,e){let i=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return i;let{implicitKey:r}=e,n=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(fo(t)?" ":""),o="",a=0;for(let l=0,c=i[l];c;c=i[++l])if(c===" "&&i[l+1]==="\\"&&i[l+2]==="n"&&(o+=i.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(i[l+1]){case"u":{o+=i.slice(a,l);let u=i.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=i.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||i[l+2]==='"'||i.length +`;let f,d;for(d=i.length;d>0;--d){let R=i[d-1];if(R!==` +`&&R!==" "&&R!==" ")break}let g=i.substring(d),m=g.indexOf(` +`);m===-1?f="-":i===g||m!==g.length-1?(f="+",s&&s()):f="",g&&(i=i.slice(0,-g.length),g[g.length-1]===` +`&&(g=g.slice(0,-1)),g=g.replace(pc,`$&${c}`));let v=!1,b,_=-1;for(b=0;b")+(v?c?"2":"1":"")+f;if(t&&(k+=" "+a(t.replace(/ ?[\r\n]+/g," ")),n&&n()),u)return i=i.replace(/\n+/g,`$&${c}`),`${k} +${c}${S}${i}${g}`;i=i.replace(/\n+/g,` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let E=Ei.foldFlowLines(`${S}${i}${g}`,c,Ei.FOLD_BLOCK,uo(r,!0));return`${k} +${c}${E}`}function jE(t,e,i,r){let{type:n,value:s}=t,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&s.includes(` +`)||u&&/[[\]{},]/.test(s))return Dr(s,e);if(!s||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(` +`)?Dr(s,e):co(t,e,i,r);if(!a&&!u&&n!==ti.Scalar.PLAIN&&s.includes(` +`))return co(t,e,i,r);if(fo(s)){if(l==="")return e.forceBlockIndent=!0,co(t,e,i,r);if(a&&l===c)return Dr(s,e)}let f=s.replace(/\n+/g,`$& +${l}`);if(o){let d=v=>{var b;return v.default&&v.tag!=="tag:yaml.org,2002:str"&&((b=v.test)==null?void 0:b.test(f))},{compat:g,tags:m}=e.doc.schema;if(m.some(d)||g!=null&&g.some(d))return Dr(s,e)}return a?f:Ei.foldFlowLines(f,l,Ei.FOLD_FLOW,uo(e,!1))}function UE(t,e,i,r){let{implicitKey:n,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==ti.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ti.Scalar.QUOTE_DOUBLE);let l=u=>{switch(u){case ti.Scalar.BLOCK_FOLDED:case ti.Scalar.BLOCK_LITERAL:return n||s?Dr(o.value,e):co(o,e,i,r);case ti.Scalar.QUOTE_DOUBLE:return wn(o.value,e);case ti.Scalar.QUOTE_SINGLE:return hc(o.value,e);case ti.Scalar.PLAIN:return jE(o,e,i,r);default:return null}},c=l(a);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=n&&u||f;if(c=l(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}hg.stringifyString=UE});var Sn=w(dc=>{"use strict";var $E=to(),ki=Se(),VE=bn(),HE=xn();function GE(t,e){let i=Object.assign({blockQuote:!0,commentString:VE.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(i.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:r,options:i}}function YE(t,e){var n,s,o,a;if(e.tag){let l=t.filter(c=>c.tag===e.tag);if(l.length>0)return(n=l.find(c=>c.format===e.format))!=null?n:l[0]}let i,r;if(ki.isScalar(e)){r=e.value;let l=t.filter(c=>{var u;return(u=c.identify)==null?void 0:u.call(c,r)});if(l.length>1){let c=l.filter(u=>u.test);c.length>0&&(l=c)}i=(s=l.find(c=>c.format===e.format))!=null?s:l.find(c=>!c.format)}else r=e,i=t.find(l=>l.nodeClass&&r instanceof l.nodeClass);if(!i){let l=(a=(o=r==null?void 0:r.constructor)==null?void 0:o.name)!=null?a:typeof r;throw new Error(`Tag not resolved for ${l} value`)}return i}function WE(t,e,{anchors:i,doc:r}){if(!r.directives)return"";let n=[],s=(ki.isScalar(t)||ki.isCollection(t))&&t.anchor;s&&$E.anchorIsValid(s)&&(i.add(s),n.push(`&${s}`));let o=t.tag?t.tag:e.default?null:e.tag;return o&&n.push(r.directives.tagString(o)),n.join(" ")}function zE(t,e,i,r){var l,c;if(ki.isPair(t))return t.toString(e,i,r);if(ki.isAlias(t)){if(e.doc.directives)return t.toString(e);if((l=e.resolvedAliases)!=null&&l.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let n,s=ki.isNode(t)?t:e.doc.createNode(t,{onTagObj:u=>n=u});n||(n=YE(e.doc.schema.tags,s));let o=WE(s,n,e);o.length>0&&(e.indentAtStart=((c=e.indentAtStart)!=null?c:0)+o.length+1);let a=typeof n.stringify=="function"?n.stringify(s,e,i,r):ki.isScalar(s)?HE.stringifyString(s,e,i,r):s.toString(e,i,r);return o?ki.isScalar(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o} +${e.indent}${a}`:a}dc.createStringifyContext=GE;dc.stringify=zE});var gg=w(mg=>{"use strict";var fi=Se(),pg=je(),dg=Sn(),En=bn();function KE({key:t,value:e},i,r,n){var T,A;let{allNullValues:s,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=i,d=fi.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(fi.isCollection(t)||!fi.isNode(t)&&typeof t=="object"){let C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let g=!f&&(!t||d&&e==null&&!i.inFlow||fi.isCollection(t)||(fi.isScalar(t)?t.type===pg.Scalar.BLOCK_FOLDED||t.type===pg.Scalar.BLOCK_LITERAL:typeof t=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!g&&(f||!s),indent:a+l});let m=!1,v=!1,b=dg.stringify(t,i,()=>m=!0,()=>v=!0);if(!g&&!i.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(i.inFlow){if(s||e==null)return m&&r&&r(),b===""?"?":g?`? ${b}`:b}else if(s&&!f||e==null&&g)return b=`? ${b}`,d&&!m?b+=En.lineComment(b,i.indent,c(d)):v&&n&&n(),b;m&&(d=null),g?(d&&(b+=En.lineComment(b,i.indent,c(d))),b=`? ${b} +${a}:`):(b=`${b}:`,d&&(b+=En.lineComment(b,i.indent,c(d))));let _,S,O;fi.isNode(e)?(_=!!e.spaceBefore,S=e.commentBefore,O=e.comment):(_=!1,S=null,O=null,e&&typeof e=="object"&&(e=o.createNode(e))),i.implicitKey=!1,!g&&!d&&fi.isScalar(e)&&(i.indentAtStart=b.length+1),v=!1,!u&&l.length>=2&&!i.inFlow&&!g&&fi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(i.indent=i.indent.substring(2));let k=!1,E=dg.stringify(e,i,()=>k=!0,()=>v=!0),R=" ";if(d||_||S){if(R=_?` +`:"",S){let C=c(S);R+=` +${En.indentComment(C,i.indent)}`}E===""&&!i.inFlow?R===` +`&&(R=` + +`):R+=` +${i.indent}`}else if(!g&&fi.isCollection(e)){let C=E[0],L=E.indexOf(` +`),P=L!==-1,U=(A=(T=i.inFlow)!=null?T:e.flow)!=null?A:e.items.length===0;if(P||!U){let F=!1;if(P&&(C==="&"||C==="!")){let H=E.indexOf(" ");C==="&"&&H!==-1&&H{"use strict";function JE(t,...e){t==="debug"&&console.log(...e)}function ZE(t,e){(t==="debug"||t==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(e):console.warn(e))}mc.debug=JE;mc.warn=ZE});var go=w(mo=>{"use strict";var kn=Se(),vg=je(),ho="<<",po={identify:t=>t===ho||typeof t=="symbol"&&t.description===ho,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new vg.Scalar(Symbol(ho)),{addToJSMap:yg}),stringify:()=>ho},QE=(t,e)=>(po.identify(e)||kn.isScalar(e)&&(!e.type||e.type===vg.Scalar.PLAIN)&&po.identify(e.value))&&(t==null?void 0:t.doc.schema.tags.some(i=>i.tag===po.tag&&i.default));function yg(t,e,i){if(i=t&&kn.isAlias(i)?i.resolve(t.doc):i,kn.isSeq(i))for(let r of i.items)vc(t,e,r);else if(Array.isArray(i))for(let r of i)vc(t,e,r);else vc(t,e,i)}function vc(t,e,i){let r=t&&kn.isAlias(i)?i.resolve(t.doc):i;if(!kn.isMap(r))throw new Error("Merge sources must be maps or map aliases");let n=r.toJSON(null,t,Map);for(let[s,o]of n)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}mo.addMergeToJSMap=yg;mo.isMergeKey=QE;mo.merge=po});var bc=w(wg=>{"use strict";var XE=gc(),bg=go(),ek=Sn(),_g=Se(),yc=xi();function tk(t,e,{key:i,value:r}){if(_g.isNode(i)&&i.addToJSMap)i.addToJSMap(t,e,r);else if(bg.isMergeKey(t,i))bg.addMergeToJSMap(t,e,r);else{let n=yc.toJS(i,"",t);if(e instanceof Map)e.set(n,yc.toJS(r,n,t));else if(e instanceof Set)e.add(n);else{let s=ik(i,n,t),o=yc.toJS(r,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function ik(t,e,i){if(e===null)return"";if(typeof e!="object")return String(e);if(_g.isNode(t)&&(i!=null&&i.doc)){let r=ek.createStringifyContext(i.doc,{});r.anchors=new Set;for(let s of i.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let n=t.toString(r);if(!i.mapKeyWarned){let s=JSON.stringify(n);s.length>40&&(s=s.substring(0,36)+'..."'),XE.warn(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return n}return JSON.stringify(e)}wg.addPairToJSMap=tk});var Oi=w(_c=>{"use strict";var xg=yn(),rk=gg(),nk=bc(),vo=Se();function sk(t,e,i){let r=xg.createNode(t,void 0,i),n=xg.createNode(e,void 0,i);return new yo(r,n)}var yo=class t{constructor(e,i=null){Object.defineProperty(this,vo.NODE_TYPE,{value:vo.PAIR}),this.key=e,this.value=i}clone(e){let{key:i,value:r}=this;return vo.isNode(i)&&(i=i.clone(e)),vo.isNode(r)&&(r=r.clone(e)),new t(i,r)}toJSON(e,i){let r=i!=null&&i.mapAsMap?new Map:{};return nk.addPairToJSMap(i,r,this)}toString(e,i,r){return e!=null&&e.doc?rk.stringifyPair(this,e,i,r):JSON.stringify(this)}};_c.Pair=yo;_c.createPair=sk});var wc=w(Eg=>{"use strict";var er=Se(),Sg=Sn(),bo=bn();function ok(t,e,i){var s;return(((s=e.inFlow)!=null?s:t.flow)?lk:ak)(t,e,i)}function ak({comment:t,items:e},i,{blockItemPrefix:r,flowChars:n,itemIndent:s,onChompKeep:o,onComment:a}){let{indent:l,options:{commentString:c}}=i,u=Object.assign({},i,{indent:s,type:null}),f=!1,d=[];for(let m=0;mb=null,()=>f=!0);b&&(_+=bo.lineComment(_,s,c(b))),f&&b&&(f=!1),d.push(r+_)}let g;if(d.length===0)g=n.start+n.end;else{g=d[0];for(let m=1;mb=null);mu||_.includes(` +`))&&(c=!0),f.push(_),u=f.length}let{start:d,end:g}=i;if(f.length===0)return d+g;if(!c){let m=f.reduce((v,b)=>v+b.length+2,2);c=e.options.lineWidth>0&&m>e.options.lineWidth}if(c){let m=d;for(let v of f)m+=v?` +${s}${n}${v}`:` +`;return`${m} +${n}${g}`}else return`${d}${o}${f.join(" ")}${o}${g}`}function _o({indent:t,options:{commentString:e}},i,r,n){if(r&&n&&(r=r.replace(/^\n+/,"")),r){let s=bo.indentComment(e(r),t);i.push(s.trimStart())}}Eg.stringifyCollection=ok});var Ti=w(Sc=>{"use strict";var ck=wc(),uk=bc(),fk=oo(),Ci=Se(),wo=Oi(),hk=je();function On(t,e){let i=Ci.isScalar(e)?e.value:e;for(let r of t)if(Ci.isPair(r)&&(r.key===e||r.key===i||Ci.isScalar(r.key)&&r.key.value===i))return r}var xc=class extends fk.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ci.MAP,e),this.items=[]}static from(e,i,r){let{keepUndefined:n,replacer:s}=r,o=new this(e),a=(l,c)=>{if(typeof s=="function")c=s.call(i,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||n)&&o.items.push(wo.createPair(l,c,r))};if(i instanceof Map)for(let[l,c]of i)a(l,c);else if(i&&typeof i=="object")for(let l of Object.keys(i))a(l,i[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,i){var o;let r;Ci.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new wo.Pair(e,e==null?void 0:e.value):r=new wo.Pair(e.key,e.value);let n=On(this.items,r.key),s=(o=this.schema)==null?void 0:o.sortMapEntries;if(n){if(!i)throw new Error(`Key ${r.key} already set`);Ci.isScalar(n.value)&&hk.isScalarValue(r.value)?n.value.value=r.value:n.value=r.value}else if(s){let a=this.items.findIndex(l=>s(r,l)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(e){let i=On(this.items,e);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(e,i){var s;let r=On(this.items,e),n=r==null?void 0:r.value;return(s=!i&&Ci.isScalar(n)?n.value:n)!=null?s:void 0}has(e){return!!On(this.items,e)}set(e,i){this.add(new wo.Pair(e,i),!0)}toJSON(e,i,r){let n=r?new r:i!=null&&i.mapAsMap?new Map:{};i!=null&&i.onCreate&&i.onCreate(n);for(let s of this.items)uk.addPairToJSMap(i,n,s);return n}toString(e,i,r){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Ci.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ck.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:i})}};Sc.YAMLMap=xc;Sc.findPair=On});var jr=w(Og=>{"use strict";var pk=Se(),kg=Ti(),dk={collection:"map",default:!0,nodeClass:kg.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return pk.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,i)=>kg.YAMLMap.from(t,e,i)};Og.map=dk});var Ai=w(Cg=>{"use strict";var mk=yn(),gk=wc(),vk=oo(),So=Se(),yk=je(),bk=xi(),Ec=class extends vk.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(So.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let i=xo(e);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(e,i){let r=xo(e);if(typeof r!="number")return;let n=this.items[r];return!i&&So.isScalar(n)?n.value:n}has(e){let i=xo(e);return typeof i=="number"&&i=0?e:null}Cg.YAMLSeq=Ec});var Ur=w(Ag=>{"use strict";var _k=Se(),Tg=Ai(),wk={collection:"seq",default:!0,nodeClass:Tg.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return _k.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,i)=>Tg.YAMLSeq.from(t,e,i)};Ag.seq=wk});var Cn=w(Ig=>{"use strict";var xk=xn(),Sk={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,i,r){return e=Object.assign({actualString:!0},e),xk.stringifyString(t,e,i,r)}};Ig.string=Sk});var Eo=w(Bg=>{"use strict";var Ng=je(),Lg={identify:t=>t==null,createNode:()=>new Ng.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ng.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Lg.test.test(t)?t:e.options.nullStr};Bg.nullTag=Lg});var kc=w(Pg=>{"use strict";var Ek=je(),Rg={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Ek.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},i){if(t&&Rg.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?i.options.trueStr:i.options.falseStr}};Pg.boolTag=Rg});var $r=w(Mg=>{"use strict";function kk({format:t,minFractionDigits:e,tag:i,value:r}){if(typeof r=="bigint")return String(r);let n=typeof r=="number"?r:Number(r);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let s=JSON.stringify(r);if(!t&&e&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}Mg.stringifyNumber=kk});var Cc=w(ko=>{"use strict";var Ok=je(),Oc=$r(),Ck={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Oc.stringifyNumber},Tk={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Oc.stringifyNumber(t)}},Ak={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Ok.Scalar(parseFloat(t)),i=t.indexOf(".");return i!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-i-1),e},stringify:Oc.stringifyNumber};ko.float=Ak;ko.floatExp=Tk;ko.floatNaN=Ck});var Ac=w(Co=>{"use strict";var qg=$r(),Oo=t=>typeof t=="bigint"||Number.isInteger(t),Tc=(t,e,i,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),i);function Fg(t,e,i){let{value:r}=t;return Oo(r)&&r>=0?i+r.toString(e):qg.stringifyNumber(t)}var Ik={identify:t=>Oo(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,i)=>Tc(t,2,8,i),stringify:t=>Fg(t,8,"0o")},Nk={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,i)=>Tc(t,0,10,i),stringify:qg.stringifyNumber},Lk={identify:t=>Oo(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,i)=>Tc(t,2,16,i),stringify:t=>Fg(t,16,"0x")};Co.int=Nk;Co.intHex=Lk;Co.intOct=Ik});var jg=w(Dg=>{"use strict";var Bk=jr(),Rk=Eo(),Pk=Ur(),Mk=Cn(),qk=kc(),Ic=Cc(),Nc=Ac(),Fk=[Bk.map,Pk.seq,Mk.string,Rk.nullTag,qk.boolTag,Nc.intOct,Nc.int,Nc.intHex,Ic.floatNaN,Ic.floatExp,Ic.float];Dg.schema=Fk});var Vg=w($g=>{"use strict";var Dk=je(),jk=jr(),Uk=Ur();function Ug(t){return typeof t=="bigint"||Number.isInteger(t)}var To=({value:t})=>JSON.stringify(t),$k=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:To},{identify:t=>t==null,createNode:()=>new Dk.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:To},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:t=>t==="true",stringify:To},{identify:Ug,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:i})=>i?BigInt(t):parseInt(t,10),stringify:({value:t})=>Ug(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:To}],Vk={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Hk=[jk.map,Uk.seq].concat($k,Vk);$g.schema=Hk});var Bc=w(Hg=>{"use strict";var Lc=je(),Gk=xn(),Yk={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Buffer=="function")return Buffer.from(t,"base64");if(typeof atob=="function"){let i=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(i.length);for(let n=0;n{"use strict";var Ao=Se(),Rc=Oi(),Wk=je(),zk=Ai();function Gg(t,e){var i;if(Ao.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let s=n.items[0]||new Rc.Pair(new Wk.Scalar(null));if(n.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${n.commentBefore} +${s.key.commentBefore}`:n.commentBefore),n.comment){let o=(i=s.value)!=null?i:s.key;o.comment=o.comment?`${n.comment} +${o.comment}`:n.comment}n=s}t.items[r]=Ao.isPair(n)?n:new Rc.Pair(n)}}else e("Expected a sequence for this tag");return t}function Yg(t,e,i){let{replacer:r}=i,n=new zk.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(s++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;n.items.push(Rc.createPair(a,l,i))}return n}var Kk={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Gg,createNode:Yg};Io.createPairs=Yg;Io.pairs=Kk;Io.resolvePairs=Gg});var qc=w(Mc=>{"use strict";var Wg=Se(),Pc=xi(),Tn=Ti(),Jk=Ai(),zg=No(),tr=class t extends Jk.YAMLSeq{constructor(){super(),this.add=Tn.YAMLMap.prototype.add.bind(this),this.delete=Tn.YAMLMap.prototype.delete.bind(this),this.get=Tn.YAMLMap.prototype.get.bind(this),this.has=Tn.YAMLMap.prototype.has.bind(this),this.set=Tn.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,i){if(!i)return super.toJSON(e);let r=new Map;i!=null&&i.onCreate&&i.onCreate(r);for(let n of this.items){let s,o;if(Wg.isPair(n)?(s=Pc.toJS(n.key,"",i),o=Pc.toJS(n.value,s,i)):s=Pc.toJS(n,"",i),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,i,r){let n=zg.createPairs(e,i,r),s=new this;return s.items=n.items,s}};tr.tag="tag:yaml.org,2002:omap";var Zk={collection:"seq",identify:t=>t instanceof Map,nodeClass:tr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let i=zg.resolvePairs(t,e),r=[];for(let{key:n}of i.items)Wg.isScalar(n)&&(r.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):r.push(n.value));return Object.assign(new tr,i)},createNode:(t,e,i)=>tr.from(t,e,i)};Mc.YAMLOMap=tr;Mc.omap=Zk});var Xg=w(Fc=>{"use strict";var Kg=je();function Jg({value:t,source:e},i){return e&&(t?Zg:Qg).test.test(e)?e:t?i.options.trueStr:i.options.falseStr}var Zg={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Kg.Scalar(!0),stringify:Jg},Qg={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Kg.Scalar(!1),stringify:Jg};Fc.falseTag=Qg;Fc.trueTag=Zg});var e0=w(Lo=>{"use strict";var Qk=je(),Dc=$r(),Xk={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Dc.stringifyNumber},eO={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Dc.stringifyNumber(t)}},tO={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Qk.Scalar(parseFloat(t.replace(/_/g,""))),i=t.indexOf(".");if(i!==-1){let r=t.substring(i+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Dc.stringifyNumber};Lo.float=tO;Lo.floatExp=eO;Lo.floatNaN=Xk});var i0=w(In=>{"use strict";var t0=$r(),An=t=>typeof t=="bigint"||Number.isInteger(t);function Bo(t,e,i,{intAsBigInt:r}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(i){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return n==="-"?BigInt(-1)*o:o}let s=parseInt(t,i);return n==="-"?-1*s:s}function jc(t,e,i){let{value:r}=t;if(An(r)){let n=r.toString(e);return r<0?"-"+i+n.substr(1):i+n}return t0.stringifyNumber(t)}var iO={identify:An,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,i)=>Bo(t,2,2,i),stringify:t=>jc(t,2,"0b")},rO={identify:An,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,i)=>Bo(t,1,8,i),stringify:t=>jc(t,8,"0")},nO={identify:An,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,i)=>Bo(t,0,10,i),stringify:t0.stringifyNumber},sO={identify:An,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,i)=>Bo(t,2,16,i),stringify:t=>jc(t,16,"0x")};In.int=nO;In.intBin=iO;In.intHex=sO;In.intOct=rO});var $c=w(Uc=>{"use strict";var Mo=Se(),Ro=Oi(),Po=Ti(),ir=class t extends Po.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let i;Mo.isPair(e)?i=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?i=new Ro.Pair(e.key,null):i=new Ro.Pair(e,null),Po.findPair(this.items,i.key)||this.items.push(i)}get(e,i){let r=Po.findPair(this.items,e);return!i&&Mo.isPair(r)?Mo.isScalar(r.key)?r.key.value:r.key:r}set(e,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);let r=Po.findPair(this.items,e);r&&!i?this.items.splice(this.items.indexOf(r),1):!r&&i&&this.items.push(new Ro.Pair(e))}toJSON(e,i){return super.toJSON(e,i,Set)}toString(e,i,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),i,r);throw new Error("Set items must all have null values")}static from(e,i,r){let{replacer:n}=r,s=new this(e);if(i&&Symbol.iterator in Object(i))for(let o of i)typeof n=="function"&&(o=n.call(i,o,o)),s.items.push(Ro.createPair(o,null,r));return s}};ir.tag="tag:yaml.org,2002:set";var oO={collection:"map",identify:t=>t instanceof Set,nodeClass:ir,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,i)=>ir.from(t,e,i),resolve(t,e){if(Mo.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ir,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Uc.YAMLSet=ir;Uc.set=oO});var Hc=w(qo=>{"use strict";var aO=$r();function Vc(t,e){let i=t[0],r=i==="-"||i==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*n(60)+n(a),n(0));return i==="-"?n(-1)*s:s}function r0(t){let{value:e}=t,i=o=>o;if(typeof e=="bigint")i=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return aO.stringifyNumber(t);let r="";e<0&&(r="-",e*=i(-1));let n=i(60),s=[e%n];return e<60?s.unshift(0):(e=(e-s[0])/n,s.unshift(e%n),e>=60&&(e=(e-s[0])/n,s.unshift(e))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var lO={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:i})=>Vc(t,i),stringify:r0},cO={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Vc(t,!1),stringify:r0},n0={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(n0.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,i,r,n,s,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(i,r-1,n,s||0,o||0,a||0,l),u=e[8];if(u&&u!=="Z"){let f=Vc(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:t})=>t.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};qo.floatTime=cO;qo.intTime=lO;qo.timestamp=n0});var a0=w(o0=>{"use strict";var uO=jr(),fO=Eo(),hO=Ur(),pO=Cn(),dO=Bc(),s0=Xg(),Gc=e0(),Fo=i0(),mO=go(),gO=qc(),vO=No(),yO=$c(),Yc=Hc(),bO=[uO.map,hO.seq,pO.string,fO.nullTag,s0.trueTag,s0.falseTag,Fo.intBin,Fo.intOct,Fo.int,Fo.intHex,Gc.floatNaN,Gc.floatExp,Gc.float,dO.binary,mO.merge,gO.omap,vO.pairs,yO.set,Yc.intTime,Yc.floatTime,Yc.timestamp];o0.schema=bO});var v0=w(Kc=>{"use strict";var f0=jr(),_O=Eo(),h0=Ur(),wO=Cn(),xO=kc(),Wc=Cc(),zc=Ac(),SO=jg(),EO=Vg(),p0=Bc(),Nn=go(),d0=qc(),m0=No(),l0=a0(),g0=$c(),Do=Hc(),c0=new Map([["core",SO.schema],["failsafe",[f0.map,h0.seq,wO.string]],["json",EO.schema],["yaml11",l0.schema],["yaml-1.1",l0.schema]]),u0={binary:p0.binary,bool:xO.boolTag,float:Wc.float,floatExp:Wc.floatExp,floatNaN:Wc.floatNaN,floatTime:Do.floatTime,int:zc.int,intHex:zc.intHex,intOct:zc.intOct,intTime:Do.intTime,map:f0.map,merge:Nn.merge,null:_O.nullTag,omap:d0.omap,pairs:m0.pairs,seq:h0.seq,set:g0.set,timestamp:Do.timestamp},kO={"tag:yaml.org,2002:binary":p0.binary,"tag:yaml.org,2002:merge":Nn.merge,"tag:yaml.org,2002:omap":d0.omap,"tag:yaml.org,2002:pairs":m0.pairs,"tag:yaml.org,2002:set":g0.set,"tag:yaml.org,2002:timestamp":Do.timestamp};function OO(t,e,i){let r=c0.get(e);if(r&&!t)return i&&!r.includes(Nn.merge)?r.concat(Nn.merge):r.slice();let n=r;if(!n)if(Array.isArray(t))n=[];else{let s=Array.from(c0.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)n=n.concat(s);else typeof t=="function"&&(n=t(n.slice()));return i&&(n=n.concat(Nn.merge)),n.reduce((s,o)=>{let a=typeof o=="string"?u0[o]:o;if(!a){let l=JSON.stringify(o),c=Object.keys(u0).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return s.includes(a)||s.push(a),s},[])}Kc.coreKnownTags=kO;Kc.getTags=OO});var Qc=w(y0=>{"use strict";var Jc=Se(),CO=jr(),TO=Ur(),AO=Cn(),jo=v0(),IO=(t,e)=>t.keye.key?1:0,Zc=class t{constructor({compat:e,customTags:i,merge:r,resolveKnownTags:n,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?jo.getTags(e,"compat"):e?jo.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=n?jo.coreKnownTags:{},this.tags=jo.getTags(i,this.name,r),this.toStringOptions=a!=null?a:null,Object.defineProperty(this,Jc.MAP,{value:CO.map}),Object.defineProperty(this,Jc.SCALAR,{value:AO.string}),Object.defineProperty(this,Jc.SEQ,{value:TO.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?IO:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};y0.Schema=Zc});var _0=w(b0=>{"use strict";var NO=Se(),Xc=Sn(),Ln=bn();function LO(t,e){var l;let i=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(i.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&i.push("---");let n=Xc.createStringifyContext(t,e),{commentString:s}=n.options;if(t.commentBefore){i.length!==1&&i.unshift("");let c=s(t.commentBefore);i.unshift(Ln.indentComment(c,""))}let o=!1,a=null;if(t.contents){if(NO.isNode(t.contents)){if(t.contents.spaceBefore&&r&&i.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);i.push(Ln.indentComment(f,""))}n.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>o=!0,u=Xc.stringify(t.contents,n,()=>a=null,c);a&&(u+=Ln.lineComment(u,"",s(a))),(u[0]==="|"||u[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${u}`:i.push(u)}else i.push(Xc.stringify(t.contents,n));if((l=t.directives)!=null&&l.docEnd)if(t.comment){let c=s(t.comment);c.includes(` +`)?(i.push("..."),i.push(Ln.indentComment(c,""))):i.push(`... ${c}`)}else i.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&i[i.length-1]!==""&&i.push(""),i.push(Ln.indentComment(s(c),"")))}return i.join(` +`)+` +`}b0.stringifyDocument=LO});var Bn=w(w0=>{"use strict";var BO=vn(),Vr=oo(),Bt=Se(),RO=Oi(),PO=xi(),MO=Qc(),qO=_0(),eu=to(),FO=nc(),DO=yn(),tu=rc(),iu=class t{constructor(e,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Bt.NODE_TYPE,{value:Bt.DOC});let n=null;typeof i=="function"||Array.isArray(i)?n=i:r===void 0&&i&&(r=i,i=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:o}=s;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new tu.Directives({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,n,r)}clone(){let e=Object.create(t.prototype,{[Bt.NODE_TYPE]:{value:Bt.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Bt.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Hr(this.contents)&&this.contents.add(e)}addIn(e,i){Hr(this.contents)&&this.contents.addIn(e,i)}createAlias(e,i){if(!e.anchor){let r=eu.anchorNames(this);e.anchor=!i||r.has(i)?eu.findNewAnchor(i||"a",r):i}return new BO.Alias(e.anchor)}createNode(e,i,r){let n;if(typeof i=="function")e=i.call({"":e},"",e),n=i;else if(Array.isArray(i)){let b=S=>typeof S=="number"||S instanceof String||S instanceof Number,_=i.filter(b).map(String);_.length>0&&(i=i.concat(_)),n=i}else r===void 0&&i&&(r=i,i=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=r!=null?r:{},{onAnchor:f,setAnchors:d,sourceObjects:g}=eu.createNodeAnchors(this,o||"a"),m={aliasDuplicateObjects:s!=null?s:!0,keepUndefined:l!=null?l:!1,onAnchor:f,onTagObj:c,replacer:n,schema:this.schema,sourceObjects:g},v=DO.createNode(e,u,m);return a&&Bt.isCollection(v)&&(v.flow=!0),d(),v}createPair(e,i,r={}){let n=this.createNode(e,null,r),s=this.createNode(i,null,r);return new RO.Pair(n,s)}delete(e){return Hr(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Vr.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Hr(this.contents)?this.contents.deleteIn(e):!1}get(e,i){return Bt.isCollection(this.contents)?this.contents.get(e,i):void 0}getIn(e,i){return Vr.isEmptyPath(e)?!i&&Bt.isScalar(this.contents)?this.contents.value:this.contents:Bt.isCollection(this.contents)?this.contents.getIn(e,i):void 0}has(e){return Bt.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Vr.isEmptyPath(e)?this.contents!==void 0:Bt.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,i){this.contents==null?this.contents=Vr.collectionFromPath(this.schema,[e],i):Hr(this.contents)&&this.contents.set(e,i)}setIn(e,i){Vr.isEmptyPath(e)?this.contents=i:this.contents==null?this.contents=Vr.collectionFromPath(this.schema,Array.from(e),i):Hr(this.contents)&&this.contents.setIn(e,i)}setSchema(e,i={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new tu.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new tu.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(r)this.schema=new MO.Schema(Object.assign(r,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:i,mapAsMap:r,maxAliasCount:n,onAnchor:s,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=PO.toJS(this.contents,i!=null?i:"",a);if(typeof s=="function")for(let{count:c,res:u}of a.anchors.values())s(u,c);return typeof o=="function"?FO.applyReviver(o,{"":l},"",l):l}toJSON(e,i){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:i})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let i=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return qO.stringifyDocument(this,e)}};function Hr(t){if(Bt.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}w0.Document=iu});var Mn=w(Pn=>{"use strict";var Rn=class extends Error{constructor(e,i,r,n){super(),this.name=e,this.code=r,this.message=n,this.pos=i}},ru=class extends Rn{constructor(e,i,r){super("YAMLParseError",e,i,r)}},nu=class extends Rn{constructor(e,i,r){super("YAMLWarning",e,i,r)}},jO=(t,e)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(a=>e.linePos(a));let{line:r,col:n}=i.linePos[0];i.message+=` at line ${r}, column ${n}`;let s=n-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let a=Math.min(s-39,o.length-79);o="\u2026"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(o.substring(0,s))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`),o=a+o}if(/[^ ]/.test(o)){let a=1,l=i.linePos[1];l&&l.line===r&&l.col>n&&(a=Math.max(1,Math.min(l.col-n,80-s)));let c=" ".repeat(s)+"^".repeat(a);i.message+=`: + +${o} +${c} +`}};Pn.YAMLError=Rn;Pn.YAMLParseError=ru;Pn.YAMLWarning=nu;Pn.prettifyError=jO});var qn=w(x0=>{"use strict";function UO(t,{flow:e,indicator:i,next:r,offset:n,onError:s,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",d="",g=!1,m=!1,v=null,b=null,_=null,S=null,O=null,k=null,E=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&s(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),v&&(c&&A.type!=="comment"&&A.type!=="newline"&&s(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),v=null),A.type){case"space":!e&&(i!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&A.source.includes(" ")&&(v=A),u=!0;break;case"comment":{u||s(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=A.source.substring(1)||" ";f?f+=d+C:f=C,d="",c=!1;break}case"newline":c?f?f+=A.source:l=!0:d+=A.source,c=!0,g=!0,(b||_)&&(S=A),u=!0;break;case"anchor":b&&s(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&s(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=A,E===null&&(E=A.offset),c=!1,u=!1,m=!0;break;case"tag":{_&&s(A,"MULTIPLE_TAGS","A node can have at most one tag"),_=A,E===null&&(E=A.offset),c=!1,u=!1,m=!0;break}case i:(b||_)&&s(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),k&&s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e!=null?e:"collection"}`),k=A,c=i==="seq-item-ind"||i==="explicit-key-ind",u=!1;break;case"comma":if(e){O&&s(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),O=A,c=!1,u=!1;break}default:s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),c=!1,u=!1}let R=t[t.length-1],T=R?R.offset+R.source.length:n;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v&&(c&&v.indent<=o||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&s(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:O,found:k,spaceBefore:l,comment:f,hasNewline:g,anchor:b,tag:_,newlineAfterProp:S,end:T,start:E!=null?E:T}}x0.resolveProps=UO});var Uo=w(S0=>{"use strict";function su(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let i of e.start)if(i.type==="newline")return!0;if(e.sep){for(let i of e.sep)if(i.type==="newline")return!0}if(su(e.key)||su(e.value))return!0}return!1;default:return!0}}S0.containsNewline=su});var ou=w(E0=>{"use strict";var $O=Uo();function VO(t,e,i){if((e==null?void 0:e.type)==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&$O.containsNewline(e)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}E0.flowIndentCheck=VO});var au=w(O0=>{"use strict";var k0=Se();function HO(t,e,i){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let n=typeof r=="function"?r:(s,o)=>s===o||k0.isScalar(s)&&k0.isScalar(o)&&s.value===o.value;return e.some(s=>n(s.key,i))}O0.mapIncludes=HO});var L0=w(N0=>{"use strict";var C0=Oi(),GO=Ti(),T0=qn(),YO=Uo(),A0=ou(),WO=au(),I0="All mapping items must start at the same column";function zO({composeNode:t,composeEmptyNode:e},i,r,n,s){var u,f;let o=(u=s==null?void 0:s.nodeClass)!=null?u:GO.YAMLMap,a=new o(i.schema);i.atRoot&&(i.atRoot=!1);let l=r.offset,c=null;for(let d of r.items){let{start:g,key:m,sep:v,value:b}=d,_=T0.resolveProps(g,{indicator:"explicit-key-ind",next:m!=null?m:v==null?void 0:v[0],offset:l,onError:n,parentIndent:r.indent,startOnNewline:!0}),S=!_.found;if(S){if(m&&(m.type==="block-seq"?n(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==r.indent&&n(l,"BAD_INDENT",I0)),!_.anchor&&!_.tag&&!v){c=_.end,_.comment&&(a.comment?a.comment+=` +`+_.comment:a.comment=_.comment);continue}(_.newlineAfterProp||YO.containsNewline(m))&&n(m!=null?m:g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((f=_.found)==null?void 0:f.indent)!==r.indent&&n(l,"BAD_INDENT",I0);i.atKey=!0;let O=_.end,k=m?t(i,m,_,n):e(i,O,g,null,_,n);i.schema.compat&&A0.flowIndentCheck(r.indent,m,n),i.atKey=!1,WO.mapIncludes(i,a.items,k)&&n(O,"DUPLICATE_KEY","Map keys must be unique");let E=T0.resolveProps(v!=null?v:[],{indicator:"map-value-ind",next:b,offset:k.range[2],onError:n,parentIndent:r.indent,startOnNewline:!m||m.type==="block-scalar"});if(l=E.end,E.found){S&&((b==null?void 0:b.type)==="block-map"&&!E.hasNewline&&n(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&_.start{"use strict";var KO=Ai(),JO=qn(),ZO=ou();function QO({composeNode:t,composeEmptyNode:e},i,r,n,s){var u;let o=(u=s==null?void 0:s.nodeClass)!=null?u:KO.YAMLSeq,a=new o(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let l=r.offset,c=null;for(let{start:f,value:d}of r.items){let g=JO.resolveProps(f,{indicator:"seq-item-ind",next:d,offset:l,onError:n,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||d)d&&d.type==="block-seq"?n(g.end,"BAD_INDENT","All sequence items must start at the same column"):n(l,"MISSING_CHAR","Sequence item without - indicator");else{c=g.end,g.comment&&(a.comment=g.comment);continue}let m=d?t(i,d,g,n):e(i,g.end,f,null,g,n);i.schema.compat&&ZO.flowIndentCheck(r.indent,d,n),l=m.range[2],a.items.push(m)}return a.range=[r.offset,l,c!=null?c:l],a}B0.resolveBlockSeq=QO});var Gr=w(P0=>{"use strict";function XO(t,e,i,r){let n="";if(t){let s=!1,o="";for(let a of t){let{source:l,type:c}=a;switch(c){case"space":s=!0;break;case"comment":{i&&!s&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=l.substring(1)||" ";n?n+=o+u:n=u,o="";break}case"newline":n&&(o+=l),s=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:n,offset:e}}P0.resolveEnd=XO});var D0=w(F0=>{"use strict";var eC=Se(),tC=Oi(),M0=Ti(),iC=Ai(),rC=Gr(),q0=qn(),nC=Uo(),sC=au(),lu="Block collections are not allowed within flow collections",cu=t=>t&&(t.type==="block-map"||t.type==="block-seq");function oC({composeNode:t,composeEmptyNode:e},i,r,n,s){var b,_;let o=r.start.source==="{",a=o?"flow map":"flow sequence",l=(b=s==null?void 0:s.nodeClass)!=null?b:o?M0.YAMLMap:iC.YAMLSeq,c=new l(i.schema);c.flow=!0;let u=i.atRoot;u&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let f=r.offset+r.start.source.length;for(let S=0;S0){let S=rC.resolveEnd(m,v,i.options.strict,n);S.comment&&(c.comment?c.comment+=` +`+S.comment:c.comment=S.comment),c.range=[r.offset,v,S.offset]}else c.range=[r.offset,v,v];return c}F0.resolveFlowCollection=oC});var U0=w(j0=>{"use strict";var aC=Se(),lC=je(),cC=Ti(),uC=Ai(),fC=L0(),hC=R0(),pC=D0();function uu(t,e,i,r,n,s){let o=i.type==="block-map"?fC.resolveBlockMap(t,e,i,r,s):i.type==="block-seq"?hC.resolveBlockSeq(t,e,i,r,s):pC.resolveFlowCollection(t,e,i,r,s),a=o.constructor;return n==="!"||n===a.tagName?(o.tag=a.tagName,o):(n&&(o.tag=n),o)}function dC(t,e,i,r,n){var d,g;let s=r.tag,o=s?e.directives.tagName(s.source,m=>n(s,"TAG_RESOLVE_FAILED",m)):null;if(i.type==="block-seq"){let{anchor:m,newlineAfterProp:v}=r,b=m&&s?m.offset>s.offset?m:s:m!=null?m:s;b&&(!v||v.offsetm.tag===o&&m.collection===a);if(!l){let m=e.schema.knownTags[o];if(m&&m.collection===a)e.schema.tags.push(Object.assign({},m,{default:!1})),l=m;else return m!=null&&m.collection?n(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${a} collection, but expects ${m.collection}`,!0):n(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),uu(t,e,i,n,o)}let c=uu(t,e,i,n,o,l),u=(g=(d=l.resolve)==null?void 0:d.call(l,c,m=>n(s,"TAG_RESOLVE_FAILED",m),e.options))!=null?g:c,f=aC.isNode(u)?u:new lC.Scalar(u);return f.range=c.range,f.tag=o,l!=null&&l.format&&(f.format=l.format),f}j0.composeCollection=dC});var hu=w($0=>{"use strict";var fu=je();function mC(t,e,i){let r=e.offset,n=gC(e,t.options.strict,i);if(!n)return{value:"",type:null,comment:"",range:[r,r,r]};let s=n.mode===">"?fu.Scalar.BLOCK_FOLDED:fu.Scalar.BLOCK_LITERAL,o=e.source?vC(e.source):[],a=o.length;for(let v=o.length-1;v>=0;--v){let b=o[v][1];if(b===""||b==="\r")a=v;else break}if(a===0){let v=n.chomp==="+"&&o.length>0?` +`.repeat(Math.max(1,o.length-1)):"",b=r+n.length;return e.source&&(b+=e.source.length),{value:v,type:s,comment:n.comment,range:[r,b,b]}}let l=e.indent+n.indent,c=e.offset+n.length,u=0;for(let v=0;vl&&(l=b.length);else{if(b.length=a;--v)o[v][0].length>l&&(a=v+1);let f="",d="",g=!1;for(let v=0;vl||_[0]===" "?(d===" "?d=` +`:!g&&d===` +`&&(d=` + +`),f+=d+b.slice(l)+_,d=` +`,g=!0):_===""?d===` +`?f+=` +`:d=` +`:(f+=d+_,d=" ",g=!1)}switch(n.chomp){case"-":break;case"+":for(let v=a;v{"use strict";var pu=je(),yC=Gr();function bC(t,e,i){let{offset:r,type:n,source:s,end:o}=t,a,l,c=(d,g,m)=>i(r+d,g,m);switch(n){case"scalar":a=pu.Scalar.PLAIN,l=_C(s,c);break;case"single-quoted-scalar":a=pu.Scalar.QUOTE_SINGLE,l=wC(s,c);break;case"double-quoted-scalar":a=pu.Scalar.QUOTE_DOUBLE,l=xC(s,c);break;default:return i(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let u=r+s.length,f=yC.resolveEnd(o,u,e,i);return{value:l,type:a,comment:f.comment,range:[r,u,f.offset]}}function _C(t,e){let i="";switch(t[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${t[0]}`;break}case"@":case"`":{i=`reserved character ${t[0]}`;break}}return i&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),V0(t)}function wC(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),V0(t.slice(1,-1)).replace(/''/g,"'")}function V0(t){var l;let e,i;try{e=new RegExp(`(.*?)(?s?t.slice(s,r+1):n)}else i+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),i}function SC(t,e){let i="",r=t[e+1];for(;(r===" "||r===" "||r===` +`||r==="\r")&&!(r==="\r"&&t[e+2]!==` +`);)r===` +`&&(i+=` +`),e+=1,r=t[e+1];return i||(i=" "),{fold:i,offset:e}}var EC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` +`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function kC(t,e,i,r){let n=t.substr(e,i),o=n.length===i&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;if(isNaN(o)){let a=t.substr(e-2,i+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}H0.resolveFlowScalar=bC});var W0=w(Y0=>{"use strict";var rr=Se(),G0=je(),OC=hu(),CC=du();function TC(t,e,i,r){let{value:n,type:s,comment:o,range:a}=e.type==="block-scalar"?OC.resolveBlockScalar(t,e,r):CC.resolveFlowScalar(e,t.options.strict,r),l=i?t.directives.tagName(i.source,f=>r(i,"TAG_RESOLVE_FAILED",f)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[rr.SCALAR]:l?c=AC(t.schema,n,l,i,r):e.type==="scalar"?c=IC(t,n,e,r):c=t.schema[rr.SCALAR];let u;try{let f=c.resolve(n,d=>r(i!=null?i:e,"TAG_RESOLVE_FAILED",d),t.options);u=rr.isScalar(f)?f:new G0.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);r(i!=null?i:e,"TAG_RESOLVE_FAILED",d),u=new G0.Scalar(n)}return u.range=a,u.source=n,s&&(u.type=s),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function AC(t,e,i,r,n){var a;if(i==="!")return t[rr.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===i)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if((a=l.test)!=null&&a.test(e))return l;let o=t.knownTags[i];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),t[rr.SCALAR])}function IC({atKey:t,directives:e,schema:i},r,n,s){var a;let o=i.tags.find(l=>{var c;return(l.default===!0||t&&l.default==="key")&&((c=l.test)==null?void 0:c.test(r))})||i[rr.SCALAR];if(i.compat){let l=(a=i.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(r))}))!=null?a:i[rr.SCALAR];if(o.tag!==l.tag){let c=e.tagString(o.tag),u=e.tagString(l.tag),f=`Value may be parsed as either ${c} or ${u}`;s(n,"TAG_RESOLVE_FAILED",f,!0)}}return o}Y0.composeScalar=TC});var K0=w(z0=>{"use strict";function NC(t,e,i){if(e){i===null&&(i=e.length);for(let r=i-1;r>=0;--r){let n=e[r];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++r];(n==null?void 0:n.type)==="space";)t+=n.source.length,n=e[++r];break}}return t}z0.emptyScalarPosition=NC});var Q0=w(gu=>{"use strict";var LC=vn(),BC=Se(),RC=U0(),J0=W0(),PC=Gr(),MC=K0(),qC={composeNode:Z0,composeEmptyNode:mu};function Z0(t,e,i,r){let n=t.atKey,{spaceBefore:s,comment:o,anchor:a,tag:l}=i,c,u=!0;switch(e.type){case"alias":c=FC(t,e,r),(a||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=J0.composeScalar(t,e,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=RC.composeCollection(qC,t,e,i,r),a&&(c.anchor=a.source.substring(1));break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),c=mu(t,e.offset,void 0,null,i,r),u=!1}}if(a&&c.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!BC.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")){let f="With stringKeys, all keys must be strings";r(l!=null?l:e,"NON_STRING_KEY",f)}return s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&u&&(c.srcToken=e),c}function mu(t,e,i,r,{spaceBefore:n,comment:s,anchor:o,tag:a,end:l},c){let u={type:"scalar",offset:MC.emptyScalarPosition(e,i,r),indent:-1,source:""},f=J0.composeScalar(t,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=l),f}function FC({options:t},{offset:e,source:i,end:r},n){let s=new LC.Alias(i.substring(1));s.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&n(e+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+i.length,a=PC.resolveEnd(r,o,t.strict,n);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}gu.composeEmptyNode=mu;gu.composeNode=Z0});var tv=w(ev=>{"use strict";var DC=Bn(),X0=Q0(),jC=Gr(),UC=qn();function $C(t,e,{offset:i,start:r,value:n,end:s},o){let a=Object.assign({_directives:e},t),l=new DC.Document(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=UC.resolveProps(r,{indicator:"doc-start",next:n!=null?n:s==null?void 0:s[0],offset:i,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=n?X0.composeNode(c,n,u,o):X0.composeEmptyNode(c,u.end,r,null,u,o);let f=l.contents.range[2],d=jC.resolveEnd(s,f,!1,o);return d.comment&&(l.comment=d.comment),l.range=[i,f,d.offset],l}ev.composeDoc=$C});var yu=w(nv=>{"use strict";var VC=rc(),HC=Bn(),Fn=Mn(),iv=Se(),GC=tv(),YC=Gr();function Dn(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:i}=t;return[e,e+(typeof i=="string"?i.length:1)]}function rv(t){var n;let e="",i=!1,r=!1;for(let s=0;s{let o=Dn(i);s?this.warnings.push(new Fn.YAMLWarning(o,r,n)):this.errors.push(new Fn.YAMLParseError(o,r,n))},this.directives=new VC.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,i){let{comment:r,afterEmptyLine:n}=rv(this.prelude);if(r){let s=e.contents;if(i)e.comment=e.comment?`${e.comment} +${r}`:r;else if(n||e.directives.docStart||!s)e.commentBefore=r;else if(iv.isCollection(s)&&!s.flow&&s.items.length>0){let o=s.items[0];iv.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${r} +${a}`:r}else{let o=s.commentBefore;s.commentBefore=o?`${r} +${o}`:r}}i?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:rv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,i=!1,r=-1){for(let n of e)yield*this.next(n);yield*this.end(i,r)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(i,r,n)=>{let s=Dn(e);s[0]+=i,this.onError(s,"BAD_DIRECTIVE",r,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let i=GC.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let i=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Fn.YAMLParseError(Dn(e),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new Fn.YAMLParseError(Dn(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let i=YC.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){let r=this.doc.comment;this.doc.comment=r?`${r} +${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new Fn.YAMLParseError(Dn(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),n=new HC.Document(void 0,r);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,i,i],this.decorate(n,!1),yield n}}};nv.Composer=vu});var av=w($o=>{"use strict";var WC=hu(),zC=du(),KC=Mn(),sv=xn();function JC(t,e=!0,i){if(t){let r=(n,s,o)=>{let a=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(i)i(a,s,o);else throw new KC.YAMLParseError([a,a+1],s,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return zC.resolveFlowScalar(t,e,r);case"block-scalar":return WC.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function ZC(t,e){var c;let{implicitKey:i=!1,indent:r,inFlow:n=!1,offset:s=-1,type:o="PLAIN"}=e,a=sv.stringifyString({type:o,value:t},{implicitKey:i,indent:r>0?" ".repeat(r):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),l=(c=e.end)!=null?c:[{type:"newline",offset:-1,indent:r,source:` +`}];switch(a[0]){case"|":case">":{let u=a.indexOf(` +`),f=a.substring(0,u),d=a.substring(u+1)+` +`,g=[{type:"block-scalar-header",offset:s,indent:r,source:f}];return ov(g,l)||g.push({type:"newline",offset:-1,indent:r,source:` +`}),{type:"block-scalar",offset:s,indent:r,props:g,source:d}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:l};default:return{type:"scalar",offset:s,indent:r,source:a,end:l}}}function QC(t,e,i={}){let{afterKey:r=!1,implicitKey:n=!1,inFlow:s=!1,type:o}=i,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=sv.stringifyString({type:o,value:e},{implicitKey:n||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":XC(t,l);break;case'"':bu(t,l,"double-quoted-scalar");break;case"'":bu(t,l,"single-quoted-scalar");break;default:bu(t,l,"scalar")}}function XC(t,e){let i=e.indexOf(` +`),r=e.substring(0,i),n=e.substring(i+1)+` +`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,t.source=n}else{let{offset:s}=t,o="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:r}];ov(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:` +`});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:o,props:a,source:n})}}function ov(t,e){if(e)for(let i of e)switch(i.type){case"space":case"comment":t.push(i);break;case"newline":return t.push(i),!0}return!1}function bu(t,e,i){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=i,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let s of r)s.offset+=n;delete t.props,Object.assign(t,{type:i,source:e,end:r});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:i,source:e,end:[n]});break}default:{let r="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:i,indent:r,source:e,end:n})}}}$o.createScalarToken=ZC;$o.resolveAsScalar=JC;$o.setScalarValue=QC});var cv=w(lv=>{"use strict";var eT=t=>"type"in t?Ho(t):Vo(t);function Ho(t){switch(t.type){case"block-scalar":{let e="";for(let i of t.props)e+=Ho(i);return e+t.source}case"block-map":case"block-seq":{let e="";for(let i of t.items)e+=Vo(i);return e}case"flow-collection":{let e=t.start.source;for(let i of t.items)e+=Vo(i);for(let i of t.end)e+=i.source;return e}case"document":{let e=Vo(t);if(t.end)for(let i of t.end)e+=i.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let i of t.end)e+=i.source;return e}}}function Vo({start:t,key:e,sep:i,value:r}){let n="";for(let s of t)n+=s.source;if(e&&(n+=Ho(e)),i)for(let s of i)n+=s.source;return r&&(n+=Ho(r)),n}lv.stringify=eT});var pv=w(hv=>{"use strict";var _u=Symbol("break visit"),tT=Symbol("skip children"),uv=Symbol("remove item");function nr(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),fv(Object.freeze([]),t,e)}nr.BREAK=_u;nr.SKIP=tT;nr.REMOVE=uv;nr.itemAtPath=(t,e)=>{let i=t;for(let[r,n]of e){let s=i==null?void 0:i[r];if(s&&"items"in s)i=s.items[n];else return}return i};nr.parentCollection=(t,e)=>{let i=nr.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],n=i==null?void 0:i[r];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function fv(t,e,i){let r=i(e,t);if(typeof r=="symbol")return r;for(let n of["key","value"]){let s=e[n];if(s&&"items"in s){for(let o=0;o{"use strict";var wu=av(),iT=cv(),rT=pv(),xu="\uFEFF",Su="",Eu="",ku="",nT=t=>!!t&&"items"in t,sT=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function oT(t){switch(t){case xu:return"";case Su:return"";case Eu:return"";case ku:return"";default:return JSON.stringify(t)}}function aT(t){switch(t){case xu:return"byte-order-mark";case Su:return"doc-mode";case Eu:return"flow-error-end";case ku:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`:case`\r +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}vt.createScalarToken=wu.createScalarToken;vt.resolveAsScalar=wu.resolveAsScalar;vt.setScalarValue=wu.setScalarValue;vt.stringify=iT.stringify;vt.visit=rT.visit;vt.BOM=xu;vt.DOCUMENT=Su;vt.FLOW_END=Eu;vt.SCALAR=ku;vt.isCollection=nT;vt.isScalar=sT;vt.prettyToken=oT;vt.tokenType=aT});var Tu=w(mv=>{"use strict";var jn=Go();function Ht(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var dv=new Set("0123456789ABCDEFabcdef"),lT=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Yo=new Set(",[]{}"),cT=new Set(` ,[]{} +\r `),Ou=t=>!t||cT.has(t),Cu=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,i=!1){var n;if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!i;let r=(n=this.next)!=null?n:"stream";for(;r&&(i||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,i=this.buffer[e];for(;i===" "||i===" ";)i=this.buffer[++e];return!i||i==="#"||i===` +`?!0:i==="\r"?this.buffer[e+1]===` +`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let i=this.buffer[e];if(this.indentNext>0){let r=0;for(;i===" ";)i=this.buffer[++r+e];if(i==="\r"){let n=this.buffer[r+e+1];if(n===` +`||!n&&!this.atEnd)return e+r+1}return i===` +`||r>=this.indentNext||!i&&!this.atEnd?e+r:-1}if(i==="-"||i==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&Ht(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Ht(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,i]=this.peek(2);if(!i&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Ht(i)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let i=yield*this.pushIndicators();switch(e[i]){case"#":yield*this.pushCount(e.length-i);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Ou),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return i+=yield*this.parseBlockScalarHeader(),i+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-i),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,i,r=-1;do e=yield*this.pushNewline(),e>0?(i=yield*this.pushSpaces(!1),this.indentValue=r=i):i=0,i+=yield*this.pushSpaces(!0);while(e+i>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((r!==-1&&r"0"&&i<="9")this.blockScalarIndent=Number(i)-1;else if(i!=="-")break}return yield*this.pushUntil(i=>Ht(i)||i==="#")}*parseBlockScalar(){let e=this.pos-1,i=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":i+=1;break;case` +`:e=s,i=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===` +`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(i>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=i:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(` +`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;for(r=this.buffer[n];r===" ";)r=this.buffer[++n];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` +`;)r=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let a=s;for(;o===" ";)o=this.buffer[--s];if(o===` +`&&s>=this.pos&&s+1+i>a)e=s;else break}while(!0);return yield jn.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,i=this.pos-1,r=this.pos-1,n;for(;n=this.buffer[++r];)if(n===":"){let s=this.buffer[r+1];if(Ht(s)||e&&Yo.has(s))break;i=r}else if(Ht(n)){let s=this.buffer[r+1];if(n==="\r"&&(s===` +`?(r+=1,n=` +`,s=this.buffer[r+1]):i=r),s==="#"||e&&Yo.has(s))break;if(n===` +`){let o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Yo.has(n))break;i=r}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield jn.SCALAR,yield*this.pushToIndex(i+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,i){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(i&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Ou))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,i=this.charAt(1);if(Ht(i)||e&&Yo.has(i))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,i=this.buffer[e];for(;!Ht(i)&&i!==">";)i=this.buffer[++e];return yield*this.pushToIndex(i===">"?e+1:e,!1)}else{let e=this.pos+1,i=this.buffer[e];for(;i;)if(lT.has(i))i=this.buffer[++e];else if(i==="%"&&dv.has(this.buffer[e+1])&&dv.has(this.buffer[e+2]))i=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` +`?yield*this.pushCount(2):0}*pushSpaces(e){let i=this.pos-1,r;do r=this.buffer[++i];while(r===" "||e&&r===" ");let n=i-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=i),n}*pushUntil(e){let i=this.pos,r=this.buffer[i];for(;!e(r);)r=this.buffer[++i];return yield*this.pushToIndex(i,!1)}};mv.Lexer=Cu});var Iu=w(gv=>{"use strict";var Au=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let i=0,r=this.lineStarts.length;for(;i>1;this.lineStarts[s]{"use strict";var vv=Go(),uT=Tu();function sr(t,e){for(let i=0;i=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((i=t[++e])==null?void 0:i.type)==="space";);return t.splice(e,t.length)}function bv(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!sr(e.start,"explicit-key-ind")&&!sr(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,_v(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var Nu=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new uT.Lexer,this.onNewLine=e}*parse(e,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,i))yield*this.next(r);i||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",vv.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let i=vv.tokenType(e);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let i=e!=null?e:this.stack.pop();if(i)if(this.stack.length===0)yield i;else{let r=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in r?r.indent:0:i.type==="flow-collection"&&r.type==="document"&&(i.indent=0),i.type==="flow-collection"&&bv(i),r.type){case"document":r.value=i;break;case"block-scalar":r.props.push(i);break;case"block-map":{let n=r.items[r.items.length-1];if(n.value){r.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=i;else{Object.assign(n,{key:i,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=r.items[r.items.length-1];n.value?r.items.push({start:[],value:i}):n.value=i;break}case"flow-collection":{let n=r.items[r.items.length-1];!n||n.value?r.items.push({start:[],key:i,sep:[]}):n.sep?n.value=i:Object.assign(n,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){let n=i.items[i.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&yv(n.start)===-1&&(i.indent===0||n.start.every(s=>s.type!=="comment"||s.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,s=n&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind",o=[];if(s&&i.sep&&!i.value){let a=[];for(let l=0;le.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(o=i.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":s||i.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):s||i.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(sr(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(_v(i.key)&&!sr(i.sep,"newline")){let a=Yr(i.start),l=i.key,c=i.sep;c.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:c}]})}else o.length>0?i.sep=i.sep.concat(o,this.sourceToken):i.sep.push(this.sourceToken);else if(sr(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{let a=Yr(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||s?e.items.push({start:o,key:null,sep:[this.sourceToken]}):sr(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);s||i.value?(e.items.push({start:o,key:a,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(a):(Object.assign(i,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){n&&a.type!=="block-seq"&&e.items.push({start:o}),this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var r;let i=e.items[e.items.length-1];switch(this.type){case"newline":if(i.value){let n="end"in i.value?i.value.end:void 0,s=Array.isArray(n)?n[n.length-1]:void 0;(s==null?void 0:s.type)==="comment"?n==null||n.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,e.indent)){let n=e.items[e.items.length-2],s=(r=n==null?void 0:n.value)==null?void 0:r.end;if(Array.isArray(s)){Array.prototype.push.apply(s,i.start),s.push(this.sourceToken),e.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=e.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;i.value||sr(i.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let i=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?e.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?e.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!i||i.value?e.items.push({start:[],key:n,sep:[]}):i.sep?this.stack.push(n):Object.assign(i,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let n=Wo(r),s=Yr(n);bv(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let i=this.source.indexOf(` +`)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(` +`,i)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let i=Wo(e),r=Yr(i);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let i=Wo(e),r=Yr(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,i){return this.type!=="comment"||this.indent<=i?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};wv.Parser=Nu});var Ov=w($n=>{"use strict";var xv=yu(),fT=Bn(),Un=Mn(),hT=gc(),pT=Se(),dT=Iu(),Sv=Lu();function Ev(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new dT.LineCounter||null,prettyErrors:e}}function mT(t,e={}){let{lineCounter:i,prettyErrors:r}=Ev(e),n=new Sv.Parser(i==null?void 0:i.addNewLine),s=new xv.Composer(e),o=Array.from(s.compose(n.parse(t)));if(r&&i)for(let a of o)a.errors.forEach(Un.prettifyError(t,i)),a.warnings.forEach(Un.prettifyError(t,i));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function kv(t,e={}){let{lineCounter:i,prettyErrors:r}=Ev(e),n=new Sv.Parser(i==null?void 0:i.addNewLine),s=new xv.Composer(e),o=null;for(let a of s.compose(n.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Un.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&i&&(o.errors.forEach(Un.prettifyError(t,i)),o.warnings.forEach(Un.prettifyError(t,i))),o}function gT(t,e,i){let r;typeof e=="function"?r=e:i===void 0&&e&&typeof e=="object"&&(i=e);let n=kv(t,i);if(!n)return null;if(n.warnings.forEach(s=>hT.warn(n.options.logLevel,s)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:r},i))}function vT(t,e,i){var n;let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:i===void 0&&e&&(i=e),typeof i=="string"&&(i=i.length),typeof i=="number"){let s=Math.round(i);i=s<1?void 0:s>8?{indent:8}:{indent:s}}if(t===void 0){let{keepUndefined:s}=(n=i!=null?i:e)!=null?n:{};if(!s)return}return pT.isDocument(t)&&!r?t.toString(i):new fT.Document(t,r,i).toString(i)}$n.parse=gT;$n.parseAllDocuments=mT;$n.parseDocument=kv;$n.stringify=vT});var Tv=w(Oe=>{"use strict";var yT=yu(),bT=Bn(),_T=Qc(),Bu=Mn(),wT=vn(),Ii=Se(),xT=Oi(),ST=je(),ET=Ti(),kT=Ai(),OT=Go(),CT=Tu(),TT=Iu(),AT=Lu(),zo=Ov(),Cv=pn();Oe.Composer=yT.Composer;Oe.Document=bT.Document;Oe.Schema=_T.Schema;Oe.YAMLError=Bu.YAMLError;Oe.YAMLParseError=Bu.YAMLParseError;Oe.YAMLWarning=Bu.YAMLWarning;Oe.Alias=wT.Alias;Oe.isAlias=Ii.isAlias;Oe.isCollection=Ii.isCollection;Oe.isDocument=Ii.isDocument;Oe.isMap=Ii.isMap;Oe.isNode=Ii.isNode;Oe.isPair=Ii.isPair;Oe.isScalar=Ii.isScalar;Oe.isSeq=Ii.isSeq;Oe.Pair=xT.Pair;Oe.Scalar=ST.Scalar;Oe.YAMLMap=ET.YAMLMap;Oe.YAMLSeq=kT.YAMLSeq;Oe.CST=OT;Oe.Lexer=CT.Lexer;Oe.LineCounter=TT.LineCounter;Oe.Parser=AT.Parser;Oe.parse=zo.parse;Oe.parseAllDocuments=zo.parseAllDocuments;Oe.parseDocument=zo.parseDocument;Oe.stringify=zo.stringify;Oe.visit=Cv.visit;Oe.visitAsync=Cv.visitAsync});var Lv=w((SL,Nv)=>{"use strict";var{Duplex:IT}=require("stream");function Av(t){t.emit("close")}function NT(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Iv(t){this.removeListener("error",Iv),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function LT(t,e){let i=!0,r=new IT({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(s,o){let a=!o&&r._readableState.objectMode?s.toString():s;r.push(a)||t.pause()}),t.once("error",function(s){r.destroyed||(i=!1,r.destroy(s))}),t.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(n,s){if(t.readyState===t.CLOSED){s(n),process.nextTick(Av,r);return}let o=!1;t.once("error",function(l){o=!0,s(l)}),t.once("close",function(){o||s(n),process.nextTick(Av,r)}),i&&t.terminate()},r._final=function(n){if(t.readyState===t.CONNECTING){t.once("open",function(){r._final(n)});return}t._socket!==null&&(t._socket._writableState.finished?(n(),r._readableState.endEmitted&&r.destroy()):(t._socket.once("finish",function(){n()}),t.close()))},r._read=function(){t.isPaused&&t.resume()},r._write=function(n,s,o){if(t.readyState===t.CONNECTING){t.once("open",function(){r._write(n,s,o)});return}t.send(n,o)},r.on("end",NT),r.on("error",Iv),r}Nv.exports=LT});var Ni=w((EL,Bv)=>{"use strict";Bv.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Vn=w((kL,Ko)=>{"use strict";var{EMPTY_BUFFER:BT}=Ni(),Ru=Buffer[Symbol.species];function RT(t,e){if(t.length===0)return BT;if(t.length===1)return t[0];let i=Buffer.allocUnsafe(e),r=0;for(let n=0;n{"use strict";var Mv=Symbol("kDone"),Mu=Symbol("kRun"),qu=class{constructor(e){this[Mv]=()=>{this.pending--,this[Mu]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Mu]()}[Mu](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Mv])}}};qv.exports=qu});var Yn=w((CL,$v)=>{"use strict";var Hn=require("zlib"),Dv=Vn(),MT=Fv(),{kStatusCode:jv}=Ni(),qT=Buffer[Symbol.species],FT=Buffer.from([0,0,255,255]),Qo=Symbol("permessage-deflate"),hi=Symbol("total-length"),Gn=Symbol("callback"),Li=Symbol("buffers"),Zo=Symbol("error"),Jo,Fu=class{constructor(e,i,r){if(this._maxPayload=r|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!i,this._deflate=null,this._inflate=null,this.params=null,!Jo){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Jo=new MT(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[Gn];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let i=this._options,r=e.find(n=>!(i.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(i.serverMaxWindowBits===!1||typeof i.serverMaxWindowBits=="number"&&i.serverMaxWindowBits>n.server_max_window_bits)||typeof i.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return i.serverNoContextTakeover&&(r.server_no_context_takeover=!0),i.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof i.serverMaxWindowBits=="number"&&(r.server_max_window_bits=i.serverMaxWindowBits),typeof i.clientMaxWindowBits=="number"?r.client_max_window_bits=i.clientMaxWindowBits:(r.client_max_window_bits===!0||i.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(e){let i=e[0];if(this._options.clientNoContextTakeover===!1&&i.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!i.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(i.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&i.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return i}normalizeParams(e){return e.forEach(i=>{Object.keys(i).forEach(r=>{let n=i[r];if(n.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(n=n[0],r==="client_max_window_bits"){if(n!==!0){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else if(r==="server_max_window_bits"){let s=+n;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${n}`);n=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${n}`)}else throw new Error(`Unknown parameter "${r}"`);i[r]=n})}),e}decompress(e,i,r){Jo.add(n=>{this._decompress(e,i,(s,o)=>{n(),r(s,o)})})}compress(e,i,r){Jo.add(n=>{this._compress(e,i,(s,o)=>{n(),r(s,o)})})}_decompress(e,i,r){let n=this._isServer?"client":"server";if(!this._inflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Hn.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Hn.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Qo]=this,this._inflate[hi]=0,this._inflate[Li]=[],this._inflate.on("error",jT),this._inflate.on("data",Uv)}this._inflate[Gn]=r,this._inflate.write(e),i&&this._inflate.write(FT),this._inflate.flush(()=>{let s=this._inflate[Zo];if(s){this._inflate.close(),this._inflate=null,r(s);return}let o=Dv.concat(this._inflate[Li],this._inflate[hi]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[hi]=0,this._inflate[Li]=[],i&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),r(null,o)})}_compress(e,i,r){let n=this._isServer?"server":"client";if(!this._deflate){let s=`${n}_max_window_bits`,o=typeof this.params[s]!="number"?Hn.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Hn.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[hi]=0,this._deflate[Li]=[],this._deflate.on("data",DT)}this._deflate[Gn]=r,this._deflate.write(e),this._deflate.flush(Hn.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Dv.concat(this._deflate[Li],this._deflate[hi]);i&&(s=new qT(s.buffer,s.byteOffset,s.length-4)),this._deflate[Gn]=null,this._deflate[hi]=0,this._deflate[Li]=[],i&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};$v.exports=Fu;function DT(t){this[Li].push(t),this[hi]+=t.length}function Uv(t){if(this[hi]+=t.length,this[Qo]._maxPayload<1||this[hi]<=this[Qo]._maxPayload){this[Li].push(t);return}this[Zo]=new RangeError("Max payload size exceeded"),this[Zo].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Zo][jv]=1009,this.removeListener("data",Uv),this.reset()}function jT(t){this[Qo]._inflate=null,t[jv]=1007,this[Gn](t)}});var Wn=w((TL,Xo)=>{"use strict";var{isUtf8:Vv}=require("buffer"),UT=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function $T(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Du(t){let e=t.length,i=0;for(;i=e||(t[i+1]&192)!==128||(t[i+2]&192)!==128||t[i]===224&&(t[i+1]&224)===128||t[i]===237&&(t[i+1]&224)===160)return!1;i+=3}else if((t[i]&248)===240){if(i+3>=e||(t[i+1]&192)!==128||(t[i+2]&192)!==128||(t[i+3]&192)!==128||t[i]===240&&(t[i+1]&240)===128||t[i]===244&&t[i+1]>143||t[i]>244)return!1;i+=4}else return!1;return!0}Xo.exports={isValidStatusCode:$T,isValidUTF8:Du,tokenChars:UT};if(Vv)Xo.exports.isValidUTF8=function(t){return t.length<24?Du(t):Vv(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=require("utf-8-validate");Xo.exports.isValidUTF8=function(e){return e.length<32?Du(e):t(e)}}catch{}});var Hu=w((AL,Jv)=>{"use strict";var{Writable:VT}=require("stream"),Hv=Yn(),{BINARY_TYPES:HT,EMPTY_BUFFER:Gv,kStatusCode:GT,kWebSocket:YT}=Ni(),{concat:ju,toArrayBuffer:WT,unmask:zT}=Vn(),{isValidStatusCode:KT,isValidUTF8:Yv}=Wn(),ea=Buffer[Symbol.species],Rt=0,Wv=1,zv=2,Kv=3,Uu=4,$u=5,ta=6,Vu=class extends VT{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||HT[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[YT]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Rt}_write(e,i,r){if(this._opcode===8&&this._state==Rt)return r();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(r)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e=r.length?i.set(this._buffers.shift(),n):(i.set(new Uint8Array(r.buffer,r.byteOffset,e),n),this._buffers[0]=new ea(r.buffer,r.byteOffset+e,r.length-e)),e-=r.length}while(e>0);return i}startLoop(e){this._loop=!0;do switch(this._state){case Rt:this.getInfo(e);break;case Wv:this.getPayloadLength16(e);break;case zv:this.getPayloadLength64(e);break;case Kv:this.getMask();break;case Uu:this.getData(e);break;case $u:case ta:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let i=this.consume(2);if(i[0]&48){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(n);return}let r=(i[0]&64)===64;if(r&&!this._extensions[Hv.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._fin=(i[0]&128)===128,this._opcode=i[0]&15,this._payloadLength=i[1]&127,this._opcode===0){if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(n);return}if(r){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(i[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(n);return}this._payloadLength===126?this._state=Wv:this._payloadLength===127?this._state=zv:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let i=this.consume(8),r=i.readUInt32BE(0);if(r>Math.pow(2,53-32)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(n);return}this._payloadLength=r*Math.pow(2,32)+i.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(i);return}this._masked?this._state=Kv:this._state=Uu}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Uu}getData(e){let i=Gv;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(i,e);return}if(this._compressed){this._state=$u,this.decompress(i,e);return}i.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(i)),this.dataMessage(e)}decompress(e,i){this._extensions[Hv.extensionName].decompress(e,this._fin,(n,s)=>{if(n)return i(n);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");i(o);return}this._fragments.push(s)}this.dataMessage(i),this._state===Rt&&this.startLoop(i)})}dataMessage(e){if(!this._fin){this._state=Rt;return}let i=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=ju(r,i):this._binaryType==="arraybuffer"?n=WT(ju(r,i)):n=r,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Rt):(this._state=ta,setImmediate(()=>{this.emit("message",n,!0),this._state=Rt,this.startLoop(e)}))}else{let n=ju(r,i);if(!this._skipUTF8Validation&&!Yv(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===$u||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Rt):(this._state=ta,setImmediate(()=>{this.emit("message",n,!1),this._state=Rt,this.startLoop(e)}))}}controlMessage(e,i){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Gv),this.end();else{let r=e.readUInt16BE(0);if(!KT(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(s);return}let n=new ea(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Yv(n)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");i(s);return}this._loop=!1,this.emit("conclude",r,n),this.end()}this._state=Rt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Rt):(this._state=ta,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Rt,this.startLoop(i)}))}createError(e,i,r,n,s){this._loop=!1,this._errored=!0;let o=new e(r?`Invalid WebSocket frame: ${i}`:i);return Error.captureStackTrace(o,this.createError),o.code=s,o[GT]=n,o}};Jv.exports=Vu});var Yu=w((NL,Xv)=>{"use strict";var{Duplex:IL}=require("stream"),{randomFillSync:JT}=require("crypto"),Zv=Yn(),{EMPTY_BUFFER:ZT}=Ni(),{isValidStatusCode:QT}=Wn(),{mask:Qv,toBuffer:Wr}=Vn(),Gt=Symbol("kByteLength"),XT=Buffer.alloc(4),ia=8*1024,or,zr=ia,Gu=class t{constructor(e,i,r){this._extensions=i||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,i){let r,n=!1,s=2,o=!1;i.mask&&(r=i.maskBuffer||XT,i.generateMask?i.generateMask(r):(zr===ia&&(or===void 0&&(or=Buffer.alloc(ia)),JT(or,0,ia),zr=0),r[0]=or[zr++],r[1]=or[zr++],r[2]=or[zr++],r[3]=or[zr++]),o=(r[0]|r[1]|r[2]|r[3])===0,s=6);let a;typeof e=="string"?(!i.mask||o)&&i[Gt]!==void 0?a=i[Gt]:(e=Buffer.from(e),a=e.length):(a=e.length,n=i.mask&&i.readOnly&&!o);let l=a;a>=65536?(s+=8,l=127):a>125&&(s+=2,l=126);let c=Buffer.allocUnsafe(n?a+s:s);return c[0]=i.fin?i.opcode|128:i.opcode,i.rsv1&&(c[0]|=64),c[1]=l,l===126?c.writeUInt16BE(a,2):l===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),i.mask?(c[1]|=128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o?[c,e]:n?(Qv(e,r,c,s,a),[c]):(Qv(e,r,e,0,a),[c,e])):[c,e]}close(e,i,r,n){let s;if(e===void 0)s=ZT;else{if(typeof e!="number"||!QT(e))throw new TypeError("First argument must be a valid error code number");if(i===void 0||!i.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(i);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof i=="string"?s.write(i,2):s.set(i,2)}}let o={[Gt]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,s,!1,o,n]):this.sendFrame(t.frame(s,o),n)}ping(e,i,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):(e=Wr(e),n=e.length,s=Wr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[Gt]:n,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}pong(e,i,r){let n,s;if(typeof e=="string"?(n=Buffer.byteLength(e),s=!1):(e=Wr(e),n=e.length,s=Wr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[Gt]:n,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,e,!1,o,r]):this.sendFrame(t.frame(e,o),r)}send(e,i,r){let n=this._extensions[Zv.extensionName],s=i.binary?2:1,o=i.compress,a,l;if(typeof e=="string"?(a=Buffer.byteLength(e),l=!1):(e=Wr(e),a=e.length,l=Wr.readOnly),this._firstFragment?(this._firstFragment=!1,o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=n._threshold),this._compress=o):(o=!1,s=0),i.fin&&(this._firstFragment=!0),n){let c={[Gt]:a,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:l,rsv1:o};this._deflating?this.enqueue([this.dispatch,e,this._compress,c,r]):this.dispatch(e,this._compress,c,r)}else this.sendFrame(t.frame(e,{[Gt]:a,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:l,rsv1:!1}),r)}dispatch(e,i,r,n){if(!i){this.sendFrame(t.frame(e,r),n);return}let s=this._extensions[Zv.extensionName];this._bufferedBytes+=r[Gt],this._deflating=!0,s.compress(e,r.fin,(o,a)=>{if(this._socket.destroyed){let l=new Error("The socket was closed while data was being compressed");typeof n=="function"&&n(l);for(let c=0;c{"use strict";var{kForOnEventAttribute:zn,kListener:Wu}=Ni(),ey=Symbol("kCode"),ty=Symbol("kData"),iy=Symbol("kError"),ry=Symbol("kMessage"),ny=Symbol("kReason"),Kr=Symbol("kTarget"),sy=Symbol("kType"),oy=Symbol("kWasClean"),pi=class{constructor(e){this[Kr]=null,this[sy]=e}get target(){return this[Kr]}get type(){return this[sy]}};Object.defineProperty(pi.prototype,"target",{enumerable:!0});Object.defineProperty(pi.prototype,"type",{enumerable:!0});var ar=class extends pi{constructor(e,i={}){super(e),this[ey]=i.code===void 0?0:i.code,this[ny]=i.reason===void 0?"":i.reason,this[oy]=i.wasClean===void 0?!1:i.wasClean}get code(){return this[ey]}get reason(){return this[ny]}get wasClean(){return this[oy]}};Object.defineProperty(ar.prototype,"code",{enumerable:!0});Object.defineProperty(ar.prototype,"reason",{enumerable:!0});Object.defineProperty(ar.prototype,"wasClean",{enumerable:!0});var Jr=class extends pi{constructor(e,i={}){super(e),this[iy]=i.error===void 0?null:i.error,this[ry]=i.message===void 0?"":i.message}get error(){return this[iy]}get message(){return this[ry]}};Object.defineProperty(Jr.prototype,"error",{enumerable:!0});Object.defineProperty(Jr.prototype,"message",{enumerable:!0});var Kn=class extends pi{constructor(e,i={}){super(e),this[ty]=i.data===void 0?null:i.data}get data(){return this[ty]}};Object.defineProperty(Kn.prototype,"data",{enumerable:!0});var eA={addEventListener(t,e,i={}){for(let n of this.listeners(t))if(!i[zn]&&n[Wu]===e&&!n[zn])return;let r;if(t==="message")r=function(s,o){let a=new Kn("message",{data:o?s:s.toString()});a[Kr]=this,ra(e,this,a)};else if(t==="close")r=function(s,o){let a=new ar("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Kr]=this,ra(e,this,a)};else if(t==="error")r=function(s){let o=new Jr("error",{error:s,message:s.message});o[Kr]=this,ra(e,this,o)};else if(t==="open")r=function(){let s=new pi("open");s[Kr]=this,ra(e,this,s)};else return;r[zn]=!!i[zn],r[Wu]=e,i.once?this.once(t,r):this.on(t,r)},removeEventListener(t,e){for(let i of this.listeners(t))if(i[Wu]===e&&!i[zn]){this.removeListener(t,i);break}}};ay.exports={CloseEvent:ar,ErrorEvent:Jr,Event:pi,EventTarget:eA,MessageEvent:Kn};function ra(t,e,i){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,i):t.call(e,i)}});var zu=w((BL,cy)=>{"use strict";var{tokenChars:Jn}=Wn();function ii(t,e,i){t[e]===void 0?t[e]=[i]:t[e].push(i)}function tA(t){let e=Object.create(null),i=Object.create(null),r=!1,n=!1,s=!1,o,a,l=-1,c=-1,u=-1,f=0;for(;f{let i=t[e];return Array.isArray(i)||(i=[i]),i.map(r=>[e].concat(Object.keys(r).map(n=>{let s=r[n];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?n:`${n}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}cy.exports={format:iA,parse:tA}});var Xu=w((ML,_y)=>{"use strict";var rA=require("events"),nA=require("https"),sA=require("http"),hy=require("net"),oA=require("tls"),{randomBytes:aA,createHash:lA}=require("crypto"),{Duplex:RL,Readable:PL}=require("stream"),{URL:Ku}=require("url"),Bi=Yn(),cA=Hu(),uA=Yu(),{BINARY_TYPES:uy,EMPTY_BUFFER:na,GUID:fA,kForOnEventAttribute:Ju,kListener:hA,kStatusCode:pA,kWebSocket:nt,NOOP:py}=Ni(),{EventTarget:{addEventListener:dA,removeEventListener:mA}}=ly(),{format:gA,parse:vA}=zu(),{toBuffer:yA}=Vn(),bA=30*1e3,dy=Symbol("kAborted"),Zu=[8,13],di=["CONNECTING","OPEN","CLOSING","CLOSED"],_A=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Fe=class t extends rA{constructor(e,i,r){super(),this._binaryType=uy[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=na,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,i===void 0?i=[]:Array.isArray(i)||(typeof i=="object"&&i!==null?(r=i,i=[]):i=[i]),my(this,e,i,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){uy.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,i,r){let n=new cA({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation});this._sender=new uA(e,this._extensions,r.generateMask),this._receiver=n,this._socket=e,n[nt]=this,e[nt]=this,n.on("conclude",SA),n.on("drain",EA),n.on("error",kA),n.on("message",OA),n.on("ping",CA),n.on("pong",TA),e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),i.length>0&&e.unshift(i),e.on("close",vy),e.on("data",oa),e.on("end",yy),e.on("error",by),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Bi.extensionName]&&this._extensions[Bi.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,i){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){let r="WebSocket was closed before the connection was established";kt(this,this._req,r);return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,i,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),bA)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,i,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=i=void 0):typeof i=="function"&&(r=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Qu(this,e,r);return}i===void 0&&(i=!this._isServer),this._sender.ping(e||na,i,r)}pong(e,i,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(r=e,e=i=void 0):typeof i=="function"&&(r=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Qu(this,e,r);return}i===void 0&&(i=!this._isServer),this._sender.pong(e||na,i,r)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,i,r){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof i=="function"&&(r=i,i={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Qu(this,e,r);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...i};this._extensions[Bi.extensionName]||(n.compress=!1),this._sender.send(e||na,n,r)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){let e="WebSocket was closed before the connection was established";kt(this,this._req,e);return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(Fe,"CONNECTING",{enumerable:!0,value:di.indexOf("CONNECTING")});Object.defineProperty(Fe.prototype,"CONNECTING",{enumerable:!0,value:di.indexOf("CONNECTING")});Object.defineProperty(Fe,"OPEN",{enumerable:!0,value:di.indexOf("OPEN")});Object.defineProperty(Fe.prototype,"OPEN",{enumerable:!0,value:di.indexOf("OPEN")});Object.defineProperty(Fe,"CLOSING",{enumerable:!0,value:di.indexOf("CLOSING")});Object.defineProperty(Fe.prototype,"CLOSING",{enumerable:!0,value:di.indexOf("CLOSING")});Object.defineProperty(Fe,"CLOSED",{enumerable:!0,value:di.indexOf("CLOSED")});Object.defineProperty(Fe.prototype,"CLOSED",{enumerable:!0,value:di.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(Fe.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(Fe.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[Ju])return e[hA];return null},set(e){for(let i of this.listeners(t))if(i[Ju]){this.removeListener(t,i);break}typeof e=="function"&&this.addEventListener(t,e,{[Ju]:!0})}})});Fe.prototype.addEventListener=dA;Fe.prototype.removeEventListener=mA;_y.exports=Fe;function my(t,e,i,r){let n={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Zu[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=n.autoPong,!Zu.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${Zu.join(", ")})`);let s;if(e instanceof Ku)s=e;else try{s=new Ku(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),t._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",l;if(s.protocol!=="ws:"&&!o&&!a?l=`The URL's protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"`:a&&!s.pathname?l="The URL's pathname is empty":s.hash&&(l="The URL contains a fragment identifier"),l){let v=new SyntaxError(l);if(t._redirects===0)throw v;sa(t,v);return}let c=o?443:80,u=aA(16).toString("base64"),f=o?nA.request:sA.request,d=new Set,g;if(n.createConnection=n.createConnection||(o?xA:wA),n.defaultPort=n.defaultPort||c,n.port=s.port||c,n.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},n.path=s.pathname+s.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(g=new Bi(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=gA({[Bi.extensionName]:g.offer()})),i.length){for(let v of i){if(typeof v!="string"||!_A.test(v)||d.has(v))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(v)}n.headers["Sec-WebSocket-Protocol"]=i.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(s.username||s.password)&&(n.auth=`${s.username}:${s.password}`),a){let v=n.path.split(":");n.socketPath=v[0],n.path=v[1]}let m;if(n.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=o,t._originalHostOrSocketPath=a?n.socketPath:s.host;let v=r&&r.headers;if(r={...r,headers:{}},v)for(let[b,_]of Object.entries(v))r.headers[b.toLowerCase()]=_}else if(t.listenerCount("redirect")===0){let v=a?t._originalIpc?n.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:s.host===t._originalHostOrSocketPath;(!v||t._originalSecure&&!o)&&(delete n.headers.authorization,delete n.headers.cookie,v||delete n.headers.host,n.auth=void 0)}n.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),m=t._req=f(n),t._redirects&&t.emit("redirect",t.url,m)}else m=t._req=f(n);n.timeout&&m.on("timeout",()=>{kt(t,m,"Opening handshake has timed out")}),m.on("error",v=>{m===null||m[dy]||(m=t._req=null,sa(t,v))}),m.on("response",v=>{let b=v.headers.location,_=v.statusCode;if(b&&n.followRedirects&&_>=300&&_<400){if(++t._redirects>n.maxRedirects){kt(t,m,"Maximum redirects exceeded");return}m.abort();let S;try{S=new Ku(b,e)}catch{let k=new SyntaxError(`Invalid URL: ${b}`);sa(t,k);return}my(t,S,i,r)}else t.emit("unexpected-response",m,v)||kt(t,m,`Unexpected server response: ${v.statusCode}`)}),m.on("upgrade",(v,b,_)=>{if(t.emit("upgrade",v),t.readyState!==Fe.CONNECTING)return;m=t._req=null;let S=v.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){kt(t,b,"Invalid Upgrade header");return}let O=lA("sha1").update(u+fA).digest("base64");if(v.headers["sec-websocket-accept"]!==O){kt(t,b,"Invalid Sec-WebSocket-Accept header");return}let k=v.headers["sec-websocket-protocol"],E;if(k!==void 0?d.size?d.has(k)||(E="Server sent an invalid subprotocol"):E="Server sent a subprotocol but none was requested":d.size&&(E="Server sent no subprotocol"),E){kt(t,b,E);return}k&&(t._protocol=k);let R=v.headers["sec-websocket-extensions"];if(R!==void 0){if(!g){kt(t,b,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let T;try{T=vA(R)}catch{kt(t,b,"Invalid Sec-WebSocket-Extensions header");return}let A=Object.keys(T);if(A.length!==1||A[0]!==Bi.extensionName){kt(t,b,"Server indicated an extension that was not requested");return}try{g.accept(T[Bi.extensionName])}catch{kt(t,b,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[Bi.extensionName]=g}t.setSocket(b,_,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(m,t):m.end()}function sa(t,e){t._readyState=Fe.CLOSING,t.emit("error",e),t.emitClose()}function wA(t){return t.path=t.socketPath,hy.connect(t)}function xA(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=hy.isIP(t.host)?"":t.host),oA.connect(t)}function kt(t,e,i){t._readyState=Fe.CLOSING;let r=new Error(i);Error.captureStackTrace(r,kt),e.setHeader?(e[dy]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(sa,t,r)):(e.destroy(r),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Qu(t,e,i){if(e){let r=yA(e).length;t._socket?t._sender._bufferedBytes+=r:t._bufferedAmount+=r}if(i){let r=new Error(`WebSocket is not open: readyState ${t.readyState} (${di[t.readyState]})`);process.nextTick(i,r)}}function SA(t,e){let i=this[nt];i._closeFrameReceived=!0,i._closeMessage=e,i._closeCode=t,i._socket[nt]!==void 0&&(i._socket.removeListener("data",oa),process.nextTick(gy,i._socket),t===1005?i.close():i.close(t,e))}function EA(){let t=this[nt];t.isPaused||t._socket.resume()}function kA(t){let e=this[nt];e._socket[nt]!==void 0&&(e._socket.removeListener("data",oa),process.nextTick(gy,e._socket),e.close(t[pA])),e.emit("error",t)}function fy(){this[nt].emitClose()}function OA(t,e){this[nt].emit("message",t,e)}function CA(t){let e=this[nt];e._autoPong&&e.pong(t,!this._isServer,py),e.emit("ping",t)}function TA(t){this[nt].emit("pong",t)}function gy(t){t.resume()}function vy(){let t=this[nt];this.removeListener("close",vy),this.removeListener("data",oa),this.removeListener("end",yy),t._readyState=Fe.CLOSING;let e;!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&(e=t._socket.read())!==null&&t._receiver.write(e),t._receiver.end(),this[nt]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",fy),t._receiver.on("finish",fy))}function oa(t){this[nt]._receiver.write(t)||this.pause()}function yy(){let t=this[nt];t._readyState=Fe.CLOSING,t._receiver.end(),this.end()}function by(){let t=this[nt];this.removeListener("error",by),this.on("error",py),t&&(t._readyState=Fe.CLOSING,this.destroy())}});var xy=w((qL,wy)=>{"use strict";var{tokenChars:AA}=Wn();function IA(t){let e=new Set,i=-1,r=-1,n=0;for(n;n{"use strict";var NA=require("events"),aa=require("http"),{Duplex:FL}=require("stream"),{createHash:LA}=require("crypto"),Sy=zu(),lr=Yn(),BA=xy(),RA=Xu(),{GUID:PA,kWebSocket:MA}=Ni(),qA=/^[+/0-9A-Za-z]{22}==$/,Ey=0,ky=1,Cy=2,ef=class extends NA{constructor(e,i){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:RA,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=aa.createServer((r,n)=>{let s=aa.STATUS_CODES[426];n.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),n.end(s)}),this._server.listen(e.port,e.host,e.backlog,i)):e.server&&(this._server=e.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=FA(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,s,o)=>{this.handleUpgrade(n,s,o,r)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Ey}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===Cy){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Zn,this);return}if(e&&this.once("close",e),this._state!==ky)if(this._state=ky,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Zn,this):process.nextTick(Zn,this);else{let i=this._server;this._removeListeners(),this._removeListeners=this._server=null,i.close(()=>{Zn(this)})}}shouldHandle(e){if(this.options.path){let i=e.url.indexOf("?");if((i!==-1?e.url.slice(0,i):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,i,r,n){i.on("error",Oy);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){cr(this,e,i,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){cr(this,e,i,400,"Invalid Upgrade header");return}if(s===void 0||!qA.test(s)){cr(this,e,i,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==8&&a!==13){cr(this,e,i,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(e)){Qn(i,400);return}let l=e.headers["sec-websocket-protocol"],c=new Set;if(l!==void 0)try{c=BA.parse(l)}catch{cr(this,e,i,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let d=new lr(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=Sy.parse(u);g[lr.extensionName]&&(d.accept(g[lr.extensionName]),f[lr.extensionName]=d)}catch{cr(this,e,i,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(d,(g,m,v,b)=>{if(!g)return Qn(i,m||401,v,b);this.completeUpgrade(f,s,c,e,i,r,n)});return}if(!this.options.verifyClient(d))return Qn(i,401)}this.completeUpgrade(f,s,c,e,i,r,n)}completeUpgrade(e,i,r,n,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[MA])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ey)return Qn(s,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${LA("sha1").update(i+PA).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(r.size){let f=this.options.handleProtocols?this.options.handleProtocols(r,n):r.values().next().value;f&&(c.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[lr.extensionName]){let f=e[lr.extensionName].params,d=Sy.format({[lr.extensionName]:[f]});c.push(`Sec-WebSocket-Extensions: ${d}`),u._extensions=e}this.emit("headers",c,n),s.write(c.concat(`\r `).join(`\r -`)),s.removeListener("error",us),u.setSocket(s,o,{maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Bi,this)})),l(u,n)}};du.exports=cs;function p0(t,e){for(let i of Object.keys(e))t.on(i,e[i]);return function(){for(let r of Object.keys(e))t.removeListener(r,e[r])}}function Bi(t){t._state=pu,t.emit("close")}function us(){this.destroy()}function ni(t,e,i,r){t.writable&&(i=i||lr.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...r},t.write(`HTTP/1.1 ${e} ${lr.STATUS_CODES[e]}\r +`)),s.removeListener("error",Oy),u.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Zn,this)})),a(u,n)}};Ty.exports=ef;function FA(t,e){for(let i of Object.keys(e))t.on(i,e[i]);return function(){for(let r of Object.keys(e))t.removeListener(r,e[r])}}function Zn(t){t._state=Cy,t.emit("close")}function Oy(){this.destroy()}function Qn(t,e,i,r){i=i||aa.STATUS_CODES[e],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...r},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${aa.STATUS_CODES[e]}\r `+Object.keys(r).map(n=>`${n}: ${r[n]}`).join(`\r `)+`\r \r -`+i)),t.removeListener("error",us),t.destroy()}});var _u=y((Dv,xu)=>{var xt=require("constants"),m0=process.cwd,cr=null,g0=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cr||(cr=m0.call(process)),cr};try{process.cwd()}catch{}typeof process.chdir=="function"&&(ds=process.chdir,process.chdir=function(t){cr=null,ds.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,ds));var ds;xu.exports=v0;function v0(t){xt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||i(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=a(t.statSync),t.fstatSync=a(t.fstatSync),t.lstatSync=a(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,f,h,p){p&&process.nextTick(p)},t.lchownSync=function(){}),g0==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function f(h,p,d){var m=Date.now(),v=0;u(h,p,function E(I){if(I&&(I.code==="EACCES"||I.code==="EPERM")&&Date.now()-m<6e4){setTimeout(function(){t.stat(p,function(w,C){w&&w.code==="ENOENT"?u(h,p,E):d(I)})},v),v<100&&(v+=10);return}d&&d(I)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function f(h,p,d,m,v,E){var I;if(E&&typeof E=="function"){var w=0;I=function(C,_,$){if(C&&C.code==="EAGAIN"&&w<10)return w++,u.call(t,h,p,d,m,v,I);E.apply(this,arguments)}}return u.call(t,h,p,d,m,v,I)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(f,h,p,d,m){for(var v=0;;)try{return u.call(t,f,h,p,d,m)}catch(E){if(E.code==="EAGAIN"&&v<10){v++;continue}throw E}}}(t.readSync);function e(u){u.lchmod=function(f,h,p){u.open(f,xt.O_WRONLY|xt.O_SYMLINK,h,function(d,m){if(d){p&&p(d);return}u.fchmod(m,h,function(v){u.close(m,function(E){p&&p(v||E)})})})},u.lchmodSync=function(f,h){var p=u.openSync(f,xt.O_WRONLY|xt.O_SYMLINK,h),d=!0,m;try{m=u.fchmodSync(p,h),d=!1}finally{if(d)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}}function i(u){xt.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,h,p,d){u.open(f,xt.O_SYMLINK,function(m,v){if(m){d&&d(m);return}u.futimes(v,h,p,function(E){u.close(v,function(I){d&&d(E||I)})})})},u.lutimesSync=function(f,h,p){var d=u.openSync(f,xt.O_SYMLINK),m,v=!0;try{m=u.futimesSync(d,h,p),v=!1}finally{if(v)try{u.closeSync(d)}catch{}else u.closeSync(d)}return m}):u.futimes&&(u.lutimes=function(f,h,p,d){d&&process.nextTick(d)},u.lutimesSync=function(){})}function r(u){return u&&function(f,h,p){return u.call(t,f,h,function(d){c(d)&&(d=null),p&&p.apply(this,arguments)})}}function n(u){return u&&function(f,h){try{return u.call(t,f,h)}catch(p){if(!c(p))throw p}}}function s(u){return u&&function(f,h,p,d){return u.call(t,f,h,p,function(m){c(m)&&(m=null),d&&d.apply(this,arguments)})}}function o(u){return u&&function(f,h,p){try{return u.call(t,f,h,p)}catch(d){if(!c(d))throw d}}}function l(u){return u&&function(f,h,p){typeof h=="function"&&(p=h,h=null);function d(m,v){v&&(v.uid<0&&(v.uid+=4294967296),v.gid<0&&(v.gid+=4294967296)),p&&p.apply(this,arguments)}return h?u.call(t,f,h,d):u.call(t,f,d)}}function a(u){return u&&function(f,h){var p=h?u.call(t,f,h):u.call(t,f);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function c(u){if(!u||u.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var wu=y((jv,bu)=>{var yu=require("stream").Stream;bu.exports=x0;function x0(t){return{ReadStream:e,WriteStream:i};function e(r,n){if(!(this instanceof e))return new e(r,n);yu.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),l=0,a=o.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(u,f){if(u){s.emit("error",u),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read()})}function i(r,n){if(!(this instanceof i))return new i(r,n);yu.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),o=0,l=s.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Su=y((qv,Eu)=>{"use strict";Eu.exports=y0;var _0=Object.getPrototypeOf||function(t){return t.__proto__};function y0(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:_0(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))}),e}});var Iu=y((Hv,vs)=>{var ke=require("fs"),b0=_u(),w0=wu(),E0=Su(),ur=require("util"),Ne,hr;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Ne=Symbol.for("graceful-fs.queue"),hr=Symbol.for("graceful-fs.previous")):(Ne="___graceful-fs.queue",hr="___graceful-fs.previous");function S0(){}function Ou(t,e){Object.defineProperty(t,Ne,{get:function(){return e}})}var Rt=S0;ur.debuglog?Rt=ur.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Rt=function(){var t=ur.format.apply(ur,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t)});ke[Ne]||(ku=global[Ne]||[],Ou(ke,ku),ke.close=function(t){function e(i,r){return t.call(ke,i,function(n){n||Cu(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(e,hr,{value:t}),e}(ke.close),ke.closeSync=function(t){function e(i){t.apply(ke,arguments),Cu()}return Object.defineProperty(e,hr,{value:t}),e}(ke.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Rt(ke[Ne]),require("assert").equal(ke[Ne].length,0)}));var ku;global[Ne]||Ou(global,ke[Ne]);vs.exports=ms(E0(ke));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ke.__patched&&(vs.exports=ms(ke),ke.__patched=!0);function ms(t){b0(t),t.gracefulify=ms,t.createReadStream=_,t.createWriteStream=$;var e=t.readFile;t.readFile=i;function i(b,T,B){return typeof T=="function"&&(B=T,T=null),G(b,T,B);function G(L,X,R,N){return e(L,X,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?si([G,[L,X,R],q,N||Date.now(),Date.now()]):typeof R=="function"&&R.apply(this,arguments)})}}var r=t.writeFile;t.writeFile=n;function n(b,T,B,G){return typeof B=="function"&&(G=B,B=null),L(b,T,B,G);function L(X,R,N,q,z){return r(X,R,N,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?si([L,[X,R,N,q],P,z||Date.now(),Date.now()]):typeof q=="function"&&q.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=o);function o(b,T,B,G){return typeof B=="function"&&(G=B,B=null),L(b,T,B,G);function L(X,R,N,q,z){return s(X,R,N,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?si([L,[X,R,N,q],P,z||Date.now(),Date.now()]):typeof q=="function"&&q.apply(this,arguments)})}}var l=t.copyFile;l&&(t.copyFile=a);function a(b,T,B,G){return typeof B=="function"&&(G=B,B=0),L(b,T,B,G);function L(X,R,N,q,z){return l(X,R,N,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?si([L,[X,R,N,q],P,z||Date.now(),Date.now()]):typeof q=="function"&&q.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var u=/^v[0-5]\./;function f(b,T,B){typeof T=="function"&&(B=T,T=null);var G=u.test(process.version)?function(R,N,q,z){return c(R,L(R,N,q,z))}:function(R,N,q,z){return c(R,N,L(R,N,q,z))};return G(b,T,B);function L(X,R,N,q){return function(z,P){z&&(z.code==="EMFILE"||z.code==="ENFILE")?si([G,[X,R,N],z,q||Date.now(),Date.now()]):(P&&P.sort&&P.sort(),typeof N=="function"&&N.call(this,z,P))}}}if(process.version.substr(0,4)==="v0.8"){var h=w0(t);E=h.ReadStream,w=h.WriteStream}var p=t.ReadStream;p&&(E.prototype=Object.create(p.prototype),E.prototype.open=I);var d=t.WriteStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return E},set:function(b){E=b},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return w},set:function(b){w=b},enumerable:!0,configurable:!0});var m=E;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(b){m=b},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(t,"FileWriteStream",{get:function(){return v},set:function(b){v=b},enumerable:!0,configurable:!0});function E(b,T){return this instanceof E?(p.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function I(){var b=this;U(b.path,b.flags,b.mode,function(T,B){T?(b.autoClose&&b.destroy(),b.emit("error",T)):(b.fd=B,b.emit("open",B),b.read())})}function w(b,T){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function C(){var b=this;U(b.path,b.flags,b.mode,function(T,B){T?(b.destroy(),b.emit("error",T)):(b.fd=B,b.emit("open",B))})}function _(b,T){return new t.ReadStream(b,T)}function $(b,T){return new t.WriteStream(b,T)}var k=t.open;t.open=U;function U(b,T,B,G){return typeof B=="function"&&(G=B,B=null),L(b,T,B,G);function L(X,R,N,q,z){return k(X,R,N,function(P,be){P&&(P.code==="EMFILE"||P.code==="ENFILE")?si([L,[X,R,N,q],P,z||Date.now(),Date.now()]):typeof q=="function"&&q.apply(this,arguments)})}}return t}function si(t){Rt("ENQUEUE",t[0].name,t[1]),ke[Ne].push(t),gs()}var fr;function Cu(){for(var t=Date.now(),e=0;e2&&(ke[Ne][e][3]=t,ke[Ne][e][4]=t);gs()}function gs(){if(clearTimeout(fr),fr=void 0,ke[Ne].length!==0){var t=ke[Ne].shift(),e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(n===void 0)Rt("RETRY",e.name,i),e.apply(null,i);else if(Date.now()-n>=6e4){Rt("TIMEOUT",e.name,i);var o=i.pop();typeof o=="function"&&o.call(null,r)}else{var l=Date.now()-s,a=Math.max(s-n,1),c=Math.min(a*1.2,100);l>=c?(Rt("RETRY",e.name,i),e.apply(null,i.concat([n]))):ke[Ne].push(t)}fr===void 0&&(fr=setTimeout(gs,0))}}});var Au=y((Vv,Tu)=>{function Xe(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Tu.exports=Xe;Xe.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Xe.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Xe.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var i=this._timeouts.shift();if(i===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),i=this._timeouts.shift();else return!1;var r=this,n=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},i);return this._options.unref&&n.unref(),!0};Xe.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Xe.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Xe.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Xe.prototype.start=Xe.prototype.try;Xe.prototype.errors=function(){return this._errors};Xe.prototype.attempts=function(){return this._attempts};Xe.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,i=0,r=0;r=i&&(e=n,i=o)}return e}});var Ru=y(Bt=>{var k0=Au();Bt.operation=function(t){var e=Bt.timeouts(t);return new k0(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Bt.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in t)e[i]=t[i];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],n=0;n{Bu.exports=Ru()});var Pu=y((zv,pr)=>{pr.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&pr.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&pr.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Du=y((Wv,li)=>{var Ee=global.process,Lt=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};Lt(Ee)?(Fu=require("assert"),oi=Pu(),Nu=/^win/i.test(Ee.platform),Li=require("events"),typeof Li!="function"&&(Li=Li.EventEmitter),Ee.__signal_exit_emitter__?Be=Ee.__signal_exit_emitter__:(Be=Ee.__signal_exit_emitter__=new Li,Be.count=0,Be.emitted={}),Be.infinite||(Be.setMaxListeners(1/0),Be.infinite=!0),li.exports=function(t,e){if(!Lt(global.process))return function(){};Fu.equal(typeof t,"function","a callback must be provided for exit handler"),ai===!1&&xs();var i="exit";e&&e.alwaysLast&&(i="afterexit");var r=function(){Be.removeListener(i,t),Be.listeners("exit").length===0&&Be.listeners("afterexit").length===0&&dr()};return Be.on(i,t),r},dr=function(){!ai||!Lt(global.process)||(ai=!1,oi.forEach(function(e){try{Ee.removeListener(e,mr[e])}catch{}}),Ee.emit=gr,Ee.reallyExit=_s,Be.count-=1)},li.exports.unload=dr,Pt=function(e,i,r){Be.emitted[e]||(Be.emitted[e]=!0,Be.emit(e,i,r))},mr={},oi.forEach(function(t){mr[t]=function(){if(Lt(global.process)){var i=Ee.listeners(t);i.length===Be.count&&(dr(),Pt("exit",null,t),Pt("afterexit",null,t),Nu&&t==="SIGHUP"&&(t="SIGINT"),Ee.kill(Ee.pid,t))}}}),li.exports.signals=function(){return oi},ai=!1,xs=function(){ai||!Lt(global.process)||(ai=!0,Be.count+=1,oi=oi.filter(function(e){try{return Ee.on(e,mr[e]),!0}catch{return!1}}),Ee.emit=Uu,Ee.reallyExit=Mu)},li.exports.load=xs,_s=Ee.reallyExit,Mu=function(e){Lt(global.process)&&(Ee.exitCode=e||0,Pt("exit",Ee.exitCode,null),Pt("afterexit",Ee.exitCode,null),_s.call(Ee,Ee.exitCode))},gr=Ee.emit,Uu=function(e,i){if(e==="exit"&&Lt(global.process)){i!==void 0&&(Ee.exitCode=i);var r=gr.apply(this,arguments);return Pt("exit",Ee.exitCode,null),Pt("afterexit",Ee.exitCode,null),r}else return gr.apply(this,arguments)}):li.exports=function(){return function(){}};var Fu,oi,Nu,Li,Be,dr,Pt,mr,ai,xs,_s,Mu,gr,Uu});var Wu=y((Yv,zu)=>{"use strict";var C0=require("path"),Vu=Iu(),O0=Lu(),I0=Du(),_t={},ju=Symbol();function T0(t,e,i){let r=e[ju];if(r)return e.stat(t,(s,o)=>{if(s)return i(s);i(null,o.mtime,r)});let n=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,n,n,s=>{if(s)return i(s);e.stat(t,(o,l)=>{if(o)return i(o);let a=l.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,ju,{value:a}),i(null,l.mtime,a)})})}function A0(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}function xr(t,e){return e.lockfilePath||`${t}.lock`}function $u(t,e,i){if(!e.realpath)return i(null,C0.resolve(t));e.fs.realpath(t,i)}function bs(t,e,i){let r=xr(t,e);e.fs.mkdir(r,n=>{if(!n)return T0(r,e.fs,(s,o,l)=>{if(s)return e.fs.rmdir(r,()=>{}),i(s);i(null,o,l)});if(n.code!=="EEXIST")return i(n);if(e.stale<=0)return i(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(r,(s,o)=>{if(s)return s.code==="ENOENT"?bs(t,{...e,stale:0},i):i(s);if(!R0(o,e))return i(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));Gu(t,e,l=>{if(l)return i(l);bs(t,{...e,stale:0},i)})})})}function R0(t,e){return t.mtime.getTime(){if(r&&r.code!=="ENOENT")return i(r);i()})}function vr(t,e){let i=_t[t];i.updateTimeout||(i.updateDelay=i.updateDelay||e.update,i.updateTimeout=setTimeout(()=>{i.updateTimeout=null,e.fs.stat(i.lockfilePath,(r,n)=>{let s=i.lastUpdate+e.stale{let c=i.lastUpdate+e.stale{throw r},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),$u(t,e,(r,n)=>{if(r)return i(r);let s=O0.operation(e.retries);s.attempt(()=>{bs(n,e,(o,l,a)=>{if(s.retry(o))return;if(o)return i(s.mainError());let c=_t[n]={lockfilePath:xr(n,e),mtime:l,mtimePrecision:a,options:e,lastUpdate:Date.now()};vr(n,e),i(null,u=>{if(c.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));L0(n,{...e,realpath:!1},u)})})})})}function L0(t,e,i){e={fs:Vu,realpath:!0,...e},$u(t,e,(r,n)=>{if(r)return i(r);let s=_t[n];if(!s)return i(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));s.updateTimeout&&clearTimeout(s.updateTimeout),s.released=!0,delete _t[n],Gu(n,e,i)})}function qu(t){return(...e)=>new Promise((i,r)=>{e.push((n,s)=>{n?r(n):i(s)}),t(...e)})}var Hu=!1;function P0(){Hu||(Hu=!0,I0(()=>{for(let t in _t){let e=_t[t].options;try{e.fs.rmdirSync(xr(t,e))}catch{}}}))}zu.exports.lock=async(t,e)=>{P0();let i=await qu(B0)(t,e);return qu(i)}});var K0={};df(K0,{HttpsProxyAgent:()=>nf.HttpsProxyAgent,PNG:()=>sf.PNG,SocksProxyAgent:()=>af.SocksProxyAgent,StackUtils:()=>$0,colors:()=>F0,debug:()=>N0,getProxyForUrl:()=>rf.getProxyForUrl,jpegjs:()=>M0,lockfile:()=>D0,mime:()=>j0,minimatch:()=>q0,open:()=>H0,program:()=>of.program,progress:()=>V0,ws:()=>G0,wsReceiver:()=>W0,wsSender:()=>Y0,wsServer:()=>z0});module.exports=mf(K0);var Yu=Te(co()),Ku=Te(Ht()),rf=Te(wo()),nf=Te(Ro()),Zu=Te(Uo()),Xu=Te(zo()),Ju=Te(pa()),Qu=Te(Oa()),sf=Te(wl()),of=Te(Fl()),ef=Te(jl()),af=Te(sc()),tf=Te(fc());var d0=Te(mc(),1),fs=Te(Jn(),1),hs=Te(es(),1),gu=Te(ls(),1),ps=Te(mu(),1);var vu=gu.default;var F0=Yu.default,N0=Ku.default,M0=Zu.default,U0=Wu(),D0=U0,j0=Xu.default,q0=Ju.default,H0=Qu.default,V0=ef.default,$0=tf.default,G0=vu,z0=ps.default,W0=fs.default,Y0=hs.default;0&&(module.exports={HttpsProxyAgent,PNG,SocksProxyAgent,StackUtils,colors,debug,getProxyForUrl,jpegjs,lockfile,mime,minimatch,open,program,progress,ws,wsReceiver,wsSender,wsServer}); +`+i)}function cr(t,e,i,r,n){if(t.listenerCount("wsClientError")){let s=new Error(n);Error.captureStackTrace(s,cr),t.emit("wsClientError",s,i,e)}else Qn(i,r,n)}});var By=w((UL,Ly)=>{var Ri=require("constants"),jA=process.cwd,la=null,UA=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return la||(la=jA.call(process)),la};try{process.cwd()}catch{}typeof process.chdir=="function"&&(sf=process.chdir,process.chdir=function(t){la=null,sf.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,sf));var sf;Ly.exports=$A;function $A(t){Ri.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||i(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=r(t.chmod),t.fchmod=r(t.fchmod),t.lchmod=r(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=l(t.statSync),t.fstatSync=l(t.fstatSync),t.lstatSync=l(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,f,d){d&&process.nextTick(d)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,f,d,g){g&&process.nextTick(g)},t.lchownSync=function(){}),UA==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function f(d,g,m){var v=Date.now(),b=0;u(d,g,function _(S){if(S&&(S.code==="EACCES"||S.code==="EPERM")&&Date.now()-v<6e4){setTimeout(function(){t.stat(g,function(O,k){O&&O.code==="ENOENT"?u(d,g,_):m(S)})},b),b<100&&(b+=10);return}m&&m(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function f(d,g,m,v,b,_){var S;if(_&&typeof _=="function"){var O=0;S=function(k,E,R){if(k&&k.code==="EAGAIN"&&O<10)return O++,u.call(t,d,g,m,v,b,S);_.apply(this,arguments)}}return u.call(t,d,g,m,v,b,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,u),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(f,d,g,m,v){for(var b=0;;)try{return u.call(t,f,d,g,m,v)}catch(_){if(_.code==="EAGAIN"&&b<10){b++;continue}throw _}}}(t.readSync);function e(u){u.lchmod=function(f,d,g){u.open(f,Ri.O_WRONLY|Ri.O_SYMLINK,d,function(m,v){if(m){g&&g(m);return}u.fchmod(v,d,function(b){u.close(v,function(_){g&&g(b||_)})})})},u.lchmodSync=function(f,d){var g=u.openSync(f,Ri.O_WRONLY|Ri.O_SYMLINK,d),m=!0,v;try{v=u.fchmodSync(g,d),m=!1}finally{if(m)try{u.closeSync(g)}catch{}else u.closeSync(g)}return v}}function i(u){Ri.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(f,d,g,m){u.open(f,Ri.O_SYMLINK,function(v,b){if(v){m&&m(v);return}u.futimes(b,d,g,function(_){u.close(b,function(S){m&&m(_||S)})})})},u.lutimesSync=function(f,d,g){var m=u.openSync(f,Ri.O_SYMLINK),v,b=!0;try{v=u.futimesSync(m,d,g),b=!1}finally{if(b)try{u.closeSync(m)}catch{}else u.closeSync(m)}return v}):u.futimes&&(u.lutimes=function(f,d,g,m){m&&process.nextTick(m)},u.lutimesSync=function(){})}function r(u){return u&&function(f,d,g){return u.call(t,f,d,function(m){c(m)&&(m=null),g&&g.apply(this,arguments)})}}function n(u){return u&&function(f,d){try{return u.call(t,f,d)}catch(g){if(!c(g))throw g}}}function s(u){return u&&function(f,d,g,m){return u.call(t,f,d,g,function(v){c(v)&&(v=null),m&&m.apply(this,arguments)})}}function o(u){return u&&function(f,d,g){try{return u.call(t,f,d,g)}catch(m){if(!c(m))throw m}}}function a(u){return u&&function(f,d,g){typeof d=="function"&&(g=d,d=null);function m(v,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),g&&g.apply(this,arguments)}return d?u.call(t,f,d,m):u.call(t,f,m)}}function l(u){return u&&function(f,d){var g=d?u.call(t,f,d):u.call(t,f);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}function c(u){if(!u||u.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var My=w(($L,Py)=>{var Ry=require("stream").Stream;Py.exports=VA;function VA(t){return{ReadStream:e,WriteStream:i};function e(r,n){if(!(this instanceof e))return new e(r,n);Ry.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var o=Object.keys(n),a=0,l=o.length;athis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(u,f){if(u){s.emit("error",u),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read()})}function i(r,n){if(!(this instanceof i))return new i(r,n);Ry.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var s=Object.keys(n),o=0,a=s.length;o= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Fy=w((VL,qy)=>{"use strict";qy.exports=GA;var HA=Object.getPrototypeOf||function(t){return t.__proto__};function GA(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:HA(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))}),e}});var $y=w((HL,lf)=>{var Me=require("fs"),YA=By(),WA=My(),zA=Fy(),ca=require("util"),et,fa;typeof Symbol=="function"&&typeof Symbol.for=="function"?(et=Symbol.for("graceful-fs.queue"),fa=Symbol.for("graceful-fs.previous")):(et="___graceful-fs.queue",fa="___graceful-fs.previous");function KA(){}function Uy(t,e){Object.defineProperty(t,et,{get:function(){return e}})}var ur=KA;ca.debuglog?ur=ca.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(ur=function(){var t=ca.format.apply(ca,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t)});Me[et]||(Dy=global[et]||[],Uy(Me,Dy),Me.close=function(t){function e(i,r){return t.call(Me,i,function(n){n||jy(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(e,fa,{value:t}),e}(Me.close),Me.closeSync=function(t){function e(i){t.apply(Me,arguments),jy()}return Object.defineProperty(e,fa,{value:t}),e}(Me.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){ur(Me[et]),require("assert").equal(Me[et].length,0)}));var Dy;global[et]||Uy(global,Me[et]);lf.exports=of(zA(Me));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Me.__patched&&(lf.exports=of(Me),Me.__patched=!0);function of(t){YA(t),t.gracefulify=of,t.createReadStream=E,t.createWriteStream=R;var e=t.readFile;t.readFile=i;function i(C,L,P){return typeof L=="function"&&(P=L,L=null),U(C,L,P);function U(F,H,j,V){return e(F,H,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Zr([U,[F,H,j],W,V||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments)})}}var r=t.writeFile;t.writeFile=n;function n(C,L,P,U){return typeof P=="function"&&(U=P,P=null),F(C,L,P,U);function F(H,j,V,W,Q){return r(H,j,V,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Zr([F,[H,j,V,W],Y,Q||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments)})}}var s=t.appendFile;s&&(t.appendFile=o);function o(C,L,P,U){return typeof P=="function"&&(U=P,P=null),F(C,L,P,U);function F(H,j,V,W,Q){return s(H,j,V,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Zr([F,[H,j,V,W],Y,Q||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=l);function l(C,L,P,U){return typeof P=="function"&&(U=P,P=0),F(C,L,P,U);function F(H,j,V,W,Q){return a(H,j,V,function(Y){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Zr([F,[H,j,V,W],Y,Q||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var u=/^v[0-5]\./;function f(C,L,P){typeof L=="function"&&(P=L,L=null);var U=u.test(process.version)?function(j,V,W,Q){return c(j,F(j,V,W,Q))}:function(j,V,W,Q){return c(j,V,F(j,V,W,Q))};return U(C,L,P);function F(H,j,V,W){return function(Q,Y){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?Zr([U,[H,j,V],Q,W||Date.now(),Date.now()]):(Y&&Y.sort&&Y.sort(),typeof V=="function"&&V.call(this,Q,Y))}}}if(process.version.substr(0,4)==="v0.8"){var d=WA(t);_=d.ReadStream,O=d.WriteStream}var g=t.ReadStream;g&&(_.prototype=Object.create(g.prototype),_.prototype.open=S);var m=t.WriteStream;m&&(O.prototype=Object.create(m.prototype),O.prototype.open=k),Object.defineProperty(t,"ReadStream",{get:function(){return _},set:function(C){_=C},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return O},set:function(C){O=C},enumerable:!0,configurable:!0});var v=_;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(C){v=C},enumerable:!0,configurable:!0});var b=O;Object.defineProperty(t,"FileWriteStream",{get:function(){return b},set:function(C){b=C},enumerable:!0,configurable:!0});function _(C,L){return this instanceof _?(g.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function S(){var C=this;A(C.path,C.flags,C.mode,function(L,P){L?(C.autoClose&&C.destroy(),C.emit("error",L)):(C.fd=P,C.emit("open",P),C.read())})}function O(C,L){return this instanceof O?(m.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}function k(){var C=this;A(C.path,C.flags,C.mode,function(L,P){L?(C.destroy(),C.emit("error",L)):(C.fd=P,C.emit("open",P))})}function E(C,L){return new t.ReadStream(C,L)}function R(C,L){return new t.WriteStream(C,L)}var T=t.open;t.open=A;function A(C,L,P,U){return typeof P=="function"&&(U=P,P=null),F(C,L,P,U);function F(H,j,V,W,Q){return T(H,j,V,function(Y,de){Y&&(Y.code==="EMFILE"||Y.code==="ENFILE")?Zr([F,[H,j,V,W],Y,Q||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments)})}}return t}function Zr(t){ur("ENQUEUE",t[0].name,t[1]),Me[et].push(t),af()}var ua;function jy(){for(var t=Date.now(),e=0;e2&&(Me[et][e][3]=t,Me[et][e][4]=t);af()}function af(){if(clearTimeout(ua),ua=void 0,Me[et].length!==0){var t=Me[et].shift(),e=t[0],i=t[1],r=t[2],n=t[3],s=t[4];if(n===void 0)ur("RETRY",e.name,i),e.apply(null,i);else if(Date.now()-n>=6e4){ur("TIMEOUT",e.name,i);var o=i.pop();typeof o=="function"&&o.call(null,r)}else{var a=Date.now()-s,l=Math.max(s-n,1),c=Math.min(l*1.2,100);a>=c?(ur("RETRY",e.name,i),e.apply(null,i.concat([n]))):Me[et].push(t)}ua===void 0&&(ua=setTimeout(af,0))}}});var Hy=w((GL,Vy)=>{function Pt(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Vy.exports=Pt;Pt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Pt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Pt.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var i=this._timeouts.shift();if(i===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),i=this._timeouts.shift();else return!1;var r=this,n=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},i);return this._options.unref&&n.unref(),!0};Pt.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Pt.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Pt.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Pt.prototype.start=Pt.prototype.try;Pt.prototype.errors=function(){return this._errors};Pt.prototype.attempts=function(){return this._attempts};Pt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,i=0,r=0;r=i&&(e=n,i=o)}return e}});var Gy=w(fr=>{var JA=Hy();fr.operation=function(t){var e=fr.timeouts(t);return new JA(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};fr.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in t)e[i]=t[i];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],n=0;n{Yy.exports=Gy()});var zy=w((zL,ha)=>{ha.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&ha.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ha.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Xy=w((KL,en)=>{var Pe=global.process,hr=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};hr(Pe)?(Ky=require("assert"),Qr=zy(),Jy=/^win/i.test(Pe.platform),Xn=require("events"),typeof Xn!="function"&&(Xn=Xn.EventEmitter),Pe.__signal_exit_emitter__?Je=Pe.__signal_exit_emitter__:(Je=Pe.__signal_exit_emitter__=new Xn,Je.count=0,Je.emitted={}),Je.infinite||(Je.setMaxListeners(1/0),Je.infinite=!0),en.exports=function(t,e){if(!hr(global.process))return function(){};Ky.equal(typeof t,"function","a callback must be provided for exit handler"),Xr===!1&&cf();var i="exit";e&&e.alwaysLast&&(i="afterexit");var r=function(){Je.removeListener(i,t),Je.listeners("exit").length===0&&Je.listeners("afterexit").length===0&&pa()};return Je.on(i,t),r},pa=function(){!Xr||!hr(global.process)||(Xr=!1,Qr.forEach(function(e){try{Pe.removeListener(e,da[e])}catch{}}),Pe.emit=ma,Pe.reallyExit=uf,Je.count-=1)},en.exports.unload=pa,pr=function(e,i,r){Je.emitted[e]||(Je.emitted[e]=!0,Je.emit(e,i,r))},da={},Qr.forEach(function(t){da[t]=function(){if(hr(global.process)){var i=Pe.listeners(t);i.length===Je.count&&(pa(),pr("exit",null,t),pr("afterexit",null,t),Jy&&t==="SIGHUP"&&(t="SIGINT"),Pe.kill(Pe.pid,t))}}}),en.exports.signals=function(){return Qr},Xr=!1,cf=function(){Xr||!hr(global.process)||(Xr=!0,Je.count+=1,Qr=Qr.filter(function(e){try{return Pe.on(e,da[e]),!0}catch{return!1}}),Pe.emit=Qy,Pe.reallyExit=Zy)},en.exports.load=cf,uf=Pe.reallyExit,Zy=function(e){hr(global.process)&&(Pe.exitCode=e||0,pr("exit",Pe.exitCode,null),pr("afterexit",Pe.exitCode,null),uf.call(Pe,Pe.exitCode))},ma=Pe.emit,Qy=function(e,i){if(e==="exit"&&hr(global.process)){i!==void 0&&(Pe.exitCode=i);var r=ma.apply(this,arguments);return pr("exit",Pe.exitCode,null),pr("afterexit",Pe.exitCode,null),r}else return ma.apply(this,arguments)}):en.exports=function(){return function(){}};var Ky,Qr,Jy,Xn,Je,pa,pr,da,Xr,cf,uf,Zy,ma,Qy});var ab=w((JL,ob)=>{"use strict";var ZA=require("path"),rb=$y(),QA=Wy(),XA=Xy(),Pi={},eb=Symbol();function eI(t,e,i){let r=e[eb];if(r)return e.stat(t,(s,o)=>{if(s)return i(s);i(null,o.mtime,r)});let n=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,n,n,s=>{if(s)return i(s);e.stat(t,(o,a)=>{if(o)return i(o);let l=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,eb,{value:l}),i(null,a.mtime,l)})})}function tI(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}function va(t,e){return e.lockfilePath||`${t}.lock`}function nb(t,e,i){if(!e.realpath)return i(null,ZA.resolve(t));e.fs.realpath(t,i)}function hf(t,e,i){let r=va(t,e);e.fs.mkdir(r,n=>{if(!n)return eI(r,e.fs,(s,o,a)=>{if(s)return e.fs.rmdir(r,()=>{}),i(s);i(null,o,a)});if(n.code!=="EEXIST")return i(n);if(e.stale<=0)return i(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(r,(s,o)=>{if(s)return s.code==="ENOENT"?hf(t,{...e,stale:0},i):i(s);if(!iI(o,e))return i(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));sb(t,e,a=>{if(a)return i(a);hf(t,{...e,stale:0},i)})})})}function iI(t,e){return t.mtime.getTime(){if(r&&r.code!=="ENOENT")return i(r);i()})}function ga(t,e){let i=Pi[t];i.updateTimeout||(i.updateDelay=i.updateDelay||e.update,i.updateTimeout=setTimeout(()=>{i.updateTimeout=null,e.fs.stat(i.lockfilePath,(r,n)=>{let s=i.lastUpdate+e.stale{let c=i.lastUpdate+e.stale{throw r},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),nb(t,e,(r,n)=>{if(r)return i(r);let s=QA.operation(e.retries);s.attempt(()=>{hf(n,e,(o,a,l)=>{if(s.retry(o))return;if(o)return i(s.mainError());let c=Pi[n]={lockfilePath:va(n,e),mtime:a,mtimePrecision:l,options:e,lastUpdate:Date.now()};ga(n,e),i(null,u=>{if(c.released)return u&&u(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));nI(n,{...e,realpath:!1},u)})})})})}function nI(t,e,i){e={fs:rb,realpath:!0,...e},nb(t,e,(r,n)=>{if(r)return i(r);let s=Pi[n];if(!s)return i(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));s.updateTimeout&&clearTimeout(s.updateTimeout),s.released=!0,delete Pi[n],sb(n,e,i)})}function tb(t){return(...e)=>new Promise((i,r)=>{e.push((n,s)=>{n?r(n):i(s)}),t(...e)})}var ib=!1;function sI(){ib||(ib=!0,XA(()=>{for(let t in Pi){let e=Pi[t].options;try{e.fs.rmdirSync(va(t,e))}catch{}}}))}ob.exports.lock=async(t,e)=>{sI();let i=await tb(rI)(t,e);return tb(i)}});var SI={};gf(SI,{HttpsProxyAgent:()=>bb.HttpsProxyAgent,PNG:()=>_b.PNG,SocksProxyAgent:()=>xb.SocksProxyAgent,StackUtils:()=>vI,colors:()=>oI,debug:()=>aI,diff:()=>lI,dotenv:()=>cI,getProxyForUrl:()=>yb.getProxyForUrl,jpegjs:()=>uI,lockfile:()=>hI,mime:()=>pI,minimatch:()=>dI,open:()=>mI,program:()=>wb.program,progress:()=>gI,ws:()=>bI,wsReceiver:()=>wI,wsSender:()=>xI,wsServer:()=>_I,yaml:()=>yI});module.exports=Vb(SI);var lb=De(Gf()),cb=De(rn());var Pa={};gf(Pa,{Diff:()=>Tt,applyPatch:()=>Sh,applyPatches:()=>z_,canonicalize:()=>Ss,convertChangesToDMP:()=>rw,convertChangesToXML:()=>nw,createPatch:()=>K_,createTwoFilesPatch:()=>Eh,diffArrays:()=>H_,diffChars:()=>O_,diffCss:()=>P_,diffJson:()=>V_,diffLines:()=>Aa,diffSentences:()=>R_,diffTrimmedLines:()=>B_,diffWords:()=>N_,diffWordsWithSpace:()=>yh,formatPatch:()=>Os,merge:()=>X_,parsePatch:()=>Cs,reversePatch:()=>kh,structuredPatch:()=>ks});function Tt(){}Tt.prototype={diff:function(e,i){var r,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=n.callback;typeof n=="function"&&(s=n,n={});var o=this;function a(k){return k=o.postProcess(k,n),s?(setTimeout(function(){s(k)},0),!0):k}e=this.castInput(e,n),i=this.castInput(i,n),e=this.removeEmpty(this.tokenize(e,n)),i=this.removeEmpty(this.tokenize(i,n));var l=i.length,c=e.length,u=1,f=l+c;n.maxEditLength!=null&&(f=Math.min(f,n.maxEditLength));var d=(r=n.timeout)!==null&&r!==void 0?r:1/0,g=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],v=this.extractCommon(m[0],i,e,0,n);if(m[0].oldPos+1>=c&&v+1>=l)return a(ih(o,m[0].lastComponent,i,e,o.useLongestToken));var b=-1/0,_=1/0;function S(){for(var k=Math.max(b,-u);k<=Math.min(_,u);k+=2){var E=void 0,R=m[k-1],T=m[k+1];R&&(m[k-1]=void 0);var A=!1;if(T){var C=T.oldPos-k;A=T&&0<=C&&C=c&&v+1>=l)return a(ih(o,E.lastComponent,i,e,o.useLongestToken));m[k]=E,E.oldPos+1>=c&&(_=Math.min(_,k-1)),v+1>=l&&(b=Math.max(b,k+1))}u++}if(s)(function k(){setTimeout(function(){if(u>f||Date.now()>g)return s();S()||k()},0)})();else for(;u<=f&&Date.now()<=g;){var O=S();if(O)return O}},addToPath:function(e,i,r,n,s){var o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===i&&o.removed===r?{oldPos:e.oldPos+n,lastComponent:{count:o.count+1,added:i,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:i,removed:r,previousComponent:o}}},extractCommon:function(e,i,r,n,s){for(var o=i.length,a=r.length,l=e.oldPos,c=l-n,u=0;c+1g.length?v:g}),f.value=t.join(d)}else f.value=t.join(i.slice(c,c+f.count));c+=f.count,f.added||(u+=f.count)}}return s}var k_=new Tt;function O_(t,e,i){return k_.diff(t,e,i)}function rh(t,e){var i;for(i=0;ie.length&&(i=t.length-e.length);var r=e.length;t.length0&&e[o]!=e[s];)s=n[s];e[o]==e[s]&&s++}s=0;for(var a=i;a0&&t[a]!=e[s];)s=n[s];t[a]==e[s]&&s++}return s}function T_(t){return t.includes(`\r +`)&&!t.startsWith(` +`)&&!t.match(/[^\r]\n/)}function A_(t){return!t.includes(`\r +`)&&t.includes(` +`)}var xs="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",I_=new RegExp("[".concat(xs,"]+|\\s+|[^").concat(xs,"]"),"ug"),sn=new Tt;sn.equals=function(t,e,i){return i.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t.trim()===e.trim()};sn.tokenize=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i;if(e.intlSegmenter){if(e.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');i=Array.from(e.intlSegmenter.segment(t),function(s){return s.segment})}else i=t.match(I_)||[];var r=[],n=null;return i.forEach(function(s){/\s/.test(s)?n==null?r.push(s):r.push(r.pop()+s):/\s/.test(n)?r[r.length-1]==n?r.push(r.pop()+s):r.push(n+s):r.push(s),n=s}),r};sn.join=function(t){return t.map(function(e,i){return i==0?e:e.replace(/^\s+/,"")}).join("")};sn.postProcess=function(t,e){if(!t||e.oneChangePerToken)return t;var i=null,r=null,n=null;return t.forEach(function(s){s.added?r=s:s.removed?n=s:((r||n)&&oh(i,n,r,s),i=s,r=null,n=null)}),(r||n)&&oh(i,n,r,null),t};function N_(t,e,i){return(i==null?void 0:i.ignoreWhitespace)!=null&&!i.ignoreWhitespace?yh(t,e,i):sn.diff(t,e,i)}function oh(t,e,i,r){if(e&&i){var n=e.value.match(/^\s*/)[0],s=e.value.match(/\s*$/)[0],o=i.value.match(/^\s*/)[0],a=i.value.match(/\s*$/)[0];if(t){var l=rh(n,o);t.value=Ta(t.value,o,l),e.value=nn(e.value,l),i.value=nn(i.value,l)}if(r){var c=nh(s,a);r.value=Ca(r.value,a,c),e.value=_s(e.value,c),i.value=_s(i.value,c)}}else if(i)t&&(i.value=i.value.replace(/^\s*/,"")),r&&(r.value=r.value.replace(/^\s*/,""));else if(t&&r){var u=r.value.match(/^\s*/)[0],f=e.value.match(/^\s*/)[0],d=e.value.match(/\s*$/)[0],g=rh(u,f);e.value=nn(e.value,g);var m=nh(nn(u,g),d);e.value=_s(e.value,m),r.value=Ca(r.value,u,m),t.value=Ta(t.value,u,u.slice(0,u.length-m.length))}else if(r){var v=r.value.match(/^\s*/)[0],b=e.value.match(/\s*$/)[0],_=sh(b,v);e.value=_s(e.value,_)}else if(t){var S=t.value.match(/\s*$/)[0],O=e.value.match(/^\s*/)[0],k=sh(S,O);e.value=nn(e.value,k)}}var vh=new Tt;vh.tokenize=function(t){var e=new RegExp("(\\r?\\n)|[".concat(xs,"]+|[^\\S\\n\\r]+|[^").concat(xs,"]"),"ug");return t.match(e)||[]};function yh(t,e,i){return vh.diff(t,e,i)}function L_(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}var on=new Tt;on.tokenize=function(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` +`));var i=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;nt.length)&&(e=t.length);for(var i=0,r=new Array(e);i2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string"&&(e=Cs(e)),Array.isArray(e)){if(e.length>1)throw new Error("applyPatch only works with a single input.");e=e[0]}(i.autoConvertLineEndings||i.autoConvertLineEndings==null)&&(T_(t)&&G_(e)?e=wh(e):A_(t)&&Y_(e)&&(e=xh(e)));var r=t.split(` +`),n=e.hunks,s=i.compareLine||function(P,U,F,H){return U===H},o=i.fuzzFactor||0,a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!n.length)return t;for(var l="",c=!1,u=!1,f=0;f3&&arguments[3]!==void 0?arguments[3]:0,j=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,V=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],W=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,Q=0,Y=!1;H0?de[0]:" ",ne=de.length>0?de.substr(1):de;if(ae==="-")if(s(U+1,r[U],ae,ne))U++,Q=0;else return!F||r[U]==null?null:(V[W]=r[U],g(P,U+1,F-1,H,!1,V,W+1));if(ae==="+"){if(!j)return null;V[W]=ne,W++,Q=0,Y=!0}if(ae===" ")if(Q++,V[W]=r[U],s(U+1,r[U],ae,ne))W++,j=!0,Y=!1,U++;else return Y||!F?null:r[U]&&(g(P,U+1,F-1,H+1,!1,V,W+1)||g(P,U+1,F-1,H,!1,V,W+1))||g(P,U,F-1,H+1,!1,V,W)}return W-=Q,U-=Q,V.length=W,{patchedLines:V,oldLineLastI:U-1}}for(var m=[],v=0,b=0;b0?f(U.lines.slice(-o.context)):[],g-=v.length,m-=v.length)}(P=v).push.apply(P,oi(L.map(function(W){return(C.added?"+":"-")+W}))),C.added?_+=L.length:b+=L.length}else{if(g)if(L.length<=o.context*2&&Ot.length)return!1;for(var i=0;i"):r.removed&&e.push(""),e.push(sw(r.value)),r.added?e.push("
"):r.removed&&e.push("")}return e.join("")}function sw(t){var e=t;return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e=e.replace(/"/g,"""),e}var ub=De(Ih()),yb=De(Lh()),bb=De(Hh()),fb=De(Zh()),hb=De(sp()),pb=De(Op()),db=De(jp()),_b=De(Pd()),wb=De(zd()),mb=De(Xd()),xb=De(Rm()),gb=De(jm()),vb=De(Tv());var DA=De(Lv(),1),tf=De(Hu(),1),rf=De(Yu(),1),Iy=De(Xu(),1),nf=De(Ay(),1);var Ny=Iy.default;var oI=lb.default,aI=cb.default,lI=Pa,cI=ub.default,uI=fb.default,fI=ab(),hI=fI,pI=hb.default,dI=pb.default,mI=db.default,gI=mb.default,vI=gb.default,yI=vb.default,bI=Ny,_I=nf.default,wI=tf.default,xI=rf.default;0&&(module.exports={HttpsProxyAgent,PNG,SocksProxyAgent,StackUtils,colors,debug,diff,dotenv,getProxyForUrl,jpegjs,lockfile,mime,minimatch,open,program,progress,ws,wsReceiver,wsSender,wsServer,yaml}); /*! Bundled license information: progress/lib/node-progress.js: diff --git a/priv/static/node_modules/playwright-core/lib/vite/htmlReport/index.html b/priv/static/node_modules/playwright-core/lib/vite/htmlReport/index.html index b0bb4a3e..fd721460 100644 --- a/priv/static/node_modules/playwright-core/lib/vite/htmlReport/index.html +++ b/priv/static/node_modules/playwright-core/lib/vite/htmlReport/index.html @@ -7,7 +7,7 @@ Playwright Test Report - - diff --git a/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BwGUc5aQ.js b/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BwGUc5aQ.js deleted file mode 100644 index 6a53b9aa..00000000 --- a/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BwGUc5aQ.js +++ /dev/null @@ -1,24 +0,0 @@ -import{c as wu,g as ku}from"./index-BBRTdeT3.js";var ho={exports:{}},ha;function Ar(){return ha||(ha=1,function(yr,Or){(function(F,Ee){yr.exports=Ee()})(wu,function(){var F=navigator.userAgent,Ee=navigator.platform,Se=/gecko\/\d/i.test(F),We=/MSIE \d/.test(F),Qe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(F),Ce=/Edge\/(\d+)/.exec(F),M=We||Qe||Ce,j=M&&(We?document.documentMode||6:+(Ce||Qe)[1]),_=!Ce&&/WebKit\//.test(F),ie=_&&/Qt\/\d+\.\d+/.test(F),G=!Ce&&/Chrome\/(\d+)/.exec(F),se=G&&+G[1],ce=/Opera\//.test(F),Ie=/Apple Computer/.test(navigator.vendor),Te=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(F),Oe=/PhantomJS/.test(F),ae=Ie&&(/Mobile\/\w+/.test(F)||navigator.maxTouchPoints>2),V=/Android/.test(F),oe=ae||V||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(F),xe=ae||/Mac/.test(Ee),_e=/\bCrOS\b/.test(F),ye=/win/i.test(Ee),Me=ce&&F.match(/Version\/(\d*\.\d*)/);Me&&(Me=Number(Me[1])),Me&&Me>=15&&(ce=!1,_=!0);var He=xe&&(ie||ce&&(Me==null||Me<12.11)),ee=Se||M&&j>=9;function X(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var me=function(e,t){var n=e.className,r=X(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function H(e,t){return T(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var ue=function(){this.id=null,this.f=null,this.time=0,this.handler=te(this.onTimeout,this)};ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ue.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var lt=[""];function ht(e){for(;lt.length<=e;)lt.push(re(lt)+" ");return lt[e]}function re(e){return e[e.length-1]}function Ne(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||be.test(e))}function ne(e,t){return t?t.source.indexOf("\\w")>-1&&R(e)?!0:t.test(e):R(e)}function Y(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var we=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ve(e){return e.charCodeAt(0)>=768&&we.test(e)}function Tt(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function rr(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var mr=null;function nr(e,t,n){var r;mr=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:mr=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:mr=i)}return r??mr}var gi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,d,p){this.level=u,this.from=d,this.to=p}return function(u,d){var p=d=="ltr"?"L":"R";if(u.length==0||d=="ltr"&&!r.test(u))return!1;for(var m=u.length,y=[],S=0;S-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function qe(e,t){var n=Yt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Et(e){e.prototype.on=function(t,n){J(this,t,n)},e.prototype.off=function(t,n){ut(this,t,n)}}function ft(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function zr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function yt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ir(e){ft(e),zr(e)}function ln(e){return e.target||e.srcElement}function It(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),xe&&e.ctrlKey&&t==1&&(t=3),t}var yi=function(){if(M&&j<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Pr;function _n(e){if(Pr==null){var t=c("span","​");H(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Pr=t.offsetWidth<=1&&t.offsetHeight>2&&!(M&&j<8))}var n=Pr?c("span","​"):c("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function or(e){if(an!=null)return an;var t=H(e,document.createTextNode("AخA")),n=b(t,0,1).getBoundingClientRect(),r=b(t,1,2).getBoundingClientRect();return T(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var Pt=` - -b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` -`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},lr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Hn=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ft=null;function mi(e){if(Ft!=null)return Ft;var t=H(e,c("span","x")),n=t.getBoundingClientRect(),r=b(t,0,1).getBoundingClientRect();return Ft=Math.abs(n.left-r.left)>1}var Er={},Wt={};function _t(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Er[e]=t}function br(e,t){Wt[e]=t}function Ir(e){if(typeof e=="string"&&Wt.hasOwnProperty(e))e=Wt[e];else if(e&&typeof e.name=="string"&&Wt.hasOwnProperty(e.name)){var t=Wt[e.name];typeof t=="string"&&(t={name:t}),e=C(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ir("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ir("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Fr(e,t){t=Ir(t);var n=Er[t.name];if(!n)return Fr(e,"text/plain");var r=n(e,t);if(ar.hasOwnProperty(t.name)){var i=ar[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var ar={};function Wr(e,t){var n=ar.hasOwnProperty(e)?ar[e]:ar[e]={};de(t,n)}function Ut(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function sn(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function _r(e,t,n){return e.startState?e.startState(t,n):!0}var je=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};je.prototype.eol=function(){return this.pos>=this.string.length},je.prototype.sol=function(){return this.pos==this.lineStart},je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},je.prototype.next=function(){if(this.post},je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},je.prototype.skipToEnd=function(){this.pos=this.string.length},je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},je.prototype.backUp=function(e){this.pos-=e},je.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},je.prototype.current=function(){return this.string.slice(this.start,this.pos)},je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function U(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?k(n,U(e,n).text.length):ka(t,U(e,t.line).text.length)}function ka(e,t){var n=e.ch;return n==null||n>t?k(e.line,t):n<0?k(e.line,0):e}function vo(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},qt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},qt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},qt.fromSaved=function(e,t,n){return t instanceof Bn?new qt(e,Ut(e.mode,t.state),n,t.lookAhead):new qt(e,Ut(e.mode,t),n)},qt.prototype.save=function(e){var t=e!==!1?Ut(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Bn(t,this.maxLookAhead):t};function go(e,t,n,r){var i=[e.state.modeGen],o={};ko(e,t.text,e.doc.mode,n,function(u,d){return i.push(u,d)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var d=e.state.overlays[u],p=1,m=0;n.state=!0,ko(e,t.text,d.mode,n,function(y,S){for(var N=p;my&&i.splice(p,1,y,i[p+1],z),p+=2,m=Math.min(y,z)}if(S)if(d.opaque)i.splice(N,p-N,y,"overlay "+S),p=N+2;else for(;Ne.options.maxHighlightLength&&Ut(e.doc.mode,r.state),o=go(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function fn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new qt(r,!0,t);var o=Sa(e,t,n),l=o>r.first&&U(r,o-1).stateAfter,a=l?qt.fromSaved(r,l,o):new qt(r,_r(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var bo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function xo(e,t,n,r){var i=e.doc,o=i.mode,l;t=fe(i,t);var a=U(i,t.line),s=fn(e,t.line,n),u=new je(a.text,e.options.tabSize,s),d;for(r&&(d=[]);(r||u.pose.options.maxHighlightLength?(a=!1,l&&bi(e,t,r,d.pos),d.pos=t.length,p=null):p=wo(xi(n,d,r.state,m),o),m){var y=m[0].name;y&&(p="m-"+(p?y+" "+p:y))}if(!a||u!=p){for(;sl;--a){if(a<=o.first)return o.first;var s=U(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Bn?u.lookAhead:0)<=o.modeFrontier))return a;var d=he(s.text,null,e.options.tabSize);(i==null||r>d)&&(i=a-1,r=d)}return i}function Ca(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=U(e,r).stateAfter;if(i&&(!(i instanceof Bn)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Rn(l,o.from,s?null:o.to))}}return r}function Aa(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from0&&a)for(var B=0;B0)){var d=[s,1],p=I(u.from,a.from),m=I(u.to,a.to);(p<0||!l.inclusiveLeft&&!p)&&d.push({from:u.from,to:a.from}),(m>0||!l.inclusiveRight&&!m)&&d.push({from:a.to,to:u.to}),i.splice.apply(i,d),s+=d.length-3}}return i}function To(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!r||ki(r,o.marker)<0)&&(r=o.marker)}return r}function Do(e,t,n,r,i){var o=U(e,t),l=Jt&&o.markedSpans;if(l)for(var a=0;a=0&&p<=0||d<=0&&p>=0)&&(d<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?I(u.to,n)>=0:I(u.to,n)>0)||d>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?I(u.from,r)<=0:I(u.from,r)<0)))return!0}}}function Ht(e){for(var t;t=No(e);)e=t.find(-1,!0).line;return e}function Pa(e){for(var t;t=qn(e);)e=t.find(1,!0).line;return e}function Ea(e){for(var t,n;t=qn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Si(e,t){var n=U(e,t),r=Ht(n);return n==r?t:f(r)}function Ao(e,t){if(t>e.lastLine())return t;var n=U(e,t),r;if(!sr(e,n))return t;for(;r=qn(n);)n=r.find(1,!0).line;return f(n)+1}function sr(e,t){var n=Jt&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Br=function(e,t,n){this.text=e,Lo(this,t),this.height=n?n(this):1};Br.prototype.lineNo=function(){return f(this)},Et(Br);function Ia(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),To(e),Lo(e,n);var i=r?r(e):1;i!=e.height&&Dt(e,i)}function Fa(e){e.parent=null,To(e)}var Wa={},_a={};function Oo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?_a:Wa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function zo(e,t){var n=x("span",null,null,_?"padding-right: .1px":null),r={pre:x("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=Ba,or(e.display.measure)&&(l=ke(o,e.doc.direction))&&(r.addToken=Ka(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);Ua(o,r,yo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=K(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=K(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(_n(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return qe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=K(r.pre.className,r.textClass||"")),r}function Ha(e){var t=c("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ba(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?Ra(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,d;if(!s.test(t))e.col+=t.length,d=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,d),M&&j<9&&(u=!0),e.pos+=t.length;else{d=document.createDocumentFragment();for(var p=0;;){s.lastIndex=p;var m=s.exec(t),y=m?m.index-p:t.length-p;if(y){var S=document.createTextNode(a.slice(p,p+y));M&&j<9?d.appendChild(c("span",[S])):d.appendChild(S),e.map.push(e.pos,e.pos+y,S),e.col+=y,e.pos+=y}if(!m)break;p+=y+1;var N=void 0;if(m[0]==" "){var z=e.cm.options.tabSize,P=z-e.col%z;N=d.appendChild(c("span",ht(P),"cm-tab")),N.setAttribute("role","presentation"),N.setAttribute("cm-text"," "),e.col+=P}else m[0]=="\r"||m[0]==` -`?(N=d.appendChild(c("span",m[0]=="\r"?"␍":"␤","cm-invalidchar")),N.setAttribute("cm-text",m[0]),e.col+=1):(N=e.cm.options.specialCharPlaceholder(m[0]),N.setAttribute("cm-text",m[0]),M&&j<9?d.appendChild(c("span",[N])):d.appendChild(N),e.col+=1);e.map.push(e.pos,e.pos+1,N),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,n||r||i||u||o||l){var W=n||"";r&&(W+=r),i&&(W+=i);var E=c("span",[d],W,o);if(l)for(var B in l)l.hasOwnProperty(B)&&B!="style"&&B!="class"&&E.setAttribute(B,l[B]);return e.content.appendChild(E)}e.content.appendChild(d)}}function Ra(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&p.from<=u));m++);if(p.to>=d)return e(n,r,i,o,l,a,s);e(n,r.slice(0,p.to-u),i,o,null,a,s),o=null,r=r.slice(p.to-u),u=p.to}}}function Po(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ua(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var l=1;ls||ge.collapsed&&Z.to==s&&Z.from==s)){if(Z.to!=null&&Z.to!=s&&y>Z.to&&(y=Z.to,N=""),ge.className&&(S+=" "+ge.className),ge.css&&(m=(m?m+";":"")+ge.css),ge.startStyle&&Z.from==s&&(z+=" "+ge.startStyle),ge.endStyle&&Z.to==y&&(B||(B=[])).push(ge.endStyle,Z.to),ge.title&&((W||(W={})).title=ge.title),ge.attributes)for(var Fe in ge.attributes)(W||(W={}))[Fe]=ge.attributes[Fe];ge.collapsed&&(!P||ki(P.marker,ge)<0)&&(P=Z)}else Z.from>s&&y>Z.from&&(y=Z.from)}if(B)for(var it=0;it=a)break;for(var Nt=Math.min(a,y);;){if(d){var wt=s+d.length;if(!P){var Ze=wt>Nt?d.slice(0,Nt-s):d;t.addToken(t,Ze,p?p+S:S,z,s+Ze.length==y?N:"",m,W)}if(wt>=Nt){d=d.slice(Nt-s),s=Nt;break}s=wt,z=""}d=i.slice(o,o=n[u++]),p=Oo(n[u++],t.cm.options)}}}function Eo(e,t,n){this.line=t,this.rest=Ea(t),this.size=this.rest?f(re(this.rest))-n+1:1,this.node=this.text=null,this.hidden=sr(e,t)}function jn(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ro(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function es(e,t){t=Ht(t);var n=f(t),r=e.display.externalMeasured=new Eo(e.doc,t,n);r.lineN=n;var i=r.built=zo(e,r);return r.text=i.pre,H(e.display.lineMeasure,i.pre),r}function Ko(e,t,n,r){return jt(e,Kr(e,t),n,r)}function Di(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=s-a,i=o-1,t>=s&&(l="right")),i!=null){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],l="left";if(n=="right"&&i==s-a)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function rs(e,t,n,r){var i=qo(t.map,n,r),o=i.node,l=i.start,a=i.end,s=i.collapse,u;if(o.nodeType==3){for(var d=0;d<4;d++){for(;l&&ve(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+a0&&(s=r="right");var p;e.options.lineWrapping&&(p=o.getClientRects()).length>1?u=p[r=="right"?p.length-1:0]:u=o.getBoundingClientRect()}if(M&&j<9&&!l&&(!u||!u.left&&!u.right)){var m=o.parentNode.getClientRects()[0];m?u={left:m.left,right:m.left+qr(e.display),top:m.top,bottom:m.bottom}:u=Uo}for(var y=u.top-t.rect.top,S=u.bottom-t.rect.top,N=(y+S)/2,z=t.view.measure.heights,P=0;P=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l(u=="before"?s-1:s,u=="before");function d(S,N,z){var P=a[N],W=P.level==1;return l(z?S-1:S,W!=z)}var p=nr(a,s,u),m=mr,y=d(s,p,u=="before");return m!=null&&(y.other=d(s,m,u!="before")),y}function Jo(e,t){var n=0;t=fe(e.doc,t),e.options.lineWrapping||(n=qr(e.display)*t.ch);var r=U(e.doc,t.line),i=Qt(r)+Xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Oi(e,t,n,r,i){var o=k(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function zi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Oi(r.first,0,null,-1,-1);var i=h(r,n),o=r.first+r.size-1;if(i>o)return Oi(r.first+r.size-1,U(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=U(r,i);;){var a=is(e,l,i,t,n),s=za(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=U(r,i=u.line)}}function Qo(e,t,n,r){r-=Ai(t);var i=t.text.length,o=Ot(function(l){return jt(e,n,l-1).bottom<=r},i,0);return i=Ot(function(l){return jt(e,n,l).top>r},o,i),{begin:o,end:i}}function Vo(e,t,n,r){n||(n=Kr(e,t));var i=Yn(e,t,jt(e,n,r),"line").top;return Qo(e,t,n,i)}function Pi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function is(e,t,n,r,i){i-=Qt(t);var o=Kr(e,t),l=Ai(t),a=0,s=t.text.length,u=!0,d=ke(t,e.doc.direction);if(d){var p=(e.options.lineWrapping?ls:os)(e,t,n,o,d,r,i);u=p.level!=1,a=u?p.from:p.to-1,s=u?p.to:p.from-1}var m=null,y=null,S=Ot(function(Q){var Z=jt(e,o,Q);return Z.top+=l,Z.bottom+=l,Pi(Z,r,i,!1)?(Z.top<=i&&Z.left<=r&&(m=Q,y=Z),!0):!1},a,s),N,z,P=!1;if(y){var W=r-y.left=B.bottom?1:0}return S=Tt(t.text,S,1),Oi(n,S,z,P,r-N)}function os(e,t,n,r,i,o,l){var a=Ot(function(p){var m=i[p],y=m.level!=1;return Pi(Bt(e,k(n,y?m.to:m.from,y?"before":"after"),"line",t,r),o,l,!0)},0,i.length-1),s=i[a];if(a>0){var u=s.level!=1,d=Bt(e,k(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Pi(d,o,l,!0)&&d.top>l&&(s=i[a-1])}return s}function ls(e,t,n,r,i,o,l){var a=Qo(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var d=null,p=null,m=0;m=u||y.to<=s)){var S=y.level!=1,N=jt(e,r,S?Math.min(u,y.to)-1:Math.max(s,y.from)).right,z=Nz)&&(d=y,p=z)}}return d||(d=i[i.length-1]),d.fromu&&(d={from:d.from,to:u,level:d.level}),d}var wr;function Ur(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(wr==null){wr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)wr.appendChild(document.createTextNode("x")),wr.appendChild(c("br"));wr.appendChild(document.createTextNode("x"))}H(e.measure,wr);var n=wr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function qr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");H(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ei(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Ii(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ii(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function $o(e){var t=Ur(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/qr(e.display)-3);return function(i){if(sr(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l0&&(u=U(e.doc,s.line).text).length==s.ch){var d=he(u,u.length,e.options.tabSize)-u.length;s=k(s.line,Math.max(0,Math.round((o-Bo(e.display).left)/qr(e.display))-d))}return s}function Sr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Jt&&Si(e.doc,t)i.viewFrom?fr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)fr(e);else if(t<=i.viewFrom){var o=Jn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):fr(e)}else if(n>=i.viewTo){var l=Jn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):fr(e)}else{var a=Jn(e,t,t,-1),s=Jn(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(jn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):fr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Sr(e,t)];if(o.node!=null){var l=o.changes||(o.changes=[]);q(l,n)==-1&&l.push(n)}}}function fr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Jn(e,t,n,r){var i=Sr(e,t),o,l=e.display.view;if(!Jt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;Si(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function as(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=jn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=jn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Sr(e,n)))),r.viewTo=n}function el(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(c("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Qn(e,t){return e.top-t.top||e.left-t.left}function ss(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=Bo(e.display),a=l.left,s=Math.max(r.sizerWidth,xr(e)-r.sizer.offsetLeft)-l.right,u=i.direction=="ltr";function d(E,B,Q,Z){B<0&&(B=0),B=Math.round(B),Z=Math.round(Z),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+E+`px; - top: `+B+"px; width: "+(Q??s-E)+`px; - height: `+(Z-B)+"px"))}function p(E,B,Q){var Z=U(i,E),ge=Z.text.length,Fe,it;function Ue(Ze,kt){return Zn(e,k(E,Ze),"div",Z,kt)}function Nt(Ze,kt,at){var $e=Vo(e,Z,null,Ze),Je=kt=="ltr"==(at=="after")?"left":"right",Xe=at=="after"?$e.begin:$e.end-(/\s/.test(Z.text.charAt($e.end-1))?2:1);return Ue(Xe,Je)[Je]}var wt=ke(Z,i.direction);return rr(wt,B||0,Q??ge,function(Ze,kt,at,$e){var Je=at=="ltr",Xe=Ue(Ze,Je?"left":"right"),St=Ue(kt-1,Je?"right":"left"),nn=B==null&&Ze==0,gr=Q==null&&kt==ge,dt=$e==0,Xt=!wt||$e==wt.length-1;if(St.top-Xe.top<=3){var ot=(u?nn:gr)&&dt,fo=(u?gr:nn)&&Xt,tr=ot?a:(Je?Xe:St).left,Nr=fo?s:(Je?St:Xe).right;d(tr,Xe.top,Nr-tr,Xe.bottom)}else{var Dr,vt,on,co;Je?(Dr=u&&nn&&dt?a:Xe.left,vt=u?s:Nt(Ze,at,"before"),on=u?a:Nt(kt,at,"after"),co=u&&gr&&Xt?s:St.right):(Dr=u?Nt(Ze,at,"before"):a,vt=!u&&nn&&dt?s:Xe.right,on=!u&&gr&&Xt?a:St.left,co=u?Nt(kt,at,"after"):s),d(Dr,Xe.top,vt-Dr,Xe.bottom),Xe.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Gr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function rl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Bi(e))}function Hi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Gr(e))},100)}function Bi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(qe(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),_&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),_i(e))}function Gr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(qe(e,"blur",e,t),e.state.focused=!1,me(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Vn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||y<-.005)&&(ie.display.sizerWidth){var N=Math.ceil(d/qr(e.display));N>e.display.maxLineLength&&(e.display.maxLineLength=N,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function nl(e){if(e.widgets)for(var t=0;t=l&&(o=h(t,Qt(U(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function us(e,t){if(!Ge(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!Oe){var l=c("div","​",null,`position: absolute; - top: `+(t.top-n.viewOffset-Xn(e.display))+`px; - height: `+(t.bottom-t.top+Gt(e)+n.barHeight)+`px; - left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function fs(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?k(t.line,t.ch+1,"before"):t,t=t.ch?k(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=Bt(e,t),s=!n||n==t?a:Bt(e,n);i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=Ri(e,i),d=e.doc.scrollTop,p=e.doc.scrollLeft;if(u.scrollTop!=null&&(mn(e,u.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(l=!0)),u.scrollLeft!=null&&(Cr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(l=!0)),!l)break}return i}function cs(e,t){var n=Ri(e,t);n.scrollTop!=null&&mn(e,n.scrollTop),n.scrollLeft!=null&&Cr(e,n.scrollLeft)}function Ri(e,t){var n=e.display,r=Ur(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ni(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Mi(n),s=t.topa-r;if(t.topi+o){var d=Math.min(t.top,(u?a:t.bottom)-o);d!=i&&(l.scrollTop=d)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,m=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-p,y=xr(e)-n.gutters.offsetWidth,S=t.right-t.left>y;return S&&(t.right=t.left+y),t.left<10?l.scrollLeft=0:t.lefty+m-3&&(l.scrollLeft=t.right+(S?0:10)-y),l}function Ki(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function jr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function yn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function ds(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Jo(e,t.from),r=Jo(e,t.to);il(e,n,r,t.margin)}}function il(e,t,n,r){var i=Ri(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});yn(e,i.scrollLeft,i.scrollTop)}function mn(e,t){Math.abs(e.doc.scrollTop-t)<2||(Se||qi(e,{top:t}),ol(e,t,!0),Se&&qi(e),wn(e,100))}function ol(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Cr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,fl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Mi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Gt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Tr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),J(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),J(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,M&&j<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Tr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Tr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Tr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Tr.prototype.zeroWidthHack=function(){var e=xe&&!Te?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ue,this.disableVert=new ue},Tr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Tr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var xn=function(){};xn.prototype.update=function(){return{bottom:0,right:0}},xn.prototype.setScrollLeft=function(){},xn.prototype.setScrollTop=function(){},xn.prototype.clear=function(){};function Xr(e,t){t||(t=bn(e));var n=e.display.barWidth,r=e.display.barHeight;ll(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Vn(e),ll(e,bn(e)),n=e.display.barWidth,r=e.display.barHeight}function ll(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var al={native:Tr,null:xn};function sl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&me(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new al[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),J(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Cr(e,t):mn(e,t)},e),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)}var hs=0;function Lr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++hs,markArrays:null},qa(e.curOp)}function Mr(e){var t=e.curOp;t&&ja(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ti(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function gs(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function ys(e){var t=e.cm,n=t.display;e.updatedDisplay&&Vn(t),e.barMeasure=bn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ko(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Gt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-xr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ms(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=fn(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Ut(t.mode,r.state):null,s=go(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,d=s.classes;d?o.styleClasses=d:u&&(o.styleClasses=null);for(var p=!l||l.length!=o.styles.length||u!=d&&(!u||!d||u.bgClass!=d.bgClass||u.textClass!=d.textClass),m=0;!p&&mn)return wn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Mt(e,function(){for(var o=0;o=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&el(e)==0)return!1;cl(e)&&(fr(e),t.dims=Ei(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Jt&&(o=Si(e.doc,o),l=Ao(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;as(e,o,l),n.viewOffset=Qt(U(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=el(e);if(!a&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=ks(e);return s>4&&(n.lineDiv.style.display="none"),Cs(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ss(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,wn(e,400)),n.updateLineNumbers=null,!0}function ul(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==xr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Mi(e.display)-Ni(e),n.top)}),t.visible=$n(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=$n(e.display,e.doc,n));if(!Ui(e,t))break;Vn(e);var i=bn(e);gn(e),Xr(e,i),ji(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function qi(e,t){var n=new ti(e,t);if(Ui(e,n)){Vn(e),ul(e,n);var r=bn(e);gn(e),Xr(e,r),ji(e,r),n.finish()}}function Cs(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(S){var N=S.nextSibling;return _&&xe&&e.display.currentWheelTarget==S?S.style.display="none":S.parentNode.removeChild(S),N}for(var s=r.view,u=r.viewFrom,d=0;d-1&&(y=!1),Io(e,p,u,n)),y&&(T(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(O(e.options,u)))),l=p.node.nextSibling}u+=p.size}for(;l;)l=a(l)}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",tt(e,"gutterChanged",e)}function ji(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Gt(e)+"px"}function fl(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ii(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),M&&j<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!_&&!(Se&&oe)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Xi(r.gutters,r.lineNumbers),dl(i),n.init(i)}var ri=0,$t=null;M?$t=-.53:Se?$t=15:G?$t=-.7:Ie&&($t=-1/3);function hl(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function Ls(e){var t=hl(e);return t.x*=$t,t.y*=$t,t}function pl(e,t){G&&se==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=hl(t),r=n.x,i=n.y,o=$t;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var l=e.display,a=l.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||i&&u){if(i&&xe&&_){e:for(var d=t.target,p=l.view;d!=a;d=d.parentNode)for(var m=0;m=0&&I(e,r.to())<=0)return n}return-1};var Ae=function(e,t){this.anchor=e,this.head=t};Ae.prototype.from=function(){return Hr(this.anchor,this.head)},Ae.prototype.to=function(){return mt(this.anchor,this.head)},Ae.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Rt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(m,y){return I(m.from(),y.from())}),n=q(t,i);for(var o=1;o0:s>=0){var u=Hr(a.from(),l.from()),d=mt(a.to(),l.to()),p=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Ae(p?d:u,p?u:d))}}return new At(t,n)}function cr(e,t){return new At([new Ae(e,t||e)],0)}function dr(e){return e.text?k(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function vl(e,t){if(I(e,t.from)<0)return e;if(I(e,t.to)<=0)return dr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=dr(t).ch-t.to.ch),k(n,r)}function Yi(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,S-1),e.insert(a.line+1,P)}tt(e,"change",e,t)}function hr(e,t,n){function r(i,o,l){if(i.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function wl(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,l,a;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=Ds(i,i.lastOp==r)))a=re(l.changes),I(t.from,t.to)==0&&I(t.from,a.to)==0?a.to=dr(t):l.changes.push(Qi(e,t));else{var s=re(i.done);for((!s||!s.ranges)&&ii(e.sel,i.done),l={changes:[Qi(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||qe(e,"historyAdded")}function As(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Os(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||As(e,o,re(i.done),t))?i.done[i.done.length-1]=t:ii(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&xl(i.undone)}function ii(e,t){var n=re(t);n&&n.ranges&&n.equals(e)||t.push(e)}function kl(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function zs(e){if(!e)return null;for(var t,n=0;n-1&&(re(a)[p]=u[p],delete u[p])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=I(t,i)<0;o!=I(n,i)<0?(i=t,t=n):o!=I(t,n)<0&&(t=n)}return new Ae(i,t)}else return new Ae(n||t,t)}function oi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),ct(e,new At([Vi(e.sel.primary(),t,n,i)],0),r)}function Cl(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(qe(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!s.atomic)continue;if(n){var p=s.find(r<0?1:-1),m=void 0;if((r<0?d:u)&&(p=Al(e,p,-r,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(m=I(p,n))&&(r<0?m<0:m>0))return Zr(e,p,t,r,i)}var y=s.find(r<0?-1:1);return(r<0?u:d)&&(y=Al(e,y,r,y.line==t.line?o:null)),y?Zr(e,y,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,l=Zr(e,t,n,o,i)||!i&&Zr(e,t,n,o,!0)||Zr(e,t,n,-o,i)||!i&&Zr(e,t,n,-o,!0);return l||(e.cantEdit=!0,k(e.first,0))}function Al(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?fe(e,k(t.line-1)):null:n>0&&t.ch==(r||U(e,t.line)).text.length?t.line=0;--i)Pl(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Pl(e,t)}}function Pl(e,t){if(!(t.text.length==1&&t.text[0]==""&&I(t.from,t.to)==0)){var n=Yi(e,t);wl(e,t,n,e.cm?e.cm.curOp.id:NaN),Cn(e,t,n,wi(e,t));var r=[];hr(e,function(i,o){!o&&q(r,i.history)==-1&&(Wl(i.history,t),r.push(i.history)),Cn(i,t,null,wi(i,t))})}}function si(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,l=e.sel,a=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u=0;--y){var S=m(y);if(S)return S.v}}}}function El(e,t){if(t!=0&&(e.first+=t,e.sel=new At(Ne(e.sel.ranges,function(i){return new Ae(k(i.anchor.line+t,i.anchor.ch),k(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){bt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:k(o,U(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Zt(e,t.from,t.to),n||(n=Yi(e,t)),e.cm?Is(e.cm,t,r):Ji(e,t,r),li(e,n,st),e.cantEdit&&ai(e,k(e.firstLine(),0))&&(e.cantEdit=!1)}}function Is(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=f(Ht(U(r,o.line))),r.iter(s,l.line+1,function(y){if(y==i.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&zt(e),Ji(r,t,n,$o(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(y){var S=Gn(y);S>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=S,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),Ca(r,o.line),wn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?bt(e):o.line==l.line&&t.text.length==1&&!yl(e.doc,t)?ur(e,o.line,"text"):bt(e,o.line,l.line+1,u);var d=Lt(e,"changes"),p=Lt(e,"change");if(p||d){var m={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};p&&tt(e,"change",e,m),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(m)}e.display.selForContextMenu=null}function Qr(e,t,n,r,i){var o;r||(r=n),I(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Jr(e,{from:n,to:r,text:t,origin:i})}function Il(e,t,n,r){n1||!(this.children[0]instanceof Ln))){var a=[];this.collapse(a),this.children=[new Ln(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=i.lines.length%25+25,a=l;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&bt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Nl(e.doc)),e&&tt(e,"markerCleared",e,this,r,i),t&&Mr(e),this.parent&&this.parent.clear()}},pr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=x("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Do(e,t.line,t,n,o)||t.line!=n.line&&Do(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");La()}o.addToHistory&&wl(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,n.line+1,function(p){s&&o.collapsed&&!s.options.lineWrapping&&Ht(p)==s.display.maxLine&&(u=!0),o.collapsed&&a!=t.line&&Dt(p,0),Na(p,new Rn(o,a==t.line?t.ch:null,a==n.line?n.ch:null),e.cm&&e.cm.curOp),++a}),o.collapsed&&e.iter(t.line,n.line+1,function(p){sr(e,p)&&Dt(p,0)}),o.clearOnEnter&&J(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ta(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Hl,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)bt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var d=t.line;d<=n.line;d++)ur(s,d,"text");o.atomic&&Nl(s.doc),tt(s,"markerAdded",s,o)}return o}var Dn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)Jr(this,r[s]);a?Ll(this,a):this.cm&&jr(this.cm)}),undo:nt(function(){si(this,"undo")}),redo:nt(function(){si(this,"redo")}),undoSelection:nt(function(){si(this,"undo",!0)}),redoSelection:nt(function(){si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=fe(this,e),t=fe(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n}),fe(this,k(n,t))},indexFromPos:function(e){e=fe(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData("Text");if(d){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),li(t.doc,cr(n,n)),p)for(var m=0;m=0;a--)Qr(e.doc,"",r[a].from,r[a].to,"+delete");jr(e)})}function eo(e,t,n){var r=Tt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new k(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=ke(n,t.doc.direction);if(o){var l=i<0?re(o):o[0],a=i<0==(l.level==1),s=a?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){var d=Kr(t,n);u=i<0?n.text.length-1:0;var p=jt(t,d,u).top;u=Ot(function(m){return jt(t,d,m).top==p},i<0==(l.level==1)?l.from:l.to-1,u),s=="before"&&(u=eo(n,u,1))}else u=i<0?l.to:l.from;return new k(r,u,s)}}return new k(r,i<0?n.text.length:0,i<0?"before":"after")}function Zs(e,t,n,r){var i=ke(t,e.doc.direction);if(!i)return to(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=nr(i,n.ch,n.sticky),l=i[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>n.ch:l.from=l.from&&m>=d.begin)){var y=p?"before":"after";return new k(n.line,m,y)}}var S=function(P,W,E){for(var B=function(Fe,it){return it?new k(n.line,a(Fe,1),"before"):new k(n.line,Fe,"after")};P>=0&&P0==(Q.level!=1),ge=Z?E.begin:a(E.end,-1);if(Q.from<=ge&&ge0?d.end:a(d.begin,-1);return z!=null&&!(r>0&&z==t.text.length)&&(N=S(r>0?0:i.length-1,r,u(z)),N)?N:null}var zn={selectAll:Ol,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),st)},killLine:function(e){return en(e,function(t){if(t.empty()){var n=U(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new k(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),k(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=U(e.doc,i.line-1).text;l&&(i=new k(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),k(i.line-1,l.length-1),i,"+transpose"))}}n.push(new Ae(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Mt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&I(t,this.pos)==0&&n==this.button};var En,In;function ru(e,t){var n=+new Date;return In&&In.compare(n,e,t)?(En=In=null,"triple"):En&&En.compare(n,e,t)?(In=new io(n,e,t),En=null,"double"):(En=new io(n,e,t),In=null,"single")}function ta(e){var t=this,n=t.display;if(!(Ge(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Vt(n,e)){_||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=kr(t,e),i=It(e),o=r?ru(r,i):"single";le(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&nu(t,i,r,o,e))&&(i==1?r?ou(t,r,o,e):ln(e)==n.scroller&&ft(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(ee?t.display.input.onContextMenu(e):Hi(t)))}}}function nu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Pn(e,jl(o,i),i,function(l){if(typeof l=="string"&&(l=zn[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,n)!=Ct}finally{e.state.suppressEdits=!1}return a})}function iu(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=_e?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=xe?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(xe?n.altKey:n.ctrlKey)),i}function ou(e,t,n,r){M?setTimeout(te(rl,e),0):e.curOp.focus=g(Re(e));var i=iu(e,n,r),o=e.doc.sel,l;e.options.dragDrop&&yi&&!e.isReadOnly()&&n=="single"&&(l=o.contains(t))>-1&&(I((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(I(l.to(),t)>0||t.xRel<0)?lu(e,r,t,i):au(e,r,t,i)}function lu(e,t,n,r){var i=e.display,o=!1,l=rt(e,function(u){_&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Hi(e)),ut(i.wrapper.ownerDocument,"mouseup",l),ut(i.wrapper.ownerDocument,"mousemove",a),ut(i.scroller,"dragstart",s),ut(i.scroller,"drop",l),o||(ft(u),r.addNew||oi(e.doc,n,null,null,r.extend),_&&!Ie||M&&j==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),a=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};_&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,J(i.wrapper.ownerDocument,"mouseup",l),J(i.wrapper.ownerDocument,"mousemove",a),J(i.scroller,"dragstart",s),J(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ra(e,t,n){if(n=="char")return new Ae(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ae(k(t.line,0),fe(e.doc,k(t.line+1,0)));var r=n(e,t);return new Ae(r.from,r.to)}function au(e,t,n,r){M&&Hi(e);var i=e.display,o=e.doc;ft(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),a>-1?l=u[a]:l=new Ae(n,n)):(l=o.sel.primary(),a=o.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new Ae(n,n)),n=kr(e,t,!0,!0),a=-1;else{var d=ra(e,n,r.unit);r.extend?l=Vi(l,d.anchor,d.head,r.extend):l=d}r.addNew?a==-1?(a=u.length,ct(o,Rt(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(ct(o,Rt(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,a,l,gt):(a=0,ct(o,new At([l],0),gt),s=o.sel);var p=n;function m(E){if(I(p,E)!=0)if(p=E,r.unit=="rectangle"){for(var B=[],Q=e.options.tabSize,Z=he(U(o,n.line).text,n.ch,Q),ge=he(U(o,E.line).text,E.ch,Q),Fe=Math.min(Z,ge),it=Math.max(Z,ge),Ue=Math.min(n.line,E.line),Nt=Math.min(e.lastLine(),Math.max(n.line,E.line));Ue<=Nt;Ue++){var wt=U(o,Ue).text,Ze=Ke(wt,Fe,Q);Fe==it?B.push(new Ae(k(Ue,Ze),k(Ue,Ze))):wt.length>Ze&&B.push(new Ae(k(Ue,Ze),k(Ue,Ke(wt,it,Q))))}B.length||B.push(new Ae(n,n)),ct(o,Rt(e,s.ranges.slice(0,a).concat(B),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(E)}else{var kt=l,at=ra(e,E,r.unit),$e=kt.anchor,Je;I(at.anchor,$e)>0?(Je=at.head,$e=Hr(kt.from(),at.anchor)):(Je=at.anchor,$e=mt(kt.to(),at.head));var Xe=s.ranges.slice(0);Xe[a]=su(e,new Ae(fe(o,$e),Je)),ct(o,Rt(e,Xe,a),gt)}}var y=i.wrapper.getBoundingClientRect(),S=0;function N(E){var B=++S,Q=kr(e,E,!0,r.unit=="rectangle");if(Q)if(I(Q,p)!=0){e.curOp.focus=g(Re(e)),m(Q);var Z=$n(i,o);(Q.line>=Z.to||Q.liney.bottom?20:0;ge&&setTimeout(rt(e,function(){S==B&&(i.scroller.scrollTop+=ge,N(E))}),50)}}function z(E){e.state.selectingText=!1,S=1/0,E&&(ft(E),i.input.focus()),ut(i.wrapper.ownerDocument,"mousemove",P),ut(i.wrapper.ownerDocument,"mouseup",W),o.history.lastSelOrigin=null}var P=rt(e,function(E){E.buttons===0||!It(E)?z(E):N(E)}),W=rt(e,z);e.state.selectingText=W,J(i.wrapper.ownerDocument,"mousemove",P),J(i.wrapper.ownerDocument,"mouseup",W)}function su(e,t){var n=t.anchor,r=t.head,i=U(e.doc,n.line);if(I(n,r)==0&&n.sticky==r.sticky)return t;var o=ke(i);if(!o)return t;var l=nr(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s=l+(a.from==n.ch==(a.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var d=nr(o,r.ch,r.sticky),p=d-l||(r.ch-n.ch)*(a.level==1?-1:1);d==s-1||d==s?u=p<0:u=p>0}var m=o[s+(u?-1:0)],y=u==(m.level==1),S=y?m.from:m.to,N=y?"after":"before";return n.ch==S&&n.sticky==N?t:new Ae(new k(n.line,S,N),r)}function na(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ft(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!Lt(e,n))return yt(t);o-=a.top-l.viewOffset;for(var s=0;s=i){var d=h(e.doc,o),p=e.display.gutterSpecs[s];return qe(e,n,e,d,p.className,t),yt(t)}}}function oo(e,t){return na(e,t,"gutterClick",!0)}function ia(e,t){Vt(e.display,t)||uu(e,t)||Ge(e,t,"contextmenu")||ee||e.display.input.onContextMenu(t)}function uu(e,t){return Lt(e,"gutterContextMenu")?na(e,t,"gutterContextMenu",!1):!1}function oa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vn(e)}var tn={toString:function(){return"CodeMirror.Init"}},la={},di={};function fu(e){var t=e.optionHandlers;function n(r,i,o,l){e.defaults[r]=i,o&&(t[r]=l?function(a,s,u){u!=tn&&o(a,s,u)}:o)}e.defineOption=n,e.Init=tn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Zi(r)},!0),n("indentUnit",2,Zi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Sn(r),vn(r),bt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],l=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var d=s.text.indexOf(i,u);if(d==-1)break;u=d+i.length,o.push(k(l,d))}l++});for(var a=o.length-1;a>=0;a--)Qr(r.doc,i,o[a],k(o[a].line,o[a].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=tn&&r.refresh()}),n("specialCharPlaceholder",Ha,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",oe?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!ye),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){oa(r),kn(r)},!0),n("keyMap","default",function(r,i,o){var l=fi(i),a=o!=tn&&fi(o);a&&a.detach&&a.detach(r,l),l.attach&&l.attach(r,a||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,du,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Xi(i,r.options.lineNumbers),kn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Ii(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Xr(r)},!0),n("scrollbarStyle","native",function(r){sl(r),Xr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Xi(r.options.gutters,i),kn(r)},!0),n("firstLineNumber",1,kn,!0),n("lineNumberFormatter",function(r){return r},kn,!0),n("showCursorWhenSelecting",!1,gn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Gr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,cu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gn,!0),n("singleCursorHeightPerLine",!0,gn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Sn,!0),n("addModeClass",!1,Sn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Sn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function cu(e,t,n){var r=n&&n!=tn;if(!t!=!r){var i=e.display.dragFunctions,o=t?J:ut;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function du(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(me(e.display.wrapper,"CodeMirror-wrap"),Ti(e)),Fi(e),bt(e),vn(e),setTimeout(function(){return Xr(e)},100)}function Be(e,t){var n=this;if(!(this instanceof Be))return new Be(e,t);this.options=t=t?de(t):{},de(la,t,!1);var r=t.value;typeof r=="string"?r=new xt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Be.inputStyles[t.inputStyle](this),o=this.display=new Ts(e,r,i,t);o.wrapper.CodeMirror=this,oa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),sl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ue,keySeq:null,specialChars:null},t.autofocus&&!oe&&o.input.focus(),M&&j<11&&setTimeout(function(){return n.display.input.reset(!0)},20),hu(this),qs(),Lr(this),this.curOp.forceUpdate=!0,ml(this,r),t.autofocus&&!oe||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Bi(n)},20):Gr(this);for(var l in di)di.hasOwnProperty(l)&&di[l](this,t[l],tn);cl(this),t.finishInit&&t.finishInit(this);for(var a=0;a20*20}J(t.scroller,"touchstart",function(s){if(!Ge(e,s)&&!o(s)&&!oo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),J(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),J(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Vt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var d=e.coordsChar(t.activeTouch,"page"),p;!u.prev||l(u,u.prev)?p=new Ae(d,d):!u.prev.prev||l(u,u.prev.prev)?p=e.findWordAt(d):p=new Ae(k(d.line,0),fe(e.doc,k(d.line+1,0))),e.setSelection(p.anchor,p.head),e.focus(),ft(s)}i()}),J(t.scroller,"touchcancel",i),J(t.scroller,"scroll",function(){t.scroller.clientHeight&&(mn(e,t.scroller.scrollTop),Cr(e,t.scroller.scrollLeft,!0),qe(e,"scroll",e))}),J(t.scroller,"mousewheel",function(s){return pl(e,s)}),J(t.scroller,"DOMMouseScroll",function(s){return pl(e,s)}),J(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Ge(e,s)||ir(s)},over:function(s){Ge(e,s)||(Us(e,s),ir(s))},start:function(s){return Ks(e,s)},drop:rt(e,Rs),leave:function(s){Ge(e,s)||Kl(e)}};var a=t.input.getField();J(a,"keyup",function(s){return $l.call(e,s)}),J(a,"keydown",rt(e,Vl)),J(a,"keypress",rt(e,ea)),J(a,"focus",function(s){return Bi(e,s)}),J(a,"blur",function(s){return Gr(e,s)})}var lo=[];Be.defineInitHook=function(e){return lo.push(e)};function Fn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=fn(e,t).state:n="prev");var l=e.options.tabSize,a=U(i,t),s=he(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],d;if(!r&&!/\S/.test(a.text))d=0,n="not";else if(n=="smart"&&(d=i.mode.indent(o,a.text.slice(u.length),a.text),d==Ct||d>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?d=he(U(i,t-1).text,null,l):d=0:n=="add"?d=s+e.options.indentUnit:n=="subtract"?d=s-e.options.indentUnit:typeof n=="number"&&(d=s+n),d=Math.max(0,d);var p="",m=0;if(e.options.indentWithTabs)for(var y=Math.floor(d/l);y;--y)m+=l,p+=" ";if(ml,s=Pt(t),u=null;if(a&&r.ranges.length>1)if(Kt&&Kt.text.join(` -`)==t){if(r.ranges.length%Kt.text.length==0){u=[];for(var d=0;d=0;m--){var y=r.ranges[m],S=y.from(),N=y.to();y.empty()&&(n&&n>0?S=k(S.line,S.ch-n):e.state.overwrite&&!a?N=k(N.line,Math.min(U(o,N.line).text.length,N.ch+re(s).length)):a&&Kt&&Kt.lineWise&&Kt.text.join(` -`)==s.join(` -`)&&(S=N=k(S.line,0)));var z={from:S,to:N,text:u?u[m%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Jr(e.doc,z),tt(e,"inputRead",e,z)}t&&!a&&sa(e,t),jr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function aa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Mt(t,function(){return ao(t,n,0,null,"paste")}),!0}function sa(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a-1){l=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(U(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Fn(e,i.head.line,"smart"));l&&tt(e,"electricInput",e,i.head.line)}}}function ua(e){for(var t=[],n=[],r=0;ro&&(Fn(this,a.head.line,r,!0),o=a.head.line,l==this.doc.sel.primIndex&&jr(this));else{var s=a.from(),u=a.to(),d=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var p=d;p0&&$i(this.doc,l,new Ae(s,m[l].to()),st)}}}),getTokenAt:function(r,i){return xo(this,r,i)},getLineTokens:function(r,i){return xo(this,k(r),i,!0)},getTokenTypeAt:function(r){r=fe(this.doc,r);var i=yo(this,U(this.doc,r.line)),o=0,l=(i.length-1)/2,a=r.ch,s;if(a==0)s=i[2];else for(;;){var u=o+l>>1;if((u?i[u*2-1]:0)>=a)l=u;else if(i[u*2+1]s&&(r=s,l=!0),a=U(this.doc,r)}else a=r;return Yn(this,a,{top:0,left:0},i||"page",o||l).top+(l?this.doc.height-Qt(a):0)},defaultTextHeight:function(){return Ur(this.display)},defaultCharWidth:function(){return qr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,l,a){var s=this.display;r=Bt(this,fe(this.doc,r));var u=r.bottom,d=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),l=="over")u=r.top;else if(l=="above"||l=="near"){var p=Math.max(s.wrapper.clientHeight,this.doc.height),m=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(l=="above"||r.bottom+i.offsetHeight>p)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=p&&(u=r.bottom),d+i.offsetWidth>m&&(d=m-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",a=="right"?(d=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(a=="left"?d=0:a=="middle"&&(d=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=d+"px"),o&&cs(this,{left:d,top:u,right:d+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:pt(Vl),triggerOnKeyPress:pt(ea),triggerOnKeyUp:$l,triggerOnMouseDown:pt(ta),execCommand:function(r){if(zn.hasOwnProperty(r))return zn[r].call(null,this)},triggerElectric:pt(function(r){sa(this,r)}),findPosH:function(r,i,o,l){var a=1;i<0&&(a=-1,i=-i);for(var s=fe(this.doc,r),u=0;u0&&d(o.charAt(l-1));)--l;for(;a.5||this.options.lineWrapping)&&Fi(this),qe(this,"refresh",this)}),swapDoc:pt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ml(this,r),vn(this),this.display.input.reset(),yn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,tt(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Et(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,l){e.registerHelper(r,i,l),n[r]._global.push({pred:o,val:l})}}function uo(e,t,n,r,i){var o=t,l=n,a=U(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var W=t.line+s;return W=e.first+e.size?!1:(t=new k(W,t.ch,t.sticky),a=U(e,W))}function d(W){var E;if(r=="codepoint"){var B=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(B))E=null;else{var Q=n>0?B>=55296&&B<56320:B>=56320&&B<57343;E=new k(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(Q?2:1))),-n)}}else i?E=Zs(e.cm,a,t,n):E=to(a,t,n);if(E==null)if(!W&&u())t=ro(i,e.cm,a,t.line,s);else return!1;else t=E;return!0}if(r=="char"||r=="codepoint")d();else if(r=="column")d(!0);else if(r=="word"||r=="group")for(var p=null,m=r=="group",y=e.cm&&e.cm.getHelper(t,"wordChars"),S=!0;!(n<0&&!d(!S));S=!1){var N=a.text.charAt(t.ch)||` -`,z=ne(N,y)?"w":m&&N==` -`?"n":!m||/\s/.test(N)?null:"p";if(m&&!S&&!z&&(z="s"),p&&p!=z){n<0&&(n=1,d(),t.sticky="after");break}if(z&&(p=z),n>0&&!d(!S))break}var P=ai(e,t,o,l,!0);return De(o,P)&&(P.hitSide=!0),P}function ca(e,t,n,r){var i=e.doc,o=t.left,l;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,le(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(a-.5*Ur(e.display),3);l=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var u;u=zi(e,o,l),!!u.outside;){if(n<0?l<=0:l>=i.height){u.hitSide=!0;break}l+=n*5}return u}var Pe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ue,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Pe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,so(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(a){for(var s=a.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}J(i,"paste",function(a){!o(a)||Ge(r,a)||aa(a,r)||j<=11&&setTimeout(rt(r,function(){return t.updateFromDOM()}),20)}),J(i,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),J(i,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),J(i,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),J(i,"touchstart",function(){return n.forceCompositionEnd()}),J(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||Ge(r,a))){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=ua(r);hi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,st),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=Kt.text.join(` -`);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var d=fa(),p=d.firstChild;so(p),r.display.lineSpace.insertBefore(d,r.display.lineSpace.firstChild),p.value=Kt.text.join(` -`);var m=g(ze(i));$(p),setTimeout(function(){r.display.lineSpace.removeChild(d),m.focus(),m==i&&n.showPrimarySelection()},50)}}J(i,"copy",l),J(i,"cut",l)},Pe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Pe.prototype.prepareSelection=function(){var e=tl(this.cm,!1);return e.focus=g(ze(this.div))==this.div,e},Pe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Pe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Pe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&da(t,r)||{node:a[0].measure.map[2],offset:0},u=i.linee.firstLine()&&(r=k(r.line-1,U(e.doc,r.line-1).length)),i.ch==U(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,l,a;r.line==t.viewFrom||(o=Sr(e,r.line))==0?(l=f(t.view[0].line),a=t.view[0].node):(l=f(t.view[o].line),a=t.view[o-1].node.nextSibling);var s=Sr(e,i.line),u,d;if(s==t.view.length-1?(u=t.viewTo-1,d=t.lineDiv.lastChild):(u=f(t.view[s+1].line)-1,d=t.view[s+1].node.previousSibling),!a)return!1;for(var p=e.doc.splitLines(gu(e,a,d,l,u)),m=Zt(e.doc,k(l,0),k(u,U(e.doc,u).text.length));p.length>1&&m.length>1;)if(re(p)==re(m))p.pop(),m.pop(),u--;else if(p[0]==m[0])p.shift(),m.shift(),l++;else break;for(var y=0,S=0,N=p[0],z=m[0],P=Math.min(N.length,z.length);yr.ch&&W.charCodeAt(W.length-S-1)==E.charCodeAt(E.length-S-1);)y--,S++;p[p.length-1]=W.slice(0,W.length-S).replace(/^\u200b+/,""),p[0]=p[0].slice(y).replace(/\u200b+$/,"");var Q=k(l,y),Z=k(u,m.length?re(m).length-S:0);if(p.length>1||p[0]||I(Q,Z))return Qr(e.doc,p,Q,Z,"+input"),!0},Pe.prototype.ensurePolled=function(){this.forceCompositionEnd()},Pe.prototype.reset=function(){this.forceCompositionEnd()},Pe.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Pe.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},Pe.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Mt(this.cm,function(){return bt(e.cm)})},Pe.prototype.setUneditable=function(e){e.contentEditable="false"},Pe.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||rt(this.cm,ao)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Pe.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Pe.prototype.onContextMenu=function(){},Pe.prototype.resetPosition=function(){},Pe.prototype.needsContentAttribute=!0;function da(e,t){var n=Di(e,t.line);if(!n||n.hidden)return null;var r=U(e.doc,t.line),i=Ro(n,r,t.line),o=ke(r,e.doc.direction),l="left";if(o){var a=nr(o,t.ch);l=a%2?"right":"left"}var s=qo(i.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function vu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function rn(e,t){return t&&(e.bad=!0),e}function gu(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(y){return function(S){return S.id==y}}function d(){l&&(o+=a,s&&(o+=a),l=s=!1)}function p(y){y&&(d(),o+=y)}function m(y){if(y.nodeType==1){var S=y.getAttribute("cm-text");if(S){p(S);return}var N=y.getAttribute("cm-marker"),z;if(N){var P=e.findMarks(k(r,0),k(i+1,0),u(+N));P.length&&(z=P[0].find(0))&&p(Zt(e.doc,z.from,z.to).join(a));return}if(y.getAttribute("contenteditable")=="false")return;var W=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;W&&d();for(var E=0;E=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),J(i,"paste",function(l){Ge(r,l)||aa(l,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(l){if(!Ge(r,l)){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=ua(r);hi({lineWise:!0,text:a.text}),l.type=="cut"?r.setSelections(a.ranges,null,st):(n.prevInput="",i.value=a.text.join(` -`),$(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}J(i,"cut",o),J(i,"copy",o),J(e.scroller,"paste",function(l){if(!(Vt(e,l)||Ge(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),J(e.lineSpace,"selectstart",function(l){Vt(e,l)||ft(l)}),J(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),J(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ye.prototype.createField=function(e){this.wrapper=fa(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ye.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ye.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=tl(e);if(e.options.moveInputWithCursor){var i=Bt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},Ye.prototype.showSelection=function(e){var t=this.cm,n=t.display;H(n.cursorDiv,e.cursors),H(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ye.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&$(this.textarea),M&&j>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",M&&j>=9&&(this.hasSelection=null));this.resetting=!1}},Ye.prototype.getField=function(){return this.textarea},Ye.prototype.supportsTouch=function(){return!1},Ye.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!oe||g(ze(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ye.prototype.blur=function(){this.textarea.blur()},Ye.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ye.prototype.receivedFocus=function(){this.slowPoll()},Ye.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ye.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Ye.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||lr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(M&&j>=9&&this.hasSelection===i||xe&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="​"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(r.length,i.length);l1e3||i.indexOf(` -`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ye.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ye.prototype.onKeyPress=function(){M&&j>=9&&(this.hasSelection=null),this.fastPoll()},Ye.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=kr(n,e),l=r.scroller.scrollTop;if(!o||ce)return;var a=n.options.resetSelectionOnContextMenu;a&&n.doc.sel.contains(o)==-1&&rt(n,ct)(n.doc,cr(o),st);var s=i.style.cssText,u=t.wrapper.style.cssText,d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; - top: `+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+`px; - z-index: 1000; background: `+(M?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var p;_&&(p=i.ownerDocument.defaultView.scrollY),r.input.focus(),_&&i.ownerDocument.defaultView.scrollTo(null,p),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function m(){if(i.selectionStart!=null){var N=n.somethingSelected(),z="​"+(N?i.value:"");i.value="⇚",i.value=z,t.prevInput=N?"":"​",i.selectionStart=1,i.selectionEnd=z.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,M&&j<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!M||M&&j<9)&&m();var N=0,z=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?rt(n,Ol)(n):N++<10?r.detectingSelectAll=setTimeout(z,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(z,200)}}if(M&&j>=9&&m(),ee){ir(e);var S=function(){ut(window,"mouseup",S),setTimeout(y,20)};J(window,"mouseup",S)}else setTimeout(y,50)},Ye.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ye.prototype.setUneditable=function(){},Ye.prototype.needsContentAttribute=!1;function mu(e,t){if(t=t?de(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=g(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(J(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ut(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=Be(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function bu(e){e.off=ut,e.on=J,e.wheelEventPixels=Ls,e.Doc=xt,e.splitLines=Pt,e.countColumn=he,e.findColumn=Ke,e.isWordChar=R,e.Pass=Ct,e.signal=qe,e.Line=Br,e.changeEnd=dr,e.scrollbarModel=al,e.Pos=k,e.cmpPos=I,e.modes=Er,e.mimeModes=Wt,e.resolveMode=Ir,e.getMode=Fr,e.modeExtensions=ar,e.extendMode=Wr,e.copyState=Ut,e.startState=_r,e.innerMode=sn,e.commands=zn,e.keyMap=er,e.keyName=Xl,e.isModifierKey=Gl,e.lookupKey=$r,e.normalizeKeyMap=Ys,e.StringStream=je,e.SharedTextMarker=Dn,e.TextMarker=pr,e.LineWidget=Nn,e.e_preventDefault=ft,e.e_stopPropagation=zr,e.e_stop=ir,e.addClass=D,e.contains=v,e.rmClass=me,e.keyNames=vr}fu(Be),pu(Be);var xu="iter insert remove copy getEditor constructor".split(" ");for(var vi in xt.prototype)xt.prototype.hasOwnProperty(vi)&&q(xu,vi)<0&&(Be.prototype[vi]=function(e){return function(){return e.apply(this.doc,arguments)}}(xt.prototype[vi]));return Et(xt),Be.inputStyles={textarea:Ye,contenteditable:Pe},Be.defineMode=function(e){!Be.defaults.mode&&e!="null"&&(Be.defaults.mode=e),_t.apply(this,arguments)},Be.defineMIME=br,Be.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Be.defineMIME("text/plain","null"),Be.defineExtension=function(e,t){Be.prototype[e]=t},Be.defineDocExtension=function(e,t){xt.prototype[e]=t},Be.fromTextArea=mu,bu(Be),Be.version="5.65.15",Be})}(ho)),ho.exports}var Su=Ar();const Lu=ku(Su);var pa={exports:{}},va;function xa(){return va||(va=1,function(yr,Or){(function(F){F(Ar())})(function(F){F.defineMode("css",function(ee,X){var me=X.inline;X.propertyKeywords||(X=F.resolveMode("text/css"));var T=ee.indentUnit,H=X.tokenHooks,c=X.documentTypes||{},x=X.mediaTypes||{},b=X.mediaFeatures||{},v=X.mediaValueKeywords||{},g=X.propertyKeywords||{},D=X.nonStandardPropertyKeywords||{},K=X.fontProperties||{},$=X.counterDescriptors||{},pe=X.colorKeywords||{},Re=X.valueKeywords||{},ze=X.allowNested,le=X.lineComment,te=X.supportsAtComponent===!0,de=ee.highlightNonStandardPropertyKeywords!==!1,he,ue;function q(w,A){return he=A,w}function Ve(w,A){var C=w.next();if(H[C]){var be=H[C](w,A);if(be!==!1)return be}if(C=="@")return w.eatWhile(/[\w\\\-]/),q("def",w.current());if(C=="="||(C=="~"||C=="|")&&w.eat("="))return q(null,"compare");if(C=='"'||C=="'")return A.tokenize=Ct(C),A.tokenize(w,A);if(C=="#")return w.eatWhile(/[\w\\\-]/),q("atom","hash");if(C=="!")return w.match(/^\s*\w*/),q("keyword","important");if(/\d/.test(C)||C=="."&&w.eat(/\d/))return w.eatWhile(/[\w.%]/),q("number","unit");if(C==="-"){if(/[\d.]/.test(w.peek()))return w.eatWhile(/[\w.%]/),q("number","unit");if(w.match(/^-[\w\\\-]*/))return w.eatWhile(/[\w\\\-]/),w.match(/^\s*:/,!1)?q("variable-2","variable-definition"):q("variable-2","variable");if(w.match(/^\w+-/))return q("meta","meta")}else return/[,+>*\/]/.test(C)?q(null,"select-op"):C=="."&&w.match(/^-?[_a-z][_a-z0-9-]*/i)?q("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(C)?q(null,C):w.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(w.current())&&(A.tokenize=st),q("variable callee","variable")):/[\w\\\-]/.test(C)?(w.eatWhile(/[\w\\\-]/),q("property","word")):q(null,null)}function Ct(w){return function(A,C){for(var be=!1,R;(R=A.next())!=null;){if(R==w&&!be){w==")"&&A.backUp(1);break}be=!be&&R=="\\"}return(R==w||!be&&w!=")")&&(C.tokenize=null),q("string","string")}}function st(w,A){return w.next(),w.match(/^\s*[\"\')]/,!1)?A.tokenize=null:A.tokenize=Ct(")"),q(null,"(")}function gt(w,A,C){this.type=w,this.indent=A,this.prev=C}function Le(w,A,C,be){return w.context=new gt(C,A.indentation()+(be===!1?0:T),w.context),C}function Ke(w){return w.context.prev&&(w.context=w.context.prev),w.context.type}function lt(w,A,C){return Ne[C.context.type](w,A,C)}function ht(w,A,C,be){for(var R=be||1;R>0;R--)C.context=C.context.prev;return lt(w,A,C)}function re(w){var A=w.current().toLowerCase();Re.hasOwnProperty(A)?ue="atom":pe.hasOwnProperty(A)?ue="keyword":ue="variable"}var Ne={};return Ne.top=function(w,A,C){if(w=="{")return Le(C,A,"block");if(w=="}"&&C.context.prev)return Ke(C);if(te&&/@component/i.test(w))return Le(C,A,"atComponentBlock");if(/^@(-moz-)?document$/i.test(w))return Le(C,A,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(w))return Le(C,A,"atBlock");if(/^@(font-face|counter-style)/i.test(w))return C.stateArg=w,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(w))return"keyframes";if(w&&w.charAt(0)=="@")return Le(C,A,"at");if(w=="hash")ue="builtin";else if(w=="word")ue="tag";else{if(w=="variable-definition")return"maybeprop";if(w=="interpolation")return Le(C,A,"interpolation");if(w==":")return"pseudo";if(ze&&w=="(")return Le(C,A,"parens")}return C.context.type},Ne.block=function(w,A,C){if(w=="word"){var be=A.current().toLowerCase();return g.hasOwnProperty(be)?(ue="property","maybeprop"):D.hasOwnProperty(be)?(ue=de?"string-2":"property","maybeprop"):ze?(ue=A.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(ue+=" error","maybeprop")}else return w=="meta"?"block":!ze&&(w=="hash"||w=="qualifier")?(ue="error","block"):Ne.top(w,A,C)},Ne.maybeprop=function(w,A,C){return w==":"?Le(C,A,"prop"):lt(w,A,C)},Ne.prop=function(w,A,C){if(w==";")return Ke(C);if(w=="{"&&ze)return Le(C,A,"propBlock");if(w=="}"||w=="{")return ht(w,A,C);if(w=="(")return Le(C,A,"parens");if(w=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(A.current()))ue+=" error";else if(w=="word")re(A);else if(w=="interpolation")return Le(C,A,"interpolation");return"prop"},Ne.propBlock=function(w,A,C){return w=="}"?Ke(C):w=="word"?(ue="property","maybeprop"):C.context.type},Ne.parens=function(w,A,C){return w=="{"||w=="}"?ht(w,A,C):w==")"?Ke(C):w=="("?Le(C,A,"parens"):w=="interpolation"?Le(C,A,"interpolation"):(w=="word"&&re(A),"parens")},Ne.pseudo=function(w,A,C){return w=="meta"?"pseudo":w=="word"?(ue="variable-3",C.context.type):lt(w,A,C)},Ne.documentTypes=function(w,A,C){return w=="word"&&c.hasOwnProperty(A.current())?(ue="tag",C.context.type):Ne.atBlock(w,A,C)},Ne.atBlock=function(w,A,C){if(w=="(")return Le(C,A,"atBlock_parens");if(w=="}"||w==";")return ht(w,A,C);if(w=="{")return Ke(C)&&Le(C,A,ze?"block":"top");if(w=="interpolation")return Le(C,A,"interpolation");if(w=="word"){var be=A.current().toLowerCase();be=="only"||be=="not"||be=="and"||be=="or"?ue="keyword":x.hasOwnProperty(be)?ue="attribute":b.hasOwnProperty(be)?ue="property":v.hasOwnProperty(be)?ue="keyword":g.hasOwnProperty(be)?ue="property":D.hasOwnProperty(be)?ue=de?"string-2":"property":Re.hasOwnProperty(be)?ue="atom":pe.hasOwnProperty(be)?ue="keyword":ue="error"}return C.context.type},Ne.atComponentBlock=function(w,A,C){return w=="}"?ht(w,A,C):w=="{"?Ke(C)&&Le(C,A,ze?"block":"top",!1):(w=="word"&&(ue="error"),C.context.type)},Ne.atBlock_parens=function(w,A,C){return w==")"?Ke(C):w=="{"||w=="}"?ht(w,A,C,2):Ne.atBlock(w,A,C)},Ne.restricted_atBlock_before=function(w,A,C){return w=="{"?Le(C,A,"restricted_atBlock"):w=="word"&&C.stateArg=="@counter-style"?(ue="variable","restricted_atBlock_before"):lt(w,A,C)},Ne.restricted_atBlock=function(w,A,C){return w=="}"?(C.stateArg=null,Ke(C)):w=="word"?(C.stateArg=="@font-face"&&!K.hasOwnProperty(A.current().toLowerCase())||C.stateArg=="@counter-style"&&!$.hasOwnProperty(A.current().toLowerCase())?ue="error":ue="property","maybeprop"):"restricted_atBlock"},Ne.keyframes=function(w,A,C){return w=="word"?(ue="variable","keyframes"):w=="{"?Le(C,A,"top"):lt(w,A,C)},Ne.at=function(w,A,C){return w==";"?Ke(C):w=="{"||w=="}"?ht(w,A,C):(w=="word"?ue="tag":w=="hash"&&(ue="builtin"),"at")},Ne.interpolation=function(w,A,C){return w=="}"?Ke(C):w=="{"||w==";"?ht(w,A,C):(w=="word"?ue="variable":w!="variable"&&w!="("&&w!=")"&&(ue="error"),"interpolation")},{startState:function(w){return{tokenize:null,state:me?"block":"top",stateArg:null,context:new gt(me?"block":"top",w||0,null)}},token:function(w,A){if(!A.tokenize&&w.eatSpace())return null;var C=(A.tokenize||Ve)(w,A);return C&&typeof C=="object"&&(he=C[1],C=C[0]),ue=C,he!="comment"&&(A.state=Ne[A.state](he,w,A)),ue},indent:function(w,A){var C=w.context,be=A&&A.charAt(0),R=C.indent;return C.type=="prop"&&(be=="}"||be==")")&&(C=C.prev),C.prev&&(be=="}"&&(C.type=="block"||C.type=="top"||C.type=="interpolation"||C.type=="restricted_atBlock")?(C=C.prev,R=C.indent):(be==")"&&(C.type=="parens"||C.type=="atBlock_parens")||be=="{"&&(C.type=="at"||C.type=="atBlock"))&&(R=Math.max(0,C.indent-T))),R},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:le,fold:"brace"}});function Ee(ee){for(var X={},me=0;me")):null:c.match("--")?b(Te("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),b(Oe(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),x.tokenize=Te("meta","?>"),"meta"):(ie=c.eat("/")?"closeTag":"openTag",x.tokenize=ce,"tag bracket");if(v=="&"){var g;return c.eat("#")?c.eat("x")?g=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):g=c.eatWhile(/[\d]/)&&c.eat(";"):g=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),g?"atom":"error"}else return c.eatWhile(/[^&<]/),null}se.isInText=!0;function ce(c,x){var b=c.next();if(b==">"||b=="/"&&c.eat(">"))return x.tokenize=se,ie=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return ie="equals",null;if(b=="<"){x.tokenize=se,x.state=_e,x.tagName=x.tagStart=null;var v=x.tokenize(c,x);return v?v+" tag error":"tag error"}else return/[\'\"]/.test(b)?(x.tokenize=Ie(b),x.stringStartCol=c.column(),x.tokenize(c,x)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Ie(c){var x=function(b,v){for(;!b.eol();)if(b.next()==c){v.tokenize=ce;break}return"string"};return x.isInAttribute=!0,x}function Te(c,x){return function(b,v){for(;!b.eol();){if(b.match(x)){v.tokenize=se;break}b.next()}return c}}function Oe(c){return function(x,b){for(var v;(v=x.next())!=null;){if(v=="<")return b.tokenize=Oe(c+1),b.tokenize(x,b);if(v==">")if(c==1){b.tokenize=se;break}else return b.tokenize=Oe(c-1),b.tokenize(x,b)}return"meta"}}function ae(c){return c&&c.toLowerCase()}function V(c,x,b){this.prev=c.context,this.tagName=x||"",this.indent=c.indented,this.startOfLine=b,(M.doNotIndent.hasOwnProperty(x)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function oe(c){c.context&&(c.context=c.context.prev)}function xe(c,x){for(var b;;){if(!c.context||(b=c.context.tagName,!M.contextGrabbers.hasOwnProperty(ae(b))||!M.contextGrabbers[ae(b)].hasOwnProperty(ae(x))))return;oe(c)}}function _e(c,x,b){return c=="openTag"?(b.tagStart=x.column(),ye):c=="closeTag"?Me:_e}function ye(c,x,b){return c=="word"?(b.tagName=x.current(),G="tag",X):M.allowMissingTagName&&c=="endTag"?(G="tag bracket",X(c,x,b)):(G="error",ye)}function Me(c,x,b){if(c=="word"){var v=x.current();return b.context&&b.context.tagName!=v&&M.implicitlyClosed.hasOwnProperty(ae(b.context.tagName))&&oe(b),b.context&&b.context.tagName==v||M.matchClosing===!1?(G="tag",He):(G="tag error",ee)}else return M.allowMissingTagName&&c=="endTag"?(G="tag bracket",He(c,x,b)):(G="error",ee)}function He(c,x,b){return c!="endTag"?(G="error",He):(oe(b),_e)}function ee(c,x,b){return G="error",He(c,x,b)}function X(c,x,b){if(c=="word")return G="attribute",me;if(c=="endTag"||c=="selfcloseTag"){var v=b.tagName,g=b.tagStart;return b.tagName=b.tagStart=null,c=="selfcloseTag"||M.autoSelfClosers.hasOwnProperty(ae(v))?xe(b,v):(xe(b,v),b.context=new V(b,v,g==b.indented)),_e}return G="error",X}function me(c,x,b){return c=="equals"?T:(M.allowMissing||(G="error"),X(c,x,b))}function T(c,x,b){return c=="string"?H:c=="word"&&M.allowUnquoted?(G="string",X):(G="error",X(c,x,b))}function H(c,x,b){return c=="string"?H:X(c,x,b)}return{startState:function(c){var x={tokenize:se,state:_e,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(x.baseIndent=c),x},token:function(c,x){if(!x.tagName&&c.sol()&&(x.indented=c.indentation()),c.eatSpace())return null;ie=null;var b=x.tokenize(c,x);return(b||ie)&&b!="comment"&&(G=null,x.state=x.state(ie||b,c,x),G&&(b=G=="error"?b+" error":G)),b},indent:function(c,x,b){var v=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+Ce;if(v&&v.noIndent)return F.Pass;if(c.tokenize!=ce&&c.tokenize!=se)return b?b.match(/^(\s*)/)[0].length:0;if(c.tagName)return M.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+Ce*(M.multilineTagIndentFactor||1);if(M.alignCDATA&&/$/,blockCommentStart:"",configuration:M.htmlMode?"html":"xml",helperType:M.htmlMode?"html":"xml",skipAttribute:function(c){c.state==T&&(c.state=X)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var x=[],b=c.context;b;b=b.prev)x.push(b.tagName);return x.reverse()}}}),F.defineMIME("text/xml","xml"),F.defineMIME("application/xml","xml"),F.mimeModes.hasOwnProperty("text/html")||F.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),ga.exports}var ma={exports:{}},ba;function wa(){return ba||(ba=1,function(yr,Or){(function(F){F(Ar())})(function(F){F.defineMode("javascript",function(Ee,Se){var We=Ee.indentUnit,Qe=Se.statementIndent,Ce=Se.jsonld,M=Se.json||Ce,j=Se.trackScope!==!1,_=Se.typescript,ie=Se.wordCharacters||/[\w$\xa1-\uffff]/,G=function(){function f(et){return{type:et,style:"keyword"}}var h=f("keyword a"),L=f("keyword b"),O=f("keyword c"),k=f("keyword d"),I=f("operator"),De={type:"atom",style:"atom"};return{if:f("if"),while:h,with:h,else:L,do:L,try:L,finally:L,return:k,break:k,continue:k,new:f("new"),delete:O,void:O,throw:O,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:I,typeof:I,instanceof:I,true:De,false:De,null:De,undefined:De,NaN:De,Infinity:De,this:f("this"),class:f("class"),super:f("atom"),yield:O,export:f("export"),import:f("import"),extends:O,await:O}}(),se=/[+\-*&%=<>!?|~^@]/,ce=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function Ie(f){for(var h=!1,L,O=!1;(L=f.next())!=null;){if(!h){if(L=="/"&&!O)return;L=="["?O=!0:O&&L=="]"&&(O=!1)}h=!h&&L=="\\"}}var Te,Oe;function ae(f,h,L){return Te=f,Oe=L,h}function V(f,h){var L=f.next();if(L=='"'||L=="'")return h.tokenize=oe(L),h.tokenize(f,h);if(L=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return ae("number","number");if(L=="."&&f.match(".."))return ae("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(L))return ae(L);if(L=="="&&f.eat(">"))return ae("=>","operator");if(L=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return ae("number","number");if(/\d/.test(L))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),ae("number","number");if(L=="/")return f.eat("*")?(h.tokenize=xe,xe(f,h)):f.eat("/")?(f.skipToEnd(),ae("comment","comment")):Dt(f,h,1)?(Ie(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),ae("regexp","string-2")):(f.eat("="),ae("operator","operator",f.current()));if(L=="`")return h.tokenize=_e,_e(f,h);if(L=="#"&&f.peek()=="!")return f.skipToEnd(),ae("meta","meta");if(L=="#"&&f.eatWhile(ie))return ae("variable","property");if(L=="<"&&f.match("!--")||L=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),ae("comment","comment");if(se.test(L))return(L!=">"||!h.lexical||h.lexical.type!=">")&&(f.eat("=")?(L=="!"||L=="=")&&f.eat("="):/[<>*+\-|&?]/.test(L)&&(f.eat(L),L==">"&&f.eat(L))),L=="?"&&f.eat(".")?ae("."):ae("operator","operator",f.current());if(ie.test(L)){f.eatWhile(ie);var O=f.current();if(h.lastType!="."){if(G.propertyIsEnumerable(O)){var k=G[O];return ae(k.type,k.style,O)}if(O=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return ae("async","keyword",O)}return ae("variable","variable",O)}}function oe(f){return function(h,L){var O=!1,k;if(Ce&&h.peek()=="@"&&h.match(ce))return L.tokenize=V,ae("jsonld-keyword","meta");for(;(k=h.next())!=null&&!(k==f&&!O);)O=!O&&k=="\\";return O||(L.tokenize=V),ae("string","string")}}function xe(f,h){for(var L=!1,O;O=f.next();){if(O=="/"&&L){h.tokenize=V;break}L=O=="*"}return ae("comment","comment")}function _e(f,h){for(var L=!1,O;(O=f.next())!=null;){if(!L&&(O=="`"||O=="$"&&f.eat("{"))){h.tokenize=V;break}L=!L&&O=="\\"}return ae("quasi","string-2",f.current())}var ye="([{}])";function Me(f,h){h.fatArrowAt&&(h.fatArrowAt=null);var L=f.string.indexOf("=>",f.start);if(!(L<0)){if(_){var O=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,L));O&&(L=O.index)}for(var k=0,I=!1,De=L-1;De>=0;--De){var et=f.string.charAt(De),mt=ye.indexOf(et);if(mt>=0&&mt<3){if(!k){++De;break}if(--k==0){et=="("&&(I=!0);break}}else if(mt>=3&&mt<6)++k;else if(ie.test(et))I=!0;else if(/["'\/`]/.test(et))for(;;--De){if(De==0)return;var Hr=f.string.charAt(De-1);if(Hr==et&&f.string.charAt(De-2)!="\\"){De--;break}}else if(I&&!k){++De;break}}I&&!k&&(h.fatArrowAt=De)}}var He={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ee(f,h,L,O,k,I){this.indented=f,this.column=h,this.type=L,this.prev=k,this.info=I,O!=null&&(this.align=O)}function X(f,h){if(!j)return!1;for(var L=f.localVars;L;L=L.next)if(L.name==h)return!0;for(var O=f.context;O;O=O.prev)for(var L=O.vars;L;L=L.next)if(L.name==h)return!0}function me(f,h,L,O,k){var I=f.cc;for(T.state=f,T.stream=k,T.marked=null,T.cc=I,T.style=h,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var De=I.length?I.pop():M?q:he;if(De(L,O)){for(;I.length&&I[I.length-1].lex;)I.pop()();return T.marked?T.marked:L=="variable"&&X(f,O)?"variable-2":h}}}var T={state:null,column:null,marked:null,cc:null};function H(){for(var f=arguments.length-1;f>=0;f--)T.cc.push(arguments[f])}function c(){return H.apply(null,arguments),!0}function x(f,h){for(var L=h;L;L=L.next)if(L.name==f)return!0;return!1}function b(f){var h=T.state;if(T.marked="def",!!j){if(h.context){if(h.lexical.info=="var"&&h.context&&h.context.block){var L=v(f,h.context);if(L!=null){h.context=L;return}}else if(!x(f,h.localVars)){h.localVars=new K(f,h.localVars);return}}Se.globalVars&&!x(f,h.globalVars)&&(h.globalVars=new K(f,h.globalVars))}}function v(f,h){if(h)if(h.block){var L=v(f,h.prev);return L?L==h.prev?h:new D(L,h.vars,!0):null}else return x(f,h.vars)?h:new D(h.prev,new K(f,h.vars),!1);else return null}function g(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function D(f,h,L){this.prev=f,this.vars=h,this.block=L}function K(f,h){this.name=f,this.next=h}var $=new K("this",new K("arguments",null));function pe(){T.state.context=new D(T.state.context,T.state.localVars,!1),T.state.localVars=$}function Re(){T.state.context=new D(T.state.context,T.state.localVars,!0),T.state.localVars=null}pe.lex=Re.lex=!0;function ze(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}ze.lex=!0;function le(f,h){var L=function(){var O=T.state,k=O.indented;if(O.lexical.type=="stat")k=O.lexical.indented;else for(var I=O.lexical;I&&I.type==")"&&I.align;I=I.prev)k=I.indented;O.lexical=new ee(k,T.stream.column(),f,null,O.lexical,h)};return L.lex=!0,L}function te(){var f=T.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}te.lex=!0;function de(f){function h(L){return L==f?c():f==";"||L=="}"||L==")"||L=="]"?H():c(h)}return h}function he(f,h){return f=="var"?c(le("vardef",h),zr,de(";"),te):f=="keyword a"?c(le("form"),Ct,he,te):f=="keyword b"?c(le("form"),he,te):f=="keyword d"?T.stream.match(/^\s*$/,!1)?c():c(le("stat"),gt,de(";"),te):f=="debugger"?c(de(";")):f=="{"?c(le("}"),Re,Ot,te,ze):f==";"?c():f=="if"?(T.state.lexical.info=="else"&&T.state.cc[T.state.cc.length-1]==te&&T.state.cc.pop()(),c(le("form"),Ct,he,te,Pr)):f=="function"?c(Pt):f=="for"?c(le("form"),Re,_n,he,ze,te):f=="class"||_&&h=="interface"?(T.marked="keyword",c(le("form",f=="class"?f:h),Er,te)):f=="variable"?_&&h=="declare"?(T.marked="keyword",c(he)):_&&(h=="module"||h=="enum"||h=="type")&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword",h=="enum"?c(U):h=="type"?c(Hn,de("operator"),ke,de(";")):c(le("form"),yt,de("{"),le("}"),Ot,te,te)):_&&h=="namespace"?(T.marked="keyword",c(le("form"),q,he,te)):_&&h=="abstract"?(T.marked="keyword",c(he)):c(le("stat"),be):f=="switch"?c(le("form"),Ct,de("{"),le("}","switch"),Re,Ot,te,te,ze):f=="case"?c(q,de(":")):f=="default"?c(de(":")):f=="catch"?c(le("form"),pe,ue,he,te,ze):f=="export"?c(le("stat"),Ir,te):f=="import"?c(le("stat"),ar,te):f=="async"?c(he):h=="@"?c(q,he):H(le("stat"),q,de(";"),te)}function ue(f){if(f=="(")return c(Ft,de(")"))}function q(f,h){return st(f,h,!1)}function Ve(f,h){return st(f,h,!0)}function Ct(f){return f!="("?H():c(le(")"),gt,de(")"),te)}function st(f,h,L){if(T.state.fatArrowAt==T.stream.start){var O=L?Ne:re;if(f=="(")return c(pe,le(")"),ve(Ft,")"),te,de("=>"),O,ze);if(f=="variable")return H(pe,yt,de("=>"),O,ze)}var k=L?Ke:Le;return He.hasOwnProperty(f)?c(k):f=="function"?c(Pt,k):f=="class"||_&&h=="interface"?(T.marked="keyword",c(le("form"),mi,te)):f=="keyword c"||f=="async"?c(L?Ve:q):f=="("?c(le(")"),gt,de(")"),te,k):f=="operator"||f=="spread"?c(L?Ve:q):f=="["?c(le("]"),je,te,k):f=="{"?Tt(ne,"}",null,k):f=="quasi"?H(lt,k):f=="new"?c(w(L)):c()}function gt(f){return f.match(/[;\}\)\],]/)?H():H(q)}function Le(f,h){return f==","?c(gt):Ke(f,h,!1)}function Ke(f,h,L){var O=L==!1?Le:Ke,k=L==!1?q:Ve;if(f=="=>")return c(pe,L?Ne:re,ze);if(f=="operator")return/\+\+|--/.test(h)||_&&h=="!"?c(O):_&&h=="<"&&T.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(le(">"),ve(ke,">"),te,O):h=="?"?c(q,de(":"),k):c(k);if(f=="quasi")return H(lt,O);if(f!=";"){if(f=="(")return Tt(Ve,")","call",O);if(f==".")return c(R,O);if(f=="[")return c(le("]"),gt,de("]"),te,O);if(_&&h=="as")return T.marked="keyword",c(ke,O);if(f=="regexp")return T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),c(k)}}function lt(f,h){return f!="quasi"?H():h.slice(h.length-2)!="${"?c(lt):c(gt,ht)}function ht(f){if(f=="}")return T.marked="string-2",T.state.tokenize=_e,c(lt)}function re(f){return Me(T.stream,T.state),H(f=="{"?he:q)}function Ne(f){return Me(T.stream,T.state),H(f=="{"?he:Ve)}function w(f){return function(h){return h=="."?c(f?C:A):h=="variable"&&_?c(Lt,f?Ke:Le):H(f?Ve:q)}}function A(f,h){if(h=="target")return T.marked="keyword",c(Le)}function C(f,h){if(h=="target")return T.marked="keyword",c(Ke)}function be(f){return f==":"?c(te,he):H(Le,de(";"),te)}function R(f){if(f=="variable")return T.marked="property",c()}function ne(f,h){if(f=="async")return T.marked="property",c(ne);if(f=="variable"||T.style=="keyword"){if(T.marked="property",h=="get"||h=="set")return c(Y);var L;return _&&T.state.fatArrowAt==T.stream.start&&(L=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+L[0].length),c(we)}else{if(f=="number"||f=="string")return T.marked=Ce?"property":T.style+" property",c(we);if(f=="jsonld-keyword")return c(we);if(_&&g(h))return T.marked="keyword",c(ne);if(f=="[")return c(q,rr,de("]"),we);if(f=="spread")return c(Ve,we);if(h=="*")return T.marked="keyword",c(ne);if(f==":")return H(we)}}function Y(f){return f!="variable"?H(we):(T.marked="property",c(Pt))}function we(f){if(f==":")return c(Ve);if(f=="(")return H(Pt)}function ve(f,h,L){function O(k,I){if(L?L.indexOf(k)>-1:k==","){var De=T.state.lexical;return De.info=="call"&&(De.pos=(De.pos||0)+1),c(function(et,mt){return et==h||mt==h?H():H(f)},O)}return k==h||I==h?c():L&&L.indexOf(";")>-1?H(f):c(de(h))}return function(k,I){return k==h||I==h?c():H(f,O)}}function Tt(f,h,L){for(var O=3;O"),ke);if(f=="quasi")return H(ut,zt)}function Wn(f){if(f=="=>")return c(ke)}function J(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(J):H(Yt,J)}function Yt(f,h){if(f=="variable"||T.style=="keyword")return T.marked="property",c(Yt);if(h=="?"||f=="number"||f=="string")return c(Yt);if(f==":")return c(ke);if(f=="[")return c(de("variable"),mr,de("]"),Yt);if(f=="(")return H(lr,Yt);if(!f.match(/[;\}\)\],]/))return c()}function ut(f,h){return f!="quasi"?H():h.slice(h.length-2)!="${"?c(ut):c(ke,qe)}function qe(f){if(f=="}")return T.marked="string-2",T.state.tokenize=_e,c(ut)}function Ge(f,h){return f=="variable"&&T.stream.match(/^\s*[?:]/,!1)||h=="?"?c(Ge):f==":"?c(ke):f=="spread"?c(Ge):H(ke)}function zt(f,h){if(h=="<")return c(le(">"),ve(ke,">"),te,zt);if(h=="|"||f=="."||h=="&")return c(ke);if(f=="[")return c(ke,de("]"),zt);if(h=="extends"||h=="implements")return T.marked="keyword",c(ke);if(h=="?")return c(ke,de(":"),ke)}function Lt(f,h){if(h=="<")return c(le(">"),ve(ke,">"),te,zt)}function Et(){return H(ke,ft)}function ft(f,h){if(h=="=")return c(ke)}function zr(f,h){return h=="enum"?(T.marked="keyword",c(U)):H(yt,rr,It,yi)}function yt(f,h){if(_&&g(h))return T.marked="keyword",c(yt);if(f=="variable")return b(h),c();if(f=="spread")return c(yt);if(f=="[")return Tt(ln,"]");if(f=="{")return Tt(ir,"}")}function ir(f,h){return f=="variable"&&!T.stream.match(/^\s*:/,!1)?(b(h),c(It)):(f=="variable"&&(T.marked="property"),f=="spread"?c(yt):f=="}"?H():f=="["?c(q,de("]"),de(":"),ir):c(de(":"),yt,It))}function ln(){return H(yt,It)}function It(f,h){if(h=="=")return c(Ve)}function yi(f){if(f==",")return c(zr)}function Pr(f,h){if(f=="keyword b"&&h=="else")return c(le("form","else"),he,te)}function _n(f,h){if(h=="await")return c(_n);if(f=="(")return c(le(")"),an,te)}function an(f){return f=="var"?c(zr,or):f=="variable"?c(or):H(or)}function or(f,h){return f==")"?c():f==";"?c(or):h=="in"||h=="of"?(T.marked="keyword",c(q,or)):H(q,or)}function Pt(f,h){if(h=="*")return T.marked="keyword",c(Pt);if(f=="variable")return b(h),c(Pt);if(f=="(")return c(pe,le(")"),ve(Ft,")"),te,nr,he,ze);if(_&&h=="<")return c(le(">"),ve(Et,">"),te,Pt)}function lr(f,h){if(h=="*")return T.marked="keyword",c(lr);if(f=="variable")return b(h),c(lr);if(f=="(")return c(pe,le(")"),ve(Ft,")"),te,nr,ze);if(_&&h=="<")return c(le(">"),ve(Et,">"),te,lr)}function Hn(f,h){if(f=="keyword"||f=="variable")return T.marked="type",c(Hn);if(h=="<")return c(le(">"),ve(Et,">"),te)}function Ft(f,h){return h=="@"&&c(q,Ft),f=="spread"?c(Ft):_&&g(h)?(T.marked="keyword",c(Ft)):_&&f=="this"?c(rr,It):H(yt,rr,It)}function mi(f,h){return f=="variable"?Er(f,h):Wt(f,h)}function Er(f,h){if(f=="variable")return b(h),c(Wt)}function Wt(f,h){if(h=="<")return c(le(">"),ve(Et,">"),te,Wt);if(h=="extends"||h=="implements"||_&&f==",")return h=="implements"&&(T.marked="keyword"),c(_?ke:q,Wt);if(f=="{")return c(le("}"),_t,te)}function _t(f,h){if(f=="async"||f=="variable"&&(h=="static"||h=="get"||h=="set"||_&&g(h))&&T.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return T.marked="keyword",c(_t);if(f=="variable"||T.style=="keyword")return T.marked="property",c(br,_t);if(f=="number"||f=="string")return c(br,_t);if(f=="[")return c(q,rr,de("]"),br,_t);if(h=="*")return T.marked="keyword",c(_t);if(_&&f=="(")return H(lr,_t);if(f==";"||f==",")return c(_t);if(f=="}")return c();if(h=="@")return c(q,_t)}function br(f,h){if(h=="!"||h=="?")return c(br);if(f==":")return c(ke,It);if(h=="=")return c(Ve);var L=T.state.lexical.prev,O=L&&L.info=="interface";return H(O?lr:Pt)}function Ir(f,h){return h=="*"?(T.marked="keyword",c(_r,de(";"))):h=="default"?(T.marked="keyword",c(q,de(";"))):f=="{"?c(ve(Fr,"}"),_r,de(";")):H(he)}function Fr(f,h){if(h=="as")return T.marked="keyword",c(de("variable"));if(f=="variable")return H(Ve,Fr)}function ar(f){return f=="string"?c():f=="("?H(q):f=="."?H(Le):H(Wr,Ut,_r)}function Wr(f,h){return f=="{"?Tt(Wr,"}"):(f=="variable"&&b(h),h=="*"&&(T.marked="keyword"),c(sn))}function Ut(f){if(f==",")return c(Wr,Ut)}function sn(f,h){if(h=="as")return T.marked="keyword",c(Wr)}function _r(f,h){if(h=="from")return T.marked="keyword",c(q)}function je(f){return f=="]"?c():H(ve(Ve,"]"))}function U(){return H(le("form"),yt,de("{"),le("}"),ve(Zt,"}"),te,te)}function Zt(){return H(yt,It)}function un(f,h){return f.lastType=="operator"||f.lastType==","||se.test(h.charAt(0))||/[,.]/.test(h.charAt(0))}function Dt(f,h,L){return h.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(h.lastType)||h.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(L||0)))}return{startState:function(f){var h={tokenize:V,lastType:"sof",cc:[],lexical:new ee((f||0)-We,0,"block",!1),localVars:Se.localVars,context:Se.localVars&&new D(null,null,!1),indented:f||0};return Se.globalVars&&typeof Se.globalVars=="object"&&(h.globalVars=Se.globalVars),h},token:function(f,h){if(f.sol()&&(h.lexical.hasOwnProperty("align")||(h.lexical.align=!1),h.indented=f.indentation(),Me(f,h)),h.tokenize!=xe&&f.eatSpace())return null;var L=h.tokenize(f,h);return Te=="comment"?L:(h.lastType=Te=="operator"&&(Oe=="++"||Oe=="--")?"incdec":Te,me(h,L,Te,Oe,f))},indent:function(f,h){if(f.tokenize==xe||f.tokenize==_e)return F.Pass;if(f.tokenize!=V)return 0;var L=h&&h.charAt(0),O=f.lexical,k;if(!/^\s*else\b/.test(h))for(var I=f.cc.length-1;I>=0;--I){var De=f.cc[I];if(De==te)O=O.prev;else if(De!=Pr&&De!=ze)break}for(;(O.type=="stat"||O.type=="form")&&(L=="}"||(k=f.cc[f.cc.length-1])&&(k==Le||k==Ke)&&!/^[,\.=+\-*:?[\(]/.test(h));)O=O.prev;Qe&&O.type==")"&&O.prev.type=="stat"&&(O=O.prev);var et=O.type,mt=L==et;return et=="vardef"?O.indented+(f.lastType=="operator"||f.lastType==","?O.info.length+1:0):et=="form"&&L=="{"?O.indented:et=="form"?O.indented+We:et=="stat"?O.indented+(un(f,h)?Qe||We:0):O.info=="switch"&&!mt&&Se.doubleIndentSwitch!=!1?O.indented+(/^(?:case|default)\b/.test(h)?We:2*We):O.align?O.column+(mt?0:1):O.indented+(mt?0:We)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:M?null:"/*",blockCommentEnd:M?null:"*/",blockCommentContinue:M?null:" * ",lineComment:M?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:M?"json":"javascript",jsonldMode:Ce,jsonMode:M,expressionAllowed:Dt,skipExpression:function(f){me(f,"atom","atom","true",new F.StringStream("",2,null))}}}),F.registerHelper("wordChars","javascript",/[\w$]/),F.defineMIME("text/javascript","javascript"),F.defineMIME("text/ecmascript","javascript"),F.defineMIME("application/javascript","javascript"),F.defineMIME("application/x-javascript","javascript"),F.defineMIME("application/ecmascript","javascript"),F.defineMIME("application/json",{name:"javascript",json:!0}),F.defineMIME("application/x-json",{name:"javascript",json:!0}),F.defineMIME("application/manifest+json",{name:"javascript",json:!0}),F.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),F.defineMIME("text/typescript",{name:"javascript",typescript:!0}),F.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}()),ma.exports}(function(yr,Or){(function(F){F(Ar(),Cu(),wa(),xa())})(function(F){var Ee={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function Se(ie,G,se){var ce=ie.current(),Ie=ce.search(G);return Ie>-1?ie.backUp(ce.length-Ie):ce.match(/<\/?$/)&&(ie.backUp(ce.length),ie.match(G,!1)||ie.match(ce)),se}var We={};function Qe(ie){var G=We[ie];return G||(We[ie]=new RegExp("\\s+"+ie+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function Ce(ie,G){var se=ie.match(Qe(G));return se?/^\s*(.*?)\s*$/.exec(se[2])[1]:""}function M(ie,G){return new RegExp((G?"^":"")+"","i")}function j(ie,G){for(var se in ie)for(var ce=G[se]||(G[se]=[]),Ie=ie[se],Te=Ie.length-1;Te>=0;Te--)ce.unshift(Ie[Te])}function _(ie,G){for(var se=0;se=0;Oe--)ce.script.unshift(["type",Te[Oe].matches,Te[Oe].mode]);function ae(V,oe){var xe=se.token(V,oe.htmlState),_e=/\btag\b/.test(xe),ye;if(_e&&!/[<>\s\/]/.test(V.current())&&(ye=oe.htmlState.tagName&&oe.htmlState.tagName.toLowerCase())&&ce.hasOwnProperty(ye))oe.inTag=ye+" ";else if(oe.inTag&&_e&&/>$/.test(V.current())){var Me=/^([\S]+) (.*)/.exec(oe.inTag);oe.inTag=null;var He=V.current()==">"&&_(ce[Me[1]],Me[2]),ee=F.getMode(ie,He),X=M(Me[1],!0),me=M(Me[1],!1);oe.token=function(T,H){return T.match(X,!1)?(H.token=ae,H.localState=H.localMode=null,null):Se(T,me,H.localMode.token(T,H.localState))},oe.localMode=ee,oe.localState=F.startState(ee,se.indent(oe.htmlState,"",""))}else oe.inTag&&(oe.inTag+=V.current(),V.eol()&&(oe.inTag+=" "));return xe}return{startState:function(){var V=F.startState(se);return{token:ae,inTag:null,localMode:null,localState:null,htmlState:V}},copyState:function(V){var oe;return V.localState&&(oe=F.copyState(V.localMode,V.localState)),{token:V.token,inTag:V.inTag,localMode:V.localMode,localState:oe,htmlState:F.copyState(se,V.htmlState)}},token:function(V,oe){return oe.token(V,oe)},indent:function(V,oe,xe){return!V.localMode||/^\s*<\//.test(oe)?se.indent(V.htmlState,oe,xe):V.localMode.indent?V.localMode.indent(V.localState,oe,xe):F.Pass},innerMode:function(V){return{state:V.localState||V.htmlState,mode:V.localMode||se}}}},"xml","javascript","css"),F.defineMIME("text/html","htmlmixed")})})();wa();(function(yr,Or){(function(F){F(Ar())})(function(F){function Ee(j){return new RegExp("^(("+j.join(")|(")+"))\\b")}var Se=Ee(["and","or","not","is"]),We=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],Qe=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];F.registerHelper("hintWords","python",We.concat(Qe).concat(["exec","print"]));function Ce(j){return j.scopes[j.scopes.length-1]}F.defineMode("python",function(j,_){for(var ie="error",G=_.delimiters||_.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,se=[_.singleOperators,_.doubleOperators,_.doubleDelimiters,_.tripleDelimiters,_.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],ce=0;ceg?X(b):D0&&T(x,b)&&(K+=" "+ie),K}}return Me(x,b)}function Me(x,b,v){if(x.eatSpace())return null;if(!v&&x.match(/^#.*/))return"comment";if(x.match(/^[0-9\.]/,!1)){var g=!1;if(x.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(g=!0),x.match(/^[\d_]+\.\d*/)&&(g=!0),x.match(/^\.\d+/)&&(g=!0),g)return x.eat(/J/i),"number";var D=!1;if(x.match(/^0x[0-9a-f_]+/i)&&(D=!0),x.match(/^0b[01_]+/i)&&(D=!0),x.match(/^0o[0-7_]+/i)&&(D=!0),x.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(x.eat(/J/i),D=!0),x.match(/^0(?![\dx])/i)&&(D=!0),D)return x.eat(/L/i),"number"}if(x.match(oe)){var K=x.current().toLowerCase().indexOf("f")!==-1;return K?(b.tokenize=He(x.current(),b.tokenize),b.tokenize(x,b)):(b.tokenize=ee(x.current(),b.tokenize),b.tokenize(x,b))}for(var $=0;$=0;)x=x.substr(1);var v=x.length==1,g="string";function D($){return function(pe,Re){var ze=Me(pe,Re,!0);return ze=="punctuation"&&(pe.current()=="{"?Re.tokenize=D($+1):pe.current()=="}"&&($>1?Re.tokenize=D($-1):Re.tokenize=K)),ze}}function K($,pe){for(;!$.eol();)if($.eatWhile(/[^'"\{\}\\]/),$.eat("\\")){if($.next(),v&&$.eol())return g}else{if($.match(x))return pe.tokenize=b,g;if($.match("{{"))return g;if($.match("{",!1))return pe.tokenize=D(0),$.current()?g:pe.tokenize($,pe);if($.match("}}"))return g;if($.match("}"))return ie;$.eat(/['"]/)}if(v){if(_.singleLineStringErrors)return ie;pe.tokenize=b}return g}return K.isString=!0,K}function ee(x,b){for(;"rubf".indexOf(x.charAt(0).toLowerCase())>=0;)x=x.substr(1);var v=x.length==1,g="string";function D(K,$){for(;!K.eol();)if(K.eatWhile(/[^'"\\]/),K.eat("\\")){if(K.next(),v&&K.eol())return g}else{if(K.match(x))return $.tokenize=b,g;K.eat(/['"]/)}if(v){if(_.singleLineStringErrors)return ie;$.tokenize=b}return g}return D.isString=!0,D}function X(x){for(;Ce(x).type!="py";)x.scopes.pop();x.scopes.push({offset:Ce(x).offset+j.indentUnit,type:"py",align:null})}function me(x,b,v){var g=x.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:x.column()+1;b.scopes.push({offset:b.indent+Ie,type:v,align:g})}function T(x,b){for(var v=x.indentation();b.scopes.length>1&&Ce(b).offset>v;){if(Ce(b).type!="py")return!0;b.scopes.pop()}return Ce(b).offset!=v}function H(x,b){x.sol()&&(b.beginningOfLine=!0,b.dedent=!1);var v=b.tokenize(x,b),g=x.current();if(b.beginningOfLine&&g=="@")return x.match(V,!1)?"meta":ae?"operator":ie;if(/\S/.test(g)&&(b.beginningOfLine=!1),(v=="variable"||v=="builtin")&&b.lastToken=="meta"&&(v="meta"),(g=="pass"||g=="return")&&(b.dedent=!0),g=="lambda"&&(b.lambda=!0),g==":"&&!b.lambda&&Ce(b).type=="py"&&x.match(/^\s*(?:#|$)/,!1)&&X(b),g.length==1&&!/string|comment/.test(v)){var D="[({".indexOf(g);if(D!=-1&&me(x,b,"])}".slice(D,D+1)),D="])}".indexOf(g),D!=-1)if(Ce(b).type==g)b.indent=b.scopes.pop().offset-Ie;else return ie}return b.dedent&&x.eol()&&Ce(b).type=="py"&&b.scopes.length>1&&b.scopes.pop(),v}var c={startState:function(x){return{tokenize:ye,scopes:[{offset:x||0,type:"py",align:null}],indent:x||0,lastToken:null,lambda:!1,dedent:0}},token:function(x,b){var v=b.errorToken;v&&(b.errorToken=!1);var g=H(x,b);return g&&g!="comment"&&(b.lastToken=g=="keyword"||g=="punctuation"?x.current():g),g=="punctuation"&&(g=null),x.eol()&&b.lambda&&(b.lambda=!1),v?g+" "+ie:g},indent:function(x,b){if(x.tokenize!=ye)return x.tokenize.isString?F.Pass:0;var v=Ce(x),g=v.type==b.charAt(0)||v.type=="py"&&!x.dedent&&/^(else:|elif |except |finally:)/.test(b);return v.align!=null?v.align-(g?1:0):v.offset-(g?Ie:0)},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:`'"`},lineComment:"#",fold:"indent"};return c}),F.defineMIME("text/x-python","python");var M=function(j){return j.split(" ")};F.defineMIME("text/x-cython",{name:"python",extra_keywords:M("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})})})();(function(yr,Or){(function(F){F(Ar())})(function(F){function Ee(v,g,D,K,$,pe){this.indented=v,this.column=g,this.type=D,this.info=K,this.align=$,this.prev=pe}function Se(v,g,D,K){var $=v.indented;return v.context&&v.context.type=="statement"&&D!="statement"&&($=v.context.indented),v.context=new Ee($,g,D,K,null,v.context)}function We(v){var g=v.context.type;return(g==")"||g=="]"||g=="}")&&(v.indented=v.context.indented),v.context=v.context.prev}function Qe(v,g,D){if(g.prevToken=="variable"||g.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(v.string.slice(0,D))||g.typeAtEndOfLine&&v.column()==v.indentation())return!0}function Ce(v){for(;;){if(!v||v.type=="top")return!0;if(v.type=="}"&&v.prev.info!="namespace")return!1;v=v.prev}}F.defineMode("clike",function(v,g){var D=v.indentUnit,K=g.statementIndentUnit||D,$=g.dontAlignCalls,pe=g.keywords||{},Re=g.types||{},ze=g.builtin||{},le=g.blockKeywords||{},te=g.defKeywords||{},de=g.atoms||{},he=g.hooks||{},ue=g.multiLineStrings,q=g.indentStatements!==!1,Ve=g.indentSwitch!==!1,Ct=g.namespaceSeparator,st=g.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,gt=g.numberStart||/[\d\.]/,Le=g.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,Ke=g.isOperatorChar||/[+\-*&%=<>!?|\/]/,lt=g.isIdentifierChar||/[\w\$_\xa1-\uffff]/,ht=g.isReservedIdentifier||!1,re,Ne;function w(R,ne){var Y=R.next();if(he[Y]){var we=he[Y](R,ne);if(we!==!1)return we}if(Y=='"'||Y=="'")return ne.tokenize=A(Y),ne.tokenize(R,ne);if(gt.test(Y)){if(R.backUp(1),R.match(Le))return"number";R.next()}if(st.test(Y))return re=Y,null;if(Y=="/"){if(R.eat("*"))return ne.tokenize=C,C(R,ne);if(R.eat("/"))return R.skipToEnd(),"comment"}if(Ke.test(Y)){for(;!R.match(/^\/[\/*]/,!1)&&R.eat(Ke););return"operator"}if(R.eatWhile(lt),Ct)for(;R.match(Ct);)R.eatWhile(lt);var ve=R.current();return j(pe,ve)?(j(le,ve)&&(re="newstatement"),j(te,ve)&&(Ne=!0),"keyword"):j(Re,ve)?"type":j(ze,ve)||ht&&ht(ve)?(j(le,ve)&&(re="newstatement"),"builtin"):j(de,ve)?"atom":"variable"}function A(R){return function(ne,Y){for(var we=!1,ve,Tt=!1;(ve=ne.next())!=null;){if(ve==R&&!we){Tt=!0;break}we=!we&&ve=="\\"}return(Tt||!(we||ue))&&(Y.tokenize=null),"string"}}function C(R,ne){for(var Y=!1,we;we=R.next();){if(we=="/"&&Y){ne.tokenize=null;break}Y=we=="*"}return"comment"}function be(R,ne){g.typeFirstDefinitions&&R.eol()&&Ce(ne.context)&&(ne.typeAtEndOfLine=Qe(R,ne,R.pos))}return{startState:function(R){return{tokenize:null,context:new Ee((R||0)-D,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(R,ne){var Y=ne.context;if(R.sol()&&(Y.align==null&&(Y.align=!1),ne.indented=R.indentation(),ne.startOfLine=!0),R.eatSpace())return be(R,ne),null;re=Ne=null;var we=(ne.tokenize||w)(R,ne);if(we=="comment"||we=="meta")return we;if(Y.align==null&&(Y.align=!0),re==";"||re==":"||re==","&&R.match(/^\s*(?:\/\/.*)?$/,!1))for(;ne.context.type=="statement";)We(ne);else if(re=="{")Se(ne,R.column(),"}");else if(re=="[")Se(ne,R.column(),"]");else if(re=="(")Se(ne,R.column(),")");else if(re=="}"){for(;Y.type=="statement";)Y=We(ne);for(Y.type=="}"&&(Y=We(ne));Y.type=="statement";)Y=We(ne)}else re==Y.type?We(ne):q&&((Y.type=="}"||Y.type=="top")&&re!=";"||Y.type=="statement"&&re=="newstatement")&&Se(ne,R.column(),"statement",R.current());if(we=="variable"&&(ne.prevToken=="def"||g.typeFirstDefinitions&&Qe(R,ne,R.start)&&Ce(ne.context)&&R.match(/^\s*\(/,!1))&&(we="def"),he.token){var ve=he.token(R,ne,we);ve!==void 0&&(we=ve)}return we=="def"&&g.styleDefs===!1&&(we="variable"),ne.startOfLine=!1,ne.prevToken=Ne?"def":we||re,be(R,ne),we},indent:function(R,ne){if(R.tokenize!=w&&R.tokenize!=null||R.typeAtEndOfLine&&Ce(R.context))return F.Pass;var Y=R.context,we=ne&&ne.charAt(0),ve=we==Y.type;if(Y.type=="statement"&&we=="}"&&(Y=Y.prev),g.dontIndentStatements)for(;Y.type=="statement"&&g.dontIndentStatements.test(Y.info);)Y=Y.prev;if(he.indent){var Tt=he.indent(R,Y,ne,D);if(typeof Tt=="number")return Tt}var Ot=Y.prev&&Y.prev.info=="switch";if(g.allmanIndentation&&/[{(]/.test(we)){for(;Y.type!="top"&&Y.type!="}";)Y=Y.prev;return Y.indented}return Y.type=="statement"?Y.indented+(we=="{"?0:K):Y.align&&(!$||Y.type!=")")?Y.column+(ve?0:1):Y.type==")"&&!ve?Y.indented+K:Y.indented+(ve?0:D)+(!ve&&Ot&&!/^(?:case|default)\b/.test(ne)?D:0)},electricInput:Ve?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function M(v){for(var g={},D=v.split(" "),K=0;K!?|\/#:@]/,hooks:{"@":function(v){return v.eatWhile(/[\w\$_]/),"meta"},'"':function(v,g){return v.match('""')?(g.tokenize=T,g.tokenize(v,g)):!1},"'":function(v){return v.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(v.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(v,g){var D=g.context;return D.type=="}"&&D.align&&v.eat(">")?(g.context=new Ee(D.indented,D.column,D.type,D.info,null,D.prev),"operator"):!1},"/":function(v,g){return v.eat("*")?(g.tokenize=H(1),g.tokenize(v,g)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function c(v){return function(g,D){for(var K=!1,$,pe=!1;!g.eol();){if(!v&&!K&&g.match('"')){pe=!0;break}if(v&&g.match('"""')){pe=!0;break}$=g.next(),!K&&$=="$"&&g.match("{")&&g.skipTo("}"),K=!K&&$=="\\"&&!v}return(pe||!v)&&(D.tokenize=null),"string"}}me("text/x-kotlin",{name:"clike",keywords:M("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:M("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:M("catch class do else finally for if where try while enum"),defKeywords:M("class val var object interface fun"),atoms:M("true false null this"),hooks:{"@":function(v){return v.eatWhile(/[\w\$_]/),"meta"},"*":function(v,g){return g.prevToken=="."?"variable":"operator"},'"':function(v,g){return g.tokenize=c(v.match('""')),g.tokenize(v,g)},"/":function(v,g){return v.eat("*")?(g.tokenize=H(1),g.tokenize(v,g)):!1},indent:function(v,g,D,K){var $=D&&D.charAt(0);if((v.prevToken=="}"||v.prevToken==")")&&D=="")return v.indented;if(v.prevToken=="operator"&&D!="}"&&v.context.type!="}"||v.prevToken=="variable"&&$=="."||(v.prevToken=="}"||v.prevToken==")")&&$==".")return K*2+g.indented;if(g.align&&g.type=="}")return g.indented+(v.context.type==(D||"").charAt(0)?0:K)}},modeProps:{closeBrackets:{triples:'"'}}}),me(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:M("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:M("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:M("for while do if else struct"),builtin:M("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:M("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":oe},modeProps:{fold:["brace","include"]}}),me("text/x-nesc",{name:"clike",keywords:M(_+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:Te,blockKeywords:M(ae),atoms:M("null true false"),hooks:{"#":oe},modeProps:{fold:["brace","include"]}}),me("text/x-objectivec",{name:"clike",keywords:M(_+" "+G),types:Oe,builtin:M(se),blockKeywords:M(ae+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:M(V+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:M("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:_e,hooks:{"#":oe,"*":xe},modeProps:{fold:["brace","include"]}}),me("text/x-objectivec++",{name:"clike",keywords:M(_+" "+G+" "+ie),types:Oe,builtin:M(se),blockKeywords:M(ae+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:M(V+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:M("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:_e,hooks:{"#":oe,"*":xe,u:Me,U:Me,L:Me,R:Me,0:ye,1:ye,2:ye,3:ye,4:ye,5:ye,6:ye,7:ye,8:ye,9:ye,token:function(v,g,D){if(D=="variable"&&v.peek()=="("&&(g.prevToken==";"||g.prevToken==null||g.prevToken=="}")&&He(v.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),me("text/x-squirrel",{name:"clike",keywords:M("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:Te,blockKeywords:M("case catch class else for foreach if switch try while"),defKeywords:M("function local class"),typeFirstDefinitions:!0,atoms:M("true false null"),hooks:{"#":oe},modeProps:{fold:["brace","include"]}});var x=null;function b(v){return function(g,D){for(var K=!1,$,pe=!1;!g.eol();){if(!K&&g.match('"')&&(v=="single"||g.match('""'))){pe=!0;break}if(!K&&g.match("``")){x=b(v),pe=!0;break}$=g.next(),K=v=="single"&&!K&&$=="\\"}return pe&&(D.tokenize=null),"string"}}me("text/x-ceylon",{name:"clike",keywords:M("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(v){var g=v.charAt(0);return g===g.toUpperCase()&&g!==g.toLowerCase()},blockKeywords:M("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:M("class dynamic function interface module object package value"),builtin:M("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:M("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(v){return v.eatWhile(/[\w\$_]/),"meta"},'"':function(v,g){return g.tokenize=b(v.match('""')?"triple":"single"),g.tokenize(v,g)},"`":function(v,g){return!x||!v.match("`")?!1:(g.tokenize=x,x=null,g.tokenize(v,g))},"'":function(v){return v.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(v,g,D){if((D=="variable"||D=="type")&&g.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})();export{Lu as default}; diff --git a/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-C5j27SYZ.js b/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-C5j27SYZ.js new file mode 100644 index 00000000..ae7a3330 --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-C5j27SYZ.js @@ -0,0 +1,24 @@ +import{c as Tu,g as Lu}from"./index-m0XdVJHe.js";var ho={exports:{}},ha;function It(){return ha||(ha=1,function(Et,zt){(function(C,De){Et.exports=De()})(Tu,function(){var C=navigator.userAgent,De=navigator.platform,I=/gecko\/\d/i.test(C),K=/MSIE \d/.test(C),$=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(C),V=/Edge\/(\d+)/.exec(C),b=K||$||V,N=b&&(K?document.documentMode||6:+(V||$)[1]),_=!V&&/WebKit\//.test(C),ie=_&&/Qt\/\d+\.\d+/.test(C),O=!V&&/Chrome\/(\d+)/.exec(C),q=O&&+O[1],z=/Opera\//.test(C),X=/Apple Computer/.test(navigator.vendor),ke=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(C),we=/PhantomJS/.test(C),te=X&&(/Mobile\/\w+/.test(C)||navigator.maxTouchPoints>2),re=/Android/.test(C),ne=te||re||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(C),se=te||/Mac/.test(De),Ae=/\bCrOS\b/.test(C),ye=/win/i.test(De),de=z&&C.match(/Version\/(\d*\.\d*)/);de&&(de=Number(de[1])),de&&de>=15&&(z=!1,_=!0);var ze=se&&(ie||z&&(de==null||de<12.11)),fe=I||b&&N>=9;function H(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ee=function(e,t){var n=e.className,r=H(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function J(e,t){return D(e).appendChild(t)}function d(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=ue(this.onTimeout,this)};be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},be.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function et(e){for(;Ue.length<=e;)Ue.push(ge(Ue)+" ");return Ue[e]}function ge(e){return e[e.length-1]}function Pe(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function Se(e,t){return t?t.source.indexOf("\\w")>-1&&ae(e)?!0:t.test(e):ae(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Me(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Lt(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function or(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var br=null;function lr(e,t,n){var r;br=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:br=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:br=i)}return r??br}var vi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,h,v){this.level=u,this.from=h,this.to=v}return function(u,h){var v=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var k=u.length,x=[],M=0;M-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Qt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Bt(e){e.prototype.on=function(t,n){ve(this,t,n)},e.prototype.off=function(t,n){dt(this,t,n)}}function ht(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Nr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function yt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){ht(e),Nr(e)}function ln(e){return e.target||e.srcElement}function Wt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),se&&e.ctrlKey&&t==1&&(t=3),t}var mi=function(){if(b&&N<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),Or;function Wn(e){if(Or==null){var t=d("span","​");J(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(b&&N<8))}var n=Or?d("span","​"):d("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function sr(e){if(an!=null)return an;var t=J(e,document.createTextNode("AخA")),n=w(t,0,1).getBoundingClientRect(),r=w(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var Pt=` + +b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` +`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ur=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},_n=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_t=null;function yi(e){if(_t!=null)return _t;var t=J(e,d("span","x")),n=t.getBoundingClientRect(),r=w(t,0,1).getBoundingClientRect();return _t=Math.abs(n.left-r.left)>1}var Pr={},Ht={};function Rt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pr[e]=t}function kr(e,t){Ht[e]=t}function Ir(e){if(typeof e=="string"&&Ht.hasOwnProperty(e))e=Ht[e];else if(e&&typeof e.name=="string"&&Ht.hasOwnProperty(e.name)){var t=Ht[e.name];typeof t=="string"&&(t={name:t}),e=F(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ir("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ir("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function zr(e,t){t=Ir(t);var n=Pr[t.name];if(!n)return zr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var fr={};function Br(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};Te(t,n)}function Gt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function sn(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Wr(e,t,n){return e.startState?e.startState(t,n):!0}var Je=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Je.prototype.eol=function(){return this.pos>=this.string.length},Je.prototype.sol=function(){return this.pos==this.lineStart},Je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Je.prototype.next=function(){if(this.post},Je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Je.prototype.skipToEnd=function(){this.pos=this.string.length},Je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Je.prototype.backUp=function(e){this.pos-=e},Je.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Je.prototype.current=function(){return this.string.slice(this.start,this.pos)},Je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ce(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?L(n,ce(e,n).text.length):La(t,ce(e,t.line).text.length)}function La(e,t){var n=e.ch;return n==null||n>t?L(e.line,t):n<0?L(e.line,0):e}function go(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Xt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Xt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Xt.fromSaved=function(e,t,n){return t instanceof Hn?new Xt(e,Gt(e.mode,t.state),n,t.lookAhead):new Xt(e,Gt(e.mode,t),n)},Xt.prototype.save=function(e){var t=e!==!1?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Hn(t,this.maxLookAhead):t};function vo(e,t,n,r){var i=[e.state.modeGen],o={};wo(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var h=e.state.overlays[u],v=1,k=0;n.state=!0,wo(e,t.text,h.mode,n,function(x,M){for(var E=v;kx&&i.splice(v,1,x,i[v+1],R),v+=2,k=Math.min(x,R)}if(M)if(h.opaque)i.splice(E,v-E,x,"overlay "+M),v=E+2;else for(;Ee.options.maxHighlightLength&&Gt(e.doc.mode,r.state),o=vo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function fn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Xt(r,!0,t);var o=Ca(e,t,n),l=o>r.first&&ce(r,o-1).stateAfter,a=l?Xt.fromSaved(r,l,o):new Xt(r,Wr(r.mode),o);return r.iter(o,t,function(s){xi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var xo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function bo(e,t,n,r){var i=e.doc,o=i.mode,l;t=Ce(i,t);var a=ce(i,t.line),s=fn(e,t.line,n),u=new Je(a.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pose.options.maxHighlightLength?(a=!1,l&&xi(e,t,r,h.pos),h.pos=t.length,v=null):v=ko(bi(n,h,r.state,k),o),k){var x=k[0].name;x&&(v="m-"+(v?x+" "+v:x))}if(!a||u!=v){for(;sl;--a){if(a<=o.first)return o.first;var s=ce(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Hn?u.lookAhead:0)<=o.modeFrontier))return a;var h=Le(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=a-1,r=h)}return i}function Da(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=ce(e,r).stateAfter;if(i&&(!(i instanceof Hn)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Rn(l,o.from,s?null:o.to))}}return r}function Oa(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from0&&a)for(var ee=0;ee0)){var h=[s,1],v=Z(u.from,a.from),k=Z(u.to,a.to);(v<0||!l.inclusiveLeft&&!v)&&h.push({from:u.from,to:a.from}),(k>0||!l.inclusiveRight&&!k)&&h.push({from:a.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Lo(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!r||wi(r,o.marker)<0)&&(r=o.marker)}return r}function Fo(e,t,n,r,i){var o=ce(e,t),l=$t&&o.markedSpans;if(l)for(var a=0;a=0&&v<=0||h<=0&&v>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.to,n)>=0:Z(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.from,r)<=0:Z(u.from,r)<0)))return!0}}}function qt(e){for(var t;t=Mo(e);)e=t.find(-1,!0).line;return e}function za(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function Ba(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Si(e,t){var n=ce(e,t),r=qt(n);return n==r?t:f(r)}function Ao(e,t){if(t>e.lastLine())return t;var n=ce(e,t),r;if(!cr(e,n))return t;for(;r=Kn(n);)n=r.find(1,!0).line;return f(n)+1}function cr(e,t){var n=$t&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Hr=function(e,t,n){this.text=e,Co(this,t),this.height=n?n(this):1};Hr.prototype.lineNo=function(){return f(this)},Bt(Hr);function Wa(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Lo(e),Co(e,n);var i=r?r(e):1;i!=e.height&&Ft(e,i)}function _a(e){e.parent=null,Lo(e)}var Ha={},Ra={};function Eo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ra:Ha;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function No(e,t){var n=S("span",null,null,_?"padding-right: .1px":null),r={pre:S("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=ja,sr(e.display.measure)&&(l=We(o,e.doc.direction))&&(r.addToken=Ua(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);Ga(o,r,mo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=le(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=le(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Wn(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=le(r.pre.className,r.textClass||"")),r}function qa(e){var t=d("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ja(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?Ka(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,h),b&&N<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var v=0;;){s.lastIndex=v;var k=s.exec(t),x=k?k.index-v:t.length-v;if(x){var M=document.createTextNode(a.slice(v,v+x));b&&N<9?h.appendChild(d("span",[M])):h.appendChild(M),e.map.push(e.pos,e.pos+x,M),e.col+=x,e.pos+=x}if(!k)break;v+=x+1;var E=void 0;if(k[0]==" "){var R=e.cm.options.tabSize,U=R-e.col%R;E=h.appendChild(d("span",et(U),"cm-tab")),E.setAttribute("role","presentation"),E.setAttribute("cm-text"," "),e.col+=U}else k[0]=="\r"||k[0]==` +`?(E=h.appendChild(d("span",k[0]=="\r"?"␍":"␤","cm-invalidchar")),E.setAttribute("cm-text",k[0]),e.col+=1):(E=e.cm.options.specialCharPlaceholder(k[0]),E.setAttribute("cm-text",k[0]),b&&N<9?h.appendChild(d("span",[E])):h.appendChild(E),e.col+=1);e.map.push(e.pos,e.pos+1,E),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,n||r||i||u||o||l){var Q=n||"";r&&(Q+=r),i&&(Q+=i);var G=d("span",[h],Q,o);if(l)for(var ee in l)l.hasOwnProperty(ee)&&ee!="style"&&ee!="class"&&G.setAttribute(ee,l[ee]);return e.content.appendChild(G)}e.content.appendChild(h)}}function Ka(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&v.from<=u));k++);if(v.to>=h)return e(n,r,i,o,l,a,s);e(n,r.slice(0,v.to-u),i,o,null,a,s),o=null,r=r.slice(v.to-u),u=v.to}}}function Oo(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ga(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var l=1;ls||Fe.collapsed&&pe.to==s&&pe.from==s)){if(pe.to!=null&&pe.to!=s&&x>pe.to&&(x=pe.to,E=""),Fe.className&&(M+=" "+Fe.className),Fe.css&&(k=(k?k+";":"")+Fe.css),Fe.startStyle&&pe.from==s&&(R+=" "+Fe.startStyle),Fe.endStyle&&pe.to==x&&(ee||(ee=[])).push(Fe.endStyle,pe.to),Fe.title&&((Q||(Q={})).title=Fe.title),Fe.attributes)for(var Ke in Fe.attributes)(Q||(Q={}))[Ke]=Fe.attributes[Ke];Fe.collapsed&&(!U||wi(U.marker,Fe)<0)&&(U=pe)}else pe.from>s&&x>pe.from&&(x=pe.from)}if(ee)for(var st=0;st=a)break;for(var Mt=Math.min(a,x);;){if(h){var wt=s+h.length;if(!U){var tt=wt>Mt?h.slice(0,Mt-s):h;t.addToken(t,tt,v?v+M:M,R,s+tt.length==x?E:"",k,Q)}if(wt>=Mt){h=h.slice(Mt-s),s=Mt;break}s=wt,R=""}h=i.slice(o,o=n[u++]),v=Eo(n[u++],t.cm.options)}}}function Po(e,t,n){this.line=t,this.rest=Ba(t),this.size=this.rest?f(ge(this.rest))-n+1:1,this.node=this.text=null,this.hidden=cr(e,t)}function Gn(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ro(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function ns(e,t){t=qt(t);var n=f(t),r=e.display.externalMeasured=new Po(e.doc,t,n);r.lineN=n;var i=r.built=No(e,r);return r.text=i.pre,J(e.display.lineMeasure,i.pre),r}function qo(e,t,n,r){return Zt(e,qr(e,t),n,r)}function Fi(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=s-a,i=o-1,t>=s&&(l="right")),i!=null){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],l="left";if(n=="right"&&i==s-a)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function os(e,t,n,r){var i=Ko(t.map,n,r),o=i.node,l=i.start,a=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;l&&Me(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+a0&&(s=r="right");var v;e.options.lineWrapping&&(v=o.getClientRects()).length>1?u=v[r=="right"?v.length-1:0]:u=o.getBoundingClientRect()}if(b&&N<9&&!l&&(!u||!u.left&&!u.right)){var k=o.parentNode.getClientRects()[0];k?u={left:k.left,right:k.left+Kr(e.display),top:k.top,bottom:k.bottom}:u=jo}for(var x=u.top-t.rect.top,M=u.bottom-t.rect.top,E=(x+M)/2,R=t.view.measure.heights,U=0;U=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l(u=="before"?s-1:s,u=="before");function h(M,E,R){var U=a[E],Q=U.level==1;return l(R?M-1:M,Q!=R)}var v=lr(a,s,u),k=br,x=h(s,v,u=="before");return k!=null&&(x.other=h(s,k,u!="before")),x}function Jo(e,t){var n=0;t=Ce(e.doc,t),e.options.lineWrapping||(n=Kr(e.display)*t.ch);var r=ce(e.doc,t.line),i=er(r)+Xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ei(e,t,n,r,i){var o=L(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Ni(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ei(r.first,0,null,-1,-1);var i=g(r,n),o=r.first+r.size-1;if(i>o)return Ei(r.first+r.size-1,ce(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=ce(r,i);;){var a=as(e,l,i,t,n),s=Ia(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=ce(r,i=u.line)}}function Qo(e,t,n,r){r-=Ai(t);var i=t.text.length,o=Nt(function(l){return Zt(e,n,l-1).bottom<=r},i,0);return i=Nt(function(l){return Zt(e,n,l).top>r},o,i),{begin:o,end:i}}function Vo(e,t,n,r){n||(n=qr(e,t));var i=Yn(e,t,Zt(e,n,r),"line").top;return Qo(e,t,n,i)}function Oi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function as(e,t,n,r,i){i-=er(t);var o=qr(e,t),l=Ai(t),a=0,s=t.text.length,u=!0,h=We(t,e.doc.direction);if(h){var v=(e.options.lineWrapping?us:ss)(e,t,n,o,h,r,i);u=v.level!=1,a=u?v.from:v.to-1,s=u?v.to:v.from-1}var k=null,x=null,M=Nt(function(me){var pe=Zt(e,o,me);return pe.top+=l,pe.bottom+=l,Oi(pe,r,i,!1)?(pe.top<=i&&pe.left<=r&&(k=me,x=pe),!0):!1},a,s),E,R,U=!1;if(x){var Q=r-x.left=ee.bottom?1:0}return M=Lt(t.text,M,1),Ei(n,M,R,U,r-E)}function ss(e,t,n,r,i,o,l){var a=Nt(function(v){var k=i[v],x=k.level!=1;return Oi(jt(e,L(n,x?k.to:k.from,x?"before":"after"),"line",t,r),o,l,!0)},0,i.length-1),s=i[a];if(a>0){var u=s.level!=1,h=jt(e,L(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Oi(h,o,l,!0)&&h.top>l&&(s=i[a-1])}return s}function us(e,t,n,r,i,o,l){var a=Qo(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,v=null,k=0;k=u||x.to<=s)){var M=x.level!=1,E=Zt(e,r,M?Math.min(u,x.to)-1:Math.max(s,x.from)).right,R=ER)&&(h=x,v=R)}}return h||(h=i[i.length-1]),h.fromu&&(h={from:h.from,to:u,level:h.level}),h}var Sr;function jr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Sr==null){Sr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Sr.appendChild(document.createTextNode("x")),Sr.appendChild(d("br"));Sr.appendChild(document.createTextNode("x"))}J(e.measure,Sr);var n=Sr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),D(e.measure),n||1}function Kr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),n=d("pre",[t],"CodeMirror-line-like");J(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Pi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Ii(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ii(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function $o(e){var t=jr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Kr(e.display)-3);return function(i){if(cr(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l0&&(u=ce(e.doc,s.line).text).length==s.ch){var h=Le(u,u.length,e.options.tabSize)-u.length;s=L(s.line,Math.max(0,Math.round((o-Ho(e.display).left)/Kr(e.display))-h))}return s}function Lr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)$t&&Si(e.doc,t)i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var o=Jn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var l=Jn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):hr(e)}else{var a=Jn(e,t,t,-1),s=Jn(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Gn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):hr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Lr(e,t)];if(o.node!=null){var l=o.changes||(o.changes=[]);oe(l,n)==-1&&l.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Jn(e,t,n,r){var i=Lr(e,t),o,l=e.display.view;if(!$t||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;Si(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function fs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Gn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Gn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Lr(e,n)))),r.viewTo=n}function el(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(d("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Qn(e,t){return e.top-t.top||e.left-t.left}function cs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=Ho(e.display),a=l.left,s=Math.max(r.sizerWidth,wr(e)-r.sizer.offsetLeft)-l.right,u=i.direction=="ltr";function h(G,ee,me,pe){ee<0&&(ee=0),ee=Math.round(ee),pe=Math.round(pe),o.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+G+`px; + top: `+ee+"px; width: "+(me??s-G)+`px; + height: `+(pe-ee)+"px"))}function v(G,ee,me){var pe=ce(i,G),Fe=pe.text.length,Ke,st;function Xe(tt,St){return Zn(e,L(G,tt),"div",pe,St)}function Mt(tt,St,ft){var nt=Vo(e,pe,null,tt),rt=St=="ltr"==(ft=="after")?"left":"right",Qe=ft=="after"?nt.begin:nt.end-(/\s/.test(pe.text.charAt(nt.end-1))?2:1);return Xe(Qe,rt)[rt]}var wt=We(pe,i.direction);return or(wt,ee||0,me??Fe,function(tt,St,ft,nt){var rt=ft=="ltr",Qe=Xe(tt,rt?"left":"right"),Tt=Xe(St-1,rt?"right":"left"),nn=ee==null&&tt==0,xr=me==null&&St==Fe,gt=nt==0,Jt=!wt||nt==wt.length-1;if(Tt.top-Qe.top<=3){var ut=(u?nn:xr)&>,fo=(u?xr:nn)&&Jt,ir=ut?a:(rt?Qe:Tt).left,Ar=fo?s:(rt?Tt:Qe).right;h(ir,Qe.top,Ar-ir,Qe.bottom)}else{var Er,mt,on,co;rt?(Er=u&&nn&>?a:Qe.left,mt=u?s:Mt(tt,ft,"before"),on=u?a:Mt(St,ft,"after"),co=u&&xr&&Jt?s:Tt.right):(Er=u?Mt(tt,ft,"before"):a,mt=!u&&nn&>?s:Qe.right,on=!u&&xr&&Jt?a:Tt.left,co=u?Mt(St,ft,"after"):s),h(Er,Qe.top,mt-Er,Qe.bottom),Qe.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Ur(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function rl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Hi(e))}function _i(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ur(e))},100)}function Hi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ye(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),_&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wi(e))}function Ur(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ye(e,"blur",e,t),e.state.focused=!1,Ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Vn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||x<-.005)&&(ie.display.sizerWidth){var E=Math.ceil(h/Kr(e.display));E>e.display.maxLineLength&&(e.display.maxLineLength=E,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function nl(e){if(e.widgets)for(var t=0;t=l&&(o=g(t,er(ce(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function ds(e,t){if(!Ze(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!we){var l=d("div","​",null,`position: absolute; + top: `+(t.top-n.viewOffset-Xn(e.display))+`px; + height: `+(t.bottom-t.top+Yt(e)+n.barHeight)+`px; + left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function hs(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?L(t.line,t.ch+1,"before"):t,t=t.ch?L(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=jt(e,t),s=!n||n==t?a:jt(e,n);i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=Ri(e,i),h=e.doc.scrollTop,v=e.doc.scrollLeft;if(u.scrollTop!=null&&(yn(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(l=!0)),u.scrollLeft!=null&&(Cr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-v)>1&&(l=!0)),!l)break}return i}function ps(e,t){var n=Ri(e,t);n.scrollTop!=null&&yn(e,n.scrollTop),n.scrollLeft!=null&&Cr(e,n.scrollLeft)}function Ri(e,t){var n=e.display,r=jr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Mi(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Di(n),s=t.topa-r;if(t.topi+o){var h=Math.min(t.top,(u?a:t.bottom)-o);h!=i&&(l.scrollTop=h)}var v=e.options.fixedGutter?0:n.gutters.offsetWidth,k=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-v,x=wr(e)-n.gutters.offsetWidth,M=t.right-t.left>x;return M&&(t.right=t.left+x),t.left<10?l.scrollLeft=0:t.leftx+k-3&&(l.scrollLeft=t.right+(M?0:10)-x),l}function qi(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Gr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function mn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function gs(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Jo(e,t.from),r=Jo(e,t.to);il(e,n,r,t.margin)}}function il(e,t,n,r){var i=Ri(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});mn(e,i.scrollLeft,i.scrollTop)}function yn(e,t){Math.abs(e.doc.scrollTop-t)<2||(I||Ki(e,{top:t}),ol(e,t,!0),I&&Ki(e),kn(e,100))}function ol(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Cr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,fl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function xn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Di(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Yt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Dr=function(e,t,n){this.cm=n;var r=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),ve(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),ve(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&N<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Dr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dr.prototype.zeroWidthHack=function(){var e=se&&!ke?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new be,this.disableVert=new be},Dr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Dr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var bn=function(){};bn.prototype.update=function(){return{bottom:0,right:0}},bn.prototype.setScrollLeft=function(){},bn.prototype.setScrollTop=function(){},bn.prototype.clear=function(){};function Xr(e,t){t||(t=xn(e));var n=e.display.barWidth,r=e.display.barHeight;ll(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Vn(e),ll(e,xn(e)),n=e.display.barWidth,r=e.display.barHeight}function ll(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var al={native:Dr,null:bn};function sl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new al[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ve(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Cr(e,t):yn(e,t)},e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var vs=0;function Mr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++vs,markArrays:null},Xa(e.curOp)}function Fr(e){var t=e.curOp;t&&Za(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ti(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function xs(e){e.updatedDisplay=e.mustUpdate&&ji(e.cm,e.update)}function bs(e){var t=e.cm,n=t.display;e.updatedDisplay&&Vn(t),e.barMeasure=xn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=qo(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Yt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-wr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ks(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=fn(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Gt(t.mode,r.state):null,s=vo(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var v=!l||l.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),k=0;!v&&kn)return kn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Dt(e,function(){for(var o=0;o=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&el(e)==0)return!1;cl(e)&&(hr(e),t.dims=Pi(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),$t&&(o=Si(e.doc,o),l=Ao(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;fs(e,o,l),n.viewOffset=er(ce(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=el(e);if(!a&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Ls(e);return s>4&&(n.lineDiv.style.display="none"),Ds(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Cs(u),D(n.cursorDiv),D(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,kn(e,400)),n.updateLineNumbers=null,!0}function ul(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==wr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Di(e.display)-Mi(e),n.top)}),t.visible=$n(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=$n(e.display,e.doc,n));if(!ji(e,t))break;Vn(e);var i=xn(e);vn(e),Xr(e,i),Gi(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ki(e,t){var n=new ti(e,t);if(ji(e,n)){Vn(e),ul(e,n);var r=xn(e);vn(e),Xr(e,r),Gi(e,r),n.finish()}}function Ds(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(M){var E=M.nextSibling;return _&&se&&e.display.currentWheelTarget==M?M.style.display="none":M.parentNode.removeChild(M),E}for(var s=r.view,u=r.viewFrom,h=0;h-1&&(x=!1),Io(e,v,u,n)),x&&(D(v.lineNumber),v.lineNumber.appendChild(document.createTextNode(W(e.options,u)))),l=v.node.nextSibling}u+=v.size}for(;l;)l=a(l)}function Ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ot(e,"gutterChanged",e)}function Gi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Yt(e)+"px"}function fl(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ii(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),b&&N<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!_&&!(I&&ne)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Xi(r.gutters,r.lineNumbers),dl(i),n.init(i)}var ri=0,rr=null;b?rr=-.53:I?rr=15:O?rr=-.7:X&&(rr=-1/3);function hl(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function Fs(e){var t=hl(e);return t.x*=rr,t.y*=rr,t}function pl(e,t){O&&q==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=hl(t),r=n.x,i=n.y,o=rr;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var l=e.display,a=l.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||i&&u){if(i&&se&&_){e:for(var h=t.target,v=l.view;h!=a;h=h.parentNode)for(var k=0;k=0&&Z(e,r.to())<=0)return n}return-1};var He=function(e,t){this.anchor=e,this.head=t};He.prototype.from=function(){return _r(this.anchor,this.head)},He.prototype.to=function(){return xt(this.anchor,this.head)},He.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Kt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(k,x){return Z(k.from(),x.from())}),n=oe(t,i);for(var o=1;o0:s>=0){var u=_r(a.from(),l.from()),h=xt(a.to(),l.to()),v=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new He(v?h:u,v?u:h))}}return new At(t,n)}function pr(e,t){return new At([new He(e,t||e)],0)}function gr(e){return e.text?L(e.from.line+e.text.length-1,ge(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function gl(e,t){if(Z(e,t.from)<0)return e;if(Z(e,t.to)<=0)return gr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=gr(t).ch-t.to.ch),L(n,r)}function Yi(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,M-1),e.insert(a.line+1,U)}ot(e,"change",e,t)}function vr(e,t,n){function r(i,o,l){if(i.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ge(e.done)}function kl(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,l,a;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=Ns(i,i.lastOp==r)))a=ge(l.changes),Z(t.from,t.to)==0&&Z(t.from,a.to)==0?a.to=gr(t):l.changes.push(Qi(e,t));else{var s=ge(i.done);for((!s||!s.ranges)&&ii(e.sel,i.done),l={changes:[Qi(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ye(e,"historyAdded")}function Os(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ps(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Os(e,o,ge(i.done),t))?i.done[i.done.length-1]=t:ii(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&bl(i.undone)}function ii(e,t){var n=ge(t);n&&n.ranges&&n.equals(e)||t.push(e)}function wl(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function Is(e){if(!e)return null;for(var t,n=0;n-1&&(ge(a)[v]=u[v],delete u[v])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=Z(t,i)<0;o!=Z(n,i)<0?(i=t,t=n):o!=Z(t,n)<0&&(t=n)}return new He(i,t)}else return new He(n||t,t)}function oi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),pt(e,new At([Vi(e.sel.primary(),t,n,i)],0),r)}function Tl(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(Ye(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!s.atomic)continue;if(n){var v=s.find(r<0?1:-1),k=void 0;if((r<0?h:u)&&(v=Al(e,v,-r,v&&v.line==t.line?o:null)),v&&v.line==t.line&&(k=Z(v,n))&&(r<0?k<0:k>0))return Zr(e,v,t,r,i)}var x=s.find(r<0?-1:1);return(r<0?u:h)&&(x=Al(e,x,r,x.line==t.line?o:null)),x?Zr(e,x,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,l=Zr(e,t,n,o,i)||!i&&Zr(e,t,n,o,!0)||Zr(e,t,n,-o,i)||!i&&Zr(e,t,n,-o,!0);return l||(e.cantEdit=!0,L(e.first,0))}function Al(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Ce(e,L(t.line-1)):null:n>0&&t.ch==(r||ce(e,t.line)).text.length?t.line=0;--i)Ol(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ol(e,t)}}function Ol(e,t){if(!(t.text.length==1&&t.text[0]==""&&Z(t.from,t.to)==0)){var n=Yi(e,t);kl(e,t,n,e.cm?e.cm.curOp.id:NaN),Tn(e,t,n,ki(e,t));var r=[];vr(e,function(i,o){!o&&oe(r,i.history)==-1&&(Bl(i.history,t),r.push(i.history)),Tn(i,t,null,ki(i,t))})}}function si(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,l=e.sel,a=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u=0;--x){var M=k(x);if(M)return M.v}}}}function Pl(e,t){if(t!=0&&(e.first+=t,e.sel=new At(Pe(e.sel.ranges,function(i){return new He(L(i.anchor.line+t,i.anchor.ch),L(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){bt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:L(o,ce(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Vt(e,t.from,t.to),n||(n=Yi(e,t)),e.cm?Ws(e.cm,t,r):Ji(e,t,r),li(e,n,Ve),e.cantEdit&&ai(e,L(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ws(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=f(qt(ce(r,o.line))),r.iter(s,l.line+1,function(x){if(x==i.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ot(e),Ji(r,t,n,$o(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(x){var M=Un(x);M>i.maxLineLength&&(i.maxLine=x,i.maxLineLength=M,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),Da(r,o.line),kn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?bt(e):o.line==l.line&&t.text.length==1&&!ml(e.doc,t)?dr(e,o.line,"text"):bt(e,o.line,l.line+1,u);var h=Ct(e,"changes"),v=Ct(e,"change");if(v||h){var k={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};v&&ot(e,"change",e,k),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(k)}e.display.selForContextMenu=null}function Qr(e,t,n,r,i){var o;r||(r=n),Z(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Jr(e,{from:n,to:r,text:t,origin:i})}function Il(e,t,n,r){n1||!(this.children[0]instanceof Cn))){var a=[];this.collapse(a),this.children=[new Cn(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=i.lines.length%25+25,a=l;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&bt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ml(e.doc)),e&&ot(e,"markerCleared",e,this,r,i),t&&Fr(e),this.parent&&this.parent.clear()}},mr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=S("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Fo(e,t.line,t,n,o)||t.line!=n.line&&Fo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Fa()}o.addToHistory&&kl(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,n.line+1,function(v){s&&o.collapsed&&!s.options.lineWrapping&&qt(v)==s.display.maxLine&&(u=!0),o.collapsed&&a!=t.line&&Ft(v,0),Ea(v,new Rn(o,a==t.line?t.ch:null,a==n.line?n.ch:null),e.cm&&e.cm.curOp),++a}),o.collapsed&&e.iter(t.line,n.line+1,function(v){cr(e,v)&&Ft(v,0)}),o.clearOnEnter&&ve(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ma(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++_l,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)bt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)dr(s,h,"text");o.atomic&&Ml(s.doc),ot(s,"markerAdded",s,o)}return o}var Fn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)Jr(this,r[s]);a?Cl(this,a):this.cm&&Gr(this.cm)}),undo:at(function(){si(this,"undo")}),redo:at(function(){si(this,"redo")}),undoSelection:at(function(){si(this,"undo",!0)}),redoSelection:at(function(){si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Ce(this,e),t=Ce(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n}),Ce(this,L(n,t))},indexFromPos:function(e){e=Ce(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var v;if(t.state.draggingText&&!t.state.draggingText.copy&&(v=t.listSelections()),li(t.doc,pr(n,n)),v)for(var k=0;k=0;a--)Qr(e.doc,"",r[a].from,r[a].to,"+delete");Gr(e)})}function eo(e,t,n){var r=Lt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new L(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=We(n,t.doc.direction);if(o){var l=i<0?ge(o):o[0],a=i<0==(l.level==1),s=a?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){var h=qr(t,n);u=i<0?n.text.length-1:0;var v=Zt(t,h,u).top;u=Nt(function(k){return Zt(t,h,k).top==v},i<0==(l.level==1)?l.from:l.to-1,u),s=="before"&&(u=eo(n,u,1))}else u=i<0?l.to:l.from;return new L(r,u,s)}}return new L(r,i<0?n.text.length:0,i<0?"before":"after")}function Vs(e,t,n,r){var i=We(t,e.doc.direction);if(!i)return to(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=lr(i,n.ch,n.sticky),l=i[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>n.ch:l.from=l.from&&k>=h.begin)){var x=v?"before":"after";return new L(n.line,k,x)}}var M=function(U,Q,G){for(var ee=function(Ke,st){return st?new L(n.line,a(Ke,1),"before"):new L(n.line,Ke,"after")};U>=0&&U0==(me.level!=1),Fe=pe?G.begin:a(G.end,-1);if(me.from<=Fe&&Fe0?h.end:a(h.begin,-1);return R!=null&&!(r>0&&R==t.text.length)&&(E=M(r>0?0:i.length-1,r,u(R)),E)?E:null}var Nn={selectAll:El,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ve)},killLine:function(e){return en(e,function(t){if(t.empty()){var n=ce(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new L(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),L(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=ce(e.doc,i.line-1).text;l&&(i=new L(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),L(i.line-1,l.length-1),i,"+transpose"))}}n.push(new He(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Dt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&Z(t,this.pos)==0&&n==this.button};var Pn,In;function ou(e,t){var n=+new Date;return In&&In.compare(n,e,t)?(Pn=In=null,"triple"):Pn&&Pn.compare(n,e,t)?(In=new io(n,e,t),Pn=null,"double"):(Pn=new io(n,e,t),In=null,"single")}function ta(e){var t=this,n=t.display;if(!(Ze(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,tr(n,e)){_||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=Tr(t,e),i=Wt(e),o=r?ou(r,i):"single";j(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&lu(t,i,r,o,e))&&(i==1?r?su(t,r,o,e):ln(e)==n.scroller&&ht(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(fe?t.display.input.onContextMenu(e):_i(t)))}}}function lu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,On(e,Gl(o,i),i,function(l){if(typeof l=="string"&&(l=Nn[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,n)!=qe}finally{e.state.suppressEdits=!1}return a})}function au(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=Ae?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=se?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(se?n.altKey:n.ctrlKey)),i}function su(e,t,n,r){b?setTimeout(ue(rl,e),0):e.curOp.focus=y(Y(e));var i=au(e,n,r),o=e.doc.sel,l;e.options.dragDrop&&mi&&!e.isReadOnly()&&n=="single"&&(l=o.contains(t))>-1&&(Z((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(Z(l.to(),t)>0||t.xRel<0)?uu(e,r,t,i):fu(e,r,t,i)}function uu(e,t,n,r){var i=e.display,o=!1,l=lt(e,function(u){_&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:_i(e)),dt(i.wrapper.ownerDocument,"mouseup",l),dt(i.wrapper.ownerDocument,"mousemove",a),dt(i.scroller,"dragstart",s),dt(i.scroller,"drop",l),o||(ht(u),r.addNew||oi(e.doc,n,null,null,r.extend),_&&!X||b&&N==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),a=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};_&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,ve(i.wrapper.ownerDocument,"mouseup",l),ve(i.wrapper.ownerDocument,"mousemove",a),ve(i.scroller,"dragstart",s),ve(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ra(e,t,n){if(n=="char")return new He(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new He(L(t.line,0),Ce(e.doc,L(t.line+1,0)));var r=n(e,t);return new He(r.from,r.to)}function fu(e,t,n,r){b&&_i(e);var i=e.display,o=e.doc;ht(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),a>-1?l=u[a]:l=new He(n,n)):(l=o.sel.primary(),a=o.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new He(n,n)),n=Tr(e,t,!0,!0),a=-1;else{var h=ra(e,n,r.unit);r.extend?l=Vi(l,h.anchor,h.head,r.extend):l=h}r.addNew?a==-1?(a=u.length,pt(o,Kt(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(pt(o,Kt(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,a,l,ct):(a=0,pt(o,new At([l],0),ct),s=o.sel);var v=n;function k(G){if(Z(v,G)!=0)if(v=G,r.unit=="rectangle"){for(var ee=[],me=e.options.tabSize,pe=Le(ce(o,n.line).text,n.ch,me),Fe=Le(ce(o,G.line).text,G.ch,me),Ke=Math.min(pe,Fe),st=Math.max(pe,Fe),Xe=Math.min(n.line,G.line),Mt=Math.min(e.lastLine(),Math.max(n.line,G.line));Xe<=Mt;Xe++){var wt=ce(o,Xe).text,tt=Re(wt,Ke,me);Ke==st?ee.push(new He(L(Xe,tt),L(Xe,tt))):wt.length>tt&&ee.push(new He(L(Xe,tt),L(Xe,Re(wt,st,me))))}ee.length||ee.push(new He(n,n)),pt(o,Kt(e,s.ranges.slice(0,a).concat(ee),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(G)}else{var St=l,ft=ra(e,G,r.unit),nt=St.anchor,rt;Z(ft.anchor,nt)>0?(rt=ft.head,nt=_r(St.from(),ft.anchor)):(rt=ft.anchor,nt=xt(St.to(),ft.head));var Qe=s.ranges.slice(0);Qe[a]=cu(e,new He(Ce(o,nt),rt)),pt(o,Kt(e,Qe,a),ct)}}var x=i.wrapper.getBoundingClientRect(),M=0;function E(G){var ee=++M,me=Tr(e,G,!0,r.unit=="rectangle");if(me)if(Z(me,v)!=0){e.curOp.focus=y(Y(e)),k(me);var pe=$n(i,o);(me.line>=pe.to||me.linex.bottom?20:0;Fe&&setTimeout(lt(e,function(){M==ee&&(i.scroller.scrollTop+=Fe,E(G))}),50)}}function R(G){e.state.selectingText=!1,M=1/0,G&&(ht(G),i.input.focus()),dt(i.wrapper.ownerDocument,"mousemove",U),dt(i.wrapper.ownerDocument,"mouseup",Q),o.history.lastSelOrigin=null}var U=lt(e,function(G){G.buttons===0||!Wt(G)?R(G):E(G)}),Q=lt(e,R);e.state.selectingText=Q,ve(i.wrapper.ownerDocument,"mousemove",U),ve(i.wrapper.ownerDocument,"mouseup",Q)}function cu(e,t){var n=t.anchor,r=t.head,i=ce(e.doc,n.line);if(Z(n,r)==0&&n.sticky==r.sticky)return t;var o=We(i);if(!o)return t;var l=lr(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s=l+(a.from==n.ch==(a.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=lr(o,r.ch,r.sticky),v=h-l||(r.ch-n.ch)*(a.level==1?-1:1);h==s-1||h==s?u=v<0:u=v>0}var k=o[s+(u?-1:0)],x=u==(k.level==1),M=x?k.from:k.to,E=x?"after":"before";return n.ch==M&&n.sticky==E?t:new He(new L(n.line,M,E),r)}function na(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ht(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!Ct(e,n))return yt(t);o-=a.top-l.viewOffset;for(var s=0;s=i){var h=g(e.doc,o),v=e.display.gutterSpecs[s];return Ye(e,n,e,h,v.className,t),yt(t)}}}function oo(e,t){return na(e,t,"gutterClick",!0)}function ia(e,t){tr(e.display,t)||du(e,t)||Ze(e,t,"contextmenu")||fe||e.display.input.onContextMenu(t)}function du(e,t){return Ct(e,"gutterContextMenu")?na(e,t,"gutterContextMenu",!1):!1}function oa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gn(e)}var tn={toString:function(){return"CodeMirror.Init"}},la={},di={};function hu(e){var t=e.optionHandlers;function n(r,i,o,l){e.defaults[r]=i,o&&(t[r]=l?function(a,s,u){u!=tn&&o(a,s,u)}:o)}e.defineOption=n,e.Init=tn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Zi(r)},!0),n("indentUnit",2,Zi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Sn(r),gn(r),bt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],l=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(L(l,h))}l++});for(var a=o.length-1;a>=0;a--)Qr(r.doc,i,o[a],L(o[a].line,o[a].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=tn&&r.refresh()}),n("specialCharPlaceholder",qa,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",ne?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!ye),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){oa(r),wn(r)},!0),n("keyMap","default",function(r,i,o){var l=fi(i),a=o!=tn&&fi(o);a&&a.detach&&a.detach(r,l),l.attach&&l.attach(r,a||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,gu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Xi(i,r.options.lineNumbers),wn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Ii(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Xr(r)},!0),n("scrollbarStyle","native",function(r){sl(r),Xr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Xi(r.options.gutters,i),wn(r)},!0),n("firstLineNumber",1,wn,!0),n("lineNumberFormatter",function(r){return r},wn,!0),n("showCursorWhenSelecting",!1,vn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Ur(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,pu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vn,!0),n("singleCursorHeightPerLine",!0,vn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Sn,!0),n("addModeClass",!1,Sn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Sn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function pu(e,t,n){var r=n&&n!=tn;if(!t!=!r){var i=e.display.dragFunctions,o=t?ve:dt;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function gu(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ee(e.display.wrapper,"CodeMirror-wrap"),Li(e)),zi(e),bt(e),gn(e),setTimeout(function(){return Xr(e)},100)}function Ge(e,t){var n=this;if(!(this instanceof Ge))return new Ge(e,t);this.options=t=t?Te(t):{},Te(la,t,!1);var r=t.value;typeof r=="string"?r=new kt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ge.inputStyles[t.inputStyle](this),o=this.display=new Ms(e,r,i,t);o.wrapper.CodeMirror=this,oa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),sl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new be,keySeq:null,specialChars:null},t.autofocus&&!ne&&o.input.focus(),b&&N<11&&setTimeout(function(){return n.display.input.reset(!0)},20),vu(this),Xs(),Mr(this),this.curOp.forceUpdate=!0,yl(this,r),t.autofocus&&!ne||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Hi(n)},20):Ur(this);for(var l in di)di.hasOwnProperty(l)&&di[l](this,t[l],tn);cl(this),t.finishInit&&t.finishInit(this);for(var a=0;a20*20}ve(t.scroller,"touchstart",function(s){if(!Ze(e,s)&&!o(s)&&!oo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),ve(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ve(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!tr(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),v;!u.prev||l(u,u.prev)?v=new He(h,h):!u.prev.prev||l(u,u.prev.prev)?v=e.findWordAt(h):v=new He(L(h.line,0),Ce(e.doc,L(h.line+1,0))),e.setSelection(v.anchor,v.head),e.focus(),ht(s)}i()}),ve(t.scroller,"touchcancel",i),ve(t.scroller,"scroll",function(){t.scroller.clientHeight&&(yn(e,t.scroller.scrollTop),Cr(e,t.scroller.scrollLeft,!0),Ye(e,"scroll",e))}),ve(t.scroller,"mousewheel",function(s){return pl(e,s)}),ve(t.scroller,"DOMMouseScroll",function(s){return pl(e,s)}),ve(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Ze(e,s)||ar(s)},over:function(s){Ze(e,s)||(Gs(e,s),ar(s))},start:function(s){return Us(e,s)},drop:lt(e,Ks),leave:function(s){Ze(e,s)||ql(e)}};var a=t.input.getField();ve(a,"keyup",function(s){return $l.call(e,s)}),ve(a,"keydown",lt(e,Vl)),ve(a,"keypress",lt(e,ea)),ve(a,"focus",function(s){return Hi(e,s)}),ve(a,"blur",function(s){return Ur(e,s)})}var lo=[];Ge.defineInitHook=function(e){return lo.push(e)};function zn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=fn(e,t).state:n="prev");var l=e.options.tabSize,a=ce(i,t),s=Le(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(a.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,a.text.slice(u.length),a.text),h==qe||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=Le(ce(i,t-1).text,null,l):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var v="",k=0;if(e.options.indentWithTabs)for(var x=Math.floor(h/l);x;--x)k+=l,v+=" ";if(kl,s=Pt(t),u=null;if(a&&r.ranges.length>1)if(Ut&&Ut.text.join(` +`)==t){if(r.ranges.length%Ut.text.length==0){u=[];for(var h=0;h=0;k--){var x=r.ranges[k],M=x.from(),E=x.to();x.empty()&&(n&&n>0?M=L(M.line,M.ch-n):e.state.overwrite&&!a?E=L(E.line,Math.min(ce(o,E.line).text.length,E.ch+ge(s).length)):a&&Ut&&Ut.lineWise&&Ut.text.join(` +`)==s.join(` +`)&&(M=E=L(M.line,0)));var R={from:M,to:E,text:u?u[k%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Jr(e.doc,R),ot(e,"inputRead",e,R)}t&&!a&&sa(e,t),Gr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=v),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function aa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Dt(t,function(){return ao(t,n,0,null,"paste")}),!0}function sa(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a-1){l=zn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ce(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=zn(e,i.head.line,"smart"));l&&ot(e,"electricInput",e,i.head.line)}}}function ua(e){for(var t=[],n=[],r=0;ro&&(zn(this,a.head.line,r,!0),o=a.head.line,l==this.doc.sel.primIndex&&Gr(this));else{var s=a.from(),u=a.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var v=h;v0&&$i(this.doc,l,new He(s,k[l].to()),Ve)}}}),getTokenAt:function(r,i){return bo(this,r,i)},getLineTokens:function(r,i){return bo(this,L(r),i,!0)},getTokenTypeAt:function(r){r=Ce(this.doc,r);var i=mo(this,ce(this.doc,r.line)),o=0,l=(i.length-1)/2,a=r.ch,s;if(a==0)s=i[2];else for(;;){var u=o+l>>1;if((u?i[u*2-1]:0)>=a)l=u;else if(i[u*2+1]s&&(r=s,l=!0),a=ce(this.doc,r)}else a=r;return Yn(this,a,{top:0,left:0},i||"page",o||l).top+(l?this.doc.height-er(a):0)},defaultTextHeight:function(){return jr(this.display)},defaultCharWidth:function(){return Kr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,l,a){var s=this.display;r=jt(this,Ce(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),l=="over")u=r.top;else if(l=="above"||l=="near"){var v=Math.max(s.wrapper.clientHeight,this.doc.height),k=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(l=="above"||r.bottom+i.offsetHeight>v)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=v&&(u=r.bottom),h+i.offsetWidth>k&&(h=k-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",a=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(a=="left"?h=0:a=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&ps(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:vt(Vl),triggerOnKeyPress:vt(ea),triggerOnKeyUp:$l,triggerOnMouseDown:vt(ta),execCommand:function(r){if(Nn.hasOwnProperty(r))return Nn[r].call(null,this)},triggerElectric:vt(function(r){sa(this,r)}),findPosH:function(r,i,o,l){var a=1;i<0&&(a=-1,i=-i);for(var s=Ce(this.doc,r),u=0;u0&&h(o.charAt(l-1));)--l;for(;a.5||this.options.lineWrapping)&&zi(this),Ye(this,"refresh",this)}),swapDoc:vt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),yl(this,r),gn(this),this.display.input.reset(),mn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ot(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Bt(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,l){e.registerHelper(r,i,l),n[r]._global.push({pred:o,val:l})}}function uo(e,t,n,r,i){var o=t,l=n,a=ce(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var Q=t.line+s;return Q=e.first+e.size?!1:(t=new L(Q,t.ch,t.sticky),a=ce(e,Q))}function h(Q){var G;if(r=="codepoint"){var ee=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(ee))G=null;else{var me=n>0?ee>=55296&&ee<56320:ee>=56320&&ee<57343;G=new L(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(me?2:1))),-n)}}else i?G=Vs(e.cm,a,t,n):G=to(a,t,n);if(G==null)if(!Q&&u())t=ro(i,e.cm,a,t.line,s);else return!1;else t=G;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var v=null,k=r=="group",x=e.cm&&e.cm.getHelper(t,"wordChars"),M=!0;!(n<0&&!h(!M));M=!1){var E=a.text.charAt(t.ch)||` +`,R=Se(E,x)?"w":k&&E==` +`?"n":!k||/\s/.test(E)?null:"p";if(k&&!M&&!R&&(R="s"),v&&v!=R){n<0&&(n=1,h(),t.sticky="after");break}if(R&&(v=R),n>0&&!h(!M))break}var U=ai(e,t,o,l,!0);return _e(o,U)&&(U.hitSide=!0),U}function ca(e,t,n,r){var i=e.doc,o=t.left,l;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,j(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(a-.5*jr(e.display),3);l=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var u;u=Ni(e,o,l),!!u.outside;){if(n<0?l<=0:l>=i.height){u.hitSide=!0;break}l+=n*5}return u}var je=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new be,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};je.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,so(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(a){for(var s=a.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}ve(i,"paste",function(a){!o(a)||Ze(r,a)||aa(a,r)||N<=11&&setTimeout(lt(r,function(){return t.updateFromDOM()}),20)}),ve(i,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),ve(i,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),ve(i,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ve(i,"touchstart",function(){return n.forceCompositionEnd()}),ve(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||Ze(r,a))){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=ua(r);hi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ve),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=Ut.text.join(` +`);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var h=fa(),v=h.firstChild;so(v),r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),v.value=Ut.text.join(` +`);var k=y(xe(i));p(v),setTimeout(function(){r.display.lineSpace.removeChild(h),k.focus(),k==i&&n.showPrimarySelection()},50)}}ve(i,"copy",l),ve(i,"cut",l)},je.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},je.prototype.prepareSelection=function(){var e=tl(this.cm,!1);return e.focus=y(xe(this.div))==this.div,e},je.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},je.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},je.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&da(t,r)||{node:a[0].measure.map[2],offset:0},u=i.linee.firstLine()&&(r=L(r.line-1,ce(e.doc,r.line-1).length)),i.ch==ce(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,l,a;r.line==t.viewFrom||(o=Lr(e,r.line))==0?(l=f(t.view[0].line),a=t.view[0].node):(l=f(t.view[o].line),a=t.view[o-1].node.nextSibling);var s=Lr(e,i.line),u,h;if(s==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=f(t.view[s+1].line)-1,h=t.view[s+1].node.previousSibling),!a)return!1;for(var v=e.doc.splitLines(xu(e,a,h,l,u)),k=Vt(e.doc,L(l,0),L(u,ce(e.doc,u).text.length));v.length>1&&k.length>1;)if(ge(v)==ge(k))v.pop(),k.pop(),u--;else if(v[0]==k[0])v.shift(),k.shift(),l++;else break;for(var x=0,M=0,E=v[0],R=k[0],U=Math.min(E.length,R.length);xr.ch&&Q.charCodeAt(Q.length-M-1)==G.charCodeAt(G.length-M-1);)x--,M++;v[v.length-1]=Q.slice(0,Q.length-M).replace(/^\u200b+/,""),v[0]=v[0].slice(x).replace(/\u200b+$/,"");var me=L(l,x),pe=L(u,k.length?ge(k).length-M:0);if(v.length>1||v[0]||Z(me,pe))return Qr(e.doc,v,me,pe,"+input"),!0},je.prototype.ensurePolled=function(){this.forceCompositionEnd()},je.prototype.reset=function(){this.forceCompositionEnd()},je.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},je.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},je.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Dt(this.cm,function(){return bt(e.cm)})},je.prototype.setUneditable=function(e){e.contentEditable="false"},je.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||lt(this.cm,ao)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},je.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},je.prototype.onContextMenu=function(){},je.prototype.resetPosition=function(){},je.prototype.needsContentAttribute=!0;function da(e,t){var n=Fi(e,t.line);if(!n||n.hidden)return null;var r=ce(e.doc,t.line),i=Ro(n,r,t.line),o=We(r,e.doc.direction),l="left";if(o){var a=lr(o,t.ch);l=a%2?"right":"left"}var s=Ko(i.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function yu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function rn(e,t){return t&&(e.bad=!0),e}function xu(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(x){return function(M){return M.id==x}}function h(){l&&(o+=a,s&&(o+=a),l=s=!1)}function v(x){x&&(h(),o+=x)}function k(x){if(x.nodeType==1){var M=x.getAttribute("cm-text");if(M){v(M);return}var E=x.getAttribute("cm-marker"),R;if(E){var U=e.findMarks(L(r,0),L(i+1,0),u(+E));U.length&&(R=U[0].find(0))&&v(Vt(e.doc,R.from,R.to).join(a));return}if(x.getAttribute("contenteditable")=="false")return;var Q=/^(pre|div|p|li|table|br)$/i.test(x.nodeName);if(!/^br$/i.test(x.nodeName)&&x.textContent.length==0)return;Q&&h();for(var G=0;G=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),ve(i,"paste",function(l){Ze(r,l)||aa(l,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(l){if(!Ze(r,l)){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=ua(r);hi({lineWise:!0,text:a.text}),l.type=="cut"?r.setSelections(a.ranges,null,Ve):(n.prevInput="",i.value=a.text.join(` +`),p(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}ve(i,"cut",o),ve(i,"copy",o),ve(e.scroller,"paste",function(l){if(!(tr(e,l)||Ze(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),ve(e.lineSpace,"selectstart",function(l){tr(e,l)||ht(l)}),ve(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ve(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},$e.prototype.createField=function(e){this.wrapper=fa(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},$e.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$e.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=tl(e);if(e.options.moveInputWithCursor){var i=jt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},$e.prototype.showSelection=function(e){var t=this.cm,n=t.display;J(n.cursorDiv,e.cursors),J(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$e.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&p(this.textarea),b&&N>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",b&&N>=9&&(this.hasSelection=null));this.resetting=!1}},$e.prototype.getField=function(){return this.textarea},$e.prototype.supportsTouch=function(){return!1},$e.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ne||y(xe(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},$e.prototype.blur=function(){this.textarea.blur()},$e.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$e.prototype.receivedFocus=function(){this.slowPoll()},$e.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},$e.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},$e.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||ur(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(b&&N>=9&&this.hasSelection===i||se&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="​"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(r.length,i.length);l1e3||i.indexOf(` +`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},$e.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$e.prototype.onKeyPress=function(){b&&N>=9&&(this.hasSelection=null),this.fastPoll()},$e.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Tr(n,e),l=r.scroller.scrollTop;if(!o||z)return;var a=n.options.resetSelectionOnContextMenu;a&&n.doc.sel.contains(o)==-1&<(n,pt)(n.doc,pr(o),Ve);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; + top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px; + z-index: 1000; background: `+(b?"rgba(255, 255, 255, .05)":"transparent")+`; + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var v;_&&(v=i.ownerDocument.defaultView.scrollY),r.input.focus(),_&&i.ownerDocument.defaultView.scrollTo(null,v),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=x,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function k(){if(i.selectionStart!=null){var E=n.somethingSelected(),R="​"+(E?i.value:"");i.value="⇚",i.value=R,t.prevInput=E?"":"​",i.selectionStart=1,i.selectionEnd=R.length,r.selForContextMenu=n.doc.sel}}function x(){if(t.contextMenuPending==x&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,b&&N<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!b||b&&N<9)&&k();var E=0,R=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?lt(n,El)(n):E++<10?r.detectingSelectAll=setTimeout(R,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(R,200)}}if(b&&N>=9&&k(),fe){ar(e);var M=function(){dt(window,"mouseup",M),setTimeout(x,20)};ve(window,"mouseup",M)}else setTimeout(x,50)},$e.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},$e.prototype.setUneditable=function(){},$e.prototype.needsContentAttribute=!1;function ku(e,t){if(t=t?Te(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=y(xe(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(ve(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(dt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=Ge(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function wu(e){e.off=dt,e.on=ve,e.wheelEventPixels=Fs,e.Doc=kt,e.splitLines=Pt,e.countColumn=Le,e.findColumn=Re,e.isWordChar=ae,e.Pass=qe,e.signal=Ye,e.Line=Hr,e.changeEnd=gr,e.scrollbarModel=al,e.Pos=L,e.cmpPos=Z,e.modes=Pr,e.mimeModes=Ht,e.resolveMode=Ir,e.getMode=zr,e.modeExtensions=fr,e.extendMode=Br,e.copyState=Gt,e.startState=Wr,e.innerMode=sn,e.commands=Nn,e.keyMap=nr,e.keyName=Xl,e.isModifierKey=Ul,e.lookupKey=$r,e.normalizeKeyMap=Qs,e.StringStream=Je,e.SharedTextMarker=Fn,e.TextMarker=mr,e.LineWidget=Mn,e.e_preventDefault=ht,e.e_stopPropagation=Nr,e.e_stop=ar,e.addClass=P,e.contains=m,e.rmClass=Ee,e.keyNames=yr}hu(Ge),mu(Ge);var Su="iter insert remove copy getEditor constructor".split(" ");for(var gi in kt.prototype)kt.prototype.hasOwnProperty(gi)&&oe(Su,gi)<0&&(Ge.prototype[gi]=function(e){return function(){return e.apply(this.doc,arguments)}}(kt.prototype[gi]));return Bt(kt),Ge.inputStyles={textarea:$e,contenteditable:je},Ge.defineMode=function(e){!Ge.defaults.mode&&e!="null"&&(Ge.defaults.mode=e),Rt.apply(this,arguments)},Ge.defineMIME=kr,Ge.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ge.defineMIME("text/plain","null"),Ge.defineExtension=function(e,t){Ge.prototype[e]=t},Ge.defineDocExtension=function(e,t){kt.prototype[e]=t},Ge.fromTextArea=ku,wu(Ge),Ge.version="5.65.18",Ge})}(ho)),ho.exports}var Cu=It();const Fu=Lu(Cu);var pa={exports:{}},ga;function wa(){return ga||(ga=1,function(Et,zt){(function(C){C(It())})(function(C){C.defineMode("css",function(fe,H){var Ee=H.inline;H.propertyKeywords||(H=C.resolveMode("text/css"));var D=fe.indentUnit,J=H.tokenHooks,d=H.documentTypes||{},S=H.mediaTypes||{},w=H.mediaFeatures||{},m=H.mediaValueKeywords||{},y=H.propertyKeywords||{},P=H.nonStandardPropertyKeywords||{},le=H.fontProperties||{},p=H.counterDescriptors||{},c=H.colorKeywords||{},Y=H.valueKeywords||{},xe=H.allowNested,j=H.lineComment,ue=H.supportsAtComponent===!0,Te=fe.highlightNonStandardPropertyKeywords!==!1,Le,be;function oe(T,B){return Le=B,T}function Ne(T,B){var F=T.next();if(J[F]){var Ie=J[F](T,B);if(Ie!==!1)return Ie}if(F=="@")return T.eatWhile(/[\w\\\-]/),oe("def",T.current());if(F=="="||(F=="~"||F=="|")&&T.eat("="))return oe(null,"compare");if(F=='"'||F=="'")return B.tokenize=qe(F),B.tokenize(T,B);if(F=="#")return T.eatWhile(/[\w\\\-]/),oe("atom","hash");if(F=="!")return T.match(/^\s*\w*/),oe("keyword","important");if(/\d/.test(F)||F=="."&&T.eat(/\d/))return T.eatWhile(/[\w.%]/),oe("number","unit");if(F==="-"){if(/[\d.]/.test(T.peek()))return T.eatWhile(/[\w.%]/),oe("number","unit");if(T.match(/^-[\w\\\-]*/))return T.eatWhile(/[\w\\\-]/),T.match(/^\s*:/,!1)?oe("variable-2","variable-definition"):oe("variable-2","variable");if(T.match(/^\w+-/))return oe("meta","meta")}else return/[,+>*\/]/.test(F)?oe(null,"select-op"):F=="."&&T.match(/^-?[_a-z][_a-z0-9-]*/i)?oe("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(F)?oe(null,F):T.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(T.current())&&(B.tokenize=Ve),oe("variable callee","variable")):/[\w\\\-]/.test(F)?(T.eatWhile(/[\w\\\-]/),oe("property","word")):oe(null,null)}function qe(T){return function(B,F){for(var Ie=!1,ae;(ae=B.next())!=null;){if(ae==T&&!Ie){T==")"&&B.backUp(1);break}Ie=!Ie&&ae=="\\"}return(ae==T||!Ie&&T!=")")&&(F.tokenize=null),oe("string","string")}}function Ve(T,B){return T.next(),T.match(/^\s*[\"\')]/,!1)?B.tokenize=null:B.tokenize=qe(")"),oe(null,"(")}function ct(T,B,F){this.type=T,this.indent=B,this.prev=F}function Oe(T,B,F,Ie){return T.context=new ct(F,B.indentation()+(Ie===!1?0:D),T.context),F}function Re(T){return T.context.prev&&(T.context=T.context.prev),T.context.type}function Ue(T,B,F){return Pe[F.context.type](T,B,F)}function et(T,B,F,Ie){for(var ae=Ie||1;ae>0;ae--)F.context=F.context.prev;return Ue(T,B,F)}function ge(T){var B=T.current().toLowerCase();Y.hasOwnProperty(B)?be="atom":c.hasOwnProperty(B)?be="keyword":be="variable"}var Pe={};return Pe.top=function(T,B,F){if(T=="{")return Oe(F,B,"block");if(T=="}"&&F.context.prev)return Re(F);if(ue&&/@component/i.test(T))return Oe(F,B,"atComponentBlock");if(/^@(-moz-)?document$/i.test(T))return Oe(F,B,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(T))return Oe(F,B,"atBlock");if(/^@(font-face|counter-style)/i.test(T))return F.stateArg=T,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(T))return"keyframes";if(T&&T.charAt(0)=="@")return Oe(F,B,"at");if(T=="hash")be="builtin";else if(T=="word")be="tag";else{if(T=="variable-definition")return"maybeprop";if(T=="interpolation")return Oe(F,B,"interpolation");if(T==":")return"pseudo";if(xe&&T=="(")return Oe(F,B,"parens")}return F.context.type},Pe.block=function(T,B,F){if(T=="word"){var Ie=B.current().toLowerCase();return y.hasOwnProperty(Ie)?(be="property","maybeprop"):P.hasOwnProperty(Ie)?(be=Te?"string-2":"property","maybeprop"):xe?(be=B.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(be+=" error","maybeprop")}else return T=="meta"?"block":!xe&&(T=="hash"||T=="qualifier")?(be="error","block"):Pe.top(T,B,F)},Pe.maybeprop=function(T,B,F){return T==":"?Oe(F,B,"prop"):Ue(T,B,F)},Pe.prop=function(T,B,F){if(T==";")return Re(F);if(T=="{"&&xe)return Oe(F,B,"propBlock");if(T=="}"||T=="{")return et(T,B,F);if(T=="(")return Oe(F,B,"parens");if(T=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(B.current()))be+=" error";else if(T=="word")ge(B);else if(T=="interpolation")return Oe(F,B,"interpolation");return"prop"},Pe.propBlock=function(T,B,F){return T=="}"?Re(F):T=="word"?(be="property","maybeprop"):F.context.type},Pe.parens=function(T,B,F){return T=="{"||T=="}"?et(T,B,F):T==")"?Re(F):T=="("?Oe(F,B,"parens"):T=="interpolation"?Oe(F,B,"interpolation"):(T=="word"&&ge(B),"parens")},Pe.pseudo=function(T,B,F){return T=="meta"?"pseudo":T=="word"?(be="variable-3",F.context.type):Ue(T,B,F)},Pe.documentTypes=function(T,B,F){return T=="word"&&d.hasOwnProperty(B.current())?(be="tag",F.context.type):Pe.atBlock(T,B,F)},Pe.atBlock=function(T,B,F){if(T=="(")return Oe(F,B,"atBlock_parens");if(T=="}"||T==";")return et(T,B,F);if(T=="{")return Re(F)&&Oe(F,B,xe?"block":"top");if(T=="interpolation")return Oe(F,B,"interpolation");if(T=="word"){var Ie=B.current().toLowerCase();Ie=="only"||Ie=="not"||Ie=="and"||Ie=="or"?be="keyword":S.hasOwnProperty(Ie)?be="attribute":w.hasOwnProperty(Ie)?be="property":m.hasOwnProperty(Ie)?be="keyword":y.hasOwnProperty(Ie)?be="property":P.hasOwnProperty(Ie)?be=Te?"string-2":"property":Y.hasOwnProperty(Ie)?be="atom":c.hasOwnProperty(Ie)?be="keyword":be="error"}return F.context.type},Pe.atComponentBlock=function(T,B,F){return T=="}"?et(T,B,F):T=="{"?Re(F)&&Oe(F,B,xe?"block":"top",!1):(T=="word"&&(be="error"),F.context.type)},Pe.atBlock_parens=function(T,B,F){return T==")"?Re(F):T=="{"||T=="}"?et(T,B,F,2):Pe.atBlock(T,B,F)},Pe.restricted_atBlock_before=function(T,B,F){return T=="{"?Oe(F,B,"restricted_atBlock"):T=="word"&&F.stateArg=="@counter-style"?(be="variable","restricted_atBlock_before"):Ue(T,B,F)},Pe.restricted_atBlock=function(T,B,F){return T=="}"?(F.stateArg=null,Re(F)):T=="word"?(F.stateArg=="@font-face"&&!le.hasOwnProperty(B.current().toLowerCase())||F.stateArg=="@counter-style"&&!p.hasOwnProperty(B.current().toLowerCase())?be="error":be="property","maybeprop"):"restricted_atBlock"},Pe.keyframes=function(T,B,F){return T=="word"?(be="variable","keyframes"):T=="{"?Oe(F,B,"top"):Ue(T,B,F)},Pe.at=function(T,B,F){return T==";"?Re(F):T=="{"||T=="}"?et(T,B,F):(T=="word"?be="tag":T=="hash"&&(be="builtin"),"at")},Pe.interpolation=function(T,B,F){return T=="}"?Re(F):T=="{"||T==";"?et(T,B,F):(T=="word"?be="variable":T!="variable"&&T!="("&&T!=")"&&(be="error"),"interpolation")},{startState:function(T){return{tokenize:null,state:Ee?"block":"top",stateArg:null,context:new ct(Ee?"block":"top",T||0,null)}},token:function(T,B){if(!B.tokenize&&T.eatSpace())return null;var F=(B.tokenize||Ne)(T,B);return F&&typeof F=="object"&&(Le=F[1],F=F[0]),be=F,Le!="comment"&&(B.state=Pe[B.state](Le,T,B)),be},indent:function(T,B){var F=T.context,Ie=B&&B.charAt(0),ae=F.indent;return F.type=="prop"&&(Ie=="}"||Ie==")")&&(F=F.prev),F.prev&&(Ie=="}"&&(F.type=="block"||F.type=="top"||F.type=="interpolation"||F.type=="restricted_atBlock")?(F=F.prev,ae=F.indent):(Ie==")"&&(F.type=="parens"||F.type=="atBlock_parens")||Ie=="{"&&(F.type=="at"||F.type=="atBlock"))&&(ae=Math.max(0,F.indent-D))),ae},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:j,fold:"brace"}});function De(fe){for(var H={},Ee=0;Ee")):null:d.match("--")?w(ke("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),w(we(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),S.tokenize=ke("meta","?>"),"meta"):(ie=d.eat("/")?"closeTag":"openTag",S.tokenize=z,"tag bracket");if(m=="&"){var y;return d.eat("#")?d.eat("x")?y=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):y=d.eatWhile(/[\d]/)&&d.eat(";"):y=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),y?"atom":"error"}else return d.eatWhile(/[^&<]/),null}q.isInText=!0;function z(d,S){var w=d.next();if(w==">"||w=="/"&&d.eat(">"))return S.tokenize=q,ie=w==">"?"endTag":"selfcloseTag","tag bracket";if(w=="=")return ie="equals",null;if(w=="<"){S.tokenize=q,S.state=Ae,S.tagName=S.tagStart=null;var m=S.tokenize(d,S);return m?m+" tag error":"tag error"}else return/[\'\"]/.test(w)?(S.tokenize=X(w),S.stringStartCol=d.column(),S.tokenize(d,S)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function X(d){var S=function(w,m){for(;!w.eol();)if(w.next()==d){m.tokenize=z;break}return"string"};return S.isInAttribute=!0,S}function ke(d,S){return function(w,m){for(;!w.eol();){if(w.match(S)){m.tokenize=q;break}w.next()}return d}}function we(d){return function(S,w){for(var m;(m=S.next())!=null;){if(m=="<")return w.tokenize=we(d+1),w.tokenize(S,w);if(m==">")if(d==1){w.tokenize=q;break}else return w.tokenize=we(d-1),w.tokenize(S,w)}return"meta"}}function te(d){return d&&d.toLowerCase()}function re(d,S,w){this.prev=d.context,this.tagName=S||"",this.indent=d.indented,this.startOfLine=w,(b.doNotIndent.hasOwnProperty(S)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function ne(d){d.context&&(d.context=d.context.prev)}function se(d,S){for(var w;;){if(!d.context||(w=d.context.tagName,!b.contextGrabbers.hasOwnProperty(te(w))||!b.contextGrabbers[te(w)].hasOwnProperty(te(S))))return;ne(d)}}function Ae(d,S,w){return d=="openTag"?(w.tagStart=S.column(),ye):d=="closeTag"?de:Ae}function ye(d,S,w){return d=="word"?(w.tagName=S.current(),O="tag",H):b.allowMissingTagName&&d=="endTag"?(O="tag bracket",H(d,S,w)):(O="error",ye)}function de(d,S,w){if(d=="word"){var m=S.current();return w.context&&w.context.tagName!=m&&b.implicitlyClosed.hasOwnProperty(te(w.context.tagName))&&ne(w),w.context&&w.context.tagName==m||b.matchClosing===!1?(O="tag",ze):(O="tag error",fe)}else return b.allowMissingTagName&&d=="endTag"?(O="tag bracket",ze(d,S,w)):(O="error",fe)}function ze(d,S,w){return d!="endTag"?(O="error",ze):(ne(w),Ae)}function fe(d,S,w){return O="error",ze(d,S,w)}function H(d,S,w){if(d=="word")return O="attribute",Ee;if(d=="endTag"||d=="selfcloseTag"){var m=w.tagName,y=w.tagStart;return w.tagName=w.tagStart=null,d=="selfcloseTag"||b.autoSelfClosers.hasOwnProperty(te(m))?se(w,m):(se(w,m),w.context=new re(w,m,y==w.indented)),Ae}return O="error",H}function Ee(d,S,w){return d=="equals"?D:(b.allowMissing||(O="error"),H(d,S,w))}function D(d,S,w){return d=="string"?J:d=="word"&&b.allowUnquoted?(O="string",H):(O="error",H(d,S,w))}function J(d,S,w){return d=="string"?J:H(d,S,w)}return{startState:function(d){var S={tokenize:q,state:Ae,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(S.baseIndent=d),S},token:function(d,S){if(!S.tagName&&d.sol()&&(S.indented=d.indentation()),d.eatSpace())return null;ie=null;var w=S.tokenize(d,S);return(w||ie)&&w!="comment"&&(O=null,S.state=S.state(ie||w,d,S),O&&(w=O=="error"?w+" error":O)),w},indent:function(d,S,w){var m=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+V;if(m&&m.noIndent)return C.Pass;if(d.tokenize!=z&&d.tokenize!=q)return w?w.match(/^(\s*)/)[0].length:0;if(d.tagName)return b.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+V*(b.multilineTagIndentFactor||1);if(b.alignCDATA&&/$/,blockCommentStart:"",configuration:b.htmlMode?"html":"xml",helperType:b.htmlMode?"html":"xml",skipAttribute:function(d){d.state==D&&(d.state=H)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var S=[],w=d.context;w;w=w.prev)S.push(w.tagName);return S.reverse()}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),va.exports}var ya={exports:{}},xa;function Ta(){return xa||(xa=1,function(Et,zt){(function(C){C(It())})(function(C){C.defineMode("javascript",function(De,I){var K=De.indentUnit,$=I.statementIndent,V=I.jsonld,b=I.json||V,N=I.trackScope!==!1,_=I.typescript,ie=I.wordCharacters||/[\w$\xa1-\uffff]/,O=function(){function f(it){return{type:it,style:"keyword"}}var g=f("keyword a"),A=f("keyword b"),W=f("keyword c"),L=f("keyword d"),Z=f("operator"),_e={type:"atom",style:"atom"};return{if:f("if"),while:g,with:g,else:A,do:A,try:A,finally:A,return:L,break:L,continue:L,new:f("new"),delete:W,void:W,throw:W,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:Z,typeof:Z,instanceof:Z,true:_e,false:_e,null:_e,undefined:_e,NaN:_e,Infinity:_e,this:f("this"),class:f("class"),super:f("atom"),yield:W,export:f("export"),import:f("import"),extends:W,await:W}}(),q=/[+\-*&%=<>!?|~^@]/,z=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function X(f){for(var g=!1,A,W=!1;(A=f.next())!=null;){if(!g){if(A=="/"&&!W)return;A=="["?W=!0:W&&A=="]"&&(W=!1)}g=!g&&A=="\\"}}var ke,we;function te(f,g,A){return ke=f,we=A,g}function re(f,g){var A=f.next();if(A=='"'||A=="'")return g.tokenize=ne(A),g.tokenize(f,g);if(A=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return te("number","number");if(A=="."&&f.match(".."))return te("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(A))return te(A);if(A=="="&&f.eat(">"))return te("=>","operator");if(A=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return te("number","number");if(/\d/.test(A))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),te("number","number");if(A=="/")return f.eat("*")?(g.tokenize=se,se(f,g)):f.eat("/")?(f.skipToEnd(),te("comment","comment")):Ft(f,g,1)?(X(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),te("regexp","string-2")):(f.eat("="),te("operator","operator",f.current()));if(A=="`")return g.tokenize=Ae,Ae(f,g);if(A=="#"&&f.peek()=="!")return f.skipToEnd(),te("meta","meta");if(A=="#"&&f.eatWhile(ie))return te("variable","property");if(A=="<"&&f.match("!--")||A=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),te("comment","comment");if(q.test(A))return(A!=">"||!g.lexical||g.lexical.type!=">")&&(f.eat("=")?(A=="!"||A=="=")&&f.eat("="):/[<>*+\-|&?]/.test(A)&&(f.eat(A),A==">"&&f.eat(A))),A=="?"&&f.eat(".")?te("."):te("operator","operator",f.current());if(ie.test(A)){f.eatWhile(ie);var W=f.current();if(g.lastType!="."){if(O.propertyIsEnumerable(W)){var L=O[W];return te(L.type,L.style,W)}if(W=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return te("async","keyword",W)}return te("variable","variable",W)}}function ne(f){return function(g,A){var W=!1,L;if(V&&g.peek()=="@"&&g.match(z))return A.tokenize=re,te("jsonld-keyword","meta");for(;(L=g.next())!=null&&!(L==f&&!W);)W=!W&&L=="\\";return W||(A.tokenize=re),te("string","string")}}function se(f,g){for(var A=!1,W;W=f.next();){if(W=="/"&&A){g.tokenize=re;break}A=W=="*"}return te("comment","comment")}function Ae(f,g){for(var A=!1,W;(W=f.next())!=null;){if(!A&&(W=="`"||W=="$"&&f.eat("{"))){g.tokenize=re;break}A=!A&&W=="\\"}return te("quasi","string-2",f.current())}var ye="([{}])";function de(f,g){g.fatArrowAt&&(g.fatArrowAt=null);var A=f.string.indexOf("=>",f.start);if(!(A<0)){if(_){var W=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,A));W&&(A=W.index)}for(var L=0,Z=!1,_e=A-1;_e>=0;--_e){var it=f.string.charAt(_e),xt=ye.indexOf(it);if(xt>=0&&xt<3){if(!L){++_e;break}if(--L==0){it=="("&&(Z=!0);break}}else if(xt>=3&&xt<6)++L;else if(ie.test(it))Z=!0;else if(/["'\/`]/.test(it))for(;;--_e){if(_e==0)return;var _r=f.string.charAt(_e-1);if(_r==it&&f.string.charAt(_e-2)!="\\"){_e--;break}}else if(Z&&!L){++_e;break}}Z&&!L&&(g.fatArrowAt=_e)}}var ze={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function fe(f,g,A,W,L,Z){this.indented=f,this.column=g,this.type=A,this.prev=L,this.info=Z,W!=null&&(this.align=W)}function H(f,g){if(!N)return!1;for(var A=f.localVars;A;A=A.next)if(A.name==g)return!0;for(var W=f.context;W;W=W.prev)for(var A=W.vars;A;A=A.next)if(A.name==g)return!0}function Ee(f,g,A,W,L){var Z=f.cc;for(D.state=f,D.stream=L,D.marked=null,D.cc=Z,D.style=g,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var _e=Z.length?Z.pop():b?oe:Le;if(_e(A,W)){for(;Z.length&&Z[Z.length-1].lex;)Z.pop()();return D.marked?D.marked:A=="variable"&&H(f,W)?"variable-2":g}}}var D={state:null,column:null,marked:null,cc:null};function J(){for(var f=arguments.length-1;f>=0;f--)D.cc.push(arguments[f])}function d(){return J.apply(null,arguments),!0}function S(f,g){for(var A=g;A;A=A.next)if(A.name==f)return!0;return!1}function w(f){var g=D.state;if(D.marked="def",!!N){if(g.context){if(g.lexical.info=="var"&&g.context&&g.context.block){var A=m(f,g.context);if(A!=null){g.context=A;return}}else if(!S(f,g.localVars)){g.localVars=new le(f,g.localVars);return}}I.globalVars&&!S(f,g.globalVars)&&(g.globalVars=new le(f,g.globalVars))}}function m(f,g){if(g)if(g.block){var A=m(f,g.prev);return A?A==g.prev?g:new P(A,g.vars,!0):null}else return S(f,g.vars)?g:new P(g.prev,new le(f,g.vars),!1);else return null}function y(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function P(f,g,A){this.prev=f,this.vars=g,this.block=A}function le(f,g){this.name=f,this.next=g}var p=new le("this",new le("arguments",null));function c(){D.state.context=new P(D.state.context,D.state.localVars,!1),D.state.localVars=p}function Y(){D.state.context=new P(D.state.context,D.state.localVars,!0),D.state.localVars=null}c.lex=Y.lex=!0;function xe(){D.state.localVars=D.state.context.vars,D.state.context=D.state.context.prev}xe.lex=!0;function j(f,g){var A=function(){var W=D.state,L=W.indented;if(W.lexical.type=="stat")L=W.lexical.indented;else for(var Z=W.lexical;Z&&Z.type==")"&&Z.align;Z=Z.prev)L=Z.indented;W.lexical=new fe(L,D.stream.column(),f,null,W.lexical,g)};return A.lex=!0,A}function ue(){var f=D.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}ue.lex=!0;function Te(f){function g(A){return A==f?d():f==";"||A=="}"||A==")"||A=="]"?J():d(g)}return g}function Le(f,g){return f=="var"?d(j("vardef",g),Nr,Te(";"),ue):f=="keyword a"?d(j("form"),qe,Le,ue):f=="keyword b"?d(j("form"),Le,ue):f=="keyword d"?D.stream.match(/^\s*$/,!1)?d():d(j("stat"),ct,Te(";"),ue):f=="debugger"?d(Te(";")):f=="{"?d(j("}"),Y,Nt,ue,xe):f==";"?d():f=="if"?(D.state.lexical.info=="else"&&D.state.cc[D.state.cc.length-1]==ue&&D.state.cc.pop()(),d(j("form"),qe,Le,ue,Or)):f=="function"?d(Pt):f=="for"?d(j("form"),Y,Wn,Le,xe,ue):f=="class"||_&&g=="interface"?(D.marked="keyword",d(j("form",f=="class"?f:g),Pr,ue)):f=="variable"?_&&g=="declare"?(D.marked="keyword",d(Le)):_&&(g=="module"||g=="enum"||g=="type")&&D.stream.match(/^\s*\w/,!1)?(D.marked="keyword",g=="enum"?d(ce):g=="type"?d(_n,Te("operator"),We,Te(";")):d(j("form"),yt,Te("{"),j("}"),Nt,ue,ue)):_&&g=="namespace"?(D.marked="keyword",d(j("form"),oe,Le,ue)):_&&g=="abstract"?(D.marked="keyword",d(Le)):d(j("stat"),Ie):f=="switch"?d(j("form"),qe,Te("{"),j("}","switch"),Y,Nt,ue,ue,xe):f=="case"?d(oe,Te(":")):f=="default"?d(Te(":")):f=="catch"?d(j("form"),c,be,Le,ue,xe):f=="export"?d(j("stat"),Ir,ue):f=="import"?d(j("stat"),fr,ue):f=="async"?d(Le):g=="@"?d(oe,Le):J(j("stat"),oe,Te(";"),ue)}function be(f){if(f=="(")return d(_t,Te(")"))}function oe(f,g){return Ve(f,g,!1)}function Ne(f,g){return Ve(f,g,!0)}function qe(f){return f!="("?J():d(j(")"),ct,Te(")"),ue)}function Ve(f,g,A){if(D.state.fatArrowAt==D.stream.start){var W=A?Pe:ge;if(f=="(")return d(c,j(")"),Me(_t,")"),ue,Te("=>"),W,xe);if(f=="variable")return J(c,yt,Te("=>"),W,xe)}var L=A?Re:Oe;return ze.hasOwnProperty(f)?d(L):f=="function"?d(Pt,L):f=="class"||_&&g=="interface"?(D.marked="keyword",d(j("form"),yi,ue)):f=="keyword c"||f=="async"?d(A?Ne:oe):f=="("?d(j(")"),ct,Te(")"),ue,L):f=="operator"||f=="spread"?d(A?Ne:oe):f=="["?d(j("]"),Je,ue,L):f=="{"?Lt(Se,"}",null,L):f=="quasi"?J(Ue,L):f=="new"?d(T(A)):d()}function ct(f){return f.match(/[;\}\)\],]/)?J():J(oe)}function Oe(f,g){return f==","?d(ct):Re(f,g,!1)}function Re(f,g,A){var W=A==!1?Oe:Re,L=A==!1?oe:Ne;if(f=="=>")return d(c,A?Pe:ge,xe);if(f=="operator")return/\+\+|--/.test(g)||_&&g=="!"?d(W):_&&g=="<"&&D.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?d(j(">"),Me(We,">"),ue,W):g=="?"?d(oe,Te(":"),L):d(L);if(f=="quasi")return J(Ue,W);if(f!=";"){if(f=="(")return Lt(Ne,")","call",W);if(f==".")return d(ae,W);if(f=="[")return d(j("]"),ct,Te("]"),ue,W);if(_&&g=="as")return D.marked="keyword",d(We,W);if(f=="regexp")return D.state.lastType=D.marked="operator",D.stream.backUp(D.stream.pos-D.stream.start-1),d(L)}}function Ue(f,g){return f!="quasi"?J():g.slice(g.length-2)!="${"?d(Ue):d(ct,et)}function et(f){if(f=="}")return D.marked="string-2",D.state.tokenize=Ae,d(Ue)}function ge(f){return de(D.stream,D.state),J(f=="{"?Le:oe)}function Pe(f){return de(D.stream,D.state),J(f=="{"?Le:Ne)}function T(f){return function(g){return g=="."?d(f?F:B):g=="variable"&&_?d(Ct,f?Re:Oe):J(f?Ne:oe)}}function B(f,g){if(g=="target")return D.marked="keyword",d(Oe)}function F(f,g){if(g=="target")return D.marked="keyword",d(Re)}function Ie(f){return f==":"?d(ue,Le):J(Oe,Te(";"),ue)}function ae(f){if(f=="variable")return D.marked="property",d()}function Se(f,g){if(f=="async")return D.marked="property",d(Se);if(f=="variable"||D.style=="keyword"){if(D.marked="property",g=="get"||g=="set")return d(he);var A;return _&&D.state.fatArrowAt==D.stream.start&&(A=D.stream.match(/^\s*:\s*/,!1))&&(D.state.fatArrowAt=D.stream.pos+A[0].length),d(Be)}else{if(f=="number"||f=="string")return D.marked=V?"property":D.style+" property",d(Be);if(f=="jsonld-keyword")return d(Be);if(_&&y(g))return D.marked="keyword",d(Se);if(f=="[")return d(oe,or,Te("]"),Be);if(f=="spread")return d(Ne,Be);if(g=="*")return D.marked="keyword",d(Se);if(f==":")return J(Be)}}function he(f){return f!="variable"?J(Be):(D.marked="property",d(Pt))}function Be(f){if(f==":")return d(Ne);if(f=="(")return J(Pt)}function Me(f,g,A){function W(L,Z){if(A?A.indexOf(L)>-1:L==","){var _e=D.state.lexical;return _e.info=="call"&&(_e.pos=(_e.pos||0)+1),d(function(it,xt){return it==g||xt==g?J():J(f)},W)}return L==g||Z==g?d():A&&A.indexOf(";")>-1?J(f):d(Te(g))}return function(L,Z){return L==g||Z==g?d():J(f,W)}}function Lt(f,g,A){for(var W=3;W"),We);if(f=="quasi")return J(dt,Ot)}function Bn(f){if(f=="=>")return d(We)}function ve(f){return f.match(/[\}\)\]]/)?d():f==","||f==";"?d(ve):J(Qt,ve)}function Qt(f,g){if(f=="variable"||D.style=="keyword")return D.marked="property",d(Qt);if(g=="?"||f=="number"||f=="string")return d(Qt);if(f==":")return d(We);if(f=="[")return d(Te("variable"),br,Te("]"),Qt);if(f=="(")return J(ur,Qt);if(!f.match(/[;\}\)\],]/))return d()}function dt(f,g){return f!="quasi"?J():g.slice(g.length-2)!="${"?d(dt):d(We,Ye)}function Ye(f){if(f=="}")return D.marked="string-2",D.state.tokenize=Ae,d(dt)}function Ze(f,g){return f=="variable"&&D.stream.match(/^\s*[?:]/,!1)||g=="?"?d(Ze):f==":"?d(We):f=="spread"?d(Ze):J(We)}function Ot(f,g){if(g=="<")return d(j(">"),Me(We,">"),ue,Ot);if(g=="|"||f=="."||g=="&")return d(We);if(f=="[")return d(We,Te("]"),Ot);if(g=="extends"||g=="implements")return D.marked="keyword",d(We);if(g=="?")return d(We,Te(":"),We)}function Ct(f,g){if(g=="<")return d(j(">"),Me(We,">"),ue,Ot)}function Bt(){return J(We,ht)}function ht(f,g){if(g=="=")return d(We)}function Nr(f,g){return g=="enum"?(D.marked="keyword",d(ce)):J(yt,or,Wt,mi)}function yt(f,g){if(_&&y(g))return D.marked="keyword",d(yt);if(f=="variable")return w(g),d();if(f=="spread")return d(yt);if(f=="[")return Lt(ln,"]");if(f=="{")return Lt(ar,"}")}function ar(f,g){return f=="variable"&&!D.stream.match(/^\s*:/,!1)?(w(g),d(Wt)):(f=="variable"&&(D.marked="property"),f=="spread"?d(yt):f=="}"?J():f=="["?d(oe,Te("]"),Te(":"),ar):d(Te(":"),yt,Wt))}function ln(){return J(yt,Wt)}function Wt(f,g){if(g=="=")return d(Ne)}function mi(f){if(f==",")return d(Nr)}function Or(f,g){if(f=="keyword b"&&g=="else")return d(j("form","else"),Le,ue)}function Wn(f,g){if(g=="await")return d(Wn);if(f=="(")return d(j(")"),an,ue)}function an(f){return f=="var"?d(Nr,sr):f=="variable"?d(sr):J(sr)}function sr(f,g){return f==")"?d():f==";"?d(sr):g=="in"||g=="of"?(D.marked="keyword",d(oe,sr)):J(oe,sr)}function Pt(f,g){if(g=="*")return D.marked="keyword",d(Pt);if(f=="variable")return w(g),d(Pt);if(f=="(")return d(c,j(")"),Me(_t,")"),ue,lr,Le,xe);if(_&&g=="<")return d(j(">"),Me(Bt,">"),ue,Pt)}function ur(f,g){if(g=="*")return D.marked="keyword",d(ur);if(f=="variable")return w(g),d(ur);if(f=="(")return d(c,j(")"),Me(_t,")"),ue,lr,xe);if(_&&g=="<")return d(j(">"),Me(Bt,">"),ue,ur)}function _n(f,g){if(f=="keyword"||f=="variable")return D.marked="type",d(_n);if(g=="<")return d(j(">"),Me(Bt,">"),ue)}function _t(f,g){return g=="@"&&d(oe,_t),f=="spread"?d(_t):_&&y(g)?(D.marked="keyword",d(_t)):_&&f=="this"?d(or,Wt):J(yt,or,Wt)}function yi(f,g){return f=="variable"?Pr(f,g):Ht(f,g)}function Pr(f,g){if(f=="variable")return w(g),d(Ht)}function Ht(f,g){if(g=="<")return d(j(">"),Me(Bt,">"),ue,Ht);if(g=="extends"||g=="implements"||_&&f==",")return g=="implements"&&(D.marked="keyword"),d(_?We:oe,Ht);if(f=="{")return d(j("}"),Rt,ue)}function Rt(f,g){if(f=="async"||f=="variable"&&(g=="static"||g=="get"||g=="set"||_&&y(g))&&D.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return D.marked="keyword",d(Rt);if(f=="variable"||D.style=="keyword")return D.marked="property",d(kr,Rt);if(f=="number"||f=="string")return d(kr,Rt);if(f=="[")return d(oe,or,Te("]"),kr,Rt);if(g=="*")return D.marked="keyword",d(Rt);if(_&&f=="(")return J(ur,Rt);if(f==";"||f==",")return d(Rt);if(f=="}")return d();if(g=="@")return d(oe,Rt)}function kr(f,g){if(g=="!"||g=="?")return d(kr);if(f==":")return d(We,Wt);if(g=="=")return d(Ne);var A=D.state.lexical.prev,W=A&&A.info=="interface";return J(W?ur:Pt)}function Ir(f,g){return g=="*"?(D.marked="keyword",d(Wr,Te(";"))):g=="default"?(D.marked="keyword",d(oe,Te(";"))):f=="{"?d(Me(zr,"}"),Wr,Te(";")):J(Le)}function zr(f,g){if(g=="as")return D.marked="keyword",d(Te("variable"));if(f=="variable")return J(Ne,zr)}function fr(f){return f=="string"?d():f=="("?J(oe):f=="."?J(Oe):J(Br,Gt,Wr)}function Br(f,g){return f=="{"?Lt(Br,"}"):(f=="variable"&&w(g),g=="*"&&(D.marked="keyword"),d(sn))}function Gt(f){if(f==",")return d(Br,Gt)}function sn(f,g){if(g=="as")return D.marked="keyword",d(Br)}function Wr(f,g){if(g=="from")return D.marked="keyword",d(oe)}function Je(f){return f=="]"?d():J(Me(Ne,"]"))}function ce(){return J(j("form"),yt,Te("{"),j("}"),Me(Vt,"}"),ue,ue)}function Vt(){return J(yt,Wt)}function un(f,g){return f.lastType=="operator"||f.lastType==","||q.test(g.charAt(0))||/[,.]/.test(g.charAt(0))}function Ft(f,g,A){return g.tokenize==re&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(g.lastType)||g.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(A||0)))}return{startState:function(f){var g={tokenize:re,lastType:"sof",cc:[],lexical:new fe((f||0)-K,0,"block",!1),localVars:I.localVars,context:I.localVars&&new P(null,null,!1),indented:f||0};return I.globalVars&&typeof I.globalVars=="object"&&(g.globalVars=I.globalVars),g},token:function(f,g){if(f.sol()&&(g.lexical.hasOwnProperty("align")||(g.lexical.align=!1),g.indented=f.indentation(),de(f,g)),g.tokenize!=se&&f.eatSpace())return null;var A=g.tokenize(f,g);return ke=="comment"?A:(g.lastType=ke=="operator"&&(we=="++"||we=="--")?"incdec":ke,Ee(g,A,ke,we,f))},indent:function(f,g){if(f.tokenize==se||f.tokenize==Ae)return C.Pass;if(f.tokenize!=re)return 0;var A=g&&g.charAt(0),W=f.lexical,L;if(!/^\s*else\b/.test(g))for(var Z=f.cc.length-1;Z>=0;--Z){var _e=f.cc[Z];if(_e==ue)W=W.prev;else if(_e!=Or&&_e!=xe)break}for(;(W.type=="stat"||W.type=="form")&&(A=="}"||(L=f.cc[f.cc.length-1])&&(L==Oe||L==Re)&&!/^[,\.=+\-*:?[\(]/.test(g));)W=W.prev;$&&W.type==")"&&W.prev.type=="stat"&&(W=W.prev);var it=W.type,xt=A==it;return it=="vardef"?W.indented+(f.lastType=="operator"||f.lastType==","?W.info.length+1:0):it=="form"&&A=="{"?W.indented:it=="form"?W.indented+K:it=="stat"?W.indented+(un(f,g)?$||K:0):W.info=="switch"&&!xt&&I.doubleIndentSwitch!=!1?W.indented+(/^(?:case|default)\b/.test(g)?K:2*K):W.align?W.column+(xt?0:1):W.indented+(xt?0:K)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:b?null:"/*",blockCommentEnd:b?null:"*/",blockCommentContinue:b?null:" * ",lineComment:b?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:b?"json":"javascript",jsonldMode:V,jsonMode:b,expressionAllowed:Ft,skipExpression:function(f){Ee(f,"atom","atom","true",new C.StringStream("",2,null))}}}),C.registerHelper("wordChars","javascript",/[\w$]/),C.defineMIME("text/javascript","javascript"),C.defineMIME("text/ecmascript","javascript"),C.defineMIME("application/javascript","javascript"),C.defineMIME("application/x-javascript","javascript"),C.defineMIME("application/ecmascript","javascript"),C.defineMIME("application/json",{name:"javascript",json:!0}),C.defineMIME("application/x-json",{name:"javascript",json:!0}),C.defineMIME("application/manifest+json",{name:"javascript",json:!0}),C.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),C.defineMIME("text/typescript",{name:"javascript",typescript:!0}),C.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}()),ya.exports}(function(Et,zt){(function(C){C(It(),Sa(),Ta(),wa())})(function(C){var De={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function I(ie,O,q){var z=ie.current(),X=z.search(O);return X>-1?ie.backUp(z.length-X):z.match(/<\/?$/)&&(ie.backUp(z.length),ie.match(O,!1)||ie.match(z)),q}var K={};function $(ie){var O=K[ie];return O||(K[ie]=new RegExp("\\s+"+ie+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function V(ie,O){var q=ie.match($(O));return q?/^\s*(.*?)\s*$/.exec(q[2])[1]:""}function b(ie,O){return new RegExp((O?"^":"")+"","i")}function N(ie,O){for(var q in ie)for(var z=O[q]||(O[q]=[]),X=ie[q],ke=X.length-1;ke>=0;ke--)z.unshift(X[ke])}function _(ie,O){for(var q=0;q=0;we--)z.script.unshift(["type",ke[we].matches,ke[we].mode]);function te(re,ne){var se=q.token(re,ne.htmlState),Ae=/\btag\b/.test(se),ye;if(Ae&&!/[<>\s\/]/.test(re.current())&&(ye=ne.htmlState.tagName&&ne.htmlState.tagName.toLowerCase())&&z.hasOwnProperty(ye))ne.inTag=ye+" ";else if(ne.inTag&&Ae&&/>$/.test(re.current())){var de=/^([\S]+) (.*)/.exec(ne.inTag);ne.inTag=null;var ze=re.current()==">"&&_(z[de[1]],de[2]),fe=C.getMode(ie,ze),H=b(de[1],!0),Ee=b(de[1],!1);ne.token=function(D,J){return D.match(H,!1)?(J.token=te,J.localState=J.localMode=null,null):I(D,Ee,J.localMode.token(D,J.localState))},ne.localMode=fe,ne.localState=C.startState(fe,q.indent(ne.htmlState,"",""))}else ne.inTag&&(ne.inTag+=re.current(),re.eol()&&(ne.inTag+=" "));return se}return{startState:function(){var re=C.startState(q);return{token:te,inTag:null,localMode:null,localState:null,htmlState:re}},copyState:function(re){var ne;return re.localState&&(ne=C.copyState(re.localMode,re.localState)),{token:re.token,inTag:re.inTag,localMode:re.localMode,localState:ne,htmlState:C.copyState(q,re.htmlState)}},token:function(re,ne){return ne.token(re,ne)},indent:function(re,ne,se){return!re.localMode||/^\s*<\//.test(ne)?q.indent(re.htmlState,ne,se):re.localMode.indent?re.localMode.indent(re.localState,ne,se):C.Pass},innerMode:function(re){return{state:re.localState||re.htmlState,mode:re.localMode||q}}}},"xml","javascript","css"),C.defineMIME("text/html","htmlmixed")})})();Ta();(function(Et,zt){(function(C){C(It())})(function(C){function De(N){return new RegExp("^(("+N.join(")|(")+"))\\b")}var I=De(["and","or","not","is"]),K=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],$=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];C.registerHelper("hintWords","python",K.concat($).concat(["exec","print"]));function V(N){return N.scopes[N.scopes.length-1]}C.defineMode("python",function(N,_){for(var ie="error",O=_.delimiters||_.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,q=[_.singleOperators,_.doubleOperators,_.doubleDelimiters,_.tripleDelimiters,_.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],z=0;zy?H(w):P0&&D(S,w)&&(le+=" "+ie),le}}return de(S,w)}function de(S,w,m){if(S.eatSpace())return null;if(!m&&S.match(/^#.*/))return"comment";if(S.match(/^[0-9\.]/,!1)){var y=!1;if(S.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(y=!0),S.match(/^[\d_]+\.\d*/)&&(y=!0),S.match(/^\.\d+/)&&(y=!0),y)return S.eat(/J/i),"number";var P=!1;if(S.match(/^0x[0-9a-f_]+/i)&&(P=!0),S.match(/^0b[01_]+/i)&&(P=!0),S.match(/^0o[0-7_]+/i)&&(P=!0),S.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(S.eat(/J/i),P=!0),S.match(/^0(?![\dx])/i)&&(P=!0),P)return S.eat(/L/i),"number"}if(S.match(ne)){var le=S.current().toLowerCase().indexOf("f")!==-1;return le?(w.tokenize=ze(S.current(),w.tokenize),w.tokenize(S,w)):(w.tokenize=fe(S.current(),w.tokenize),w.tokenize(S,w))}for(var p=0;p=0;)S=S.substr(1);var m=S.length==1,y="string";function P(p){return function(c,Y){var xe=de(c,Y,!0);return xe=="punctuation"&&(c.current()=="{"?Y.tokenize=P(p+1):c.current()=="}"&&(p>1?Y.tokenize=P(p-1):Y.tokenize=le)),xe}}function le(p,c){for(;!p.eol();)if(p.eatWhile(/[^'"\{\}\\]/),p.eat("\\")){if(p.next(),m&&p.eol())return y}else{if(p.match(S))return c.tokenize=w,y;if(p.match("{{"))return y;if(p.match("{",!1))return c.tokenize=P(0),p.current()?y:c.tokenize(p,c);if(p.match("}}"))return y;if(p.match("}"))return ie;p.eat(/['"]/)}if(m){if(_.singleLineStringErrors)return ie;c.tokenize=w}return y}return le.isString=!0,le}function fe(S,w){for(;"rubf".indexOf(S.charAt(0).toLowerCase())>=0;)S=S.substr(1);var m=S.length==1,y="string";function P(le,p){for(;!le.eol();)if(le.eatWhile(/[^'"\\]/),le.eat("\\")){if(le.next(),m&&le.eol())return y}else{if(le.match(S))return p.tokenize=w,y;le.eat(/['"]/)}if(m){if(_.singleLineStringErrors)return ie;p.tokenize=w}return y}return P.isString=!0,P}function H(S){for(;V(S).type!="py";)S.scopes.pop();S.scopes.push({offset:V(S).offset+N.indentUnit,type:"py",align:null})}function Ee(S,w,m){var y=S.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:S.column()+1;w.scopes.push({offset:w.indent+X,type:m,align:y})}function D(S,w){for(var m=S.indentation();w.scopes.length>1&&V(w).offset>m;){if(V(w).type!="py")return!0;w.scopes.pop()}return V(w).offset!=m}function J(S,w){S.sol()&&(w.beginningOfLine=!0,w.dedent=!1);var m=w.tokenize(S,w),y=S.current();if(w.beginningOfLine&&y=="@")return S.match(re,!1)?"meta":te?"operator":ie;if(/\S/.test(y)&&(w.beginningOfLine=!1),(m=="variable"||m=="builtin")&&w.lastToken=="meta"&&(m="meta"),(y=="pass"||y=="return")&&(w.dedent=!0),y=="lambda"&&(w.lambda=!0),y==":"&&!w.lambda&&V(w).type=="py"&&S.match(/^\s*(?:#|$)/,!1)&&H(w),y.length==1&&!/string|comment/.test(m)){var P="[({".indexOf(y);if(P!=-1&&Ee(S,w,"])}".slice(P,P+1)),P="])}".indexOf(y),P!=-1)if(V(w).type==y)w.indent=w.scopes.pop().offset-X;else return ie}return w.dedent&&S.eol()&&V(w).type=="py"&&w.scopes.length>1&&w.scopes.pop(),m}var d={startState:function(S){return{tokenize:ye,scopes:[{offset:S||0,type:"py",align:null}],indent:S||0,lastToken:null,lambda:!1,dedent:0}},token:function(S,w){var m=w.errorToken;m&&(w.errorToken=!1);var y=J(S,w);return y&&y!="comment"&&(w.lastToken=y=="keyword"||y=="punctuation"?S.current():y),y=="punctuation"&&(y=null),S.eol()&&w.lambda&&(w.lambda=!1),m?y+" "+ie:y},indent:function(S,w){if(S.tokenize!=ye)return S.tokenize.isString?C.Pass:0;var m=V(S),y=m.type==w.charAt(0)||m.type=="py"&&!S.dedent&&/^(else:|elif |except |finally:)/.test(w);return m.align!=null?m.align-(y?1:0):m.offset-(y?X:0)},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:`'"`},lineComment:"#",fold:"indent"};return d}),C.defineMIME("text/x-python","python");var b=function(N){return N.split(" ")};C.defineMIME("text/x-cython",{name:"python",extra_keywords:b("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})})})();(function(Et,zt){(function(C){C(It())})(function(C){function De(m,y,P,le,p,c){this.indented=m,this.column=y,this.type=P,this.info=le,this.align=p,this.prev=c}function I(m,y,P,le){var p=m.indented;return m.context&&m.context.type=="statement"&&P!="statement"&&(p=m.context.indented),m.context=new De(p,y,P,le,null,m.context)}function K(m){var y=m.context.type;return(y==")"||y=="]"||y=="}")&&(m.indented=m.context.indented),m.context=m.context.prev}function $(m,y,P){if(y.prevToken=="variable"||y.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(m.string.slice(0,P))||y.typeAtEndOfLine&&m.column()==m.indentation())return!0}function V(m){for(;;){if(!m||m.type=="top")return!0;if(m.type=="}"&&m.prev.info!="namespace")return!1;m=m.prev}}C.defineMode("clike",function(m,y){var P=m.indentUnit,le=y.statementIndentUnit||P,p=y.dontAlignCalls,c=y.keywords||{},Y=y.types||{},xe=y.builtin||{},j=y.blockKeywords||{},ue=y.defKeywords||{},Te=y.atoms||{},Le=y.hooks||{},be=y.multiLineStrings,oe=y.indentStatements!==!1,Ne=y.indentSwitch!==!1,qe=y.namespaceSeparator,Ve=y.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,ct=y.numberStart||/[\d\.]/,Oe=y.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,Re=y.isOperatorChar||/[+\-*&%=<>!?|\/]/,Ue=y.isIdentifierChar||/[\w\$_\xa1-\uffff]/,et=y.isReservedIdentifier||!1,ge,Pe;function T(ae,Se){var he=ae.next();if(Le[he]){var Be=Le[he](ae,Se);if(Be!==!1)return Be}if(he=='"'||he=="'")return Se.tokenize=B(he),Se.tokenize(ae,Se);if(ct.test(he)){if(ae.backUp(1),ae.match(Oe))return"number";ae.next()}if(Ve.test(he))return ge=he,null;if(he=="/"){if(ae.eat("*"))return Se.tokenize=F,F(ae,Se);if(ae.eat("/"))return ae.skipToEnd(),"comment"}if(Re.test(he)){for(;!ae.match(/^\/[\/*]/,!1)&&ae.eat(Re););return"operator"}if(ae.eatWhile(Ue),qe)for(;ae.match(qe);)ae.eatWhile(Ue);var Me=ae.current();return N(c,Me)?(N(j,Me)&&(ge="newstatement"),N(ue,Me)&&(Pe=!0),"keyword"):N(Y,Me)?"type":N(xe,Me)||et&&et(Me)?(N(j,Me)&&(ge="newstatement"),"builtin"):N(Te,Me)?"atom":"variable"}function B(ae){return function(Se,he){for(var Be=!1,Me,Lt=!1;(Me=Se.next())!=null;){if(Me==ae&&!Be){Lt=!0;break}Be=!Be&&Me=="\\"}return(Lt||!(Be||be))&&(he.tokenize=null),"string"}}function F(ae,Se){for(var he=!1,Be;Be=ae.next();){if(Be=="/"&&he){Se.tokenize=null;break}he=Be=="*"}return"comment"}function Ie(ae,Se){y.typeFirstDefinitions&&ae.eol()&&V(Se.context)&&(Se.typeAtEndOfLine=$(ae,Se,ae.pos))}return{startState:function(ae){return{tokenize:null,context:new De((ae||0)-P,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(ae,Se){var he=Se.context;if(ae.sol()&&(he.align==null&&(he.align=!1),Se.indented=ae.indentation(),Se.startOfLine=!0),ae.eatSpace())return Ie(ae,Se),null;ge=Pe=null;var Be=(Se.tokenize||T)(ae,Se);if(Be=="comment"||Be=="meta")return Be;if(he.align==null&&(he.align=!0),ge==";"||ge==":"||ge==","&&ae.match(/^\s*(?:\/\/.*)?$/,!1))for(;Se.context.type=="statement";)K(Se);else if(ge=="{")I(Se,ae.column(),"}");else if(ge=="[")I(Se,ae.column(),"]");else if(ge=="(")I(Se,ae.column(),")");else if(ge=="}"){for(;he.type=="statement";)he=K(Se);for(he.type=="}"&&(he=K(Se));he.type=="statement";)he=K(Se)}else ge==he.type?K(Se):oe&&((he.type=="}"||he.type=="top")&&ge!=";"||he.type=="statement"&&ge=="newstatement")&&I(Se,ae.column(),"statement",ae.current());if(Be=="variable"&&(Se.prevToken=="def"||y.typeFirstDefinitions&&$(ae,Se,ae.start)&&V(Se.context)&&ae.match(/^\s*\(/,!1))&&(Be="def"),Le.token){var Me=Le.token(ae,Se,Be);Me!==void 0&&(Be=Me)}return Be=="def"&&y.styleDefs===!1&&(Be="variable"),Se.startOfLine=!1,Se.prevToken=Pe?"def":Be||ge,Ie(ae,Se),Be},indent:function(ae,Se){if(ae.tokenize!=T&&ae.tokenize!=null||ae.typeAtEndOfLine&&V(ae.context))return C.Pass;var he=ae.context,Be=Se&&Se.charAt(0),Me=Be==he.type;if(he.type=="statement"&&Be=="}"&&(he=he.prev),y.dontIndentStatements)for(;he.type=="statement"&&y.dontIndentStatements.test(he.info);)he=he.prev;if(Le.indent){var Lt=Le.indent(ae,he,Se,P);if(typeof Lt=="number")return Lt}var Nt=he.prev&&he.prev.info=="switch";if(y.allmanIndentation&&/[{(]/.test(Be)){for(;he.type!="top"&&he.type!="}";)he=he.prev;return he.indented}return he.type=="statement"?he.indented+(Be=="{"?0:le):he.align&&(!p||he.type!=")")?he.column+(Me?0:1):he.type==")"&&!Me?he.indented+le:he.indented+(Me?0:P)+(!Me&&Nt&&!/^(?:case|default)\b/.test(Se)?P:0)},electricInput:Ne?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function b(m){for(var y={},P=m.split(" "),le=0;le!?|\/#:@]/,hooks:{"@":function(m){return m.eatWhile(/[\w\$_]/),"meta"},'"':function(m,y){return m.match('""')?(y.tokenize=D,y.tokenize(m,y)):!1},"'":function(m){return m.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(m.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(m,y){var P=y.context;return P.type=="}"&&P.align&&m.eat(">")?(y.context=new De(P.indented,P.column,P.type,P.info,null,P.prev),"operator"):!1},"/":function(m,y){return m.eat("*")?(y.tokenize=J(1),y.tokenize(m,y)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function d(m){return function(y,P){for(var le=!1,p,c=!1;!y.eol();){if(!m&&!le&&y.match('"')){c=!0;break}if(m&&y.match('"""')){c=!0;break}p=y.next(),!le&&p=="$"&&y.match("{")&&y.skipTo("}"),le=!le&&p=="\\"&&!m}return(c||!m)&&(P.tokenize=null),"string"}}Ee("text/x-kotlin",{name:"clike",keywords:b("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:b("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:b("catch class do else finally for if where try while enum"),defKeywords:b("class val var object interface fun"),atoms:b("true false null this"),hooks:{"@":function(m){return m.eatWhile(/[\w\$_]/),"meta"},"*":function(m,y){return y.prevToken=="."?"variable":"operator"},'"':function(m,y){return y.tokenize=d(m.match('""')),y.tokenize(m,y)},"/":function(m,y){return m.eat("*")?(y.tokenize=J(1),y.tokenize(m,y)):!1},indent:function(m,y,P,le){var p=P&&P.charAt(0);if((m.prevToken=="}"||m.prevToken==")")&&P=="")return m.indented;if(m.prevToken=="operator"&&P!="}"&&m.context.type!="}"||m.prevToken=="variable"&&p=="."||(m.prevToken=="}"||m.prevToken==")")&&p==".")return le*2+y.indented;if(y.align&&y.type=="}")return y.indented+(m.context.type==(P||"").charAt(0)?0:le)}},modeProps:{closeBrackets:{triples:'"'}}}),Ee(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:b("for while do if else struct"),builtin:b("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:b("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":ne},modeProps:{fold:["brace","include"]}}),Ee("text/x-nesc",{name:"clike",keywords:b(_+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:ke,blockKeywords:b(te),atoms:b("null true false"),hooks:{"#":ne},modeProps:{fold:["brace","include"]}}),Ee("text/x-objectivec",{name:"clike",keywords:b(_+" "+O),types:we,builtin:b(q),blockKeywords:b(te+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:b(re+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:b("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:Ae,hooks:{"#":ne,"*":se},modeProps:{fold:["brace","include"]}}),Ee("text/x-objectivec++",{name:"clike",keywords:b(_+" "+O+" "+ie),types:we,builtin:b(q),blockKeywords:b(te+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:b(re+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:b("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:Ae,hooks:{"#":ne,"*":se,u:de,U:de,L:de,R:de,0:ye,1:ye,2:ye,3:ye,4:ye,5:ye,6:ye,7:ye,8:ye,9:ye,token:function(m,y,P){if(P=="variable"&&m.peek()=="("&&(y.prevToken==";"||y.prevToken==null||y.prevToken=="}")&&ze(m.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),Ee("text/x-squirrel",{name:"clike",keywords:b("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:ke,blockKeywords:b("case catch class else for foreach if switch try while"),defKeywords:b("function local class"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":ne},modeProps:{fold:["brace","include"]}});var S=null;function w(m){return function(y,P){for(var le=!1,p,c=!1;!y.eol();){if(!le&&y.match('"')&&(m=="single"||y.match('""'))){c=!0;break}if(!le&&y.match("``")){S=w(m),c=!0;break}p=y.next(),le=m=="single"&&!le&&p=="\\"}return c&&(P.tokenize=null),"string"}}Ee("text/x-ceylon",{name:"clike",keywords:b("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(m){var y=m.charAt(0);return y===y.toUpperCase()&&y!==y.toLowerCase()},blockKeywords:b("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:b("class dynamic function interface module object package value"),builtin:b("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:b("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(m){return m.eatWhile(/[\w\$_]/),"meta"},'"':function(m,y){return y.tokenize=w(m.match('""')?"triple":"single"),y.tokenize(m,y)},"`":function(m,y){return!S||!m.match("`")?!1:(y.tokenize=S,S=null,y.tokenize(m,y))},"'":function(m){return m.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(m,y,P){if((P=="variable"||P=="type")&&y.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})();var ba={exports:{}},ka;function Du(){return ka||(ka=1,function(Et,zt){(function(C){C(It())})(function(C){C.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var De=0;De-1&&K.substring(b+1,K.length);if(N)return C.findModeByExtension(N)},C.findModeByName=function(K){K=K.toLowerCase();for(var $=0;$` "'(~:]+/,ke=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,we=/^\s*\[[^\]]+?\]:.*$/,te=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,re=" ";function ne(p,c,Y){return c.f=c.inline=Y,Y(p,c)}function se(p,c,Y){return c.f=c.block=Y,Y(p,c)}function Ae(p){return!p||!/\S/.test(p.string)}function ye(p){if(p.linkTitle=!1,p.linkHref=!1,p.linkText=!1,p.em=!1,p.strong=!1,p.strikethrough=!1,p.quote=0,p.indentedCode=!1,p.f==ze){var c=$;if(!c){var Y=C.innerMode(K,p.htmlState);c=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}c&&(p.f=D,p.block=de,p.htmlState=null)}return p.trailingSpace=0,p.trailingSpaceNewLine=!1,p.prevLine=p.thisLine,p.thisLine={stream:null},null}function de(p,c){var Y=p.column()===c.indentation,xe=Ae(c.prevLine.stream),j=c.indentedCode,ue=c.prevLine.hr,Te=c.list!==!1,Le=(c.listStack[c.listStack.length-1]||0)+3;c.indentedCode=!1;var be=c.indentation;if(c.indentationDiff===null&&(c.indentationDiff=c.indentation,Te)){for(c.list=null;be=4&&(j||c.prevLine.fencedCodeEnd||c.prevLine.header||xe))return p.skipToEnd(),c.indentedCode=!0,b.code;if(p.eatSpace())return null;if(Y&&c.indentation<=Le&&(qe=p.match(q))&&qe[1].length<=6)return c.quote=0,c.header=qe[1].length,c.thisLine.header=!0,I.highlightFormatting&&(c.formatting="header"),c.f=c.inline,H(c);if(c.indentation<=Le&&p.eat(">"))return c.quote=Y?1:c.quote+1,I.highlightFormatting&&(c.formatting="quote"),p.eatSpace(),H(c);if(!Ne&&!c.setext&&Y&&c.indentation<=Le&&(qe=p.match(ie))){var Ve=qe[1]?"ol":"ul";return c.indentation=be+p.current().length,c.list=!0,c.quote=0,c.listStack.push(c.indentation),c.em=!1,c.strong=!1,c.code=!1,c.strikethrough=!1,I.taskLists&&p.match(O,!1)&&(c.taskList=!0),c.f=c.inline,I.highlightFormatting&&(c.formatting=["list","list-"+Ve]),H(c)}else{if(Y&&c.indentation<=Le&&(qe=p.match(ke,!0)))return c.quote=0,c.fencedEndRE=new RegExp(qe[1]+"+ *$"),c.localMode=I.fencedCodeBlockHighlighting&&V(qe[2]||I.fencedCodeBlockDefaultMode),c.localMode&&(c.localState=C.startState(c.localMode)),c.f=c.block=fe,I.highlightFormatting&&(c.formatting="code-block"),c.code=-1,H(c);if(c.setext||(!oe||!Te)&&!c.quote&&c.list===!1&&!c.code&&!Ne&&!we.test(p.string)&&(qe=p.lookAhead(1))&&(qe=qe.match(z)))return c.setext?(c.header=c.setext,c.setext=0,p.skipToEnd(),I.highlightFormatting&&(c.formatting="header")):(c.header=qe[0].charAt(0)=="="?1:2,c.setext=c.header),c.thisLine.header=!0,c.f=c.inline,H(c);if(Ne)return p.skipToEnd(),c.hr=!0,c.thisLine.hr=!0,b.hr;if(p.peek()==="[")return ne(p,c,m)}return ne(p,c,c.inline)}function ze(p,c){var Y=K.token(p,c.htmlState);if(!$){var xe=C.innerMode(K,c.htmlState);(xe.mode.name=="xml"&&xe.state.tagStart===null&&!xe.state.context&&xe.state.tokenize.isInText||c.md_inside&&p.current().indexOf(">")>-1)&&(c.f=D,c.block=de,c.htmlState=null)}return Y}function fe(p,c){var Y=c.listStack[c.listStack.length-1]||0,xe=c.indentation=p.quote?c.push(b.formatting+"-"+p.formatting[Y]+"-"+p.quote):c.push("error"))}if(p.taskOpen)return c.push("meta"),c.length?c.join(" "):null;if(p.taskClosed)return c.push("property"),c.length?c.join(" "):null;if(p.linkHref?c.push(b.linkHref,"url"):(p.strong&&c.push(b.strong),p.em&&c.push(b.em),p.strikethrough&&c.push(b.strikethrough),p.emoji&&c.push(b.emoji),p.linkText&&c.push(b.linkText),p.code&&c.push(b.code),p.image&&c.push(b.image),p.imageAltText&&c.push(b.imageAltText,"link"),p.imageMarker&&c.push(b.imageMarker)),p.header&&c.push(b.header,b.header+"-"+p.header),p.quote&&(c.push(b.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=p.quote?c.push(b.quote+"-"+p.quote):c.push(b.quote+"-"+I.maxBlockquoteDepth)),p.list!==!1){var xe=(p.listStack.length-1)%3;xe?xe===1?c.push(b.list2):c.push(b.list3):c.push(b.list1)}return p.trailingSpaceNewLine?c.push("trailing-space-new-line"):p.trailingSpace&&c.push("trailing-space-"+(p.trailingSpace%2?"a":"b")),c.length?c.join(" "):null}function Ee(p,c){if(p.match(X,!0))return H(c)}function D(p,c){var Y=c.text(p,c);if(typeof Y<"u")return Y;if(c.list)return c.list=null,H(c);if(c.taskList){var xe=p.match(O,!0)[1]===" ";return xe?c.taskOpen=!0:c.taskClosed=!0,I.highlightFormatting&&(c.formatting="task"),c.taskList=!1,H(c)}if(c.taskOpen=!1,c.taskClosed=!1,c.header&&p.match(/^#+$/,!0))return I.highlightFormatting&&(c.formatting="header"),H(c);var j=p.next();if(c.linkTitle){c.linkTitle=!1;var ue=j;j==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Te="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(p.match(new RegExp(Te),!0))return b.linkHref}if(j==="`"){var Le=c.formatting;I.highlightFormatting&&(c.formatting="code"),p.eatWhile("`");var be=p.current().length;if(c.code==0&&(!c.quote||be==1))return c.code=be,H(c);if(be==c.code){var oe=H(c);return c.code=0,oe}else return c.formatting=Le,H(c)}else if(c.code)return H(c);if(j==="\\"&&(p.next(),I.highlightFormatting)){var Ne=H(c),qe=b.formatting+"-escape";return Ne?Ne+" "+qe:qe}if(j==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return c.imageMarker=!0,c.image=!0,I.highlightFormatting&&(c.formatting="image"),H(c);if(j==="["&&c.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return c.imageMarker=!1,c.imageAltText=!0,I.highlightFormatting&&(c.formatting="image"),H(c);if(j==="]"&&c.imageAltText){I.highlightFormatting&&(c.formatting="image");var Ne=H(c);return c.imageAltText=!1,c.image=!1,c.inline=c.f=d,Ne}if(j==="["&&!c.image)return c.linkText&&p.match(/^.*?\]/)||(c.linkText=!0,I.highlightFormatting&&(c.formatting="link")),H(c);if(j==="]"&&c.linkText){I.highlightFormatting&&(c.formatting="link");var Ne=H(c);return c.linkText=!1,c.inline=c.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?d:D,Ne}if(j==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){c.f=c.inline=J,I.highlightFormatting&&(c.formatting="link");var Ne=H(c);return Ne?Ne+=" ":Ne="",Ne+b.linkInline}if(j==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){c.f=c.inline=J,I.highlightFormatting&&(c.formatting="link");var Ne=H(c);return Ne?Ne+=" ":Ne="",Ne+b.linkEmail}if(I.xml&&j==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Ve=p.string.indexOf(">",p.pos);if(Ve!=-1){var ct=p.string.substring(p.start,Ve);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ct)&&(c.md_inside=!0)}return p.backUp(1),c.htmlState=C.startState(K),se(p,c,ze)}if(I.xml&&j==="<"&&p.match(/^\/\w*?>/))return c.md_inside=!1,"tag";if(j==="*"||j==="_"){for(var Oe=1,Re=p.pos==1?" ":p.string.charAt(p.pos-2);Oe<3&&p.eat(j);)Oe++;var Ue=p.peek()||" ",et=!/\s/.test(Ue)&&(!te.test(Ue)||/\s/.test(Re)||te.test(Re)),ge=!/\s/.test(Re)&&(!te.test(Re)||/\s/.test(Ue)||te.test(Ue)),Pe=null,T=null;if(Oe%2&&(!c.em&&et&&(j==="*"||!ge||te.test(Re))?Pe=!0:c.em==j&&ge&&(j==="*"||!et||te.test(Ue))&&(Pe=!1)),Oe>1&&(!c.strong&&et&&(j==="*"||!ge||te.test(Re))?T=!0:c.strong==j&&ge&&(j==="*"||!et||te.test(Ue))&&(T=!1)),T!=null||Pe!=null){I.highlightFormatting&&(c.formatting=Pe==null?"strong":T==null?"em":"strong em"),Pe===!0&&(c.em=j),T===!0&&(c.strong=j);var oe=H(c);return Pe===!1&&(c.em=!1),T===!1&&(c.strong=!1),oe}}else if(j===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return H(c);p.backUp(1)}if(I.strikethrough){if(j==="~"&&p.eatWhile(j)){if(c.strikethrough){I.highlightFormatting&&(c.formatting="strikethrough");var oe=H(c);return c.strikethrough=!1,oe}else if(p.match(/^[^\s]/,!1))return c.strikethrough=!0,I.highlightFormatting&&(c.formatting="strikethrough"),H(c)}else if(j===" "&&p.match("~~",!0)){if(p.peek()===" ")return H(c);p.backUp(2)}}if(I.emoji&&j===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){c.emoji=!0,I.highlightFormatting&&(c.formatting="emoji");var B=H(c);return c.emoji=!1,B}return j===" "&&(p.match(/^ +$/,!1)?c.trailingSpace++:c.trailingSpace&&(c.trailingSpaceNewLine=!0)),H(c)}function J(p,c){var Y=p.next();if(Y===">"){c.f=c.inline=D,I.highlightFormatting&&(c.formatting="link");var xe=H(c);return xe?xe+=" ":xe="",xe+b.linkInline}return p.match(/^[^>]+/,!0),b.linkInline}function d(p,c){if(p.eatSpace())return null;var Y=p.next();return Y==="("||Y==="["?(c.f=c.inline=w(Y==="("?")":"]"),I.highlightFormatting&&(c.formatting="link-string"),c.linkHref=!0,H(c)):"error"}var S={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(p){return function(c,Y){var xe=c.next();if(xe===p){Y.f=Y.inline=D,I.highlightFormatting&&(Y.formatting="link-string");var j=H(Y);return Y.linkHref=!1,j}return c.match(S[p]),Y.linkHref=!0,H(Y)}}function m(p,c){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(c.f=y,p.next(),I.highlightFormatting&&(c.formatting="link"),c.linkText=!0,H(c)):ne(p,c,D)}function y(p,c){if(p.match("]:",!0)){c.f=c.inline=P,I.highlightFormatting&&(c.formatting="link");var Y=H(c);return c.linkText=!1,Y}return p.match(/^([^\]\\]|\\.)+/,!0),b.linkText}function P(p,c){return p.eatSpace()?null:(p.match(/^[^\s]+/,!0),p.peek()===void 0?c.linkTitle=!0:p.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),c.f=c.inline=D,b.linkHref+" url")}var le={startState:function(){return{f:de,prevLine:{stream:null},thisLine:{stream:null},block:de,htmlState:null,indentation:0,inline:D,text:Ee,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(p){return{f:p.f,prevLine:p.prevLine,thisLine:p.thisLine,block:p.block,htmlState:p.htmlState&&C.copyState(K,p.htmlState),indentation:p.indentation,localMode:p.localMode,localState:p.localMode?C.copyState(p.localMode,p.localState):null,inline:p.inline,text:p.text,formatting:!1,linkText:p.linkText,linkTitle:p.linkTitle,linkHref:p.linkHref,code:p.code,em:p.em,strong:p.strong,strikethrough:p.strikethrough,emoji:p.emoji,header:p.header,setext:p.setext,hr:p.hr,taskList:p.taskList,list:p.list,listStack:p.listStack.slice(0),quote:p.quote,indentedCode:p.indentedCode,trailingSpace:p.trailingSpace,trailingSpaceNewLine:p.trailingSpaceNewLine,md_inside:p.md_inside,fencedEndRE:p.fencedEndRE}},token:function(p,c){if(c.formatting=!1,p!=c.thisLine.stream){if(c.header=0,c.hr=!1,p.match(/^\s*$/,!0))return ye(c),null;if(c.prevLine=c.thisLine,c.thisLine={stream:p},c.taskList=!1,c.trailingSpace=0,c.trailingSpaceNewLine=!1,!c.localState&&(c.f=c.block,c.f!=ze)){var Y=p.match(/^\s*/,!0)[0].replace(/\t/g,re).length;if(c.indentation=Y,c.indentationDiff=null,Y>0)return null}}return c.f(p,c)},innerMode:function(p){return p.block==ze?{state:p.htmlState,mode:K}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:le}},indent:function(p,c,Y){return p.block==ze&&K.indent?K.indent(p.htmlState,c,Y):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,c,Y):C.Pass},blankLine:ye,getType:H,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return le},"xml"),C.defineMIME("text/markdown","markdown"),C.defineMIME("text/x-markdown","markdown")})})();(function(Et,zt){(function(C){C(It())})(function(C){C.defineOption("placeholder","",function(N,_,ie){var O=ie&&ie!=C.Init;if(_&&!O)N.on("blur",$),N.on("change",V),N.on("swapDoc",V),C.on(N.getInputField(),"compositionupdate",N.state.placeholderCompose=function(){K(N)}),V(N);else if(!_&&O){N.off("blur",$),N.off("change",V),N.off("swapDoc",V),C.off(N.getInputField(),"compositionupdate",N.state.placeholderCompose),De(N);var q=N.getWrapperElement();q.className=q.className.replace(" CodeMirror-empty","")}_&&!N.hasFocus()&&$(N)});function De(N){N.state.placeholder&&(N.state.placeholder.parentNode.removeChild(N.state.placeholder),N.state.placeholder=null)}function I(N){De(N);var _=N.state.placeholder=document.createElement("pre");_.style.cssText="height: 0; overflow: visible",_.style.direction=N.getOption("direction"),_.className="CodeMirror-placeholder CodeMirror-line-like";var ie=N.getOption("placeholder");typeof ie=="string"&&(ie=document.createTextNode(ie)),_.appendChild(ie),N.display.lineSpace.insertBefore(_,N.display.lineSpace.firstChild)}function K(N){setTimeout(function(){var _=!1;if(N.lineCount()==1){var ie=N.getInputField();_=ie.nodeName=="TEXTAREA"?!N.getLine(0).length:!/[^\u200b]/.test(ie.querySelector(".CodeMirror-line").textContent)}_?I(N):De(N)},20)}function $(N){b(N)&&I(N)}function V(N){var _=N.getWrapperElement(),ie=b(N);_.className=_.className.replace(" CodeMirror-empty","")+(ie?" CodeMirror-empty":""),ie?I(N):De(N)}function b(N){return N.lineCount()===1&&N.getLine(0)===""}})})();(function(Et,zt){(function(C){C(It())})(function(C){C.defineSimpleMode=function(O,q){C.defineMode(O,function(z){return C.simpleMode(z,q)})},C.simpleMode=function(O,q){De(q,"start");var z={},X=q.meta||{},ke=!1;for(var we in q)if(we!=X&&q.hasOwnProperty(we))for(var te=z[we]=[],re=q[we],ne=0;ne2&&se.token&&typeof se.token!="string"){for(var de=2;de-1)return C.Pass;var we=z.indent.length-1,te=O[z.state];e:for(;;){for(var re=0;re$.keyCol)return K.skipToEnd(),"string";if($.literal&&($.literal=!1),K.sol()){if($.keyCol=0,$.pair=!1,$.pairStart=!1,K.match("---")||K.match("..."))return"def";if(K.match(/\s*-\s+/))return"meta"}if(K.match(/^(\{|\}|\[|\])/))return V=="{"?$.inlinePairs++:V=="}"?$.inlinePairs--:V=="["?$.inlineList++:$.inlineList--,"meta";if($.inlineList>0&&!b&&V==",")return K.next(),"meta";if($.inlinePairs>0&&!b&&V==",")return $.keyCol=0,$.pair=!1,$.pairStart=!1,K.next(),"meta";if($.pairStart){if(K.match(/^\s*(\||\>)\s*/))return $.literal=!0,"meta";if(K.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if($.inlinePairs==0&&K.match(/^\s*-?[0-9\.\,]+\s?$/)||$.inlinePairs>0&&K.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(K.match(I))return"keyword"}return!$.pair&&K.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^\s,\[\]{}#&*!|>'"%@`])[^#:]*(?=:($|\s))/)?($.pair=!0,$.keyCol=K.indentation(),"atom"):$.pair&&K.match(/^:\s*/)?($.pairStart=!0,"meta"):($.pairStart=!1,$.escaped=V=="\\",K.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}}),C.defineMIME("text/x-yaml","yaml"),C.defineMIME("text/yaml","yaml")})})();export{Fu as default}; diff --git a/priv/static/node_modules/playwright-core/lib/vite/traceViewer/codicon.DMa5iZz2.ttf b/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf similarity index 70% rename from priv/static/node_modules/playwright-core/lib/vite/traceViewer/codicon.DMa5iZz2.ttf rename to priv/static/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf index c4a33a4d5669d1c4f6ac274fae5792096bdb082b..27ee4c68caef1cd22342f481420d6dbda1648012 100644 GIT binary patch delta 14648 zcma)@31C#!_5aU#GxOf;GnqF__HB}xup}Yt3|oN69z;|`M2sYm1q>uW*pxbmOD&3` zQ9x=HtsB-o3W#yv5z)5RT7UkmP;2db`MI>VT59$Gy>kODKimH=$>*K>*1Ml`?s+d? zJZ^pCuhwnFsitW}d?gVrTD-ia=cJ!bxPZt}LX`b(N7sh-zbr4?Koq}?=<{G_Tg#I9 zJ9eLrYu^L)oj9PJt^5P&0Z`Jpymx)>q_2i|vXR=i!u<$a2&2mi0Z# z$9xgaXX5(86)nr#`f@&hw23%>KMsD;)4jTPapu%#hzlPe$||{LAnG|xjBCN%fBs|T zHG@@rxG$eKI9{P&;qY*JrEfP^D4%lw>)g(LS6PF7U-96O>>848A^V@O7Fuv}PT#xQ z-fNX$-*xst$`(sMovejqNvB3aI*D-HYWWNq1jvsgigCGdrSYQivgt5q57vIlUw=(x zEHbtjR~s)IhfJ3_M;^l+-~M6T-%9QDCcVjX_)W`AIBB6zc_vSzhdIHi>$#Lyu$Oyj zHb2XYco{FHYp9+_(Pi`+eMOVFk2X+*pP--8<$Mz7agalN7rjh(&;ak|O>_lc!yEW= zzKqZ3pYS%mf-j*bIK^8@AuHKX85g<9LtgTsDgnx&Jj$m6T1e+mbBfMI`4&?#MX7{J zDMrI+1dXI}s-Q|5Mb%V8wNyvrXf%zd2AV(PPaU+B&Z8By zih5}ct)+Fep3bKWXe0fIE~FG)M4Ranx|DuQKcOq>YT8D9bRAt!sqM6bcG3;Bi*BTw z=w{kYx6rNhbGn`GqCIpsF8T%CL-)~sdXyfgr|3C)o?fDZ^a>rKSLxUE2K@$&`&)X8 zen)T9$MhHaEB&4RLC5Hy^d%EBtE{n|J?vvYXRyu@&g2}<jBzJ9!V^&A;G# z_+EaH`}tvhg!l8Ke1He|aej`U=NI@zeu)q9tMnQDjXtL@Xc4tg4~?Ofw1lswZdy&t z>1>Kq89QhzT}v+)WqLCSK1Sw2vO4z5Fykl}%IlOrA?~ z=`pslg`VUn>2xpDjoP=;eXMVj+mUjM2_1rZ5*1mGa#CJBciFOonjlCfC= z{Yb{e5@<>?E|CZ`Wn3!Z-H@VkfW`BEETJnPML_^x1Lb9G!46CD7qy z+$MoGC*yVr^g0=$z5p7Yj5{UJ^<;?l0n`k+M*{Uv#@!Ma0y2Iffk`0a9tn&C8JH3& zv4Nc+<30&21{wEDU^~coKmsd5#)A^r6EYr>z_O6hFM*9A<6#M`4H=I}V0XyaD}eFa4g&P`?cvb={NXBy#*h4a&m%uWT@qz?4l8hH6u$E-JEP>r5^9e-!=yN7VjG?0g`BBSFTWBycIn z_)r4pf{Z^);6adKNZ@dgVM=H_uE z3mJcrz=0v-uM*k~`I!Vx4HT+(g$+C+ zGX5z^*X&EA0lXwK{w0CGM8;PVcur(|ErAaO<0^qSMJ7w&SCOem=qX5x1iluTRtdZ= zN|`q7061V|suH+jWNH#PWn|hVaL>qeNZ_cE>5{-@BhxK`^G2pe0ymCKuLKSqnLY_z zJ2L%g(Ee{Bks*PxEkppxCZGVxEARlxDM$dxE|>tcr4Nh36FzJN_afvXbCq!j*;*L%zsnd z1b8B(xC!tiNO2S3Mo4iJ;K`5^Bs>*T+yi(zq__w03`lVg;3mkEBs>dJ+z)s*E zQBfdb6K1>Uf7F(*!cK>TcR-3-1KtU_RKmAFE|c)BkfJpJ-v-$w;X5Ej%K*L;a)pHV zKz2*`Zpa=9{{sDQisl1+52R>5!1qFm<^%j7WUqw#Aw^RHei%|TCE!OO*GYIk0xtc%IqF2M?!Ofhx@GH;QP=wmTB0gD;%a|yRXih&Ba81i-rr^KMSL&75< z@04IQPv%_`S^z0VFu)3*OfiB1O@{o1gq@IL00S)l$-GyBKmeKdN$6|H`z4$W`GDwu zY!D|PQ;c$e;2W8u$p8<76eAuWia@3q@c{7zGR24oh%At~S3)x(_eofE*M13$^I|3d zMt-JfCBXNI`7de&5SAcQObbBbA~7ofpAPwigy%s%DM9#x%%>#O1u1F@_+`jvB>W2G zvl2cC`J9AzK|U{-h#S!VrWi1Q#Ta-|!eR`F=>=Gf0r6nKVho6f0luLxKR=QZMSN9) z$O)N;B_y8kngr1lGGCVUd5dI?bpAy>A zx2$k%3UwP~3BqACs7MePqd|)VAu<}YO6WyMn}mf_B?zF=pe8{mjRx%!1l4HJAwhVJ z2AvWF+Gx;)(IYm9xzV6oLj8~)3F2@x=#|hcNS}mTApH_V>1Z%RLa##xBrKk%OZexI z=u`osc{GR-Dxhf?J%i{~0YZE<7?IGOkeL#M{b*2>98eXcs1e{8WR8SIrlOSqqe6pu z5(ElqFkga@Aq^Ht2m@iTP=L|HqA4&G1&AopV6gZfOvrKxBAGN;Awf)&1}i1>8007k zi?JbE1|Z@|gVhoeEmtE!6qE*QC5VUOg@r_+d;3-u4NqCJElJB3%llTpwcUEimTOyv z-<>u?Rn!RJEtp)H}$!gIrW!-Eljq%4w*OpnZsbVk-jc4cN}R%g!2+?D0bs?VC9 zwK?lh)|c7g?1t#m=jX1?y)kzn_r1LAy!yQPd6(xM z$onAQohl`Iz$3%BWpNW1_ zqLk#9+*6sZEbB&?e5x->h7p}tG=QBj{0MXafxM#&52!!{fYOI)?_R>IoX=r zl-!xzn>?Hx9Bmz)J9^&eYe&C7=E5;gj5#`X^4NuA*N^j#i;bH)ZvD7-#vL0!YyA50 zcZ?rw2sBhT%xqZFu&rUB;pl|GgjEx+oN#nv=ENlvubOypk}|0=HEHdn7bbnt7;9YA zcwyr+jmAkmC*3`{Wb%qBr%l;1WngOY)TvXioBGDI`e|29J2>4xeaZB9W{jG#dB)Be zFU|DMoI104=4CVQXi}TTG(9(~c-AGe_MWVsTz&G+lV3XdquEnux6bZ4W%w!EPI-7v z#hkn6d~)idQ+J;F`e|jS%{%R~)5E9toPKC-DmHia+*Nb8&;95O?-|u+Tz1CMdAaiz z&f7e1@4QdW9CPN*GY_8m;rx>M51f^K)^%qcTd-ik>u1}~Zan+Oh5m)}7Cv*%%w~Uc zMf0q4$DG@B?&fpvI`=P&l8fdq+Op_yOLNPnmIE!vTJu|Hwsy7Nx;VMGYw^y-?=IQC zY~_NLyH>uvs$|u&Rd27hu0Cz`TfM!#xAp#g zP1%|yYYwdWa_#iBoonA-m%nb&x&!OpUZ1&s^7@Py})_F>S9 zGGI$#PGSb!$BXb#j#qXYh%So2gB79@EWT^QGIyD7_P2go-wL8W3xRo z!`^GL*)6@^+%oTGugjHJR_0r-uxh`$(_dKO-)Q$o?A?mprgVE^Ii8K)SS;7+^mbb8 zHe?Cgfqb+3w+;WBKP7iG_=pK%Nc5UeP2CWYP)#U$0xcSf)}0_;7p1_6htsAtrMCfjs3-7zFefMIR?D)Jq2kcMo}$R;NRjSv`~7ata;SFAZgaYwPSuY0 zsH)TL_`eoUDRiad31pnanIInv>*=NJjq+CoQt2RPpv4Z6jVxXW|7`2Udj_ zV5v}zRtaJRkLTL@2!^nVU5whgcsP=%kDwt!K`l~~FJ6LcUcAs%HT)LG(O8vuhbtPg zwmwmlh}G35>J#-o4vBlJ6ZI3gF0Mw!g}6RioJz#J=?CK~HIk2ZtF7QQs@?9k+vkam z+g`1(B_kH~du$f=`Yej3xm3;V8Ftz*k6Tk+nx(8Tq=~uVr~N zZK}m#v)iniEfBD2RwNx3)t2ea()?~cKSQ_LHY;;jwfTHDmFFm`E}p5k+HHE7Hy8}t z?cre1Tc(StIy5T9^wiMSu;dfCCer7fF&c9OBNZP5l!+IA2_MH3kwm0{>(CU@Vl5V} zuc^*QXK3{r##n8GlCOAKt8QSNFGlO-bL7rSZ>}d)HpAfzP(c9FA9rO=Me=bG@NaBOIBYKr}yKv+0p|MVZSx;`qfSxNqoU+`;|hXWZqN z^}q}2Y`g>Z!a>ca(!OJl6-5&T9MURzZ&KCw==#c)dy*@gpbKI#y|lUciV?N|C;O@f zg4*E`p2zgV$-Y0Fbz$G1AM5DvT+pnh(gRRDGX$+Q8Pie=B_dEB!Zhj+KrF9eHRT+??l7!+w`L z;Pgavr&Eu3oVv^95BtPz@tpqKTds4Y(%p~{b(_a#8`&<5Jzh;6JjGU24WF04QuQ3Srdr{t`3Kqwg;m@{0)gnQBh=j zq-b$b2`4|J10W=TrR9k`V;59WSMM5P~C#>STe+lRfl2GFl5nXiHH^#Dji2K4*boY z+4{-eWc>mrGGREr3W zA^JV)<>FXe7>PP)o9cS;d|}8g)~h{@oc2Sb+%xdcUqpOYD{HrZe_09ouQ>wQF*DWzRZ)E6b8=W z5VkLw=_y+=#WSTit01>BIVwlVfDQ`A!@-OeTpAgUT!U)9cmAirp_1jHWMlD; z7VA)9Y~XVx>Y+TX#a^oh<(Qs+`9f7RC>T(&cu1IRVcKdMxF%5@!R3kino(84dP&11 z^ouZ9_{FJekqDkJaJ6?~c3BlggY|Uz^-yL=_qkMN4{WnVbJ+524k#JLp;;{XinY|@ z(iCfr>UDWEn`XDW>`trAX?JN34S(1xaHxu=s18Lro>=d++f*2PkI$WcwCeKdA$K6p z?TmQD!!05gJFC80#cEZCsdk=|>2ul?hAMMrSF;=Vi`4Vr)gfABo zQ3<$<7*LVu1dd0=K*msjh1YPjYh835{+5iiZ?#vBOmDYg|6fTx**Mkfwlz7XPV-{x zO;Ug7j=PlphzXVJwa!!wK zDCY{c{G0qca$~vps~obhFcLZct0-HW^xRy%2}65#MnOhX`qDrXl3)Gl`$g+_? zOo*7bZZvQl?kdVx8V$wLbE*LzrX~!WumeJI#GoFfy%3sH3u$#jr)%q>Z#_O_9M7q6 zWx(BIf7N!!(2+~v!B>i-e*d0I2c{I~=w~ExQ69M7;n?bAVb_8y?SZ+@Qb%m7xDp;? z`Hj1eTR9Ei99hzZ%ttZd%S5!qar3JQ+a;`7MA|F3F2|2d-tOJ5q|1}xP8Tj`hZ{wU zWMsI|QpmGmz&)@@W+&WMlD#b{I+p38VR^Ty+m5#6%-`##| zl>_^M1w|1o3ePc8AHEpF_9erFCSJh2m>bmUCwa~5!txSKiD+M zp%OKHH!oz>yg@dJXaH#uW&N|Lc+t12|NpP_5BJHJ?d|ExF8^N{BftK44lL(yjW;`7 zuWYpYD15Qhj?ATtSRK}cG7xhw@=YS`J>pb-0**6$sYE_Lrp1&DVeOj7@B~hn!+4$0 zgk!l5%2p`gv|B2CQlWQhW2xx&a6uSe3RlvYGvU0PW9%nkN$nMN^vf@$Ucjwsyg@Ft` zn&ENh^-X{B2CnNn`ed~#GwdsPszf`b)QeSHLEkA)4Oc^@I+FdbK3Ql_No^xkZ5BFv zocOd23v+l|FaetMjNxO!6bMHKiwfE4(I2=*EXLF8j-g9dxvxKrjmOQJ< zR!e~;qsk7Oops#gMuj6x)yQA3r~I9G~%v ziNjeiyly!Aq)gZ1s4rb0v|_(QO1f-I%;BU!{4Z2 zHKbLKidHo@!dG?bk3oeGFY<-7DO0qNFXXf;tj`J-g_z-Q`63PnTU2H8WJR@%W2LX(&Nss znEH0S)R>Pd9G`sgVl@HM!!3z=Qtg9msqXY z_lS+|vgbM+F}L4|TD-&;DspZ3Ar*777Pmjta9qmnbCB#QN$eY_te#S8k(9|3k1aekt3tUk@3zNy>Hz| zTU^pB$%a>w)93v-Z&bV8YqJJwHMho=sNLeR-|6!CTv;pZQCEgz7^^O?Iy0gBB zr>{fnyX9lO&;RlD^S|{Vlqz2lV?STP3PeN^M4T}_O6p(u!RKc$w_{oB6gg-vkI2C} zl!4lR%f|;iDG{N_!pFKIOgwEUMv?Y@F$fU_72#^RK7!{WA`@x1TST?d;orn8&@iPS zE+e3F^nR1BX+lJzD57Qfe9o}b=fjc@yXmo;(%cTex7h1o*Heq*83Q zpGbX{cH|NARGrSE%qB!b!@eeeSamrZF2rM+d|^a1lcjQ^$nA0OM8lT`Hkio*5m(Sf zSJsB&qHf+425vnjs0dvqglVgf#WnZ@s;GSJzEjFZUa6q7ENs2S=CxXDtyZ>KKMWV- z$fJSj1w~`kUCR`U+v2cXXH$pmbQ&4v4=_4Y3cyX9eMQBuH zl0q)fU+I?vXi^kGOePV8*2G!|s{N3vS}co(r}MLvlvq$0yE44hYPVKft>b3Q7;m%2 zEf!Yh7s^5u6{93>i&A(N4ra04x^Pl5Q8B}6#{`zaZ!w2mh_eWnp}*r_6%MZ2v0de@ z5G5M^h2-$QXEdH`nXcTU+^gKD+^;;KJg7XR^eYc5k0^VUeae32QRRU0m@=R|t~{YU zsXV1TtvsVVt30PXue_kVsJx`StQ=HcQ4T4uDu5x33YLIdwbgssQ67`ZE<(c(ys1aoaotr%htB7YUya( zcc+&>SG=AjOWWJam#^vSUE0&tw&SJ@&UU-f$5t<0(b3hmZ+`~<`NV>MWZMzZx!Ts= z*1NcK$7G#vD)V(L?JZy3+p@Z|yrrk7YlG*T{hsa~$BDfiM|B=n>&1TOn%453Ro%);|+p~D|DF3Q8xUs9N{CM+fLkAo}wzhS3uXBsk@zXnwWbtm*wz{)rRojk>vbg~1 z6)oqr?bwa9&pTAjp;GU7GMg8AJ*(HOTGhQ~#gg)MXvuwutd3O5Gtj2XTURgXUbkZC tV&^wUd@{MFXXwF`%`UC{c>IRBU1nmvX60RK)P?ex;xYnRMzJoXlleF8Z1QO)87)iWEL zrt;h~R9wRsJhMH2;r>y|u352q-M8_-T;%t)0p8}?m5Uav+Fteo(0w%!QMF>hx_Zx_ zjke3`f4# z{ym6z2NCUieHo(xz8)E|k6)F*{}F)MY_^(L&FeN`E89B!@(W*?Z?>4b%S`0Wig(V`BK-A5SVv-Mhdf+@{>aAw6krfaP=>)6f}t3W5g3Kh zxD;bB36pUdreFaUVKHh@i#n`CJ+8tkti~Fw#Wh%mYjGW}$9mj=Fm4RvX55C&xE)(@ z2kyjO*oN)cft}ceM(oBtxEJ@~0X&E%Jj8SM;$iH=V|X0D!|(Al4&zz;fp^byIEI(; z3XbDdyoT5D2L8l*>>U1%&+$(fShV45e1r4&9vAR0{2LeXAN(v~k3@)9d=f1&(m|3X zMN%bA(xsDhmM+p&x=FV5kQ~XCp3+NtOCRYcdD36bmM#xAR zE#ss@#>)hmB$H*TOq1y{LuSexnJe?;3Rx(Nq?$KdjVzZHVOc5bcaT4g)$*i>ABPb45^at(&%AR8ns8|6B5K&8atZrQ`z z`6axCH*o?JF#+R|gg@dDJc_AUC_`{RZ}?=i;3-L%hi=Hg{~#p0L~t5!;~o43f9BKh zSG{HbAnFc6M)&s>sUpFBC}o=VmJ%r4+Q;Vk1qB?A~2DL#uZ)e7#jiW_U zajBAc#u~+^7v{>a+wc$k#JEgJ72|S+3dUL`4>GP$aw%h-l1j#vihTe~y<%?wbCp6N z<0{1-0_JLk@CNR%4|UjWz^qa1KwwbTHM#5d}Z($x*?0I4KDfYoIk0|!WF#8qzWtc}5duW(u#l9Nm zfMTx=b5ODWhIve}Cx>}lu}_Ejt!oHw*uBHJN+fplFuzmm@?l*0iJd>p?-hpum_v#K z0!)kI&;aw4;vfO@wBm39b69cUfN516Lf8<`@PIg)z&xusuE4m~CXO&Le^4B2V2&z| zIxx>Ejz2KR6h|VM=M~2!m=_dBCzux%$0?YX9Czyt=guD$2QQeH6^AjHR}=>{nB$5= z8_cVUgB;B3io+eu3B`dA=1s*R5aun#!4T$c#bJ@R{yW?dM@X1=6~{`LlZvAz%%2s< zPnc7RBPk3gN)E?VnD-P%SD3#ljeVe3pQ49&IKD(oPEK@DbB-S;}vIQunFy0|9pIG z2gPX`Y@*_X4K}23hA~NT5(k^CIGuw{QJmPprYcVHVAB*Qd$1jqt16qWI01z1#J_Jl z@#=XG*v^WxLf9^f^F!FKiZeynZi;h8*bK$lBW!oYc_eJ6;*1hDOL1-qo2|fRv^^B( zo7~A!;@T)ziEE0UN?cR)QWDMBTZyawK1y5-_Eq9)r=Jp6J9$c6?OdYVg30!G?az(4 zD#=&E+OPwZxEf)X>xiq7LM5(7ij=q-DOTdHutbTw!cryf0tYH_7dS{sPd@*)j0Ys{ z3I{83S2#q8yTYML+*J)z;;w4A5?+KIp~PLtNF}cDqm;P9k5=Lef2qUv7gzdnC9d>i zl(^E5RpLrNPKhf_g%Veo@k(4_CMa=*nW)4Src#M3z+@%v`@)xTL*l-0iW2vQQW37@~7~L0>+{##|WHY1t8zjGBtXHyy?QgGAay#QH<60#<8Lv^&$mlMDWH+O`2$FjkuTyd#PaHz;|Caf6b*jIOXG z4>N95vXAjbCC!YkmWaziSXWELg(0k~CE^kh*3}YmvB>A&RTFXD2z#623KG^;8F4KM z>#B^ns)XI5xW0sSHAY-%!nztGxO?Uf#nmV5or>#F*t-;0q_D15x3T@XIECG=xJ-q0 zRZLv4!n!IZE?r?=6%!Y+uy-piXJL0KE^J|4)e~A7UDXp8yRfe6$t^AHy^0H9*!x_S zvMsn4hIP$A_=NERB>~1gO3D}?RO0T9CdJh=tZOR5Zy8-vk&I<@O+_+>(KQuGkns`4 z^)`3*D@kH}RB;Us+pI8+@qpsG9QL5%3LW+_#kD%@2x~eBx!}yF6*IdskareLx zC3m>z{|`JMW)onKD!3YXPRSs~V@d`yKChT{fPFz>3FC`OT-Cm$#MR~>mALPGS;_T` zuQ|+K!JTvF_i-QSJ#N#FslOlzG8j__5;OC z3+#uAITzT!DP~__KT^!Yz<#W-knyx)ZU)vp4#X@C>=}jmjAs=yH*CanJRl}>P9&n?W6N0sh*&*0AhmFHT5v={p6uB-pPN6H2h(D5jQRzg0{!!G5QhZh}3pn0SKyUNHp)dqKIZu^spWHw4$F z?m;AGs9^u4@I2#Bidieze=BTisOVl6W`nfxx*TS)(B@IhXQ3@ZF|&m>-tZ1{Txg3@ z%yyy8tC;sfn@=$VhBm)qE(~n}#jF_Gq80OFXo~?V-G-?$w8bhMU<@jz&(OwO+QC@H zcqQeGY*dHIHMDh5c(K8g-8<~L7*QF~9C0eLcjUInGf{c`KPT#ms5iXJd|iF>d|&vz z{yP7e!0zY?(L17#M4yOBiphy7jj4#46SFpEbIi_|LouggV`J-M_s1TIJr|4)t_vOv z{unnPZbIDNxQp?l<7?t~#ve&YOPG?dKjEVe=up?;L}E(fpv3CL`owdgaB-+92}ui+ zb|)Q8I+gTk()na0CnaYlmnXlRd^-8Zl=76rDd$qor{<-uOKnblDb=KT(>kYBrq!qI zOnWWuOvm{hw{<+69+{q*J~q83eQSDi`WxvNJN4{T(P>quJ)Mqs`nhve=l8orcggND zr^}Hp7rWMVeWRPF+q7;+Ga@r8GPZ;>zV4pbeR%gN-Rru4o0*W=H*;*}uFO+e{;cAx z=Io5@+U#9DQhMB<(?93&+``-qxi9ss>bbL5ajz$PSM)y7C%RA9KGl6T_j#(%`M&9W z*Y$1g7u~PC-|Bux^3wAv@@n!9=b205E?Ixc$^LQuhxXr^KRSPH{zn5w57<56!vcRn zMnP#oxT;`7!QO(G3(ggyuxnv);k3fq!Yze+3y&0@FX~^kspzGm&x^+v&o5qIl33Ea zq@rYf$(fR$ODC7EFFjcL^}v*Y#RDq`UN^95;5&o*52_f{H0X^oZ`shY4P}SQJ{_Dm zc*5XigP$1u-jF#%b`4D!I&0X_VQYsq504u@VED%2=SB<~u`xX2)W``Vn?`;+%0H@f z)P_-qN4+)b!swLIYeyfvwD8g$m!2=rDPLQ@cZ`2b>6m$A4v#rG=FHf8$6;LdxIN=O zuc)dxI^I8i{`fn`ADfUiVfBQ!CR~`9K5^*8c@sBHJYAVqIkR#@<)O;9NyU?PPC7p6 z)5#f=AHOW+vTc{WKc#ZYty5l@nm#o=f9i>8JElE3?XBrYr+--$S=GC0b=A(Q<1?aX z+&kmwj0-c1XU>{=>&)hvr!QZ9dGqC`W~I+MIqTx=^|POulR2ki&dqavnp-^gy17T^ z{y1;wye;$2UE#fA@)cjqAHHz-q6^iT)#cTPs^44eS)9JOcJZ+#bC&E{vVY0pCC8V% zx3qZa+NFnUP*_u5bGYWrm3db_wQTaTjmu6hk6b={`L5;f*Jjs_uH936toGuHo+~!3 zXsWBOJGFA{$}j5&)YrA_&3!(q<%50~6IvDzd&k#sV9eN-z_>Y44R21WY+iT|@ zdm|zPDbZ=sDFI)k$LG)W&-cgsB4WMq2`+lQvCnnSPw1YWy3ZdKxiYFlOloJpKb{}v zcf|Yso%5n2qk};o4+BwAf#k%HH#Wu-;p1B!V!dAO_&UUUWB1*ZpP!JPzNo8+!g;4?%(Zed1c=LPs^(2Zl0F>$LBm%`*?-!DtU`N_4E+|SZ$#t^ITce{#l$MqrC>`SU`@KVk1d~LP`UHFA2eU&t!Ga#a!Z_&|I2%aJ z3GLby3PeRm1rjAGcqlG3D?XUriKpGUjpwEJ2o^Qm^!m9lyJeP%zaue4+K<`IB6iTD zT$VqSoYh_^Eum|cBo;22E#u0UnVXZFGep{3u}pkLsqN)YF7WXxN__5!7cQ65iJ&>Qx)zFZp8e~rQHwd-<%MNg(il}1TI=g_W^ zybOtmitt49LlKhbKH)vY4|_e2-yRtXC5A#(?blrt+}yde6dZg0uY!AUzF6SWuOU`z zYO*)Q-A9?O%*AEWeq*^Jhq);!^7Zc`C0b^!>#STB`#-Jil^YzQRn0mtEgcd4_P|gm z_SZi;I24kOp}0dlFR{I_E9?3#sIKB#li4GNJL?0vVX- zTeXJo*VYDHT)4P)div{width:100%;height:100%}.CodeMirror span.cm-meta{color:var(--vscode-editor-foreground)}.CodeMirror span.cm-number{color:var(--vscode-debugTokenExpression-number)}.CodeMirror span.cm-keyword{color:var(--vscode-debugTokenExpression-name)}.CodeMirror span.cm-operator{color:var(--vscode-editor-foreground)}.CodeMirror span.cm-string,.CodeMirror span.cm-string-2{color:var(--vscode-debugTokenExpression-string)}.CodeMirror span.cm-error{color:var(--vscode-errorForeground)}.CodeMirror span.cm-def,.CodeMirror span.cm-tag{color:#0070c1}.CodeMirror span.cm-comment,.CodeMirror span.cm-link{color:green}.CodeMirror span.cm-variable,.CodeMirror span.cm-variable-2,.CodeMirror span.cm-atom{color:#0070c1}.CodeMirror span.cm-property{color:#795e26}.CodeMirror span.cm-qualifier,.CodeMirror span.cm-attribute{color:#001080}.CodeMirror span.cm-variable-3,.CodeMirror span.cm-type{color:#267f99}body.dark-mode .CodeMirror span.cm-def,body.dark-mode .CodeMirror span.cm-tag{color:var(--vscode-debugView-valueChangedHighlight)}body.dark-mode .CodeMirror span.cm-comment,body.dark-mode .CodeMirror span.cm-link{color:#6a9955}body.dark-mode .CodeMirror span.cm-variable,body.dark-mode .CodeMirror span.cm-variable-2,body.dark-mode .CodeMirror span.cm-atom{color:#4fc1ff}body.dark-mode .CodeMirror span.cm-property{color:#dcdcaa}body.dark-mode .CodeMirror span.cm-qualifier,body.dark-mode .CodeMirror span.cm-attribute{color:#9cdcfe}body.dark-mode .CodeMirror span.cm-variable-3,body.dark-mode .CodeMirror span.cm-type{color:#4ec9b0}.CodeMirror span.cm-bracket{color:var(--vscode-editorBracketHighlight-foreground3)}.CodeMirror-cursor{border-left:1px solid var(--vscode-editor-foreground)!important}.CodeMirror div.CodeMirror-selected{background:var(--vscode-terminal-inactiveSelectionBackground)}.CodeMirror .CodeMirror-gutters{z-index:0;background:1px solid var(--vscode-editorGroup-border);border-right:none}.CodeMirror .CodeMirror-gutter-elt{background-color:var(--vscode-editorGutter-background)}.CodeMirror .CodeMirror-gutterwrapper{border-right:1px solid var(--vscode-editorGroup-border);color:var(--vscode-editorLineNumber-foreground)}.CodeMirror .CodeMirror-matchingbracket{background-color:var(--vscode-editorBracketPairGuide-background1);color:var(--vscode-editorBracketHighlight-foreground1)!important}.CodeMirror{font-family:var(--vscode-editor-font-family)!important;color:var(--vscode-editor-foreground)!important;background-color:var(--vscode-editor-background)!important;font-weight:var(--vscode-editor-font-weight)!important;font-size:var(--vscode-editor-font-size)!important}.CodeMirror .source-line-running{background-color:var(--vscode-editor-selectionBackground);z-index:2}.CodeMirror .source-line-paused{background-color:var(--vscode-editor-selectionHighlightBackground);z-index:2}.CodeMirror .source-line-error-underline{text-decoration:underline wavy var(--vscode-errorForeground);position:relative;top:-12px}.CodeMirror .source-line-error-widget{background-color:var(--vscode-inputValidation-errorBackground);white-space:pre-wrap;margin:3px 10px;padding:5px}.split-view{display:flex;flex:auto;position:relative}.split-view.vertical{flex-direction:column}.split-view.vertical.sidebar-first{flex-direction:column-reverse}.split-view.horizontal{flex-direction:row}.split-view.horizontal.sidebar-first{flex-direction:row-reverse}.split-view-main{display:flex;flex:auto}.split-view-sidebar{display:flex;flex:none}.split-view.vertical:not(.sidebar-first)>.split-view-sidebar{border-top:1px solid var(--vscode-panel-border)}.split-view.horizontal:not(.sidebar-first)>.split-view-sidebar{border-left:1px solid var(--vscode-panel-border)}.split-view.vertical.sidebar-first>.split-view-sidebar{border-bottom:1px solid var(--vscode-panel-border)}.split-view.horizontal.sidebar-first>.split-view-sidebar{border-right:1px solid var(--vscode-panel-border)}.split-view-resizer{position:absolute;z-index:100}.split-view.vertical>.split-view-resizer{left:0;right:0;height:12px;cursor:ns-resize}.split-view.horizontal>.split-view-resizer{top:0;bottom:0;width:12px;cursor:ew-resize}.tabbed-pane{display:flex;flex:auto;overflow:hidden}.tabbed-pane .toolbar{background-color:var(--vscode-sideBar-background)}.tabbed-pane .tab-content{display:flex;flex:auto;overflow:hidden;position:relative;flex-direction:column}.tabbed-pane-tab{padding:2px 6px 0;cursor:pointer;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border-bottom:2px solid transparent;outline:none;height:100%}.tabbed-pane-tab-label{max-width:250px;white-space:pre;overflow:hidden;text-overflow:ellipsis;display:inline-block}.tabbed-pane-tab.selected{background-color:var(--vscode-tab-activeBackground)}.tabbed-pane-tab-counter{padding:0 4px;background:var(--vscode-menu-separatorBackground);border-radius:8px;height:16px;margin-left:4px;line-height:16px;min-width:18px;display:flex;align-items:center;justify-content:center}.tabbed-pane-tab-counter.error{background:var(--vscode-list-errorForeground);color:var(--vscode-button-foreground)}.toolbar{position:relative;display:flex;color:var(--vscode-sideBarTitle-foreground);min-height:35px;align-items:center;flex:none;padding-right:4px}.toolbar:after{content:"";display:block;position:absolute;pointer-events:none;top:0;bottom:0;left:-2px;right:-2px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px;z-index:100}.toolbar.no-shadow:after{box-shadow:none}.toolbar.no-min-height{min-height:0}.toolbar input{padding:0 5px;line-height:24px;outline:none;margin:0 4px}.toolbar select{background:none;outline:none;padding:3px;margin:2px}.toolbar input,.toolbar select{border:none;color:var(--vscode-input-foreground);background-color:var(--vscode-input-background)}.toolbar-button{flex:none;border:none;outline:none;color:var(--vscode-sideBarTitle-foreground);background:transparent;padding:4px;cursor:pointer;display:inline-flex;align-items:center}.toolbar-button:disabled{color:var(--vscode-disabledForeground)!important;cursor:default}.toolbar-button:not(:disabled):hover{background-color:var(--vscode-toolbar-hoverBackground)}.toolbar-button:not(:disabled):active{background-color:var(--vscode-toolbar-activeBackground)}.toolbar-button.toggled{color:var(--vscode-notificationLink-foreground)}.toolbar-separator{flex:none;background-color:var(--vscode-menu-separatorBackground);width:1px;padding:0;margin:5px 4px;height:16px}.call-log{display:flex;flex-direction:column;flex:auto;line-height:20px;white-space:pre;overflow:auto}.call-log-message{flex:none;padding:3px 0 3px 36px;display:flex;align-items:center}.call-log-call{display:flex;flex:none;flex-direction:column;border-top:1px solid var(--vscode-panel-border)}.call-log-call-header{height:24px;display:flex;align-items:center;padding:0 2px;z-index:2}.call-log-call .codicon{padding:0 4px;flex:none}.call-log .codicon-check{color:#21a945;font-weight:700}.call-log-call.error{background-color:var(--vscode-inputValidation-errorBackground);border-top:1px solid var(--vscode-panel-border)}.call-log-call.error .call-log-call-header,.call-log-message.error,.call-log .codicon-error{color:var(--vscode-errorForeground)}.call-log-details{flex:0 1 auto;overflow-x:hidden;text-overflow:ellipsis}.call-log-url{color:var(--vscode-charts-blue)}.call-log-selector{color:var(--vscode-charts-orange);white-space:nowrap}.call-log-time{flex:none;margin-left:4px;color:var(--gray)}.call-log-call .codicon.preview{visibility:hidden;color:var(--vscode-sideBarTitle-foreground);cursor:pointer}.call-log-call .codicon.preview:hover{color:inherit}.call-log-call:hover .codicon.preview{visibility:visible}.recorder{display:flex;flex-direction:column;flex:auto}.recorder-chooser{border:none;background:none;outline:none;color:var(--vscode-sideBarTitle-foreground);min-width:100px}.recorder .codicon{font-size:16px}.recorder .codicon.circle-large-filled{font-size:15px}.recorder .toolbar-button.toggled.circle-large-filled{color:#a1260d}body.dark-mode .recorder .toolbar-button.toggled.circle-large-filled{color:#f48771}.recorder .toolbar-button:not([disabled]) .codicon-debug-continue,.recorder .toolbar-button:not([disabled]) .codicon-debug-step-over{color:#01bb01}.recorder .toolbar-button:not([disabled]):hover .codicon-debug-continue,.recorder .toolbar-button:not([disabled]):hover .codicon-debug-step-over{color:#41ca1e}.recorder .selector-input{flex:auto} diff --git a/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-BBRTdeT3.js b/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-BBRTdeT3.js deleted file mode 100644 index f91c0b2f..00000000 --- a/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-BBRTdeT3.js +++ /dev/null @@ -1,47 +0,0 @@ -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/codeMirrorModule-BwGUc5aQ.js","assets/codeMirrorModule-ez37Vkbh.css"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();var Rh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ps={exports:{}},_l={},Ls={exports:{}},M={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var dr=Symbol.for("react.element"),hf=Symbol.for("react.portal"),mf=Symbol.for("react.fragment"),gf=Symbol.for("react.strict_mode"),vf=Symbol.for("react.profiler"),yf=Symbol.for("react.provider"),wf=Symbol.for("react.context"),Sf=Symbol.for("react.forward_ref"),xf=Symbol.for("react.suspense"),kf=Symbol.for("react.memo"),Ef=Symbol.for("react.lazy"),au=Symbol.iterator;function Cf(e){return e===null||typeof e!="object"?null:(e=au&&e[au]||e["@@iterator"],typeof e=="function"?e:null)}var $s={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zs=Object.assign,Os={};function yn(e,t,n){this.props=e,this.context=t,this.refs=Os,this.updater=n||$s}yn.prototype.isReactComponent={};yn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};yn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Rs(){}Rs.prototype=yn.prototype;function ho(e,t,n){this.props=e,this.context=t,this.refs=Os,this.updater=n||$s}var mo=ho.prototype=new Rs;mo.constructor=ho;zs(mo,yn.prototype);mo.isPureReactComponent=!0;var cu=Array.isArray,js=Object.prototype.hasOwnProperty,go={current:null},Ms={key:!0,ref:!0,__self:!0,__source:!0};function Is(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)js.call(t,r)&&!Ms.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1{const r=e.current;if(!r)return;const l=new ResizeObserver(i=>{const o=i[i.length-1];o&&o.contentRect&&n(o.contentRect)});return l.observe(r),()=>l.disconnect()},[e]),[t,e]}function Mf(e){if(!isFinite(e))return"-";if(e===0)return"0";if(e<1e3)return e.toFixed(0)+"ms";const t=e/1e3;if(t<60)return t.toFixed(1)+"s";const n=t/60;if(n<60)return n.toFixed(1)+"m";const r=n/60;return r<24?r.toFixed(1)+"h":(r/24).toFixed(1)+"d"}function du(e){const t=document.createElement("textarea");t.style.position="absolute",t.style.zIndex="-1000",t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}function pu(e,t){const n=e?Yn.getObject(e,t):t,[r,l]=Ar.useState(n);return[r,o=>{e&&Yn.setObject(e,o),l(o)}]}class If{getString(t,n){return localStorage[t]||n}setString(t,n){localStorage[t]=n,window.saveSettings&&window.saveSettings()}getObject(t,n){if(!localStorage[t])return n;try{return JSON.parse(localStorage[t])}catch{return n}}setObject(t,n){localStorage[t]=JSON.stringify(n),window.saveSettings&&window.saveSettings()}}const Yn=new If;function Ff(){if(document.playwrightThemeInitialized)return;document.playwrightThemeInitialized=!0,document.defaultView.addEventListener("focus",n=>{n.target.document.nodeType===Node.DOCUMENT_NODE&&document.body.classList.remove("inactive")},!1),document.defaultView.addEventListener("blur",n=>{document.body.classList.add("inactive")},!1);const e=Yn.getString("theme","light-mode"),t=window.matchMedia("(prefers-color-scheme: dark)");(e==="dark-mode"||t.matches)&&document.body.classList.add("dark-mode")}const Df=new Set;function Af(){const e=Yn.getString("theme","light-mode");let t;e==="dark-mode"?t="light-mode":t="dark-mode",e&&document.body.classList.remove(e),document.body.classList.add(t),Yn.setString("theme",t);for(const n of Df)n(t)}var As={exports:{}},$e={},Us={exports:{}},Ws={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(L,R){var j=L.length;L.push(R);e:for(;0>>1,ne=L[Y];if(0>>1;Yl(Ql,j))Ltl(wr,Ql)?(L[Y]=wr,L[Lt]=j,Y=Lt):(L[Y]=Ql,L[Pt]=j,Y=Pt);else if(Ltl(wr,j))L[Y]=wr,L[Lt]=j,Y=Lt;else break e}}return R}function l(L,R){var j=L.sortIndex-R.sortIndex;return j!==0?j:L.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var s=[],a=[],m=1,p=null,h=3,g=!1,S=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(L){for(var R=n(a);R!==null;){if(R.callback===null)r(a);else if(R.startTime<=L)r(a),R.sortIndex=R.expirationTime,t(s,R);else break;R=n(a)}}function w(L){if(v=!1,d(L),!S)if(n(s)!==null)S=!0,Cn(C);else{var R=n(a);R!==null&&Tn(w,R.startTime-L)}}function C(L,R){S=!1,v&&(v=!1,f($),$=-1),g=!0;var j=h;try{for(d(R),p=n(s);p!==null&&(!(p.expirationTime>R)||L&&!D());){var Y=p.callback;if(typeof Y=="function"){p.callback=null,h=p.priorityLevel;var ne=Y(p.expirationTime<=R);R=e.unstable_now(),typeof ne=="function"?p.callback=ne:p===n(s)&&r(s),d(R)}else r(s);p=n(s)}if(p!==null)var yr=!0;else{var Pt=n(a);Pt!==null&&Tn(w,Pt.startTime-R),yr=!1}return yr}finally{p=null,h=j,g=!1}}var N=!1,T=null,$=-1,x=5,z=-1;function D(){return!(e.unstable_now()-zL||125Y?(L.sortIndex=j,t(a,L),n(s)===null&&L===n(a)&&(v?(f($),$=-1):v=!0,Tn(w,j-Y))):(L.sortIndex=ne,t(s,L),S||g||(S=!0,Cn(C))),L},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(L){var R=h;return function(){var j=h;h=R;try{return L.apply(this,arguments)}finally{h=j}}}})(Ws);Us.exports=Ws;var Uf=Us.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Bs=A,Le=Uf;function k(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wi=Object.prototype.hasOwnProperty,Wf=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hu={},mu={};function Bf(e){return wi.call(mu,e)?!0:wi.call(hu,e)?!1:Wf.test(e)?mu[e]=!0:(hu[e]=!0,!1)}function Hf(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Vf(e,t,n,r){if(t===null||typeof t>"u"||Hf(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ye(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var se={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){se[e]=new ye(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];se[t]=new ye(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){se[e]=new ye(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){se[e]=new ye(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){se[e]=new ye(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){se[e]=new ye(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){se[e]=new ye(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){se[e]=new ye(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){se[e]=new ye(e,5,!1,e.toLowerCase(),null,!1,!1)});var yo=/[\-:]([a-z])/g;function wo(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(yo,wo);se[t]=new ye(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(yo,wo);se[t]=new ye(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(yo,wo);se[t]=new ye(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){se[e]=new ye(e,1,!1,e.toLowerCase(),null,!1,!1)});se.xlinkHref=new ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){se[e]=new ye(e,1,!1,e.toLowerCase(),null,!0,!0)});function So(e,t,n,r){var l=se.hasOwnProperty(t)?se[t]:null;(l!==null?l.type!==0:r||!(2u||l[o]!==i[u]){var s=` -`+l[o].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=u);break}}}finally{Yl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Mn(e):""}function Qf(e){switch(e.tag){case 5:return Mn(e.type);case 16:return Mn("Lazy");case 13:return Mn("Suspense");case 19:return Mn("SuspenseList");case 0:case 2:case 15:return e=ql(e.type,!1),e;case 11:return e=ql(e.type.render,!1),e;case 1:return e=ql(e.type,!0),e;default:return""}}function Ei(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Gt:return"Fragment";case Kt:return"Portal";case Si:return"Profiler";case xo:return"StrictMode";case xi:return"Suspense";case ki:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qs:return(e.displayName||"Context")+".Consumer";case Vs:return(e._context.displayName||"Context")+".Provider";case ko:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Eo:return t=e.displayName||null,t!==null?t:Ei(e.type)||"Memo";case at:t=e._payload,e=e._init;try{return Ei(e(t))}catch{}}return null}function Kf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ei(t);case 8:return t===xo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Et(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gf(e){var t=Gs(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kr(e){e._valueTracker||(e._valueTracker=Gf(e))}function Ys(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Gs(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function tl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ci(e,t){var n=t.checked;return K({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function vu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Et(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qs(e,t){t=t.checked,t!=null&&So(e,"checked",t,!1)}function Ti(e,t){qs(e,t);var n=Et(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ni(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ni(e,t.type,Et(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yu(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ni(e,t,n){(t!=="number"||tl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var In=Array.isArray;function ln(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Er.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Jn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var An={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yf=["Webkit","ms","Moz","O"];Object.keys(An).forEach(function(e){Yf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),An[t]=An[e]})});function bs(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||An.hasOwnProperty(e)&&An[e]?(""+t).trim():t+"px"}function ea(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=bs(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var qf=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Li(e,t){if(t){if(qf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(k(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(k(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(k(61))}if(t.style!=null&&typeof t.style!="object")throw Error(k(62))}}function $i(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zi=null;function Co(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Oi=null,on=null,un=null;function xu(e){if(e=mr(e)){if(typeof Oi!="function")throw Error(k(280));var t=e.stateNode;t&&(t=Ol(t),Oi(e.stateNode,e.type,t))}}function ta(e){on?un?un.push(e):un=[e]:on=e}function na(){if(on){var e=on,t=un;if(un=on=null,xu(e),t)for(e=0;e>>=0,e===0?32:31-(od(e)/ud|0)|0}var Cr=64,Tr=4194304;function Fn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function il(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var u=o&~l;u!==0?r=Fn(u):(i&=o,i!==0&&(r=Fn(i)))}else o=n&~l,o!==0?r=Fn(o):i!==0&&(r=Fn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function pr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-He(t),e[t]=n}function fd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Wn),$u=" ",zu=!1;function ka(e,t){switch(e){case"keyup":return Ad.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ea(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Yt=!1;function Wd(e,t){switch(e){case"compositionend":return Ea(t);case"keypress":return t.which!==32?null:(zu=!0,$u);case"textInput":return e=t.data,e===$u&&zu?null:e;default:return null}}function Bd(e,t){if(Yt)return e==="compositionend"||!Oo&&ka(e,t)?(e=Sa(),Wr=Lo=pt=null,Yt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mu(n)}}function _a(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_a(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pa(){for(var e=window,t=tl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=tl(e.document)}return t}function Ro(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Xd(e){var t=Pa(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_a(n.ownerDocument.documentElement,n)){if(r!==null&&Ro(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=Iu(n,i);var o=Iu(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,qt=null,Di=null,Hn=null,Ai=!1;function Fu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ai||qt==null||qt!==tl(r)||(r=qt,"selectionStart"in r&&Ro(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hn&&nr(Hn,r)||(Hn=r,r=sl(Di,"onSelect"),0Zt||(e.current=Qi[Zt],Qi[Zt]=null,Zt--)}function U(e,t){Zt++,Qi[Zt]=e.current,e.current=t}var Ct={},he=Nt(Ct),Ee=Nt(!1),Ft=Ct;function dn(e,t){var n=e.type.contextTypes;if(!n)return Ct;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ce(e){return e=e.childContextTypes,e!=null}function cl(){B(Ee),B(he)}function Vu(e,t,n){if(he.current!==Ct)throw Error(k(168));U(he,t),U(Ee,n)}function Fa(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(k(108,Kf(e)||"Unknown",l));return K({},n,r)}function fl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ct,Ft=he.current,U(he,e),U(Ee,Ee.current),!0}function Qu(e,t,n){var r=e.stateNode;if(!r)throw Error(k(169));n?(e=Fa(e,t,Ft),r.__reactInternalMemoizedMergedChildContext=e,B(Ee),B(he),U(he,e)):B(Ee),U(Ee,n)}var be=null,Rl=!1,ai=!1;function Da(e){be===null?be=[e]:be.push(e)}function ap(e){Rl=!0,Da(e)}function _t(){if(!ai&&be!==null){ai=!0;var e=0,t=F;try{var n=be;for(F=1;e>=o,l-=o,et=1<<32-He(t)+l|n<$?(x=T,T=null):x=T.sibling;var z=h(f,T,d[$],w);if(z===null){T===null&&(T=x);break}e&&T&&z.alternate===null&&t(f,T),c=i(z,c,$),N===null?C=z:N.sibling=z,N=z,T=x}if($===d.length)return n(f,T),H&&$t(f,$),C;if(T===null){for(;$$?(x=T,T=null):x=T.sibling;var D=h(f,T,z.value,w);if(D===null){T===null&&(T=x);break}e&&T&&D.alternate===null&&t(f,T),c=i(D,c,$),N===null?C=D:N.sibling=D,N=D,T=x}if(z.done)return n(f,T),H&&$t(f,$),C;if(T===null){for(;!z.done;$++,z=d.next())z=p(f,z.value,w),z!==null&&(c=i(z,c,$),N===null?C=z:N.sibling=z,N=z);return H&&$t(f,$),C}for(T=r(f,T);!z.done;$++,z=d.next())z=g(T,f,$,z.value,w),z!==null&&(e&&z.alternate!==null&&T.delete(z.key===null?$:z.key),c=i(z,c,$),N===null?C=z:N.sibling=z,N=z);return e&&T.forEach(function(E){return t(f,E)}),H&&$t(f,$),C}function y(f,c,d,w){if(typeof d=="object"&&d!==null&&d.type===Gt&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case xr:e:{for(var C=d.key,N=c;N!==null;){if(N.key===C){if(C=d.type,C===Gt){if(N.tag===7){n(f,N.sibling),c=l(N,d.props.children),c.return=f,f=c;break e}}else if(N.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===at&&Zu(C)===N.type){n(f,N.sibling),c=l(N,d.props),c.ref=zn(f,N,d),c.return=f,f=c;break e}n(f,N);break}else t(f,N);N=N.sibling}d.type===Gt?(c=It(d.props.children,f.mode,w,d.key),c.return=f,f=c):(w=qr(d.type,d.key,d.props,null,f.mode,w),w.ref=zn(f,c,d),w.return=f,f=w)}return o(f);case Kt:e:{for(N=d.key;c!==null;){if(c.key===N)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(f,c.sibling),c=l(c,d.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=vi(d,f.mode,w),c.return=f,f=c}return o(f);case at:return N=d._init,y(f,c,N(d._payload),w)}if(In(d))return S(f,c,d,w);if(Nn(d))return v(f,c,d,w);Or(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,d),c.return=f,f=c):(n(f,c),c=gi(d,f.mode,w),c.return=f,f=c),o(f)):n(f,c)}return y}var hn=Ka(!0),Ga=Ka(!1),gr={},Je=Nt(gr),or=Nt(gr),ur=Nt(gr);function jt(e){if(e===gr)throw Error(k(174));return e}function Bo(e,t){switch(U(ur,t),U(or,e),U(Je,gr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Pi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Pi(t,e)}B(Je),U(Je,t)}function mn(){B(Je),B(or),B(ur)}function Ya(e){jt(ur.current);var t=jt(Je.current),n=Pi(t,e.type);t!==n&&(U(or,e),U(Je,n))}function Ho(e){or.current===e&&(B(Je),B(or))}var V=Nt(0);function vl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ci=[];function Vo(){for(var e=0;en?n:4,e(!0);var r=fi.transition;fi.transition={};try{e(!1),t()}finally{F=n,fi.transition=r}}function cc(){return De().memoizedState}function pp(e,t,n){var r=xt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e))dc(t,n);else if(n=Ba(e,t,n,r),n!==null){var l=ge();Ve(n,e,r,l),pc(n,t,r)}}function hp(e,t,n){var r=xt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))dc(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,u=i(o,n);if(l.hasEagerState=!0,l.eagerState=u,Qe(u,o)){var s=t.interleaved;s===null?(l.next=l,Uo(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=Ba(e,t,l,r),n!==null&&(l=ge(),Ve(n,e,r,l),pc(n,t,r))}}function fc(e){var t=e.alternate;return e===Q||t!==null&&t===Q}function dc(e,t){Vn=yl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,No(e,n)}}var wl={readContext:Fe,useCallback:ce,useContext:ce,useEffect:ce,useImperativeHandle:ce,useInsertionEffect:ce,useLayoutEffect:ce,useMemo:ce,useReducer:ce,useRef:ce,useState:ce,useDebugValue:ce,useDeferredValue:ce,useTransition:ce,useMutableSource:ce,useSyncExternalStore:ce,useId:ce,unstable_isNewReconciler:!1},mp={readContext:Fe,useCallback:function(e,t){return Ge().memoizedState=[e,t===void 0?null:t],e},useContext:Fe,useEffect:es,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Qr(4194308,4,ic.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qr(4,2,e,t)},useMemo:function(e,t){var n=Ge();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ge();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=pp.bind(null,Q,e),[r.memoizedState,e]},useRef:function(e){var t=Ge();return e={current:e},t.memoizedState=e},useState:bu,useDebugValue:qo,useDeferredValue:function(e){return Ge().memoizedState=e},useTransition:function(){var e=bu(!1),t=e[0];return e=dp.bind(null,e[1]),Ge().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Q,l=Ge();if(H){if(n===void 0)throw Error(k(407));n=n()}else{if(n=t(),le===null)throw Error(k(349));At&30||Xa(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,es(ba.bind(null,r,i,e),[e]),r.flags|=2048,cr(9,Za.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ge(),t=le.identifierPrefix;if(H){var n=tt,r=et;n=(r&~(1<<32-He(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=sr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Ye]=t,e[ir]=r,kc(e,t,!1,!1),t.stateNode=e;e:{switch(o=$i(n,r),n){case"dialog":W("cancel",e),W("close",e),l=r;break;case"iframe":case"object":case"embed":W("load",e),l=r;break;case"video":case"audio":for(l=0;lvn&&(t.flags|=128,r=!0,On(i,!1),t.lanes=4194304)}else{if(!r)if(e=vl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),On(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!H)return fe(t),null}else 2*q()-i.renderingStartTime>vn&&n!==1073741824&&(t.flags|=128,r=!0,On(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=q(),t.sibling=null,n=V.current,U(V,r?n&1|2:n&1),t):(fe(t),null);case 22:case 23:return tu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ne&1073741824&&(fe(t),t.subtreeFlags&6&&(t.flags|=8192)):fe(t),null;case 24:return null;case 25:return null}throw Error(k(156,t.tag))}function Ep(e,t){switch(Mo(t),t.tag){case 1:return Ce(t.type)&&cl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mn(),B(Ee),B(he),Vo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ho(t),null;case 13:if(B(V),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(k(340));pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(V),null;case 4:return mn(),null;case 10:return Ao(t.type._context),null;case 22:case 23:return tu(),null;case 24:return null;default:return null}}var jr=!1,pe=!1,Cp=typeof WeakSet=="function"?WeakSet:Set,_=null;function nn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){G(e,t,r)}else n.current=null}function ro(e,t,n){try{n()}catch(r){G(e,t,r)}}var as=!1;function Tp(e,t){if(Ui=ol,e=Pa(),Ro(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,u=-1,s=-1,a=0,m=0,p=e,h=null;t:for(;;){for(var g;p!==n||l!==0&&p.nodeType!==3||(u=o+l),p!==i||r!==0&&p.nodeType!==3||(s=o+r),p.nodeType===3&&(o+=p.nodeValue.length),(g=p.firstChild)!==null;)h=p,p=g;for(;;){if(p===e)break t;if(h===n&&++a===l&&(u=o),h===i&&++m===r&&(s=o),(g=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=g}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wi={focusedElem:e,selectionRange:n},ol=!1,_=t;_!==null;)if(t=_,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_=e;else for(;_!==null;){t=_;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var v=S.memoizedProps,y=S.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ue(t.type,v),y);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(k(163))}}catch(w){G(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,_=e;break}_=t.return}return S=as,as=!1,S}function Qn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&ro(t,n,i)}l=l.next}while(l!==r)}}function Il(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function lo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Tc(e){var t=e.alternate;t!==null&&(e.alternate=null,Tc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ye],delete t[ir],delete t[Vi],delete t[up],delete t[sp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Nc(e){return e.tag===5||e.tag===3||e.tag===4}function cs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function io(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=al));else if(r!==4&&(e=e.child,e!==null))for(io(e,t,n),e=e.sibling;e!==null;)io(e,t,n),e=e.sibling}function oo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(oo(e,t,n),e=e.sibling;e!==null;)oo(e,t,n),e=e.sibling}var ie=null,We=!1;function st(e,t,n){for(n=n.child;n!==null;)_c(e,t,n),n=n.sibling}function _c(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(Pl,n)}catch{}switch(n.tag){case 5:pe||nn(n,t);case 6:var r=ie,l=We;ie=null,st(e,t,n),ie=r,We=l,ie!==null&&(We?(e=ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ie.removeChild(n.stateNode));break;case 18:ie!==null&&(We?(e=ie,n=n.stateNode,e.nodeType===8?si(e.parentNode,n):e.nodeType===1&&si(e,n),er(e)):si(ie,n.stateNode));break;case 4:r=ie,l=We,ie=n.stateNode.containerInfo,We=!0,st(e,t,n),ie=r,We=l;break;case 0:case 11:case 14:case 15:if(!pe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&ro(n,t,o),l=l.next}while(l!==r)}st(e,t,n);break;case 1:if(!pe&&(nn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){G(n,t,u)}st(e,t,n);break;case 21:st(e,t,n);break;case 22:n.mode&1?(pe=(r=pe)||n.memoizedState!==null,st(e,t,n),pe=r):st(e,t,n);break;default:st(e,t,n)}}function fs(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Cp),t.forEach(function(r){var l=jp.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Ae(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_p(r/1960))-r,10e?16:e,ht===null)var r=!1;else{if(e=ht,ht=null,kl=0,I&6)throw Error(k(331));var l=I;for(I|=4,_=e.current;_!==null;){var i=_,o=i.child;if(_.flags&16){var u=i.deletions;if(u!==null){for(var s=0;sq()-bo?Mt(e,0):Zo|=n),Te(e,t)}function Mc(e,t){t===0&&(e.mode&1?(t=Tr,Tr<<=1,!(Tr&130023424)&&(Tr=4194304)):t=1);var n=ge();e=it(e,t),e!==null&&(pr(e,t,n),Te(e,n))}function Rp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mc(e,n)}function jp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(k(314))}r!==null&&r.delete(t),Mc(e,n)}var Ic;Ic=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ee.current)ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ke=!1,xp(e,t,n);ke=!!(e.flags&131072)}else ke=!1,H&&t.flags&1048576&&Aa(t,pl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Kr(e,t),e=t.pendingProps;var l=dn(t,he.current);an(t,n),l=Ko(null,t,r,e,l,n);var i=Go();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ce(r)?(i=!0,fl(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Wo(t),l.updater=jl,t.stateNode=l,l._reactInternals=t,Ji(t,r,e,n),t=bi(null,t,r,!0,i,n)):(t.tag=0,H&&i&&jo(t),me(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Kr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Ip(r),e=Ue(r,e),l){case 0:t=Zi(null,t,r,e,n);break e;case 1:t=os(null,t,r,e,n);break e;case 11:t=ls(null,t,r,e,n);break e;case 14:t=is(null,t,r,Ue(r.type,e),n);break e}throw Error(k(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),Zi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),os(e,t,r,l,n);case 3:e:{if(wc(t),e===null)throw Error(k(387));r=t.pendingProps,i=t.memoizedState,l=i.element,Ha(e,t),gl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=gn(Error(k(423)),t),t=us(e,t,r,n,l);break e}else if(r!==l){l=gn(Error(k(424)),t),t=us(e,t,r,n,l);break e}else for(_e=yt(t.stateNode.containerInfo.firstChild),Pe=t,H=!0,Be=null,n=Ga(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(pn(),r===l){t=ot(e,t,n);break e}me(e,t,r,n)}t=t.child}return t;case 5:return Ya(t),e===null&&Gi(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,Bi(r,l)?o=null:i!==null&&Bi(r,i)&&(t.flags|=32),yc(e,t),me(e,t,o,n),t.child;case 6:return e===null&&Gi(t),null;case 13:return Sc(e,t,n);case 4:return Bo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hn(t,null,r,n):me(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),ls(e,t,r,l,n);case 7:return me(e,t,t.pendingProps,n),t.child;case 8:return me(e,t,t.pendingProps.children,n),t.child;case 12:return me(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,U(hl,r._currentValue),r._currentValue=o,i!==null)if(Qe(i.value,o)){if(i.children===l.children&&!Ee.current){t=ot(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){o=i.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=nt(-1,n&-n),s.tag=2;var a=i.updateQueue;if(a!==null){a=a.shared;var m=a.pending;m===null?s.next=s:(s.next=m.next,m.next=s),a.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Yi(i.return,n,t),u.lanes|=n;break}s=s.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(k(341));o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Yi(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}me(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,an(t,n),l=Fe(l),r=r(l),t.flags|=1,me(e,t,r,n),t.child;case 14:return r=t.type,l=Ue(r,t.pendingProps),l=Ue(r.type,l),is(e,t,r,l,n);case 15:return gc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),Kr(e,t),t.tag=1,Ce(r)?(e=!0,fl(t)):e=!1,an(t,n),Qa(t,r,l),Ji(t,r,l,n),bi(null,t,r,!0,e,n);case 19:return xc(e,t,n);case 22:return vc(e,t,n)}throw Error(k(156,t.tag))};function Fc(e,t){return aa(e,t)}function Mp(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Me(e,t,n,r){return new Mp(e,t,n,r)}function ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ip(e){if(typeof e=="function")return ru(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ko)return 11;if(e===Eo)return 14}return 2}function kt(e,t){var n=e.alternate;return n===null?(n=Me(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qr(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")ru(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Gt:return It(n.children,l,i,t);case xo:o=8,l|=8;break;case Si:return e=Me(12,n,t,l|2),e.elementType=Si,e.lanes=i,e;case xi:return e=Me(13,n,t,l),e.elementType=xi,e.lanes=i,e;case ki:return e=Me(19,n,t,l),e.elementType=ki,e.lanes=i,e;case Ks:return Dl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Vs:o=10;break e;case Qs:o=9;break e;case ko:o=11;break e;case Eo:o=14;break e;case at:o=16,r=null;break e}throw Error(k(130,e==null?e:typeof e,""))}return t=Me(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function It(e,t,n,r){return e=Me(7,e,r,t),e.lanes=n,e}function Dl(e,t,n,r){return e=Me(22,e,r,t),e.elementType=Ks,e.lanes=n,e.stateNode={isHidden:!1},e}function gi(e,t,n){return e=Me(6,e,null,t),e.lanes=n,e}function vi(e,t,n){return t=Me(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fp(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xl(0),this.expirationTimes=Xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function lu(e,t,n,r,l,i,o,u,s){return e=new Fp(e,t,n,u,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Me(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wo(i),e}function Dp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wc)}catch(e){console.error(e)}}Wc(),As.exports=$e;var Hp=As.exports;const Vp="modulepreload",Qp=function(e){return"/"+e},ws={},Kp=function(t,n,r){let l=Promise.resolve();if(n&&n.length>0){const i=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));l=Promise.all(n.map(s=>{if(s=Qp(s),s in ws)return;ws[s]=!0;const a=s.endsWith(".css"),m=a?'[rel="stylesheet"]':"";if(!!r)for(let g=i.length-1;g>=0;g--){const S=i[g];if(S.href===s&&(!a||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${m}`))return;const h=document.createElement("link");if(h.rel=a?"stylesheet":Vp,a||(h.as="script",h.crossOrigin=""),h.href=s,u&&h.setAttribute("nonce",u),document.head.appendChild(h),a)return new Promise((g,S)=>{h.addEventListener("load",g),h.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${s}`)))})}))}return l.then(()=>t()).catch(i=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i})};function Gp(e){const t=/(\x1b\[(\d+(;\d+)*)m)|([^\x1b]+)/g,n=[];let r,l={};for(;(r=t.exec(e))!==null;){const[,,i,,o]=r;if(i){const u=+i;switch(u){case 0:l={};break;case 1:l["font-weight"]="bold";break;case 3:l["font-style"]="italic";break;case 4:l["text-decoration"]="underline";break;case 8:l.display="none";break;case 9:l["text-decoration"]="line-through";break;case 22:l={...l,"font-weight":void 0,"font-style":void 0,"text-decoration":void 0};break;case 23:l={...l,"font-weight":void 0,"font-style":void 0};break;case 24:l={...l,"text-decoration":void 0};break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:l.color=Ss[u-30];break;case 39:l={...l,color:void 0};break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:l["background-color"]=Ss[u-40];break;case 49:l={...l,"background-color":void 0};break;case 53:l["text-decoration"]="overline";break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:l.color=xs[u-90];break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:l["background-color"]=xs[u-100];break}}else o&&n.push(`${Yp(o)}`)}return n.join("")}const Ss={0:"var(--vscode-terminal-ansiBlack)",1:"var(--vscode-terminal-ansiRed)",2:"var(--vscode-terminal-ansiGreen)",3:"var(--vscode-terminal-ansiYellow)",4:"var(--vscode-terminal-ansiBlue)",5:"var(--vscode-terminal-ansiMagenta)",6:"var(--vscode-terminal-ansiCyan)",7:"var(--vscode-terminal-ansiWhite)"},xs={0:"var(--vscode-terminal-ansiBrightBlack)",1:"var(--vscode-terminal-ansiBrightRed)",2:"var(--vscode-terminal-ansiBrightGreen)",3:"var(--vscode-terminal-ansiBrightYellow)",4:"var(--vscode-terminal-ansiBrightBlue)",5:"var(--vscode-terminal-ansiBrightMagenta)",6:"var(--vscode-terminal-ansiBrightCyan)",7:"var(--vscode-terminal-ansiBrightWhite)"};function Yp(e){return e.replace(/[&"<>]/g,t=>({"&":"&",'"':""","<":"<",">":">"})[t])}function qp(e){return Object.entries(e).map(([t,n])=>`${t}: ${n}`).join("; ")}const ks=({text:e,language:t,readOnly:n,highlight:r,revealLine:l,lineNumbers:i,isFocused:o,focusOnChange:u,wrapLines:s,onChange:a})=>{const[m,p]=Ds(),[h]=A.useState(Kp(()=>import("./codeMirrorModule-BwGUc5aQ.js"),__vite__mapDeps([0,1])).then(y=>y.default)),g=A.useRef(null),[S,v]=A.useState();return A.useEffect(()=>{(async()=>{var w,C;const y=await h,f=p.current;if(!f)return;let c="";if(t==="javascript"&&(c="javascript"),t==="python"&&(c="python"),t==="java"&&(c="text/x-java"),t==="csharp"&&(c="text/x-csharp"),t==="html"&&(c="htmlmixed"),t==="css"&&(c="css"),g.current&&c===g.current.cm.getOption("mode")&&!!n===g.current.cm.getOption("readOnly")&&i===g.current.cm.getOption("lineNumbers")&&s===g.current.cm.getOption("lineWrapping"))return;(C=(w=g.current)==null?void 0:w.cm)==null||C.getWrapperElement().remove();const d=y(f,{value:"",mode:c,readOnly:!!n,lineNumbers:i,lineWrapping:s});return g.current={cm:d},o&&d.focus(),v(d),d})()},[h,S,p,t,i,s,n,o]),A.useEffect(()=>{g.current&&g.current.cm.setSize(m.width,m.height)},[m]),A.useLayoutEffect(()=>{var c;if(!S)return;let y=!1;if(S.getValue()!==e&&(S.setValue(e),y=!0,u&&(S.execCommand("selectAll"),S.focus())),y||JSON.stringify(r)!==JSON.stringify(g.current.highlight)){for(const w of g.current.highlight||[])S.removeLineClass(w.line-1,"wrap");for(const w of r||[])S.addLineClass(w.line-1,"wrap",`source-line-${w.type}`);for(const w of g.current.widgets||[])S.removeLineWidget(w);const d=[];for(const w of r||[]){if(w.type!=="error")continue;const C=(c=g.current)==null?void 0:c.cm.getLine(w.line-1);if(C){const T=document.createElement("div");T.className="source-line-error-underline",T.innerHTML=" ".repeat(C.length||1),d.push(S.addLineWidget(w.line,T,{above:!0,coverGutter:!1}))}const N=document.createElement("div");N.innerHTML=Gp(w.message||""),N.className="source-line-error-widget",d.push(S.addLineWidget(w.line,N,{above:!0,coverGutter:!1}))}g.current.highlight=r,g.current.widgets=d}typeof l=="number"&&g.current.cm.lineCount()>=l&&S.scrollIntoView({line:Math.max(0,l-1),ch:0},50);let f;return a&&(f=()=>a(S.getValue()),S.on("change",f)),()=>{f&&S.off("change",f)}},[S,e,r,l,u,a]),P.jsx("div",{className:"cm-wrapper",ref:p})},Jp=50,Xp=({sidebarSize:e,sidebarHidden:t=!1,sidebarIsFirst:n=!1,orientation:r="vertical",minSidebarSize:l=Jp,settingName:i,children:o})=>{const[u,s]=pu(i?i+"."+r+":size":void 0,Math.max(l,e)*window.devicePixelRatio),[a,m]=pu(i?i+"."+r+":size":void 0,Math.max(l,e)*window.devicePixelRatio),[p,h]=A.useState(null),[g,S]=Ds();let v;r==="vertical"?(v=a/window.devicePixelRatio,g&&g.heighth({offset:r==="vertical"?c.clientY:c.clientX,size:v}),onMouseUp:()=>h(null),onMouseMove:c=>{if(!c.buttons)h(null);else if(p){const w=(r==="vertical"?c.clientY:c.clientX)-p.offset,C=n?p.size+w:p.size-w,T=c.target.parentElement.getBoundingClientRect(),$=Math.min(Math.max(l,C),(r==="vertical"?T.height:T.width)-l);r==="vertical"?m($*window.devicePixelRatio):s($*window.devicePixelRatio)}}})]})},Bc=({noShadow:e,children:t,noMinHeight:n})=>P.jsx("div",{className:"toolbar"+(e?" no-shadow":"")+(n?" no-min-height":""),children:t}),Zp=({tabs:e,selectedTab:t,setSelectedTab:n,leftToolbar:r,rightToolbar:l,dataTestId:i,mode:o})=>(o||(o="default"),P.jsx("div",{className:"tabbed-pane","data-testid":i,children:P.jsxs("div",{className:"vbox",children:[P.jsxs(Bc,{children:[r&&P.jsxs("div",{style:{flex:"none",display:"flex",margin:"0 4px",alignItems:"center"},children:[...r]}),o==="default"&&P.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},children:[...e.map(u=>P.jsx(bp,{id:u.id,title:u.title,count:u.count,errorCount:u.errorCount,selected:t===u.id,onSelect:n}))]}),o==="select"&&P.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},children:P.jsx("select",{style:{width:"100%",background:"none",cursor:"pointer"},onChange:u=>{n(e[u.currentTarget.selectedIndex].id)},children:e.map(u=>{let s="";return u.count===1?s=" 🔵":u.count&&(s=` 🔵✖️${u.count}`),u.errorCount===1?s=" 🔴":u.errorCount&&(s=` 🔴✖️${u.errorCount}`),P.jsxs("option",{value:u.id,selected:u.id===t,children:[u.title,s]})})})}),l&&P.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:[...l]})]}),e.map(u=>{const s="tab-content tab-"+u.id;if(u.component)return P.jsx("div",{className:s,style:{display:t===u.id?"inherit":"none"},children:u.component},u.id);if(t===u.id)return P.jsx("div",{className:s,children:u.render()},u.id)})]})})),bp=({id:e,title:t,count:n,errorCount:r,selected:l,onSelect:i})=>P.jsxs("div",{className:"tabbed-pane-tab "+(l?"selected":""),onClick:()=>i(e),title:t,children:[P.jsx("div",{className:"tabbed-pane-tab-label",children:t}),!!n&&P.jsx("div",{className:"tabbed-pane-tab-counter",children:n}),!!r&&P.jsx("div",{className:"tabbed-pane-tab-counter error",children:r})]},e),Oe=({children:e,title:t="",icon:n,disabled:r=!1,toggled:l=!1,onClick:i=()=>{},style:o})=>{let u=`toolbar-button ${n}`;return l&&(u+=" toggled"),P.jsxs("button",{className:u,onMouseDown:Cs,onClick:i,onDoubleClick:Cs,title:t,disabled:!!r,style:o,children:[n&&P.jsx("span",{className:`codicon codicon-${n}`,style:e?{marginRight:5}:{}}),e]})},Es=({style:e})=>P.jsx("div",{className:"toolbar-separator",style:e}),Cs=e=>{e.stopPropagation(),e.preventDefault()};function Hl(e,t="'"){const n=JSON.stringify(e),r=n.substring(1,n.length-1).replace(/\\"/g,'"');if(t==="'")return t+r.replace(/[']/g,"\\'")+t;if(t==='"')return t+r.replace(/["]/g,'\\"')+t;if(t==="`")return t+r.replace(/[`]/g,"`")+t;throw new Error("Invalid escape char")}function Tl(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Hc(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function Vl(e){return e.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}const X=function(e,t,n){return e>=t&&e<=n};function we(e){return X(e,48,57)}function Ts(e){return we(e)||X(e,65,70)||X(e,97,102)}function eh(e){return X(e,65,90)}function th(e){return X(e,97,122)}function nh(e){return eh(e)||th(e)}function rh(e){return e>=128}function Jr(e){return nh(e)||rh(e)||e===95}function Ns(e){return Jr(e)||we(e)||e===45}function lh(e){return X(e,0,8)||e===11||X(e,14,31)||e===127}function Xr(e){return e===10}function Xe(e){return Xr(e)||e===9||e===32}const ih=1114111;class su extends Error{constructor(t){super(t),this.name="InvalidCharacterError"}}function oh(e){const t=[];for(let n=0;n=t.length?-1:t[E]},o=function(E){if(E===void 0&&(E=1),E>3)throw"Spec Error: no more than three codepoints of lookahead.";return i(n+E)},u=function(E){return E===void 0&&(E=1),n+=E,l=i(n),!0},s=function(){return n-=1,!0},a=function(E){return E===void 0&&(E=l),E===-1},m=function(){if(p(),u(),Xe(l)){for(;Xe(o());)u();return new fo}else{if(l===34)return S();if(l===35)if(Ns(o())||f(o(1),o(2))){const E=new lf("");return d(o(1),o(2),o(3))&&(E.type="id"),E.value=T(),E}else return new de(l);else return l===36?o()===61?(u(),new fh):new de(l):l===39?S():l===40?new bc:l===41?new ef:l===42?o()===61?(u(),new dh):new de(l):l===43?N()?(s(),h()):new de(l):l===44?new qc:l===45?N()?(s(),h()):o(1)===45&&o(2)===62?(u(2),new Kc):w()?(s(),g()):new de(l):l===46?N()?(s(),h()):new de(l):l===58?new Gc:l===59?new Yc:l===60?o(1)===33&&o(2)===45&&o(3)===45?(u(3),new Qc):new de(l):l===64?d(o(1),o(2),o(3))?new rf(T()):new de(l):l===91?new Zc:l===92?c()?(s(),g()):new de(l):l===93?new po:l===94?o()===61?(u(),new ch):new de(l):l===123?new Jc:l===124?o()===61?(u(),new ah):o()===124?(u(),new tf):new de(l):l===125?new Xc:l===126?o()===61?(u(),new sh):new de(l):we(l)?(s(),h()):Jr(l)?(s(),g()):a()?new br:new de(l)}},p=function(){for(;o(1)===47&&o(2)===42;)for(u(2);;)if(u(),l===42&&o()===47){u();break}else if(a())return},h=function(){const E=$();if(d(o(1),o(2),o(3))){const O=new ph;return O.value=E.value,O.repr=E.repr,O.type=E.type,O.unit=T(),O}else if(o()===37){u();const O=new af;return O.value=E.value,O.repr=E.repr,O}else{const O=new sf;return O.value=E.value,O.repr=E.repr,O.type=E.type,O}},g=function(){const E=T();if(E.toLowerCase()==="url"&&o()===40){for(u();Xe(o(1))&&Xe(o(2));)u();return o()===34||o()===39?new el(E):Xe(o())&&(o(2)===34||o(2)===39)?new el(E):v()}else return o()===40?(u(),new el(E)):new nf(E)},S=function(E){E===void 0&&(E=l);let O="";for(;u();){if(l===E||a())return new of(O);if(Xr(l))return s(),new Vc;l===92?a(o())||(Xr(o())?u():O+=b(y())):O+=b(l)}throw new Error("Internal error")},v=function(){const E=new uf("");for(;Xe(o());)u();if(a(o()))return E;for(;u();){if(l===41||a())return E;if(Xe(l)){for(;Xe(o());)u();return o()===41||a(o())?(u(),E):(z(),new Zr)}else{if(l===34||l===39||l===40||lh(l))return z(),new Zr;if(l===92)if(c())E.value+=b(y());else return z(),new Zr;else E.value+=b(l)}}throw new Error("Internal error")},y=function(){if(u(),Ts(l)){const E=[l];for(let ae=0;ae<5&&Ts(o());ae++)u(),E.push(l);Xe(o())&&u();let O=parseInt(E.map(function(ae){return String.fromCharCode(ae)}).join(""),16);return O>ih&&(O=65533),O}else return a()?65533:l},f=function(E,O){return!(E!==92||Xr(O))},c=function(){return f(l,o())},d=function(E,O,ae){return E===45?Jr(O)||O===45||f(O,ae):Jr(E)?!0:E===92?f(E,O):!1},w=function(){return d(l,o(1),o(2))},C=function(E,O,ae){return E===43||E===45?!!(we(O)||O===46&&we(ae)):E===46?!!we(O):!!we(E)},N=function(){return C(l,o(1),o(2))},T=function(){let E="";for(;u();)if(Ns(l))E+=b(l);else if(c())E+=b(y());else return s(),E;throw new Error("Internal parse error")},$=function(){let E="",O="integer";for((o()===43||o()===45)&&(u(),E+=b(l));we(o());)u(),E+=b(l);if(o(1)===46&&we(o(2)))for(u(),E+=b(l),u(),E+=b(l),O="number";we(o());)u(),E+=b(l);const ae=o(1),En=o(2),Cn=o(3);if((ae===69||ae===101)&&we(En))for(u(),E+=b(l),u(),E+=b(l),O="number";we(o());)u(),E+=b(l);else if((ae===69||ae===101)&&(En===43||En===45)&&we(Cn))for(u(),E+=b(l),u(),E+=b(l),u(),E+=b(l),O="number";we(o());)u(),E+=b(l);const Tn=x(E);return{type:O,value:Tn,repr:E}},x=function(E){return+E},z=function(){for(;u();){if(l===41||a())return;c()&&y()}};let D=0;for(;!a(o());)if(r.push(m()),D++,D>t.length*2)throw new Error("I'm infinite-looping!");return r}class J{constructor(){this.tokenType=""}toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}}class Vc extends J{constructor(){super(...arguments),this.tokenType="BADSTRING"}}class Zr extends J{constructor(){super(...arguments),this.tokenType="BADURL"}}class fo extends J{constructor(){super(...arguments),this.tokenType="WHITESPACE"}toString(){return"WS"}toSource(){return" "}}class Qc extends J{constructor(){super(...arguments),this.tokenType="CDO"}toSource(){return""}}class Gc extends J{constructor(){super(...arguments),this.tokenType=":"}}class Yc extends J{constructor(){super(...arguments),this.tokenType=";"}}class qc extends J{constructor(){super(...arguments),this.tokenType=","}}class xn extends J{constructor(){super(...arguments),this.value="",this.mirror=""}}class Jc extends xn{constructor(){super(),this.tokenType="{",this.value="{",this.mirror="}"}}class Xc extends xn{constructor(){super(),this.tokenType="}",this.value="}",this.mirror="{"}}class Zc extends xn{constructor(){super(),this.tokenType="[",this.value="[",this.mirror="]"}}class po extends xn{constructor(){super(),this.tokenType="]",this.value="]",this.mirror="["}}class bc extends xn{constructor(){super(),this.tokenType="(",this.value="(",this.mirror=")"}}class ef extends xn{constructor(){super(),this.tokenType=")",this.value=")",this.mirror="("}}class sh extends J{constructor(){super(...arguments),this.tokenType="~="}}class ah extends J{constructor(){super(...arguments),this.tokenType="|="}}class ch extends J{constructor(){super(...arguments),this.tokenType="^="}}class fh extends J{constructor(){super(...arguments),this.tokenType="$="}}class dh extends J{constructor(){super(...arguments),this.tokenType="*="}}class tf extends J{constructor(){super(...arguments),this.tokenType="||"}}class br extends J{constructor(){super(...arguments),this.tokenType="EOF"}toSource(){return""}}class de extends J{constructor(t){super(),this.tokenType="DELIM",this.value="",this.value=b(t)}toString(){return"DELIM("+this.value+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t}toSource(){return this.value==="\\"?`\\ -`:this.value}}class kn extends J{constructor(){super(...arguments),this.value=""}ASCIIMatch(t){return this.value.toLowerCase()===t.toLowerCase()}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t}}class nf extends kn{constructor(t){super(),this.tokenType="IDENT",this.value=t}toString(){return"IDENT("+this.value+")"}toSource(){return vr(this.value)}}class el extends kn{constructor(t){super(),this.tokenType="FUNCTION",this.value=t,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return vr(this.value)+"("}}class rf extends kn{constructor(t){super(),this.tokenType="AT-KEYWORD",this.value=t}toString(){return"AT("+this.value+")"}toSource(){return"@"+vr(this.value)}}class lf extends kn{constructor(t){super(),this.tokenType="HASH",this.value=t,this.type="unrestricted"}toString(){return"HASH("+this.value+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t.type=this.type,t}toSource(){return this.type==="id"?"#"+vr(this.value):"#"+hh(this.value)}}class of extends kn{constructor(t){super(),this.tokenType="STRING",this.value=t}toString(){return'"'+cf(this.value)+'"'}}class uf extends kn{constructor(t){super(),this.tokenType="URL",this.value=t}toString(){return"URL("+this.value+")"}toSource(){return'url("'+cf(this.value)+'")'}}class sf extends J{constructor(){super(),this.tokenType="NUMBER",this.type="integer",this.repr=""}toString(){return this.type==="integer"?"INT("+this.value+")":"NUMBER("+this.value+")"}toJSON(){const t=super.toJSON();return t.value=this.value,t.type=this.type,t.repr=this.repr,t}toSource(){return this.repr}}class af extends J{constructor(){super(),this.tokenType="PERCENTAGE",this.repr=""}toString(){return"PERCENTAGE("+this.value+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t.repr=this.repr,t}toSource(){return this.repr+"%"}}class ph extends J{constructor(){super(),this.tokenType="DIMENSION",this.type="integer",this.repr="",this.unit=""}toString(){return"DIM("+this.value+","+this.unit+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t.type=this.type,t.repr=this.repr,t.unit=this.unit,t}toSource(){const t=this.repr;let n=vr(this.unit);return n[0].toLowerCase()==="e"&&(n[1]==="-"||X(n.charCodeAt(1),48,57))&&(n="\\65 "+n.slice(1,n.length)),t+n}}function vr(e){e=""+e;let t="";const n=e.charCodeAt(0);for(let r=0;r=128||l===45||l===95||X(l,48,57)||X(l,65,90)||X(l,97,122)?t+=e[r]:t+="\\"+e[r]}return t}function hh(e){e=""+e;let t="";for(let n=0;n=128||r===45||r===95||X(r,48,57)||X(r,65,90)||X(r,97,122)?t+=e[n]:t+="\\"+r.toString(16)+" "}return t}function cf(e){e=""+e;let t="";for(let n=0;nx instanceof rf||x instanceof Vc||x instanceof Zr||x instanceof tf||x instanceof Qc||x instanceof Kc||x instanceof Yc||x instanceof Jc||x instanceof Xc||x instanceof uf||x instanceof af);if(r)throw new xe(`Unsupported token "${r.toSource()}" while parsing selector "${e}"`);let l=0;const i=new Set;function o(){return new xe(`Unexpected token "${n[l].toSource()}" while parsing selector "${e}"`)}function u(){for(;n[l]instanceof fo;)l++}function s(x=l){return n[x]instanceof nf}function a(x=l){return n[x]instanceof of}function m(x=l){return n[x]instanceof sf}function p(x=l){return n[x]instanceof qc}function h(x=l){return n[x]instanceof bc}function g(x=l){return n[x]instanceof ef}function S(x=l){return n[x]instanceof el}function v(x=l){return n[x]instanceof de&&n[x].value==="*"}function y(x=l){return n[x]instanceof br}function f(x=l){return n[x]instanceof de&&[">","+","~"].includes(n[x].value)}function c(x=l){return p(x)||g(x)||y(x)||f(x)||n[x]instanceof fo}function d(){const x=[w()];for(;u(),!!p();)l++,x.push(w());return x}function w(){return u(),m()||a()?n[l++].value:C()}function C(){const x={simples:[]};for(u(),f()?x.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""}):x.simples.push({selector:N(),combinator:""});;){if(u(),f())x.simples[x.simples.length-1].combinator=n[l++].value,u();else if(c())break;x.simples.push({combinator:"",selector:N()})}return x}function N(){let x="";const z=[];for(;!c();)if(s()||v())x+=n[l++].toSource();else if(n[l]instanceof lf)x+=n[l++].toSource();else if(n[l]instanceof de&&n[l].value===".")if(l++,s())x+="."+n[l++].toSource();else throw o();else if(n[l]instanceof Gc)if(l++,s())if(!t.has(n[l].value.toLowerCase()))x+=":"+n[l++].toSource();else{const D=n[l++].value.toLowerCase();z.push({name:D,args:[]}),i.add(D)}else if(S()){const D=n[l++].value.toLowerCase();if(t.has(D)?(z.push({name:D,args:d()}),i.add(D)):x+=`:${D}(${T()})`,u(),!g())throw o();l++}else throw o();else if(n[l]instanceof Zc){for(x+="[",l++;!(n[l]instanceof po)&&!y();)x+=n[l++].toSource();if(!(n[l]instanceof po))throw o();x+="]",l++}else throw o();if(!x&&!z.length)throw o();return{css:x||void 0,functions:z}}function T(){let x="",z=1;for(;!y()&&((h()||S())&&z++,g()&&z--,!!z);)x+=n[l++].toSource();return x}const $=d();if(!y())throw o();if($.some(x=>typeof x!="object"||!("simples"in x)))throw new xe(`Error while parsing selector "${e}"`);return{selector:$,names:Array.from(i)}}const _s=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),gh=new Set(["left-of","right-of","above","below","near"]),vh=new Set(["not","is","where","has","scope","light","visible","text","text-matches","text-is","has-text","above","below","right-of","left-of","near","nth-match"]);function ff(e){const t=wh(e),n=[];for(const r of t.parts){if(r.name==="css"||r.name==="css:light"){r.name==="css:light"&&(r.body=":light("+r.body+")");const l=mh(r.body,vh);n.push({name:"css",body:l.selector,source:r.body});continue}if(_s.has(r.name)){let l,i;try{const a=JSON.parse("["+r.body+"]");if(!Array.isArray(a)||a.length<1||a.length>2||typeof a[0]!="string")throw new xe(`Malformed selector: ${r.name}=`+r.body);if(l=a[0],a.length===2){if(typeof a[1]!="number"||!gh.has(r.name))throw new xe(`Malformed selector: ${r.name}=`+r.body);i=a[1]}}catch{throw new xe(`Malformed selector: ${r.name}=`+r.body)}const o={name:r.name,source:r.body,body:{parsed:ff(l),distance:i}},u=[...o.body.parsed.parts].reverse().find(a=>a.name==="internal:control"&&a.body==="enter-frame"),s=u?o.body.parsed.parts.indexOf(u):-1;s!==-1&&yh(o.body.parsed.parts.slice(0,s+1),n.slice(0,s+1))&&o.body.parsed.parts.splice(0,s+1),n.push(o);continue}n.push({...r,source:r.body})}if(_s.has(n[0].name))throw new xe(`"${n[0].name}" selector cannot be first`);return{capture:t.capture,parts:n}}function yh(e,t){return Nl({parts:e})===Nl({parts:t})}function Nl(e,t){return typeof e=="string"?e:e.parts.map((n,r)=>{let l=!0;!t&&r!==e.capture&&(n.name==="css"||n.name==="xpath"&&n.source.startsWith("//")||n.source.startsWith(".."))&&(l=!1);const i=l?n.name+"=":"";return`${r===e.capture?"*":""}${i}${n.source}`}).join(" >> ")}function wh(e){let t=0,n,r=0;const l={parts:[]},i=()=>{const u=e.substring(r,t).trim(),s=u.indexOf("=");let a,m;s!==-1&&u.substring(0,s).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(a=u.substring(0,s).trim(),m=u.substring(s+1)):u.length>1&&u[0]==='"'&&u[u.length-1]==='"'||u.length>1&&u[0]==="'"&&u[u.length-1]==="'"?(a="text",m=u):/^\(*\/\//.test(u)||u.startsWith("..")?(a="xpath",m=u):(a="css",m=u);let p=!1;if(a[0]==="*"&&(p=!0,a=a.substring(1)),l.parts.push({name:a,body:m}),p){if(l.capture!==void 0)throw new xe("Only one of the selectors can capture using * modifier");l.capture=l.parts.length-1}};if(!e.includes(">>"))return t=e.length,i(),l;const o=()=>{const s=e.substring(r,t).match(/^\s*text\s*=(.*)$/);return!!s&&!!s[1]};for(;t"&&e[t+1]===">"?(i(),t+=2,r=t):t++}return i(),l}function yi(e,t){let n=0,r=e.length===0;const l=()=>e[n]||"",i=()=>{const y=l();return++n,r=n>=e.length,y},o=y=>{throw r?new xe(`Unexpected end of selector while parsing selector \`${e}\``):new xe(`Error while parsing selector \`${e}\` - unexpected symbol "${l()}" at position ${n}`+(y?" during "+y:""))};function u(){for(;!r&&/\s/.test(l());)i()}function s(y){return y>="€"||y>="0"&&y<="9"||y>="A"&&y<="Z"||y>="a"&&y<="z"||y>="0"&&y<="9"||y==="_"||y==="-"}function a(){let y="";for(u();!r&&s(l());)y+=i();return y}function m(y){let f=i();for(f!==y&&o("parsing quoted string");!r&&l()!==y;)l()==="\\"&&i(),f+=i();return l()!==y&&o("parsing quoted string"),f+=i(),f}function p(){i()!=="/"&&o("parsing regular expression");let y="",f=!1;for(;!r;){if(l()==="\\")y+=i(),r&&o("parsing regular expression");else if(f&&l()==="]")f=!1;else if(!f&&l()==="[")f=!0;else if(!f&&l()==="/")break;y+=i()}i()!=="/"&&o("parsing regular expression");let c="";for(;!r&&l().match(/[dgimsuy]/);)c+=i();try{return new RegExp(y,c)}catch(d){throw new xe(`Error while parsing selector \`${e}\`: ${d.message}`)}}function h(){let y="";return u(),l()==="'"||l()==='"'?y=m(l()).slice(1,-1):y=a(),y||o("parsing property path"),y}function g(){u();let y="";return r||(y+=i()),!r&&y!=="="&&(y+=i()),["=","*=","^=","$=","|=","~="].includes(y)||o("parsing operator"),y}function S(){i();const y=[];for(y.push(h()),u();l()===".";)i(),y.push(h()),u();if(l()==="]")return i(),{name:y.join("."),jsonPath:y,op:"",value:null,caseSensitive:!1};const f=g();let c,d=!0;if(u(),l()==="/"){if(f!=="=")throw new xe(`Error while parsing selector \`${e}\` - cannot use ${f} in attribute with regular expression`);c=p()}else if(l()==="'"||l()==='"')c=m(l()).slice(1,-1),u(),l()==="i"||l()==="I"?(d=!1,i()):(l()==="s"||l()==="S")&&(d=!0,i());else{for(c="";!r&&(s(l())||l()==="+"||l()===".");)c+=i();c==="true"?c=!0:c==="false"?c=!1:t||(c=+c,Number.isNaN(c)&&o("parsing attribute value"))}if(u(),l()!=="]"&&o("parsing attribute value"),i(),f!=="="&&typeof c!="string")throw new xe(`Error while parsing selector \`${e}\` - cannot use ${f} in attribute with non-string matching value - ${c}`);return{name:y.join("."),jsonPath:y,op:f,value:c,caseSensitive:d}}const v={name:"",attributes:[]};for(v.name=a(),u();l()==="[";)v.attributes.push(S()),u();if(r||o(void 0),!v.name&&!v.attributes.length)throw new xe(`Error while parsing selector \`${e}\` - selector cannot be empty`);return v}function df(e,t,n=!1){return Sh(e,t,n)[0]}function Sh(e,t,n=!1,r=20,l){try{return Qt(new _h[e](l),ff(t),n,r)}catch{return[t]}}function Qt(e,t,n=!1,r=20){const l=[...t.parts];for(let u=0;ue.generateLocator(a,"has",y)));continue}if(s.name==="internal:has-not"){const v=Qt(e,s.body.parsed,!1,r);i.push(v.map(y=>e.generateLocator(a,"hasNot",y)));continue}if(s.name==="internal:and"){const v=Qt(e,s.body.parsed,!1,r);i.push(v.map(y=>e.generateLocator(a,"and",y)));continue}if(s.name==="internal:or"){const v=Qt(e,s.body.parsed,!1,r);i.push(v.map(y=>e.generateLocator(a,"or",y)));continue}if(s.name==="internal:chain"){const v=Qt(e,s.body.parsed,!1,r);i.push(v.map(y=>e.generateLocator(a,"chain",y)));continue}if(s.name==="internal:label"){const{exact:v,text:y}=jn(s.body);i.push([e.generateLocator(a,"label",y,{exact:v})]);continue}if(s.name==="internal:role"){const v=yi(s.body,!0),y={attrs:[]};for(const f of v.attributes)f.name==="name"?(y.exact=f.caseSensitive,y.name=f.value):(f.name==="level"&&typeof f.value=="string"&&(f.value=+f.value),y.attrs.push({name:f.name==="include-hidden"?"includeHidden":f.name,value:f.value}));i.push([e.generateLocator(a,"role",v.name,y)]);continue}if(s.name==="internal:testid"){const v=yi(s.body,!0),{value:y}=v.attributes[0];i.push([e.generateLocator(a,"test-id",y)]);continue}if(s.name==="internal:attr"){const v=yi(s.body,!0),{name:y,value:f,caseSensitive:c}=v.attributes[0],d=f,w=!!c;if(y==="placeholder"){i.push([e.generateLocator(a,"placeholder",d,{exact:w})]);continue}if(y==="alt"){i.push([e.generateLocator(a,"alt",d,{exact:w})]);continue}if(y==="title"){i.push([e.generateLocator(a,"title",d,{exact:w})]);continue}}let m="default";const p=l[u+1];p&&p.name==="internal:control"&&p.body==="enter-frame"&&(m="frame",o="frame-locator",u++);const h=Nl({parts:[s]}),g=e.generateLocator(a,m,h);if(m==="default"&&p&&["internal:has-text","internal:has-not-text"].includes(p.name)){const{exact:v,text:y}=jn(p.body);if(!v){const f=e.generateLocator("locator",p.name==="internal:has-text"?"has-text":"has-not-text",y,{exact:v}),c={};p.name==="internal:has-text"?c.hasText=y:c.hasNotText=y;const d=e.generateLocator(a,"default",h,c);i.push([e.chainLocators([g,f]),d]),u++;continue}}let S;if(["xpath","css"].includes(s.name)){const v=Nl({parts:[s]},!0);S=e.generateLocator(a,m,v)}i.push([g,S].filter(Boolean))}return xh(e,i,r)}function xh(e,t,n){const r=t.map(()=>""),l=[],i=o=>{if(o===t.length)return l.push(e.chainLocators(r)),r.lengthJSON.parse(r));for(let r=0;r{const n=A.useRef(null),[r,l]=A.useState(new Map);return A.useLayoutEffect(()=>{var i;t.find(o=>o.reveal)&&((i=n.current)==null||i.scrollIntoView({block:"center",inline:"nearest"}))},[n,t]),P.jsxs("div",{className:"call-log",style:{flex:"auto"},children:[t.map(i=>{const o=r.get(i.id),u=typeof o=="boolean"?o:i.status!=="done",s=i.params.selector?df(e,i.params.selector):null;let a=i.title,m="";return i.title.startsWith("expect.to")||i.title.startsWith("expect.not.to")?(a="expect(",m=`).${i.title.substring(7)}()`):i.title.startsWith("locator.")?(a="",m=`.${i.title.substring(8)}()`):(s||i.params.url)&&(a=i.title+"(",m=")"),P.jsxs("div",{className:`call-log-call ${i.status}`,children:[P.jsxs("div",{className:"call-log-call-header",children:[P.jsx("span",{className:`codicon codicon-chevron-${u?"down":"right"}`,style:{cursor:"pointer"},onClick:()=>{const p=new Map(r);p.set(i.id,!u),l(p)}}),a,i.params.url?P.jsx("span",{className:"call-log-details",children:P.jsx("span",{className:"call-log-url",title:i.params.url,children:i.params.url})}):void 0,s?P.jsx("span",{className:"call-log-details",children:P.jsx("span",{className:"call-log-selector",title:`page.${s}`,children:`page.${s}`})}):void 0,m,P.jsx("span",{className:"codicon "+Lh(i)}),typeof i.duration=="number"?P.jsxs("span",{className:"call-log-time",children:["— ",Mf(i.duration)]}):void 0]}),(u?i.messages:[]).map((p,h)=>P.jsx("div",{className:"call-log-message",children:p.trim()},h)),!!i.error&&P.jsx("div",{className:"call-log-message error",hidden:!u,children:i.error})]},i.id)}),P.jsx("div",{ref:n})]})};function Lh(e){switch(e.status){case"done":return"codicon-check";case"in-progress":return"codicon-clock";case"paused":return"codicon-debug-pause";case"error":return"codicon-error"}}const $h=({sources:e,paused:t,log:n,mode:r})=>{const[l,i]=A.useState(),[o,u]=A.useState("log");A.useEffect(()=>{!l&&e.length>0&&i(e[0].id)},[l,e]);const s=e.find(g=>g.id===l)||{id:"default",isRecorded:!1,text:"",language:"javascript",label:"",highlight:[]},[a,m]=A.useState("");window.playwrightSetSelector=(g,S)=>{const v=s.language;S&&u("locator"),m(df(v,g))},window.playwrightSetFileIfNeeded=g=>{const S=e.find(v=>v.id===g);(S&&!S.isRecorded||!s.isRecorded)&&i(g)};const p=A.useRef(null);A.useLayoutEffect(()=>{var g;(g=p.current)==null||g.scrollIntoView({block:"center",inline:"nearest"})},[p]),A.useEffect(()=>{const g=S=>{switch(S.key){case"F8":S.preventDefault(),t?window.dispatch({event:"resume"}):window.dispatch({event:"pause"});break;case"F10":S.preventDefault(),t&&window.dispatch({event:"step"});break}};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t]);const h=A.useCallback(g=>{r==="none"&&window.dispatch({event:"setMode",params:{mode:"standby"}}),m(g),window.dispatch({event:"selectorUpdated",params:{selector:g}})},[r]);return P.jsxs("div",{className:"recorder",children:[P.jsxs(Bc,{children:[P.jsx(Oe,{icon:"circle-large-filled",title:"Record",toggled:r==="recording"||r==="recording-inspecting"||r==="assertingText"||r==="assertingVisibility",onClick:()=>{window.dispatch({event:"setMode",params:{mode:r==="none"||r==="standby"||r==="inspecting"?"recording":"standby"}})},children:"Record"}),P.jsx(Es,{}),P.jsx(Oe,{icon:"inspect",title:"Pick locator",toggled:r==="inspecting"||r==="recording-inspecting",onClick:()=>{const g={inspecting:"standby",none:"inspecting",standby:"inspecting",recording:"recording-inspecting","recording-inspecting":"recording",assertingText:"recording-inspecting",assertingVisibility:"recording-inspecting",assertingValue:"recording-inspecting"}[r];window.dispatch({event:"setMode",params:{mode:g}}).catch(()=>{})}}),P.jsx(Oe,{icon:"eye",title:"Assert visibility",toggled:r==="assertingVisibility",disabled:r==="none"||r==="standby"||r==="inspecting",onClick:()=>{window.dispatch({event:"setMode",params:{mode:r==="assertingVisibility"?"recording":"assertingVisibility"}})}}),P.jsx(Oe,{icon:"whole-word",title:"Assert text",toggled:r==="assertingText",disabled:r==="none"||r==="standby"||r==="inspecting",onClick:()=>{window.dispatch({event:"setMode",params:{mode:r==="assertingText"?"recording":"assertingText"}})}}),P.jsx(Oe,{icon:"symbol-constant",title:"Assert value",toggled:r==="assertingValue",disabled:r==="none"||r==="standby"||r==="inspecting",onClick:()=>{window.dispatch({event:"setMode",params:{mode:r==="assertingValue"?"recording":"assertingValue"}})}}),P.jsx(Es,{}),P.jsx(Oe,{icon:"files",title:"Copy",disabled:!s||!s.text,onClick:()=>{du(s.text)}}),P.jsx(Oe,{icon:"debug-continue",title:"Resume (F8)",disabled:!t,onClick:()=>{window.dispatch({event:"resume"})}}),P.jsx(Oe,{icon:"debug-pause",title:"Pause (F8)",disabled:t,onClick:()=>{window.dispatch({event:"pause"})}}),P.jsx(Oe,{icon:"debug-step-over",title:"Step over (F10)",disabled:!t,onClick:()=>{window.dispatch({event:"step"})}}),P.jsx("div",{style:{flex:"auto"}}),P.jsx("div",{children:"Target:"}),P.jsx("select",{className:"recorder-chooser",hidden:!e.length,value:l,onChange:g=>{i(g.target.selectedOptions[0].value),window.dispatch({event:"fileChanged",params:{file:g.target.selectedOptions[0].value}})},children:zh(e)}),P.jsx(Oe,{icon:"clear-all",title:"Clear",disabled:!s||!s.text,onClick:()=>{window.dispatch({event:"clear"})}}),P.jsx(Oe,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>Af()})]}),P.jsxs(Xp,{sidebarSize:200,children:[P.jsx(ks,{text:s.text,language:s.language,highlight:s.highlight,revealLine:s.revealLine,readOnly:!0,lineNumbers:!0}),P.jsx(Zp,{rightToolbar:o==="locator"?[P.jsx(Oe,{icon:"files",title:"Copy",onClick:()=>du(a)})]:[],tabs:[{id:"locator",title:"Locator",render:()=>P.jsx(ks,{text:a,language:s.language,readOnly:!1,focusOnChange:!0,onChange:h,wrapLines:!0})},{id:"log",title:"Log",render:()=>P.jsx(Ph,{language:s.language,log:Array.from(n.values())})}],selectedTab:o,setSelectedTab:u})]})]})};function zh(e){const t=l=>l.replace(/.*[/\\]([^/\\]+)/,"$1"),n=l=>P.jsx("option",{value:l.id,children:t(l.label)},l.id);return e.some(l=>l.group)?[...new Set(e.map(i=>i.group))].filter(Boolean).map(i=>P.jsx("optgroup",{label:i,children:e.filter(o=>o.group===i).map(o=>n(o))},i)):e.map(l=>n(l))}const Oh=({})=>{const[e,t]=A.useState([]),[n,r]=A.useState(!1),[l,i]=A.useState(new Map),[o,u]=A.useState("none");return window.playwrightSetMode=u,window.playwrightSetSources=t,window.playwrightSetPaused=r,window.playwrightUpdateLogs=s=>{const a=new Map(l);for(const m of s)m.reveal=!l.has(m.id),a.set(m.id,m);i(a)},window.playwrightSourcesEchoForTest=e,P.jsx($h,{sources:e,paused:n,log:l,mode:o})};(async()=>(Ff(),Hp.render(P.jsx(Oh,{}),document.querySelector("#root"))))();export{Rh as c,pf as g}; diff --git a/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-iA1aAGZg.css b/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-iA1aAGZg.css new file mode 100644 index 00000000..0a520d6c --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-iA1aAGZg.css @@ -0,0 +1 @@ +:root{color-scheme:light dark}body{--transparent-blue: #2196F355;--light-pink: #ff69b460;--gray: #888888;--sidebar-width: 250px;--box-shadow: rgba(0, 0, 0, .133) 0px 1.6px 3.6px 0px, rgba(0, 0, 0, .11) 0px .3px .9px 0px}html,body{width:100%;height:100%;padding:0;margin:0;overflow:hidden;display:flex;overscroll-behavior-x:none}#root{width:100%;height:100%;display:flex}body,dialog{background-color:var(--vscode-panel-background);color:var(--vscode-foreground);font-family:var(--vscode-font-family);font-weight:var(--vscode-font-weight);font-size:var(--vscode-font-size);-webkit-font-smoothing:antialiased}a{color:var(--vscode-textLink-foreground)}dialog{border:none;padding:0;box-shadow:var(--box-shadow);line-height:28px;max-width:400px}dialog .title{display:flex;align-items:center;margin:0;padding:0 5px;height:32px;background-color:var(--vscode-sideBar-background);max-width:400px}dialog .title .codicon{margin-right:3px}dialog .body{padding:10px;text-align:center}.button{color:var(--vscode-button-foreground);background:var(--vscode-button-background);margin:10px;border:none;height:28px;min-width:40px;cursor:pointer;-webkit-user-select:none;user-select:none}.button:focus{outline:1px solid var(--vscode-focusBorder)}.button:hover{background:var(--vscode-button-hoverBackground)}.button.secondary{color:var(--vscode-button-secondaryForeground);background:var(--vscode-button-secondaryBackground)}.button.secondary:hover{background:var(--vscode-button-secondaryHoverBackground)}*{box-sizing:border-box;min-width:0;min-height:0}*[hidden],.hidden{display:none!important}.invisible{visibility:hidden!important}svg{fill:currentColor}.vbox{display:flex;flex-direction:column;flex:auto;position:relative}.fill{position:absolute;top:0;right:0;bottom:0;left:0}.hbox{display:flex;flex:auto;position:relative}.spacer{flex:auto}.codicon-check{color:var(--vscode-charts-green)}.codicon-error{color:var(--vscode-errorForeground)}.codicon-warning{color:var(--vscode-list-warningForeground)}.codicon-circle-outline{color:var(--vscode-disabledForeground)}input[type=text],input[type=search]{color:var(--vscode-input-foreground);background-color:var(--vscode-input-background);border:none;outline:none}body.dark-mode ::-webkit-scrollbar{width:10px}body.dark-mode ::-webkit-scrollbar-thumb{background-color:#555}body.dark-mode ::-webkit-scrollbar-track{background-color:#333}body.dark-mode ::-webkit-scrollbar-thumb:hover{background-color:#777}body.dark-mode ::-webkit-scrollbar-track:hover{background-color:#444}.codicon-loading{animation:spin 1s infinite linear}::placeholder{color:var(--vscode-input-placeholderForeground)}@keyframes spin{to{transform:rotate(360deg)}}@font-face{font-family:codicon;src:url(/assets/codicon-DCmgc-ay.ttf) format("truetype")}.codicon{font: 16px/1 codicon;flex:none;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.codicon-add:before{content:""}.codicon-plus:before{content:""}.codicon-gist-new:before{content:""}.codicon-repo-create:before{content:""}.codicon-lightbulb:before{content:""}.codicon-light-bulb:before{content:""}.codicon-repo:before{content:""}.codicon-repo-delete:before{content:""}.codicon-gist-fork:before{content:""}.codicon-repo-forked:before{content:""}.codicon-git-pull-request:before{content:""}.codicon-git-pull-request-abandoned:before{content:""}.codicon-record-keys:before{content:""}.codicon-keyboard:before{content:""}.codicon-tag:before{content:""}.codicon-git-pull-request-label:before{content:""}.codicon-tag-add:before{content:""}.codicon-tag-remove:before{content:""}.codicon-person:before{content:""}.codicon-person-follow:before{content:""}.codicon-person-outline:before{content:""}.codicon-person-filled:before{content:""}.codicon-git-branch:before{content:""}.codicon-git-branch-create:before{content:""}.codicon-git-branch-delete:before{content:""}.codicon-source-control:before{content:""}.codicon-mirror:before{content:""}.codicon-mirror-public:before{content:""}.codicon-star:before{content:""}.codicon-star-add:before{content:""}.codicon-star-delete:before{content:""}.codicon-star-empty:before{content:""}.codicon-comment:before{content:""}.codicon-comment-add:before{content:""}.codicon-alert:before{content:""}.codicon-warning:before{content:""}.codicon-search:before{content:""}.codicon-search-save:before{content:""}.codicon-log-out:before{content:""}.codicon-sign-out:before{content:""}.codicon-log-in:before{content:""}.codicon-sign-in:before{content:""}.codicon-eye:before{content:""}.codicon-eye-unwatch:before{content:""}.codicon-eye-watch:before{content:""}.codicon-circle-filled:before{content:""}.codicon-primitive-dot:before{content:""}.codicon-close-dirty:before{content:""}.codicon-debug-breakpoint:before{content:""}.codicon-debug-breakpoint-disabled:before{content:""}.codicon-debug-hint:before{content:""}.codicon-terminal-decoration-success:before{content:""}.codicon-primitive-square:before{content:""}.codicon-edit:before{content:""}.codicon-pencil:before{content:""}.codicon-info:before{content:""}.codicon-issue-opened:before{content:""}.codicon-gist-private:before{content:""}.codicon-git-fork-private:before{content:""}.codicon-lock:before{content:""}.codicon-mirror-private:before{content:""}.codicon-close:before{content:""}.codicon-remove-close:before{content:""}.codicon-x:before{content:""}.codicon-repo-sync:before{content:""}.codicon-sync:before{content:""}.codicon-clone:before{content:""}.codicon-desktop-download:before{content:""}.codicon-beaker:before{content:""}.codicon-microscope:before{content:""}.codicon-vm:before{content:""}.codicon-device-desktop:before{content:""}.codicon-file:before{content:""}.codicon-file-text:before{content:""}.codicon-more:before{content:""}.codicon-ellipsis:before{content:""}.codicon-kebab-horizontal:before{content:""}.codicon-mail-reply:before{content:""}.codicon-reply:before{content:""}.codicon-organization:before{content:""}.codicon-organization-filled:before{content:""}.codicon-organization-outline:before{content:""}.codicon-new-file:before{content:""}.codicon-file-add:before{content:""}.codicon-new-folder:before{content:""}.codicon-file-directory-create:before{content:""}.codicon-trash:before{content:""}.codicon-trashcan:before{content:""}.codicon-history:before{content:""}.codicon-clock:before{content:""}.codicon-folder:before{content:""}.codicon-file-directory:before{content:""}.codicon-symbol-folder:before{content:""}.codicon-logo-github:before{content:""}.codicon-mark-github:before{content:""}.codicon-github:before{content:""}.codicon-terminal:before{content:""}.codicon-console:before{content:""}.codicon-repl:before{content:""}.codicon-zap:before{content:""}.codicon-symbol-event:before{content:""}.codicon-error:before{content:""}.codicon-stop:before{content:""}.codicon-variable:before{content:""}.codicon-symbol-variable:before{content:""}.codicon-array:before{content:""}.codicon-symbol-array:before{content:""}.codicon-symbol-module:before{content:""}.codicon-symbol-package:before{content:""}.codicon-symbol-namespace:before{content:""}.codicon-symbol-object:before{content:""}.codicon-symbol-method:before{content:""}.codicon-symbol-function:before{content:""}.codicon-symbol-constructor:before{content:""}.codicon-symbol-boolean:before{content:""}.codicon-symbol-null:before{content:""}.codicon-symbol-numeric:before{content:""}.codicon-symbol-number:before{content:""}.codicon-symbol-structure:before{content:""}.codicon-symbol-struct:before{content:""}.codicon-symbol-parameter:before{content:""}.codicon-symbol-type-parameter:before{content:""}.codicon-symbol-key:before{content:""}.codicon-symbol-text:before{content:""}.codicon-symbol-reference:before{content:""}.codicon-go-to-file:before{content:""}.codicon-symbol-enum:before{content:""}.codicon-symbol-value:before{content:""}.codicon-symbol-ruler:before{content:""}.codicon-symbol-unit:before{content:""}.codicon-activate-breakpoints:before{content:""}.codicon-archive:before{content:""}.codicon-arrow-both:before{content:""}.codicon-arrow-down:before{content:""}.codicon-arrow-left:before{content:""}.codicon-arrow-right:before{content:""}.codicon-arrow-small-down:before{content:""}.codicon-arrow-small-left:before{content:""}.codicon-arrow-small-right:before{content:""}.codicon-arrow-small-up:before{content:""}.codicon-arrow-up:before{content:""}.codicon-bell:before{content:""}.codicon-bold:before{content:""}.codicon-book:before{content:""}.codicon-bookmark:before{content:""}.codicon-debug-breakpoint-conditional-unverified:before{content:""}.codicon-debug-breakpoint-conditional:before{content:""}.codicon-debug-breakpoint-conditional-disabled:before{content:""}.codicon-debug-breakpoint-data-unverified:before{content:""}.codicon-debug-breakpoint-data:before{content:""}.codicon-debug-breakpoint-data-disabled:before{content:""}.codicon-debug-breakpoint-log-unverified:before{content:""}.codicon-debug-breakpoint-log:before{content:""}.codicon-debug-breakpoint-log-disabled:before{content:""}.codicon-briefcase:before{content:""}.codicon-broadcast:before{content:""}.codicon-browser:before{content:""}.codicon-bug:before{content:""}.codicon-calendar:before{content:""}.codicon-case-sensitive:before{content:""}.codicon-check:before{content:""}.codicon-checklist:before{content:""}.codicon-chevron-down:before{content:""}.codicon-chevron-left:before{content:""}.codicon-chevron-right:before{content:""}.codicon-chevron-up:before{content:""}.codicon-chrome-close:before{content:""}.codicon-chrome-maximize:before{content:""}.codicon-chrome-minimize:before{content:""}.codicon-chrome-restore:before{content:""}.codicon-circle-outline:before{content:""}.codicon-circle:before{content:""}.codicon-debug-breakpoint-unverified:before{content:""}.codicon-terminal-decoration-incomplete:before{content:""}.codicon-circle-slash:before{content:""}.codicon-circuit-board:before{content:""}.codicon-clear-all:before{content:""}.codicon-clippy:before{content:""}.codicon-close-all:before{content:""}.codicon-cloud-download:before{content:""}.codicon-cloud-upload:before{content:""}.codicon-code:before{content:""}.codicon-collapse-all:before{content:""}.codicon-color-mode:before{content:""}.codicon-comment-discussion:before{content:""}.codicon-credit-card:before{content:""}.codicon-dash:before{content:""}.codicon-dashboard:before{content:""}.codicon-database:before{content:""}.codicon-debug-continue:before{content:""}.codicon-debug-disconnect:before{content:""}.codicon-debug-pause:before{content:""}.codicon-debug-restart:before{content:""}.codicon-debug-start:before{content:""}.codicon-debug-step-into:before{content:""}.codicon-debug-step-out:before{content:""}.codicon-debug-step-over:before{content:""}.codicon-debug-stop:before{content:""}.codicon-debug:before{content:""}.codicon-device-camera-video:before{content:""}.codicon-device-camera:before{content:""}.codicon-device-mobile:before{content:""}.codicon-diff-added:before{content:""}.codicon-diff-ignored:before{content:""}.codicon-diff-modified:before{content:""}.codicon-diff-removed:before{content:""}.codicon-diff-renamed:before{content:""}.codicon-diff:before{content:""}.codicon-diff-sidebyside:before{content:""}.codicon-discard:before{content:""}.codicon-editor-layout:before{content:""}.codicon-empty-window:before{content:""}.codicon-exclude:before{content:""}.codicon-extensions:before{content:""}.codicon-eye-closed:before{content:""}.codicon-file-binary:before{content:""}.codicon-file-code:before{content:""}.codicon-file-media:before{content:""}.codicon-file-pdf:before{content:""}.codicon-file-submodule:before{content:""}.codicon-file-symlink-directory:before{content:""}.codicon-file-symlink-file:before{content:""}.codicon-file-zip:before{content:""}.codicon-files:before{content:""}.codicon-filter:before{content:""}.codicon-flame:before{content:""}.codicon-fold-down:before{content:""}.codicon-fold-up:before{content:""}.codicon-fold:before{content:""}.codicon-folder-active:before{content:""}.codicon-folder-opened:before{content:""}.codicon-gear:before{content:""}.codicon-gift:before{content:""}.codicon-gist-secret:before{content:""}.codicon-gist:before{content:""}.codicon-git-commit:before{content:""}.codicon-git-compare:before{content:""}.codicon-compare-changes:before{content:""}.codicon-git-merge:before{content:""}.codicon-github-action:before{content:""}.codicon-github-alt:before{content:""}.codicon-globe:before{content:""}.codicon-grabber:before{content:""}.codicon-graph:before{content:""}.codicon-gripper:before{content:""}.codicon-heart:before{content:""}.codicon-home:before{content:""}.codicon-horizontal-rule:before{content:""}.codicon-hubot:before{content:""}.codicon-inbox:before{content:""}.codicon-issue-reopened:before{content:""}.codicon-issues:before{content:""}.codicon-italic:before{content:""}.codicon-jersey:before{content:""}.codicon-json:before{content:""}.codicon-kebab-vertical:before{content:""}.codicon-key:before{content:""}.codicon-law:before{content:""}.codicon-lightbulb-autofix:before{content:""}.codicon-link-external:before{content:""}.codicon-link:before{content:""}.codicon-list-ordered:before{content:""}.codicon-list-unordered:before{content:""}.codicon-live-share:before{content:""}.codicon-loading:before{content:""}.codicon-location:before{content:""}.codicon-mail-read:before{content:""}.codicon-mail:before{content:""}.codicon-markdown:before{content:""}.codicon-megaphone:before{content:""}.codicon-mention:before{content:""}.codicon-milestone:before{content:""}.codicon-git-pull-request-milestone:before{content:""}.codicon-mortar-board:before{content:""}.codicon-move:before{content:""}.codicon-multiple-windows:before{content:""}.codicon-mute:before{content:""}.codicon-no-newline:before{content:""}.codicon-note:before{content:""}.codicon-octoface:before{content:""}.codicon-open-preview:before{content:""}.codicon-package:before{content:""}.codicon-paintcan:before{content:""}.codicon-pin:before{content:""}.codicon-play:before{content:""}.codicon-run:before{content:""}.codicon-plug:before{content:""}.codicon-preserve-case:before{content:""}.codicon-preview:before{content:""}.codicon-project:before{content:""}.codicon-pulse:before{content:""}.codicon-question:before{content:""}.codicon-quote:before{content:""}.codicon-radio-tower:before{content:""}.codicon-reactions:before{content:""}.codicon-references:before{content:""}.codicon-refresh:before{content:""}.codicon-regex:before{content:""}.codicon-remote-explorer:before{content:""}.codicon-remote:before{content:""}.codicon-remove:before{content:""}.codicon-replace-all:before{content:""}.codicon-replace:before{content:""}.codicon-repo-clone:before{content:""}.codicon-repo-force-push:before{content:""}.codicon-repo-pull:before{content:""}.codicon-repo-push:before{content:""}.codicon-report:before{content:""}.codicon-request-changes:before{content:""}.codicon-rocket:before{content:""}.codicon-root-folder-opened:before{content:""}.codicon-root-folder:before{content:""}.codicon-rss:before{content:""}.codicon-ruby:before{content:""}.codicon-save-all:before{content:""}.codicon-save-as:before{content:""}.codicon-save:before{content:""}.codicon-screen-full:before{content:""}.codicon-screen-normal:before{content:""}.codicon-search-stop:before{content:""}.codicon-server:before{content:""}.codicon-settings-gear:before{content:""}.codicon-settings:before{content:""}.codicon-shield:before{content:""}.codicon-smiley:before{content:""}.codicon-sort-precedence:before{content:""}.codicon-split-horizontal:before{content:""}.codicon-split-vertical:before{content:""}.codicon-squirrel:before{content:""}.codicon-star-full:before{content:""}.codicon-star-half:before{content:""}.codicon-symbol-class:before{content:""}.codicon-symbol-color:before{content:""}.codicon-symbol-constant:before{content:""}.codicon-symbol-enum-member:before{content:""}.codicon-symbol-field:before{content:""}.codicon-symbol-file:before{content:""}.codicon-symbol-interface:before{content:""}.codicon-symbol-keyword:before{content:""}.codicon-symbol-misc:before{content:""}.codicon-symbol-operator:before{content:""}.codicon-symbol-property:before{content:""}.codicon-wrench:before{content:""}.codicon-wrench-subaction:before{content:""}.codicon-symbol-snippet:before{content:""}.codicon-tasklist:before{content:""}.codicon-telescope:before{content:""}.codicon-text-size:before{content:""}.codicon-three-bars:before{content:""}.codicon-thumbsdown:before{content:""}.codicon-thumbsup:before{content:""}.codicon-tools:before{content:""}.codicon-triangle-down:before{content:""}.codicon-triangle-left:before{content:""}.codicon-triangle-right:before{content:""}.codicon-triangle-up:before{content:""}.codicon-twitter:before{content:""}.codicon-unfold:before{content:""}.codicon-unlock:before{content:""}.codicon-unmute:before{content:""}.codicon-unverified:before{content:""}.codicon-verified:before{content:""}.codicon-versions:before{content:""}.codicon-vm-active:before{content:""}.codicon-vm-outline:before{content:""}.codicon-vm-running:before{content:""}.codicon-watch:before{content:""}.codicon-whitespace:before{content:""}.codicon-whole-word:before{content:""}.codicon-window:before{content:""}.codicon-word-wrap:before{content:""}.codicon-zoom-in:before{content:""}.codicon-zoom-out:before{content:""}.codicon-list-filter:before{content:""}.codicon-list-flat:before{content:""}.codicon-list-selection:before{content:""}.codicon-selection:before{content:""}.codicon-list-tree:before{content:""}.codicon-debug-breakpoint-function-unverified:before{content:""}.codicon-debug-breakpoint-function:before{content:""}.codicon-debug-breakpoint-function-disabled:before{content:""}.codicon-debug-stackframe-active:before{content:""}.codicon-circle-small-filled:before{content:""}.codicon-debug-stackframe-dot:before{content:""}.codicon-terminal-decoration-mark:before{content:""}.codicon-debug-stackframe:before{content:""}.codicon-debug-stackframe-focused:before{content:""}.codicon-debug-breakpoint-unsupported:before{content:""}.codicon-symbol-string:before{content:""}.codicon-debug-reverse-continue:before{content:""}.codicon-debug-step-back:before{content:""}.codicon-debug-restart-frame:before{content:""}.codicon-debug-alt:before{content:""}.codicon-call-incoming:before{content:""}.codicon-call-outgoing:before{content:""}.codicon-menu:before{content:""}.codicon-expand-all:before{content:""}.codicon-feedback:before{content:""}.codicon-git-pull-request-reviewer:before{content:""}.codicon-group-by-ref-type:before{content:""}.codicon-ungroup-by-ref-type:before{content:""}.codicon-account:before{content:""}.codicon-git-pull-request-assignee:before{content:""}.codicon-bell-dot:before{content:""}.codicon-debug-console:before{content:""}.codicon-library:before{content:""}.codicon-output:before{content:""}.codicon-run-all:before{content:""}.codicon-sync-ignored:before{content:""}.codicon-pinned:before{content:""}.codicon-github-inverted:before{content:""}.codicon-server-process:before{content:""}.codicon-server-environment:before{content:""}.codicon-pass:before{content:""}.codicon-issue-closed:before{content:""}.codicon-stop-circle:before{content:""}.codicon-play-circle:before{content:""}.codicon-record:before{content:""}.codicon-debug-alt-small:before{content:""}.codicon-vm-connect:before{content:""}.codicon-cloud:before{content:""}.codicon-merge:before{content:""}.codicon-export:before{content:""}.codicon-graph-left:before{content:""}.codicon-magnet:before{content:""}.codicon-notebook:before{content:""}.codicon-redo:before{content:""}.codicon-check-all:before{content:""}.codicon-pinned-dirty:before{content:""}.codicon-pass-filled:before{content:""}.codicon-circle-large-filled:before{content:""}.codicon-circle-large:before{content:""}.codicon-circle-large-outline:before{content:""}.codicon-combine:before{content:""}.codicon-gather:before{content:""}.codicon-table:before{content:""}.codicon-variable-group:before{content:""}.codicon-type-hierarchy:before{content:""}.codicon-type-hierarchy-sub:before{content:""}.codicon-type-hierarchy-super:before{content:""}.codicon-git-pull-request-create:before{content:""}.codicon-run-above:before{content:""}.codicon-run-below:before{content:""}.codicon-notebook-template:before{content:""}.codicon-debug-rerun:before{content:""}.codicon-workspace-trusted:before{content:""}.codicon-workspace-untrusted:before{content:""}.codicon-workspace-unknown:before{content:""}.codicon-terminal-cmd:before{content:""}.codicon-terminal-debian:before{content:""}.codicon-terminal-linux:before{content:""}.codicon-terminal-powershell:before{content:""}.codicon-terminal-tmux:before{content:""}.codicon-terminal-ubuntu:before{content:""}.codicon-terminal-bash:before{content:""}.codicon-arrow-swap:before{content:""}.codicon-copy:before{content:""}.codicon-person-add:before{content:""}.codicon-filter-filled:before{content:""}.codicon-wand:before{content:""}.codicon-debug-line-by-line:before{content:""}.codicon-inspect:before{content:""}.codicon-layers:before{content:""}.codicon-layers-dot:before{content:""}.codicon-layers-active:before{content:""}.codicon-compass:before{content:""}.codicon-compass-dot:before{content:""}.codicon-compass-active:before{content:""}.codicon-azure:before{content:""}.codicon-issue-draft:before{content:""}.codicon-git-pull-request-closed:before{content:""}.codicon-git-pull-request-draft:before{content:""}.codicon-debug-all:before{content:""}.codicon-debug-coverage:before{content:""}.codicon-run-errors:before{content:""}.codicon-folder-library:before{content:""}.codicon-debug-continue-small:before{content:""}.codicon-beaker-stop:before{content:""}.codicon-graph-line:before{content:""}.codicon-graph-scatter:before{content:""}.codicon-pie-chart:before{content:""}.codicon-bracket:before{content:""}.codicon-bracket-dot:before{content:""}.codicon-bracket-error:before{content:""}.codicon-lock-small:before{content:""}.codicon-azure-devops:before{content:""}.codicon-verified-filled:before{content:""}.codicon-newline:before{content:""}.codicon-layout:before{content:""}.codicon-layout-activitybar-left:before{content:""}.codicon-layout-activitybar-right:before{content:""}.codicon-layout-panel-left:before{content:""}.codicon-layout-panel-center:before{content:""}.codicon-layout-panel-justify:before{content:""}.codicon-layout-panel-right:before{content:""}.codicon-layout-panel:before{content:""}.codicon-layout-sidebar-left:before{content:""}.codicon-layout-sidebar-right:before{content:""}.codicon-layout-statusbar:before{content:""}.codicon-layout-menubar:before{content:""}.codicon-layout-centered:before{content:""}.codicon-target:before{content:""}.codicon-indent:before{content:""}.codicon-record-small:before{content:""}.codicon-error-small:before{content:""}.codicon-terminal-decoration-error:before{content:""}.codicon-arrow-circle-down:before{content:""}.codicon-arrow-circle-left:before{content:""}.codicon-arrow-circle-right:before{content:""}.codicon-arrow-circle-up:before{content:""}.codicon-layout-sidebar-right-off:before{content:""}.codicon-layout-panel-off:before{content:""}.codicon-layout-sidebar-left-off:before{content:""}.codicon-blank:before{content:""}.codicon-heart-filled:before{content:""}.codicon-map:before{content:""}.codicon-map-horizontal:before{content:""}.codicon-fold-horizontal:before{content:""}.codicon-map-filled:before{content:""}.codicon-map-horizontal-filled:before{content:""}.codicon-fold-horizontal-filled:before{content:""}.codicon-circle-small:before{content:""}.codicon-bell-slash:before{content:""}.codicon-bell-slash-dot:before{content:""}.codicon-comment-unresolved:before{content:""}.codicon-git-pull-request-go-to-changes:before{content:""}.codicon-git-pull-request-new-changes:before{content:""}.codicon-search-fuzzy:before{content:""}.codicon-comment-draft:before{content:""}.codicon-send:before{content:""}.codicon-sparkle:before{content:""}.codicon-insert:before{content:""}.codicon-mic:before{content:""}.codicon-thumbsdown-filled:before{content:""}.codicon-thumbsup-filled:before{content:""}.codicon-coffee:before{content:""}.codicon-snake:before{content:""}.codicon-game:before{content:""}.codicon-vr:before{content:""}.codicon-chip:before{content:""}.codicon-piano:before{content:""}.codicon-music:before{content:""}.codicon-mic-filled:before{content:""}.codicon-repo-fetch:before{content:""}.codicon-copilot:before{content:""}.codicon-lightbulb-sparkle:before{content:""}.codicon-robot:before{content:""}.codicon-sparkle-filled:before{content:""}.codicon-diff-single:before{content:""}.codicon-diff-multiple:before{content:""}.codicon-surround-with:before{content:""}.codicon-share:before{content:""}.codicon-git-stash:before{content:""}.codicon-git-stash-apply:before{content:""}.codicon-git-stash-pop:before{content:""}.codicon-vscode:before{content:""}.codicon-vscode-insiders:before{content:""}.codicon-code-oss:before{content:""}.codicon-run-coverage:before{content:""}.codicon-run-all-coverage:before{content:""}.codicon-coverage:before{content:""}.codicon-github-project:before{content:""}.codicon-map-vertical:before{content:""}.codicon-fold-vertical:before{content:""}.codicon-map-vertical-filled:before{content:""}.codicon-fold-vertical-filled:before{content:""}.codicon-go-to-search:before{content:""}.codicon-percentage:before{content:""}.codicon-sort-percentage:before{content:""}.codicon-attach:before{content:""}.codicon-git-fetch:before{content:""}body{--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #616161;--vscode-disabledForeground: rgba(97, 97, 97, .5);--vscode-errorForeground: #a1260d;--vscode-descriptionForeground: #717171;--vscode-icon-foreground: #424242;--vscode-focusBorder: #0090f1;--vscode-textSeparator-foreground: rgba(0, 0, 0, .18);--vscode-textLink-foreground: #006ab1;--vscode-textLink-activeForeground: #006ab1;--vscode-textPreformat-foreground: #a31515;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(220, 220, 220, .4);--vscode-widget-shadow: rgba(0, 0, 0, .16);--vscode-input-background: #ffffff;--vscode-input-foreground: #616161;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(184, 184, 184, .31);--vscode-inputOption-activeBackground: rgba(0, 144, 241, .2);--vscode-inputOption-activeForeground: #000000;--vscode-input-placeholderForeground: #767676;--vscode-inputValidation-infoBackground: #d6ecf2;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #f6f5d2;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #f2dede;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #ffffff;--vscode-dropdown-border: #cecece;--vscode-checkbox-background: #ffffff;--vscode-checkbox-border: #cecece;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #007acc;--vscode-button-hoverBackground: #0062a3;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #5f6a79;--vscode-button-secondaryHoverBackground: #4c5561;--vscode-badge-background: #c4c4c4;--vscode-badge-foreground: #333333;--vscode-scrollbar-shadow: #dddddd;--vscode-scrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #e51400;--vscode-editorWarning-foreground: #bf8803;--vscode-editorInfo-foreground: #1a85ff;--vscode-editorHint-foreground: #6c6c6c;--vscode-sash-hoverBorder: #0090f1;--vscode-editor-background: #ffffff;--vscode-editor-foreground: #000000;--vscode-editorStickyScroll-background: #ffffff;--vscode-editorStickyScrollHover-background: #f0f0f0;--vscode-editorWidget-background: #f3f3f3;--vscode-editorWidget-foreground: #616161;--vscode-editorWidget-border: #c8c8c8;--vscode-quickInput-background: #f3f3f3;--vscode-quickInput-foreground: #616161;--vscode-quickInputTitle-background: rgba(0, 0, 0, .06);--vscode-pickerGroup-foreground: #0066bf;--vscode-pickerGroup-border: #cccedb;--vscode-keybindingLabel-background: rgba(221, 221, 221, .4);--vscode-keybindingLabel-foreground: #555555;--vscode-keybindingLabel-border: rgba(204, 204, 204, .4);--vscode-keybindingLabel-bottomBorder: rgba(187, 187, 187, .4);--vscode-editor-selectionBackground: #add6ff;--vscode-editor-inactiveSelectionBackground: #e5ebf1;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .5);--vscode-editor-findMatchBackground: #a8ac94;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(180, 180, 180, .3);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, .15);--vscode-editorHoverWidget-background: #f3f3f3;--vscode-editorHoverWidget-foreground: #616161;--vscode-editorHoverWidget-border: #c8c8c8;--vscode-editorHoverWidget-statusBarBackground: #e7e7e7;--vscode-editorLink-activeForeground: #0000ff;--vscode-editorInlayHint-foreground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-background: rgba(196, 196, 196, .3);--vscode-editorInlayHint-typeForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-typeBackground: rgba(196, 196, 196, .3);--vscode-editorInlayHint-parameterForeground: rgba(51, 51, 51, .8);--vscode-editorInlayHint-parameterBackground: rgba(196, 196, 196, .3);--vscode-editorLightBulb-foreground: #ddb100;--vscode-editorLightBulbAutoFix-foreground: #007acc;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .4);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .3);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(34, 34, 34, .2);--vscode-list-focusOutline: #0090f1;--vscode-list-focusAndSelectionOutline: #90c2f9;--vscode-list-activeSelectionBackground: #0060c0;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #e4e6f1;--vscode-list-hoverBackground: #e8e8e8;--vscode-list-dropBackground: #d6ebff;--vscode-list-highlightForeground: #0066bf;--vscode-list-focusHighlightForeground: #bbe7ff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #b01011;--vscode-list-warningForeground: #855f00;--vscode-listFilterWidget-background: #f3f3f3;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .16);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #a9a9a9;--vscode-tree-tableColumnsBorder: rgba(97, 97, 97, .13);--vscode-tree-tableOddRowsBackground: rgba(97, 97, 97, .04);--vscode-list-deemphasizedForeground: #8e8e90;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #0060c0;--vscode-menu-foreground: #616161;--vscode-menu-background: #ffffff;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #0060c0;--vscode-menu-separatorBackground: #d4d4d4;--vscode-toolbar-hoverBackground: rgba(184, 184, 184, .31);--vscode-toolbar-activeBackground: rgba(166, 166, 166, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(10, 50, 100, .2);--vscode-editor-snippetFinalTabstopHighlightBorder: rgba(10, 50, 100, .5);--vscode-breadcrumb-foreground: rgba(97, 97, 97, .8);--vscode-breadcrumb-background: #ffffff;--vscode-breadcrumb-focusForeground: #4e4e4e;--vscode-breadcrumb-activeSelectionForeground: #4e4e4e;--vscode-breadcrumbPicker-background: #f3f3f3;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #c9c9c9;--vscode-minimap-selectionHighlight: #add6ff;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #bf8803;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(100, 100, 100, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(0, 0, 0, .3);--vscode-problemsErrorIcon-foreground: #e51400;--vscode-problemsWarningIcon-foreground: #bf8803;--vscode-problemsInfoIcon-foreground: #1a85ff;--vscode-charts-foreground: #616161;--vscode-charts-lines: rgba(97, 97, 97, .5);--vscode-charts-red: #e51400;--vscode-charts-blue: #1a85ff;--vscode-charts-yellow: #bf8803;--vscode-charts-orange: #d18616;--vscode-charts-green: #388a34;--vscode-charts-purple: #652d90;--vscode-editor-lineHighlightBorder: #eeeeee;--vscode-editor-rangeHighlightBackground: rgba(253, 255, 0, .2);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #000000;--vscode-editorWhitespace-foreground: rgba(51, 51, 51, .2);--vscode-editorIndentGuide-background: #d3d3d3;--vscode-editorIndentGuide-activeBackground: #939393;--vscode-editorLineNumber-foreground: #237893;--vscode-editorActiveLineNumber-foreground: #0b216f;--vscode-editorLineNumber-activeForeground: #0b216f;--vscode-editorRuler-foreground: #d3d3d3;--vscode-editorCodeLens-foreground: #919191;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #b9b9b9;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #ffffff;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .47);--vscode-editorGhostText-foreground: rgba(0, 0, 0, .47);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #bf8803;--vscode-editorOverviewRuler-infoForeground: #1a85ff;--vscode-editorBracketHighlight-foreground1: #0431fa;--vscode-editorBracketHighlight-foreground2: #319331;--vscode-editorBracketHighlight-foreground3: #7b3814;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #cea33d;--vscode-editorUnicodeHighlight-background: rgba(206, 163, 61, .08);--vscode-symbolIcon-arrayForeground: #616161;--vscode-symbolIcon-booleanForeground: #616161;--vscode-symbolIcon-classForeground: #d67e00;--vscode-symbolIcon-colorForeground: #616161;--vscode-symbolIcon-constantForeground: #616161;--vscode-symbolIcon-constructorForeground: #652d90;--vscode-symbolIcon-enumeratorForeground: #d67e00;--vscode-symbolIcon-enumeratorMemberForeground: #007acc;--vscode-symbolIcon-eventForeground: #d67e00;--vscode-symbolIcon-fieldForeground: #007acc;--vscode-symbolIcon-fileForeground: #616161;--vscode-symbolIcon-folderForeground: #616161;--vscode-symbolIcon-functionForeground: #652d90;--vscode-symbolIcon-interfaceForeground: #007acc;--vscode-symbolIcon-keyForeground: #616161;--vscode-symbolIcon-keywordForeground: #616161;--vscode-symbolIcon-methodForeground: #652d90;--vscode-symbolIcon-moduleForeground: #616161;--vscode-symbolIcon-namespaceForeground: #616161;--vscode-symbolIcon-nullForeground: #616161;--vscode-symbolIcon-numberForeground: #616161;--vscode-symbolIcon-objectForeground: #616161;--vscode-symbolIcon-operatorForeground: #616161;--vscode-symbolIcon-packageForeground: #616161;--vscode-symbolIcon-propertyForeground: #616161;--vscode-symbolIcon-referenceForeground: #616161;--vscode-symbolIcon-snippetForeground: #616161;--vscode-symbolIcon-stringForeground: #616161;--vscode-symbolIcon-structForeground: #616161;--vscode-symbolIcon-textForeground: #616161;--vscode-symbolIcon-typeParameterForeground: #616161;--vscode-symbolIcon-unitForeground: #616161;--vscode-symbolIcon-variableForeground: #007acc;--vscode-editorHoverWidget-highlightForeground: #0066bf;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(173, 214, 255, .3);--vscode-editorGutter-foldingControlForeground: #424242;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .25);--vscode-editor-wordHighlightStrongBackground: rgba(14, 99, 156, .25);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(26, 133, 255, .1);--vscode-peekViewTitleLabel-foreground: #000000;--vscode-peekViewTitleDescription-foreground: #616161;--vscode-peekView-border: #1a85ff;--vscode-peekViewResult-background: #f3f3f3;--vscode-peekViewResult-lineForeground: #646465;--vscode-peekViewResult-fileForeground: #1e1e1e;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #6c6c6c;--vscode-peekViewEditor-background: #f2f8fc;--vscode-peekViewEditorGutter-background: #f2f8fc;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(245, 216, 2, .87);--vscode-editorMarkerNavigationError-background: #e51400;--vscode-editorMarkerNavigationError-headerBackground: rgba(229, 20, 0, .1);--vscode-editorMarkerNavigationWarning-background: #bf8803;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(191, 136, 3, .1);--vscode-editorMarkerNavigationInfo-background: #1a85ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(26, 133, 255, .1);--vscode-editorMarkerNavigation-background: #ffffff;--vscode-editorSuggestWidget-background: #f3f3f3;--vscode-editorSuggestWidget-border: #c8c8c8;--vscode-editorSuggestWidget-foreground: #000000;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #0060c0;--vscode-editorSuggestWidget-highlightForeground: #0066bf;--vscode-editorSuggestWidget-focusHighlightForeground: #bbe7ff;--vscode-editorSuggestWidgetStatus-foreground: rgba(0, 0, 0, .5);--vscode-tab-activeBackground: #ffffff;--vscode-tab-unfocusedActiveBackground: #ffffff;--vscode-tab-inactiveBackground: #ececec;--vscode-tab-unfocusedInactiveBackground: #ececec;--vscode-tab-activeForeground: #333333;--vscode-tab-inactiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedActiveForeground: rgba(51, 51, 51, .7);--vscode-tab-unfocusedInactiveForeground: rgba(51, 51, 51, .35);--vscode-tab-border: #f3f3f3;--vscode-tab-lastPinnedBorder: rgba(97, 97, 97, .19);--vscode-tab-activeModifiedBorder: #33aaee;--vscode-tab-inactiveModifiedBorder: rgba(51, 170, 238, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 170, 238, .7);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 170, 238, .25);--vscode-editorPane-background: #ffffff;--vscode-editorGroupHeader-tabsBackground: #f3f3f3;--vscode-editorGroupHeader-noTabsBackground: #ffffff;--vscode-editorGroup-border: #e7e7e7;--vscode-editorGroup-dropBackground: rgba(38, 119, 203, .18);--vscode-editorGroup-dropIntoPromptForeground: #616161;--vscode-editorGroup-dropIntoPromptBackground: #f3f3f3;--vscode-sideBySideEditor-horizontalBorder: #e7e7e7;--vscode-sideBySideEditor-verticalBorder: #e7e7e7;--vscode-panel-background: #ffffff;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #424242;--vscode-panelTitle-inactiveForeground: rgba(66, 66, 66, .75);--vscode-panelTitle-activeBorder: #424242;--vscode-panelInput-border: #dddddd;--vscode-panel-dropBorder: #424242;--vscode-panelSection-dropBackground: rgba(38, 119, 203, .18);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #004386;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #1a85ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #725102;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #2c2c2c;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #f3f3f3;--vscode-sideBarTitle-foreground: #6f6f6f;--vscode-sideBar-dropBackground: rgba(38, 119, 203, .18);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(97, 97, 97, .19);--vscode-titleBar-activeForeground: #333333;--vscode-titleBar-inactiveForeground: rgba(51, 51, 51, .6);--vscode-titleBar-activeBackground: #dddddd;--vscode-titleBar-inactiveBackground: rgba(221, 221, 221, .6);--vscode-menubar-selectionForeground: #333333;--vscode-menubar-selectionBackground: rgba(184, 184, 184, .31);--vscode-notifications-foreground: #616161;--vscode-notifications-background: #f3f3f3;--vscode-notificationLink-foreground: #006ab1;--vscode-notificationCenterHeader-background: #e7e7e7;--vscode-notifications-border: #e7e7e7;--vscode-notificationsErrorIcon-foreground: #e51400;--vscode-notificationsWarningIcon-foreground: #bf8803;--vscode-notificationsInfoIcon-foreground: #1a85ff;--vscode-commandCenter-foreground: #333333;--vscode-commandCenter-activeForeground: #333333;--vscode-commandCenter-activeBackground: rgba(184, 184, 184, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(97, 97, 97, .5);--vscode-editorCommentsWidget-unresolvedBorder: #1a85ff;--vscode-editorCommentsWidget-rangeBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(26, 133, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(26, 133, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(26, 133, 255, .4);--vscode-editorGutter-commentRangeForeground: #d5d8e9;--vscode-debugToolBar-background: #f3f3f3;--vscode-debugIcon-startForeground: #388a34;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 102, .45);--vscode-editor-focusedStackFrameHighlightBackground: rgba(206, 231, 206, .45);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .4);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #444444;--vscode-settings-modifiedItemIndicator: #66afe0;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #ffffff;--vscode-settings-dropdownBorder: #cecece;--vscode-settings-dropdownListBorder: #c8c8c8;--vscode-settings-checkboxBackground: #ffffff;--vscode-settings-checkboxBorder: #cecece;--vscode-settings-textInputBackground: #ffffff;--vscode-settings-textInputForeground: #616161;--vscode-settings-textInputBorder: #cecece;--vscode-settings-numberInputBackground: #ffffff;--vscode-settings-numberInputForeground: #616161;--vscode-settings-numberInputBorder: #cecece;--vscode-settings-focusedRowBackground: rgba(232, 232, 232, .6);--vscode-settings-rowHoverBackground: rgba(232, 232, 232, .3);--vscode-settings-focusedRowBorder: rgba(0, 0, 0, .12);--vscode-terminal-foreground: #333333;--vscode-terminal-selectionBackground: #add6ff;--vscode-terminal-inactiveSelectionBackground: #e5ebf1;--vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, .25);--vscode-terminalCommandDecoration-successBackground: #2090d3;--vscode-terminalCommandDecoration-errorBackground: #e51400;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #a8ac94;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(38, 119, 203, .18);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #e51400;--vscode-testing-peekHeaderBackground: rgba(229, 20, 0, .1);--vscode-testing-message\.error\.decorationForeground: #e51400;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(0, 0, 0, .5);--vscode-welcomePage-tileBackground: #f3f3f3;--vscode-welcomePage-tileHoverBackground: #dbdbdb;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .16);--vscode-welcomePage-progress\.background: #ffffff;--vscode-welcomePage-progress\.foreground: #006ab1;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #f1dfde;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(0, 0, 0, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #2090d3;--vscode-editorGutter-addedBackground: #48985d;--vscode-editorGutter-deletedBackground: #e51400;--vscode-minimapGutter-modifiedBackground: #2090d3;--vscode-minimapGutter-addedBackground: #48985d;--vscode-minimapGutter-deletedBackground: #e51400;--vscode-editorOverviewRuler-modifiedForeground: rgba(32, 144, 211, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 152, 93, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(229, 20, 0, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #be8700;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #e8e8e8;--vscode-notebook-focusedEditorBorder: #0090f1;--vscode-notebookStatusSuccessIcon-foreground: #388a34;--vscode-notebookStatusErrorIcon-foreground: #a1260d;--vscode-notebookStatusRunningIcon-foreground: #616161;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: rgba(200, 221, 241, .31);--vscode-notebook-selectedCellBorder: #e8e8e8;--vscode-notebook-focusedCellBorder: #0090f1;--vscode-notebook-inactiveFocusedCellBorder: #e8e8e8;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, .08);--vscode-notebook-cellInsertionIndicator: #0090f1;--vscode-notebookScrollbarSlider-background: rgba(100, 100, 100, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(0, 0, 0, .6);--vscode-notebook-symbolHighlightBackground: rgba(253, 255, 0, .2);--vscode-notebook-cellEditorBackground: #f3f3f3;--vscode-notebook-editorBackground: #ffffff;--vscode-keybindingTable-headerBackground: rgba(97, 97, 97, .04);--vscode-keybindingTable-rowsBackground: rgba(97, 97, 97, .04);--vscode-scm-providerBorder: #c8c8c8;--vscode-searchEditor-textInputBorder: #cecece;--vscode-debugTokenExpression-name: #9b46b0;--vscode-debugTokenExpression-value: rgba(108, 108, 108, .8);--vscode-debugTokenExpression-string: #a31515;--vscode-debugTokenExpression-boolean: #0000ff;--vscode-debugTokenExpression-number: #098658;--vscode-debugTokenExpression-error: #e51400;--vscode-debugView-exceptionLabelForeground: #ffffff;--vscode-debugView-exceptionLabelBackground: #a31515;--vscode-debugView-stateLabelForeground: #616161;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #1a85ff;--vscode-debugConsole-warningForeground: #bf8803;--vscode-debugConsole-errorForeground: #a1260d;--vscode-debugConsole-sourceForeground: #616161;--vscode-debugConsoleInputIcon-foreground: #616161;--vscode-debugIcon-pauseForeground: #007acc;--vscode-debugIcon-stopForeground: #a1260d;--vscode-debugIcon-disconnectForeground: #a1260d;--vscode-debugIcon-restartForeground: #388a34;--vscode-debugIcon-stepOverForeground: #007acc;--vscode-debugIcon-stepIntoForeground: #007acc;--vscode-debugIcon-stepOutForeground: #007acc;--vscode-debugIcon-continueForeground: #007acc;--vscode-debugIcon-stepBackForeground: #007acc;--vscode-extensionButton-prominentBackground: #007acc;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #0062a3;--vscode-extensionIcon-starForeground: #df6100;--vscode-extensionIcon-verifiedForeground: #006ab1;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #b51e78;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #00bc00;--vscode-terminal-ansiYellow: #949800;--vscode-terminal-ansiBlue: #0451a5;--vscode-terminal-ansiMagenta: #bc05bc;--vscode-terminal-ansiCyan: #0598bc;--vscode-terminal-ansiWhite: #555555;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #cd3131;--vscode-terminal-ansiBrightGreen: #14ce14;--vscode-terminal-ansiBrightYellow: #b5ba00;--vscode-terminal-ansiBrightBlue: #0451a5;--vscode-terminal-ansiBrightMagenta: #bc05bc;--vscode-terminal-ansiBrightCyan: #0598bc;--vscode-terminal-ansiBrightWhite: #a5a5a5;--vscode-interactive-activeCodeBorder: #1a85ff;--vscode-interactive-inactiveCodeBorder: #e4e6f1;--vscode-gitDecoration-addedResourceForeground: #587c0c;--vscode-gitDecoration-modifiedResourceForeground: #895503;--vscode-gitDecoration-deletedResourceForeground: #ad0707;--vscode-gitDecoration-renamedResourceForeground: #007100;--vscode-gitDecoration-untrackedResourceForeground: #007100;--vscode-gitDecoration-ignoredResourceForeground: #8e8e90;--vscode-gitDecoration-stageModifiedResourceForeground: #895503;--vscode-gitDecoration-stageDeletedResourceForeground: #ad0707;--vscode-gitDecoration-conflictingResourceForeground: #ad0707;--vscode-gitDecoration-submoduleResourceForeground: #1258a7}body.dark-mode{--vscode-font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif;--vscode-font-weight: normal;--vscode-font-size: 13px;--vscode-editor-font-family: "Droid Sans Mono", "monospace", monospace;--vscode-editor-font-weight: normal;--vscode-editor-font-size: 14px;--vscode-foreground: #cccccc;--vscode-disabledForeground: rgba(204, 204, 204, .5);--vscode-errorForeground: #f48771;--vscode-descriptionForeground: rgba(204, 204, 204, .7);--vscode-icon-foreground: #c5c5c5;--vscode-focusBorder: #007fd4;--vscode-textSeparator-foreground: rgba(255, 255, 255, .18);--vscode-textLink-foreground: #3794ff;--vscode-textLink-activeForeground: #3794ff;--vscode-textPreformat-foreground: #d7ba7d;--vscode-textBlockQuote-background: rgba(127, 127, 127, .1);--vscode-textBlockQuote-border: rgba(0, 122, 204, .5);--vscode-textCodeBlock-background: rgba(10, 10, 10, .4);--vscode-widget-shadow: rgba(0, 0, 0, .36);--vscode-input-background: #3c3c3c;--vscode-input-foreground: #cccccc;--vscode-inputOption-activeBorder: #007acc;--vscode-inputOption-hoverBackground: rgba(90, 93, 94, .5);--vscode-inputOption-activeBackground: rgba(0, 127, 212, .4);--vscode-inputOption-activeForeground: #ffffff;--vscode-input-placeholderForeground: #a6a6a6;--vscode-inputValidation-infoBackground: #063b49;--vscode-inputValidation-infoBorder: #007acc;--vscode-inputValidation-warningBackground: #352a05;--vscode-inputValidation-warningBorder: #b89500;--vscode-inputValidation-errorBackground: #5a1d1d;--vscode-inputValidation-errorBorder: #be1100;--vscode-dropdown-background: #3c3c3c;--vscode-dropdown-foreground: #f0f0f0;--vscode-dropdown-border: #3c3c3c;--vscode-checkbox-background: #3c3c3c;--vscode-checkbox-foreground: #f0f0f0;--vscode-checkbox-border: #3c3c3c;--vscode-button-foreground: #ffffff;--vscode-button-separator: rgba(255, 255, 255, .4);--vscode-button-background: #0e639c;--vscode-button-hoverBackground: #1177bb;--vscode-button-secondaryForeground: #ffffff;--vscode-button-secondaryBackground: #3a3d41;--vscode-button-secondaryHoverBackground: #45494e;--vscode-badge-background: #4d4d4d;--vscode-badge-foreground: #ffffff;--vscode-scrollbar-shadow: #000000;--vscode-scrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-scrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-scrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-progressBar-background: #0e70c0;--vscode-editorError-foreground: #f14c4c;--vscode-editorWarning-foreground: #cca700;--vscode-editorInfo-foreground: #3794ff;--vscode-editorHint-foreground: rgba(238, 238, 238, .7);--vscode-sash-hoverBorder: #007fd4;--vscode-editor-background: #1e1e1e;--vscode-editor-foreground: #d4d4d4;--vscode-editorStickyScroll-background: #1e1e1e;--vscode-editorStickyScrollHover-background: #2a2d2e;--vscode-editorWidget-background: #252526;--vscode-editorWidget-foreground: #cccccc;--vscode-editorWidget-border: #454545;--vscode-quickInput-background: #252526;--vscode-quickInput-foreground: #cccccc;--vscode-quickInputTitle-background: rgba(255, 255, 255, .1);--vscode-pickerGroup-foreground: #3794ff;--vscode-pickerGroup-border: #3f3f46;--vscode-keybindingLabel-background: rgba(128, 128, 128, .17);--vscode-keybindingLabel-foreground: #cccccc;--vscode-keybindingLabel-border: rgba(51, 51, 51, .6);--vscode-keybindingLabel-bottomBorder: rgba(68, 68, 68, .6);--vscode-editor-selectionBackground: #264f78;--vscode-editor-inactiveSelectionBackground: #3a3d41;--vscode-editor-selectionHighlightBackground: rgba(173, 214, 255, .15);--vscode-editor-findMatchBackground: #515c6a;--vscode-editor-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-editor-findRangeHighlightBackground: rgba(58, 61, 65, .4);--vscode-searchEditor-findMatchBackground: rgba(234, 92, 0, .22);--vscode-editor-hoverHighlightBackground: rgba(38, 79, 120, .25);--vscode-editorHoverWidget-background: #252526;--vscode-editorHoverWidget-foreground: #cccccc;--vscode-editorHoverWidget-border: #454545;--vscode-editorHoverWidget-statusBarBackground: #2c2c2d;--vscode-editorLink-activeForeground: #4e94ce;--vscode-editorInlayHint-foreground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-background: rgba(77, 77, 77, .6);--vscode-editorInlayHint-typeForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-typeBackground: rgba(77, 77, 77, .6);--vscode-editorInlayHint-parameterForeground: rgba(255, 255, 255, .8);--vscode-editorInlayHint-parameterBackground: rgba(77, 77, 77, .6);--vscode-editorLightBulb-foreground: #ffcc00;--vscode-editorLightBulbAutoFix-foreground: #75beff;--vscode-diffEditor-insertedTextBackground: rgba(156, 204, 44, .2);--vscode-diffEditor-removedTextBackground: rgba(255, 0, 0, .4);--vscode-diffEditor-insertedLineBackground: rgba(155, 185, 85, .2);--vscode-diffEditor-removedLineBackground: rgba(255, 0, 0, .2);--vscode-diffEditor-diagonalFill: rgba(204, 204, 204, .2);--vscode-list-focusOutline: #007fd4;--vscode-list-activeSelectionBackground: #04395e;--vscode-list-activeSelectionForeground: #ffffff;--vscode-list-activeSelectionIconForeground: #ffffff;--vscode-list-inactiveSelectionBackground: #37373d;--vscode-list-hoverBackground: #2a2d2e;--vscode-list-dropBackground: #383b3d;--vscode-list-highlightForeground: #2aaaff;--vscode-list-focusHighlightForeground: #2aaaff;--vscode-list-invalidItemForeground: #b89500;--vscode-list-errorForeground: #f88070;--vscode-list-warningForeground: #cca700;--vscode-listFilterWidget-background: #252526;--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);--vscode-listFilterWidget-noMatchesOutline: #be1100;--vscode-listFilterWidget-shadow: rgba(0, 0, 0, .36);--vscode-list-filterMatchBackground: rgba(234, 92, 0, .33);--vscode-tree-indentGuidesStroke: #585858;--vscode-tree-tableColumnsBorder: rgba(204, 204, 204, .13);--vscode-tree-tableOddRowsBackground: rgba(204, 204, 204, .04);--vscode-list-deemphasizedForeground: #8c8c8c;--vscode-quickInputList-focusForeground: #ffffff;--vscode-quickInputList-focusIconForeground: #ffffff;--vscode-quickInputList-focusBackground: #04395e;--vscode-menu-foreground: #cccccc;--vscode-menu-background: #303031;--vscode-menu-selectionForeground: #ffffff;--vscode-menu-selectionBackground: #04395e;--vscode-menu-separatorBackground: #606060;--vscode-toolbar-hoverBackground: rgba(90, 93, 94, .31);--vscode-toolbar-activeBackground: rgba(99, 102, 103, .31);--vscode-editor-snippetTabstopHighlightBackground: rgba(124, 124, 124, .3);--vscode-editor-snippetFinalTabstopHighlightBorder: #525252;--vscode-breadcrumb-foreground: rgba(204, 204, 204, .8);--vscode-breadcrumb-background: #1e1e1e;--vscode-breadcrumb-focusForeground: #e0e0e0;--vscode-breadcrumb-activeSelectionForeground: #e0e0e0;--vscode-breadcrumbPicker-background: #252526;--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, .5);--vscode-merge-currentContentBackground: rgba(64, 200, 174, .2);--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, .5);--vscode-merge-incomingContentBackground: rgba(64, 166, 255, .2);--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, .4);--vscode-merge-commonContentBackground: rgba(96, 96, 96, .16);--vscode-editorOverviewRuler-currentContentForeground: rgba(64, 200, 174, .5);--vscode-editorOverviewRuler-incomingContentForeground: rgba(64, 166, 255, .5);--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, .4);--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(160, 160, 160, .8);--vscode-minimap-findMatchHighlight: #d18616;--vscode-minimap-selectionOccurrenceHighlight: #676767;--vscode-minimap-selectionHighlight: #264f78;--vscode-minimap-errorHighlight: rgba(255, 18, 18, .7);--vscode-minimap-warningHighlight: #cca700;--vscode-minimap-foregroundOpacity: #000000;--vscode-minimapSlider-background: rgba(121, 121, 121, .2);--vscode-minimapSlider-hoverBackground: rgba(100, 100, 100, .35);--vscode-minimapSlider-activeBackground: rgba(191, 191, 191, .2);--vscode-problemsErrorIcon-foreground: #f14c4c;--vscode-problemsWarningIcon-foreground: #cca700;--vscode-problemsInfoIcon-foreground: #3794ff;--vscode-charts-foreground: #cccccc;--vscode-charts-lines: rgba(204, 204, 204, .5);--vscode-charts-red: #f14c4c;--vscode-charts-blue: #3794ff;--vscode-charts-yellow: #cca700;--vscode-charts-orange: #d18616;--vscode-charts-green: #89d185;--vscode-charts-purple: #b180d7;--vscode-editor-lineHighlightBorder: #282828;--vscode-editor-rangeHighlightBackground: rgba(255, 255, 255, .04);--vscode-editor-symbolHighlightBackground: rgba(234, 92, 0, .33);--vscode-editorCursor-foreground: #aeafad;--vscode-editorWhitespace-foreground: rgba(227, 228, 226, .16);--vscode-editorIndentGuide-background: #404040;--vscode-editorIndentGuide-activeBackground: #707070;--vscode-editorLineNumber-foreground: #858585;--vscode-editorActiveLineNumber-foreground: #c6c6c6;--vscode-editorLineNumber-activeForeground: #c6c6c6;--vscode-editorRuler-foreground: #5a5a5a;--vscode-editorCodeLens-foreground: #999999;--vscode-editorBracketMatch-background: rgba(0, 100, 0, .1);--vscode-editorBracketMatch-border: #888888;--vscode-editorOverviewRuler-border: rgba(127, 127, 127, .3);--vscode-editorGutter-background: #1e1e1e;--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, .67);--vscode-editorGhostText-foreground: rgba(255, 255, 255, .34);--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, .6);--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, .7);--vscode-editorOverviewRuler-warningForeground: #cca700;--vscode-editorOverviewRuler-infoForeground: #3794ff;--vscode-editorBracketHighlight-foreground1: #ffd700;--vscode-editorBracketHighlight-foreground2: #da70d6;--vscode-editorBracketHighlight-foreground3: #179fff;--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);--vscode-editorBracketHighlight-unexpectedBracket\.foreground: rgba(255, 18, 18, .8);--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);--vscode-editorUnicodeHighlight-border: #bd9b03;--vscode-editorUnicodeHighlight-background: rgba(189, 155, 3, .15);--vscode-symbolIcon-arrayForeground: #cccccc;--vscode-symbolIcon-booleanForeground: #cccccc;--vscode-symbolIcon-classForeground: #ee9d28;--vscode-symbolIcon-colorForeground: #cccccc;--vscode-symbolIcon-constantForeground: #cccccc;--vscode-symbolIcon-constructorForeground: #b180d7;--vscode-symbolIcon-enumeratorForeground: #ee9d28;--vscode-symbolIcon-enumeratorMemberForeground: #75beff;--vscode-symbolIcon-eventForeground: #ee9d28;--vscode-symbolIcon-fieldForeground: #75beff;--vscode-symbolIcon-fileForeground: #cccccc;--vscode-symbolIcon-folderForeground: #cccccc;--vscode-symbolIcon-functionForeground: #b180d7;--vscode-symbolIcon-interfaceForeground: #75beff;--vscode-symbolIcon-keyForeground: #cccccc;--vscode-symbolIcon-keywordForeground: #cccccc;--vscode-symbolIcon-methodForeground: #b180d7;--vscode-symbolIcon-moduleForeground: #cccccc;--vscode-symbolIcon-namespaceForeground: #cccccc;--vscode-symbolIcon-nullForeground: #cccccc;--vscode-symbolIcon-numberForeground: #cccccc;--vscode-symbolIcon-objectForeground: #cccccc;--vscode-symbolIcon-operatorForeground: #cccccc;--vscode-symbolIcon-packageForeground: #cccccc;--vscode-symbolIcon-propertyForeground: #cccccc;--vscode-symbolIcon-referenceForeground: #cccccc;--vscode-symbolIcon-snippetForeground: #cccccc;--vscode-symbolIcon-stringForeground: #cccccc;--vscode-symbolIcon-structForeground: #cccccc;--vscode-symbolIcon-textForeground: #cccccc;--vscode-symbolIcon-typeParameterForeground: #cccccc;--vscode-symbolIcon-unitForeground: #cccccc;--vscode-symbolIcon-variableForeground: #75beff;--vscode-editorHoverWidget-highlightForeground: #2aaaff;--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;--vscode-editor-foldBackground: rgba(38, 79, 120, .3);--vscode-editorGutter-foldingControlForeground: #c5c5c5;--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, .3);--vscode-editor-wordHighlightBackground: rgba(87, 87, 87, .72);--vscode-editor-wordHighlightStrongBackground: rgba(0, 73, 114, .72);--vscode-editorOverviewRuler-wordHighlightForeground: rgba(160, 160, 160, .8);--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(192, 160, 192, .8);--vscode-peekViewTitle-background: rgba(55, 148, 255, .1);--vscode-peekViewTitleLabel-foreground: #ffffff;--vscode-peekViewTitleDescription-foreground: rgba(204, 204, 204, .7);--vscode-peekView-border: #3794ff;--vscode-peekViewResult-background: #252526;--vscode-peekViewResult-lineForeground: #bbbbbb;--vscode-peekViewResult-fileForeground: #ffffff;--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, .2);--vscode-peekViewResult-selectionForeground: #ffffff;--vscode-peekViewEditor-background: #001f33;--vscode-peekViewEditorGutter-background: #001f33;--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, .3);--vscode-peekViewEditor-matchHighlightBackground: rgba(255, 143, 0, .6);--vscode-editorMarkerNavigationError-background: #f14c4c;--vscode-editorMarkerNavigationError-headerBackground: rgba(241, 76, 76, .1);--vscode-editorMarkerNavigationWarning-background: #cca700;--vscode-editorMarkerNavigationWarning-headerBackground: rgba(204, 167, 0, .1);--vscode-editorMarkerNavigationInfo-background: #3794ff;--vscode-editorMarkerNavigationInfo-headerBackground: rgba(55, 148, 255, .1);--vscode-editorMarkerNavigation-background: #1e1e1e;--vscode-editorSuggestWidget-background: #252526;--vscode-editorSuggestWidget-border: #454545;--vscode-editorSuggestWidget-foreground: #d4d4d4;--vscode-editorSuggestWidget-selectedForeground: #ffffff;--vscode-editorSuggestWidget-selectedIconForeground: #ffffff;--vscode-editorSuggestWidget-selectedBackground: #04395e;--vscode-editorSuggestWidget-highlightForeground: #2aaaff;--vscode-editorSuggestWidget-focusHighlightForeground: #2aaaff;--vscode-editorSuggestWidgetStatus-foreground: rgba(212, 212, 212, .5);--vscode-tab-activeBackground: #1e1e1e;--vscode-tab-unfocusedActiveBackground: #1e1e1e;--vscode-tab-inactiveBackground: #2d2d2d;--vscode-tab-unfocusedInactiveBackground: #2d2d2d;--vscode-tab-activeForeground: #ffffff;--vscode-tab-inactiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedActiveForeground: rgba(255, 255, 255, .5);--vscode-tab-unfocusedInactiveForeground: rgba(255, 255, 255, .25);--vscode-tab-border: #252526;--vscode-tab-lastPinnedBorder: rgba(204, 204, 204, .2);--vscode-tab-activeModifiedBorder: #3399cc;--vscode-tab-inactiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 153, 204, .5);--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 153, 204, .25);--vscode-editorPane-background: #1e1e1e;--vscode-editorGroupHeader-tabsBackground: #252526;--vscode-editorGroupHeader-noTabsBackground: #1e1e1e;--vscode-editorGroup-border: #444444;--vscode-editorGroup-dropBackground: rgba(83, 89, 93, .5);--vscode-editorGroup-dropIntoPromptForeground: #cccccc;--vscode-editorGroup-dropIntoPromptBackground: #252526;--vscode-sideBySideEditor-horizontalBorder: #444444;--vscode-sideBySideEditor-verticalBorder: #444444;--vscode-panel-background: #1e1e1e;--vscode-panel-border: rgba(128, 128, 128, .35);--vscode-panelTitle-activeForeground: #e7e7e7;--vscode-panelTitle-inactiveForeground: rgba(231, 231, 231, .6);--vscode-panelTitle-activeBorder: #e7e7e7;--vscode-panel-dropBorder: #e7e7e7;--vscode-panelSection-dropBackground: rgba(83, 89, 93, .5);--vscode-panelSectionHeader-background: rgba(128, 128, 128, .2);--vscode-panelSection-border: rgba(128, 128, 128, .35);--vscode-banner-background: #04395e;--vscode-banner-foreground: #ffffff;--vscode-banner-iconForeground: #3794ff;--vscode-statusBar-foreground: #ffffff;--vscode-statusBar-noFolderForeground: #ffffff;--vscode-statusBar-background: #007acc;--vscode-statusBar-noFolderBackground: #68217a;--vscode-statusBar-focusBorder: #ffffff;--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, .18);--vscode-statusBarItem-focusBorder: #ffffff;--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, .12);--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, .2);--vscode-statusBarItem-prominentForeground: #ffffff;--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, .5);--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, .3);--vscode-statusBarItem-errorBackground: #c72e0f;--vscode-statusBarItem-errorForeground: #ffffff;--vscode-statusBarItem-warningBackground: #7a6400;--vscode-statusBarItem-warningForeground: #ffffff;--vscode-activityBar-background: #333333;--vscode-activityBar-foreground: #ffffff;--vscode-activityBar-inactiveForeground: rgba(255, 255, 255, .4);--vscode-activityBar-activeBorder: #ffffff;--vscode-activityBar-dropBorder: #ffffff;--vscode-activityBarBadge-background: #007acc;--vscode-activityBarBadge-foreground: #ffffff;--vscode-statusBarItem-remoteBackground: #16825d;--vscode-statusBarItem-remoteForeground: #ffffff;--vscode-extensionBadge-remoteBackground: #007acc;--vscode-extensionBadge-remoteForeground: #ffffff;--vscode-sideBar-background: #252526;--vscode-sideBarTitle-foreground: #bbbbbb;--vscode-sideBar-dropBackground: rgba(83, 89, 93, .5);--vscode-sideBarSectionHeader-background: rgba(0, 0, 0, 0);--vscode-sideBarSectionHeader-border: rgba(204, 204, 204, .2);--vscode-titleBar-activeForeground: #cccccc;--vscode-titleBar-inactiveForeground: rgba(204, 204, 204, .6);--vscode-titleBar-activeBackground: #3c3c3c;--vscode-titleBar-inactiveBackground: rgba(60, 60, 60, .6);--vscode-menubar-selectionForeground: #cccccc;--vscode-menubar-selectionBackground: rgba(90, 93, 94, .31);--vscode-notifications-foreground: #cccccc;--vscode-notifications-background: #252526;--vscode-notificationLink-foreground: #3794ff;--vscode-notificationCenterHeader-background: #303031;--vscode-notifications-border: #303031;--vscode-notificationsErrorIcon-foreground: #f14c4c;--vscode-notificationsWarningIcon-foreground: #cca700;--vscode-notificationsInfoIcon-foreground: #3794ff;--vscode-commandCenter-foreground: #cccccc;--vscode-commandCenter-activeForeground: #cccccc;--vscode-commandCenter-activeBackground: rgba(90, 93, 94, .31);--vscode-commandCenter-border: rgba(128, 128, 128, .35);--vscode-editorCommentsWidget-resolvedBorder: rgba(204, 204, 204, .5);--vscode-editorCommentsWidget-unresolvedBorder: #3794ff;--vscode-editorCommentsWidget-rangeBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeBorder: rgba(55, 148, 255, .4);--vscode-editorCommentsWidget-rangeActiveBackground: rgba(55, 148, 255, .1);--vscode-editorCommentsWidget-rangeActiveBorder: rgba(55, 148, 255, .4);--vscode-editorGutter-commentRangeForeground: #37373d;--vscode-debugToolBar-background: #333333;--vscode-debugIcon-startForeground: #89d185;--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 0, .2);--vscode-editor-focusedStackFrameHighlightBackground: rgba(122, 189, 122, .3);--vscode-mergeEditor-change\.background: rgba(155, 185, 85, .2);--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, .2);--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(255, 166, 0, .48);--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(134, 134, 134, .29);--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(193, 193, 193, .8);--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(173, 172, 168, .93);--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, .28);--vscode-settings-headerForeground: #e7e7e7;--vscode-settings-modifiedItemIndicator: #0c7d9d;--vscode-settings-headerBorder: rgba(128, 128, 128, .35);--vscode-settings-sashBorder: rgba(128, 128, 128, .35);--vscode-settings-dropdownBackground: #3c3c3c;--vscode-settings-dropdownForeground: #f0f0f0;--vscode-settings-dropdownBorder: #3c3c3c;--vscode-settings-dropdownListBorder: #454545;--vscode-settings-checkboxBackground: #3c3c3c;--vscode-settings-checkboxForeground: #f0f0f0;--vscode-settings-checkboxBorder: #3c3c3c;--vscode-settings-textInputBackground: #3c3c3c;--vscode-settings-textInputForeground: #cccccc;--vscode-settings-numberInputBackground: #3c3c3c;--vscode-settings-numberInputForeground: #cccccc;--vscode-settings-focusedRowBackground: rgba(42, 45, 46, .6);--vscode-settings-rowHoverBackground: rgba(42, 45, 46, .3);--vscode-settings-focusedRowBorder: rgba(255, 255, 255, .12);--vscode-terminal-foreground: #cccccc;--vscode-terminal-selectionBackground: #264f78;--vscode-terminal-inactiveSelectionBackground: #3a3d41;--vscode-terminalCommandDecoration-defaultBackground: rgba(255, 255, 255, .25);--vscode-terminalCommandDecoration-successBackground: #1b81a8;--vscode-terminalCommandDecoration-errorBackground: #f14c4c;--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, .8);--vscode-terminal-border: rgba(128, 128, 128, .35);--vscode-terminal-findMatchBackground: #515c6a;--vscode-terminal-findMatchHighlightBackground: rgba(234, 92, 0, .33);--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, .49);--vscode-terminal-dropBackground: rgba(83, 89, 93, .5);--vscode-testing-iconFailed: #f14c4c;--vscode-testing-iconErrored: #f14c4c;--vscode-testing-iconPassed: #73c991;--vscode-testing-runAction: #73c991;--vscode-testing-iconQueued: #cca700;--vscode-testing-iconUnset: #848484;--vscode-testing-iconSkipped: #848484;--vscode-testing-peekBorder: #f14c4c;--vscode-testing-peekHeaderBackground: rgba(241, 76, 76, .1);--vscode-testing-message\.error\.decorationForeground: #f14c4c;--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, .2);--vscode-testing-message\.info\.decorationForeground: rgba(212, 212, 212, .5);--vscode-welcomePage-tileBackground: #252526;--vscode-welcomePage-tileHoverBackground: #2c2c2d;--vscode-welcomePage-tileShadow: rgba(0, 0, 0, .36);--vscode-welcomePage-progress\.background: #3c3c3c;--vscode-welcomePage-progress\.foreground: #3794ff;--vscode-debugExceptionWidget-border: #a31515;--vscode-debugExceptionWidget-background: #420b0d;--vscode-ports-iconRunningProcessForeground: #369432;--vscode-statusBar-debuggingBackground: #cc6633;--vscode-statusBar-debuggingForeground: #ffffff;--vscode-editor-inlineValuesForeground: rgba(255, 255, 255, .5);--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, .2);--vscode-editorGutter-modifiedBackground: #1b81a8;--vscode-editorGutter-addedBackground: #487e02;--vscode-editorGutter-deletedBackground: #f14c4c;--vscode-minimapGutter-modifiedBackground: #1b81a8;--vscode-minimapGutter-addedBackground: #487e02;--vscode-minimapGutter-deletedBackground: #f14c4c;--vscode-editorOverviewRuler-modifiedForeground: rgba(27, 129, 168, .6);--vscode-editorOverviewRuler-addedForeground: rgba(72, 126, 2, .6);--vscode-editorOverviewRuler-deletedForeground: rgba(241, 76, 76, .6);--vscode-debugIcon-breakpointForeground: #e51400;--vscode-debugIcon-breakpointDisabledForeground: #848484;--vscode-debugIcon-breakpointUnverifiedForeground: #848484;--vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00;--vscode-debugIcon-breakpointStackframeForeground: #89d185;--vscode-notebook-cellBorderColor: #37373d;--vscode-notebook-focusedEditorBorder: #007fd4;--vscode-notebookStatusSuccessIcon-foreground: #89d185;--vscode-notebookStatusErrorIcon-foreground: #f48771;--vscode-notebookStatusRunningIcon-foreground: #cccccc;--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, .35);--vscode-notebook-selectedCellBackground: #37373d;--vscode-notebook-selectedCellBorder: #37373d;--vscode-notebook-focusedCellBorder: #007fd4;--vscode-notebook-inactiveFocusedCellBorder: #37373d;--vscode-notebook-cellStatusBarItemHoverBackground: rgba(255, 255, 255, .15);--vscode-notebook-cellInsertionIndicator: #007fd4;--vscode-notebookScrollbarSlider-background: rgba(121, 121, 121, .4);--vscode-notebookScrollbarSlider-hoverBackground: rgba(100, 100, 100, .7);--vscode-notebookScrollbarSlider-activeBackground: rgba(191, 191, 191, .4);--vscode-notebook-symbolHighlightBackground: rgba(255, 255, 255, .04);--vscode-notebook-cellEditorBackground: #252526;--vscode-notebook-editorBackground: #1e1e1e;--vscode-keybindingTable-headerBackground: rgba(204, 204, 204, .04);--vscode-keybindingTable-rowsBackground: rgba(204, 204, 204, .04);--vscode-scm-providerBorder: #454545;--vscode-debugTokenExpression-name: #c586c0;--vscode-debugTokenExpression-value: rgba(204, 204, 204, .6);--vscode-debugTokenExpression-string: #ce9178;--vscode-debugTokenExpression-boolean: #4e94ce;--vscode-debugTokenExpression-number: #b5cea8;--vscode-debugTokenExpression-error: #f48771;--vscode-debugView-exceptionLabelForeground: #cccccc;--vscode-debugView-exceptionLabelBackground: #6c2022;--vscode-debugView-stateLabelForeground: #cccccc;--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, .27);--vscode-debugView-valueChangedHighlight: #569cd6;--vscode-debugConsole-infoForeground: #3794ff;--vscode-debugConsole-warningForeground: #cca700;--vscode-debugConsole-errorForeground: #f48771;--vscode-debugConsole-sourceForeground: #cccccc;--vscode-debugConsoleInputIcon-foreground: #cccccc;--vscode-debugIcon-pauseForeground: #75beff;--vscode-debugIcon-stopForeground: #f48771;--vscode-debugIcon-disconnectForeground: #f48771;--vscode-debugIcon-restartForeground: #89d185;--vscode-debugIcon-stepOverForeground: #75beff;--vscode-debugIcon-stepIntoForeground: #75beff;--vscode-debugIcon-stepOutForeground: #75beff;--vscode-debugIcon-continueForeground: #75beff;--vscode-debugIcon-stepBackForeground: #75beff;--vscode-extensionButton-prominentBackground: #0e639c;--vscode-extensionButton-prominentForeground: #ffffff;--vscode-extensionButton-prominentHoverBackground: #1177bb;--vscode-extensionIcon-starForeground: #ff8e00;--vscode-extensionIcon-verifiedForeground: #3794ff;--vscode-extensionIcon-preReleaseForeground: #1d9271;--vscode-extensionIcon-sponsorForeground: #d758b3;--vscode-terminal-ansiBlack: #000000;--vscode-terminal-ansiRed: #cd3131;--vscode-terminal-ansiGreen: #0dbc79;--vscode-terminal-ansiYellow: #e5e510;--vscode-terminal-ansiBlue: #2472c8;--vscode-terminal-ansiMagenta: #bc3fbc;--vscode-terminal-ansiCyan: #11a8cd;--vscode-terminal-ansiWhite: #e5e5e5;--vscode-terminal-ansiBrightBlack: #666666;--vscode-terminal-ansiBrightRed: #f14c4c;--vscode-terminal-ansiBrightGreen: #23d18b;--vscode-terminal-ansiBrightYellow: #f5f543;--vscode-terminal-ansiBrightBlue: #3b8eea;--vscode-terminal-ansiBrightMagenta: #d670d6;--vscode-terminal-ansiBrightCyan: #29b8db;--vscode-terminal-ansiBrightWhite: #e5e5e5;--vscode-interactive-activeCodeBorder: #3794ff;--vscode-interactive-inactiveCodeBorder: #37373d;--vscode-gitDecoration-addedResourceForeground: #81b88b;--vscode-gitDecoration-modifiedResourceForeground: #e2c08d;--vscode-gitDecoration-deletedResourceForeground: #c74e39;--vscode-gitDecoration-renamedResourceForeground: #73c991;--vscode-gitDecoration-untrackedResourceForeground: #73c991;--vscode-gitDecoration-ignoredResourceForeground: #8c8c8c;--vscode-gitDecoration-stageModifiedResourceForeground: #e2c08d;--vscode-gitDecoration-stageDeletedResourceForeground: #c74e39;--vscode-gitDecoration-conflictingResourceForeground: #e4676b;--vscode-gitDecoration-submoduleResourceForeground: #8db9e2}.cm-wrapper{line-height:18px}.cm-wrapper,.cm-wrapper>div{width:100%;height:100%}.CodeMirror span.cm-meta{color:var(--vscode-editor-foreground)}.CodeMirror span.cm-number{color:var(--vscode-debugTokenExpression-number)}.CodeMirror span.cm-keyword,.CodeMirror span.cm-builtin{color:var(--vscode-debugTokenExpression-name)}.CodeMirror span.cm-operator{color:var(--vscode-editor-foreground)}.CodeMirror span.cm-string,.CodeMirror span.cm-string-2{color:var(--vscode-debugTokenExpression-string)}.CodeMirror span.cm-error{color:var(--vscode-errorForeground)}.CodeMirror span.cm-def,.CodeMirror span.cm-tag{color:#0070c1}.CodeMirror span.cm-comment,.CodeMirror span.cm-link{color:green}.CodeMirror span.cm-variable,.CodeMirror span.cm-variable-2,.CodeMirror span.cm-atom{color:#0070c1}.CodeMirror span.cm-property{color:#795e26}.CodeMirror span.cm-qualifier,.CodeMirror span.cm-attribute{color:#001080}.CodeMirror span.cm-variable-3,.CodeMirror span.cm-type{color:#267f99}body.dark-mode .CodeMirror span.cm-def,body.dark-mode .CodeMirror span.cm-tag{color:var(--vscode-debugView-valueChangedHighlight)}body.dark-mode .CodeMirror span.cm-comment,body.dark-mode .CodeMirror span.cm-link{color:#6a9955}body.dark-mode .CodeMirror span.cm-variable,body.dark-mode .CodeMirror span.cm-variable-2,body.dark-mode .CodeMirror span.cm-atom{color:#4fc1ff}body.dark-mode .CodeMirror span.cm-property{color:#dcdcaa}body.dark-mode .CodeMirror span.cm-qualifier,body.dark-mode .CodeMirror span.cm-attribute{color:#9cdcfe}body.dark-mode .CodeMirror span.cm-variable-3,body.dark-mode .CodeMirror span.cm-type{color:#4ec9b0}.CodeMirror span.cm-bracket{color:var(--vscode-editorBracketHighlight-foreground3)}.CodeMirror-cursor{border-left:1px solid var(--vscode-editor-foreground)!important}.CodeMirror div.CodeMirror-selected{background:var(--vscode-terminal-inactiveSelectionBackground)}.CodeMirror .CodeMirror-gutters{z-index:0;background:1px solid var(--vscode-editorGroup-border);border-right:none}.CodeMirror .CodeMirror-gutter-elt{background-color:var(--vscode-editorGutter-background)}.CodeMirror .CodeMirror-gutterwrapper{border-right:1px solid var(--vscode-editorGroup-border);color:var(--vscode-editorLineNumber-foreground)}.CodeMirror .CodeMirror-matchingbracket{background-color:var(--vscode-editorBracketPairGuide-background1);color:var(--vscode-editorBracketHighlight-foreground1)!important}.CodeMirror{font-family:var(--vscode-editor-font-family)!important;color:var(--vscode-editor-foreground)!important;background-color:var(--vscode-editor-background)!important;font-weight:var(--vscode-editor-font-weight)!important;font-size:var(--vscode-editor-font-size)!important}.CodeMirror .source-line-running{background-color:var(--vscode-editor-selectionBackground);z-index:2}.CodeMirror .source-line-paused{background-color:var(--vscode-editor-selectionHighlightBackground);z-index:2}.CodeMirror .source-line-error-widget{background-color:var(--vscode-inputValidation-errorBackground);white-space:pre-wrap;margin:3px 10px;padding:5px}.CodeMirror span.cm-link,span.cm-linkified{color:var(--vscode-textLink-foreground);text-decoration:underline;cursor:pointer}.CodeMirror .source-line-error-underline{text-decoration:underline;text-decoration-color:var(--vscode-errorForeground);text-decoration-style:wavy}.CodeMirror-placeholder{color:var(--vscode-input-placeholderForeground)!important}.split-view{display:flex;flex:auto;position:relative}.split-view.vertical{flex-direction:column}.split-view.vertical.sidebar-first{flex-direction:column-reverse}.split-view.horizontal{flex-direction:row}.split-view.horizontal.sidebar-first{flex-direction:row-reverse}.split-view-main{display:flex;flex:auto}.split-view-sidebar{display:flex;flex:none}.split-view.vertical:not(.sidebar-first)>.split-view-sidebar{border-top:1px solid var(--vscode-panel-border)}.split-view.horizontal:not(.sidebar-first)>.split-view-sidebar{border-left:1px solid var(--vscode-panel-border)}.split-view.vertical.sidebar-first>.split-view-sidebar{border-bottom:1px solid var(--vscode-panel-border)}.split-view.horizontal.sidebar-first>.split-view-sidebar{border-right:1px solid var(--vscode-panel-border)}.split-view-resizer{position:absolute;z-index:100}.split-view.vertical>.split-view-resizer{left:0;right:0;height:12px;cursor:ns-resize}.split-view.horizontal>.split-view-resizer{top:0;bottom:0;width:12px;cursor:ew-resize}.tabbed-pane{display:flex;flex:auto;overflow:hidden}.tabbed-pane .toolbar{background-color:var(--vscode-sideBar-background)}.tabbed-pane .tab-content{display:flex;flex:auto;overflow:hidden;position:relative;flex-direction:column}.tabbed-pane-tab{padding:2px 6px 0;cursor:pointer;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border-bottom:2px solid transparent;outline:none;height:100%}.tabbed-pane-tab-label{max-width:250px;white-space:pre;overflow:hidden;text-overflow:ellipsis;display:inline-block}.tabbed-pane-tab.selected{background-color:var(--vscode-tab-activeBackground)}.tabbed-pane-tab-counter{padding:0 4px;background:var(--vscode-menu-separatorBackground);border-radius:8px;height:16px;margin-left:4px;line-height:16px;min-width:18px;display:flex;align-items:center;justify-content:center}.tabbed-pane-tab-counter.error{background:var(--vscode-list-errorForeground);color:var(--vscode-button-foreground)}.toolbar{position:relative;display:flex;color:var(--vscode-sideBarTitle-foreground);min-height:35px;align-items:center;flex:none;padding-right:4px}.toolbar.toolbar-sidebar-background{background-color:var(--vscode-sideBar-background)}.toolbar:after{content:"";display:block;position:absolute;pointer-events:none;top:0;bottom:0;left:-2px;right:-2px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px;z-index:100}.toolbar.no-shadow:after{box-shadow:none}.toolbar.no-min-height{min-height:0}.toolbar input{padding:0 5px;line-height:24px;outline:none;margin:0 4px}.toolbar select{background:none;outline:none;padding:3px;margin:2px}.toolbar input,.toolbar select{border:none;color:var(--vscode-input-foreground);background-color:var(--vscode-input-background)}.toolbar-button{flex:none;border:none;outline:none;color:var(--vscode-sideBarTitle-foreground);background:transparent;padding:4px;cursor:pointer;display:inline-flex;align-items:center}.toolbar-button:disabled{color:var(--vscode-disabledForeground)!important;cursor:default}.toolbar-button:not(:disabled):hover{background-color:var(--vscode-toolbar-hoverBackground)}.toolbar-button:not(:disabled):active{background-color:var(--vscode-toolbar-activeBackground)}.toolbar-button.toggled{color:var(--vscode-notificationLink-foreground)}.toolbar-separator{flex:none;background-color:var(--vscode-menu-separatorBackground);width:1px;padding:0;margin:5px 4px;height:16px}.call-log{display:flex;flex-direction:column;flex:auto;line-height:20px;white-space:pre;overflow:auto}.call-log-message{flex:none;padding:3px 0 3px 36px;display:flex;align-items:center}.call-log-call{display:flex;flex:none;flex-direction:column;border-top:1px solid var(--vscode-panel-border)}.call-log-call-header{height:24px;display:flex;align-items:center;padding:0 2px;z-index:2}.call-log-call .codicon{padding:0 4px;flex:none}.call-log .codicon-check{color:#21a945;font-weight:700}.call-log-call.error{background-color:var(--vscode-inputValidation-errorBackground);border-top:1px solid var(--vscode-panel-border)}.call-log-call.error .call-log-call-header,.call-log-message.error,.call-log .codicon-error{color:var(--vscode-errorForeground)}.call-log-details{flex:0 1 auto;overflow-x:hidden;text-overflow:ellipsis}.call-log-url{color:var(--vscode-charts-blue)}.call-log-selector{color:var(--vscode-charts-orange);white-space:nowrap}.call-log-time{flex:none;margin-left:4px;color:var(--gray)}.call-log-call .codicon.preview{visibility:hidden;color:var(--vscode-sideBarTitle-foreground);cursor:pointer}.call-log-call .codicon.preview:hover{color:inherit}.call-log-call:hover .codicon.preview{visibility:visible}.recorder{display:flex;flex-direction:column;flex:auto}.recorder-chooser{border:none;background:none;outline:none;color:var(--vscode-sideBarTitle-foreground);min-width:100px}.recorder .codicon{font-size:16px}.recorder .codicon.circle-large-filled{font-size:15px}.recorder .toolbar-button.toggled.circle-large-filled{color:#a1260d}body.dark-mode .recorder .toolbar-button.toggled.circle-large-filled{color:#f48771}.recorder .toolbar-button:not([disabled]) .codicon-debug-continue,.recorder .toolbar-button:not([disabled]) .codicon-debug-step-over{color:#01bb01}.recorder .toolbar-button:not([disabled]):hover .codicon-debug-continue,.recorder .toolbar-button:not([disabled]):hover .codicon-debug-step-over{color:#41ca1e}.recorder .selector-input{flex:auto} diff --git a/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-m0XdVJHe.js b/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-m0XdVJHe.js new file mode 100644 index 00000000..1fb9e1a9 --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/vite/recorder/assets/index-m0XdVJHe.js @@ -0,0 +1,184 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/codeMirrorModule-C5j27SYZ.js","assets/codeMirrorModule-ez37Vkbh.css"])))=>i.map(i=>d[i]); +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var a1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ep(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vc={exports:{}},Fi={},Kc={exports:{}},D={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var fs=Symbol.for("react.element"),Np=Symbol.for("react.portal"),xp=Symbol.for("react.fragment"),Tp=Symbol.for("react.strict_mode"),Cp=Symbol.for("react.profiler"),_p=Symbol.for("react.provider"),Lp=Symbol.for("react.context"),Op=Symbol.for("react.forward_ref"),$p=Symbol.for("react.suspense"),Ip=Symbol.for("react.memo"),Ap=Symbol.for("react.lazy"),hu=Symbol.iterator;function Pp(e){return e===null||typeof e!="object"?null:(e=hu&&e[hu]||e["@@iterator"],typeof e=="function"?e:null)}var Wc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Hc=Object.assign,qc={};function lr(e,t,n){this.props=e,this.context=t,this.refs=qc,this.updater=n||Wc}lr.prototype.isReactComponent={};lr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};lr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qc(){}Qc.prototype=lr.prototype;function na(e,t,n){this.props=e,this.context=t,this.refs=qc,this.updater=n||Wc}var ra=na.prototype=new Qc;ra.constructor=na;Hc(ra,lr.prototype);ra.isPureReactComponent=!0;var pu=Array.isArray,Yc=Object.prototype.hasOwnProperty,sa={current:null},Jc={key:!0,ref:!0,__self:!0,__source:!0};function Gc(e,t,n){var r,s={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Yc.call(t,r)&&!Jc.hasOwnProperty(r)&&(s[r]=t[r]);var o=arguments.length-2;if(o===1)s.children=n;else if(1{const r=e.current;if(!r)return;const s=new ResizeObserver(i=>{const l=i[i.length-1];l&&l.contentRect&&n(l.contentRect)});return s.observe(r),()=>s.disconnect()},[e]),[t,e]}function Kp(e){if(e<0||!isFinite(e))return"-";if(e===0)return"0";if(e<1e3)return e.toFixed(0)+"ms";const t=e/1e3;if(t<60)return t.toFixed(1)+"s";const n=t/60;if(n<60)return n.toFixed(1)+"m";const r=n/60;return r<24?r.toFixed(1)+"h":(r/24).toFixed(1)+"d"}function gu(e){const t=document.createElement("textarea");t.style.position="absolute",t.style.zIndex="-1000",t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}function eo(e,t){e&&(t=Xt.getObject(e,t));const[n,r]=Un.useState(t),s=Un.useCallback(i=>{e?Xt.setObject(e,i):r(i)},[e,r]);return Un.useEffect(()=>{if(e){const i=()=>r(Xt.getObject(e,t));return Xt.onChangeEmitter.addEventListener(e,i),()=>Xt.onChangeEmitter.removeEventListener(e,i)}},[t,e]),[n,s]}class Wp{constructor(){this.onChangeEmitter=new EventTarget}getString(t,n){return localStorage[t]||n}setString(t,n){var r;localStorage[t]=n,this.onChangeEmitter.dispatchEvent(new Event(t)),(r=window.saveSettings)==null||r.call(window)}getObject(t,n){if(!localStorage[t])return n;try{return JSON.parse(localStorage[t])}catch{return n}}setObject(t,n){var r;localStorage[t]=JSON.stringify(n),this.onChangeEmitter.dispatchEvent(new Event(t)),(r=window.saveSettings)==null||r.call(window)}}const Xt=new Wp;function on(...e){return e.filter(Boolean).join(" ")}const yu="\\u0000-\\u0020\\u007f-\\u009f",Hp=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|www\\.)[^\\s"+yu+'"]{2,}[^\\s'+yu+`"')}\\],:;.!?]`,"ug");function qp(){if(document.playwrightThemeInitialized)return;document.playwrightThemeInitialized=!0,document.defaultView.addEventListener("focus",n=>{n.target.document.nodeType===Node.DOCUMENT_NODE&&document.body.classList.remove("inactive")},!1),document.defaultView.addEventListener("blur",n=>{document.body.classList.add("inactive")},!1);const e=Xt.getString("theme","light-mode"),t=window.matchMedia("(prefers-color-scheme: dark)");(e==="dark-mode"||t.matches)&&document.body.classList.add("dark-mode")}const Qp=new Set;function Yp(){const e=Jp(),t=e==="dark-mode"?"light-mode":"dark-mode";e&&document.body.classList.remove(e),document.body.classList.add(t),Xt.setString("theme",t);for(const n of Qp)n(t)}function Jp(){return document.body.classList.contains("dark-mode")?"dark-mode":"light-mode"}var ef={exports:{}},Fe={},tf={exports:{}},nf={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t($,j){var R=$.length;$.push(j);e:for(;0>>1,oe=$[Z];if(0>>1;Zs(vl,R))Yts(ks,vl)?($[Z]=ks,$[Yt]=R,Z=Yt):($[Z]=vl,$[Qt]=R,Z=Qt);else if(Yts(ks,R))$[Z]=ks,$[Yt]=R,Z=Yt;else break e}}return j}function s($,j){var R=$.sortIndex-j.sortIndex;return R!==0?R:$.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var a=[],u=[],m=1,f=null,p=3,g=!1,w=!1,h=!1,v=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y($){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=$)r(u),j.sortIndex=j.expirationTime,t(a,j);else break;j=n(u)}}function S($){if(h=!1,y($),!w)if(n(a)!==null)w=!0,vr(x);else{var j=n(u);j!==null&&wr(S,j.startTime-$)}}function x($,j){w=!1,h&&(h=!1,d(N),N=-1),g=!0;var R=p;try{for(y(j),f=n(a);f!==null&&(!(f.expirationTime>j)||$&&!M());){var Z=f.callback;if(typeof Z=="function"){f.callback=null,p=f.priorityLevel;var oe=Z(f.expirationTime<=j);j=e.unstable_now(),typeof oe=="function"?f.callback=oe:f===n(a)&&r(a),y(j)}else r(a);f=n(a)}if(f!==null)var Ss=!0;else{var Qt=n(u);Qt!==null&&wr(S,Qt.startTime-j),Ss=!1}return Ss}finally{f=null,p=R,g=!1}}var E=!1,T=null,N=-1,k=5,I=-1;function M(){return!(e.unstable_now()-I$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function($){switch(p){case 1:case 2:case 3:var j=3;break;default:j=p}var R=p;p=j;try{return $()}finally{p=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,j){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var R=p;p=$;try{return j()}finally{p=R}},e.unstable_scheduleCallback=function($,j,R){var Z=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0Z?($.sortIndex=R,t(u,$),n(a)===null&&$===n(u)&&(h?(d(N),N=-1):h=!0,wr(S,R-Z))):($.sortIndex=oe,t(a,$),w||g||(w=!0,vr(x))),$},e.unstable_shouldYield=M,e.unstable_wrapCallback=function($){var j=p;return function(){var R=p;p=j;try{return $.apply(this,arguments)}finally{p=R}}}})(nf);tf.exports=nf;var Gp=tf.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var rf=B,Be=Gp;function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),to=Object.prototype.hasOwnProperty,Xp=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,vu={},wu={};function Zp(e){return to.call(wu,e)?!0:to.call(vu,e)?!1:Xp.test(e)?wu[e]=!0:(vu[e]=!0,!1)}function em(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tm(e,t,n,r){if(t===null||typeof t>"u"||em(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Te(e,t,n,r,s,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var he={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){he[e]=new Te(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];he[t]=new Te(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){he[e]=new Te(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){he[e]=new Te(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){he[e]=new Te(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){he[e]=new Te(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){he[e]=new Te(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){he[e]=new Te(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){he[e]=new Te(e,5,!1,e.toLowerCase(),null,!1,!1)});var la=/[\-:]([a-z])/g;function oa(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(la,oa);he[t]=new Te(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(la,oa);he[t]=new Te(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(la,oa);he[t]=new Te(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){he[e]=new Te(e,1,!1,e.toLowerCase(),null,!1,!1)});he.xlinkHref=new Te("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){he[e]=new Te(e,1,!1,e.toLowerCase(),null,!0,!0)});function aa(e,t,n,r){var s=he.hasOwnProperty(t)?he[t]:null;(s!==null?s.type!==0:r||!(2o||s[l]!==i[o]){var a=` +`+s[l].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=l&&0<=o);break}}}finally{kl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$r(e):""}function nm(e){switch(e.tag){case 5:return $r(e.type);case 16:return $r("Lazy");case 13:return $r("Suspense");case 19:return $r("SuspenseList");case 0:case 2:case 15:return e=El(e.type,!1),e;case 11:return e=El(e.type.render,!1),e;case 1:return e=El(e.type,!0),e;default:return""}}function io(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Cn:return"Fragment";case Tn:return"Portal";case no:return"Profiler";case ua:return"StrictMode";case ro:return"Suspense";case so:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case of:return(e.displayName||"Context")+".Consumer";case lf:return(e._context.displayName||"Context")+".Provider";case ca:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case fa:return t=e.displayName||null,t!==null?t:io(e.type)||"Memo";case Ct:t=e._payload,e=e._init;try{return io(e(t))}catch{}}return null}function rm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return io(t);case 8:return t===ua?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function zt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sm(e){var t=uf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xs(e){e._valueTracker||(e._valueTracker=sm(e))}function cf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=uf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function lo(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ku(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=zt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ff(e,t){t=t.checked,t!=null&&aa(e,"checked",t,!1)}function oo(e,t){ff(e,t);var n=zt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ao(e,t.type,n):t.hasOwnProperty("defaultValue")&&ao(e,t.type,zt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Eu(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ao(e,t,n){(t!=="number"||fi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ir=Array.isArray;function Vn(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=Ts.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},im=["Webkit","ms","Moz","O"];Object.keys(Mr).forEach(function(e){im.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mr[t]=Mr[e]})});function mf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mr.hasOwnProperty(e)&&Mr[e]?(""+t).trim():t+"px"}function gf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=mf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var lm=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fo(e,t){if(t){if(lm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function ho(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var po=null;function da(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mo=null,Kn=null,Wn=null;function Tu(e){if(e=ps(e)){if(typeof mo!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Wi(t),mo(e.stateNode,e.type,t))}}function yf(e){Kn?Wn?Wn.push(e):Wn=[e]:Kn=e}function vf(){if(Kn){var e=Kn,t=Wn;if(Wn=Kn=null,Tu(e),t)for(e=0;e>>=0,e===0?32:31-(ym(e)/vm|0)|0}var Cs=64,_s=4194304;function Ar(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function mi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var o=l&~s;o!==0?r=Ar(o):(i&=l,i!==0&&(r=Ar(i)))}else l=n&~s,l!==0?r=Ar(l):i!==0&&(r=Ar(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ds(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-tt(t),e[t]=n}function Em(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Dr),ju=" ",Mu=!1;function bf(e,t){switch(e){case"keyup":return Jm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _n=!1;function Xm(e,t){switch(e){case"compositionend":return Bf(t);case"keypress":return t.which!==32?null:(Mu=!0,ju);case"textInput":return e=t.data,e===ju&&Mu?null:e;default:return null}}function Zm(e,t){if(_n)return e==="compositionend"||!Sa&&bf(e,t)?(e=Rf(),qs=ya=$t=null,_n=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Bu(n)}}function Vf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kf(){for(var e=window,t=fi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fi(e.document)}return t}function ka(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ag(e){var t=Kf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Vf(n.ownerDocument.documentElement,n)){if(r!==null&&ka(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Fu(n,i);var l=Fu(n,r);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ln=null,ko=null,Br=null,Eo=!1;function zu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Eo||Ln==null||Ln!==fi(r)||(r=Ln,"selectionStart"in r&&ka(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Br&&Xr(Br,r)||(Br=r,r=vi(ko,"onSelect"),0In||(e.current=Lo[In],Lo[In]=null,In--)}function U(e,t){In++,Lo[In]=e.current,e.current=t}var Ut={},Se=Ht(Ut),Ie=Ht(!1),cn=Ut;function Xn(e,t){var n=e.type.contextTypes;if(!n)return Ut;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ae(e){return e=e.childContextTypes,e!=null}function Si(){K(Ie),K(Se)}function Qu(e,t,n){if(Se.current!==Ut)throw Error(_(168));U(Se,t),U(Ie,n)}function Zf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(_(108,rm(e)||"Unknown",s));return G({},n,r)}function ki(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ut,cn=Se.current,U(Se,e),U(Ie,Ie.current),!0}function Yu(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=Zf(e,t,cn),r.__reactInternalMemoizedMergedChildContext=e,K(Ie),K(Se),U(Se,e)):K(Ie),U(Ie,n)}var pt=null,Hi=!1,Rl=!1;function ed(e){pt===null?pt=[e]:pt.push(e)}function Sg(e){Hi=!0,ed(e)}function qt(){if(!Rl&&pt!==null){Rl=!0;var e=0,t=F;try{var n=pt;for(F=1;e>=l,s-=l,mt=1<<32-tt(t)+s|n<N?(k=T,T=null):k=T.sibling;var I=p(d,T,y[N],S);if(I===null){T===null&&(T=k);break}e&&T&&I.alternate===null&&t(d,T),c=i(I,c,N),E===null?x=I:E.sibling=I,E=I,T=k}if(N===y.length)return n(d,T),W&&Jt(d,N),x;if(T===null){for(;NN?(k=T,T=null):k=T.sibling;var M=p(d,T,I.value,S);if(M===null){T===null&&(T=k);break}e&&T&&M.alternate===null&&t(d,T),c=i(M,c,N),E===null?x=M:E.sibling=M,E=M,T=k}if(I.done)return n(d,T),W&&Jt(d,N),x;if(T===null){for(;!I.done;N++,I=y.next())I=f(d,I.value,S),I!==null&&(c=i(I,c,N),E===null?x=I:E.sibling=I,E=I);return W&&Jt(d,N),x}for(T=r(d,T);!I.done;N++,I=y.next())I=g(T,d,N,I.value,S),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?N:I.key),c=i(I,c,N),E===null?x=I:E.sibling=I,E=I);return e&&T.forEach(function(C){return t(d,C)}),W&&Jt(d,N),x}function v(d,c,y,S){if(typeof y=="object"&&y!==null&&y.type===Cn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Ns:e:{for(var x=y.key,E=c;E!==null;){if(E.key===x){if(x=y.type,x===Cn){if(E.tag===7){n(d,E.sibling),c=s(E,y.props.children),c.return=d,d=c;break e}}else if(E.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Ct&&nc(x)===E.type){n(d,E.sibling),c=s(E,y.props),c.ref=Tr(d,E,y),c.return=d,d=c;break e}n(d,E);break}else t(d,E);E=E.sibling}y.type===Cn?(c=un(y.props.children,d.mode,S,y.key),c.return=d,d=c):(S=ti(y.type,y.key,y.props,null,d.mode,S),S.ref=Tr(d,c,y),S.return=d,d=S)}return l(d);case Tn:e:{for(E=y.key;c!==null;){if(c.key===E)if(c.tag===4&&c.stateNode.containerInfo===y.containerInfo&&c.stateNode.implementation===y.implementation){n(d,c.sibling),c=s(c,y.children||[]),c.return=d,d=c;break e}else{n(d,c);break}else t(d,c);c=c.sibling}c=Kl(y,d.mode,S),c.return=d,d=c}return l(d);case Ct:return E=y._init,v(d,c,E(y._payload),S)}if(Ir(y))return w(d,c,y,S);if(Sr(y))return h(d,c,y,S);js(d,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,c!==null&&c.tag===6?(n(d,c.sibling),c=s(c,y),c.return=d,d=c):(n(d,c),c=Vl(y,d.mode,S),c.return=d,d=c),l(d)):n(d,c)}return v}var er=ad(!0),ud=ad(!1),ms={},ut=Ht(ms),ns=Ht(ms),rs=Ht(ms);function nn(e){if(e===ms)throw Error(_(174));return e}function $a(e,t){switch(U(rs,t),U(ns,e),U(ut,ms),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:co(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=co(t,e)}K(ut),U(ut,t)}function tr(){K(ut),K(ns),K(rs)}function cd(e){nn(rs.current);var t=nn(ut.current),n=co(t,e.type);t!==n&&(U(ns,e),U(ut,n))}function Ia(e){ns.current===e&&(K(ut),K(ns))}var q=Ht(0);function _i(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Dl=[];function Aa(){for(var e=0;en?n:4,e(!0);var r=bl.transition;bl.transition={};try{e(!1),t()}finally{F=n,bl.transition=r}}function Cd(){return Qe().memoizedState}function xg(e,t,n){var r=bt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_d(e))Ld(t,n);else if(n=sd(e,t,n,r),n!==null){var s=Ne();nt(n,e,r,s),Od(n,t,r)}}function Tg(e,t,n){var r=bt(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_d(e))Ld(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,o=i(l,n);if(s.hasEagerState=!0,s.eagerState=o,rt(o,l)){var a=t.interleaved;a===null?(s.next=s,La(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}n=sd(e,t,s,r),n!==null&&(s=Ne(),nt(n,e,r,s),Od(n,t,r))}}function _d(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function Ld(e,t){Fr=Li=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Od(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,pa(e,n)}}var Oi={readContext:qe,useCallback:me,useContext:me,useEffect:me,useImperativeHandle:me,useInsertionEffect:me,useLayoutEffect:me,useMemo:me,useReducer:me,useRef:me,useState:me,useDebugValue:me,useDeferredValue:me,useTransition:me,useMutableSource:me,useSyncExternalStore:me,useId:me,unstable_isNewReconciler:!1},Cg={readContext:qe,useCallback:function(e,t){return lt().memoizedState=[e,t===void 0?null:t],e},useContext:qe,useEffect:sc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gs(4194308,4,kd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gs(4,2,e,t)},useMemo:function(e,t){var n=lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=lt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xg.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=lt();return e={current:e},t.memoizedState=e},useState:rc,useDebugValue:Da,useDeferredValue:function(e){return lt().memoizedState=e},useTransition:function(){var e=rc(!1),t=e[0];return e=Ng.bind(null,e[1]),lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Y,s=lt();if(W){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),ue===null)throw Error(_(349));dn&30||hd(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,sc(md.bind(null,r,i,e),[e]),r.flags|=2048,ls(9,pd.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=lt(),t=ue.identifierPrefix;if(W){var n=gt,r=mt;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ss++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[ot]=t,e[ts]=r,bd(e,t,!1,!1),t.stateNode=e;e:{switch(l=ho(n,r),n){case"dialog":V("cancel",e),V("close",e),s=r;break;case"iframe":case"object":case"embed":V("load",e),s=r;break;case"video":case"audio":for(s=0;srr&&(t.flags|=128,r=!0,Cr(i,!1),t.lanes=4194304)}else{if(!r)if(e=_i(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Cr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!W)return ge(t),null}else 2*ee()-i.renderingStartTime>rr&&n!==1073741824&&(t.flags|=128,r=!0,Cr(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ee(),t.sibling=null,n=q.current,U(q,r?n&1|2:n&1),t):(ge(t),null);case 22:case 23:return Va(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Me&1073741824&&(ge(t),t.subtreeFlags&6&&(t.flags|=8192)):ge(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function jg(e,t){switch(Na(t),t.tag){case 1:return Ae(t.type)&&Si(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tr(),K(Ie),K(Se),Aa(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ia(t),null;case 13:if(K(q),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));Zn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(q),null;case 4:return tr(),null;case 10:return _a(t.type._context),null;case 22:case 23:return Va(),null;case 24:return null;default:return null}}var Rs=!1,ve=!1,Mg=typeof WeakSet=="function"?WeakSet:Set,O=null;function Mn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){X(e,t,r)}else n.current=null}function Fo(e,t,n){try{n()}catch(r){X(e,t,r)}}var hc=!1;function Rg(e,t){if(No=gi,e=Kf(),ka(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,o=-1,a=-1,u=0,m=0,f=e,p=null;t:for(;;){for(var g;f!==n||s!==0&&f.nodeType!==3||(o=l+s),f!==i||r!==0&&f.nodeType!==3||(a=l+r),f.nodeType===3&&(l+=f.nodeValue.length),(g=f.firstChild)!==null;)p=f,f=g;for(;;){if(f===e)break t;if(p===n&&++u===s&&(o=l),p===i&&++m===r&&(a=l),(g=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=g}n=o===-1||a===-1?null:{start:o,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(xo={focusedElem:e,selectionRange:n},gi=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var h=w.memoizedProps,v=w.memoizedState,d=t.stateNode,c=d.getSnapshotBeforeUpdate(t.elementType===t.type?h:Xe(t.type,h),v);d.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(S){X(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return w=hc,hc=!1,w}function zr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Fo(t,n,i)}s=s.next}while(s!==r)}}function Yi(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function zo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function zd(e){var t=e.alternate;t!==null&&(e.alternate=null,zd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ot],delete t[ts],delete t[_o],delete t[vg],delete t[wg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ud(e){return e.tag===5||e.tag===3||e.tag===4}function pc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ud(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Uo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=wi));else if(r!==4&&(e=e.child,e!==null))for(Uo(e,t,n),e=e.sibling;e!==null;)Uo(e,t,n),e=e.sibling}function Vo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Vo(e,t,n),e=e.sibling;e!==null;)Vo(e,t,n),e=e.sibling}var ce=null,Ze=!1;function Tt(e,t,n){for(n=n.child;n!==null;)Vd(e,t,n),n=n.sibling}function Vd(e,t,n){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(zi,n)}catch{}switch(n.tag){case 5:ve||Mn(n,t);case 6:var r=ce,s=Ze;ce=null,Tt(e,t,n),ce=r,Ze=s,ce!==null&&(Ze?(e=ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ce.removeChild(n.stateNode));break;case 18:ce!==null&&(Ze?(e=ce,n=n.stateNode,e.nodeType===8?Ml(e.parentNode,n):e.nodeType===1&&Ml(e,n),Jr(e)):Ml(ce,n.stateNode));break;case 4:r=ce,s=Ze,ce=n.stateNode.containerInfo,Ze=!0,Tt(e,t,n),ce=r,Ze=s;break;case 0:case 11:case 14:case 15:if(!ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&Fo(n,t,l),s=s.next}while(s!==r)}Tt(e,t,n);break;case 1:if(!ve&&(Mn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){X(n,t,o)}Tt(e,t,n);break;case 21:Tt(e,t,n);break;case 22:n.mode&1?(ve=(r=ve)||n.memoizedState!==null,Tt(e,t,n),ve=r):Tt(e,t,n);break;default:Tt(e,t,n)}}function mc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mg),t.forEach(function(r){var s=Wg.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Je(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=l),r&=~i}if(r=s,r=ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bg(r/1960))-r,10e?16:e,It===null)var r=!1;else{if(e=It,It=null,Ai=0,b&6)throw Error(_(331));var s=b;for(b|=4,O=e.current;O!==null;){var i=O,l=i.child;if(O.flags&16){var o=i.deletions;if(o!==null){for(var a=0;aee()-za?an(e,0):Fa|=n),Pe(e,t)}function Gd(e,t){t===0&&(e.mode&1?(t=_s,_s<<=1,!(_s&130023424)&&(_s=4194304)):t=1);var n=Ne();e=Et(e,t),e!==null&&(ds(e,t,n),Pe(e,n))}function Kg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gd(e,n)}function Wg(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),Gd(e,n)}var Xd;Xd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ie.current)$e=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return $e=!1,Ag(e,t,n);$e=!!(e.flags&131072)}else $e=!1,W&&t.flags&1048576&&td(t,Ni,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xs(e,t),e=t.pendingProps;var s=Xn(t,Se.current);qn(t,n),s=ja(null,t,r,e,s,n);var i=Ma();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ae(r)?(i=!0,ki(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Oa(t),s.updater=qi,t.stateNode=s,s._reactInternals=t,Po(t,r,e,n),t=Ro(null,t,r,!0,i,n)):(t.tag=0,W&&i&&Ea(t),ke(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Xs(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=qg(r),e=Xe(r,e),s){case 0:t=Mo(null,t,r,e,n);break e;case 1:t=cc(null,t,r,e,n);break e;case 11:t=ac(null,t,r,e,n);break e;case 14:t=uc(null,t,r,Xe(r.type,e),n);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Xe(r,s),Mo(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Xe(r,s),cc(e,t,r,s,n);case 3:e:{if(Md(t),e===null)throw Error(_(387));r=t.pendingProps,i=t.memoizedState,s=i.element,id(e,t),Ci(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=nr(Error(_(423)),t),t=fc(e,t,r,n,s);break e}else if(r!==s){s=nr(Error(_(424)),t),t=fc(e,t,r,n,s);break e}else for(De=Mt(t.stateNode.containerInfo.firstChild),be=t,W=!0,et=null,n=ud(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Zn(),r===s){t=Nt(e,t,n);break e}ke(e,t,r,n)}t=t.child}return t;case 5:return cd(t),e===null&&$o(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,l=s.children,To(r,s)?l=null:i!==null&&To(r,i)&&(t.flags|=32),jd(e,t),ke(e,t,l,n),t.child;case 6:return e===null&&$o(t),null;case 13:return Rd(e,t,n);case 4:return $a(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=er(t,null,r,n):ke(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Xe(r,s),ac(e,t,r,s,n);case 7:return ke(e,t,t.pendingProps,n),t.child;case 8:return ke(e,t,t.pendingProps.children,n),t.child;case 12:return ke(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,l=s.value,U(xi,r._currentValue),r._currentValue=l,i!==null)if(rt(i.value,l)){if(i.children===s.children&&!Ie.current){t=Nt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){l=i.child;for(var a=o.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=vt(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var m=u.pending;m===null?a.next=a:(a.next=m.next,m.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Io(i.return,n,t),o.lanes|=n;break}a=a.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(_(341));l.lanes|=n,o=l.alternate,o!==null&&(o.lanes|=n),Io(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}ke(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,qn(t,n),s=qe(s),r=r(s),t.flags|=1,ke(e,t,r,n),t.child;case 14:return r=t.type,s=Xe(r,t.pendingProps),s=Xe(r.type,s),uc(e,t,r,s,n);case 15:return Ad(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Xe(r,s),Xs(e,t),t.tag=1,Ae(r)?(e=!0,ki(t)):e=!1,qn(t,n),od(t,r,s),Po(t,r,s,n),Ro(null,t,r,!0,e,n);case 19:return Dd(e,t,n);case 22:return Pd(e,t,n)}throw Error(_(156,t.tag))};function Zd(e,t){return Tf(e,t)}function Hg(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ke(e,t,n,r){return new Hg(e,t,n,r)}function Wa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qg(e){if(typeof e=="function")return Wa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ca)return 11;if(e===fa)return 14}return 2}function Bt(e,t){var n=e.alternate;return n===null?(n=Ke(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ti(e,t,n,r,s,i){var l=2;if(r=e,typeof e=="function")Wa(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Cn:return un(n.children,s,i,t);case ua:l=8,s|=8;break;case no:return e=Ke(12,n,t,s|2),e.elementType=no,e.lanes=i,e;case ro:return e=Ke(13,n,t,s),e.elementType=ro,e.lanes=i,e;case so:return e=Ke(19,n,t,s),e.elementType=so,e.lanes=i,e;case af:return Gi(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case lf:l=10;break e;case of:l=9;break e;case ca:l=11;break e;case fa:l=14;break e;case Ct:l=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=Ke(l,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function un(e,t,n,r){return e=Ke(7,e,r,t),e.lanes=n,e}function Gi(e,t,n,r){return e=Ke(22,e,r,t),e.elementType=af,e.lanes=n,e.stateNode={isHidden:!1},e}function Vl(e,t,n){return e=Ke(6,e,null,t),e.lanes=n,e}function Kl(e,t,n){return t=Ke(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qg(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xl(0),this.expirationTimes=xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xl(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Ha(e,t,n,r,s,i,l,o,a){return e=new Qg(e,t,n,o,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ke(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Oa(i),e}function Yg(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rh)}catch(e){console.error(e)}}rh(),ef.exports=Fe;var ey=ef.exports,sh,Nc=ey;sh=Nc.createRoot,Nc.hydrateRoot;const ty="modulepreload",ny=function(e){return"/"+e},xc={},ry=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),o=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=Promise.allSettled(n.map(a=>{if(a=ny(a),a in xc)return;xc[a]=!0;const u=a.endsWith(".css"),m=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${m}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":ty,u||(f.as="script"),f.crossOrigin="",f.href=a,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((p,g)=>{f.addEventListener("load",p),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}function i(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return s.then(l=>{for(const o of l||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})};function sy(e,t){const n=/(\x1b\[(\d+(;\d+)*)m)|([^\x1b]+)/g,r=[];let s,i={},l=!1,o=t==null?void 0:t.fg,a=t==null?void 0:t.bg;for(;(s=n.exec(e))!==null;){const[,,u,,m]=s;if(u){const f=+u;switch(f){case 0:i={};break;case 1:i["font-weight"]="bold";break;case 2:i.opacity="0.8";break;case 3:i["font-style"]="italic";break;case 4:i["text-decoration"]="underline";break;case 7:l=!0;break;case 8:i.display="none";break;case 9:i["text-decoration"]="line-through";break;case 22:delete i["font-weight"],delete i["font-style"],delete i.opacity,delete i["text-decoration"];break;case 23:delete i["font-weight"],delete i["font-style"],delete i.opacity;break;case 24:delete i["text-decoration"];break;case 27:l=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:o=Tc[f-30];break;case 39:o=t==null?void 0:t.fg;break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:a=Tc[f-40];break;case 49:a=t==null?void 0:t.bg;break;case 53:i["text-decoration"]="overline";break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:o=Cc[f-90];break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:a=Cc[f-100];break}}else if(m){const f={...i},p=l?a:o;p!==void 0&&(f.color=p);const g=l?o:a;g!==void 0&&(f["background-color"]=g),r.push(`${iy(m)}`)}}return r.join("")}const Tc={0:"var(--vscode-terminal-ansiBlack)",1:"var(--vscode-terminal-ansiRed)",2:"var(--vscode-terminal-ansiGreen)",3:"var(--vscode-terminal-ansiYellow)",4:"var(--vscode-terminal-ansiBlue)",5:"var(--vscode-terminal-ansiMagenta)",6:"var(--vscode-terminal-ansiCyan)",7:"var(--vscode-terminal-ansiWhite)"},Cc={0:"var(--vscode-terminal-ansiBrightBlack)",1:"var(--vscode-terminal-ansiBrightRed)",2:"var(--vscode-terminal-ansiBrightGreen)",3:"var(--vscode-terminal-ansiBrightYellow)",4:"var(--vscode-terminal-ansiBrightBlue)",5:"var(--vscode-terminal-ansiBrightMagenta)",6:"var(--vscode-terminal-ansiBrightCyan)",7:"var(--vscode-terminal-ansiBrightWhite)"};function iy(e){return e.replace(/[&"<>]/g,t=>({"&":"&",'"':""","<":"<",">":">"})[t])}function ly(e){return Object.entries(e).map(([t,n])=>`${t}: ${n}`).join("; ")}const Wl=({text:e,language:t,mimeType:n,linkify:r,readOnly:s,highlight:i,revealLine:l,lineNumbers:o,isFocused:a,focusOnChange:u,wrapLines:m,onChange:f,dataTestId:p,placeholder:g})=>{const[w,h]=Zc(),[v]=B.useState(ry(()=>import("./codeMirrorModule-C5j27SYZ.js"),__vite__mapDeps([0,1])).then(S=>S.default)),d=B.useRef(null),[c,y]=B.useState();return B.useEffect(()=>{(async()=>{var N,k;const S=await v;ay(S);const x=h.current;if(!x)return;const E=cy(t)||uy(n)||(r?"text/linkified":"");if(d.current&&E===d.current.cm.getOption("mode")&&!!s===d.current.cm.getOption("readOnly")&&o===d.current.cm.getOption("lineNumbers")&&m===d.current.cm.getOption("lineWrapping")&&g===d.current.cm.getOption("placeholder"))return;(k=(N=d.current)==null?void 0:N.cm)==null||k.getWrapperElement().remove();const T=S(x,{value:"",mode:E,readOnly:!!s,lineNumbers:o,lineWrapping:m,placeholder:g});return d.current={cm:T},a&&T.focus(),y(T),T})()},[v,c,h,t,n,r,o,m,s,a,g]),B.useEffect(()=>{d.current&&d.current.cm.setSize(w.width,w.height)},[w]),B.useLayoutEffect(()=>{var E;if(!c)return;let S=!1;if(c.getValue()!==e&&(c.setValue(e),S=!0,u&&(c.execCommand("selectAll"),c.focus())),S||JSON.stringify(i)!==JSON.stringify(d.current.highlight)){for(const k of d.current.highlight||[])c.removeLineClass(k.line-1,"wrap");for(const k of i||[])c.addLineClass(k.line-1,"wrap",`source-line-${k.type}`);for(const k of d.current.widgets||[])c.removeLineWidget(k);for(const k of d.current.markers||[])k.clear();const T=[],N=[];for(const k of i||[]){if(k.type!=="subtle-error"&&k.type!=="error")continue;const I=(E=d.current)==null?void 0:E.cm.getLine(k.line-1);if(I){const M={};M.title=k.message||"",N.push(c.markText({line:k.line-1,ch:0},{line:k.line-1,ch:k.column||I.length},{className:"source-line-error-underline",attributes:M}))}if(k.type==="error"){const M=document.createElement("div");M.innerHTML=sy(k.message||""),M.className="source-line-error-widget",T.push(c.addLineWidget(k.line,M,{above:!0,coverGutter:!1}))}}d.current.highlight=i,d.current.widgets=T,d.current.markers=N}typeof l=="number"&&d.current.cm.lineCount()>=l&&c.scrollIntoView({line:Math.max(0,l-1),ch:0},50);let x;return f&&(x=()=>f(c.getValue()),c.on("change",x)),()=>{x&&c.off("change",x)}},[c,e,i,l,u,f]),L.jsx("div",{"data-testid":p,className:"cm-wrapper",ref:h,onClick:oy})};function oy(e){var n;if(!(e.target instanceof HTMLElement))return;let t;e.target.classList.contains("cm-linkified")?t=e.target.textContent:e.target.classList.contains("cm-link")&&((n=e.target.nextElementSibling)!=null&&n.classList.contains("cm-url"))&&(t=e.target.nextElementSibling.textContent.slice(1,-1)),t&&(e.preventDefault(),e.stopPropagation(),window.open(t,"_blank"))}let _c=!1;function ay(e){_c||(_c=!0,e.defineSimpleMode("text/linkified",{start:[{regex:Hp,token:"linkified"}]}))}function uy(e){if(e){if(e.includes("javascript")||e.includes("json"))return"javascript";if(e.includes("python"))return"python";if(e.includes("csharp"))return"text/x-csharp";if(e.includes("java"))return"text/x-java";if(e.includes("markdown"))return"markdown";if(e.includes("html")||e.includes("svg"))return"htmlmixed";if(e.includes("css"))return"css"}}function cy(e){if(e)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[e]}const fy=50,dy=({sidebarSize:e,sidebarHidden:t=!1,sidebarIsFirst:n=!1,orientation:r="vertical",minSidebarSize:s=fy,settingName:i,sidebar:l,main:o})=>{const a=Math.max(s,e)*window.devicePixelRatio,[u,m]=eo(i?i+"."+r+":size":void 0,a),[f,p]=eo(i?i+"."+r+":size":void 0,a),[g,w]=B.useState(null),[h,v]=Zc();let d;r==="vertical"?(d=f/window.devicePixelRatio,h&&h.heightw({offset:r==="vertical"?y.clientY:y.clientX,size:d}),onMouseUp:()=>w(null),onMouseMove:y=>{if(!y.buttons)w(null);else if(g){const x=(r==="vertical"?y.clientY:y.clientX)-g.offset,E=n?g.size+x:g.size-x,N=y.target.parentElement.getBoundingClientRect(),k=Math.min(Math.max(s,E),(r==="vertical"?N.height:N.width)-s);r==="vertical"?p(k*window.devicePixelRatio):m(k*window.devicePixelRatio)}}})]})},ih=({noShadow:e,children:t,noMinHeight:n,className:r,sidebarBackground:s,onClick:i})=>L.jsx("div",{className:on("toolbar",e&&"no-shadow",n&&"no-min-height",r,s&&"toolbar-sidebar-background"),onClick:i,children:t}),hy=({tabs:e,selectedTab:t,setSelectedTab:n,leftToolbar:r,rightToolbar:s,dataTestId:i,mode:l})=>{const o=B.useId();return t||(t=e[0].id),l||(l="default"),L.jsx("div",{className:"tabbed-pane","data-testid":i,children:L.jsxs("div",{className:"vbox",children:[L.jsxs(ih,{children:[r&&L.jsxs("div",{style:{flex:"none",display:"flex",margin:"0 4px",alignItems:"center"},children:[...r]}),l==="default"&&L.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",children:[...e.map(a=>L.jsx(py,{id:a.id,ariaControls:`${o}-${a.id}`,title:a.title,count:a.count,errorCount:a.errorCount,selected:t===a.id,onSelect:n},a.id))]}),l==="select"&&L.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",children:L.jsx("select",{style:{width:"100%",background:"none",cursor:"pointer"},onChange:a=>{n==null||n(e[a.currentTarget.selectedIndex].id)},children:e.map(a=>{let u="";return a.count&&(u=` (${a.count})`),a.errorCount&&(u=` (${a.errorCount})`),L.jsxs("option",{value:a.id,selected:a.id===t,role:"tab","aria-controls":`${o}-${a.id}`,children:[a.title,u]},a.id)})})}),s&&L.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:[...s]})]}),e.map(a=>{const u="tab-content tab-"+a.id;if(a.component)return L.jsx("div",{id:`${o}-${a.id}`,role:"tabpanel","aria-label":a.title,className:u,style:{display:t===a.id?"inherit":"none"},children:a.component},a.id);if(t===a.id)return L.jsx("div",{id:`${o}-${a.id}`,role:"tabpanel","aria-label":a.title,className:u,children:a.render()},a.id)})]})})},py=({id:e,title:t,count:n,errorCount:r,selected:s,onSelect:i,ariaControls:l})=>L.jsxs("div",{className:on("tabbed-pane-tab",s&&"selected"),onClick:()=>i==null?void 0:i(e),role:"tab",title:t,"aria-controls":l,children:[L.jsx("div",{className:"tabbed-pane-tab-label",children:t}),!!n&&L.jsx("div",{className:"tabbed-pane-tab-counter",children:n}),!!r&&L.jsx("div",{className:"tabbed-pane-tab-counter error",children:r})]}),my=({sources:e,fileId:t,setFileId:n})=>L.jsx("select",{className:"source-chooser",hidden:!e.length,title:"Source chooser",value:t,onChange:r=>{n(r.target.selectedOptions[0].value)},children:gy(e)});function gy(e){const t=s=>s.replace(/.*[/\\]([^/\\]+)/,"$1"),n=s=>L.jsx("option",{value:s.id,children:t(s.label)},s.id),r=new Map;for(const s of e){let i=r.get(s.group||"Debugger");i||(i=[],r.set(s.group||"Debugger",i)),i.push(s)}return[...r.entries()].map(([s,i])=>L.jsx("optgroup",{label:s,children:i.filter(l=>(l.group||"Debugger")===s).map(l=>n(l))},s))}function yy(){return{id:"default",isRecorded:!1,text:"",language:"javascript",label:"",highlight:[]}}const je=({children:e,title:t="",icon:n,disabled:r=!1,toggled:s=!1,onClick:i=()=>{},style:l,testId:o,className:a,ariaLabel:u})=>L.jsxs("button",{className:on(a,"toolbar-button",n,s&&"toggled"),onMouseDown:Oc,onClick:i,onDoubleClick:Oc,title:t,disabled:!!r,style:l,"data-testid":o,"aria-label":u||t,children:[n&&L.jsx("span",{className:`codicon codicon-${n}`,style:e?{marginRight:5}:{}}),e]}),Lc=({style:e})=>L.jsx("div",{className:"toolbar-separator",style:e}),Oc=e=>{e.stopPropagation(),e.preventDefault()};function nl(e,t="'"){const n=JSON.stringify(e),r=n.substring(1,n.length-1).replace(/\\"/g,'"');if(t==="'")return t+r.replace(/[']/g,"\\'")+t;if(t==='"')return t+r.replace(/["]/g,'\\"')+t;if(t==="`")return t+r.replace(/[`]/g,"`")+t;throw new Error("Invalid escape char")}function Mi(e){return e.charAt(0).toUpperCase()+e.substring(1)}function lh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function rl(e){return e.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}const ne=function(e,t,n){return e>=t&&e<=n};function Ce(e){return ne(e,48,57)}function $c(e){return Ce(e)||ne(e,65,70)||ne(e,97,102)}function vy(e){return ne(e,65,90)}function wy(e){return ne(e,97,122)}function Sy(e){return vy(e)||wy(e)}function ky(e){return e>=128}function ni(e){return Sy(e)||ky(e)||e===95}function Ic(e){return ni(e)||Ce(e)||e===45}function Ey(e){return ne(e,0,8)||e===11||ne(e,14,31)||e===127}function ri(e){return e===10}function dt(e){return ri(e)||e===9||e===32}const Ny=1114111;class Ja extends Error{constructor(t){super(t),this.name="InvalidCharacterError"}}function xy(e){const t=[];for(let n=0;n=t.length?-1:t[C]},l=function(C){if(C===void 0&&(C=1),C>3)throw"Spec Error: no more than three codepoints of lookahead.";return i(n+C)},o=function(C){return C===void 0&&(C=1),n+=C,s=i(n),!0},a=function(){return n-=1,!0},u=function(C){return C===void 0&&(C=s),C===-1},m=function(){if(f(),o(),dt(s)){for(;dt(l());)o();return new Qo}else{if(s===34)return w();if(s===35)if(Ic(l())||d(l(1),l(2))){const C=new kh("");return y(l(1),l(2),l(3))&&(C.type="id"),C.value=T(),C}else return new ye(s);else return s===36?l()===61?(o(),new Oy):new ye(s):s===39?w():s===40?new gh:s===41?new yh:s===42?l()===61?(o(),new $y):new ye(s):s===43?E()?(a(),p()):new ye(s):s===44?new dh:s===45?E()?(a(),p()):l(1)===45&&l(2)===62?(o(2),new uh):S()?(a(),g()):new ye(s):s===46?E()?(a(),p()):new ye(s):s===58?new ch:s===59?new fh:s===60?l(1)===33&&l(2)===45&&l(3)===45?(o(3),new ah):new ye(s):s===64?y(l(1),l(2),l(3))?new Sh(T()):new ye(s):s===91?new mh:s===92?c()?(a(),g()):new ye(s):s===93?new Yo:s===94?l()===61?(o(),new Ly):new ye(s):s===123?new hh:s===124?l()===61?(o(),new _y):l()===124?(o(),new vh):new ye(s):s===125?new ph:s===126?l()===61?(o(),new Cy):new ye(s):Ce(s)?(a(),p()):ni(s)?(a(),g()):u()?new ii:new ye(s)}},f=function(){for(;l(1)===47&&l(2)===42;)for(o(2);;)if(o(),s===42&&l()===47){o();break}else if(u())return},p=function(){const C=N();if(y(l(1),l(2),l(3))){const A=new Iy;return A.value=C.value,A.repr=C.repr,A.type=C.type,A.unit=T(),A}else if(l()===37){o();const A=new Th;return A.value=C.value,A.repr=C.repr,A}else{const A=new xh;return A.value=C.value,A.repr=C.repr,A.type=C.type,A}},g=function(){const C=T();if(C.toLowerCase()==="url"&&l()===40){for(o();dt(l(1))&&dt(l(2));)o();return l()===34||l()===39?new li(C):dt(l())&&(l(2)===34||l(2)===39)?new li(C):h()}else return l()===40?(o(),new li(C)):new wh(C)},w=function(C){C===void 0&&(C=s);let A="";for(;o();){if(s===C||u())return new Eh(A);if(ri(s))return a(),new oh;s===92?u(l())||(ri(l())?o():A+=se(v())):A+=se(s)}throw new Error("Internal error")},h=function(){const C=new Nh("");for(;dt(l());)o();if(u(l()))return C;for(;o();){if(s===41||u())return C;if(dt(s)){for(;dt(l());)o();return l()===41||u(l())?(o(),C):(I(),new si)}else{if(s===34||s===39||s===40||Ey(s))return I(),new si;if(s===92)if(c())C.value+=se(v());else return I(),new si;else C.value+=se(s)}}throw new Error("Internal error")},v=function(){if(o(),$c(s)){const C=[s];for(let pe=0;pe<5&&$c(l());pe++)o(),C.push(s);dt(l())&&o();let A=parseInt(C.map(function(pe){return String.fromCharCode(pe)}).join(""),16);return A>Ny&&(A=65533),A}else return u()?65533:s},d=function(C,A){return!(C!==92||ri(A))},c=function(){return d(s,l())},y=function(C,A,pe){return C===45?ni(A)||A===45||d(A,pe):ni(C)?!0:C===92?d(C,A):!1},S=function(){return y(s,l(1),l(2))},x=function(C,A,pe){return C===43||C===45?!!(Ce(A)||A===46&&Ce(pe)):C===46?!!Ce(A):!!Ce(C)},E=function(){return x(s,l(1),l(2))},T=function(){let C="";for(;o();)if(Ic(s))C+=se(s);else if(c())C+=se(v());else return a(),C;throw new Error("Internal parse error")},N=function(){let C="",A="integer";for((l()===43||l()===45)&&(o(),C+=se(s));Ce(l());)o(),C+=se(s);if(l(1)===46&&Ce(l(2)))for(o(),C+=se(s),o(),C+=se(s),A="number";Ce(l());)o(),C+=se(s);const pe=l(1),yr=l(2),vr=l(3);if((pe===69||pe===101)&&Ce(yr))for(o(),C+=se(s),o(),C+=se(s),A="number";Ce(l());)o(),C+=se(s);else if((pe===69||pe===101)&&(yr===43||yr===45)&&Ce(vr))for(o(),C+=se(s),o(),C+=se(s),o(),C+=se(s),A="number";Ce(l());)o(),C+=se(s);const wr=k(C);return{type:A,value:wr,repr:C}},k=function(C){return+C},I=function(){for(;o();){if(s===41||u())return;c()&&v()}};let M=0;for(;!u(l());)if(r.push(m()),M++,M>t.length*2)throw new Error("I'm infinite-looping!");return r}class te{constructor(){this.tokenType=""}toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}}class oh extends te{constructor(){super(...arguments),this.tokenType="BADSTRING"}}class si extends te{constructor(){super(...arguments),this.tokenType="BADURL"}}class Qo extends te{constructor(){super(...arguments),this.tokenType="WHITESPACE"}toString(){return"WS"}toSource(){return" "}}class ah extends te{constructor(){super(...arguments),this.tokenType="CDO"}toSource(){return""}}class ch extends te{constructor(){super(...arguments),this.tokenType=":"}}class fh extends te{constructor(){super(...arguments),this.tokenType=";"}}class dh extends te{constructor(){super(...arguments),this.tokenType=","}}class ur extends te{constructor(){super(...arguments),this.value="",this.mirror=""}}class hh extends ur{constructor(){super(),this.tokenType="{",this.value="{",this.mirror="}"}}class ph extends ur{constructor(){super(),this.tokenType="}",this.value="}",this.mirror="{"}}class mh extends ur{constructor(){super(),this.tokenType="[",this.value="[",this.mirror="]"}}class Yo extends ur{constructor(){super(),this.tokenType="]",this.value="]",this.mirror="["}}class gh extends ur{constructor(){super(),this.tokenType="(",this.value="(",this.mirror=")"}}class yh extends ur{constructor(){super(),this.tokenType=")",this.value=")",this.mirror="("}}class Cy extends te{constructor(){super(...arguments),this.tokenType="~="}}class _y extends te{constructor(){super(...arguments),this.tokenType="|="}}class Ly extends te{constructor(){super(...arguments),this.tokenType="^="}}class Oy extends te{constructor(){super(...arguments),this.tokenType="$="}}class $y extends te{constructor(){super(...arguments),this.tokenType="*="}}class vh extends te{constructor(){super(...arguments),this.tokenType="||"}}class ii extends te{constructor(){super(...arguments),this.tokenType="EOF"}toSource(){return""}}class ye extends te{constructor(t){super(),this.tokenType="DELIM",this.value="",this.value=se(t)}toString(){return"DELIM("+this.value+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t}toSource(){return this.value==="\\"?`\\ +`:this.value}}class cr extends te{constructor(){super(...arguments),this.value=""}ASCIIMatch(t){return this.value.toLowerCase()===t.toLowerCase()}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t}}class wh extends cr{constructor(t){super(),this.tokenType="IDENT",this.value=t}toString(){return"IDENT("+this.value+")"}toSource(){return gs(this.value)}}class li extends cr{constructor(t){super(),this.tokenType="FUNCTION",this.value=t,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return gs(this.value)+"("}}class Sh extends cr{constructor(t){super(),this.tokenType="AT-KEYWORD",this.value=t}toString(){return"AT("+this.value+")"}toSource(){return"@"+gs(this.value)}}class kh extends cr{constructor(t){super(),this.tokenType="HASH",this.value=t,this.type="unrestricted"}toString(){return"HASH("+this.value+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t.type=this.type,t}toSource(){return this.type==="id"?"#"+gs(this.value):"#"+Ay(this.value)}}class Eh extends cr{constructor(t){super(),this.tokenType="STRING",this.value=t}toString(){return'"'+Ch(this.value)+'"'}}class Nh extends cr{constructor(t){super(),this.tokenType="URL",this.value=t}toString(){return"URL("+this.value+")"}toSource(){return'url("'+Ch(this.value)+'")'}}class xh extends te{constructor(){super(),this.tokenType="NUMBER",this.type="integer",this.repr=""}toString(){return this.type==="integer"?"INT("+this.value+")":"NUMBER("+this.value+")"}toJSON(){const t=super.toJSON();return t.value=this.value,t.type=this.type,t.repr=this.repr,t}toSource(){return this.repr}}class Th extends te{constructor(){super(),this.tokenType="PERCENTAGE",this.repr=""}toString(){return"PERCENTAGE("+this.value+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t.repr=this.repr,t}toSource(){return this.repr+"%"}}class Iy extends te{constructor(){super(),this.tokenType="DIMENSION",this.type="integer",this.repr="",this.unit=""}toString(){return"DIM("+this.value+","+this.unit+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t.type=this.type,t.repr=this.repr,t.unit=this.unit,t}toSource(){const t=this.repr;let n=gs(this.unit);return n[0].toLowerCase()==="e"&&(n[1]==="-"||ne(n.charCodeAt(1),48,57))&&(n="\\65 "+n.slice(1,n.length)),t+n}}function gs(e){e=""+e;let t="";const n=e.charCodeAt(0);for(let r=0;r=128||s===45||s===95||ne(s,48,57)||ne(s,65,90)||ne(s,97,122)?t+=e[r]:t+="\\"+e[r]}return t}function Ay(e){e=""+e;let t="";for(let n=0;n=128||r===45||r===95||ne(r,48,57)||ne(r,65,90)||ne(r,97,122)?t+=e[n]:t+="\\"+r.toString(16)+" "}return t}function Ch(e){e=""+e;let t="";for(let n=0;nk instanceof Sh||k instanceof oh||k instanceof si||k instanceof vh||k instanceof ah||k instanceof uh||k instanceof fh||k instanceof hh||k instanceof ph||k instanceof Nh||k instanceof Th);if(r)throw new Le(`Unsupported token "${r.toSource()}" while parsing selector "${e}"`);let s=0;const i=new Set;function l(){return new Le(`Unexpected token "${n[s].toSource()}" while parsing selector "${e}"`)}function o(){for(;n[s]instanceof Qo;)s++}function a(k=s){return n[k]instanceof wh}function u(k=s){return n[k]instanceof Eh}function m(k=s){return n[k]instanceof xh}function f(k=s){return n[k]instanceof dh}function p(k=s){return n[k]instanceof gh}function g(k=s){return n[k]instanceof yh}function w(k=s){return n[k]instanceof li}function h(k=s){return n[k]instanceof ye&&n[k].value==="*"}function v(k=s){return n[k]instanceof ii}function d(k=s){return n[k]instanceof ye&&[">","+","~"].includes(n[k].value)}function c(k=s){return f(k)||g(k)||v(k)||d(k)||n[k]instanceof Qo}function y(){const k=[S()];for(;o(),!!f();)s++,k.push(S());return k}function S(){return o(),m()||u()?n[s++].value:x()}function x(){const k={simples:[]};for(o(),d()?k.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""}):k.simples.push({selector:E(),combinator:""});;){if(o(),d())k.simples[k.simples.length-1].combinator=n[s++].value,o();else if(c())break;k.simples.push({combinator:"",selector:E()})}return k}function E(){let k="";const I=[];for(;!c();)if(a()||h())k+=n[s++].toSource();else if(n[s]instanceof kh)k+=n[s++].toSource();else if(n[s]instanceof ye&&n[s].value===".")if(s++,a())k+="."+n[s++].toSource();else throw l();else if(n[s]instanceof ch)if(s++,a())if(!t.has(n[s].value.toLowerCase()))k+=":"+n[s++].toSource();else{const M=n[s++].value.toLowerCase();I.push({name:M,args:[]}),i.add(M)}else if(w()){const M=n[s++].value.toLowerCase();if(t.has(M)?(I.push({name:M,args:y()}),i.add(M)):k+=`:${M}(${T()})`,o(),!g())throw l();s++}else throw l();else if(n[s]instanceof mh){for(k+="[",s++;!(n[s]instanceof Yo)&&!v();)k+=n[s++].toSource();if(!(n[s]instanceof Yo))throw l();k+="]",s++}else throw l();if(!k&&!I.length)throw l();return{css:k||void 0,functions:I}}function T(){let k="",I=1;for(;!v()&&((p()||w())&&I++,g()&&I--,!!I);)k+=n[s++].toSource();return k}const N=y();if(!v())throw l();if(N.some(k=>typeof k!="object"||!("simples"in k)))throw new Le(`Error while parsing selector "${e}"`);return{selector:N,names:Array.from(i)}}const Ac=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),jy=new Set(["left-of","right-of","above","below","near"]),My=new Set(["not","is","where","has","scope","light","visible","text","text-matches","text-is","has-text","above","below","right-of","left-of","near","nth-match"]);function _h(e){const t=Dy(e),n=[];for(const r of t.parts){if(r.name==="css"||r.name==="css:light"){r.name==="css:light"&&(r.body=":light("+r.body+")");const s=Py(r.body,My);n.push({name:"css",body:s.selector,source:r.body});continue}if(Ac.has(r.name)){let s,i;try{const u=JSON.parse("["+r.body+"]");if(!Array.isArray(u)||u.length<1||u.length>2||typeof u[0]!="string")throw new Le(`Malformed selector: ${r.name}=`+r.body);if(s=u[0],u.length===2){if(typeof u[1]!="number"||!jy.has(r.name))throw new Le(`Malformed selector: ${r.name}=`+r.body);i=u[1]}}catch{throw new Le(`Malformed selector: ${r.name}=`+r.body)}const l={name:r.name,source:r.body,body:{parsed:_h(s),distance:i}},o=[...l.body.parsed.parts].reverse().find(u=>u.name==="internal:control"&&u.body==="enter-frame"),a=o?l.body.parsed.parts.indexOf(o):-1;a!==-1&&Ry(l.body.parsed.parts.slice(0,a+1),n.slice(0,a+1))&&l.body.parsed.parts.splice(0,a+1),n.push(l);continue}n.push({...r,source:r.body})}if(Ac.has(n[0].name))throw new Le(`"${n[0].name}" selector cannot be first`);return{capture:t.capture,parts:n}}function Ry(e,t){return Dn({parts:e})===Dn({parts:t})}function Dn(e,t){return typeof e=="string"?e:e.parts.map((n,r)=>{let s=!0;!t&&r!==e.capture&&(n.name==="css"||n.name==="xpath"&&n.source.startsWith("//")||n.source.startsWith(".."))&&(s=!1);const i=s?n.name+"=":"";return`${r===e.capture?"*":""}${i}${n.source}`}).join(" >> ")}function Dy(e){let t=0,n,r=0;const s={parts:[]},i=()=>{const o=e.substring(r,t).trim(),a=o.indexOf("=");let u,m;a!==-1&&o.substring(0,a).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(u=o.substring(0,a).trim(),m=o.substring(a+1)):o.length>1&&o[0]==='"'&&o[o.length-1]==='"'||o.length>1&&o[0]==="'"&&o[o.length-1]==="'"?(u="text",m=o):/^\(*\/\//.test(o)||o.startsWith("..")?(u="xpath",m=o):(u="css",m=o);let f=!1;if(u[0]==="*"&&(f=!0,u=u.substring(1)),s.parts.push({name:u,body:m}),f){if(s.capture!==void 0)throw new Le("Only one of the selectors can capture using * modifier");s.capture=s.parts.length-1}};if(!e.includes(">>"))return t=e.length,i(),s;const l=()=>{const a=e.substring(r,t).match(/^\s*text\s*=(.*)$/);return!!a&&!!a[1]};for(;t"&&e[t+1]===">"?(i(),t+=2,r=t):t++}return i(),s}function Hl(e,t){let n=0,r=e.length===0;const s=()=>e[n]||"",i=()=>{const v=s();return++n,r=n>=e.length,v},l=v=>{throw r?new Le(`Unexpected end of selector while parsing selector \`${e}\``):new Le(`Error while parsing selector \`${e}\` - unexpected symbol "${s()}" at position ${n}`+(v?" during "+v:""))};function o(){for(;!r&&/\s/.test(s());)i()}function a(v){return v>="€"||v>="0"&&v<="9"||v>="A"&&v<="Z"||v>="a"&&v<="z"||v>="0"&&v<="9"||v==="_"||v==="-"}function u(){let v="";for(o();!r&&a(s());)v+=i();return v}function m(v){let d=i();for(d!==v&&l("parsing quoted string");!r&&s()!==v;)s()==="\\"&&i(),d+=i();return s()!==v&&l("parsing quoted string"),d+=i(),d}function f(){i()!=="/"&&l("parsing regular expression");let v="",d=!1;for(;!r;){if(s()==="\\")v+=i(),r&&l("parsing regular expression");else if(d&&s()==="]")d=!1;else if(!d&&s()==="[")d=!0;else if(!d&&s()==="/")break;v+=i()}i()!=="/"&&l("parsing regular expression");let c="";for(;!r&&s().match(/[dgimsuy]/);)c+=i();try{return new RegExp(v,c)}catch(y){throw new Le(`Error while parsing selector \`${e}\`: ${y.message}`)}}function p(){let v="";return o(),s()==="'"||s()==='"'?v=m(s()).slice(1,-1):v=u(),v||l("parsing property path"),v}function g(){o();let v="";return r||(v+=i()),!r&&v!=="="&&(v+=i()),["=","*=","^=","$=","|=","~="].includes(v)||l("parsing operator"),v}function w(){i();const v=[];for(v.push(p()),o();s()===".";)i(),v.push(p()),o();if(s()==="]")return i(),{name:v.join("."),jsonPath:v,op:"",value:null,caseSensitive:!1};const d=g();let c,y=!0;if(o(),s()==="/"){if(d!=="=")throw new Le(`Error while parsing selector \`${e}\` - cannot use ${d} in attribute with regular expression`);c=f()}else if(s()==="'"||s()==='"')c=m(s()).slice(1,-1),o(),s()==="i"||s()==="I"?(y=!1,i()):(s()==="s"||s()==="S")&&(y=!0,i());else{for(c="";!r&&(a(s())||s()==="+"||s()===".");)c+=i();c==="true"?c=!0:c==="false"&&(c=!1)}if(o(),s()!=="]"&&l("parsing attribute value"),i(),d!=="="&&typeof c!="string")throw new Le(`Error while parsing selector \`${e}\` - cannot use ${d} in attribute with non-string matching value - ${c}`);return{name:v.join("."),jsonPath:v,op:d,value:c,caseSensitive:y}}const h={name:"",attributes:[]};for(h.name=u(),o();s()==="[";)h.attributes.push(w()),o();if(r||l(void 0),!h.name&&!h.attributes.length)throw new Le(`Error while parsing selector \`${e}\` - selector cannot be empty`);return h}function Lh(e,t,n=!1){return by(e,t,n)[0]}function by(e,t,n=!1,r=20,s){try{return xn(new Wy[e](s),_h(t),n,r)}catch{return[t]}}function xn(e,t,n=!1,r=20){const s=[...t.parts],i=[];let l=n?"frame-locator":"page";for(let o=0;oe.generateLocator(u,"has",h)));continue}if(a.name==="internal:has-not"){const w=xn(e,a.body.parsed,!1,r);i.push(w.map(h=>e.generateLocator(u,"hasNot",h)));continue}if(a.name==="internal:and"){const w=xn(e,a.body.parsed,!1,r);i.push(w.map(h=>e.generateLocator(u,"and",h)));continue}if(a.name==="internal:or"){const w=xn(e,a.body.parsed,!1,r);i.push(w.map(h=>e.generateLocator(u,"or",h)));continue}if(a.name==="internal:chain"){const w=xn(e,a.body.parsed,!1,r);i.push(w.map(h=>e.generateLocator(u,"chain",h)));continue}if(a.name==="internal:label"){const{exact:w,text:h}=Lr(a.body);i.push([e.generateLocator(u,"label",h,{exact:w})]);continue}if(a.name==="internal:role"){const w=Hl(a.body),h={attrs:[]};for(const v of w.attributes)v.name==="name"?(h.exact=v.caseSensitive,h.name=v.value):(v.name==="level"&&typeof v.value=="string"&&(v.value=+v.value),h.attrs.push({name:v.name==="include-hidden"?"includeHidden":v.name,value:v.value}));i.push([e.generateLocator(u,"role",w.name,h)]);continue}if(a.name==="internal:testid"){const w=Hl(a.body),{value:h}=w.attributes[0];i.push([e.generateLocator(u,"test-id",h)]);continue}if(a.name==="internal:attr"){const w=Hl(a.body),{name:h,value:v,caseSensitive:d}=w.attributes[0],c=v,y=!!d;if(h==="placeholder"){i.push([e.generateLocator(u,"placeholder",c,{exact:y})]);continue}if(h==="alt"){i.push([e.generateLocator(u,"alt",c,{exact:y})]);continue}if(h==="title"){i.push([e.generateLocator(u,"title",c,{exact:y})]);continue}}if(a.name==="internal:control"&&a.body==="enter-frame"){const w=i[i.length-1],h=s[o-1],v=w.map(d=>e.chainLocators([d,e.generateLocator(u,"frame","")]));["xpath","css"].includes(h.name)&&v.push(e.generateLocator(u,"frame-locator",Dn({parts:[h]})),e.generateLocator(u,"frame-locator",Dn({parts:[h]},!0))),w.splice(0,w.length,...v),l="frame-locator";continue}const m=s[o+1],f=Dn({parts:[a]}),p=e.generateLocator(u,"default",f);if(m&&["internal:has-text","internal:has-not-text"].includes(m.name)){const{exact:w,text:h}=Lr(m.body);if(!w){const v=e.generateLocator("locator",m.name==="internal:has-text"?"has-text":"has-not-text",h,{exact:w}),d={};m.name==="internal:has-text"?d.hasText=h:d.hasNotText=h;const c=e.generateLocator(u,"default",f,d);i.push([e.chainLocators([p,v]),c]),o++;continue}}let g;if(["xpath","css"].includes(a.name)){const w=Dn({parts:[a]},!0);g=e.generateLocator(u,"default",w)}i.push([p,g].filter(Boolean))}return By(e,i,r)}function By(e,t,n){const r=t.map(()=>""),s=[],i=l=>{if(l===t.length)return s.push(e.chainLocators(r)),r.lengthJSON.parse(r));for(let r=0;r{const n=B.useRef(null),[r,s]=B.useState(new Map);return B.useLayoutEffect(()=>{var i;t.find(l=>l.reveal)&&((i=n.current)==null||i.scrollIntoView({block:"center",inline:"nearest"}))},[n,t]),L.jsxs("div",{className:"call-log",style:{flex:"auto"},children:[t.map(i=>{const l=r.get(i.id),o=typeof l=="boolean"?l:i.status!=="done",a=i.params.selector?Lh(e,i.params.selector):null;let u=i.title,m="";return i.title.startsWith("expect.to")||i.title.startsWith("expect.not.to")?(u="expect(",m=`).${i.title.substring(7)}()`):i.title.startsWith("locator.")?(u="",m=`.${i.title.substring(8)}()`):(a||i.params.url)&&(u=i.title+"(",m=")"),L.jsxs("div",{className:on("call-log-call",i.status),children:[L.jsxs("div",{className:"call-log-call-header",children:[L.jsx("span",{className:on("codicon",`codicon-chevron-${o?"down":"right"}`),style:{cursor:"pointer"},onClick:()=>{const f=new Map(r);f.set(i.id,!o),s(f)}}),u,i.params.url?L.jsx("span",{className:"call-log-details",children:L.jsx("span",{className:"call-log-url",title:i.params.url,children:i.params.url})}):void 0,a?L.jsx("span",{className:"call-log-details",children:L.jsx("span",{className:"call-log-selector",title:`page.${a}`,children:`page.${a}`})}):void 0,m,L.jsx("span",{className:on("codicon",qy(i))}),typeof i.duration=="number"?L.jsxs("span",{className:"call-log-time",children:["— ",Kp(i.duration)]}):void 0]}),(o?i.messages:[]).map((f,p)=>L.jsx("div",{className:"call-log-message",children:f.trim()},p)),!!i.error&&L.jsx("div",{className:"call-log-message error",hidden:!o,children:i.error})]},i.id)}),L.jsx("div",{ref:n})]})};function qy(e){switch(e.status){case"done":return"codicon-check";case"in-progress":return"codicon-clock";case"paused":return"codicon-debug-pause";case"error":return"codicon-error"}}const Ga=Symbol.for("yaml.alias"),Jo=Symbol.for("yaml.document"),Ft=Symbol.for("yaml.map"),Oh=Symbol.for("yaml.pair"),ft=Symbol.for("yaml.scalar"),fr=Symbol.for("yaml.seq"),Ye=Symbol.for("yaml.node.type"),vn=e=>!!e&&typeof e=="object"&&e[Ye]===Ga,wn=e=>!!e&&typeof e=="object"&&e[Ye]===Jo,dr=e=>!!e&&typeof e=="object"&&e[Ye]===Ft,H=e=>!!e&&typeof e=="object"&&e[Ye]===Oh,z=e=>!!e&&typeof e=="object"&&e[Ye]===ft,hr=e=>!!e&&typeof e=="object"&&e[Ye]===fr;function Q(e){if(e&&typeof e=="object")switch(e[Ye]){case Ft:case fr:return!0}return!1}function J(e){if(e&&typeof e=="object")switch(e[Ye]){case Ga:case Ft:case ft:case fr:return!0}return!1}const Qy=e=>(z(e)||Q(e))&&!!e.anchor,Oe=Symbol("break visit"),$h=Symbol("skip children"),ct=Symbol("remove node");function Vt(e,t){const n=Ih(t);wn(e)?bn(null,e.contents,n,Object.freeze([e]))===ct&&(e.contents=null):bn(null,e,n,Object.freeze([]))}Vt.BREAK=Oe;Vt.SKIP=$h;Vt.REMOVE=ct;function bn(e,t,n,r){const s=Ah(e,t,n,r);if(J(s)||H(s))return Ph(e,r,s),bn(e,s,n,r);if(typeof s!="symbol"){if(Q(t)){r=Object.freeze(r.concat(t));for(let i=0;ie.replace(/[!,[\]{}]/g,t=>Yy[t]);class Ee{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ee.defaultYaml,t),this.tags=Object.assign({},Ee.defaultTags,n)}clone(){const t=new Ee(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Ee(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ee.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ee.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Ee.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ee.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,l]=r;return this.tags[i]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const l=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,l),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(l){return n(String(l)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+Jy(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&J(t.contents)){const i={};Vt(t.contents,(l,o)=>{J(o)&&o.tag&&(i[o.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,l]of r)i==="!!"&&l==="tag:yaml.org,2002:"||(!t||s.some(o=>o.startsWith(l)))&&n.push(`%TAG ${i} ${l}`);return n.join(` +`)}}Ee.defaultYaml={explicit:!1,version:"1.2"};Ee.defaultTags={"!!":"tag:yaml.org,2002:"};function jh(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Mh(e){const t=new Set;return Vt(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function Rh(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Gy(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s||(s=Mh(e));const l=Rh(t,s);return s.add(l),l},setAnchors:()=>{for(const i of n){const l=r.get(i);if(typeof l=="object"&&l.anchor&&(z(l.node)||Q(l.node)))l.node.anchor=l.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=i,o}}},sourceObjects:r}}function Fn(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;sHe(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!Qy(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Xa{constructor(t){Object.defineProperty(this,Ye,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!wn(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},o=He(this,"",l);if(typeof s=="function")for(const{count:a,res:u}of l.anchors.values())s(u,a);return typeof i=="function"?Fn(i,{"":o},"",o):o}}class il extends Xa{constructor(t){super(Ga),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let n;return Vt(t,{Node:(r,s)=>{if(s===this)return Vt.BREAK;s.anchor===this.source&&(n=s)}}),n}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,l=this.resolve(s);if(!l){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let o=r.get(l);if(o||(He(l,null,n),o=r.get(l)),!o||o.res===void 0){const a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=oi(s,l,r)),o.count*o.aliasCount>i)){const a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return o.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(jh(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function oi(e,t,n){if(vn(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(Q(t)){let r=0;for(const s of t.items){const i=oi(e,s,n);i>r&&(r=i)}return r}else if(H(t)){const r=oi(e,t.key,n),s=oi(e,t.value,n);return Math.max(r,s)}return 1}const Dh=e=>!e||typeof e!="function"&&typeof e!="object";class P extends Xa{constructor(t){super(ft),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:He(this.value,t,n)}toString(){return String(this.value)}}P.BLOCK_FOLDED="BLOCK_FOLDED";P.BLOCK_LITERAL="BLOCK_LITERAL";P.PLAIN="PLAIN";P.QUOTE_DOUBLE="QUOTE_DOUBLE";P.QUOTE_SINGLE="QUOTE_SINGLE";const Xy="tag:yaml.org,2002:";function Zy(e,t,n){if(t){const r=n.filter(i=>i.tag===t),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>{var s;return((s=r.identify)==null?void 0:s.call(r,e))&&!r.format})}function as(e,t,n){var f,p,g;if(wn(e)&&(e=e.contents),J(e))return e;if(H(e)){const w=(p=(f=n.schema[Ft]).createNode)==null?void 0:p.call(f,n.schema,null,n);return w.items.push(e),w}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:l,sourceObjects:o}=n;let a;if(r&&e&&typeof e=="object"){if(a=o.get(e),a)return a.anchor||(a.anchor=s(e)),new il(a.anchor);a={anchor:null,node:null},o.set(e,a)}t!=null&&t.startsWith("!!")&&(t=Xy+t.slice(2));let u=Zy(e,t,l.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const w=new P(e);return a&&(a.node=w),w}u=e instanceof Map?l[Ft]:Symbol.iterator in Object(e)?l[fr]:l[Ft]}i&&(i(u),delete n.onTagObj);const m=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((g=u==null?void 0:u.nodeClass)==null?void 0:g.from)=="function"?u.nodeClass.from(n.schema,e,n):new P(e);return t?m.tag=t:u.default||(m.tag=u.tag),a&&(a.node=m),m}function Ri(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const l=[];l[i]=r,r=l}else r=new Map([[i,r]])}return as(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const jr=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class bh extends Xa{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>J(r)||H(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(jr(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(Q(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Ri(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(Q(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&z(i)?i.value:i:Q(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!H(n))return!1;const r=n.value;return r==null||t&&z(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return Q(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(Q(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Ri(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const e0=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function yt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const rn=(e,t,n)=>e.endsWith(` +`)?yt(n,t):n.includes(` +`)?` +`+yt(n,t):(e.endsWith(" ")?"":" ")+n,Bh="flow",Go="block",ai="quoted";function ll(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:l,onOverflow:o}={}){if(!s||s<0)return e;ss-Math.max(2,i)?u.push(0):f=s-r);let p,g,w=!1,h=-1,v=-1,d=-1;n===Go&&(h=Pc(e,h,t.length),h!==-1&&(f=h+a));for(let y;y=e[h+=1];){if(n===ai&&y==="\\"){switch(v=h,e[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}d=h}if(y===` +`)n===Go&&(h=Pc(e,h,t.length)),f=h+t.length+a,p=void 0;else{if(y===" "&&g&&g!==" "&&g!==` +`&&g!==" "){const S=e[h+1];S&&S!==" "&&S!==` +`&&S!==" "&&(p=h)}if(h>=f)if(p)u.push(p),f=p+a,p=void 0;else if(n===ai){for(;g===" "||g===" ";)g=y,y=e[h+=1],w=!0;const S=h>d+1?h-2:v-1;if(m[S])return e;u.push(S),m[S]=!0,f=S+a,p=void 0}else w=!0}g=y}if(w&&o&&o(),u.length===0)return e;l&&l();let c=e.slice(0,u[0]);for(let y=0;y({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),al=e=>/^(%|---|\.\.\.)/m.test(e);function t0(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,l=0;ir)return!0;if(l=i+1,s-l<=r)return!1}return!0}function Kr(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(al(e)?" ":"");let l="",o=0;for(let a=0,u=n[a];u;u=n[++a])if(u===" "&&n[a+1]==="\\"&&n[a+2]==="n"&&(l+=n.slice(o,a)+"\\ ",a+=1,o=a,u="\\"),u==="\\")switch(n[a+1]){case"u":{l+=n.slice(o,a);const m=n.substr(a+2,4);switch(m){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:m.substr(0,2)==="00"?l+="\\x"+m.substr(2):l+=n.substr(a,6)}a+=5,o=a+1}break;case"n":if(r||n[a+2]==='"'||n.length +`;let f,p;for(p=n.length;p>0;--p){const E=n[p-1];if(E!==` +`&&E!==" "&&E!==" ")break}let g=n.substring(p);const w=g.indexOf(` +`);w===-1?f="-":n===g||w!==g.length-1?(f="+",i&&i()):f="",g&&(n=n.slice(0,-g.length),g[g.length-1]===` +`&&(g=g.slice(0,-1)),g=g.replace(Zo,`$&${u}`));let h=!1,v,d=-1;for(v=0;v")+(h?u?"2":"1":"")+f;if(e&&(S+=" "+o(e.replace(/ ?[\r\n]+/g," ")),s&&s()),m)return n=n.replace(/\n+/g,`$&${u}`),`${S} +${u}${c}${n}${g}`;n=n.replace(/\n+/g,` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);const x=ll(`${c}${n}${g}`,u,Go,ol(r,!0));return`${S} +${u}${x}`}function n0(e,t,n,r){const{type:s,value:i}=e,{actualString:l,implicitKey:o,indent:a,indentStep:u,inFlow:m}=t;if(o&&i.includes(` +`)||m&&/[[\]{},]/.test(i))return zn(i,t);if(!i||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return o||m||!i.includes(` +`)?zn(i,t):ui(e,t,n,r);if(!o&&!m&&s!==P.PLAIN&&i.includes(` +`))return ui(e,t,n,r);if(al(i)){if(a==="")return t.forceBlockIndent=!0,ui(e,t,n,r);if(o&&a===u)return zn(i,t)}const f=i.replace(/\n+/g,`$& +${a}`);if(l){const p=h=>{var v;return h.default&&h.tag!=="tag:yaml.org,2002:str"&&((v=h.test)==null?void 0:v.test(f))},{compat:g,tags:w}=t.doc.schema;if(w.some(p)||g!=null&&g.some(p))return zn(i,t)}return o?f:ll(f,a,Bh,ol(t,!1))}function ys(e,t,n,r){const{implicitKey:s,inFlow:i}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;o!==P.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(o=P.QUOTE_DOUBLE);const a=m=>{switch(m){case P.BLOCK_FOLDED:case P.BLOCK_LITERAL:return s||i?zn(l.value,t):ui(l,t,n,r);case P.QUOTE_DOUBLE:return Kr(l.value,t);case P.QUOTE_SINGLE:return Xo(l.value,t);case P.PLAIN:return n0(l,t,n,r);default:return null}};let u=a(o);if(u===null){const{defaultKeyType:m,defaultStringType:f}=t.options,p=s&&m||f;if(u=a(p),u===null)throw new Error(`Unsupported default string type ${p}`)}return u}function Fh(e,t){const n=Object.assign({blockQuote:!0,commentString:e0,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function r0(e,t){var s;if(t.tag){const i=e.filter(l=>l.tag===t.tag);if(i.length>0)return i.find(l=>l.format===t.format)??i[0]}let n,r;if(z(t)){r=t.value;let i=e.filter(l=>{var o;return(o=l.identify)==null?void 0:o.call(l,r)});if(i.length>1){const l=i.filter(o=>o.test);l.length>0&&(i=l)}n=i.find(l=>l.format===t.format)??i.find(l=>!l.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=((s=r==null?void 0:r.constructor)==null?void 0:s.name)??typeof r;throw new Error(`Tag not resolved for ${i} value`)}return n}function s0(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(z(e)||Q(e))&&e.anchor;i&&jh(i)&&(n.add(i),s.push(`&${i}`));const l=e.tag?e.tag:t.default?null:t.tag;return l&&s.push(r.directives.tagString(l)),s.join(" ")}function sr(e,t,n,r){var a;if(H(e))return e.toString(t,n,r);if(vn(e)){if(t.doc.directives)return e.toString(t);if((a=t.resolvedAliases)!=null&&a.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=J(e)?e:t.doc.createNode(e,{onTagObj:u=>s=u});s||(s=r0(t.doc.schema.tags,i));const l=s0(i,s,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const o=typeof s.stringify=="function"?s.stringify(i,t,n,r):z(i)?ys(i,t,n,r):i.toString(t,n,r);return l?z(i)||o[0]==="{"||o[0]==="["?`${l} ${o}`:`${l} +${t.indent}${o}`:o}function i0({key:e,value:t},n,r,s){const{allNullValues:i,doc:l,indent:o,indentStep:a,options:{commentString:u,indentSeq:m,simpleKeys:f}}=n;let p=J(e)&&e.comment||null;if(f){if(p)throw new Error("With simple keys, key nodes cannot have comments");if(Q(e)||!J(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let g=!f&&(!e||p&&t==null&&!n.inFlow||Q(e)||(z(e)?e.type===P.BLOCK_FOLDED||e.type===P.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!g&&(f||!i),indent:o+a});let w=!1,h=!1,v=sr(e,n,()=>w=!0,()=>h=!0);if(!g&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(n.inFlow){if(i||t==null)return w&&r&&r(),v===""?"?":g?`? ${v}`:v}else if(i&&!f||t==null&&g)return v=`? ${v}`,p&&!w?v+=rn(v,n.indent,u(p)):h&&s&&s(),v;w&&(p=null),g?(p&&(v+=rn(v,n.indent,u(p))),v=`? ${v} +${o}:`):(v=`${v}:`,p&&(v+=rn(v,n.indent,u(p))));let d,c,y;J(t)?(d=!!t.spaceBefore,c=t.commentBefore,y=t.comment):(d=!1,c=null,y=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!g&&!p&&z(t)&&(n.indentAtStart=v.length+1),h=!1,!m&&a.length>=2&&!n.inFlow&&!g&&hr(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let S=!1;const x=sr(t,n,()=>S=!0,()=>h=!0);let E=" ";if(p||d||c){if(E=d?` +`:"",c){const T=u(c);E+=` +${yt(T,n.indent)}`}x===""&&!n.inFlow?E===` +`&&(E=` + +`):E+=` +${n.indent}`}else if(!g&&Q(t)){const T=x[0],N=x.indexOf(` +`),k=N!==-1,I=n.inFlow??t.flow??t.items.length===0;if(k||!I){let M=!1;if(k&&(T==="&"||T==="!")){let C=x.indexOf(" ");T==="&"&&C!==-1&&Ce===Bs||typeof e=="symbol"&&e.description===Bs,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new P(Symbol(Bs)),{addToJSMap:Uh}),stringify:()=>Bs},l0=(e,t)=>(wt.identify(t)||z(t)&&(!t.type||t.type===P.PLAIN)&&wt.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===wt.tag&&n.default));function Uh(e,t,n){if(n=e&&vn(n)?n.resolve(e.doc):n,hr(n))for(const r of n.items)ql(e,t,r);else if(Array.isArray(n))for(const r of n)ql(e,t,r);else ql(e,t,n)}function ql(e,t,n){const r=e&&vn(n)?n.resolve(e.doc):n;if(!dr(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,l]of s)t instanceof Map?t.has(i)||t.set(i,l):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function Vh(e,t,{key:n,value:r}){if(J(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(l0(e,n))Uh(e,t,r);else{const s=He(n,"",e);if(t instanceof Map)t.set(s,He(r,s,e));else if(t instanceof Set)t.add(s);else{const i=o0(n,s,e),l=He(r,i,e);i in t?Object.defineProperty(t,i,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[i]=l}}return t}function o0(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(J(e)&&(n!=null&&n.doc)){const r=Fh(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),zh(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function Za(e,t,n){const r=as(e,void 0,n),s=as(t,void 0,n);return new we(r,s)}class we{constructor(t,n=null){Object.defineProperty(this,Ye,{value:Oh}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return J(n)&&(n=n.clone(t)),J(r)&&(r=r.clone(t)),new we(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return Vh(n,r,this)}toString(t,n,r){return t!=null&&t.doc?i0(this,t,n,r):JSON.stringify(this)}}function Kh(e,t,n){return(t.inFlow??e.flow?u0:a0)(e,t,n)}function a0({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:l,onComment:o}){const{indent:a,options:{commentString:u}}=n,m=Object.assign({},n,{indent:i,type:null});let f=!1;const p=[];for(let w=0;wv=null,()=>f=!0);v&&(d+=rn(d,i,u(v))),f&&v&&(f=!1),p.push(r+d)}let g;if(p.length===0)g=s.start+s.end;else{g=p[0];for(let w=1;wv=null);wm||d.includes(` +`))&&(u=!0),f.push(d),m=f.length}const{start:p,end:g}=n;if(f.length===0)return p+g;if(!u){const w=f.reduce((h,v)=>h+v.length+2,2);u=t.options.lineWidth>0&&w>t.options.lineWidth}if(u){let w=p;for(const h of f)w+=h?` +${i}${s}${h}`:` +`;return`${w} +${s}${g}`}else return`${p}${l}${f.join(" ")}${l}${g}`}function Di({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=yt(t(r),e);n.push(i.trimStart())}}function sn(e,t){const n=z(t)?t.value:t;for(const r of e)if(H(r)&&(r.key===t||r.key===n||z(r.key)&&r.key.value===n))return r}class Re extends bh{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ft,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,l=new this(t),o=(a,u)=>{if(typeof i=="function")u=i.call(n,a,u);else if(Array.isArray(i)&&!i.includes(a))return;(u!==void 0||s)&&l.items.push(Za(a,u,r))};if(n instanceof Map)for(const[a,u]of n)o(a,u);else if(n&&typeof n=="object")for(const a of Object.keys(n))o(a,n[a]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){var l;let r;H(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new we(t,t==null?void 0:t.value):r=new we(t.key,t.value);const s=sn(this.items,r.key),i=(l=this.schema)==null?void 0:l.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);z(s.value)&&Dh(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=sn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=sn(this.items,t),s=r==null?void 0:r.value;return(!n&&z(s)?s.value:s)??void 0}has(t){return!!sn(this.items,t)}set(t,n){this.add(new we(t,n),!0)}toJSON(t,n,r){const s=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items)Vh(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!H(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Kh(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const pr={collection:"map",default:!0,nodeClass:Re,tag:"tag:yaml.org,2002:map",resolve(e,t){return dr(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Re.from(e,t,n)};class Kt extends bh{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(fr,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Fs(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Fs(t);if(typeof r!="number")return;const s=this.items[r];return!n&&z(s)?s.value:s}has(t){const n=Fs(t);return typeof n=="number"&&n=0?t:null}const mr={collection:"seq",default:!0,nodeClass:Kt,tag:"tag:yaml.org,2002:seq",resolve(e,t){return hr(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Kt.from(e,t,n)},ul={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),ys(e,t,n,r)}},cl={identify:e=>e==null,createNode:()=>new P(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new P(null),stringify:({source:e},t)=>typeof e=="string"&&cl.test.test(e)?e:t.options.nullStr},eu={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new P(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&eu.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function st({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let l=i.indexOf(".");l<0&&(l=i.length,i+=".");let o=t-(i.length-l-1);for(;o-- >0;)i+="0"}return i}const Wh={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:st},Hh={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():st(e)}},qh={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new P(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:st},fl=e=>typeof e=="bigint"||Number.isInteger(e),tu=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Qh(e,t,n){const{value:r}=e;return fl(r)&&r>=0?n+r.toString(t):st(e)}const Yh={identify:e=>fl(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>tu(e,2,8,n),stringify:e=>Qh(e,8,"0o")},Jh={identify:fl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>tu(e,0,10,n),stringify:st},Gh={identify:e=>fl(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>tu(e,2,16,n),stringify:e=>Qh(e,16,"0x")},c0=[pr,mr,ul,cl,eu,Yh,Jh,Gh,Wh,Hh,qh];function jc(e){return typeof e=="bigint"||Number.isInteger(e)}const zs=({value:e})=>JSON.stringify(e),f0=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:zs},{identify:e=>e==null,createNode:()=>new P(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:zs},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>e==="true",stringify:zs},{identify:jc,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>jc(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:zs}],d0={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},h0=[pr,mr].concat(f0,d0),nu={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Buffer=="function")return Buffer.from(e,"base64");if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new we(new P(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore} +${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment} +${i.comment}`:r.comment}r=s}e.items[n]=H(r)?r:new we(r)}}else t("Expected a sequence for this tag");return e}function Zh(e,t,n){const{replacer:r}=n,s=new Kt(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(i++),l));let o,a;if(Array.isArray(l))if(l.length===2)o=l[0],a=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const u=Object.keys(l);if(u.length===1)o=u[0],a=l[o];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else o=l;s.items.push(Za(o,a,n))}return s}const ru={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Xh,createNode:Zh};class Yn extends Kt{constructor(){super(),this.add=Re.prototype.add.bind(this),this.delete=Re.prototype.delete.bind(this),this.get=Re.prototype.get.bind(this),this.has=Re.prototype.has.bind(this),this.set=Re.prototype.set.bind(this),this.tag=Yn.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items){let i,l;if(H(s)?(i=He(s.key,"",n),l=He(s.value,i,n)):i=He(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,l)}return r}static from(t,n,r){const s=Zh(t,n,r),i=new this;return i.items=s.items,i}}Yn.tag="tag:yaml.org,2002:omap";const su={collection:"seq",identify:e=>e instanceof Map,nodeClass:Yn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Xh(e,t),r=[];for(const{key:s}of n.items)z(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new Yn,n)},createNode:(e,t,n)=>Yn.from(e,t,n)};function ep({value:e,source:t},n){return t&&(e?tp:np).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const tp={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new P(!0),stringify:ep},np={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new P(!1),stringify:ep},p0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:st},m0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():st(e)}},g0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new P(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:st},vs=e=>typeof e=="bigint"||Number.isInteger(e);function dl(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const l=BigInt(e);return s==="-"?BigInt(-1)*l:l}const i=parseInt(e,n);return s==="-"?-1*i:i}function iu(e,t,n){const{value:r}=e;if(vs(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return st(e)}const y0={identify:vs,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>dl(e,2,2,n),stringify:e=>iu(e,2,"0b")},v0={identify:vs,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>dl(e,1,8,n),stringify:e=>iu(e,8,"0")},w0={identify:vs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>dl(e,0,10,n),stringify:st},S0={identify:vs,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>dl(e,2,16,n),stringify:e=>iu(e,16,"0x")};class Jn extends Re{constructor(t){super(t),this.tag=Jn.tag}add(t){let n;H(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new we(t.key,null):n=new we(t,null),sn(this.items,n.key)||this.items.push(n)}get(t,n){const r=sn(this.items,t);return!n&&H(r)?z(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=sn(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new we(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof s=="function"&&(l=s.call(n,l,l)),i.items.push(Za(l,null,r));return i}}Jn.tag="tag:yaml.org,2002:set";const lu={collection:"map",identify:e=>e instanceof Set,nodeClass:Jn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Jn.from(e,t,n),resolve(e,t){if(dr(e)){if(e.hasAllNullValues(!0))return Object.assign(new Jn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ou(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=l=>t?BigInt(l):Number(l),i=r.replace(/_/g,"").split(":").reduce((l,o)=>l*s(60)+s(o),s(0));return n==="-"?s(-1)*i:i}function rp(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return st(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const sp={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>ou(e,n),stringify:rp},ip={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ou(e,!1),stringify:rp},hl={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(hl.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,l,o]=t.map(Number),a=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,s,i||0,l||0,o||0,a);const m=t[8];if(m&&m!=="Z"){let f=ou(m,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Mc=[pr,mr,ul,cl,tp,np,y0,v0,w0,S0,p0,m0,g0,nu,wt,su,ru,lu,sp,ip,hl],Rc=new Map([["core",c0],["failsafe",[pr,mr,ul]],["json",h0],["yaml11",Mc],["yaml-1.1",Mc]]),Dc={binary:nu,bool:eu,float:qh,floatExp:Hh,floatNaN:Wh,floatTime:ip,int:Jh,intHex:Gh,intOct:Yh,intTime:sp,map:pr,merge:wt,null:cl,omap:su,pairs:ru,seq:mr,set:lu,timestamp:hl},k0={"tag:yaml.org,2002:binary":nu,"tag:yaml.org,2002:merge":wt,"tag:yaml.org,2002:omap":su,"tag:yaml.org,2002:pairs":ru,"tag:yaml.org,2002:set":lu,"tag:yaml.org,2002:timestamp":hl};function Ql(e,t,n){const r=Rc.get(t);if(r&&!e)return n&&!r.includes(wt)?r.concat(wt):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(Rc.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(wt)),s.reduce((i,l)=>{const o=typeof l=="string"?Dc[l]:l;if(!o){const a=JSON.stringify(l),u=Object.keys(Dc).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${u}`)}return i.includes(o)||i.push(o),i},[])}const E0=(e,t)=>e.keyt.key?1:0;class pl{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:l,toStringDefaults:o}){this.compat=Array.isArray(t)?Ql(t,"compat"):t?Ql(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?k0:{},this.tags=Ql(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,Ft,{value:pr}),Object.defineProperty(this,ft,{value:ul}),Object.defineProperty(this,fr,{value:mr}),this.sortMapEntries=typeof l=="function"?l:l===!0?E0:null}clone(){const t=Object.create(pl.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function N0(e,t){var a;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=Fh(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(yt(u,""))}let l=!1,o=null;if(e.contents){if(J(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=i(e.contents.commentBefore);n.push(yt(f,""))}s.forceBlockIndent=!!e.comment,o=e.contents.comment}const u=o?void 0:()=>l=!0;let m=sr(e.contents,s,()=>o=null,u);o&&(m+=rn(m,"",i(o))),(m[0]==="|"||m[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${m}`:n.push(m)}else n.push(sr(e.contents,s));if((a=e.directives)!=null&&a.docEnd)if(e.comment){const u=i(e.comment);u.includes(` +`)?(n.push("..."),n.push(yt(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&l&&(u=u.replace(/^\n+/,"")),u&&((!l||o)&&n[n.length-1]!==""&&n.push(""),n.push(yt(i(u),"")))}return n.join(` +`)+` +`}class gr{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ye,{value:Jo});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:l}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new Ee({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(gr.prototype,{[Ye]:{value:Jo}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=J(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){kn(this.contents)&&this.contents.add(t)}addIn(t,n){kn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=Mh(this);t.anchor=!n||r.has(n)?Rh(n||"a",r):n}return new il(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const v=c=>typeof c=="number"||c instanceof String||c instanceof Number,d=n.filter(v).map(String);d.length>0&&(n=n.concat(d)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:l,flow:o,keepUndefined:a,onTagObj:u,tag:m}=r??{},{onAnchor:f,setAnchors:p,sourceObjects:g}=Gy(this,l||"a"),w={aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:f,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:g},h=as(t,m,w);return o&&Q(h)&&(h.flow=!0),p(),h}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new we(s,i)}delete(t){return kn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return jr(t)?this.contents==null?!1:(this.contents=null,!0):kn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Q(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return jr(t)?!n&&z(this.contents)?this.contents.value:this.contents:Q(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Q(this.contents)?this.contents.has(t):!1}hasIn(t){return jr(t)?this.contents!==void 0:Q(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Ri(this.schema,[t],n):kn(this.contents)&&this.contents.set(t,n)}setIn(t,n){jr(t)?this.contents=n:this.contents==null?this.contents=Ri(this.schema,Array.from(t),n):kn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ee({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Ee({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new pl(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:l}={}){const o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=He(this.contents,n??"",o);if(typeof i=="function")for(const{count:u,res:m}of o.anchors.values())i(m,u);return typeof l=="function"?Fn(l,{"":a},"",a):a}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return N0(this,t)}}function kn(e){if(Q(e))return!0;throw new Error("Expected a YAML collection as document contents")}class au extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class ln extends au{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class lp extends au{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const bi=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&l.length>80){const o=Math.min(i-39,l.length-79);l="…"+l.substring(o),i-=o-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,i))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`… +`),l=o+l}if(/[^ ]/.test(l)){let o=1;const a=n.linePos[1];a&&a.line===r&&a.col>s&&(o=Math.max(1,Math.min(a.col-s,80-i)));const u=" ".repeat(i)+"^".repeat(o);n.message+=`: + +${l} +${u} +`}};function ir(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:l,startOnNewline:o}){let a=!1,u=o,m=o,f="",p="",g=!1,w=!1,h=null,v=null,d=null,c=null,y=null,S=null,x=null;for(const N of e)switch(w&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&i(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),h&&(u&&N.type!=="comment"&&N.type!=="newline"&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),N.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&N.source.includes(" ")&&(h=N),m=!0;break;case"comment":{m||i(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const k=N.source.substring(1)||" ";f?f+=p+k:f=k,p="",u=!1;break}case"newline":u?f?f+=N.source:a=!0:p+=N.source,u=!0,g=!0,(v||d)&&(c=N),m=!0;break;case"anchor":v&&i(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&i(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=N,x===null&&(x=N.offset),u=!1,m=!1,w=!0;break;case"tag":{d&&i(N,"MULTIPLE_TAGS","A node can have at most one tag"),d=N,x===null&&(x=N.offset),u=!1,m=!1,w=!0;break}case n:(v||d)&&i(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),S&&i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${t??"collection"}`),S=N,u=n==="seq-item-ind"||n==="explicit-key-ind",m=!1;break;case"comma":if(t){y&&i(N,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),y=N,u=!1,m=!1;break}default:i(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),u=!1,m=!1}const E=e[e.length-1],T=E?E.offset+E.source.length:s;return w&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(u&&h.indent<=l||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&i(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:y,found:S,spaceBefore:a,comment:f,hasNewline:g,anchor:v,tag:d,newlineAfterProp:c,end:T,start:x??T}}function us(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` +`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(us(t.key)||us(t.value))return!0}return!1;default:return!0}}function ea(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&us(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function op(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,l)=>i===l||z(i)&&z(l)&&i.value===l.value;return t.some(i=>s(i.key,n))}const bc="All mapping items must start at the same column";function x0({composeNode:e,composeEmptyNode:t},n,r,s,i){var m;const l=(i==null?void 0:i.nodeClass)??Re,o=new l(n.schema);n.atRoot&&(n.atRoot=!1);let a=r.offset,u=null;for(const f of r.items){const{start:p,key:g,sep:w,value:h}=f,v=ir(p,{indicator:"explicit-key-ind",next:g??(w==null?void 0:w[0]),offset:a,onError:s,parentIndent:r.indent,startOnNewline:!0}),d=!v.found;if(d){if(g&&(g.type==="block-seq"?s(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==r.indent&&s(a,"BAD_INDENT",bc)),!v.anchor&&!v.tag&&!w){u=v.end,v.comment&&(o.comment?o.comment+=` +`+v.comment:o.comment=v.comment);continue}(v.newlineAfterProp||us(g))&&s(g??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((m=v.found)==null?void 0:m.indent)!==r.indent&&s(a,"BAD_INDENT",bc);n.atKey=!0;const c=v.end,y=g?e(n,g,v,s):t(n,c,p,null,v,s);n.schema.compat&&ea(r.indent,g,s),n.atKey=!1,op(n,o.items,y)&&s(c,"DUPLICATE_KEY","Map keys must be unique");const S=ir(w??[],{indicator:"map-value-ind",next:h,offset:y.range[2],onError:s,parentIndent:r.indent,startOnNewline:!g||g.type==="block-scalar"});if(a=S.end,S.found){d&&((h==null?void 0:h.type)==="block-map"&&!S.hasNewline&&s(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function C0({composeNode:e,composeEmptyNode:t},n,r,s,i){const l=r.start.source==="{",o=l?"flow map":"flow sequence",a=(i==null?void 0:i.nodeClass)??(l?Re:Kt),u=new a(n.schema);u.flow=!0;const m=n.atRoot;m&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let v=0;v0){const v=ws(w,h,n.options.strict,s);v.comment&&(u.comment?u.comment+=` +`+v.comment:u.comment=v.comment),u.range=[r.offset,h,v.offset]}else u.range=[r.offset,h,h];return u}function Gl(e,t,n,r,s,i){const l=n.type==="block-map"?x0(e,t,n,r,i):n.type==="block-seq"?T0(e,t,n,r,i):C0(e,t,n,r,i),o=l.constructor;return s==="!"||s===o.tagName?(l.tag=o.tagName,l):(s&&(l.tag=s),l)}function _0(e,t,n,r,s){var p;const i=r.tag,l=i?t.directives.tagName(i.source,g=>s(i,"TAG_RESOLVE_FAILED",g)):null;if(n.type==="block-seq"){const{anchor:g,newlineAfterProp:w}=r,h=g&&i?g.offset>i.offset?g:i:g??i;h&&(!w||w.offsetg.tag===l&&g.collection===o);if(!a){const g=t.schema.knownTags[l];if(g&&g.collection===o)t.schema.tags.push(Object.assign({},g,{default:!1})),a=g;else return g!=null&&g.collection?s(i,"BAD_COLLECTION_TYPE",`${g.tag} used for ${o} collection, but expects ${g.collection}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Gl(e,t,n,s,l)}const u=Gl(e,t,n,s,l,a),m=((p=a.resolve)==null?void 0:p.call(a,u,g=>s(i,"TAG_RESOLVE_FAILED",g),t.options))??u,f=J(m)?m:new P(m);return f.range=u.range,f.tag=l,a!=null&&a.format&&(f.format=a.format),f}function ap(e,t,n){const r=t.offset,s=L0(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?P.BLOCK_FOLDED:P.BLOCK_LITERAL,l=t.source?O0(t.source):[];let o=l.length;for(let h=l.length-1;h>=0;--h){const v=l[h][1];if(v===""||v==="\r")o=h;else break}if(o===0){const h=s.chomp==="+"&&l.length>0?` +`.repeat(Math.max(1,l.length-1)):"";let v=r+s.length;return t.source&&(v+=t.source.length),{value:h,type:i,comment:s.comment,range:[r,v,v]}}let a=t.indent+s.indent,u=t.offset+s.length,m=0;for(let h=0;ha&&(a=v.length);else{v.length=o;--h)l[h][0].length>a&&(o=h+1);let f="",p="",g=!1;for(let h=0;ha||d[0]===" "?(p===" "?p=` +`:!g&&p===` +`&&(p=` + +`),f+=p+v.slice(a)+d,p=` +`,g=!0):d===""?p===` +`?f+=` +`:p=` +`:(f+=p+d,p=" ",g=!1)}switch(s.chomp){case"-":break;case"+":for(let h=o;hn(r+p,g,w);switch(s){case"scalar":o=P.PLAIN,a=$0(i,u);break;case"single-quoted-scalar":o=P.QUOTE_SINGLE,a=I0(i,u);break;case"double-quoted-scalar":o=P.QUOTE_DOUBLE,a=A0(i,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const m=r+i.length,f=ws(l,m,t,n);return{value:a,type:o,comment:f.comment,range:[r,m,f.offset]}}function $0(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),cp(e)}function I0(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),cp(e.slice(1,-1)).replace(/''/g,"'")}function cp(e){let t,n;try{t=new RegExp(`(.*?)(?i?e.slice(i,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function P0(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===` +`||r==="\r")&&!(r==="\r"&&e[t+2]!==` +`);)r===` +`&&(n+=` +`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const j0={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` +`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function M0(e,t,n,r){const s=e.substr(t,n),l=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(l)){const o=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(l)}function fp(e,t,n,r){const{value:s,type:i,comment:l,range:o}=t.type==="block-scalar"?ap(e,t,r):up(t,e.options.strict,r),a=n?e.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[ft]:a?u=R0(e.schema,s,a,n,r):t.type==="scalar"?u=D0(e,s,t,r):u=e.schema[ft];let m;try{const f=u.resolve(s,p=>r(n??t,"TAG_RESOLVE_FAILED",p),e.options);m=z(f)?f:new P(f)}catch(f){const p=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",p),m=new P(s)}return m.range=o,m.source=s,i&&(m.type=i),a&&(m.tag=a),u.format&&(m.format=u.format),l&&(m.comment=l),m}function R0(e,t,n,r,s){var o;if(n==="!")return e[ft];const i=[];for(const a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(const a of i)if((o=a.test)!=null&&o.test(t))return a;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[ft])}function D0({atKey:e,directives:t,schema:n},r,s,i){const l=n.tags.find(o=>{var a;return(o.default===!0||e&&o.default==="key")&&((a=o.test)==null?void 0:a.test(r))})||n[ft];if(n.compat){const o=n.compat.find(a=>{var u;return a.default&&((u=a.test)==null?void 0:u.test(r))})??n[ft];if(l.tag!==o.tag){const a=t.tagString(l.tag),u=t.tagString(o.tag),m=`Value may be parsed as either ${a} or ${u}`;i(s,"TAG_RESOLVE_FAILED",m,!0)}}return l}function b0(e,t,n){if(t){n===null&&(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];(s==null?void 0:s.type)==="space";)e+=s.source.length,s=t[++r];break}}return e}const B0={composeNode:dp,composeEmptyNode:uu};function dp(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:l,anchor:o,tag:a}=n;let u,m=!0;switch(t.type){case"alias":u=F0(e,t,r),(o||a)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=fp(e,t,a,r),o&&(u.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":u=_0(B0,e,t,n,r),o&&(u.anchor=o.source.substring(1));break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f),u=uu(e,t.offset,void 0,null,n,r),m=!1}}return o&&u.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!z(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(a??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(u.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?u.comment=l:u.commentBefore=l),e.options.keepSourceTokens&&m&&(u.srcToken=t),u}function uu(e,t,n,r,{spaceBefore:s,comment:i,anchor:l,tag:o,end:a},u){const m={type:"scalar",offset:b0(t,n,r),indent:-1,source:""},f=fp(e,m,o,u);return l&&(f.anchor=l.source.substring(1),f.anchor===""&&u(l,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=a),f}function F0({options:e},{offset:t,source:n,end:r},s){const i=new il(n.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,o=ws(r,l,e.strict,s);return i.range=[t,l,o.offset],o.comment&&(i.comment=o.comment),i}function z0(e,t,{offset:n,start:r,value:s,end:i},l){const o=Object.assign({_directives:t},e),a=new gr(void 0,o),u={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},m=ir(r,{indicator:"doc-start",next:s??(i==null?void 0:i[0]),offset:n,onError:l,parentIndent:0,startOnNewline:!0});m.found&&(a.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!m.hasNewline&&l(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=s?dp(u,s,m,l):uu(u,m.end,r,null,m,l);const f=a.contents.range[2],p=ws(i,f,!1,l);return p.comment&&(a.comment=p.comment),a.range=[n,f,p.offset],a}function Or(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Bc(e){var s;let t="",n=!1,r=!1;for(let i=0;i{const l=Or(n);i?this.warnings.push(new lp(l,r,s)):this.errors.push(new ln(l,r,s))},this.directives=new Ee({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=Bc(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment} +${r}`:r;else if(s||t.directives.docStart||!i)t.commentBefore=r;else if(Q(i)&&!i.flow&&i.items.length>0){let l=i.items[0];H(l)&&(l=l.key);const o=l.commentBefore;l.commentBefore=o?`${r} +${o}`:r}else{const l=i.commentBefore;i.commentBefore=l?`${r} +${l}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Bc(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const s of t)yield*this.next(s);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,s)=>{const i=Or(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=z0(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new ln(Or(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new ln(Or(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=ws(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ln(Or(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new gr(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}function U0(e,t=!0,n){if(e){const r=(s,i,l)=>{const o=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(n)n(o,i,l);else throw new ln([o,o+1],i,l)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return up(e,t,r);case"block-scalar":return ap({options:{strict:t}},e,r)}}return null}function V0(e,t){const{implicitKey:n=!1,indent:r,inFlow:s=!1,offset:i=-1,type:l="PLAIN"}=t,o=ys({type:l,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),a=t.end??[{type:"newline",offset:-1,indent:r,source:` +`}];switch(o[0]){case"|":case">":{const u=o.indexOf(` +`),m=o.substring(0,u),f=o.substring(u+1)+` +`,p=[{type:"block-scalar-header",offset:i,indent:r,source:m}];return hp(p,a)||p.push({type:"newline",offset:-1,indent:r,source:` +`}),{type:"block-scalar",offset:i,indent:r,props:p,source:f}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:o,end:a};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:o,end:a};default:return{type:"scalar",offset:i,indent:r,source:o,end:a}}}function K0(e,t,n={}){let{afterKey:r=!1,implicitKey:s=!1,inFlow:i=!1,type:l}=n,o="indent"in e?e.indent:null;if(r&&typeof o=="number"&&(o+=2),!l)switch(e.type){case"single-quoted-scalar":l="QUOTE_SINGLE";break;case"double-quoted-scalar":l="QUOTE_DOUBLE";break;case"block-scalar":{const u=e.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");l=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:l="PLAIN"}const a=ys({type:l,value:t},{implicitKey:s||o===null,indent:o!==null&&o>0?" ".repeat(o):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(a[0]){case"|":case">":W0(e,a);break;case'"':Xl(e,a,"double-quoted-scalar");break;case"'":Xl(e,a,"single-quoted-scalar");break;default:Xl(e,a,"scalar")}}function W0(e,t){const n=t.indexOf(` +`),r=t.substring(0,n),s=t.substring(n+1)+` +`;if(e.type==="block-scalar"){const i=e.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,e.source=s}else{const{offset:i}=e,l="indent"in e?e.indent:-1,o=[{type:"block-scalar-header",offset:i,indent:l,source:r}];hp(o,"end"in e?e.end:void 0)||o.push({type:"newline",offset:-1,indent:l,source:` +`});for(const a of Object.keys(e))a!=="type"&&a!=="offset"&&delete e[a];Object.assign(e,{type:"block-scalar",indent:l,props:o,source:s})}}function hp(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function Xl(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const r=e.props.slice(1);let s=t.length;e.props[0].type==="block-scalar-header"&&(s-=e.props[0].source.length);for(const i of r)i.offset+=s;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{const s={type:"newline",offset:e.offset+t.length,indent:e.indent,source:` +`};delete e.items,Object.assign(e,{type:n,source:t,end:[s]});break}default:{const r="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(const i of Object.keys(e))i!=="type"&&i!=="offset"&&delete e[i];Object.assign(e,{type:n,indent:r,source:t,end:s})}}}const H0=e=>"type"in e?Bi(e):ci(e);function Bi(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=Bi(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=ci(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=ci(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=ci(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function ci({start:e,key:t,sep:n,value:r}){let s="";for(const i of e)s+=i.source;if(t&&(s+=Bi(t)),n)for(const i of n)s+=i.source;return r&&(s+=Bi(r)),s}const ta=Symbol("break visit"),q0=Symbol("skip children"),pp=Symbol("remove item");function mn(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),mp(Object.freeze([]),e,t)}mn.BREAK=ta;mn.SKIP=q0;mn.REMOVE=pp;mn.itemAtPath=(e,t)=>{let n=e;for(const[r,s]of t){const i=n==null?void 0:n[r];if(i&&"items"in i)n=i.items[s];else return}return n};mn.parentCollection=(e,t)=>{const n=mn.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],s=n==null?void 0:n[r];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function mp(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(const s of["key","value"]){const i=t[s];if(i&&"items"in i){for(let l=0;l!!e&&"items"in e,Y0=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function J0(e){switch(e){case ml:return"";case gl:return"";case yl:return"";case cs:return"";default:return JSON.stringify(e)}}function gp(e){switch(e){case ml:return"byte-order-mark";case gl:return"doc-mode";case yl:return"flow-error-end";case cs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`:case`\r +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const G0=Object.freeze(Object.defineProperty({__proto__:null,BOM:ml,DOCUMENT:gl,FLOW_END:yl,SCALAR:cs,createScalarToken:V0,isCollection:Q0,isScalar:Y0,prettyToken:J0,resolveAsScalar:U0,setScalarValue:K0,stringify:H0,tokenType:gp,visit:mn},Symbol.toStringTag,{value:"Module"}));function Ge(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const Fc=new Set("0123456789ABCDEFabcdef"),X0=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Us=new Set(",[]{}"),Z0=new Set(` ,[]{} +\r `),Zl=e=>!e||Z0.has(e);class yp{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`?!0:n==="\r"?this.buffer[t+1]===` +`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===` +`||!s&&!this.atEnd)return t+r+1}return n===` +`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Ge(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Ge(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Ge(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Zl),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Ge(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case` +`:t=i,n=0;break;case"\r":{const l=this.buffer[i+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===` +`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(` +`,i)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` +`;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let i=t-1,l=this.buffer[i];l==="\r"&&(l=this.buffer[--i]);const o=i;for(;l===" ";)l=this.buffer[--i];if(l===` +`&&i>=this.pos&&i+1+n>o)t=i;else break}while(!0);return yield cs,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(Ge(i)||t&&Us.has(i))break;n=r}else if(Ge(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===` +`?(r+=1,s=` +`,i=this.buffer[r+1]):n=r),i==="#"||t&&Us.has(i))break;if(s===` +`){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&Us.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield cs,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Zl))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(Ge(n)||t&&Us.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!Ge(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(X0.has(n))n=this.buffer[++t];else if(n==="%"&&Fc.has(this.buffer[t+1])&&Fc.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` +`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class vp{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[i]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Uc(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Zt(t.start,"explicit-key-ind")&&!Zt(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,wp(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class fu{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new yp,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=gp(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(!t||t.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Uc(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&zc(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent=t.indent){const s=!this.onKeyLine&&this.indent===t.indent,i=s&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let l=[];if(i&&n.sep&&!n.value){const o=[];for(let a=0;at.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(l=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(l.push(this.sourceToken),t.items.push({start:l}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(l.push(this.sourceToken),t.items.push({start:l,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Zt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]});else if(wp(n.key)&&!Zt(n.sep,"newline")){const o=En(n.start),a=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:u}]})}else l.length>0?n.sep=n.sep.concat(l,this.sourceToken):n.sep.push(this.sourceToken);else if(Zt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=En(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:l,key:null,sep:[this.sourceToken]}):Zt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||n.value?(t.items.push({start:l,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){s&&o.type!=="block-seq"&&t.items.push({start:l}),this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const s="end"in n.value?n.value.end:void 0,i=Array.isArray(s)?s[s.length-1]:void 0;(i==null?void 0:i.type)==="comment"?s==null||s.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2],i=(r=s==null?void 0:s.value)==null?void 0:r.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Zt(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const s=this.startBlockValue(t);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Vs(r),i=En(s);Uc(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Vs(t),r=En(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Vs(t),r=En(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Sp(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new vp||null,prettyErrors:t}}function e1(e,t={}){const{lineCounter:n,prettyErrors:r}=Sp(t),s=new fu(n==null?void 0:n.addNewLine),i=new cu(t),l=Array.from(i.compose(s.parse(e)));if(r&&n)for(const o of l)o.errors.forEach(bi(e,n)),o.warnings.forEach(bi(e,n));return l.length>0?l:Object.assign([],{empty:!0},i.streamInfo())}function kp(e,t={}){const{lineCounter:n,prettyErrors:r}=Sp(t),s=new fu(n==null?void 0:n.addNewLine),i=new cu(t);let l=null;for(const o of i.compose(s.parse(e),!0,e.length))if(!l)l=o;else if(l.options.logLevel!=="silent"){l.errors.push(new ln(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(l.errors.forEach(bi(e,n)),l.warnings.forEach(bi(e,n))),l}function t1(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);const s=kp(e,n);if(!s)return null;if(s.warnings.forEach(i=>zh(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}function n1(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const s=Math.round(n);n=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=n??t??{};if(!s)return}return wn(e)&&!r?e.toString(n):new gr(e,r,n).toString(n)}const Nn=Object.freeze(Object.defineProperty({__proto__:null,Alias:il,CST:G0,Composer:cu,Document:gr,Lexer:yp,LineCounter:vp,Pair:we,Parser:fu,Scalar:P,Schema:pl,YAMLError:au,YAMLMap:Re,YAMLParseError:ln,YAMLSeq:Kt,YAMLWarning:lp,isAlias:vn,isCollection:Q,isDocument:wn,isMap:dr,isNode:J,isPair:H,isScalar:z,isSeq:hr,parse:t1,parseAllDocuments:e1,parseDocument:kp,stringify:n1,visit:Vt,visitAsync:sl},Symbol.toStringTag,{value:"Module"}));class du{static parse(t){return new du(t)._parse()}constructor(t){this._input=t,this._pos=0,this._length=t.length}_peek(){return this._input[this._pos]||""}_next(){return this._pos=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(t){this._eof()&&this._throwError(`Unexpected end of input when expecting ${t}`);const n=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(n,this._pos)}_readString(){let t="",n=!1;for(;!this._eof();){const r=this._next();if(n)t+=r,n=!1;else if(r==="\\")n=!0;else{if(r==='"')return t;t+=r}}this._throwError("Unterminated string")}_throwError(t,n){throw new s1(t,this._input,n||this._pos)}_readRegex(){let t="",n=!1,r=!1;for(;!this._eof();){const s=this._next();if(n)t+=s,n=!1;else if(s==="\\")n=!0,t+=s;else{if(s==="/"&&!r)return t;s==="["?(r=!0,t+=s):s==="]"&&r?(t+=s,r=!1):t+=s}}this._throwError("Unterminated regex")}_readStringOrRegex(){const t=this._peek();return t==='"'?(this._next(),this._readString()):t==="/"?(this._next(),new RegExp(this._readRegex())):null}_readAttributes(t){let n=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),n=this._pos;const r=this._readIdentifier("attribute");this._skipWhitespace();let s="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),n=this._pos;this._peek()!=="]"&&!this._isWhitespace()&&!this._eof();)s+=this._next();this._skipWhitespace(),this._peek()!=="]"&&this._throwError("Expected ]"),this._next(),this._applyAttribute(t,r,s||"true",n)}}_parse(){this._skipWhitespace();const t=this._readIdentifier("role");this._skipWhitespace();const n=this._readStringOrRegex()||"",r={kind:"role",role:t,name:n};return this._readAttributes(r),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),r}_applyAttribute(t,n,r,s){if(n==="checked"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',s),t.checked=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="disabled"){this._assert(r==="true"||r==="false",'Value of "disabled" attribute must be a boolean',s),t.disabled=r==="true";return}if(n==="expanded"){this._assert(r==="true"||r==="false",'Value of "expanded" attribute must be a boolean',s),t.expanded=r==="true";return}if(n==="level"){this._assert(!isNaN(Number(r)),'Value of "level" attribute must be a number',s),t.level=Number(r);return}if(n==="pressed"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',s),t.pressed=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="selected"){this._assert(r==="true"||r==="false",'Value of "selected" attribute must be a boolean',s),t.selected=r==="true";return}this._assert(!1,`Unsupported attribute [${n}]`,s)}_assert(t,n,r){t||this._throwError(n||"Assertion error",r)}}function r1(e){return du.parse(e)}class s1 extends Error{constructor(t,n,r){super(t+`: + +`+n+` +`+" ".repeat(r)+`^ +`),this.shortMessage=t,this.pos=r,this.stack=void 0}}const i1=({sources:e,paused:t,log:n,mode:r})=>{var x;const[s,i]=B.useState(),[l,o]=B.useState(),[a,u]=eo("recorderPropertiesTab","log"),[m,f]=B.useState(),[p,g]=B.useState(),w=s||l||((x=e[0])==null?void 0:x.id),h=B.useMemo(()=>{if(w){const E=e.find(T=>T.id===w);if(E)return E}return yy()},[e,w]),[v,d]=B.useState("");window.playwrightElementPicked=(E,T)=>{const N=h.language;d(Lh(N,E.selector)),f(E.ariaSnapshot),g([]),T&&a!=="locator"&&a!=="aria"&&u("locator"),r==="inspecting"&&a==="aria"||window.dispatch({event:"setMode",params:{mode:r==="inspecting"?"standby":"recording"}}).catch(()=>{})},window.playwrightSetRunningFile=o;const c=B.useRef(null);B.useLayoutEffect(()=>{var E;(E=c.current)==null||E.scrollIntoView({block:"center",inline:"nearest"})},[c]),B.useEffect(()=>{const E=T=>{switch(T.key){case"F8":T.preventDefault(),t?window.dispatch({event:"resume"}):window.dispatch({event:"pause"});break;case"F10":T.preventDefault(),t&&window.dispatch({event:"step"});break}};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[t]);const y=B.useCallback(E=>{(r==="none"||r==="inspecting")&&window.dispatch({event:"setMode",params:{mode:"standby"}}),d(E),window.dispatch({event:"highlightRequested",params:{selector:E}})},[r]),S=B.useCallback(E=>{(r==="none"||r==="inspecting")&&window.dispatch({event:"setMode",params:{mode:"standby"}});const{fragment:T,errors:N}=l1(E);g(N),f(E),N.length||window.dispatch({event:"highlightRequested",params:{ariaTemplate:T}})},[r]);return L.jsxs("div",{className:"recorder",children:[L.jsxs(ih,{children:[L.jsx(je,{icon:"circle-large-filled",title:"Record",toggled:r==="recording"||r==="recording-inspecting"||r==="assertingText"||r==="assertingVisibility",onClick:()=>{window.dispatch({event:"setMode",params:{mode:r==="none"||r==="standby"||r==="inspecting"?"recording":"standby"}})},children:"Record"}),L.jsx(Lc,{}),L.jsx(je,{icon:"inspect",title:"Pick locator",toggled:r==="inspecting"||r==="recording-inspecting",onClick:()=>{const E={inspecting:"standby",none:"inspecting",standby:"inspecting",recording:"recording-inspecting","recording-inspecting":"recording",assertingText:"recording-inspecting",assertingVisibility:"recording-inspecting",assertingValue:"recording-inspecting",assertingSnapshot:"recording-inspecting"}[r];window.dispatch({event:"setMode",params:{mode:E}}).catch(()=>{})}}),L.jsx(je,{icon:"eye",title:"Assert visibility",toggled:r==="assertingVisibility",disabled:r==="none"||r==="standby"||r==="inspecting",onClick:()=>{window.dispatch({event:"setMode",params:{mode:r==="assertingVisibility"?"recording":"assertingVisibility"}})}}),L.jsx(je,{icon:"whole-word",title:"Assert text",toggled:r==="assertingText",disabled:r==="none"||r==="standby"||r==="inspecting",onClick:()=>{window.dispatch({event:"setMode",params:{mode:r==="assertingText"?"recording":"assertingText"}})}}),L.jsx(je,{icon:"symbol-constant",title:"Assert value",toggled:r==="assertingValue",disabled:r==="none"||r==="standby"||r==="inspecting",onClick:()=>{window.dispatch({event:"setMode",params:{mode:r==="assertingValue"?"recording":"assertingValue"}})}}),L.jsx(je,{icon:"gist",title:"Assert snapshot",toggled:r==="assertingSnapshot",disabled:r==="none"||r==="standby"||r==="inspecting",onClick:()=>{window.dispatch({event:"setMode",params:{mode:r==="assertingSnapshot"?"recording":"assertingSnapshot"}})}}),L.jsx(Lc,{}),L.jsx(je,{icon:"files",title:"Copy",disabled:!h||!h.text,onClick:()=>{gu(h.text)}}),L.jsx(je,{icon:"debug-continue",title:"Resume (F8)",ariaLabel:"Resume",disabled:!t,onClick:()=>{window.dispatch({event:"resume"})}}),L.jsx(je,{icon:"debug-pause",title:"Pause (F8)",ariaLabel:"Pause",disabled:t,onClick:()=>{window.dispatch({event:"pause"})}}),L.jsx(je,{icon:"debug-step-over",title:"Step over (F10)",ariaLabel:"Step over",disabled:!t,onClick:()=>{window.dispatch({event:"step"})}}),L.jsx("div",{style:{flex:"auto"}}),L.jsx("div",{children:"Target:"}),L.jsx(my,{fileId:w,sources:e,setFileId:E=>{i(E),window.dispatch({event:"fileChanged",params:{file:E}})}}),L.jsx(je,{icon:"clear-all",title:"Clear",disabled:!h||!h.text,onClick:()=>{window.dispatch({event:"clear"})}}),L.jsx(je,{icon:"color-mode",title:"Toggle color mode",toggled:!1,onClick:()=>Yp()})]}),L.jsx(dy,{sidebarSize:200,main:L.jsx(Wl,{text:h.text,language:h.language,highlight:h.highlight,revealLine:h.revealLine,readOnly:!0,lineNumbers:!0}),sidebar:L.jsx(hy,{rightToolbar:a==="locator"||a==="aria"?[L.jsx(je,{icon:"files",title:"Copy",onClick:()=>gu((a==="locator"?v:m)||"")},1)]:[],tabs:[{id:"locator",title:"Locator",render:()=>L.jsx(Wl,{text:v,placeholder:"Type locator to inspect",language:h.language,focusOnChange:!0,onChange:y,wrapLines:!0})},{id:"log",title:"Log",render:()=>L.jsx(Hy,{language:h.language,log:Array.from(n.values())})},{id:"aria",title:"Aria",render:()=>L.jsx(Wl,{text:m||"",placeholder:"Type aria template to match",language:"yaml",onChange:S,highlight:p,wrapLines:!0})}],selectedTab:a,setSelectedTab:u})})]})};function l1(e){const t=new Nn.LineCounter,n=Nn.parseDocument(e,{keepSourceTokens:!0,lineCounter:t,prettyErrors:!1}),r=[];for(const l of n.errors)r.push({line:t.linePos(l.pos[0]).line,type:"subtle-error",message:l.message});if(n.errors.length)return{errors:r};const s=l=>{try{r1(l.value)}catch(o){const a=o,u=t.linePos(l.srcToken.offset+a.pos);r.push({message:a.shortMessage,line:u.line,column:u.col,type:"subtle-error"})}},i=l=>{for(const o of l.items){if(o instanceof Nn.YAMLMap){const a=o;for(const u of a.items)u.key instanceof Nn.Scalar&&s(u.key),u.value instanceof Nn.YAMLSeq&&i(u.value);continue}o instanceof Nn.Scalar&&s(o)}};return i(n.contents),r.length?{errors:r}:{fragment:n.toJSON(),errors:r}}const o1=({})=>{const[e,t]=B.useState([]),[n,r]=B.useState(!1),[s,i]=B.useState(new Map),[l,o]=B.useState("none");return window.playwrightSetMode=o,window.playwrightSetSources=B.useCallback(a=>{t(a),window.playwrightSourcesEchoForTest=a},[]),window.playwrightSetPaused=r,window.playwrightUpdateLogs=a=>{i(u=>{const m=new Map(u);for(const f of a)f.reveal=!u.has(f.id),m.set(f.id,f);return m})},L.jsx(i1,{sources:e,paused:n,log:s,mode:l})};(async()=>(qp(),sh(document.querySelector("#root")).render(L.jsx(o1,{}))))();export{a1 as c,Ep as g}; diff --git a/priv/static/node_modules/playwright-core/lib/vite/recorder/index.html b/priv/static/node_modules/playwright-core/lib/vite/recorder/index.html index 7c64d793..1899c0b2 100644 --- a/priv/static/node_modules/playwright-core/lib/vite/recorder/index.html +++ b/priv/static/node_modules/playwright-core/lib/vite/recorder/index.html @@ -20,8 +20,8 @@ Playwright Inspector - - + +
diff --git a/priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BBCX0spr.js b/priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BBCX0spr.js new file mode 100644 index 00000000..32a0be67 --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BBCX0spr.js @@ -0,0 +1,24 @@ +import{V as yu,W as xu}from"./inspectorTab-B4Iw34Ow.js";var ho={exports:{}},ha;function It(){return ha||(ha=1,function(Et,zt){(function(C,De){Et.exports=De()})(yu,function(){var C=navigator.userAgent,De=navigator.platform,I=/gecko\/\d/i.test(C),K=/MSIE \d/.test(C),$=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(C),V=/Edge\/(\d+)/.exec(C),b=K||$||V,N=b&&(K?document.documentMode||6:+(V||$)[1]),_=!V&&/WebKit\//.test(C),ie=_&&/Qt\/\d+\.\d+/.test(C),O=!V&&/Chrome\/(\d+)/.exec(C),q=O&&+O[1],z=/Opera\//.test(C),X=/Apple Computer/.test(navigator.vendor),ke=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(C),we=/PhantomJS/.test(C),te=X&&(/Mobile\/\w+/.test(C)||navigator.maxTouchPoints>2),re=/Android/.test(C),ne=te||re||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(C),se=te||/Mac/.test(De),Ae=/\bCrOS\b/.test(C),ye=/win/i.test(De),de=z&&C.match(/Version\/(\d*\.\d*)/);de&&(de=Number(de[1])),de&&de>=15&&(z=!1,_=!0);var ze=se&&(ie||z&&(de==null||de<12.11)),fe=I||b&&N>=9;function H(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ee=function(e,t){var n=e.className,r=H(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Q(e,t){return D(e).appendChild(t)}function d(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=ue(this.onTimeout,this)};be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},be.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Ue=[""];function et(e){for(;Ue.length<=e;)Ue.push(ge(Ue)+" ");return Ue[e]}function ge(e){return e[e.length-1]}function Pe(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function Se(e,t){return t?t.source.indexOf("\\w")>-1&&ae(e)?!0:t.test(e):ae(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Me(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Lt(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function or(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var br=null;function lr(e,t,n){var r;br=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:br=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:br=i)}return r??br}var vi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,h,v){this.level=u,this.from=h,this.to=v}return function(u,h){var v=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var k=u.length,x=[],M=0;M-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ye(e,t){var n=Jt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Bt(e){e.prototype.on=function(t,n){ve(this,t,n)},e.prototype.off=function(t,n){dt(this,t,n)}}function ht(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Nr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function yt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){ht(e),Nr(e)}function ln(e){return e.target||e.srcElement}function Wt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),se&&e.ctrlKey&&t==1&&(t=3),t}var mi=function(){if(b&&N<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),Or;function Wn(e){if(Or==null){var t=d("span","​");Q(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Or=t.offsetWidth<=1&&t.offsetHeight>2&&!(b&&N<8))}var n=Or?d("span","​"):d("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function sr(e){if(an!=null)return an;var t=Q(e,document.createTextNode("AخA")),n=w(t,0,1).getBoundingClientRect(),r=w(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var Pt=` + +b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` +`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ur=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},_n=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),_t=null;function yi(e){if(_t!=null)return _t;var t=Q(e,d("span","x")),n=t.getBoundingClientRect(),r=w(t,0,1).getBoundingClientRect();return _t=Math.abs(n.left-r.left)>1}var Pr={},Ht={};function Rt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pr[e]=t}function kr(e,t){Ht[e]=t}function Ir(e){if(typeof e=="string"&&Ht.hasOwnProperty(e))e=Ht[e];else if(e&&typeof e.name=="string"&&Ht.hasOwnProperty(e.name)){var t=Ht[e.name];typeof t=="string"&&(t={name:t}),e=F(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ir("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ir("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function zr(e,t){t=Ir(t);var n=Pr[t.name];if(!n)return zr(e,"text/plain");var r=n(e,t);if(fr.hasOwnProperty(t.name)){var i=fr[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var fr={};function Br(e,t){var n=fr.hasOwnProperty(e)?fr[e]:fr[e]={};Te(t,n)}function Gt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function sn(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Wr(e,t,n){return e.startState?e.startState(t,n):!0}var Qe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Qe.prototype.eol=function(){return this.pos>=this.string.length},Qe.prototype.sol=function(){return this.pos==this.lineStart},Qe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qe.prototype.next=function(){if(this.post},Qe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Qe.prototype.skipToEnd=function(){this.pos=this.string.length},Qe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Qe.prototype.backUp=function(e){this.pos-=e},Qe.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Qe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Qe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Qe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ce(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?L(n,ce(e,n).text.length):xa(t,ce(e,t.line).text.length)}function xa(e,t){var n=e.ch;return n==null||n>t?L(e.line,t):n<0?L(e.line,0):e}function go(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Xt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Xt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Xt.fromSaved=function(e,t,n){return t instanceof Hn?new Xt(e,Gt(e.mode,t.state),n,t.lookAhead):new Xt(e,Gt(e.mode,t),n)},Xt.prototype.save=function(e){var t=e!==!1?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Hn(t,this.maxLookAhead):t};function vo(e,t,n,r){var i=[e.state.modeGen],o={};wo(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var h=e.state.overlays[u],v=1,k=0;n.state=!0,wo(e,t.text,h.mode,n,function(x,M){for(var E=v;kx&&i.splice(v,1,x,i[v+1],R),v+=2,k=Math.min(x,R)}if(M)if(h.opaque)i.splice(E,v-E,x,"overlay "+M),v=E+2;else for(;Ee.options.maxHighlightLength&&Gt(e.doc.mode,r.state),o=vo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function fn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Xt(r,!0,t);var o=ba(e,t,n),l=o>r.first&&ce(r,o-1).stateAfter,a=l?Xt.fromSaved(r,l,o):new Xt(r,Wr(r.mode),o);return r.iter(o,t,function(s){xi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var xo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function bo(e,t,n,r){var i=e.doc,o=i.mode,l;t=Ce(i,t);var a=ce(i,t.line),s=fn(e,t.line,n),u=new Qe(a.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pose.options.maxHighlightLength?(a=!1,l&&xi(e,t,r,h.pos),h.pos=t.length,v=null):v=ko(bi(n,h,r.state,k),o),k){var x=k[0].name;x&&(v="m-"+(v?x+" "+v:x))}if(!a||u!=v){for(;sl;--a){if(a<=o.first)return o.first;var s=ce(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Hn?u.lookAhead:0)<=o.modeFrontier))return a;var h=Le(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=a-1,r=h)}return i}function ka(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=ce(e,r).stateAfter;if(i&&(!(i instanceof Hn)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Rn(l,o.from,s?null:o.to))}}return r}function Da(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from0&&a)for(var ee=0;ee0)){var h=[s,1],v=Z(u.from,a.from),k=Z(u.to,a.to);(v<0||!l.inclusiveLeft&&!v)&&h.push({from:u.from,to:a.from}),(k>0||!l.inclusiveRight&&!k)&&h.push({from:a.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Lo(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!r||wi(r,o.marker)<0)&&(r=o.marker)}return r}function Fo(e,t,n,r,i){var o=ce(e,t),l=$t&&o.markedSpans;if(l)for(var a=0;a=0&&v<=0||h<=0&&v>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.to,n)>=0:Z(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.from,r)<=0:Z(u.from,r)<0)))return!0}}}function qt(e){for(var t;t=Mo(e);)e=t.find(-1,!0).line;return e}function Aa(e){for(var t;t=Kn(e);)e=t.find(1,!0).line;return e}function Ea(e){for(var t,n;t=Kn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Si(e,t){var n=ce(e,t),r=qt(n);return n==r?t:f(r)}function Ao(e,t){if(t>e.lastLine())return t;var n=ce(e,t),r;if(!cr(e,n))return t;for(;r=Kn(n);)n=r.find(1,!0).line;return f(n)+1}function cr(e,t){var n=$t&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Hr=function(e,t,n){this.text=e,Co(this,t),this.height=n?n(this):1};Hr.prototype.lineNo=function(){return f(this)},Bt(Hr);function Na(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Lo(e),Co(e,n);var i=r?r(e):1;i!=e.height&&Ft(e,i)}function Oa(e){e.parent=null,Lo(e)}var Pa={},Ia={};function Eo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ia:Pa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function No(e,t){var n=S("span",null,null,_?"padding-right: .1px":null),r={pre:S("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=Ba,sr(e.display.measure)&&(l=We(o,e.doc.direction))&&(r.addToken=_a(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);Ha(o,r,mo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=le(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=le(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Wn(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ye(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=le(r.pre.className,r.textClass||"")),r}function za(e){var t=d("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ba(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?Wa(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,h),b&&N<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var v=0;;){s.lastIndex=v;var k=s.exec(t),x=k?k.index-v:t.length-v;if(x){var M=document.createTextNode(a.slice(v,v+x));b&&N<9?h.appendChild(d("span",[M])):h.appendChild(M),e.map.push(e.pos,e.pos+x,M),e.col+=x,e.pos+=x}if(!k)break;v+=x+1;var E=void 0;if(k[0]==" "){var R=e.cm.options.tabSize,U=R-e.col%R;E=h.appendChild(d("span",et(U),"cm-tab")),E.setAttribute("role","presentation"),E.setAttribute("cm-text"," "),e.col+=U}else k[0]=="\r"||k[0]==` +`?(E=h.appendChild(d("span",k[0]=="\r"?"␍":"␤","cm-invalidchar")),E.setAttribute("cm-text",k[0]),e.col+=1):(E=e.cm.options.specialCharPlaceholder(k[0]),E.setAttribute("cm-text",k[0]),b&&N<9?h.appendChild(d("span",[E])):h.appendChild(E),e.col+=1);e.map.push(e.pos,e.pos+1,E),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,n||r||i||u||o||l){var J=n||"";r&&(J+=r),i&&(J+=i);var G=d("span",[h],J,o);if(l)for(var ee in l)l.hasOwnProperty(ee)&&ee!="style"&&ee!="class"&&G.setAttribute(ee,l[ee]);return e.content.appendChild(G)}e.content.appendChild(h)}}function Wa(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&v.from<=u));k++);if(v.to>=h)return e(n,r,i,o,l,a,s);e(n,r.slice(0,v.to-u),i,o,null,a,s),o=null,r=r.slice(v.to-u),u=v.to}}}function Oo(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ha(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var l=1;ls||Fe.collapsed&&pe.to==s&&pe.from==s)){if(pe.to!=null&&pe.to!=s&&x>pe.to&&(x=pe.to,E=""),Fe.className&&(M+=" "+Fe.className),Fe.css&&(k=(k?k+";":"")+Fe.css),Fe.startStyle&&pe.from==s&&(R+=" "+Fe.startStyle),Fe.endStyle&&pe.to==x&&(ee||(ee=[])).push(Fe.endStyle,pe.to),Fe.title&&((J||(J={})).title=Fe.title),Fe.attributes)for(var Ke in Fe.attributes)(J||(J={}))[Ke]=Fe.attributes[Ke];Fe.collapsed&&(!U||wi(U.marker,Fe)<0)&&(U=pe)}else pe.from>s&&x>pe.from&&(x=pe.from)}if(ee)for(var st=0;st=a)break;for(var Mt=Math.min(a,x);;){if(h){var wt=s+h.length;if(!U){var tt=wt>Mt?h.slice(0,Mt-s):h;t.addToken(t,tt,v?v+M:M,R,s+tt.length==x?E:"",k,J)}if(wt>=Mt){h=h.slice(Mt-s),s=Mt;break}s=wt,R=""}h=i.slice(o,o=n[u++]),v=Eo(n[u++],t.cm.options)}}}function Po(e,t,n){this.line=t,this.rest=Ea(t),this.size=this.rest?f(ge(this.rest))-n+1:1,this.node=this.text=null,this.hidden=cr(e,t)}function Gn(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ro(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Ja(e,t){t=qt(t);var n=f(t),r=e.display.externalMeasured=new Po(e.doc,t,n);r.lineN=n;var i=r.built=No(e,r);return r.text=i.pre,Q(e.display.lineMeasure,i.pre),r}function qo(e,t,n,r){return Zt(e,qr(e,t),n,r)}function Fi(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=s-a,i=o-1,t>=s&&(l="right")),i!=null){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],l="left";if(n=="right"&&i==s-a)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function $a(e,t,n,r){var i=Ko(t.map,n,r),o=i.node,l=i.start,a=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;l&&Me(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+a0&&(s=r="right");var v;e.options.lineWrapping&&(v=o.getClientRects()).length>1?u=v[r=="right"?v.length-1:0]:u=o.getBoundingClientRect()}if(b&&N<9&&!l&&(!u||!u.left&&!u.right)){var k=o.parentNode.getClientRects()[0];k?u={left:k.left,right:k.left+Kr(e.display),top:k.top,bottom:k.bottom}:u=jo}for(var x=u.top-t.rect.top,M=u.bottom-t.rect.top,E=(x+M)/2,R=t.view.measure.heights,U=0;U=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l(u=="before"?s-1:s,u=="before");function h(M,E,R){var U=a[E],J=U.level==1;return l(R?M-1:M,J!=R)}var v=lr(a,s,u),k=br,x=h(s,v,u=="before");return k!=null&&(x.other=h(s,k,u!="before")),x}function Qo(e,t){var n=0;t=Ce(e.doc,t),e.options.lineWrapping||(n=Kr(e.display)*t.ch);var r=ce(e.doc,t.line),i=er(r)+Xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Ei(e,t,n,r,i){var o=L(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Ni(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Ei(r.first,0,null,-1,-1);var i=g(r,n),o=r.first+r.size-1;if(i>o)return Ei(r.first+r.size-1,ce(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=ce(r,i);;){var a=ts(e,l,i,t,n),s=Fa(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=ce(r,i=u.line)}}function Jo(e,t,n,r){r-=Ai(t);var i=t.text.length,o=Nt(function(l){return Zt(e,n,l-1).bottom<=r},i,0);return i=Nt(function(l){return Zt(e,n,l).top>r},o,i),{begin:o,end:i}}function Vo(e,t,n,r){n||(n=qr(e,t));var i=Yn(e,t,Zt(e,n,r),"line").top;return Jo(e,t,n,i)}function Oi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function ts(e,t,n,r,i){i-=er(t);var o=qr(e,t),l=Ai(t),a=0,s=t.text.length,u=!0,h=We(t,e.doc.direction);if(h){var v=(e.options.lineWrapping?ns:rs)(e,t,n,o,h,r,i);u=v.level!=1,a=u?v.from:v.to-1,s=u?v.to:v.from-1}var k=null,x=null,M=Nt(function(me){var pe=Zt(e,o,me);return pe.top+=l,pe.bottom+=l,Oi(pe,r,i,!1)?(pe.top<=i&&pe.left<=r&&(k=me,x=pe),!0):!1},a,s),E,R,U=!1;if(x){var J=r-x.left=ee.bottom?1:0}return M=Lt(t.text,M,1),Ei(n,M,R,U,r-E)}function rs(e,t,n,r,i,o,l){var a=Nt(function(v){var k=i[v],x=k.level!=1;return Oi(jt(e,L(n,x?k.to:k.from,x?"before":"after"),"line",t,r),o,l,!0)},0,i.length-1),s=i[a];if(a>0){var u=s.level!=1,h=jt(e,L(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Oi(h,o,l,!0)&&h.top>l&&(s=i[a-1])}return s}function ns(e,t,n,r,i,o,l){var a=Jo(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,v=null,k=0;k=u||x.to<=s)){var M=x.level!=1,E=Zt(e,r,M?Math.min(u,x.to)-1:Math.max(s,x.from)).right,R=ER)&&(h=x,v=R)}}return h||(h=i[i.length-1]),h.fromu&&(h={from:h.from,to:u,level:h.level}),h}var Sr;function jr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Sr==null){Sr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Sr.appendChild(document.createTextNode("x")),Sr.appendChild(d("br"));Sr.appendChild(document.createTextNode("x"))}Q(e.measure,Sr);var n=Sr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),D(e.measure),n||1}function Kr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),n=d("pre",[t],"CodeMirror-line-like");Q(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Pi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Ii(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ii(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function $o(e){var t=jr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Kr(e.display)-3);return function(i){if(cr(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l0&&(u=ce(e.doc,s.line).text).length==s.ch){var h=Le(u,u.length,e.options.tabSize)-u.length;s=L(s.line,Math.max(0,Math.round((o-Ho(e.display).left)/Kr(e.display))-h))}return s}function Lr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)$t&&Si(e.doc,t)i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var o=Qn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var l=Qn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):hr(e)}else{var a=Qn(e,t,t,-1),s=Qn(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Gn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):hr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Lr(e,t)];if(o.node!=null){var l=o.changes||(o.changes=[]);oe(l,n)==-1&&l.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,n,r){var i=Lr(e,t),o,l=e.display.view;if(!$t||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;Si(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function is(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Gn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Gn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Lr(e,n)))),r.viewTo=n}function el(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(d("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Jn(e,t){return e.top-t.top||e.left-t.left}function os(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=Ho(e.display),a=l.left,s=Math.max(r.sizerWidth,wr(e)-r.sizer.offsetLeft)-l.right,u=i.direction=="ltr";function h(G,ee,me,pe){ee<0&&(ee=0),ee=Math.round(ee),pe=Math.round(pe),o.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+G+`px; + top: `+ee+"px; width: "+(me??s-G)+`px; + height: `+(pe-ee)+"px"))}function v(G,ee,me){var pe=ce(i,G),Fe=pe.text.length,Ke,st;function Xe(tt,St){return Zn(e,L(G,tt),"div",pe,St)}function Mt(tt,St,ft){var nt=Vo(e,pe,null,tt),rt=St=="ltr"==(ft=="after")?"left":"right",Je=ft=="after"?nt.begin:nt.end-(/\s/.test(pe.text.charAt(nt.end-1))?2:1);return Xe(Je,rt)[rt]}var wt=We(pe,i.direction);return or(wt,ee||0,me??Fe,function(tt,St,ft,nt){var rt=ft=="ltr",Je=Xe(tt,rt?"left":"right"),Tt=Xe(St-1,rt?"right":"left"),nn=ee==null&&tt==0,xr=me==null&&St==Fe,gt=nt==0,Qt=!wt||nt==wt.length-1;if(Tt.top-Je.top<=3){var ut=(u?nn:xr)&>,fo=(u?xr:nn)&&Qt,ir=ut?a:(rt?Je:Tt).left,Ar=fo?s:(rt?Tt:Je).right;h(ir,Je.top,Ar-ir,Je.bottom)}else{var Er,mt,on,co;rt?(Er=u&&nn&>?a:Je.left,mt=u?s:Mt(tt,ft,"before"),on=u?a:Mt(St,ft,"after"),co=u&&xr&&Qt?s:Tt.right):(Er=u?Mt(tt,ft,"before"):a,mt=!u&&nn&>?s:Je.right,on=!u&&xr&&Qt?a:Tt.left,co=u?Mt(St,ft,"after"):s),h(Er,Je.top,mt-Er,Je.bottom),Je.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Ur(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function rl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Hi(e))}function _i(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ur(e))},100)}function Hi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ye(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),_&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wi(e))}function Ur(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ye(e,"blur",e,t),e.state.focused=!1,Ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Vn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||x<-.005)&&(ie.display.sizerWidth){var E=Math.ceil(h/Kr(e.display));E>e.display.maxLineLength&&(e.display.maxLineLength=E,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function nl(e){if(e.widgets)for(var t=0;t=l&&(o=g(t,er(ce(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function ls(e,t){if(!Ze(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!we){var l=d("div","​",null,`position: absolute; + top: `+(t.top-n.viewOffset-Xn(e.display))+`px; + height: `+(t.bottom-t.top+Yt(e)+n.barHeight)+`px; + left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function as(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?L(t.line,t.ch+1,"before"):t,t=t.ch?L(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=jt(e,t),s=!n||n==t?a:jt(e,n);i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=Ri(e,i),h=e.doc.scrollTop,v=e.doc.scrollLeft;if(u.scrollTop!=null&&(yn(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(l=!0)),u.scrollLeft!=null&&(Cr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-v)>1&&(l=!0)),!l)break}return i}function ss(e,t){var n=Ri(e,t);n.scrollTop!=null&&yn(e,n.scrollTop),n.scrollLeft!=null&&Cr(e,n.scrollLeft)}function Ri(e,t){var n=e.display,r=jr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Mi(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Di(n),s=t.topa-r;if(t.topi+o){var h=Math.min(t.top,(u?a:t.bottom)-o);h!=i&&(l.scrollTop=h)}var v=e.options.fixedGutter?0:n.gutters.offsetWidth,k=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-v,x=wr(e)-n.gutters.offsetWidth,M=t.right-t.left>x;return M&&(t.right=t.left+x),t.left<10?l.scrollLeft=0:t.leftx+k-3&&(l.scrollLeft=t.right+(M?0:10)-x),l}function qi(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Gr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function mn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function us(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Qo(e,t.from),r=Qo(e,t.to);il(e,n,r,t.margin)}}function il(e,t,n,r){var i=Ri(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});mn(e,i.scrollLeft,i.scrollTop)}function yn(e,t){Math.abs(e.doc.scrollTop-t)<2||(I||Ki(e,{top:t}),ol(e,t,!0),I&&Ki(e),kn(e,100))}function ol(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Cr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,fl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function xn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Di(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Yt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Dr=function(e,t,n){this.cm=n;var r=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),ve(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),ve(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&N<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Dr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dr.prototype.zeroWidthHack=function(){var e=se&&!ke?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new be,this.disableVert=new be},Dr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Dr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var bn=function(){};bn.prototype.update=function(){return{bottom:0,right:0}},bn.prototype.setScrollLeft=function(){},bn.prototype.setScrollTop=function(){},bn.prototype.clear=function(){};function Xr(e,t){t||(t=xn(e));var n=e.display.barWidth,r=e.display.barHeight;ll(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Vn(e),ll(e,xn(e)),n=e.display.barWidth,r=e.display.barHeight}function ll(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var al={native:Dr,null:bn};function sl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new al[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ve(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Cr(e,t):yn(e,t)},e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var fs=0;function Mr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++fs,markArrays:null},Ra(e.curOp)}function Fr(e){var t=e.curOp;t&&ja(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ti(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function hs(e){e.updatedDisplay=e.mustUpdate&&ji(e.cm,e.update)}function ps(e){var t=e.cm,n=t.display;e.updatedDisplay&&Vn(t),e.barMeasure=xn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=qo(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Yt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-wr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function gs(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=fn(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Gt(t.mode,r.state):null,s=vo(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var v=!l||l.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),k=0;!v&&kn)return kn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Dt(e,function(){for(var o=0;o=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&el(e)==0)return!1;cl(e)&&(hr(e),t.dims=Pi(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),$t&&(o=Si(e.doc,o),l=Ao(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;is(e,o,l),n.viewOffset=er(ce(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=el(e);if(!a&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=xs(e);return s>4&&(n.lineDiv.style.display="none"),ks(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,bs(u),D(n.cursorDiv),D(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,kn(e,400)),n.updateLineNumbers=null,!0}function ul(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==wr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Di(e.display)-Mi(e),n.top)}),t.visible=$n(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=$n(e.display,e.doc,n));if(!ji(e,t))break;Vn(e);var i=xn(e);vn(e),Xr(e,i),Gi(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ki(e,t){var n=new ti(e,t);if(ji(e,n)){Vn(e),ul(e,n);var r=xn(e);vn(e),Xr(e,r),Gi(e,r),n.finish()}}function ks(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(M){var E=M.nextSibling;return _&&se&&e.display.currentWheelTarget==M?M.style.display="none":M.parentNode.removeChild(M),E}for(var s=r.view,u=r.viewFrom,h=0;h-1&&(x=!1),Io(e,v,u,n)),x&&(D(v.lineNumber),v.lineNumber.appendChild(document.createTextNode(W(e.options,u)))),l=v.node.nextSibling}u+=v.size}for(;l;)l=a(l)}function Ui(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ot(e,"gutterChanged",e)}function Gi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Yt(e)+"px"}function fl(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ii(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),b&&N<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!_&&!(I&&ne)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Xi(r.gutters,r.lineNumbers),dl(i),n.init(i)}var ri=0,rr=null;b?rr=-.53:I?rr=15:O?rr=-.7:X&&(rr=-1/3);function hl(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function Ss(e){var t=hl(e);return t.x*=rr,t.y*=rr,t}function pl(e,t){O&&q==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=hl(t),r=n.x,i=n.y,o=rr;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var l=e.display,a=l.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||i&&u){if(i&&se&&_){e:for(var h=t.target,v=l.view;h!=a;h=h.parentNode)for(var k=0;k=0&&Z(e,r.to())<=0)return n}return-1};var He=function(e,t){this.anchor=e,this.head=t};He.prototype.from=function(){return _r(this.anchor,this.head)},He.prototype.to=function(){return xt(this.anchor,this.head)},He.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Kt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(k,x){return Z(k.from(),x.from())}),n=oe(t,i);for(var o=1;o0:s>=0){var u=_r(a.from(),l.from()),h=xt(a.to(),l.to()),v=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new He(v?h:u,v?u:h))}}return new At(t,n)}function pr(e,t){return new At([new He(e,t||e)],0)}function gr(e){return e.text?L(e.from.line+e.text.length-1,ge(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function gl(e,t){if(Z(e,t.from)<0)return e;if(Z(e,t.to)<=0)return gr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=gr(t).ch-t.to.ch),L(n,r)}function Yi(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,M-1),e.insert(a.line+1,U)}ot(e,"change",e,t)}function vr(e,t,n){function r(i,o,l){if(i.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ge(e.done)}function kl(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,l,a;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=Cs(i,i.lastOp==r)))a=ge(l.changes),Z(t.from,t.to)==0&&Z(t.from,a.to)==0?a.to=gr(t):l.changes.push(Ji(e,t));else{var s=ge(i.done);for((!s||!s.ranges)&&ii(e.sel,i.done),l={changes:[Ji(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ye(e,"historyAdded")}function Ds(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ms(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Ds(e,o,ge(i.done),t))?i.done[i.done.length-1]=t:ii(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&bl(i.undone)}function ii(e,t){var n=ge(t);n&&n.ranges&&n.equals(e)||t.push(e)}function wl(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function Fs(e){if(!e)return null;for(var t,n=0;n-1&&(ge(a)[v]=u[v],delete u[v])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=Z(t,i)<0;o!=Z(n,i)<0?(i=t,t=n):o!=Z(t,n)<0&&(t=n)}return new He(i,t)}else return new He(n||t,t)}function oi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),pt(e,new At([Vi(e.sel.primary(),t,n,i)],0),r)}function Tl(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(Ye(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!s.atomic)continue;if(n){var v=s.find(r<0?1:-1),k=void 0;if((r<0?h:u)&&(v=Al(e,v,-r,v&&v.line==t.line?o:null)),v&&v.line==t.line&&(k=Z(v,n))&&(r<0?k<0:k>0))return Zr(e,v,t,r,i)}var x=s.find(r<0?-1:1);return(r<0?u:h)&&(x=Al(e,x,r,x.line==t.line?o:null)),x?Zr(e,x,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,l=Zr(e,t,n,o,i)||!i&&Zr(e,t,n,o,!0)||Zr(e,t,n,-o,i)||!i&&Zr(e,t,n,-o,!0);return l||(e.cantEdit=!0,L(e.first,0))}function Al(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Ce(e,L(t.line-1)):null:n>0&&t.ch==(r||ce(e,t.line)).text.length?t.line=0;--i)Ol(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Ol(e,t)}}function Ol(e,t){if(!(t.text.length==1&&t.text[0]==""&&Z(t.from,t.to)==0)){var n=Yi(e,t);kl(e,t,n,e.cm?e.cm.curOp.id:NaN),Tn(e,t,n,ki(e,t));var r=[];vr(e,function(i,o){!o&&oe(r,i.history)==-1&&(Bl(i.history,t),r.push(i.history)),Tn(i,t,null,ki(i,t))})}}function si(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,l=e.sel,a=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u=0;--x){var M=k(x);if(M)return M.v}}}}function Pl(e,t){if(t!=0&&(e.first+=t,e.sel=new At(Pe(e.sel.ranges,function(i){return new He(L(i.anchor.line+t,i.anchor.ch),L(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){bt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:L(o,ce(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Vt(e,t.from,t.to),n||(n=Yi(e,t)),e.cm?Ns(e.cm,t,r):Qi(e,t,r),li(e,n,Ve),e.cantEdit&&ai(e,L(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ns(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=f(qt(ce(r,o.line))),r.iter(s,l.line+1,function(x){if(x==i.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ot(e),Qi(r,t,n,$o(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(x){var M=Un(x);M>i.maxLineLength&&(i.maxLine=x,i.maxLineLength=M,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),ka(r,o.line),kn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?bt(e):o.line==l.line&&t.text.length==1&&!ml(e.doc,t)?dr(e,o.line,"text"):bt(e,o.line,l.line+1,u);var h=Ct(e,"changes"),v=Ct(e,"change");if(v||h){var k={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};v&&ot(e,"change",e,k),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(k)}e.display.selForContextMenu=null}function Jr(e,t,n,r,i){var o;r||(r=n),Z(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Qr(e,{from:n,to:r,text:t,origin:i})}function Il(e,t,n,r){n1||!(this.children[0]instanceof Cn))){var a=[];this.collapse(a),this.children=[new Cn(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=i.lines.length%25+25,a=l;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&bt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ml(e.doc)),e&&ot(e,"markerCleared",e,this,r,i),t&&Fr(e),this.parent&&this.parent.clear()}},mr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=S("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Fo(e,t.line,t,n,o)||t.line!=n.line&&Fo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Sa()}o.addToHistory&&kl(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,n.line+1,function(v){s&&o.collapsed&&!s.options.lineWrapping&&qt(v)==s.display.maxLine&&(u=!0),o.collapsed&&a!=t.line&&Ft(v,0),La(v,new Rn(o,a==t.line?t.ch:null,a==n.line?n.ch:null),e.cm&&e.cm.curOp),++a}),o.collapsed&&e.iter(t.line,n.line+1,function(v){cr(e,v)&&Ft(v,0)}),o.clearOnEnter&&ve(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(wa(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++_l,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)bt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)dr(s,h,"text");o.atomic&&Ml(s.doc),ot(s,"markerAdded",s,o)}return o}var Fn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)Qr(this,r[s]);a?Cl(this,a):this.cm&&Gr(this.cm)}),undo:at(function(){si(this,"undo")}),redo:at(function(){si(this,"redo")}),undoSelection:at(function(){si(this,"undo",!0)}),redoSelection:at(function(){si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Ce(this,e),t=Ce(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n}),Ce(this,L(n,t))},indexFromPos:function(e){e=Ce(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var h=e.dataTransfer.getData("Text");if(h){var v;if(t.state.draggingText&&!t.state.draggingText.copy&&(v=t.listSelections()),li(t.doc,pr(n,n)),v)for(var k=0;k=0;a--)Jr(e.doc,"",r[a].from,r[a].to,"+delete");Gr(e)})}function eo(e,t,n){var r=Lt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new L(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=We(n,t.doc.direction);if(o){var l=i<0?ge(o):o[0],a=i<0==(l.level==1),s=a?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){var h=qr(t,n);u=i<0?n.text.length-1:0;var v=Zt(t,h,u).top;u=Nt(function(k){return Zt(t,h,k).top==v},i<0==(l.level==1)?l.from:l.to-1,u),s=="before"&&(u=eo(n,u,1))}else u=i<0?l.to:l.from;return new L(r,u,s)}}return new L(r,i<0?n.text.length:0,i<0?"before":"after")}function Gs(e,t,n,r){var i=We(t,e.doc.direction);if(!i)return to(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=lr(i,n.ch,n.sticky),l=i[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>n.ch:l.from=l.from&&k>=h.begin)){var x=v?"before":"after";return new L(n.line,k,x)}}var M=function(U,J,G){for(var ee=function(Ke,st){return st?new L(n.line,a(Ke,1),"before"):new L(n.line,Ke,"after")};U>=0&&U0==(me.level!=1),Fe=pe?G.begin:a(G.end,-1);if(me.from<=Fe&&Fe0?h.end:a(h.begin,-1);return R!=null&&!(r>0&&R==t.text.length)&&(E=M(r>0?0:i.length-1,r,u(R)),E)?E:null}var Nn={selectAll:El,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ve)},killLine:function(e){return en(e,function(t){if(t.empty()){var n=ce(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new L(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),L(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=ce(e.doc,i.line-1).text;l&&(i=new L(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),L(i.line-1,l.length-1),i,"+transpose"))}}n.push(new He(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Dt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&Z(t,this.pos)==0&&n==this.button};var Pn,In;function $s(e,t){var n=+new Date;return In&&In.compare(n,e,t)?(Pn=In=null,"triple"):Pn&&Pn.compare(n,e,t)?(In=new io(n,e,t),Pn=null,"double"):(Pn=new io(n,e,t),In=null,"single")}function ta(e){var t=this,n=t.display;if(!(Ze(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,tr(n,e)){_||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=Tr(t,e),i=Wt(e),o=r?$s(r,i):"single";j(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&eu(t,i,r,o,e))&&(i==1?r?ru(t,r,o,e):ln(e)==n.scroller&&ht(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(fe?t.display.input.onContextMenu(e):_i(t)))}}}function eu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,On(e,Gl(o,i),i,function(l){if(typeof l=="string"&&(l=Nn[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,n)!=qe}finally{e.state.suppressEdits=!1}return a})}function tu(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=Ae?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=se?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(se?n.altKey:n.ctrlKey)),i}function ru(e,t,n,r){b?setTimeout(ue(rl,e),0):e.curOp.focus=y(Y(e));var i=tu(e,n,r),o=e.doc.sel,l;e.options.dragDrop&&mi&&!e.isReadOnly()&&n=="single"&&(l=o.contains(t))>-1&&(Z((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(Z(l.to(),t)>0||t.xRel<0)?nu(e,r,t,i):iu(e,r,t,i)}function nu(e,t,n,r){var i=e.display,o=!1,l=lt(e,function(u){_&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:_i(e)),dt(i.wrapper.ownerDocument,"mouseup",l),dt(i.wrapper.ownerDocument,"mousemove",a),dt(i.scroller,"dragstart",s),dt(i.scroller,"drop",l),o||(ht(u),r.addNew||oi(e.doc,n,null,null,r.extend),_&&!X||b&&N==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),a=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};_&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,ve(i.wrapper.ownerDocument,"mouseup",l),ve(i.wrapper.ownerDocument,"mousemove",a),ve(i.scroller,"dragstart",s),ve(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ra(e,t,n){if(n=="char")return new He(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new He(L(t.line,0),Ce(e.doc,L(t.line+1,0)));var r=n(e,t);return new He(r.from,r.to)}function iu(e,t,n,r){b&&_i(e);var i=e.display,o=e.doc;ht(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),a>-1?l=u[a]:l=new He(n,n)):(l=o.sel.primary(),a=o.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new He(n,n)),n=Tr(e,t,!0,!0),a=-1;else{var h=ra(e,n,r.unit);r.extend?l=Vi(l,h.anchor,h.head,r.extend):l=h}r.addNew?a==-1?(a=u.length,pt(o,Kt(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(pt(o,Kt(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,a,l,ct):(a=0,pt(o,new At([l],0),ct),s=o.sel);var v=n;function k(G){if(Z(v,G)!=0)if(v=G,r.unit=="rectangle"){for(var ee=[],me=e.options.tabSize,pe=Le(ce(o,n.line).text,n.ch,me),Fe=Le(ce(o,G.line).text,G.ch,me),Ke=Math.min(pe,Fe),st=Math.max(pe,Fe),Xe=Math.min(n.line,G.line),Mt=Math.min(e.lastLine(),Math.max(n.line,G.line));Xe<=Mt;Xe++){var wt=ce(o,Xe).text,tt=Re(wt,Ke,me);Ke==st?ee.push(new He(L(Xe,tt),L(Xe,tt))):wt.length>tt&&ee.push(new He(L(Xe,tt),L(Xe,Re(wt,st,me))))}ee.length||ee.push(new He(n,n)),pt(o,Kt(e,s.ranges.slice(0,a).concat(ee),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(G)}else{var St=l,ft=ra(e,G,r.unit),nt=St.anchor,rt;Z(ft.anchor,nt)>0?(rt=ft.head,nt=_r(St.from(),ft.anchor)):(rt=ft.anchor,nt=xt(St.to(),ft.head));var Je=s.ranges.slice(0);Je[a]=ou(e,new He(Ce(o,nt),rt)),pt(o,Kt(e,Je,a),ct)}}var x=i.wrapper.getBoundingClientRect(),M=0;function E(G){var ee=++M,me=Tr(e,G,!0,r.unit=="rectangle");if(me)if(Z(me,v)!=0){e.curOp.focus=y(Y(e)),k(me);var pe=$n(i,o);(me.line>=pe.to||me.linex.bottom?20:0;Fe&&setTimeout(lt(e,function(){M==ee&&(i.scroller.scrollTop+=Fe,E(G))}),50)}}function R(G){e.state.selectingText=!1,M=1/0,G&&(ht(G),i.input.focus()),dt(i.wrapper.ownerDocument,"mousemove",U),dt(i.wrapper.ownerDocument,"mouseup",J),o.history.lastSelOrigin=null}var U=lt(e,function(G){G.buttons===0||!Wt(G)?R(G):E(G)}),J=lt(e,R);e.state.selectingText=J,ve(i.wrapper.ownerDocument,"mousemove",U),ve(i.wrapper.ownerDocument,"mouseup",J)}function ou(e,t){var n=t.anchor,r=t.head,i=ce(e.doc,n.line);if(Z(n,r)==0&&n.sticky==r.sticky)return t;var o=We(i);if(!o)return t;var l=lr(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s=l+(a.from==n.ch==(a.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=lr(o,r.ch,r.sticky),v=h-l||(r.ch-n.ch)*(a.level==1?-1:1);h==s-1||h==s?u=v<0:u=v>0}var k=o[s+(u?-1:0)],x=u==(k.level==1),M=x?k.from:k.to,E=x?"after":"before";return n.ch==M&&n.sticky==E?t:new He(new L(n.line,M,E),r)}function na(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ht(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!Ct(e,n))return yt(t);o-=a.top-l.viewOffset;for(var s=0;s=i){var h=g(e.doc,o),v=e.display.gutterSpecs[s];return Ye(e,n,e,h,v.className,t),yt(t)}}}function oo(e,t){return na(e,t,"gutterClick",!0)}function ia(e,t){tr(e.display,t)||lu(e,t)||Ze(e,t,"contextmenu")||fe||e.display.input.onContextMenu(t)}function lu(e,t){return Ct(e,"gutterContextMenu")?na(e,t,"gutterContextMenu",!1):!1}function oa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gn(e)}var tn={toString:function(){return"CodeMirror.Init"}},la={},di={};function au(e){var t=e.optionHandlers;function n(r,i,o,l){e.defaults[r]=i,o&&(t[r]=l?function(a,s,u){u!=tn&&o(a,s,u)}:o)}e.defineOption=n,e.Init=tn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Zi(r)},!0),n("indentUnit",2,Zi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Sn(r),gn(r),bt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],l=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(L(l,h))}l++});for(var a=o.length-1;a>=0;a--)Jr(r.doc,i,o[a],L(o[a].line,o[a].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=tn&&r.refresh()}),n("specialCharPlaceholder",za,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",ne?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!ye),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){oa(r),wn(r)},!0),n("keyMap","default",function(r,i,o){var l=fi(i),a=o!=tn&&fi(o);a&&a.detach&&a.detach(r,l),l.attach&&l.attach(r,a||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,uu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Xi(i,r.options.lineNumbers),wn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Ii(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Xr(r)},!0),n("scrollbarStyle","native",function(r){sl(r),Xr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Xi(r.options.gutters,i),wn(r)},!0),n("firstLineNumber",1,wn,!0),n("lineNumberFormatter",function(r){return r},wn,!0),n("showCursorWhenSelecting",!1,vn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Ur(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,su),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vn,!0),n("singleCursorHeightPerLine",!0,vn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Sn,!0),n("addModeClass",!1,Sn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Sn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function su(e,t,n){var r=n&&n!=tn;if(!t!=!r){var i=e.display.dragFunctions,o=t?ve:dt;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function uu(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ee(e.display.wrapper,"CodeMirror-wrap"),Li(e)),zi(e),bt(e),gn(e),setTimeout(function(){return Xr(e)},100)}function Ge(e,t){var n=this;if(!(this instanceof Ge))return new Ge(e,t);this.options=t=t?Te(t):{},Te(la,t,!1);var r=t.value;typeof r=="string"?r=new kt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ge.inputStyles[t.inputStyle](this),o=this.display=new ws(e,r,i,t);o.wrapper.CodeMirror=this,oa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),sl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new be,keySeq:null,specialChars:null},t.autofocus&&!ne&&o.input.focus(),b&&N<11&&setTimeout(function(){return n.display.input.reset(!0)},20),fu(this),Rs(),Mr(this),this.curOp.forceUpdate=!0,yl(this,r),t.autofocus&&!ne||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Hi(n)},20):Ur(this);for(var l in di)di.hasOwnProperty(l)&&di[l](this,t[l],tn);cl(this),t.finishInit&&t.finishInit(this);for(var a=0;a20*20}ve(t.scroller,"touchstart",function(s){if(!Ze(e,s)&&!o(s)&&!oo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),ve(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ve(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!tr(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),v;!u.prev||l(u,u.prev)?v=new He(h,h):!u.prev.prev||l(u,u.prev.prev)?v=e.findWordAt(h):v=new He(L(h.line,0),Ce(e.doc,L(h.line+1,0))),e.setSelection(v.anchor,v.head),e.focus(),ht(s)}i()}),ve(t.scroller,"touchcancel",i),ve(t.scroller,"scroll",function(){t.scroller.clientHeight&&(yn(e,t.scroller.scrollTop),Cr(e,t.scroller.scrollLeft,!0),Ye(e,"scroll",e))}),ve(t.scroller,"mousewheel",function(s){return pl(e,s)}),ve(t.scroller,"DOMMouseScroll",function(s){return pl(e,s)}),ve(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Ze(e,s)||ar(s)},over:function(s){Ze(e,s)||(Hs(e,s),ar(s))},start:function(s){return _s(e,s)},drop:lt(e,Ws),leave:function(s){Ze(e,s)||ql(e)}};var a=t.input.getField();ve(a,"keyup",function(s){return $l.call(e,s)}),ve(a,"keydown",lt(e,Vl)),ve(a,"keypress",lt(e,ea)),ve(a,"focus",function(s){return Hi(e,s)}),ve(a,"blur",function(s){return Ur(e,s)})}var lo=[];Ge.defineInitHook=function(e){return lo.push(e)};function zn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=fn(e,t).state:n="prev");var l=e.options.tabSize,a=ce(i,t),s=Le(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(a.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,a.text.slice(u.length),a.text),h==qe||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=Le(ce(i,t-1).text,null,l):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var v="",k=0;if(e.options.indentWithTabs)for(var x=Math.floor(h/l);x;--x)k+=l,v+=" ";if(kl,s=Pt(t),u=null;if(a&&r.ranges.length>1)if(Ut&&Ut.text.join(` +`)==t){if(r.ranges.length%Ut.text.length==0){u=[];for(var h=0;h=0;k--){var x=r.ranges[k],M=x.from(),E=x.to();x.empty()&&(n&&n>0?M=L(M.line,M.ch-n):e.state.overwrite&&!a?E=L(E.line,Math.min(ce(o,E.line).text.length,E.ch+ge(s).length)):a&&Ut&&Ut.lineWise&&Ut.text.join(` +`)==s.join(` +`)&&(M=E=L(M.line,0)));var R={from:M,to:E,text:u?u[k%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Qr(e.doc,R),ot(e,"inputRead",e,R)}t&&!a&&sa(e,t),Gr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=v),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function aa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Dt(t,function(){return ao(t,n,0,null,"paste")}),!0}function sa(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a-1){l=zn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ce(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=zn(e,i.head.line,"smart"));l&&ot(e,"electricInput",e,i.head.line)}}}function ua(e){for(var t=[],n=[],r=0;ro&&(zn(this,a.head.line,r,!0),o=a.head.line,l==this.doc.sel.primIndex&&Gr(this));else{var s=a.from(),u=a.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var v=h;v0&&$i(this.doc,l,new He(s,k[l].to()),Ve)}}}),getTokenAt:function(r,i){return bo(this,r,i)},getLineTokens:function(r,i){return bo(this,L(r),i,!0)},getTokenTypeAt:function(r){r=Ce(this.doc,r);var i=mo(this,ce(this.doc,r.line)),o=0,l=(i.length-1)/2,a=r.ch,s;if(a==0)s=i[2];else for(;;){var u=o+l>>1;if((u?i[u*2-1]:0)>=a)l=u;else if(i[u*2+1]s&&(r=s,l=!0),a=ce(this.doc,r)}else a=r;return Yn(this,a,{top:0,left:0},i||"page",o||l).top+(l?this.doc.height-er(a):0)},defaultTextHeight:function(){return jr(this.display)},defaultCharWidth:function(){return Kr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,l,a){var s=this.display;r=jt(this,Ce(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),l=="over")u=r.top;else if(l=="above"||l=="near"){var v=Math.max(s.wrapper.clientHeight,this.doc.height),k=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(l=="above"||r.bottom+i.offsetHeight>v)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=v&&(u=r.bottom),h+i.offsetWidth>k&&(h=k-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",a=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(a=="left"?h=0:a=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&ss(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:vt(Vl),triggerOnKeyPress:vt(ea),triggerOnKeyUp:$l,triggerOnMouseDown:vt(ta),execCommand:function(r){if(Nn.hasOwnProperty(r))return Nn[r].call(null,this)},triggerElectric:vt(function(r){sa(this,r)}),findPosH:function(r,i,o,l){var a=1;i<0&&(a=-1,i=-i);for(var s=Ce(this.doc,r),u=0;u0&&h(o.charAt(l-1));)--l;for(;a.5||this.options.lineWrapping)&&zi(this),Ye(this,"refresh",this)}),swapDoc:vt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),yl(this,r),gn(this),this.display.input.reset(),mn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ot(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Bt(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,l){e.registerHelper(r,i,l),n[r]._global.push({pred:o,val:l})}}function uo(e,t,n,r,i){var o=t,l=n,a=ce(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var J=t.line+s;return J=e.first+e.size?!1:(t=new L(J,t.ch,t.sticky),a=ce(e,J))}function h(J){var G;if(r=="codepoint"){var ee=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(ee))G=null;else{var me=n>0?ee>=55296&&ee<56320:ee>=56320&&ee<57343;G=new L(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(me?2:1))),-n)}}else i?G=Gs(e.cm,a,t,n):G=to(a,t,n);if(G==null)if(!J&&u())t=ro(i,e.cm,a,t.line,s);else return!1;else t=G;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var v=null,k=r=="group",x=e.cm&&e.cm.getHelper(t,"wordChars"),M=!0;!(n<0&&!h(!M));M=!1){var E=a.text.charAt(t.ch)||` +`,R=Se(E,x)?"w":k&&E==` +`?"n":!k||/\s/.test(E)?null:"p";if(k&&!M&&!R&&(R="s"),v&&v!=R){n<0&&(n=1,h(),t.sticky="after");break}if(R&&(v=R),n>0&&!h(!M))break}var U=ai(e,t,o,l,!0);return _e(o,U)&&(U.hitSide=!0),U}function ca(e,t,n,r){var i=e.doc,o=t.left,l;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,j(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(a-.5*jr(e.display),3);l=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var u;u=Ni(e,o,l),!!u.outside;){if(n<0?l<=0:l>=i.height){u.hitSide=!0;break}l+=n*5}return u}var je=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new be,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};je.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,so(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(a){for(var s=a.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}ve(i,"paste",function(a){!o(a)||Ze(r,a)||aa(a,r)||N<=11&&setTimeout(lt(r,function(){return t.updateFromDOM()}),20)}),ve(i,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),ve(i,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),ve(i,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ve(i,"touchstart",function(){return n.forceCompositionEnd()}),ve(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||Ze(r,a))){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=ua(r);hi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ve),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=Ut.text.join(` +`);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var h=fa(),v=h.firstChild;so(v),r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),v.value=Ut.text.join(` +`);var k=y(xe(i));p(v),setTimeout(function(){r.display.lineSpace.removeChild(h),k.focus(),k==i&&n.showPrimarySelection()},50)}}ve(i,"copy",l),ve(i,"cut",l)},je.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},je.prototype.prepareSelection=function(){var e=tl(this.cm,!1);return e.focus=y(xe(this.div))==this.div,e},je.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},je.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},je.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&da(t,r)||{node:a[0].measure.map[2],offset:0},u=i.linee.firstLine()&&(r=L(r.line-1,ce(e.doc,r.line-1).length)),i.ch==ce(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,l,a;r.line==t.viewFrom||(o=Lr(e,r.line))==0?(l=f(t.view[0].line),a=t.view[0].node):(l=f(t.view[o].line),a=t.view[o-1].node.nextSibling);var s=Lr(e,i.line),u,h;if(s==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=f(t.view[s+1].line)-1,h=t.view[s+1].node.previousSibling),!a)return!1;for(var v=e.doc.splitLines(hu(e,a,h,l,u)),k=Vt(e.doc,L(l,0),L(u,ce(e.doc,u).text.length));v.length>1&&k.length>1;)if(ge(v)==ge(k))v.pop(),k.pop(),u--;else if(v[0]==k[0])v.shift(),k.shift(),l++;else break;for(var x=0,M=0,E=v[0],R=k[0],U=Math.min(E.length,R.length);xr.ch&&J.charCodeAt(J.length-M-1)==G.charCodeAt(G.length-M-1);)x--,M++;v[v.length-1]=J.slice(0,J.length-M).replace(/^\u200b+/,""),v[0]=v[0].slice(x).replace(/\u200b+$/,"");var me=L(l,x),pe=L(u,k.length?ge(k).length-M:0);if(v.length>1||v[0]||Z(me,pe))return Jr(e.doc,v,me,pe,"+input"),!0},je.prototype.ensurePolled=function(){this.forceCompositionEnd()},je.prototype.reset=function(){this.forceCompositionEnd()},je.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},je.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},je.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Dt(this.cm,function(){return bt(e.cm)})},je.prototype.setUneditable=function(e){e.contentEditable="false"},je.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||lt(this.cm,ao)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},je.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},je.prototype.onContextMenu=function(){},je.prototype.resetPosition=function(){},je.prototype.needsContentAttribute=!0;function da(e,t){var n=Fi(e,t.line);if(!n||n.hidden)return null;var r=ce(e.doc,t.line),i=Ro(n,r,t.line),o=We(r,e.doc.direction),l="left";if(o){var a=lr(o,t.ch);l=a%2?"right":"left"}var s=Ko(i.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function du(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function rn(e,t){return t&&(e.bad=!0),e}function hu(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(x){return function(M){return M.id==x}}function h(){l&&(o+=a,s&&(o+=a),l=s=!1)}function v(x){x&&(h(),o+=x)}function k(x){if(x.nodeType==1){var M=x.getAttribute("cm-text");if(M){v(M);return}var E=x.getAttribute("cm-marker"),R;if(E){var U=e.findMarks(L(r,0),L(i+1,0),u(+E));U.length&&(R=U[0].find(0))&&v(Vt(e.doc,R.from,R.to).join(a));return}if(x.getAttribute("contenteditable")=="false")return;var J=/^(pre|div|p|li|table|br)$/i.test(x.nodeName);if(!/^br$/i.test(x.nodeName)&&x.textContent.length==0)return;J&&h();for(var G=0;G=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),ve(i,"paste",function(l){Ze(r,l)||aa(l,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(l){if(!Ze(r,l)){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=ua(r);hi({lineWise:!0,text:a.text}),l.type=="cut"?r.setSelections(a.ranges,null,Ve):(n.prevInput="",i.value=a.text.join(` +`),p(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}ve(i,"cut",o),ve(i,"copy",o),ve(e.scroller,"paste",function(l){if(!(tr(e,l)||Ze(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),ve(e.lineSpace,"selectstart",function(l){tr(e,l)||ht(l)}),ve(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),ve(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},$e.prototype.createField=function(e){this.wrapper=fa(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},$e.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$e.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=tl(e);if(e.options.moveInputWithCursor){var i=jt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},$e.prototype.showSelection=function(e){var t=this.cm,n=t.display;Q(n.cursorDiv,e.cursors),Q(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$e.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&p(this.textarea),b&&N>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",b&&N>=9&&(this.hasSelection=null));this.resetting=!1}},$e.prototype.getField=function(){return this.textarea},$e.prototype.supportsTouch=function(){return!1},$e.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ne||y(xe(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},$e.prototype.blur=function(){this.textarea.blur()},$e.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$e.prototype.receivedFocus=function(){this.slowPoll()},$e.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},$e.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},$e.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||ur(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(b&&N>=9&&this.hasSelection===i||se&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="​"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(r.length,i.length);l1e3||i.indexOf(` +`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},$e.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$e.prototype.onKeyPress=function(){b&&N>=9&&(this.hasSelection=null),this.fastPoll()},$e.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Tr(n,e),l=r.scroller.scrollTop;if(!o||z)return;var a=n.options.resetSelectionOnContextMenu;a&&n.doc.sel.contains(o)==-1&<(n,pt)(n.doc,pr(o),Ve);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; + top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px; + z-index: 1000; background: `+(b?"rgba(255, 255, 255, .05)":"transparent")+`; + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var v;_&&(v=i.ownerDocument.defaultView.scrollY),r.input.focus(),_&&i.ownerDocument.defaultView.scrollTo(null,v),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=x,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function k(){if(i.selectionStart!=null){var E=n.somethingSelected(),R="​"+(E?i.value:"");i.value="⇚",i.value=R,t.prevInput=E?"":"​",i.selectionStart=1,i.selectionEnd=R.length,r.selForContextMenu=n.doc.sel}}function x(){if(t.contextMenuPending==x&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,b&&N<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!b||b&&N<9)&&k();var E=0,R=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?lt(n,El)(n):E++<10?r.detectingSelectAll=setTimeout(R,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(R,200)}}if(b&&N>=9&&k(),fe){ar(e);var M=function(){dt(window,"mouseup",M),setTimeout(x,20)};ve(window,"mouseup",M)}else setTimeout(x,50)},$e.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},$e.prototype.setUneditable=function(){},$e.prototype.needsContentAttribute=!1;function gu(e,t){if(t=t?Te(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=y(xe(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(ve(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(dt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=Ge(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function vu(e){e.off=dt,e.on=ve,e.wheelEventPixels=Ss,e.Doc=kt,e.splitLines=Pt,e.countColumn=Le,e.findColumn=Re,e.isWordChar=ae,e.Pass=qe,e.signal=Ye,e.Line=Hr,e.changeEnd=gr,e.scrollbarModel=al,e.Pos=L,e.cmpPos=Z,e.modes=Pr,e.mimeModes=Ht,e.resolveMode=Ir,e.getMode=zr,e.modeExtensions=fr,e.extendMode=Br,e.copyState=Gt,e.startState=Wr,e.innerMode=sn,e.commands=Nn,e.keyMap=nr,e.keyName=Xl,e.isModifierKey=Ul,e.lookupKey=$r,e.normalizeKeyMap=Us,e.StringStream=Qe,e.SharedTextMarker=Fn,e.TextMarker=mr,e.LineWidget=Mn,e.e_preventDefault=ht,e.e_stopPropagation=Nr,e.e_stop=ar,e.addClass=P,e.contains=m,e.rmClass=Ee,e.keyNames=yr}au(Ge),cu(Ge);var mu="iter insert remove copy getEditor constructor".split(" ");for(var gi in kt.prototype)kt.prototype.hasOwnProperty(gi)&&oe(mu,gi)<0&&(Ge.prototype[gi]=function(e){return function(){return e.apply(this.doc,arguments)}}(kt.prototype[gi]));return Bt(kt),Ge.inputStyles={textarea:$e,contenteditable:je},Ge.defineMode=function(e){!Ge.defaults.mode&&e!="null"&&(Ge.defaults.mode=e),Rt.apply(this,arguments)},Ge.defineMIME=kr,Ge.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ge.defineMIME("text/plain","null"),Ge.defineExtension=function(e,t){Ge.prototype[e]=t},Ge.defineDocExtension=function(e,t){kt.prototype[e]=t},Ge.fromTextArea=gu,vu(Ge),Ge.version="5.65.18",Ge})}(ho)),ho.exports}var bu=It();const Du=xu(bu);var ku={exports:{}};(function(Et,zt){(function(C){C(It())})(function(C){C.defineMode("css",function(fe,H){var Ee=H.inline;H.propertyKeywords||(H=C.resolveMode("text/css"));var D=fe.indentUnit,Q=H.tokenHooks,d=H.documentTypes||{},S=H.mediaTypes||{},w=H.mediaFeatures||{},m=H.mediaValueKeywords||{},y=H.propertyKeywords||{},P=H.nonStandardPropertyKeywords||{},le=H.fontProperties||{},p=H.counterDescriptors||{},c=H.colorKeywords||{},Y=H.valueKeywords||{},xe=H.allowNested,j=H.lineComment,ue=H.supportsAtComponent===!0,Te=fe.highlightNonStandardPropertyKeywords!==!1,Le,be;function oe(T,B){return Le=B,T}function Ne(T,B){var F=T.next();if(Q[F]){var Ie=Q[F](T,B);if(Ie!==!1)return Ie}if(F=="@")return T.eatWhile(/[\w\\\-]/),oe("def",T.current());if(F=="="||(F=="~"||F=="|")&&T.eat("="))return oe(null,"compare");if(F=='"'||F=="'")return B.tokenize=qe(F),B.tokenize(T,B);if(F=="#")return T.eatWhile(/[\w\\\-]/),oe("atom","hash");if(F=="!")return T.match(/^\s*\w*/),oe("keyword","important");if(/\d/.test(F)||F=="."&&T.eat(/\d/))return T.eatWhile(/[\w.%]/),oe("number","unit");if(F==="-"){if(/[\d.]/.test(T.peek()))return T.eatWhile(/[\w.%]/),oe("number","unit");if(T.match(/^-[\w\\\-]*/))return T.eatWhile(/[\w\\\-]/),T.match(/^\s*:/,!1)?oe("variable-2","variable-definition"):oe("variable-2","variable");if(T.match(/^\w+-/))return oe("meta","meta")}else return/[,+>*\/]/.test(F)?oe(null,"select-op"):F=="."&&T.match(/^-?[_a-z][_a-z0-9-]*/i)?oe("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(F)?oe(null,F):T.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(T.current())&&(B.tokenize=Ve),oe("variable callee","variable")):/[\w\\\-]/.test(F)?(T.eatWhile(/[\w\\\-]/),oe("property","word")):oe(null,null)}function qe(T){return function(B,F){for(var Ie=!1,ae;(ae=B.next())!=null;){if(ae==T&&!Ie){T==")"&&B.backUp(1);break}Ie=!Ie&&ae=="\\"}return(ae==T||!Ie&&T!=")")&&(F.tokenize=null),oe("string","string")}}function Ve(T,B){return T.next(),T.match(/^\s*[\"\')]/,!1)?B.tokenize=null:B.tokenize=qe(")"),oe(null,"(")}function ct(T,B,F){this.type=T,this.indent=B,this.prev=F}function Oe(T,B,F,Ie){return T.context=new ct(F,B.indentation()+(Ie===!1?0:D),T.context),F}function Re(T){return T.context.prev&&(T.context=T.context.prev),T.context.type}function Ue(T,B,F){return Pe[F.context.type](T,B,F)}function et(T,B,F,Ie){for(var ae=Ie||1;ae>0;ae--)F.context=F.context.prev;return Ue(T,B,F)}function ge(T){var B=T.current().toLowerCase();Y.hasOwnProperty(B)?be="atom":c.hasOwnProperty(B)?be="keyword":be="variable"}var Pe={};return Pe.top=function(T,B,F){if(T=="{")return Oe(F,B,"block");if(T=="}"&&F.context.prev)return Re(F);if(ue&&/@component/i.test(T))return Oe(F,B,"atComponentBlock");if(/^@(-moz-)?document$/i.test(T))return Oe(F,B,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(T))return Oe(F,B,"atBlock");if(/^@(font-face|counter-style)/i.test(T))return F.stateArg=T,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(T))return"keyframes";if(T&&T.charAt(0)=="@")return Oe(F,B,"at");if(T=="hash")be="builtin";else if(T=="word")be="tag";else{if(T=="variable-definition")return"maybeprop";if(T=="interpolation")return Oe(F,B,"interpolation");if(T==":")return"pseudo";if(xe&&T=="(")return Oe(F,B,"parens")}return F.context.type},Pe.block=function(T,B,F){if(T=="word"){var Ie=B.current().toLowerCase();return y.hasOwnProperty(Ie)?(be="property","maybeprop"):P.hasOwnProperty(Ie)?(be=Te?"string-2":"property","maybeprop"):xe?(be=B.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(be+=" error","maybeprop")}else return T=="meta"?"block":!xe&&(T=="hash"||T=="qualifier")?(be="error","block"):Pe.top(T,B,F)},Pe.maybeprop=function(T,B,F){return T==":"?Oe(F,B,"prop"):Ue(T,B,F)},Pe.prop=function(T,B,F){if(T==";")return Re(F);if(T=="{"&&xe)return Oe(F,B,"propBlock");if(T=="}"||T=="{")return et(T,B,F);if(T=="(")return Oe(F,B,"parens");if(T=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(B.current()))be+=" error";else if(T=="word")ge(B);else if(T=="interpolation")return Oe(F,B,"interpolation");return"prop"},Pe.propBlock=function(T,B,F){return T=="}"?Re(F):T=="word"?(be="property","maybeprop"):F.context.type},Pe.parens=function(T,B,F){return T=="{"||T=="}"?et(T,B,F):T==")"?Re(F):T=="("?Oe(F,B,"parens"):T=="interpolation"?Oe(F,B,"interpolation"):(T=="word"&&ge(B),"parens")},Pe.pseudo=function(T,B,F){return T=="meta"?"pseudo":T=="word"?(be="variable-3",F.context.type):Ue(T,B,F)},Pe.documentTypes=function(T,B,F){return T=="word"&&d.hasOwnProperty(B.current())?(be="tag",F.context.type):Pe.atBlock(T,B,F)},Pe.atBlock=function(T,B,F){if(T=="(")return Oe(F,B,"atBlock_parens");if(T=="}"||T==";")return et(T,B,F);if(T=="{")return Re(F)&&Oe(F,B,xe?"block":"top");if(T=="interpolation")return Oe(F,B,"interpolation");if(T=="word"){var Ie=B.current().toLowerCase();Ie=="only"||Ie=="not"||Ie=="and"||Ie=="or"?be="keyword":S.hasOwnProperty(Ie)?be="attribute":w.hasOwnProperty(Ie)?be="property":m.hasOwnProperty(Ie)?be="keyword":y.hasOwnProperty(Ie)?be="property":P.hasOwnProperty(Ie)?be=Te?"string-2":"property":Y.hasOwnProperty(Ie)?be="atom":c.hasOwnProperty(Ie)?be="keyword":be="error"}return F.context.type},Pe.atComponentBlock=function(T,B,F){return T=="}"?et(T,B,F):T=="{"?Re(F)&&Oe(F,B,xe?"block":"top",!1):(T=="word"&&(be="error"),F.context.type)},Pe.atBlock_parens=function(T,B,F){return T==")"?Re(F):T=="{"||T=="}"?et(T,B,F,2):Pe.atBlock(T,B,F)},Pe.restricted_atBlock_before=function(T,B,F){return T=="{"?Oe(F,B,"restricted_atBlock"):T=="word"&&F.stateArg=="@counter-style"?(be="variable","restricted_atBlock_before"):Ue(T,B,F)},Pe.restricted_atBlock=function(T,B,F){return T=="}"?(F.stateArg=null,Re(F)):T=="word"?(F.stateArg=="@font-face"&&!le.hasOwnProperty(B.current().toLowerCase())||F.stateArg=="@counter-style"&&!p.hasOwnProperty(B.current().toLowerCase())?be="error":be="property","maybeprop"):"restricted_atBlock"},Pe.keyframes=function(T,B,F){return T=="word"?(be="variable","keyframes"):T=="{"?Oe(F,B,"top"):Ue(T,B,F)},Pe.at=function(T,B,F){return T==";"?Re(F):T=="{"||T=="}"?et(T,B,F):(T=="word"?be="tag":T=="hash"&&(be="builtin"),"at")},Pe.interpolation=function(T,B,F){return T=="}"?Re(F):T=="{"||T==";"?et(T,B,F):(T=="word"?be="variable":T!="variable"&&T!="("&&T!=")"&&(be="error"),"interpolation")},{startState:function(T){return{tokenize:null,state:Ee?"block":"top",stateArg:null,context:new ct(Ee?"block":"top",T||0,null)}},token:function(T,B){if(!B.tokenize&&T.eatSpace())return null;var F=(B.tokenize||Ne)(T,B);return F&&typeof F=="object"&&(Le=F[1],F=F[0]),be=F,Le!="comment"&&(B.state=Pe[B.state](Le,T,B)),be},indent:function(T,B){var F=T.context,Ie=B&&B.charAt(0),ae=F.indent;return F.type=="prop"&&(Ie=="}"||Ie==")")&&(F=F.prev),F.prev&&(Ie=="}"&&(F.type=="block"||F.type=="top"||F.type=="interpolation"||F.type=="restricted_atBlock")?(F=F.prev,ae=F.indent):(Ie==")"&&(F.type=="parens"||F.type=="atBlock_parens")||Ie=="{"&&(F.type=="at"||F.type=="atBlock"))&&(ae=Math.max(0,F.indent-D))),ae},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:j,fold:"brace"}});function De(fe){for(var H={},Ee=0;Ee")):null:d.match("--")?w(ke("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),w(we(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),S.tokenize=ke("meta","?>"),"meta"):(ie=d.eat("/")?"closeTag":"openTag",S.tokenize=z,"tag bracket");if(m=="&"){var y;return d.eat("#")?d.eat("x")?y=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):y=d.eatWhile(/[\d]/)&&d.eat(";"):y=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),y?"atom":"error"}else return d.eatWhile(/[^&<]/),null}q.isInText=!0;function z(d,S){var w=d.next();if(w==">"||w=="/"&&d.eat(">"))return S.tokenize=q,ie=w==">"?"endTag":"selfcloseTag","tag bracket";if(w=="=")return ie="equals",null;if(w=="<"){S.tokenize=q,S.state=Ae,S.tagName=S.tagStart=null;var m=S.tokenize(d,S);return m?m+" tag error":"tag error"}else return/[\'\"]/.test(w)?(S.tokenize=X(w),S.stringStartCol=d.column(),S.tokenize(d,S)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function X(d){var S=function(w,m){for(;!w.eol();)if(w.next()==d){m.tokenize=z;break}return"string"};return S.isInAttribute=!0,S}function ke(d,S){return function(w,m){for(;!w.eol();){if(w.match(S)){m.tokenize=q;break}w.next()}return d}}function we(d){return function(S,w){for(var m;(m=S.next())!=null;){if(m=="<")return w.tokenize=we(d+1),w.tokenize(S,w);if(m==">")if(d==1){w.tokenize=q;break}else return w.tokenize=we(d-1),w.tokenize(S,w)}return"meta"}}function te(d){return d&&d.toLowerCase()}function re(d,S,w){this.prev=d.context,this.tagName=S||"",this.indent=d.indented,this.startOfLine=w,(b.doNotIndent.hasOwnProperty(S)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function ne(d){d.context&&(d.context=d.context.prev)}function se(d,S){for(var w;;){if(!d.context||(w=d.context.tagName,!b.contextGrabbers.hasOwnProperty(te(w))||!b.contextGrabbers[te(w)].hasOwnProperty(te(S))))return;ne(d)}}function Ae(d,S,w){return d=="openTag"?(w.tagStart=S.column(),ye):d=="closeTag"?de:Ae}function ye(d,S,w){return d=="word"?(w.tagName=S.current(),O="tag",H):b.allowMissingTagName&&d=="endTag"?(O="tag bracket",H(d,S,w)):(O="error",ye)}function de(d,S,w){if(d=="word"){var m=S.current();return w.context&&w.context.tagName!=m&&b.implicitlyClosed.hasOwnProperty(te(w.context.tagName))&&ne(w),w.context&&w.context.tagName==m||b.matchClosing===!1?(O="tag",ze):(O="tag error",fe)}else return b.allowMissingTagName&&d=="endTag"?(O="tag bracket",ze(d,S,w)):(O="error",fe)}function ze(d,S,w){return d!="endTag"?(O="error",ze):(ne(w),Ae)}function fe(d,S,w){return O="error",ze(d,S,w)}function H(d,S,w){if(d=="word")return O="attribute",Ee;if(d=="endTag"||d=="selfcloseTag"){var m=w.tagName,y=w.tagStart;return w.tagName=w.tagStart=null,d=="selfcloseTag"||b.autoSelfClosers.hasOwnProperty(te(m))?se(w,m):(se(w,m),w.context=new re(w,m,y==w.indented)),Ae}return O="error",H}function Ee(d,S,w){return d=="equals"?D:(b.allowMissing||(O="error"),H(d,S,w))}function D(d,S,w){return d=="string"?Q:d=="word"&&b.allowUnquoted?(O="string",H):(O="error",H(d,S,w))}function Q(d,S,w){return d=="string"?Q:H(d,S,w)}return{startState:function(d){var S={tokenize:q,state:Ae,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(S.baseIndent=d),S},token:function(d,S){if(!S.tagName&&d.sol()&&(S.indented=d.indentation()),d.eatSpace())return null;ie=null;var w=S.tokenize(d,S);return(w||ie)&&w!="comment"&&(O=null,S.state=S.state(ie||w,d,S),O&&(w=O=="error"?w+" error":O)),w},indent:function(d,S,w){var m=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+V;if(m&&m.noIndent)return C.Pass;if(d.tokenize!=z&&d.tokenize!=q)return w?w.match(/^(\s*)/)[0].length:0;if(d.tagName)return b.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+V*(b.multilineTagIndentFactor||1);if(b.alignCDATA&&/$/,blockCommentStart:"",configuration:b.htmlMode?"html":"xml",helperType:b.htmlMode?"html":"xml",skipAttribute:function(d){d.state==D&&(d.state=H)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var S=[],w=d.context;w;w=w.prev)S.push(w.tagName);return S.reverse()}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),pa.exports}var Su={exports:{}};(function(Et,zt){(function(C){C(It())})(function(C){C.defineMode("javascript",function(De,I){var K=De.indentUnit,$=I.statementIndent,V=I.jsonld,b=I.json||V,N=I.trackScope!==!1,_=I.typescript,ie=I.wordCharacters||/[\w$\xa1-\uffff]/,O=function(){function f(it){return{type:it,style:"keyword"}}var g=f("keyword a"),A=f("keyword b"),W=f("keyword c"),L=f("keyword d"),Z=f("operator"),_e={type:"atom",style:"atom"};return{if:f("if"),while:g,with:g,else:A,do:A,try:A,finally:A,return:L,break:L,continue:L,new:f("new"),delete:W,void:W,throw:W,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:Z,typeof:Z,instanceof:Z,true:_e,false:_e,null:_e,undefined:_e,NaN:_e,Infinity:_e,this:f("this"),class:f("class"),super:f("atom"),yield:W,export:f("export"),import:f("import"),extends:W,await:W}}(),q=/[+\-*&%=<>!?|~^@]/,z=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function X(f){for(var g=!1,A,W=!1;(A=f.next())!=null;){if(!g){if(A=="/"&&!W)return;A=="["?W=!0:W&&A=="]"&&(W=!1)}g=!g&&A=="\\"}}var ke,we;function te(f,g,A){return ke=f,we=A,g}function re(f,g){var A=f.next();if(A=='"'||A=="'")return g.tokenize=ne(A),g.tokenize(f,g);if(A=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return te("number","number");if(A=="."&&f.match(".."))return te("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(A))return te(A);if(A=="="&&f.eat(">"))return te("=>","operator");if(A=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return te("number","number");if(/\d/.test(A))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),te("number","number");if(A=="/")return f.eat("*")?(g.tokenize=se,se(f,g)):f.eat("/")?(f.skipToEnd(),te("comment","comment")):Ft(f,g,1)?(X(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),te("regexp","string-2")):(f.eat("="),te("operator","operator",f.current()));if(A=="`")return g.tokenize=Ae,Ae(f,g);if(A=="#"&&f.peek()=="!")return f.skipToEnd(),te("meta","meta");if(A=="#"&&f.eatWhile(ie))return te("variable","property");if(A=="<"&&f.match("!--")||A=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),te("comment","comment");if(q.test(A))return(A!=">"||!g.lexical||g.lexical.type!=">")&&(f.eat("=")?(A=="!"||A=="=")&&f.eat("="):/[<>*+\-|&?]/.test(A)&&(f.eat(A),A==">"&&f.eat(A))),A=="?"&&f.eat(".")?te("."):te("operator","operator",f.current());if(ie.test(A)){f.eatWhile(ie);var W=f.current();if(g.lastType!="."){if(O.propertyIsEnumerable(W)){var L=O[W];return te(L.type,L.style,W)}if(W=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return te("async","keyword",W)}return te("variable","variable",W)}}function ne(f){return function(g,A){var W=!1,L;if(V&&g.peek()=="@"&&g.match(z))return A.tokenize=re,te("jsonld-keyword","meta");for(;(L=g.next())!=null&&!(L==f&&!W);)W=!W&&L=="\\";return W||(A.tokenize=re),te("string","string")}}function se(f,g){for(var A=!1,W;W=f.next();){if(W=="/"&&A){g.tokenize=re;break}A=W=="*"}return te("comment","comment")}function Ae(f,g){for(var A=!1,W;(W=f.next())!=null;){if(!A&&(W=="`"||W=="$"&&f.eat("{"))){g.tokenize=re;break}A=!A&&W=="\\"}return te("quasi","string-2",f.current())}var ye="([{}])";function de(f,g){g.fatArrowAt&&(g.fatArrowAt=null);var A=f.string.indexOf("=>",f.start);if(!(A<0)){if(_){var W=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,A));W&&(A=W.index)}for(var L=0,Z=!1,_e=A-1;_e>=0;--_e){var it=f.string.charAt(_e),xt=ye.indexOf(it);if(xt>=0&&xt<3){if(!L){++_e;break}if(--L==0){it=="("&&(Z=!0);break}}else if(xt>=3&&xt<6)++L;else if(ie.test(it))Z=!0;else if(/["'\/`]/.test(it))for(;;--_e){if(_e==0)return;var _r=f.string.charAt(_e-1);if(_r==it&&f.string.charAt(_e-2)!="\\"){_e--;break}}else if(Z&&!L){++_e;break}}Z&&!L&&(g.fatArrowAt=_e)}}var ze={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function fe(f,g,A,W,L,Z){this.indented=f,this.column=g,this.type=A,this.prev=L,this.info=Z,W!=null&&(this.align=W)}function H(f,g){if(!N)return!1;for(var A=f.localVars;A;A=A.next)if(A.name==g)return!0;for(var W=f.context;W;W=W.prev)for(var A=W.vars;A;A=A.next)if(A.name==g)return!0}function Ee(f,g,A,W,L){var Z=f.cc;for(D.state=f,D.stream=L,D.marked=null,D.cc=Z,D.style=g,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var _e=Z.length?Z.pop():b?oe:Le;if(_e(A,W)){for(;Z.length&&Z[Z.length-1].lex;)Z.pop()();return D.marked?D.marked:A=="variable"&&H(f,W)?"variable-2":g}}}var D={state:null,column:null,marked:null,cc:null};function Q(){for(var f=arguments.length-1;f>=0;f--)D.cc.push(arguments[f])}function d(){return Q.apply(null,arguments),!0}function S(f,g){for(var A=g;A;A=A.next)if(A.name==f)return!0;return!1}function w(f){var g=D.state;if(D.marked="def",!!N){if(g.context){if(g.lexical.info=="var"&&g.context&&g.context.block){var A=m(f,g.context);if(A!=null){g.context=A;return}}else if(!S(f,g.localVars)){g.localVars=new le(f,g.localVars);return}}I.globalVars&&!S(f,g.globalVars)&&(g.globalVars=new le(f,g.globalVars))}}function m(f,g){if(g)if(g.block){var A=m(f,g.prev);return A?A==g.prev?g:new P(A,g.vars,!0):null}else return S(f,g.vars)?g:new P(g.prev,new le(f,g.vars),!1);else return null}function y(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function P(f,g,A){this.prev=f,this.vars=g,this.block=A}function le(f,g){this.name=f,this.next=g}var p=new le("this",new le("arguments",null));function c(){D.state.context=new P(D.state.context,D.state.localVars,!1),D.state.localVars=p}function Y(){D.state.context=new P(D.state.context,D.state.localVars,!0),D.state.localVars=null}c.lex=Y.lex=!0;function xe(){D.state.localVars=D.state.context.vars,D.state.context=D.state.context.prev}xe.lex=!0;function j(f,g){var A=function(){var W=D.state,L=W.indented;if(W.lexical.type=="stat")L=W.lexical.indented;else for(var Z=W.lexical;Z&&Z.type==")"&&Z.align;Z=Z.prev)L=Z.indented;W.lexical=new fe(L,D.stream.column(),f,null,W.lexical,g)};return A.lex=!0,A}function ue(){var f=D.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}ue.lex=!0;function Te(f){function g(A){return A==f?d():f==";"||A=="}"||A==")"||A=="]"?Q():d(g)}return g}function Le(f,g){return f=="var"?d(j("vardef",g),Nr,Te(";"),ue):f=="keyword a"?d(j("form"),qe,Le,ue):f=="keyword b"?d(j("form"),Le,ue):f=="keyword d"?D.stream.match(/^\s*$/,!1)?d():d(j("stat"),ct,Te(";"),ue):f=="debugger"?d(Te(";")):f=="{"?d(j("}"),Y,Nt,ue,xe):f==";"?d():f=="if"?(D.state.lexical.info=="else"&&D.state.cc[D.state.cc.length-1]==ue&&D.state.cc.pop()(),d(j("form"),qe,Le,ue,Or)):f=="function"?d(Pt):f=="for"?d(j("form"),Y,Wn,Le,xe,ue):f=="class"||_&&g=="interface"?(D.marked="keyword",d(j("form",f=="class"?f:g),Pr,ue)):f=="variable"?_&&g=="declare"?(D.marked="keyword",d(Le)):_&&(g=="module"||g=="enum"||g=="type")&&D.stream.match(/^\s*\w/,!1)?(D.marked="keyword",g=="enum"?d(ce):g=="type"?d(_n,Te("operator"),We,Te(";")):d(j("form"),yt,Te("{"),j("}"),Nt,ue,ue)):_&&g=="namespace"?(D.marked="keyword",d(j("form"),oe,Le,ue)):_&&g=="abstract"?(D.marked="keyword",d(Le)):d(j("stat"),Ie):f=="switch"?d(j("form"),qe,Te("{"),j("}","switch"),Y,Nt,ue,ue,xe):f=="case"?d(oe,Te(":")):f=="default"?d(Te(":")):f=="catch"?d(j("form"),c,be,Le,ue,xe):f=="export"?d(j("stat"),Ir,ue):f=="import"?d(j("stat"),fr,ue):f=="async"?d(Le):g=="@"?d(oe,Le):Q(j("stat"),oe,Te(";"),ue)}function be(f){if(f=="(")return d(_t,Te(")"))}function oe(f,g){return Ve(f,g,!1)}function Ne(f,g){return Ve(f,g,!0)}function qe(f){return f!="("?Q():d(j(")"),ct,Te(")"),ue)}function Ve(f,g,A){if(D.state.fatArrowAt==D.stream.start){var W=A?Pe:ge;if(f=="(")return d(c,j(")"),Me(_t,")"),ue,Te("=>"),W,xe);if(f=="variable")return Q(c,yt,Te("=>"),W,xe)}var L=A?Re:Oe;return ze.hasOwnProperty(f)?d(L):f=="function"?d(Pt,L):f=="class"||_&&g=="interface"?(D.marked="keyword",d(j("form"),yi,ue)):f=="keyword c"||f=="async"?d(A?Ne:oe):f=="("?d(j(")"),ct,Te(")"),ue,L):f=="operator"||f=="spread"?d(A?Ne:oe):f=="["?d(j("]"),Qe,ue,L):f=="{"?Lt(Se,"}",null,L):f=="quasi"?Q(Ue,L):f=="new"?d(T(A)):d()}function ct(f){return f.match(/[;\}\)\],]/)?Q():Q(oe)}function Oe(f,g){return f==","?d(ct):Re(f,g,!1)}function Re(f,g,A){var W=A==!1?Oe:Re,L=A==!1?oe:Ne;if(f=="=>")return d(c,A?Pe:ge,xe);if(f=="operator")return/\+\+|--/.test(g)||_&&g=="!"?d(W):_&&g=="<"&&D.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?d(j(">"),Me(We,">"),ue,W):g=="?"?d(oe,Te(":"),L):d(L);if(f=="quasi")return Q(Ue,W);if(f!=";"){if(f=="(")return Lt(Ne,")","call",W);if(f==".")return d(ae,W);if(f=="[")return d(j("]"),ct,Te("]"),ue,W);if(_&&g=="as")return D.marked="keyword",d(We,W);if(f=="regexp")return D.state.lastType=D.marked="operator",D.stream.backUp(D.stream.pos-D.stream.start-1),d(L)}}function Ue(f,g){return f!="quasi"?Q():g.slice(g.length-2)!="${"?d(Ue):d(ct,et)}function et(f){if(f=="}")return D.marked="string-2",D.state.tokenize=Ae,d(Ue)}function ge(f){return de(D.stream,D.state),Q(f=="{"?Le:oe)}function Pe(f){return de(D.stream,D.state),Q(f=="{"?Le:Ne)}function T(f){return function(g){return g=="."?d(f?F:B):g=="variable"&&_?d(Ct,f?Re:Oe):Q(f?Ne:oe)}}function B(f,g){if(g=="target")return D.marked="keyword",d(Oe)}function F(f,g){if(g=="target")return D.marked="keyword",d(Re)}function Ie(f){return f==":"?d(ue,Le):Q(Oe,Te(";"),ue)}function ae(f){if(f=="variable")return D.marked="property",d()}function Se(f,g){if(f=="async")return D.marked="property",d(Se);if(f=="variable"||D.style=="keyword"){if(D.marked="property",g=="get"||g=="set")return d(he);var A;return _&&D.state.fatArrowAt==D.stream.start&&(A=D.stream.match(/^\s*:\s*/,!1))&&(D.state.fatArrowAt=D.stream.pos+A[0].length),d(Be)}else{if(f=="number"||f=="string")return D.marked=V?"property":D.style+" property",d(Be);if(f=="jsonld-keyword")return d(Be);if(_&&y(g))return D.marked="keyword",d(Se);if(f=="[")return d(oe,or,Te("]"),Be);if(f=="spread")return d(Ne,Be);if(g=="*")return D.marked="keyword",d(Se);if(f==":")return Q(Be)}}function he(f){return f!="variable"?Q(Be):(D.marked="property",d(Pt))}function Be(f){if(f==":")return d(Ne);if(f=="(")return Q(Pt)}function Me(f,g,A){function W(L,Z){if(A?A.indexOf(L)>-1:L==","){var _e=D.state.lexical;return _e.info=="call"&&(_e.pos=(_e.pos||0)+1),d(function(it,xt){return it==g||xt==g?Q():Q(f)},W)}return L==g||Z==g?d():A&&A.indexOf(";")>-1?Q(f):d(Te(g))}return function(L,Z){return L==g||Z==g?d():Q(f,W)}}function Lt(f,g,A){for(var W=3;W"),We);if(f=="quasi")return Q(dt,Ot)}function Bn(f){if(f=="=>")return d(We)}function ve(f){return f.match(/[\}\)\]]/)?d():f==","||f==";"?d(ve):Q(Jt,ve)}function Jt(f,g){if(f=="variable"||D.style=="keyword")return D.marked="property",d(Jt);if(g=="?"||f=="number"||f=="string")return d(Jt);if(f==":")return d(We);if(f=="[")return d(Te("variable"),br,Te("]"),Jt);if(f=="(")return Q(ur,Jt);if(!f.match(/[;\}\)\],]/))return d()}function dt(f,g){return f!="quasi"?Q():g.slice(g.length-2)!="${"?d(dt):d(We,Ye)}function Ye(f){if(f=="}")return D.marked="string-2",D.state.tokenize=Ae,d(dt)}function Ze(f,g){return f=="variable"&&D.stream.match(/^\s*[?:]/,!1)||g=="?"?d(Ze):f==":"?d(We):f=="spread"?d(Ze):Q(We)}function Ot(f,g){if(g=="<")return d(j(">"),Me(We,">"),ue,Ot);if(g=="|"||f=="."||g=="&")return d(We);if(f=="[")return d(We,Te("]"),Ot);if(g=="extends"||g=="implements")return D.marked="keyword",d(We);if(g=="?")return d(We,Te(":"),We)}function Ct(f,g){if(g=="<")return d(j(">"),Me(We,">"),ue,Ot)}function Bt(){return Q(We,ht)}function ht(f,g){if(g=="=")return d(We)}function Nr(f,g){return g=="enum"?(D.marked="keyword",d(ce)):Q(yt,or,Wt,mi)}function yt(f,g){if(_&&y(g))return D.marked="keyword",d(yt);if(f=="variable")return w(g),d();if(f=="spread")return d(yt);if(f=="[")return Lt(ln,"]");if(f=="{")return Lt(ar,"}")}function ar(f,g){return f=="variable"&&!D.stream.match(/^\s*:/,!1)?(w(g),d(Wt)):(f=="variable"&&(D.marked="property"),f=="spread"?d(yt):f=="}"?Q():f=="["?d(oe,Te("]"),Te(":"),ar):d(Te(":"),yt,Wt))}function ln(){return Q(yt,Wt)}function Wt(f,g){if(g=="=")return d(Ne)}function mi(f){if(f==",")return d(Nr)}function Or(f,g){if(f=="keyword b"&&g=="else")return d(j("form","else"),Le,ue)}function Wn(f,g){if(g=="await")return d(Wn);if(f=="(")return d(j(")"),an,ue)}function an(f){return f=="var"?d(Nr,sr):f=="variable"?d(sr):Q(sr)}function sr(f,g){return f==")"?d():f==";"?d(sr):g=="in"||g=="of"?(D.marked="keyword",d(oe,sr)):Q(oe,sr)}function Pt(f,g){if(g=="*")return D.marked="keyword",d(Pt);if(f=="variable")return w(g),d(Pt);if(f=="(")return d(c,j(")"),Me(_t,")"),ue,lr,Le,xe);if(_&&g=="<")return d(j(">"),Me(Bt,">"),ue,Pt)}function ur(f,g){if(g=="*")return D.marked="keyword",d(ur);if(f=="variable")return w(g),d(ur);if(f=="(")return d(c,j(")"),Me(_t,")"),ue,lr,xe);if(_&&g=="<")return d(j(">"),Me(Bt,">"),ue,ur)}function _n(f,g){if(f=="keyword"||f=="variable")return D.marked="type",d(_n);if(g=="<")return d(j(">"),Me(Bt,">"),ue)}function _t(f,g){return g=="@"&&d(oe,_t),f=="spread"?d(_t):_&&y(g)?(D.marked="keyword",d(_t)):_&&f=="this"?d(or,Wt):Q(yt,or,Wt)}function yi(f,g){return f=="variable"?Pr(f,g):Ht(f,g)}function Pr(f,g){if(f=="variable")return w(g),d(Ht)}function Ht(f,g){if(g=="<")return d(j(">"),Me(Bt,">"),ue,Ht);if(g=="extends"||g=="implements"||_&&f==",")return g=="implements"&&(D.marked="keyword"),d(_?We:oe,Ht);if(f=="{")return d(j("}"),Rt,ue)}function Rt(f,g){if(f=="async"||f=="variable"&&(g=="static"||g=="get"||g=="set"||_&&y(g))&&D.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return D.marked="keyword",d(Rt);if(f=="variable"||D.style=="keyword")return D.marked="property",d(kr,Rt);if(f=="number"||f=="string")return d(kr,Rt);if(f=="[")return d(oe,or,Te("]"),kr,Rt);if(g=="*")return D.marked="keyword",d(Rt);if(_&&f=="(")return Q(ur,Rt);if(f==";"||f==",")return d(Rt);if(f=="}")return d();if(g=="@")return d(oe,Rt)}function kr(f,g){if(g=="!"||g=="?")return d(kr);if(f==":")return d(We,Wt);if(g=="=")return d(Ne);var A=D.state.lexical.prev,W=A&&A.info=="interface";return Q(W?ur:Pt)}function Ir(f,g){return g=="*"?(D.marked="keyword",d(Wr,Te(";"))):g=="default"?(D.marked="keyword",d(oe,Te(";"))):f=="{"?d(Me(zr,"}"),Wr,Te(";")):Q(Le)}function zr(f,g){if(g=="as")return D.marked="keyword",d(Te("variable"));if(f=="variable")return Q(Ne,zr)}function fr(f){return f=="string"?d():f=="("?Q(oe):f=="."?Q(Oe):Q(Br,Gt,Wr)}function Br(f,g){return f=="{"?Lt(Br,"}"):(f=="variable"&&w(g),g=="*"&&(D.marked="keyword"),d(sn))}function Gt(f){if(f==",")return d(Br,Gt)}function sn(f,g){if(g=="as")return D.marked="keyword",d(Br)}function Wr(f,g){if(g=="from")return D.marked="keyword",d(oe)}function Qe(f){return f=="]"?d():Q(Me(Ne,"]"))}function ce(){return Q(j("form"),yt,Te("{"),j("}"),Me(Vt,"}"),ue,ue)}function Vt(){return Q(yt,Wt)}function un(f,g){return f.lastType=="operator"||f.lastType==","||q.test(g.charAt(0))||/[,.]/.test(g.charAt(0))}function Ft(f,g,A){return g.tokenize==re&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(g.lastType)||g.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(A||0)))}return{startState:function(f){var g={tokenize:re,lastType:"sof",cc:[],lexical:new fe((f||0)-K,0,"block",!1),localVars:I.localVars,context:I.localVars&&new P(null,null,!1),indented:f||0};return I.globalVars&&typeof I.globalVars=="object"&&(g.globalVars=I.globalVars),g},token:function(f,g){if(f.sol()&&(g.lexical.hasOwnProperty("align")||(g.lexical.align=!1),g.indented=f.indentation(),de(f,g)),g.tokenize!=se&&f.eatSpace())return null;var A=g.tokenize(f,g);return ke=="comment"?A:(g.lastType=ke=="operator"&&(we=="++"||we=="--")?"incdec":ke,Ee(g,A,ke,we,f))},indent:function(f,g){if(f.tokenize==se||f.tokenize==Ae)return C.Pass;if(f.tokenize!=re)return 0;var A=g&&g.charAt(0),W=f.lexical,L;if(!/^\s*else\b/.test(g))for(var Z=f.cc.length-1;Z>=0;--Z){var _e=f.cc[Z];if(_e==ue)W=W.prev;else if(_e!=Or&&_e!=xe)break}for(;(W.type=="stat"||W.type=="form")&&(A=="}"||(L=f.cc[f.cc.length-1])&&(L==Oe||L==Re)&&!/^[,\.=+\-*:?[\(]/.test(g));)W=W.prev;$&&W.type==")"&&W.prev.type=="stat"&&(W=W.prev);var it=W.type,xt=A==it;return it=="vardef"?W.indented+(f.lastType=="operator"||f.lastType==","?W.info.length+1:0):it=="form"&&A=="{"?W.indented:it=="form"?W.indented+K:it=="stat"?W.indented+(un(f,g)?$||K:0):W.info=="switch"&&!xt&&I.doubleIndentSwitch!=!1?W.indented+(/^(?:case|default)\b/.test(g)?K:2*K):W.align?W.column+(xt?0:1):W.indented+(xt?0:K)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:b?null:"/*",blockCommentEnd:b?null:"*/",blockCommentContinue:b?null:" * ",lineComment:b?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:b?"json":"javascript",jsonldMode:V,jsonMode:b,expressionAllowed:Ft,skipExpression:function(f){Ee(f,"atom","atom","true",new C.StringStream("",2,null))}}}),C.registerHelper("wordChars","javascript",/[\w$]/),C.defineMIME("text/javascript","javascript"),C.defineMIME("text/ecmascript","javascript"),C.defineMIME("application/javascript","javascript"),C.defineMIME("application/x-javascript","javascript"),C.defineMIME("application/ecmascript","javascript"),C.defineMIME("application/json",{name:"javascript",json:!0}),C.defineMIME("application/x-json",{name:"javascript",json:!0}),C.defineMIME("application/manifest+json",{name:"javascript",json:!0}),C.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),C.defineMIME("text/typescript",{name:"javascript",typescript:!0}),C.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})();var Tu=Su.exports;(function(Et,zt){(function(C){C(It(),ya(),Tu,wu)})(function(C){var De={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function I(ie,O,q){var z=ie.current(),X=z.search(O);return X>-1?ie.backUp(z.length-X):z.match(/<\/?$/)&&(ie.backUp(z.length),ie.match(O,!1)||ie.match(z)),q}var K={};function $(ie){var O=K[ie];return O||(K[ie]=new RegExp("\\s+"+ie+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function V(ie,O){var q=ie.match($(O));return q?/^\s*(.*?)\s*$/.exec(q[2])[1]:""}function b(ie,O){return new RegExp((O?"^":"")+"","i")}function N(ie,O){for(var q in ie)for(var z=O[q]||(O[q]=[]),X=ie[q],ke=X.length-1;ke>=0;ke--)z.unshift(X[ke])}function _(ie,O){for(var q=0;q=0;we--)z.script.unshift(["type",ke[we].matches,ke[we].mode]);function te(re,ne){var se=q.token(re,ne.htmlState),Ae=/\btag\b/.test(se),ye;if(Ae&&!/[<>\s\/]/.test(re.current())&&(ye=ne.htmlState.tagName&&ne.htmlState.tagName.toLowerCase())&&z.hasOwnProperty(ye))ne.inTag=ye+" ";else if(ne.inTag&&Ae&&/>$/.test(re.current())){var de=/^([\S]+) (.*)/.exec(ne.inTag);ne.inTag=null;var ze=re.current()==">"&&_(z[de[1]],de[2]),fe=C.getMode(ie,ze),H=b(de[1],!0),Ee=b(de[1],!1);ne.token=function(D,Q){return D.match(H,!1)?(Q.token=te,Q.localState=Q.localMode=null,null):I(D,Ee,Q.localMode.token(D,Q.localState))},ne.localMode=fe,ne.localState=C.startState(fe,q.indent(ne.htmlState,"",""))}else ne.inTag&&(ne.inTag+=re.current(),re.eol()&&(ne.inTag+=" "));return se}return{startState:function(){var re=C.startState(q);return{token:te,inTag:null,localMode:null,localState:null,htmlState:re}},copyState:function(re){var ne;return re.localState&&(ne=C.copyState(re.localMode,re.localState)),{token:re.token,inTag:re.inTag,localMode:re.localMode,localState:ne,htmlState:C.copyState(q,re.htmlState)}},token:function(re,ne){return ne.token(re,ne)},indent:function(re,ne,se){return!re.localMode||/^\s*<\//.test(ne)?q.indent(re.htmlState,ne,se):re.localMode.indent?re.localMode.indent(re.localState,ne,se):C.Pass},innerMode:function(re){return{state:re.localState||re.htmlState,mode:re.localMode||q}}}},"xml","javascript","css"),C.defineMIME("text/html","htmlmixed")})})();(function(Et,zt){(function(C){C(It())})(function(C){function De(N){return new RegExp("^(("+N.join(")|(")+"))\\b")}var I=De(["and","or","not","is"]),K=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],$=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];C.registerHelper("hintWords","python",K.concat($).concat(["exec","print"]));function V(N){return N.scopes[N.scopes.length-1]}C.defineMode("python",function(N,_){for(var ie="error",O=_.delimiters||_.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,q=[_.singleOperators,_.doubleOperators,_.doubleDelimiters,_.tripleDelimiters,_.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],z=0;zy?H(w):P0&&D(S,w)&&(le+=" "+ie),le}}return de(S,w)}function de(S,w,m){if(S.eatSpace())return null;if(!m&&S.match(/^#.*/))return"comment";if(S.match(/^[0-9\.]/,!1)){var y=!1;if(S.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(y=!0),S.match(/^[\d_]+\.\d*/)&&(y=!0),S.match(/^\.\d+/)&&(y=!0),y)return S.eat(/J/i),"number";var P=!1;if(S.match(/^0x[0-9a-f_]+/i)&&(P=!0),S.match(/^0b[01_]+/i)&&(P=!0),S.match(/^0o[0-7_]+/i)&&(P=!0),S.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(S.eat(/J/i),P=!0),S.match(/^0(?![\dx])/i)&&(P=!0),P)return S.eat(/L/i),"number"}if(S.match(ne)){var le=S.current().toLowerCase().indexOf("f")!==-1;return le?(w.tokenize=ze(S.current(),w.tokenize),w.tokenize(S,w)):(w.tokenize=fe(S.current(),w.tokenize),w.tokenize(S,w))}for(var p=0;p=0;)S=S.substr(1);var m=S.length==1,y="string";function P(p){return function(c,Y){var xe=de(c,Y,!0);return xe=="punctuation"&&(c.current()=="{"?Y.tokenize=P(p+1):c.current()=="}"&&(p>1?Y.tokenize=P(p-1):Y.tokenize=le)),xe}}function le(p,c){for(;!p.eol();)if(p.eatWhile(/[^'"\{\}\\]/),p.eat("\\")){if(p.next(),m&&p.eol())return y}else{if(p.match(S))return c.tokenize=w,y;if(p.match("{{"))return y;if(p.match("{",!1))return c.tokenize=P(0),p.current()?y:c.tokenize(p,c);if(p.match("}}"))return y;if(p.match("}"))return ie;p.eat(/['"]/)}if(m){if(_.singleLineStringErrors)return ie;c.tokenize=w}return y}return le.isString=!0,le}function fe(S,w){for(;"rubf".indexOf(S.charAt(0).toLowerCase())>=0;)S=S.substr(1);var m=S.length==1,y="string";function P(le,p){for(;!le.eol();)if(le.eatWhile(/[^'"\\]/),le.eat("\\")){if(le.next(),m&&le.eol())return y}else{if(le.match(S))return p.tokenize=w,y;le.eat(/['"]/)}if(m){if(_.singleLineStringErrors)return ie;p.tokenize=w}return y}return P.isString=!0,P}function H(S){for(;V(S).type!="py";)S.scopes.pop();S.scopes.push({offset:V(S).offset+N.indentUnit,type:"py",align:null})}function Ee(S,w,m){var y=S.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:S.column()+1;w.scopes.push({offset:w.indent+X,type:m,align:y})}function D(S,w){for(var m=S.indentation();w.scopes.length>1&&V(w).offset>m;){if(V(w).type!="py")return!0;w.scopes.pop()}return V(w).offset!=m}function Q(S,w){S.sol()&&(w.beginningOfLine=!0,w.dedent=!1);var m=w.tokenize(S,w),y=S.current();if(w.beginningOfLine&&y=="@")return S.match(re,!1)?"meta":te?"operator":ie;if(/\S/.test(y)&&(w.beginningOfLine=!1),(m=="variable"||m=="builtin")&&w.lastToken=="meta"&&(m="meta"),(y=="pass"||y=="return")&&(w.dedent=!0),y=="lambda"&&(w.lambda=!0),y==":"&&!w.lambda&&V(w).type=="py"&&S.match(/^\s*(?:#|$)/,!1)&&H(w),y.length==1&&!/string|comment/.test(m)){var P="[({".indexOf(y);if(P!=-1&&Ee(S,w,"])}".slice(P,P+1)),P="])}".indexOf(y),P!=-1)if(V(w).type==y)w.indent=w.scopes.pop().offset-X;else return ie}return w.dedent&&S.eol()&&V(w).type=="py"&&w.scopes.length>1&&w.scopes.pop(),m}var d={startState:function(S){return{tokenize:ye,scopes:[{offset:S||0,type:"py",align:null}],indent:S||0,lastToken:null,lambda:!1,dedent:0}},token:function(S,w){var m=w.errorToken;m&&(w.errorToken=!1);var y=Q(S,w);return y&&y!="comment"&&(w.lastToken=y=="keyword"||y=="punctuation"?S.current():y),y=="punctuation"&&(y=null),S.eol()&&w.lambda&&(w.lambda=!1),m?y+" "+ie:y},indent:function(S,w){if(S.tokenize!=ye)return S.tokenize.isString?C.Pass:0;var m=V(S),y=m.type==w.charAt(0)||m.type=="py"&&!S.dedent&&/^(else:|elif |except |finally:)/.test(w);return m.align!=null?m.align-(y?1:0):m.offset-(y?X:0)},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:`'"`},lineComment:"#",fold:"indent"};return d}),C.defineMIME("text/x-python","python");var b=function(N){return N.split(" ")};C.defineMIME("text/x-cython",{name:"python",extra_keywords:b("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})})})();(function(Et,zt){(function(C){C(It())})(function(C){function De(m,y,P,le,p,c){this.indented=m,this.column=y,this.type=P,this.info=le,this.align=p,this.prev=c}function I(m,y,P,le){var p=m.indented;return m.context&&m.context.type=="statement"&&P!="statement"&&(p=m.context.indented),m.context=new De(p,y,P,le,null,m.context)}function K(m){var y=m.context.type;return(y==")"||y=="]"||y=="}")&&(m.indented=m.context.indented),m.context=m.context.prev}function $(m,y,P){if(y.prevToken=="variable"||y.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(m.string.slice(0,P))||y.typeAtEndOfLine&&m.column()==m.indentation())return!0}function V(m){for(;;){if(!m||m.type=="top")return!0;if(m.type=="}"&&m.prev.info!="namespace")return!1;m=m.prev}}C.defineMode("clike",function(m,y){var P=m.indentUnit,le=y.statementIndentUnit||P,p=y.dontAlignCalls,c=y.keywords||{},Y=y.types||{},xe=y.builtin||{},j=y.blockKeywords||{},ue=y.defKeywords||{},Te=y.atoms||{},Le=y.hooks||{},be=y.multiLineStrings,oe=y.indentStatements!==!1,Ne=y.indentSwitch!==!1,qe=y.namespaceSeparator,Ve=y.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,ct=y.numberStart||/[\d\.]/,Oe=y.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,Re=y.isOperatorChar||/[+\-*&%=<>!?|\/]/,Ue=y.isIdentifierChar||/[\w\$_\xa1-\uffff]/,et=y.isReservedIdentifier||!1,ge,Pe;function T(ae,Se){var he=ae.next();if(Le[he]){var Be=Le[he](ae,Se);if(Be!==!1)return Be}if(he=='"'||he=="'")return Se.tokenize=B(he),Se.tokenize(ae,Se);if(ct.test(he)){if(ae.backUp(1),ae.match(Oe))return"number";ae.next()}if(Ve.test(he))return ge=he,null;if(he=="/"){if(ae.eat("*"))return Se.tokenize=F,F(ae,Se);if(ae.eat("/"))return ae.skipToEnd(),"comment"}if(Re.test(he)){for(;!ae.match(/^\/[\/*]/,!1)&&ae.eat(Re););return"operator"}if(ae.eatWhile(Ue),qe)for(;ae.match(qe);)ae.eatWhile(Ue);var Me=ae.current();return N(c,Me)?(N(j,Me)&&(ge="newstatement"),N(ue,Me)&&(Pe=!0),"keyword"):N(Y,Me)?"type":N(xe,Me)||et&&et(Me)?(N(j,Me)&&(ge="newstatement"),"builtin"):N(Te,Me)?"atom":"variable"}function B(ae){return function(Se,he){for(var Be=!1,Me,Lt=!1;(Me=Se.next())!=null;){if(Me==ae&&!Be){Lt=!0;break}Be=!Be&&Me=="\\"}return(Lt||!(Be||be))&&(he.tokenize=null),"string"}}function F(ae,Se){for(var he=!1,Be;Be=ae.next();){if(Be=="/"&&he){Se.tokenize=null;break}he=Be=="*"}return"comment"}function Ie(ae,Se){y.typeFirstDefinitions&&ae.eol()&&V(Se.context)&&(Se.typeAtEndOfLine=$(ae,Se,ae.pos))}return{startState:function(ae){return{tokenize:null,context:new De((ae||0)-P,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(ae,Se){var he=Se.context;if(ae.sol()&&(he.align==null&&(he.align=!1),Se.indented=ae.indentation(),Se.startOfLine=!0),ae.eatSpace())return Ie(ae,Se),null;ge=Pe=null;var Be=(Se.tokenize||T)(ae,Se);if(Be=="comment"||Be=="meta")return Be;if(he.align==null&&(he.align=!0),ge==";"||ge==":"||ge==","&&ae.match(/^\s*(?:\/\/.*)?$/,!1))for(;Se.context.type=="statement";)K(Se);else if(ge=="{")I(Se,ae.column(),"}");else if(ge=="[")I(Se,ae.column(),"]");else if(ge=="(")I(Se,ae.column(),")");else if(ge=="}"){for(;he.type=="statement";)he=K(Se);for(he.type=="}"&&(he=K(Se));he.type=="statement";)he=K(Se)}else ge==he.type?K(Se):oe&&((he.type=="}"||he.type=="top")&&ge!=";"||he.type=="statement"&&ge=="newstatement")&&I(Se,ae.column(),"statement",ae.current());if(Be=="variable"&&(Se.prevToken=="def"||y.typeFirstDefinitions&&$(ae,Se,ae.start)&&V(Se.context)&&ae.match(/^\s*\(/,!1))&&(Be="def"),Le.token){var Me=Le.token(ae,Se,Be);Me!==void 0&&(Be=Me)}return Be=="def"&&y.styleDefs===!1&&(Be="variable"),Se.startOfLine=!1,Se.prevToken=Pe?"def":Be||ge,Ie(ae,Se),Be},indent:function(ae,Se){if(ae.tokenize!=T&&ae.tokenize!=null||ae.typeAtEndOfLine&&V(ae.context))return C.Pass;var he=ae.context,Be=Se&&Se.charAt(0),Me=Be==he.type;if(he.type=="statement"&&Be=="}"&&(he=he.prev),y.dontIndentStatements)for(;he.type=="statement"&&y.dontIndentStatements.test(he.info);)he=he.prev;if(Le.indent){var Lt=Le.indent(ae,he,Se,P);if(typeof Lt=="number")return Lt}var Nt=he.prev&&he.prev.info=="switch";if(y.allmanIndentation&&/[{(]/.test(Be)){for(;he.type!="top"&&he.type!="}";)he=he.prev;return he.indented}return he.type=="statement"?he.indented+(Be=="{"?0:le):he.align&&(!p||he.type!=")")?he.column+(Me?0:1):he.type==")"&&!Me?he.indented+le:he.indented+(Me?0:P)+(!Me&&Nt&&!/^(?:case|default)\b/.test(Se)?P:0)},electricInput:Ne?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function b(m){for(var y={},P=m.split(" "),le=0;le!?|\/#:@]/,hooks:{"@":function(m){return m.eatWhile(/[\w\$_]/),"meta"},'"':function(m,y){return m.match('""')?(y.tokenize=D,y.tokenize(m,y)):!1},"'":function(m){return m.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(m.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(m,y){var P=y.context;return P.type=="}"&&P.align&&m.eat(">")?(y.context=new De(P.indented,P.column,P.type,P.info,null,P.prev),"operator"):!1},"/":function(m,y){return m.eat("*")?(y.tokenize=Q(1),y.tokenize(m,y)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function d(m){return function(y,P){for(var le=!1,p,c=!1;!y.eol();){if(!m&&!le&&y.match('"')){c=!0;break}if(m&&y.match('"""')){c=!0;break}p=y.next(),!le&&p=="$"&&y.match("{")&&y.skipTo("}"),le=!le&&p=="\\"&&!m}return(c||!m)&&(P.tokenize=null),"string"}}Ee("text/x-kotlin",{name:"clike",keywords:b("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:b("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:b("catch class do else finally for if where try while enum"),defKeywords:b("class val var object interface fun"),atoms:b("true false null this"),hooks:{"@":function(m){return m.eatWhile(/[\w\$_]/),"meta"},"*":function(m,y){return y.prevToken=="."?"variable":"operator"},'"':function(m,y){return y.tokenize=d(m.match('""')),y.tokenize(m,y)},"/":function(m,y){return m.eat("*")?(y.tokenize=Q(1),y.tokenize(m,y)):!1},indent:function(m,y,P,le){var p=P&&P.charAt(0);if((m.prevToken=="}"||m.prevToken==")")&&P=="")return m.indented;if(m.prevToken=="operator"&&P!="}"&&m.context.type!="}"||m.prevToken=="variable"&&p=="."||(m.prevToken=="}"||m.prevToken==")")&&p==".")return le*2+y.indented;if(y.align&&y.type=="}")return y.indented+(m.context.type==(P||"").charAt(0)?0:le)}},modeProps:{closeBrackets:{triples:'"'}}}),Ee(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:b("for while do if else struct"),builtin:b("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:b("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":ne},modeProps:{fold:["brace","include"]}}),Ee("text/x-nesc",{name:"clike",keywords:b(_+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:ke,blockKeywords:b(te),atoms:b("null true false"),hooks:{"#":ne},modeProps:{fold:["brace","include"]}}),Ee("text/x-objectivec",{name:"clike",keywords:b(_+" "+O),types:we,builtin:b(q),blockKeywords:b(te+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:b(re+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:b("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:Ae,hooks:{"#":ne,"*":se},modeProps:{fold:["brace","include"]}}),Ee("text/x-objectivec++",{name:"clike",keywords:b(_+" "+O+" "+ie),types:we,builtin:b(q),blockKeywords:b(te+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:b(re+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:b("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:Ae,hooks:{"#":ne,"*":se,u:de,U:de,L:de,R:de,0:ye,1:ye,2:ye,3:ye,4:ye,5:ye,6:ye,7:ye,8:ye,9:ye,token:function(m,y,P){if(P=="variable"&&m.peek()=="("&&(y.prevToken==";"||y.prevToken==null||y.prevToken=="}")&&ze(m.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),Ee("text/x-squirrel",{name:"clike",keywords:b("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:ke,blockKeywords:b("case catch class else for foreach if switch try while"),defKeywords:b("function local class"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":ne},modeProps:{fold:["brace","include"]}});var S=null;function w(m){return function(y,P){for(var le=!1,p,c=!1;!y.eol();){if(!le&&y.match('"')&&(m=="single"||y.match('""'))){c=!0;break}if(!le&&y.match("``")){S=w(m),c=!0;break}p=y.next(),le=m=="single"&&!le&&p=="\\"}return c&&(P.tokenize=null),"string"}}Ee("text/x-ceylon",{name:"clike",keywords:b("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(m){var y=m.charAt(0);return y===y.toUpperCase()&&y!==y.toLowerCase()},blockKeywords:b("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:b("class dynamic function interface module object package value"),builtin:b("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:b("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(m){return m.eatWhile(/[\w\$_]/),"meta"},'"':function(m,y){return y.tokenize=w(m.match('""')?"triple":"single"),y.tokenize(m,y)},"`":function(m,y){return!S||!m.match("`")?!1:(y.tokenize=S,S=null,y.tokenize(m,y))},"'":function(m){return m.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(m,y,P){if((P=="variable"||P=="type")&&y.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})();var va={exports:{}},ma;function Lu(){return ma||(ma=1,function(Et,zt){(function(C){C(It())})(function(C){C.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var De=0;De-1&&K.substring(b+1,K.length);if(N)return C.findModeByExtension(N)},C.findModeByName=function(K){K=K.toLowerCase();for(var $=0;$` "'(~:]+/,ke=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,we=/^\s*\[[^\]]+?\]:.*$/,te=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,re=" ";function ne(p,c,Y){return c.f=c.inline=Y,Y(p,c)}function se(p,c,Y){return c.f=c.block=Y,Y(p,c)}function Ae(p){return!p||!/\S/.test(p.string)}function ye(p){if(p.linkTitle=!1,p.linkHref=!1,p.linkText=!1,p.em=!1,p.strong=!1,p.strikethrough=!1,p.quote=0,p.indentedCode=!1,p.f==ze){var c=$;if(!c){var Y=C.innerMode(K,p.htmlState);c=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}c&&(p.f=D,p.block=de,p.htmlState=null)}return p.trailingSpace=0,p.trailingSpaceNewLine=!1,p.prevLine=p.thisLine,p.thisLine={stream:null},null}function de(p,c){var Y=p.column()===c.indentation,xe=Ae(c.prevLine.stream),j=c.indentedCode,ue=c.prevLine.hr,Te=c.list!==!1,Le=(c.listStack[c.listStack.length-1]||0)+3;c.indentedCode=!1;var be=c.indentation;if(c.indentationDiff===null&&(c.indentationDiff=c.indentation,Te)){for(c.list=null;be=4&&(j||c.prevLine.fencedCodeEnd||c.prevLine.header||xe))return p.skipToEnd(),c.indentedCode=!0,b.code;if(p.eatSpace())return null;if(Y&&c.indentation<=Le&&(qe=p.match(q))&&qe[1].length<=6)return c.quote=0,c.header=qe[1].length,c.thisLine.header=!0,I.highlightFormatting&&(c.formatting="header"),c.f=c.inline,H(c);if(c.indentation<=Le&&p.eat(">"))return c.quote=Y?1:c.quote+1,I.highlightFormatting&&(c.formatting="quote"),p.eatSpace(),H(c);if(!Ne&&!c.setext&&Y&&c.indentation<=Le&&(qe=p.match(ie))){var Ve=qe[1]?"ol":"ul";return c.indentation=be+p.current().length,c.list=!0,c.quote=0,c.listStack.push(c.indentation),c.em=!1,c.strong=!1,c.code=!1,c.strikethrough=!1,I.taskLists&&p.match(O,!1)&&(c.taskList=!0),c.f=c.inline,I.highlightFormatting&&(c.formatting=["list","list-"+Ve]),H(c)}else{if(Y&&c.indentation<=Le&&(qe=p.match(ke,!0)))return c.quote=0,c.fencedEndRE=new RegExp(qe[1]+"+ *$"),c.localMode=I.fencedCodeBlockHighlighting&&V(qe[2]||I.fencedCodeBlockDefaultMode),c.localMode&&(c.localState=C.startState(c.localMode)),c.f=c.block=fe,I.highlightFormatting&&(c.formatting="code-block"),c.code=-1,H(c);if(c.setext||(!oe||!Te)&&!c.quote&&c.list===!1&&!c.code&&!Ne&&!we.test(p.string)&&(qe=p.lookAhead(1))&&(qe=qe.match(z)))return c.setext?(c.header=c.setext,c.setext=0,p.skipToEnd(),I.highlightFormatting&&(c.formatting="header")):(c.header=qe[0].charAt(0)=="="?1:2,c.setext=c.header),c.thisLine.header=!0,c.f=c.inline,H(c);if(Ne)return p.skipToEnd(),c.hr=!0,c.thisLine.hr=!0,b.hr;if(p.peek()==="[")return ne(p,c,m)}return ne(p,c,c.inline)}function ze(p,c){var Y=K.token(p,c.htmlState);if(!$){var xe=C.innerMode(K,c.htmlState);(xe.mode.name=="xml"&&xe.state.tagStart===null&&!xe.state.context&&xe.state.tokenize.isInText||c.md_inside&&p.current().indexOf(">")>-1)&&(c.f=D,c.block=de,c.htmlState=null)}return Y}function fe(p,c){var Y=c.listStack[c.listStack.length-1]||0,xe=c.indentation=p.quote?c.push(b.formatting+"-"+p.formatting[Y]+"-"+p.quote):c.push("error"))}if(p.taskOpen)return c.push("meta"),c.length?c.join(" "):null;if(p.taskClosed)return c.push("property"),c.length?c.join(" "):null;if(p.linkHref?c.push(b.linkHref,"url"):(p.strong&&c.push(b.strong),p.em&&c.push(b.em),p.strikethrough&&c.push(b.strikethrough),p.emoji&&c.push(b.emoji),p.linkText&&c.push(b.linkText),p.code&&c.push(b.code),p.image&&c.push(b.image),p.imageAltText&&c.push(b.imageAltText,"link"),p.imageMarker&&c.push(b.imageMarker)),p.header&&c.push(b.header,b.header+"-"+p.header),p.quote&&(c.push(b.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=p.quote?c.push(b.quote+"-"+p.quote):c.push(b.quote+"-"+I.maxBlockquoteDepth)),p.list!==!1){var xe=(p.listStack.length-1)%3;xe?xe===1?c.push(b.list2):c.push(b.list3):c.push(b.list1)}return p.trailingSpaceNewLine?c.push("trailing-space-new-line"):p.trailingSpace&&c.push("trailing-space-"+(p.trailingSpace%2?"a":"b")),c.length?c.join(" "):null}function Ee(p,c){if(p.match(X,!0))return H(c)}function D(p,c){var Y=c.text(p,c);if(typeof Y<"u")return Y;if(c.list)return c.list=null,H(c);if(c.taskList){var xe=p.match(O,!0)[1]===" ";return xe?c.taskOpen=!0:c.taskClosed=!0,I.highlightFormatting&&(c.formatting="task"),c.taskList=!1,H(c)}if(c.taskOpen=!1,c.taskClosed=!1,c.header&&p.match(/^#+$/,!0))return I.highlightFormatting&&(c.formatting="header"),H(c);var j=p.next();if(c.linkTitle){c.linkTitle=!1;var ue=j;j==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Te="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(p.match(new RegExp(Te),!0))return b.linkHref}if(j==="`"){var Le=c.formatting;I.highlightFormatting&&(c.formatting="code"),p.eatWhile("`");var be=p.current().length;if(c.code==0&&(!c.quote||be==1))return c.code=be,H(c);if(be==c.code){var oe=H(c);return c.code=0,oe}else return c.formatting=Le,H(c)}else if(c.code)return H(c);if(j==="\\"&&(p.next(),I.highlightFormatting)){var Ne=H(c),qe=b.formatting+"-escape";return Ne?Ne+" "+qe:qe}if(j==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return c.imageMarker=!0,c.image=!0,I.highlightFormatting&&(c.formatting="image"),H(c);if(j==="["&&c.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return c.imageMarker=!1,c.imageAltText=!0,I.highlightFormatting&&(c.formatting="image"),H(c);if(j==="]"&&c.imageAltText){I.highlightFormatting&&(c.formatting="image");var Ne=H(c);return c.imageAltText=!1,c.image=!1,c.inline=c.f=d,Ne}if(j==="["&&!c.image)return c.linkText&&p.match(/^.*?\]/)||(c.linkText=!0,I.highlightFormatting&&(c.formatting="link")),H(c);if(j==="]"&&c.linkText){I.highlightFormatting&&(c.formatting="link");var Ne=H(c);return c.linkText=!1,c.inline=c.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?d:D,Ne}if(j==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){c.f=c.inline=Q,I.highlightFormatting&&(c.formatting="link");var Ne=H(c);return Ne?Ne+=" ":Ne="",Ne+b.linkInline}if(j==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){c.f=c.inline=Q,I.highlightFormatting&&(c.formatting="link");var Ne=H(c);return Ne?Ne+=" ":Ne="",Ne+b.linkEmail}if(I.xml&&j==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Ve=p.string.indexOf(">",p.pos);if(Ve!=-1){var ct=p.string.substring(p.start,Ve);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ct)&&(c.md_inside=!0)}return p.backUp(1),c.htmlState=C.startState(K),se(p,c,ze)}if(I.xml&&j==="<"&&p.match(/^\/\w*?>/))return c.md_inside=!1,"tag";if(j==="*"||j==="_"){for(var Oe=1,Re=p.pos==1?" ":p.string.charAt(p.pos-2);Oe<3&&p.eat(j);)Oe++;var Ue=p.peek()||" ",et=!/\s/.test(Ue)&&(!te.test(Ue)||/\s/.test(Re)||te.test(Re)),ge=!/\s/.test(Re)&&(!te.test(Re)||/\s/.test(Ue)||te.test(Ue)),Pe=null,T=null;if(Oe%2&&(!c.em&&et&&(j==="*"||!ge||te.test(Re))?Pe=!0:c.em==j&&ge&&(j==="*"||!et||te.test(Ue))&&(Pe=!1)),Oe>1&&(!c.strong&&et&&(j==="*"||!ge||te.test(Re))?T=!0:c.strong==j&&ge&&(j==="*"||!et||te.test(Ue))&&(T=!1)),T!=null||Pe!=null){I.highlightFormatting&&(c.formatting=Pe==null?"strong":T==null?"em":"strong em"),Pe===!0&&(c.em=j),T===!0&&(c.strong=j);var oe=H(c);return Pe===!1&&(c.em=!1),T===!1&&(c.strong=!1),oe}}else if(j===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return H(c);p.backUp(1)}if(I.strikethrough){if(j==="~"&&p.eatWhile(j)){if(c.strikethrough){I.highlightFormatting&&(c.formatting="strikethrough");var oe=H(c);return c.strikethrough=!1,oe}else if(p.match(/^[^\s]/,!1))return c.strikethrough=!0,I.highlightFormatting&&(c.formatting="strikethrough"),H(c)}else if(j===" "&&p.match("~~",!0)){if(p.peek()===" ")return H(c);p.backUp(2)}}if(I.emoji&&j===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){c.emoji=!0,I.highlightFormatting&&(c.formatting="emoji");var B=H(c);return c.emoji=!1,B}return j===" "&&(p.match(/^ +$/,!1)?c.trailingSpace++:c.trailingSpace&&(c.trailingSpaceNewLine=!0)),H(c)}function Q(p,c){var Y=p.next();if(Y===">"){c.f=c.inline=D,I.highlightFormatting&&(c.formatting="link");var xe=H(c);return xe?xe+=" ":xe="",xe+b.linkInline}return p.match(/^[^>]+/,!0),b.linkInline}function d(p,c){if(p.eatSpace())return null;var Y=p.next();return Y==="("||Y==="["?(c.f=c.inline=w(Y==="("?")":"]"),I.highlightFormatting&&(c.formatting="link-string"),c.linkHref=!0,H(c)):"error"}var S={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(p){return function(c,Y){var xe=c.next();if(xe===p){Y.f=Y.inline=D,I.highlightFormatting&&(Y.formatting="link-string");var j=H(Y);return Y.linkHref=!1,j}return c.match(S[p]),Y.linkHref=!0,H(Y)}}function m(p,c){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(c.f=y,p.next(),I.highlightFormatting&&(c.formatting="link"),c.linkText=!0,H(c)):ne(p,c,D)}function y(p,c){if(p.match("]:",!0)){c.f=c.inline=P,I.highlightFormatting&&(c.formatting="link");var Y=H(c);return c.linkText=!1,Y}return p.match(/^([^\]\\]|\\.)+/,!0),b.linkText}function P(p,c){return p.eatSpace()?null:(p.match(/^[^\s]+/,!0),p.peek()===void 0?c.linkTitle=!0:p.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),c.f=c.inline=D,b.linkHref+" url")}var le={startState:function(){return{f:de,prevLine:{stream:null},thisLine:{stream:null},block:de,htmlState:null,indentation:0,inline:D,text:Ee,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(p){return{f:p.f,prevLine:p.prevLine,thisLine:p.thisLine,block:p.block,htmlState:p.htmlState&&C.copyState(K,p.htmlState),indentation:p.indentation,localMode:p.localMode,localState:p.localMode?C.copyState(p.localMode,p.localState):null,inline:p.inline,text:p.text,formatting:!1,linkText:p.linkText,linkTitle:p.linkTitle,linkHref:p.linkHref,code:p.code,em:p.em,strong:p.strong,strikethrough:p.strikethrough,emoji:p.emoji,header:p.header,setext:p.setext,hr:p.hr,taskList:p.taskList,list:p.list,listStack:p.listStack.slice(0),quote:p.quote,indentedCode:p.indentedCode,trailingSpace:p.trailingSpace,trailingSpaceNewLine:p.trailingSpaceNewLine,md_inside:p.md_inside,fencedEndRE:p.fencedEndRE}},token:function(p,c){if(c.formatting=!1,p!=c.thisLine.stream){if(c.header=0,c.hr=!1,p.match(/^\s*$/,!0))return ye(c),null;if(c.prevLine=c.thisLine,c.thisLine={stream:p},c.taskList=!1,c.trailingSpace=0,c.trailingSpaceNewLine=!1,!c.localState&&(c.f=c.block,c.f!=ze)){var Y=p.match(/^\s*/,!0)[0].replace(/\t/g,re).length;if(c.indentation=Y,c.indentationDiff=null,Y>0)return null}}return c.f(p,c)},innerMode:function(p){return p.block==ze?{state:p.htmlState,mode:K}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:le}},indent:function(p,c,Y){return p.block==ze&&K.indent?K.indent(p.htmlState,c,Y):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,c,Y):C.Pass},blankLine:ye,getType:H,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return le},"xml"),C.defineMIME("text/markdown","markdown"),C.defineMIME("text/x-markdown","markdown")})})();(function(Et,zt){(function(C){C(It())})(function(C){C.defineOption("placeholder","",function(N,_,ie){var O=ie&&ie!=C.Init;if(_&&!O)N.on("blur",$),N.on("change",V),N.on("swapDoc",V),C.on(N.getInputField(),"compositionupdate",N.state.placeholderCompose=function(){K(N)}),V(N);else if(!_&&O){N.off("blur",$),N.off("change",V),N.off("swapDoc",V),C.off(N.getInputField(),"compositionupdate",N.state.placeholderCompose),De(N);var q=N.getWrapperElement();q.className=q.className.replace(" CodeMirror-empty","")}_&&!N.hasFocus()&&$(N)});function De(N){N.state.placeholder&&(N.state.placeholder.parentNode.removeChild(N.state.placeholder),N.state.placeholder=null)}function I(N){De(N);var _=N.state.placeholder=document.createElement("pre");_.style.cssText="height: 0; overflow: visible",_.style.direction=N.getOption("direction"),_.className="CodeMirror-placeholder CodeMirror-line-like";var ie=N.getOption("placeholder");typeof ie=="string"&&(ie=document.createTextNode(ie)),_.appendChild(ie),N.display.lineSpace.insertBefore(_,N.display.lineSpace.firstChild)}function K(N){setTimeout(function(){var _=!1;if(N.lineCount()==1){var ie=N.getInputField();_=ie.nodeName=="TEXTAREA"?!N.getLine(0).length:!/[^\u200b]/.test(ie.querySelector(".CodeMirror-line").textContent)}_?I(N):De(N)},20)}function $(N){b(N)&&I(N)}function V(N){var _=N.getWrapperElement(),ie=b(N);_.className=_.className.replace(" CodeMirror-empty","")+(ie?" CodeMirror-empty":""),ie?I(N):De(N)}function b(N){return N.lineCount()===1&&N.getLine(0)===""}})})();(function(Et,zt){(function(C){C(It())})(function(C){C.defineSimpleMode=function(O,q){C.defineMode(O,function(z){return C.simpleMode(z,q)})},C.simpleMode=function(O,q){De(q,"start");var z={},X=q.meta||{},ke=!1;for(var we in q)if(we!=X&&q.hasOwnProperty(we))for(var te=z[we]=[],re=q[we],ne=0;ne2&&se.token&&typeof se.token!="string"){for(var de=2;de-1)return C.Pass;var we=z.indent.length-1,te=O[z.state];e:for(;;){for(var re=0;re$.keyCol)return K.skipToEnd(),"string";if($.literal&&($.literal=!1),K.sol()){if($.keyCol=0,$.pair=!1,$.pairStart=!1,K.match("---")||K.match("..."))return"def";if(K.match(/\s*-\s+/))return"meta"}if(K.match(/^(\{|\}|\[|\])/))return V=="{"?$.inlinePairs++:V=="}"?$.inlinePairs--:V=="["?$.inlineList++:$.inlineList--,"meta";if($.inlineList>0&&!b&&V==",")return K.next(),"meta";if($.inlinePairs>0&&!b&&V==",")return $.keyCol=0,$.pair=!1,$.pairStart=!1,K.next(),"meta";if($.pairStart){if(K.match(/^\s*(\||\>)\s*/))return $.literal=!0,"meta";if(K.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if($.inlinePairs==0&&K.match(/^\s*-?[0-9\.\,]+\s?$/)||$.inlinePairs>0&&K.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(K.match(I))return"keyword"}return!$.pair&&K.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^\s,\[\]{}#&*!|>'"%@`])[^#:]*(?=:($|\s))/)?($.pair=!0,$.keyCol=K.indentation(),"atom"):$.pair&&K.match(/^:\s*/)?($.pairStart=!0,"meta"):($.pairStart=!1,$.escaped=V=="\\",K.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}}),C.defineMIME("text/x-yaml","yaml"),C.defineMIME("text/yaml","yaml")})})();export{Du as default}; diff --git a/priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-ITBVLGwz.js b/priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-ITBVLGwz.js deleted file mode 100644 index b49cc918..00000000 --- a/priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-ITBVLGwz.js +++ /dev/null @@ -1,24 +0,0 @@ -import{n as mu,o as bu}from"./testServerConnection-Dj8RHZjQ.js";var ho={exports:{}},ha;function Ar(){return ha||(ha=1,function(yr,Or){(function(F,Ee){yr.exports=Ee()})(mu,function(){var F=navigator.userAgent,Ee=navigator.platform,Se=/gecko\/\d/i.test(F),We=/MSIE \d/.test(F),Qe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(F),Ce=/Edge\/(\d+)/.exec(F),M=We||Qe||Ce,j=M&&(We?document.documentMode||6:+(Ce||Qe)[1]),_=!Ce&&/WebKit\//.test(F),ie=_&&/Qt\/\d+\.\d+/.test(F),G=!Ce&&/Chrome\/(\d+)/.exec(F),se=G&&+G[1],ce=/Opera\//.test(F),Ie=/Apple Computer/.test(navigator.vendor),Te=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(F),Oe=/PhantomJS/.test(F),ae=Ie&&(/Mobile\/\w+/.test(F)||navigator.maxTouchPoints>2),V=/Android/.test(F),oe=ae||V||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(F),xe=ae||/Mac/.test(Ee),_e=/\bCrOS\b/.test(F),ye=/win/i.test(Ee),Me=ce&&F.match(/Version\/(\d*\.\d*)/);Me&&(Me=Number(Me[1])),Me&&Me>=15&&(ce=!1,_=!0);var He=xe&&(ie||ce&&(Me==null||Me<12.11)),ee=Se||M&&j>=9;function X(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var me=function(e,t){var n=e.className,r=X(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function H(e,t){return T(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return l+(t-o);l+=a-o,l+=n-l%n,o=a+1}}var ue=function(){this.id=null,this.f=null,this.time=0,this.handler=te(this.onTimeout,this)};ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ue.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(l,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var lt=[""];function ht(e){for(;lt.length<=e;)lt.push(re(lt)+" ");return lt[e]}function re(e){return e[e.length-1]}function Ne(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||be.test(e))}function ne(e,t){return t?t.source.indexOf("\\w")>-1&&R(e)?!0:t.test(e):R(e)}function Y(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var we=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ve(e){return e.charCodeAt(0)>=768&&we.test(e)}function Tt(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function rr(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var mr=null;function nr(e,t,n){var r;mr=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:mr=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:mr=i)}return r??mr}var gi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,d,p){this.level=u,this.from=d,this.to=p}return function(u,d){var p=d=="ltr"?"L":"R";if(u.length==0||d=="ltr"&&!r.test(u))return!1;for(var m=u.length,y=[],S=0;S-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function qe(e,t){var n=Yt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Et(e){e.prototype.on=function(t,n){J(this,t,n)},e.prototype.off=function(t,n){ut(this,t,n)}}function ft(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function zr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function yt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ir(e){ft(e),zr(e)}function ln(e){return e.target||e.srcElement}function It(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),xe&&e.ctrlKey&&t==1&&(t=3),t}var yi=function(){if(M&&j<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Pr;function _n(e){if(Pr==null){var t=c("span","​");H(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Pr=t.offsetWidth<=1&&t.offsetHeight>2&&!(M&&j<8))}var n=Pr?c("span","​"):c("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function or(e){if(an!=null)return an;var t=H(e,document.createTextNode("AخA")),n=b(t,0,1).getBoundingClientRect(),r=b(t,1,2).getBoundingClientRect();return T(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var Pt=` - -b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` -`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},lr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Hn=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ft=null;function mi(e){if(Ft!=null)return Ft;var t=H(e,c("span","x")),n=t.getBoundingClientRect(),r=b(t,0,1).getBoundingClientRect();return Ft=Math.abs(n.left-r.left)>1}var Er={},Wt={};function _t(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Er[e]=t}function br(e,t){Wt[e]=t}function Ir(e){if(typeof e=="string"&&Wt.hasOwnProperty(e))e=Wt[e];else if(e&&typeof e.name=="string"&&Wt.hasOwnProperty(e.name)){var t=Wt[e.name];typeof t=="string"&&(t={name:t}),e=C(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ir("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ir("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Fr(e,t){t=Ir(t);var n=Er[t.name];if(!n)return Fr(e,"text/plain");var r=n(e,t);if(ar.hasOwnProperty(t.name)){var i=ar[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var ar={};function Wr(e,t){var n=ar.hasOwnProperty(e)?ar[e]:ar[e]={};de(t,n)}function Ut(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function sn(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function _r(e,t,n){return e.startState?e.startState(t,n):!0}var je=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};je.prototype.eol=function(){return this.pos>=this.string.length},je.prototype.sol=function(){return this.pos==this.lineStart},je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},je.prototype.next=function(){if(this.post},je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},je.prototype.skipToEnd=function(){this.pos=this.string.length},je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},je.prototype.backUp=function(e){this.pos-=e},je.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},je.prototype.current=function(){return this.string.slice(this.start,this.pos)},je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function U(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?k(n,U(e,n).text.length):ba(t,U(e,t.line).text.length)}function ba(e,t){var n=e.ch;return n==null||n>t?k(e.line,t):n<0?k(e.line,0):e}function vo(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},qt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},qt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},qt.fromSaved=function(e,t,n){return t instanceof Bn?new qt(e,Ut(e.mode,t.state),n,t.lookAhead):new qt(e,Ut(e.mode,t),n)},qt.prototype.save=function(e){var t=e!==!1?Ut(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Bn(t,this.maxLookAhead):t};function go(e,t,n,r){var i=[e.state.modeGen],o={};ko(e,t.text,e.doc.mode,n,function(u,d){return i.push(u,d)},o,r);for(var l=n.state,a=function(u){n.baseTokens=i;var d=e.state.overlays[u],p=1,m=0;n.state=!0,ko(e,t.text,d.mode,n,function(y,S){for(var N=p;my&&i.splice(p,1,y,i[p+1],z),p+=2,m=Math.min(y,z)}if(S)if(d.opaque)i.splice(N,p-N,y,"overlay "+S),p=N+2;else for(;Ne.options.maxHighlightLength&&Ut(e.doc.mode,r.state),o=go(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function fn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new qt(r,!0,t);var o=xa(e,t,n),l=o>r.first&&U(r,o-1).stateAfter,a=l?qt.fromSaved(r,l,o):new qt(r,_r(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var bo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function xo(e,t,n,r){var i=e.doc,o=i.mode,l;t=fe(i,t);var a=U(i,t.line),s=fn(e,t.line,n),u=new je(a.text,e.options.tabSize,s),d;for(r&&(d=[]);(r||u.pose.options.maxHighlightLength?(a=!1,l&&bi(e,t,r,d.pos),d.pos=t.length,p=null):p=wo(xi(n,d,r.state,m),o),m){var y=m[0].name;y&&(p="m-"+(p?y+" "+p:y))}if(!a||u!=p){for(;sl;--a){if(a<=o.first)return o.first;var s=U(o,a-1),u=s.stateAfter;if(u&&(!n||a+(u instanceof Bn?u.lookAhead:0)<=o.modeFrontier))return a;var d=he(s.text,null,e.options.tabSize);(i==null||r>d)&&(i=a-1,r=d)}return i}function wa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=U(e,r).stateAfter;if(i&&(!(i instanceof Bn)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Rn(l,o.from,s?null:o.to))}}return r}function Ma(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from0&&a)for(var B=0;B0)){var d=[s,1],p=I(u.from,a.from),m=I(u.to,a.to);(p<0||!l.inclusiveLeft&&!p)&&d.push({from:u.from,to:a.from}),(m>0||!l.inclusiveRight&&!m)&&d.push({from:a.to,to:u.to}),i.splice.apply(i,d),s+=d.length-3}}return i}function To(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!r||ki(r,o.marker)<0)&&(r=o.marker)}return r}function Do(e,t,n,r,i){var o=U(e,t),l=Jt&&o.markedSpans;if(l)for(var a=0;a=0&&p<=0||d<=0&&p>=0)&&(d<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?I(u.to,n)>=0:I(u.to,n)>0)||d>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?I(u.from,r)<=0:I(u.from,r)<0)))return!0}}}function Ht(e){for(var t;t=No(e);)e=t.find(-1,!0).line;return e}function Aa(e){for(var t;t=qn(e);)e=t.find(1,!0).line;return e}function Oa(e){for(var t,n;t=qn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Si(e,t){var n=U(e,t),r=Ht(n);return n==r?t:f(r)}function Ao(e,t){if(t>e.lastLine())return t;var n=U(e,t),r;if(!sr(e,n))return t;for(;r=qn(n);)n=r.find(1,!0).line;return f(n)+1}function sr(e,t){var n=Jt&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Br=function(e,t,n){this.text=e,Lo(this,t),this.height=n?n(this):1};Br.prototype.lineNo=function(){return f(this)},Et(Br);function za(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),To(e),Lo(e,n);var i=r?r(e):1;i!=e.height&&Dt(e,i)}function Pa(e){e.parent=null,To(e)}var Ea={},Ia={};function Oo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ia:Ea;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function zo(e,t){var n=x("span",null,null,_?"padding-right: .1px":null),r={pre:x("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=Wa,or(e.display.measure)&&(l=ke(o,e.doc.direction))&&(r.addToken=Ha(r.addToken,l)),r.map=[];var a=t!=e.display.externalMeasured&&f(o);Ba(o,r,yo(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=K(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=K(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(_n(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return qe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=K(r.pre.className,r.textClass||"")),r}function Fa(e){var t=c("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Wa(e,t,n,r,i,o,l){if(t){var a=e.splitSpaces?_a(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,d;if(!s.test(t))e.col+=t.length,d=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,d),M&&j<9&&(u=!0),e.pos+=t.length;else{d=document.createDocumentFragment();for(var p=0;;){s.lastIndex=p;var m=s.exec(t),y=m?m.index-p:t.length-p;if(y){var S=document.createTextNode(a.slice(p,p+y));M&&j<9?d.appendChild(c("span",[S])):d.appendChild(S),e.map.push(e.pos,e.pos+y,S),e.col+=y,e.pos+=y}if(!m)break;p+=y+1;var N=void 0;if(m[0]==" "){var z=e.cm.options.tabSize,P=z-e.col%z;N=d.appendChild(c("span",ht(P),"cm-tab")),N.setAttribute("role","presentation"),N.setAttribute("cm-text"," "),e.col+=P}else m[0]=="\r"||m[0]==` -`?(N=d.appendChild(c("span",m[0]=="\r"?"␍":"␤","cm-invalidchar")),N.setAttribute("cm-text",m[0]),e.col+=1):(N=e.cm.options.specialCharPlaceholder(m[0]),N.setAttribute("cm-text",m[0]),M&&j<9?d.appendChild(c("span",[N])):d.appendChild(N),e.col+=1);e.map.push(e.pos,e.pos+1,N),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,n||r||i||u||o||l){var W=n||"";r&&(W+=r),i&&(W+=i);var E=c("span",[d],W,o);if(l)for(var B in l)l.hasOwnProperty(B)&&B!="style"&&B!="class"&&E.setAttribute(B,l[B]);return e.content.appendChild(E)}e.content.appendChild(d)}}function _a(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&p.from<=u));m++);if(p.to>=d)return e(n,r,i,o,l,a,s);e(n,r.slice(0,p.to-u),i,o,null,a,s),o=null,r=r.slice(p.to-u),u=p.to}}}function Po(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Ba(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var l=1;ls||ge.collapsed&&Z.to==s&&Z.from==s)){if(Z.to!=null&&Z.to!=s&&y>Z.to&&(y=Z.to,N=""),ge.className&&(S+=" "+ge.className),ge.css&&(m=(m?m+";":"")+ge.css),ge.startStyle&&Z.from==s&&(z+=" "+ge.startStyle),ge.endStyle&&Z.to==y&&(B||(B=[])).push(ge.endStyle,Z.to),ge.title&&((W||(W={})).title=ge.title),ge.attributes)for(var Fe in ge.attributes)(W||(W={}))[Fe]=ge.attributes[Fe];ge.collapsed&&(!P||ki(P.marker,ge)<0)&&(P=Z)}else Z.from>s&&y>Z.from&&(y=Z.from)}if(B)for(var it=0;it=a)break;for(var Nt=Math.min(a,y);;){if(d){var wt=s+d.length;if(!P){var Ze=wt>Nt?d.slice(0,Nt-s):d;t.addToken(t,Ze,p?p+S:S,z,s+Ze.length==y?N:"",m,W)}if(wt>=Nt){d=d.slice(Nt-s),s=Nt;break}s=wt,z=""}d=i.slice(o,o=n[u++]),p=Oo(n[u++],t.cm.options)}}}function Eo(e,t,n){this.line=t,this.rest=Oa(t),this.size=this.rest?f(re(this.rest))-n+1:1,this.node=this.text=null,this.hidden=sr(e,t)}function jn(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ro(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Qa(e,t){t=Ht(t);var n=f(t),r=e.display.externalMeasured=new Eo(e.doc,t,n);r.lineN=n;var i=r.built=zo(e,r);return r.text=i.pre,H(e.display.lineMeasure,i.pre),r}function Ko(e,t,n,r){return jt(e,Kr(e,t),n,r)}function Di(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=s-a,i=o-1,t>=s&&(l="right")),i!=null){if(r=e[u+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],l="left";if(n=="right"&&i==s-a)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function $a(e,t,n,r){var i=qo(t.map,n,r),o=i.node,l=i.start,a=i.end,s=i.collapse,u;if(o.nodeType==3){for(var d=0;d<4;d++){for(;l&&ve(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+a0&&(s=r="right");var p;e.options.lineWrapping&&(p=o.getClientRects()).length>1?u=p[r=="right"?p.length-1:0]:u=o.getBoundingClientRect()}if(M&&j<9&&!l&&(!u||!u.left&&!u.right)){var m=o.parentNode.getClientRects()[0];m?u={left:m.left,right:m.left+qr(e.display),top:m.top,bottom:m.bottom}:u=Uo}for(var y=u.top-t.rect.top,S=u.bottom-t.rect.top,N=(y+S)/2,z=t.view.measure.heights,P=0;P=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l(u=="before"?s-1:s,u=="before");function d(S,N,z){var P=a[N],W=P.level==1;return l(z?S-1:S,W!=z)}var p=nr(a,s,u),m=mr,y=d(s,p,u=="before");return m!=null&&(y.other=d(s,m,u!="before")),y}function Jo(e,t){var n=0;t=fe(e.doc,t),e.options.lineWrapping||(n=qr(e.display)*t.ch);var r=U(e.doc,t.line),i=Qt(r)+Xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Oi(e,t,n,r,i){var o=k(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function zi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Oi(r.first,0,null,-1,-1);var i=h(r,n),o=r.first+r.size-1;if(i>o)return Oi(r.first+r.size-1,U(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=U(r,i);;){var a=ts(e,l,i,t,n),s=Da(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=U(r,i=u.line)}}function Qo(e,t,n,r){r-=Ai(t);var i=t.text.length,o=Ot(function(l){return jt(e,n,l-1).bottom<=r},i,0);return i=Ot(function(l){return jt(e,n,l).top>r},o,i),{begin:o,end:i}}function Vo(e,t,n,r){n||(n=Kr(e,t));var i=Yn(e,t,jt(e,n,r),"line").top;return Qo(e,t,n,i)}function Pi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function ts(e,t,n,r,i){i-=Qt(t);var o=Kr(e,t),l=Ai(t),a=0,s=t.text.length,u=!0,d=ke(t,e.doc.direction);if(d){var p=(e.options.lineWrapping?ns:rs)(e,t,n,o,d,r,i);u=p.level!=1,a=u?p.from:p.to-1,s=u?p.to:p.from-1}var m=null,y=null,S=Ot(function(Q){var Z=jt(e,o,Q);return Z.top+=l,Z.bottom+=l,Pi(Z,r,i,!1)?(Z.top<=i&&Z.left<=r&&(m=Q,y=Z),!0):!1},a,s),N,z,P=!1;if(y){var W=r-y.left=B.bottom?1:0}return S=Tt(t.text,S,1),Oi(n,S,z,P,r-N)}function rs(e,t,n,r,i,o,l){var a=Ot(function(p){var m=i[p],y=m.level!=1;return Pi(Bt(e,k(n,y?m.to:m.from,y?"before":"after"),"line",t,r),o,l,!0)},0,i.length-1),s=i[a];if(a>0){var u=s.level!=1,d=Bt(e,k(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Pi(d,o,l,!0)&&d.top>l&&(s=i[a-1])}return s}function ns(e,t,n,r,i,o,l){var a=Qo(e,t,r,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var d=null,p=null,m=0;m=u||y.to<=s)){var S=y.level!=1,N=jt(e,r,S?Math.min(u,y.to)-1:Math.max(s,y.from)).right,z=Nz)&&(d=y,p=z)}}return d||(d=i[i.length-1]),d.fromu&&(d={from:d.from,to:u,level:d.level}),d}var wr;function Ur(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(wr==null){wr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)wr.appendChild(document.createTextNode("x")),wr.appendChild(c("br"));wr.appendChild(document.createTextNode("x"))}H(e.measure,wr);var n=wr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function qr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");H(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ei(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;n[a]=o.offsetLeft+o.clientLeft+i,r[a]=o.clientWidth}return{fixedPos:Ii(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ii(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function $o(e){var t=Ur(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/qr(e.display)-3);return function(i){if(sr(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l0&&(u=U(e.doc,s.line).text).length==s.ch){var d=he(u,u.length,e.options.tabSize)-u.length;s=k(s.line,Math.max(0,Math.round((o-Bo(e.display).left)/qr(e.display))-d))}return s}function Sr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Jt&&Si(e.doc,t)i.viewFrom?fr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)fr(e);else if(t<=i.viewFrom){var o=Jn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):fr(e)}else if(n>=i.viewTo){var l=Jn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):fr(e)}else{var a=Jn(e,t,t,-1),s=Jn(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(jn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):fr(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Sr(e,t)];if(o.node!=null){var l=o.changes||(o.changes=[]);q(l,n)==-1&&l.push(n)}}}function fr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Jn(e,t,n,r){var i=Sr(e,t),o,l=e.display.view;if(!Jt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var a=e.display.viewFrom,s=0;s0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,n+=o}for(;Si(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function is(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=jn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=jn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Sr(e,n)))),r.viewTo=n}function el(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?l:e.defaultCharWidth())+"px"}if(r.other){var a=n.appendChild(c("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Qn(e,t){return e.top-t.top||e.left-t.left}function os(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=Bo(e.display),a=l.left,s=Math.max(r.sizerWidth,xr(e)-r.sizer.offsetLeft)-l.right,u=i.direction=="ltr";function d(E,B,Q,Z){B<0&&(B=0),B=Math.round(B),Z=Math.round(Z),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+E+`px; - top: `+B+"px; width: "+(Q??s-E)+`px; - height: `+(Z-B)+"px"))}function p(E,B,Q){var Z=U(i,E),ge=Z.text.length,Fe,it;function Ue(Ze,kt){return Zn(e,k(E,Ze),"div",Z,kt)}function Nt(Ze,kt,at){var $e=Vo(e,Z,null,Ze),Je=kt=="ltr"==(at=="after")?"left":"right",Xe=at=="after"?$e.begin:$e.end-(/\s/.test(Z.text.charAt($e.end-1))?2:1);return Ue(Xe,Je)[Je]}var wt=ke(Z,i.direction);return rr(wt,B||0,Q??ge,function(Ze,kt,at,$e){var Je=at=="ltr",Xe=Ue(Ze,Je?"left":"right"),St=Ue(kt-1,Je?"right":"left"),nn=B==null&&Ze==0,gr=Q==null&&kt==ge,dt=$e==0,Xt=!wt||$e==wt.length-1;if(St.top-Xe.top<=3){var ot=(u?nn:gr)&&dt,fo=(u?gr:nn)&&Xt,tr=ot?a:(Je?Xe:St).left,Nr=fo?s:(Je?St:Xe).right;d(tr,Xe.top,Nr-tr,Xe.bottom)}else{var Dr,vt,on,co;Je?(Dr=u&&nn&&dt?a:Xe.left,vt=u?s:Nt(Ze,at,"before"),on=u?a:Nt(kt,at,"after"),co=u&&gr&&Xt?s:St.right):(Dr=u?Nt(Ze,at,"before"):a,vt=!u&&nn&&dt?s:Xe.right,on=!u&&gr&&Xt?a:St.left,co=u?Nt(kt,at,"after"):s),d(Dr,Xe.top,vt-Dr,Xe.bottom),Xe.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Gr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function rl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Bi(e))}function Hi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Gr(e))},100)}function Bi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(qe(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),_&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),_i(e))}function Gr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(qe(e,"blur",e,t),e.state.focused=!1,me(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Vn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l.005||y<-.005)&&(ie.display.sizerWidth){var N=Math.ceil(d/qr(e.display));N>e.display.maxLineLength&&(e.display.maxLineLength=N,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function nl(e){if(e.widgets)for(var t=0;t=l&&(o=h(t,Qt(U(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function ls(e,t){if(!Ge(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!Oe){var l=c("div","​",null,`position: absolute; - top: `+(t.top-n.viewOffset-Xn(e.display))+`px; - height: `+(t.bottom-t.top+Gt(e)+n.barHeight)+`px; - left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function as(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?k(t.line,t.ch+1,"before"):t,t=t.ch?k(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=Bt(e,t),s=!n||n==t?a:Bt(e,n);i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r};var u=Ri(e,i),d=e.doc.scrollTop,p=e.doc.scrollLeft;if(u.scrollTop!=null&&(mn(e,u.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(l=!0)),u.scrollLeft!=null&&(Cr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(l=!0)),!l)break}return i}function ss(e,t){var n=Ri(e,t);n.scrollTop!=null&&mn(e,n.scrollTop),n.scrollLeft!=null&&Cr(e,n.scrollLeft)}function Ri(e,t){var n=e.display,r=Ur(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ni(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Mi(n),s=t.topa-r;if(t.topi+o){var d=Math.min(t.top,(u?a:t.bottom)-o);d!=i&&(l.scrollTop=d)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,m=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-p,y=xr(e)-n.gutters.offsetWidth,S=t.right-t.left>y;return S&&(t.right=t.left+y),t.left<10?l.scrollLeft=0:t.lefty+m-3&&(l.scrollLeft=t.right+(S?0:10)-y),l}function Ki(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function jr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function yn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function us(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Jo(e,t.from),r=Jo(e,t.to);il(e,n,r,t.margin)}}function il(e,t,n,r){var i=Ri(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});yn(e,i.scrollLeft,i.scrollTop)}function mn(e,t){Math.abs(e.doc.scrollTop-t)<2||(Se||qi(e,{top:t}),ol(e,t,!0),Se&&qi(e),wn(e,100))}function ol(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Cr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,fl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Mi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Gt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Tr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),J(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),J(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,M&&j<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Tr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Tr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Tr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Tr.prototype.zeroWidthHack=function(){var e=xe&&!Te?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ue,this.disableVert=new ue},Tr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Tr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var xn=function(){};xn.prototype.update=function(){return{bottom:0,right:0}},xn.prototype.setScrollLeft=function(){},xn.prototype.setScrollTop=function(){},xn.prototype.clear=function(){};function Xr(e,t){t||(t=bn(e));var n=e.display.barWidth,r=e.display.barHeight;ll(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Vn(e),ll(e,bn(e)),n=e.display.barWidth,r=e.display.barHeight}function ll(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var al={native:Tr,null:xn};function sl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&me(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new al[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),J(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Cr(e,t):mn(e,t)},e),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)}var fs=0;function Lr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++fs,markArrays:null},Ra(e.curOp)}function Mr(e){var t=e.curOp;t&&Ua(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ti(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function hs(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function ps(e){var t=e.cm,n=t.display;e.updatedDisplay&&Vn(t),e.barMeasure=bn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ko(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Gt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-xr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function vs(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=fn(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Ut(t.mode,r.state):null,s=go(e,o,r,!0);a&&(r.state=a),o.styles=s.styles;var u=o.styleClasses,d=s.classes;d?o.styleClasses=d:u&&(o.styleClasses=null);for(var p=!l||l.length!=o.styles.length||u!=d&&(!u||!d||u.bgClass!=d.bgClass||u.textClass!=d.textClass),m=0;!p&&mn)return wn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Mt(e,function(){for(var o=0;o=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&el(e)==0)return!1;cl(e)&&(fr(e),t.dims=Ei(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroml&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Jt&&(o=Si(e.doc,o),l=Ao(e.doc,l));var a=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;is(e,o,l),n.viewOffset=Qt(U(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=el(e);if(!a&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=bs(e);return s>4&&(n.lineDiv.style.display="none"),ws(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,xs(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,wn(e,400)),n.updateLineNumbers=null,!0}function ul(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==xr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Mi(e.display)-Ni(e),n.top)}),t.visible=$n(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=$n(e.display,e.doc,n));if(!Ui(e,t))break;Vn(e);var i=bn(e);gn(e),Xr(e,i),ji(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function qi(e,t){var n=new ti(e,t);if(Ui(e,n)){Vn(e),ul(e,n);var r=bn(e);gn(e),Xr(e,r),ji(e,r),n.finish()}}function ws(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function a(S){var N=S.nextSibling;return _&&xe&&e.display.currentWheelTarget==S?S.style.display="none":S.parentNode.removeChild(S),N}for(var s=r.view,u=r.viewFrom,d=0;d-1&&(y=!1),Io(e,p,u,n)),y&&(T(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(O(e.options,u)))),l=p.node.nextSibling}u+=p.size}for(;l;)l=a(l)}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",tt(e,"gutterChanged",e)}function ji(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Gt(e)+"px"}function fl(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ii(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),M&&j<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!_&&!(Se&&oe)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Xi(r.gutters,r.lineNumbers),dl(i),n.init(i)}var ri=0,$t=null;M?$t=-.53:Se?$t=15:G?$t=-.7:Ie&&($t=-1/3);function hl(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function Ss(e){var t=hl(e);return t.x*=$t,t.y*=$t,t}function pl(e,t){G&&se==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=hl(t),r=n.x,i=n.y,o=$t;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var l=e.display,a=l.scroller,s=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||i&&u){if(i&&xe&&_){e:for(var d=t.target,p=l.view;d!=a;d=d.parentNode)for(var m=0;m=0&&I(e,r.to())<=0)return n}return-1};var Ae=function(e,t){this.anchor=e,this.head=t};Ae.prototype.from=function(){return Hr(this.anchor,this.head)},Ae.prototype.to=function(){return mt(this.anchor,this.head)},Ae.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Rt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(m,y){return I(m.from(),y.from())}),n=q(t,i);for(var o=1;o0:s>=0){var u=Hr(a.from(),l.from()),d=mt(a.to(),l.to()),p=a.empty()?l.from()==l.head:a.from()==a.head;o<=n&&--n,t.splice(--o,2,new Ae(p?d:u,p?u:d))}}return new At(t,n)}function cr(e,t){return new At([new Ae(e,t||e)],0)}function dr(e){return e.text?k(e.from.line+e.text.length-1,re(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function vl(e,t){if(I(e,t.from)<0)return e;if(I(e,t.to)<=0)return dr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=dr(t).ch-t.to.ch),k(n,r)}function Yi(e,t){for(var n=[],r=0;r1&&e.remove(a.line+1,S-1),e.insert(a.line+1,P)}tt(e,"change",e,t)}function hr(e,t,n){function r(i,o,l){if(i.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges)return e.done.pop(),re(e.done)}function wl(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,l,a;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=Ls(i,i.lastOp==r)))a=re(l.changes),I(t.from,t.to)==0&&I(t.from,a.to)==0?a.to=dr(t):l.changes.push(Qi(e,t));else{var s=re(i.done);for((!s||!s.ranges)&&ii(e.sel,i.done),l={changes:[Qi(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||qe(e,"historyAdded")}function Ms(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ns(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Ms(e,o,re(i.done),t))?i.done[i.done.length-1]=t:ii(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&xl(i.undone)}function ii(e,t){var n=re(t);n&&n.ranges&&n.equals(e)||t.push(e)}function kl(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function Ds(e){if(!e)return null;for(var t,n=0;n-1&&(re(a)[p]=u[p],delete u[p])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=I(t,i)<0;o!=I(n,i)<0?(i=t,t=n):o!=I(t,n)<0&&(t=n)}return new Ae(i,t)}else return new Ae(n||t,t)}function oi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),ct(e,new At([Vi(e.sel.primary(),t,n,i)],0),r)}function Cl(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:a.to>t.ch))){if(i&&(qe(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!s.atomic)continue;if(n){var p=s.find(r<0?1:-1),m=void 0;if((r<0?d:u)&&(p=Al(e,p,-r,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(m=I(p,n))&&(r<0?m<0:m>0))return Zr(e,p,t,r,i)}var y=s.find(r<0?-1:1);return(r<0?u:d)&&(y=Al(e,y,r,y.line==t.line?o:null)),y?Zr(e,y,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,l=Zr(e,t,n,o,i)||!i&&Zr(e,t,n,o,!0)||Zr(e,t,n,-o,i)||!i&&Zr(e,t,n,-o,!0);return l||(e.cantEdit=!0,k(e.first,0))}function Al(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?fe(e,k(t.line-1)):null:n>0&&t.ch==(r||U(e,t.line)).text.length?t.line=0;--i)Pl(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Pl(e,t)}}function Pl(e,t){if(!(t.text.length==1&&t.text[0]==""&&I(t.from,t.to)==0)){var n=Yi(e,t);wl(e,t,n,e.cm?e.cm.curOp.id:NaN),Cn(e,t,n,wi(e,t));var r=[];hr(e,function(i,o){!o&&q(r,i.history)==-1&&(Wl(i.history,t),r.push(i.history)),Cn(i,t,null,wi(i,t))})}}function si(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,l=e.sel,a=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u=0;--y){var S=m(y);if(S)return S.v}}}}function El(e,t){if(t!=0&&(e.first+=t,e.sel=new At(Ne(e.sel.ranges,function(i){return new Ae(k(i.anchor.line+t,i.anchor.ch),k(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){bt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:k(o,U(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Zt(e,t.from,t.to),n||(n=Yi(e,t)),e.cm?zs(e.cm,t,r):Ji(e,t,r),li(e,n,st),e.cantEdit&&ai(e,k(e.firstLine(),0))&&(e.cantEdit=!1)}}function zs(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=f(Ht(U(r,o.line))),r.iter(s,l.line+1,function(y){if(y==i.maxLine)return a=!0,!0})),r.sel.contains(t.from,t.to)>-1&&zt(e),Ji(r,t,n,$o(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(y){var S=Gn(y);S>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=S,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),wa(r,o.line),wn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?bt(e):o.line==l.line&&t.text.length==1&&!yl(e.doc,t)?ur(e,o.line,"text"):bt(e,o.line,l.line+1,u);var d=Lt(e,"changes"),p=Lt(e,"change");if(p||d){var m={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};p&&tt(e,"change",e,m),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(m)}e.display.selForContextMenu=null}function Qr(e,t,n,r,i){var o;r||(r=n),I(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Jr(e,{from:n,to:r,text:t,origin:i})}function Il(e,t,n,r){n1||!(this.children[0]instanceof Ln))){var a=[];this.collapse(a),this.children=[new Ln(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var l=i.lines.length%25+25,a=l;a10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&bt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Nl(e.doc)),e&&tt(e,"markerCleared",e,this,r,i),t&&Mr(e),this.parent&&this.parent.clear()}},pr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=x("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Do(e,t.line,t,n,o)||t.line!=n.line&&Do(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Sa()}o.addToHistory&&wl(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,n.line+1,function(p){s&&o.collapsed&&!s.options.lineWrapping&&Ht(p)==s.display.maxLine&&(u=!0),o.collapsed&&a!=t.line&&Dt(p,0),Ta(p,new Rn(o,a==t.line?t.ch:null,a==n.line?n.ch:null),e.cm&&e.cm.curOp),++a}),o.collapsed&&e.iter(t.line,n.line+1,function(p){sr(e,p)&&Dt(p,0)}),o.clearOnEnter&&J(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(ka(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Hl,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)bt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var d=t.line;d<=n.line;d++)ur(s,d,"text");o.atomic&&Nl(s.doc),tt(s,"markerAdded",s,o)}return o}var Dn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)Jr(this,r[s]);a?Ll(this,a):this.cm&&jr(this.cm)}),undo:nt(function(){si(this,"undo")}),redo:nt(function(){si(this,"redo")}),undoSelection:nt(function(){si(this,"undo",!0)}),redoSelection:nt(function(){si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=fe(this,e),t=fe(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n}),fe(this,k(n,t))},indexFromPos:function(e){e=fe(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData("Text");if(d){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),li(t.doc,cr(n,n)),p)for(var m=0;m=0;a--)Qr(e.doc,"",r[a].from,r[a].to,"+delete");jr(e)})}function eo(e,t,n){var r=Tt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new k(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=ke(n,t.doc.direction);if(o){var l=i<0?re(o):o[0],a=i<0==(l.level==1),s=a?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){var d=Kr(t,n);u=i<0?n.text.length-1:0;var p=jt(t,d,u).top;u=Ot(function(m){return jt(t,d,m).top==p},i<0==(l.level==1)?l.from:l.to-1,u),s=="before"&&(u=eo(n,u,1))}else u=i<0?l.to:l.from;return new k(r,u,s)}}return new k(r,i<0?n.text.length:0,i<0?"before":"after")}function js(e,t,n,r){var i=ke(t,e.doc.direction);if(!i)return to(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=nr(i,n.ch,n.sticky),l=i[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>n.ch:l.from=l.from&&m>=d.begin)){var y=p?"before":"after";return new k(n.line,m,y)}}var S=function(P,W,E){for(var B=function(Fe,it){return it?new k(n.line,a(Fe,1),"before"):new k(n.line,Fe,"after")};P>=0&&P0==(Q.level!=1),ge=Z?E.begin:a(E.end,-1);if(Q.from<=ge&&ge0?d.end:a(d.begin,-1);return z!=null&&!(r>0&&z==t.text.length)&&(N=S(r>0?0:i.length-1,r,u(z)),N)?N:null}var zn={selectAll:Ol,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),st)},killLine:function(e){return en(e,function(t){if(t.empty()){var n=U(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new k(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),k(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=U(e.doc,i.line-1).text;l&&(i=new k(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),k(i.line-1,l.length-1),i,"+transpose"))}}n.push(new Ae(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Mt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&I(t,this.pos)==0&&n==this.button};var En,In;function $s(e,t){var n=+new Date;return In&&In.compare(n,e,t)?(En=In=null,"triple"):En&&En.compare(n,e,t)?(In=new io(n,e,t),En=null,"double"):(En=new io(n,e,t),In=null,"single")}function ta(e){var t=this,n=t.display;if(!(Ge(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Vt(n,e)){_||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=kr(t,e),i=It(e),o=r?$s(r,i):"single";le(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&eu(t,i,r,o,e))&&(i==1?r?ru(t,r,o,e):ln(e)==n.scroller&&ft(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(ee?t.display.input.onContextMenu(e):Hi(t)))}}}function eu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Pn(e,jl(o,i),i,function(l){if(typeof l=="string"&&(l=zn[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,n)!=Ct}finally{e.state.suppressEdits=!1}return a})}function tu(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=_e?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=xe?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(xe?n.altKey:n.ctrlKey)),i}function ru(e,t,n,r){M?setTimeout(te(rl,e),0):e.curOp.focus=g(Re(e));var i=tu(e,n,r),o=e.doc.sel,l;e.options.dragDrop&&yi&&!e.isReadOnly()&&n=="single"&&(l=o.contains(t))>-1&&(I((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(I(l.to(),t)>0||t.xRel<0)?nu(e,r,t,i):iu(e,r,t,i)}function nu(e,t,n,r){var i=e.display,o=!1,l=rt(e,function(u){_&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Hi(e)),ut(i.wrapper.ownerDocument,"mouseup",l),ut(i.wrapper.ownerDocument,"mousemove",a),ut(i.scroller,"dragstart",s),ut(i.scroller,"drop",l),o||(ft(u),r.addNew||oi(e.doc,n,null,null,r.extend),_&&!Ie||M&&j==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),a=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};_&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,J(i.wrapper.ownerDocument,"mouseup",l),J(i.wrapper.ownerDocument,"mousemove",a),J(i.scroller,"dragstart",s),J(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ra(e,t,n){if(n=="char")return new Ae(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ae(k(t.line,0),fe(e.doc,k(t.line+1,0)));var r=n(e,t);return new Ae(r.from,r.to)}function iu(e,t,n,r){M&&Hi(e);var i=e.display,o=e.doc;ft(t);var l,a,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),a>-1?l=u[a]:l=new Ae(n,n)):(l=o.sel.primary(),a=o.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new Ae(n,n)),n=kr(e,t,!0,!0),a=-1;else{var d=ra(e,n,r.unit);r.extend?l=Vi(l,d.anchor,d.head,r.extend):l=d}r.addNew?a==-1?(a=u.length,ct(o,Rt(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&r.unit=="char"&&!r.extend?(ct(o,Rt(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,a,l,gt):(a=0,ct(o,new At([l],0),gt),s=o.sel);var p=n;function m(E){if(I(p,E)!=0)if(p=E,r.unit=="rectangle"){for(var B=[],Q=e.options.tabSize,Z=he(U(o,n.line).text,n.ch,Q),ge=he(U(o,E.line).text,E.ch,Q),Fe=Math.min(Z,ge),it=Math.max(Z,ge),Ue=Math.min(n.line,E.line),Nt=Math.min(e.lastLine(),Math.max(n.line,E.line));Ue<=Nt;Ue++){var wt=U(o,Ue).text,Ze=Ke(wt,Fe,Q);Fe==it?B.push(new Ae(k(Ue,Ze),k(Ue,Ze))):wt.length>Ze&&B.push(new Ae(k(Ue,Ze),k(Ue,Ke(wt,it,Q))))}B.length||B.push(new Ae(n,n)),ct(o,Rt(e,s.ranges.slice(0,a).concat(B),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(E)}else{var kt=l,at=ra(e,E,r.unit),$e=kt.anchor,Je;I(at.anchor,$e)>0?(Je=at.head,$e=Hr(kt.from(),at.anchor)):(Je=at.anchor,$e=mt(kt.to(),at.head));var Xe=s.ranges.slice(0);Xe[a]=ou(e,new Ae(fe(o,$e),Je)),ct(o,Rt(e,Xe,a),gt)}}var y=i.wrapper.getBoundingClientRect(),S=0;function N(E){var B=++S,Q=kr(e,E,!0,r.unit=="rectangle");if(Q)if(I(Q,p)!=0){e.curOp.focus=g(Re(e)),m(Q);var Z=$n(i,o);(Q.line>=Z.to||Q.liney.bottom?20:0;ge&&setTimeout(rt(e,function(){S==B&&(i.scroller.scrollTop+=ge,N(E))}),50)}}function z(E){e.state.selectingText=!1,S=1/0,E&&(ft(E),i.input.focus()),ut(i.wrapper.ownerDocument,"mousemove",P),ut(i.wrapper.ownerDocument,"mouseup",W),o.history.lastSelOrigin=null}var P=rt(e,function(E){E.buttons===0||!It(E)?z(E):N(E)}),W=rt(e,z);e.state.selectingText=W,J(i.wrapper.ownerDocument,"mousemove",P),J(i.wrapper.ownerDocument,"mouseup",W)}function ou(e,t){var n=t.anchor,r=t.head,i=U(e.doc,n.line);if(I(n,r)==0&&n.sticky==r.sticky)return t;var o=ke(i);if(!o)return t;var l=nr(o,n.ch,n.sticky),a=o[l];if(a.from!=n.ch&&a.to!=n.ch)return t;var s=l+(a.from==n.ch==(a.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var d=nr(o,r.ch,r.sticky),p=d-l||(r.ch-n.ch)*(a.level==1?-1:1);d==s-1||d==s?u=p<0:u=p>0}var m=o[s+(u?-1:0)],y=u==(m.level==1),S=y?m.from:m.to,N=y?"after":"before";return n.ch==S&&n.sticky==N?t:new Ae(new k(n.line,S,N),r)}function na(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ft(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!Lt(e,n))return yt(t);o-=a.top-l.viewOffset;for(var s=0;s=i){var d=h(e.doc,o),p=e.display.gutterSpecs[s];return qe(e,n,e,d,p.className,t),yt(t)}}}function oo(e,t){return na(e,t,"gutterClick",!0)}function ia(e,t){Vt(e.display,t)||lu(e,t)||Ge(e,t,"contextmenu")||ee||e.display.input.onContextMenu(t)}function lu(e,t){return Lt(e,"gutterContextMenu")?na(e,t,"gutterContextMenu",!1):!1}function oa(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vn(e)}var tn={toString:function(){return"CodeMirror.Init"}},la={},di={};function au(e){var t=e.optionHandlers;function n(r,i,o,l){e.defaults[r]=i,o&&(t[r]=l?function(a,s,u){u!=tn&&o(a,s,u)}:o)}e.defineOption=n,e.Init=tn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Zi(r)},!0),n("indentUnit",2,Zi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Sn(r),vn(r),bt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],l=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var d=s.text.indexOf(i,u);if(d==-1)break;u=d+i.length,o.push(k(l,d))}l++});for(var a=o.length-1;a>=0;a--)Qr(r.doc,i,o[a],k(o[a].line,o[a].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=tn&&r.refresh()}),n("specialCharPlaceholder",Fa,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",oe?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!ye),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){oa(r),kn(r)},!0),n("keyMap","default",function(r,i,o){var l=fi(i),a=o!=tn&&fi(o);a&&a.detach&&a.detach(r,l),l.attach&&l.attach(r,a||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,uu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Xi(i,r.options.lineNumbers),kn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Ii(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Xr(r)},!0),n("scrollbarStyle","native",function(r){sl(r),Xr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Xi(r.options.gutters,i),kn(r)},!0),n("firstLineNumber",1,kn,!0),n("lineNumberFormatter",function(r){return r},kn,!0),n("showCursorWhenSelecting",!1,gn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Gr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,su),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gn,!0),n("singleCursorHeightPerLine",!0,gn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Sn,!0),n("addModeClass",!1,Sn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Sn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function su(e,t,n){var r=n&&n!=tn;if(!t!=!r){var i=e.display.dragFunctions,o=t?J:ut;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function uu(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(me(e.display.wrapper,"CodeMirror-wrap"),Ti(e)),Fi(e),bt(e),vn(e),setTimeout(function(){return Xr(e)},100)}function Be(e,t){var n=this;if(!(this instanceof Be))return new Be(e,t);this.options=t=t?de(t):{},de(la,t,!1);var r=t.value;typeof r=="string"?r=new xt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Be.inputStyles[t.inputStyle](this),o=this.display=new ks(e,r,i,t);o.wrapper.CodeMirror=this,oa(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),sl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ue,keySeq:null,specialChars:null},t.autofocus&&!oe&&o.input.focus(),M&&j<11&&setTimeout(function(){return n.display.input.reset(!0)},20),fu(this),Rs(),Lr(this),this.curOp.forceUpdate=!0,ml(this,r),t.autofocus&&!oe||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Bi(n)},20):Gr(this);for(var l in di)di.hasOwnProperty(l)&&di[l](this,t[l],tn);cl(this),t.finishInit&&t.finishInit(this);for(var a=0;a20*20}J(t.scroller,"touchstart",function(s){if(!Ge(e,s)&&!o(s)&&!oo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),J(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),J(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Vt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var d=e.coordsChar(t.activeTouch,"page"),p;!u.prev||l(u,u.prev)?p=new Ae(d,d):!u.prev.prev||l(u,u.prev.prev)?p=e.findWordAt(d):p=new Ae(k(d.line,0),fe(e.doc,k(d.line+1,0))),e.setSelection(p.anchor,p.head),e.focus(),ft(s)}i()}),J(t.scroller,"touchcancel",i),J(t.scroller,"scroll",function(){t.scroller.clientHeight&&(mn(e,t.scroller.scrollTop),Cr(e,t.scroller.scrollLeft,!0),qe(e,"scroll",e))}),J(t.scroller,"mousewheel",function(s){return pl(e,s)}),J(t.scroller,"DOMMouseScroll",function(s){return pl(e,s)}),J(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Ge(e,s)||ir(s)},over:function(s){Ge(e,s)||(Bs(e,s),ir(s))},start:function(s){return Hs(e,s)},drop:rt(e,_s),leave:function(s){Ge(e,s)||Kl(e)}};var a=t.input.getField();J(a,"keyup",function(s){return $l.call(e,s)}),J(a,"keydown",rt(e,Vl)),J(a,"keypress",rt(e,ea)),J(a,"focus",function(s){return Bi(e,s)}),J(a,"blur",function(s){return Gr(e,s)})}var lo=[];Be.defineInitHook=function(e){return lo.push(e)};function Fn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=fn(e,t).state:n="prev");var l=e.options.tabSize,a=U(i,t),s=he(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],d;if(!r&&!/\S/.test(a.text))d=0,n="not";else if(n=="smart"&&(d=i.mode.indent(o,a.text.slice(u.length),a.text),d==Ct||d>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?d=he(U(i,t-1).text,null,l):d=0:n=="add"?d=s+e.options.indentUnit:n=="subtract"?d=s-e.options.indentUnit:typeof n=="number"&&(d=s+n),d=Math.max(0,d);var p="",m=0;if(e.options.indentWithTabs)for(var y=Math.floor(d/l);y;--y)m+=l,p+=" ";if(ml,s=Pt(t),u=null;if(a&&r.ranges.length>1)if(Kt&&Kt.text.join(` -`)==t){if(r.ranges.length%Kt.text.length==0){u=[];for(var d=0;d=0;m--){var y=r.ranges[m],S=y.from(),N=y.to();y.empty()&&(n&&n>0?S=k(S.line,S.ch-n):e.state.overwrite&&!a?N=k(N.line,Math.min(U(o,N.line).text.length,N.ch+re(s).length)):a&&Kt&&Kt.lineWise&&Kt.text.join(` -`)==s.join(` -`)&&(S=N=k(S.line,0)));var z={from:S,to:N,text:u?u[m%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Jr(e.doc,z),tt(e,"inputRead",e,z)}t&&!a&&sa(e,t),jr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function aa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Mt(t,function(){return ao(t,n,0,null,"paste")}),!0}function sa(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a-1){l=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(U(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Fn(e,i.head.line,"smart"));l&&tt(e,"electricInput",e,i.head.line)}}}function ua(e){for(var t=[],n=[],r=0;ro&&(Fn(this,a.head.line,r,!0),o=a.head.line,l==this.doc.sel.primIndex&&jr(this));else{var s=a.from(),u=a.to(),d=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var p=d;p0&&$i(this.doc,l,new Ae(s,m[l].to()),st)}}}),getTokenAt:function(r,i){return xo(this,r,i)},getLineTokens:function(r,i){return xo(this,k(r),i,!0)},getTokenTypeAt:function(r){r=fe(this.doc,r);var i=yo(this,U(this.doc,r.line)),o=0,l=(i.length-1)/2,a=r.ch,s;if(a==0)s=i[2];else for(;;){var u=o+l>>1;if((u?i[u*2-1]:0)>=a)l=u;else if(i[u*2+1]s&&(r=s,l=!0),a=U(this.doc,r)}else a=r;return Yn(this,a,{top:0,left:0},i||"page",o||l).top+(l?this.doc.height-Qt(a):0)},defaultTextHeight:function(){return Ur(this.display)},defaultCharWidth:function(){return qr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,l,a){var s=this.display;r=Bt(this,fe(this.doc,r));var u=r.bottom,d=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),l=="over")u=r.top;else if(l=="above"||l=="near"){var p=Math.max(s.wrapper.clientHeight,this.doc.height),m=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(l=="above"||r.bottom+i.offsetHeight>p)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=p&&(u=r.bottom),d+i.offsetWidth>m&&(d=m-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",a=="right"?(d=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(a=="left"?d=0:a=="middle"&&(d=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=d+"px"),o&&ss(this,{left:d,top:u,right:d+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:pt(Vl),triggerOnKeyPress:pt(ea),triggerOnKeyUp:$l,triggerOnMouseDown:pt(ta),execCommand:function(r){if(zn.hasOwnProperty(r))return zn[r].call(null,this)},triggerElectric:pt(function(r){sa(this,r)}),findPosH:function(r,i,o,l){var a=1;i<0&&(a=-1,i=-i);for(var s=fe(this.doc,r),u=0;u0&&d(o.charAt(l-1));)--l;for(;a.5||this.options.lineWrapping)&&Fi(this),qe(this,"refresh",this)}),swapDoc:pt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ml(this,r),vn(this),this.display.input.reset(),yn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,tt(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Et(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,l){e.registerHelper(r,i,l),n[r]._global.push({pred:o,val:l})}}function uo(e,t,n,r,i){var o=t,l=n,a=U(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var W=t.line+s;return W=e.first+e.size?!1:(t=new k(W,t.ch,t.sticky),a=U(e,W))}function d(W){var E;if(r=="codepoint"){var B=a.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(B))E=null;else{var Q=n>0?B>=55296&&B<56320:B>=56320&&B<57343;E=new k(t.line,Math.max(0,Math.min(a.text.length,t.ch+n*(Q?2:1))),-n)}}else i?E=js(e.cm,a,t,n):E=to(a,t,n);if(E==null)if(!W&&u())t=ro(i,e.cm,a,t.line,s);else return!1;else t=E;return!0}if(r=="char"||r=="codepoint")d();else if(r=="column")d(!0);else if(r=="word"||r=="group")for(var p=null,m=r=="group",y=e.cm&&e.cm.getHelper(t,"wordChars"),S=!0;!(n<0&&!d(!S));S=!1){var N=a.text.charAt(t.ch)||` -`,z=ne(N,y)?"w":m&&N==` -`?"n":!m||/\s/.test(N)?null:"p";if(m&&!S&&!z&&(z="s"),p&&p!=z){n<0&&(n=1,d(),t.sticky="after");break}if(z&&(p=z),n>0&&!d(!S))break}var P=ai(e,t,o,l,!0);return De(o,P)&&(P.hitSide=!0),P}function ca(e,t,n,r){var i=e.doc,o=t.left,l;if(r=="page"){var a=Math.min(e.display.wrapper.clientHeight,le(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(a-.5*Ur(e.display),3);l=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var u;u=zi(e,o,l),!!u.outside;){if(n<0?l<=0:l>=i.height){u.hitSide=!0;break}l+=n*5}return u}var Pe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ue,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Pe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,so(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(a){for(var s=a.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}J(i,"paste",function(a){!o(a)||Ge(r,a)||aa(a,r)||j<=11&&setTimeout(rt(r,function(){return t.updateFromDOM()}),20)}),J(i,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),J(i,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),J(i,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),J(i,"touchstart",function(){return n.forceCompositionEnd()}),J(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||Ge(r,a))){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()}),a.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=ua(r);hi({lineWise:!0,text:s.text}),a.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,st),r.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var u=Kt.text.join(` -`);if(a.clipboardData.setData("Text",u),a.clipboardData.getData("Text")==u){a.preventDefault();return}}var d=fa(),p=d.firstChild;so(p),r.display.lineSpace.insertBefore(d,r.display.lineSpace.firstChild),p.value=Kt.text.join(` -`);var m=g(ze(i));$(p),setTimeout(function(){r.display.lineSpace.removeChild(d),m.focus(),m==i&&n.showPrimarySelection()},50)}}J(i,"copy",l),J(i,"cut",l)},Pe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Pe.prototype.prepareSelection=function(){var e=tl(this.cm,!1);return e.focus=g(ze(this.div))==this.div,e},Pe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Pe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Pe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&da(t,r)||{node:a[0].measure.map[2],offset:0},u=i.linee.firstLine()&&(r=k(r.line-1,U(e.doc,r.line-1).length)),i.ch==U(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,l,a;r.line==t.viewFrom||(o=Sr(e,r.line))==0?(l=f(t.view[0].line),a=t.view[0].node):(l=f(t.view[o].line),a=t.view[o-1].node.nextSibling);var s=Sr(e,i.line),u,d;if(s==t.view.length-1?(u=t.viewTo-1,d=t.lineDiv.lastChild):(u=f(t.view[s+1].line)-1,d=t.view[s+1].node.previousSibling),!a)return!1;for(var p=e.doc.splitLines(hu(e,a,d,l,u)),m=Zt(e.doc,k(l,0),k(u,U(e.doc,u).text.length));p.length>1&&m.length>1;)if(re(p)==re(m))p.pop(),m.pop(),u--;else if(p[0]==m[0])p.shift(),m.shift(),l++;else break;for(var y=0,S=0,N=p[0],z=m[0],P=Math.min(N.length,z.length);yr.ch&&W.charCodeAt(W.length-S-1)==E.charCodeAt(E.length-S-1);)y--,S++;p[p.length-1]=W.slice(0,W.length-S).replace(/^\u200b+/,""),p[0]=p[0].slice(y).replace(/\u200b+$/,"");var Q=k(l,y),Z=k(u,m.length?re(m).length-S:0);if(p.length>1||p[0]||I(Q,Z))return Qr(e.doc,p,Q,Z,"+input"),!0},Pe.prototype.ensurePolled=function(){this.forceCompositionEnd()},Pe.prototype.reset=function(){this.forceCompositionEnd()},Pe.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Pe.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},Pe.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Mt(this.cm,function(){return bt(e.cm)})},Pe.prototype.setUneditable=function(e){e.contentEditable="false"},Pe.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||rt(this.cm,ao)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Pe.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Pe.prototype.onContextMenu=function(){},Pe.prototype.resetPosition=function(){},Pe.prototype.needsContentAttribute=!0;function da(e,t){var n=Di(e,t.line);if(!n||n.hidden)return null;var r=U(e.doc,t.line),i=Ro(n,r,t.line),o=ke(r,e.doc.direction),l="left";if(o){var a=nr(o,t.ch);l=a%2?"right":"left"}var s=qo(i.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function du(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function rn(e,t){return t&&(e.bad=!0),e}function hu(e,t,n,r,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(y){return function(S){return S.id==y}}function d(){l&&(o+=a,s&&(o+=a),l=s=!1)}function p(y){y&&(d(),o+=y)}function m(y){if(y.nodeType==1){var S=y.getAttribute("cm-text");if(S){p(S);return}var N=y.getAttribute("cm-marker"),z;if(N){var P=e.findMarks(k(r,0),k(i+1,0),u(+N));P.length&&(z=P[0].find(0))&&p(Zt(e.doc,z.from,z.to).join(a));return}if(y.getAttribute("contenteditable")=="false")return;var W=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;W&&d();for(var E=0;E=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),J(i,"paste",function(l){Ge(r,l)||aa(l,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(l){if(!Ge(r,l)){if(r.somethingSelected())hi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var a=ua(r);hi({lineWise:!0,text:a.text}),l.type=="cut"?r.setSelections(a.ranges,null,st):(n.prevInput="",i.value=a.text.join(` -`),$(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}J(i,"cut",o),J(i,"copy",o),J(e.scroller,"paste",function(l){if(!(Vt(e,l)||Ge(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),J(e.lineSpace,"selectstart",function(l){Vt(e,l)||ft(l)}),J(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),J(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ye.prototype.createField=function(e){this.wrapper=fa(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ye.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ye.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=tl(e);if(e.options.moveInputWithCursor){var i=Bt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},Ye.prototype.showSelection=function(e){var t=this.cm,n=t.display;H(n.cursorDiv,e.cursors),H(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ye.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&$(this.textarea),M&&j>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",M&&j>=9&&(this.hasSelection=null));this.resetting=!1}},Ye.prototype.getField=function(){return this.textarea},Ye.prototype.supportsTouch=function(){return!1},Ye.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!oe||g(ze(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ye.prototype.blur=function(){this.textarea.blur()},Ye.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ye.prototype.receivedFocus=function(){this.slowPoll()},Ye.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ye.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Ye.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||lr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(M&&j>=9&&this.hasSelection===i||xe&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="​"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(r.length,i.length);l1e3||i.indexOf(` -`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ye.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ye.prototype.onKeyPress=function(){M&&j>=9&&(this.hasSelection=null),this.fastPoll()},Ye.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=kr(n,e),l=r.scroller.scrollTop;if(!o||ce)return;var a=n.options.resetSelectionOnContextMenu;a&&n.doc.sel.contains(o)==-1&&rt(n,ct)(n.doc,cr(o),st);var s=i.style.cssText,u=t.wrapper.style.cssText,d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; - top: `+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+`px; - z-index: 1000; background: `+(M?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var p;_&&(p=i.ownerDocument.defaultView.scrollY),r.input.focus(),_&&i.ownerDocument.defaultView.scrollTo(null,p),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function m(){if(i.selectionStart!=null){var N=n.somethingSelected(),z="​"+(N?i.value:"");i.value="⇚",i.value=z,t.prevInput=N?"":"​",i.selectionStart=1,i.selectionEnd=z.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,M&&j<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!M||M&&j<9)&&m();var N=0,z=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?rt(n,Ol)(n):N++<10?r.detectingSelectAll=setTimeout(z,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(z,200)}}if(M&&j>=9&&m(),ee){ir(e);var S=function(){ut(window,"mouseup",S),setTimeout(y,20)};J(window,"mouseup",S)}else setTimeout(y,50)},Ye.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ye.prototype.setUneditable=function(){},Ye.prototype.needsContentAttribute=!1;function vu(e,t){if(t=t?de(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=g(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=a.getValue()}var i;if(e.form&&(J(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ut(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=Be(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function gu(e){e.off=ut,e.on=J,e.wheelEventPixels=Ss,e.Doc=xt,e.splitLines=Pt,e.countColumn=he,e.findColumn=Ke,e.isWordChar=R,e.Pass=Ct,e.signal=qe,e.Line=Br,e.changeEnd=dr,e.scrollbarModel=al,e.Pos=k,e.cmpPos=I,e.modes=Er,e.mimeModes=Wt,e.resolveMode=Ir,e.getMode=Fr,e.modeExtensions=ar,e.extendMode=Wr,e.copyState=Ut,e.startState=_r,e.innerMode=sn,e.commands=zn,e.keyMap=er,e.keyName=Xl,e.isModifierKey=Gl,e.lookupKey=$r,e.normalizeKeyMap=Gs,e.StringStream=je,e.SharedTextMarker=Dn,e.TextMarker=pr,e.LineWidget=Nn,e.e_preventDefault=ft,e.e_stopPropagation=zr,e.e_stop=ir,e.addClass=D,e.contains=v,e.rmClass=me,e.keyNames=vr}au(Be),cu(Be);var yu="iter insert remove copy getEditor constructor".split(" ");for(var vi in xt.prototype)xt.prototype.hasOwnProperty(vi)&&q(yu,vi)<0&&(Be.prototype[vi]=function(e){return function(){return e.apply(this.doc,arguments)}}(xt.prototype[vi]));return Et(xt),Be.inputStyles={textarea:Ye,contenteditable:Pe},Be.defineMode=function(e){!Be.defaults.mode&&e!="null"&&(Be.defaults.mode=e),_t.apply(this,arguments)},Be.defineMIME=br,Be.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Be.defineMIME("text/plain","null"),Be.defineExtension=function(e,t){Be.prototype[e]=t},Be.defineDocExtension=function(e,t){xt.prototype[e]=t},Be.fromTextArea=vu,gu(Be),Be.version="5.65.15",Be})}(ho)),ho.exports}var xu=Ar();const Tu=bu(xu);var wu={exports:{}};(function(yr,Or){(function(F){F(Ar())})(function(F){F.defineMode("css",function(ee,X){var me=X.inline;X.propertyKeywords||(X=F.resolveMode("text/css"));var T=ee.indentUnit,H=X.tokenHooks,c=X.documentTypes||{},x=X.mediaTypes||{},b=X.mediaFeatures||{},v=X.mediaValueKeywords||{},g=X.propertyKeywords||{},D=X.nonStandardPropertyKeywords||{},K=X.fontProperties||{},$=X.counterDescriptors||{},pe=X.colorKeywords||{},Re=X.valueKeywords||{},ze=X.allowNested,le=X.lineComment,te=X.supportsAtComponent===!0,de=ee.highlightNonStandardPropertyKeywords!==!1,he,ue;function q(w,A){return he=A,w}function Ve(w,A){var C=w.next();if(H[C]){var be=H[C](w,A);if(be!==!1)return be}if(C=="@")return w.eatWhile(/[\w\\\-]/),q("def",w.current());if(C=="="||(C=="~"||C=="|")&&w.eat("="))return q(null,"compare");if(C=='"'||C=="'")return A.tokenize=Ct(C),A.tokenize(w,A);if(C=="#")return w.eatWhile(/[\w\\\-]/),q("atom","hash");if(C=="!")return w.match(/^\s*\w*/),q("keyword","important");if(/\d/.test(C)||C=="."&&w.eat(/\d/))return w.eatWhile(/[\w.%]/),q("number","unit");if(C==="-"){if(/[\d.]/.test(w.peek()))return w.eatWhile(/[\w.%]/),q("number","unit");if(w.match(/^-[\w\\\-]*/))return w.eatWhile(/[\w\\\-]/),w.match(/^\s*:/,!1)?q("variable-2","variable-definition"):q("variable-2","variable");if(w.match(/^\w+-/))return q("meta","meta")}else return/[,+>*\/]/.test(C)?q(null,"select-op"):C=="."&&w.match(/^-?[_a-z][_a-z0-9-]*/i)?q("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(C)?q(null,C):w.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(w.current())&&(A.tokenize=st),q("variable callee","variable")):/[\w\\\-]/.test(C)?(w.eatWhile(/[\w\\\-]/),q("property","word")):q(null,null)}function Ct(w){return function(A,C){for(var be=!1,R;(R=A.next())!=null;){if(R==w&&!be){w==")"&&A.backUp(1);break}be=!be&&R=="\\"}return(R==w||!be&&w!=")")&&(C.tokenize=null),q("string","string")}}function st(w,A){return w.next(),w.match(/^\s*[\"\')]/,!1)?A.tokenize=null:A.tokenize=Ct(")"),q(null,"(")}function gt(w,A,C){this.type=w,this.indent=A,this.prev=C}function Le(w,A,C,be){return w.context=new gt(C,A.indentation()+(be===!1?0:T),w.context),C}function Ke(w){return w.context.prev&&(w.context=w.context.prev),w.context.type}function lt(w,A,C){return Ne[C.context.type](w,A,C)}function ht(w,A,C,be){for(var R=be||1;R>0;R--)C.context=C.context.prev;return lt(w,A,C)}function re(w){var A=w.current().toLowerCase();Re.hasOwnProperty(A)?ue="atom":pe.hasOwnProperty(A)?ue="keyword":ue="variable"}var Ne={};return Ne.top=function(w,A,C){if(w=="{")return Le(C,A,"block");if(w=="}"&&C.context.prev)return Ke(C);if(te&&/@component/i.test(w))return Le(C,A,"atComponentBlock");if(/^@(-moz-)?document$/i.test(w))return Le(C,A,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(w))return Le(C,A,"atBlock");if(/^@(font-face|counter-style)/i.test(w))return C.stateArg=w,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(w))return"keyframes";if(w&&w.charAt(0)=="@")return Le(C,A,"at");if(w=="hash")ue="builtin";else if(w=="word")ue="tag";else{if(w=="variable-definition")return"maybeprop";if(w=="interpolation")return Le(C,A,"interpolation");if(w==":")return"pseudo";if(ze&&w=="(")return Le(C,A,"parens")}return C.context.type},Ne.block=function(w,A,C){if(w=="word"){var be=A.current().toLowerCase();return g.hasOwnProperty(be)?(ue="property","maybeprop"):D.hasOwnProperty(be)?(ue=de?"string-2":"property","maybeprop"):ze?(ue=A.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(ue+=" error","maybeprop")}else return w=="meta"?"block":!ze&&(w=="hash"||w=="qualifier")?(ue="error","block"):Ne.top(w,A,C)},Ne.maybeprop=function(w,A,C){return w==":"?Le(C,A,"prop"):lt(w,A,C)},Ne.prop=function(w,A,C){if(w==";")return Ke(C);if(w=="{"&&ze)return Le(C,A,"propBlock");if(w=="}"||w=="{")return ht(w,A,C);if(w=="(")return Le(C,A,"parens");if(w=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(A.current()))ue+=" error";else if(w=="word")re(A);else if(w=="interpolation")return Le(C,A,"interpolation");return"prop"},Ne.propBlock=function(w,A,C){return w=="}"?Ke(C):w=="word"?(ue="property","maybeprop"):C.context.type},Ne.parens=function(w,A,C){return w=="{"||w=="}"?ht(w,A,C):w==")"?Ke(C):w=="("?Le(C,A,"parens"):w=="interpolation"?Le(C,A,"interpolation"):(w=="word"&&re(A),"parens")},Ne.pseudo=function(w,A,C){return w=="meta"?"pseudo":w=="word"?(ue="variable-3",C.context.type):lt(w,A,C)},Ne.documentTypes=function(w,A,C){return w=="word"&&c.hasOwnProperty(A.current())?(ue="tag",C.context.type):Ne.atBlock(w,A,C)},Ne.atBlock=function(w,A,C){if(w=="(")return Le(C,A,"atBlock_parens");if(w=="}"||w==";")return ht(w,A,C);if(w=="{")return Ke(C)&&Le(C,A,ze?"block":"top");if(w=="interpolation")return Le(C,A,"interpolation");if(w=="word"){var be=A.current().toLowerCase();be=="only"||be=="not"||be=="and"||be=="or"?ue="keyword":x.hasOwnProperty(be)?ue="attribute":b.hasOwnProperty(be)?ue="property":v.hasOwnProperty(be)?ue="keyword":g.hasOwnProperty(be)?ue="property":D.hasOwnProperty(be)?ue=de?"string-2":"property":Re.hasOwnProperty(be)?ue="atom":pe.hasOwnProperty(be)?ue="keyword":ue="error"}return C.context.type},Ne.atComponentBlock=function(w,A,C){return w=="}"?ht(w,A,C):w=="{"?Ke(C)&&Le(C,A,ze?"block":"top",!1):(w=="word"&&(ue="error"),C.context.type)},Ne.atBlock_parens=function(w,A,C){return w==")"?Ke(C):w=="{"||w=="}"?ht(w,A,C,2):Ne.atBlock(w,A,C)},Ne.restricted_atBlock_before=function(w,A,C){return w=="{"?Le(C,A,"restricted_atBlock"):w=="word"&&C.stateArg=="@counter-style"?(ue="variable","restricted_atBlock_before"):lt(w,A,C)},Ne.restricted_atBlock=function(w,A,C){return w=="}"?(C.stateArg=null,Ke(C)):w=="word"?(C.stateArg=="@font-face"&&!K.hasOwnProperty(A.current().toLowerCase())||C.stateArg=="@counter-style"&&!$.hasOwnProperty(A.current().toLowerCase())?ue="error":ue="property","maybeprop"):"restricted_atBlock"},Ne.keyframes=function(w,A,C){return w=="word"?(ue="variable","keyframes"):w=="{"?Le(C,A,"top"):lt(w,A,C)},Ne.at=function(w,A,C){return w==";"?Ke(C):w=="{"||w=="}"?ht(w,A,C):(w=="word"?ue="tag":w=="hash"&&(ue="builtin"),"at")},Ne.interpolation=function(w,A,C){return w=="}"?Ke(C):w=="{"||w==";"?ht(w,A,C):(w=="word"?ue="variable":w!="variable"&&w!="("&&w!=")"&&(ue="error"),"interpolation")},{startState:function(w){return{tokenize:null,state:me?"block":"top",stateArg:null,context:new gt(me?"block":"top",w||0,null)}},token:function(w,A){if(!A.tokenize&&w.eatSpace())return null;var C=(A.tokenize||Ve)(w,A);return C&&typeof C=="object"&&(he=C[1],C=C[0]),ue=C,he!="comment"&&(A.state=Ne[A.state](he,w,A)),ue},indent:function(w,A){var C=w.context,be=A&&A.charAt(0),R=C.indent;return C.type=="prop"&&(be=="}"||be==")")&&(C=C.prev),C.prev&&(be=="}"&&(C.type=="block"||C.type=="top"||C.type=="interpolation"||C.type=="restricted_atBlock")?(C=C.prev,R=C.indent):(be==")"&&(C.type=="parens"||C.type=="atBlock_parens")||be=="{"&&(C.type=="at"||C.type=="atBlock"))&&(R=Math.max(0,C.indent-T))),R},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:le,fold:"brace"}});function Ee(ee){for(var X={},me=0;me")):null:c.match("--")?b(Te("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),b(Oe(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),x.tokenize=Te("meta","?>"),"meta"):(ie=c.eat("/")?"closeTag":"openTag",x.tokenize=ce,"tag bracket");if(v=="&"){var g;return c.eat("#")?c.eat("x")?g=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):g=c.eatWhile(/[\d]/)&&c.eat(";"):g=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),g?"atom":"error"}else return c.eatWhile(/[^&<]/),null}se.isInText=!0;function ce(c,x){var b=c.next();if(b==">"||b=="/"&&c.eat(">"))return x.tokenize=se,ie=b==">"?"endTag":"selfcloseTag","tag bracket";if(b=="=")return ie="equals",null;if(b=="<"){x.tokenize=se,x.state=_e,x.tagName=x.tagStart=null;var v=x.tokenize(c,x);return v?v+" tag error":"tag error"}else return/[\'\"]/.test(b)?(x.tokenize=Ie(b),x.stringStartCol=c.column(),x.tokenize(c,x)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Ie(c){var x=function(b,v){for(;!b.eol();)if(b.next()==c){v.tokenize=ce;break}return"string"};return x.isInAttribute=!0,x}function Te(c,x){return function(b,v){for(;!b.eol();){if(b.match(x)){v.tokenize=se;break}b.next()}return c}}function Oe(c){return function(x,b){for(var v;(v=x.next())!=null;){if(v=="<")return b.tokenize=Oe(c+1),b.tokenize(x,b);if(v==">")if(c==1){b.tokenize=se;break}else return b.tokenize=Oe(c-1),b.tokenize(x,b)}return"meta"}}function ae(c){return c&&c.toLowerCase()}function V(c,x,b){this.prev=c.context,this.tagName=x||"",this.indent=c.indented,this.startOfLine=b,(M.doNotIndent.hasOwnProperty(x)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function oe(c){c.context&&(c.context=c.context.prev)}function xe(c,x){for(var b;;){if(!c.context||(b=c.context.tagName,!M.contextGrabbers.hasOwnProperty(ae(b))||!M.contextGrabbers[ae(b)].hasOwnProperty(ae(x))))return;oe(c)}}function _e(c,x,b){return c=="openTag"?(b.tagStart=x.column(),ye):c=="closeTag"?Me:_e}function ye(c,x,b){return c=="word"?(b.tagName=x.current(),G="tag",X):M.allowMissingTagName&&c=="endTag"?(G="tag bracket",X(c,x,b)):(G="error",ye)}function Me(c,x,b){if(c=="word"){var v=x.current();return b.context&&b.context.tagName!=v&&M.implicitlyClosed.hasOwnProperty(ae(b.context.tagName))&&oe(b),b.context&&b.context.tagName==v||M.matchClosing===!1?(G="tag",He):(G="tag error",ee)}else return M.allowMissingTagName&&c=="endTag"?(G="tag bracket",He(c,x,b)):(G="error",ee)}function He(c,x,b){return c!="endTag"?(G="error",He):(oe(b),_e)}function ee(c,x,b){return G="error",He(c,x,b)}function X(c,x,b){if(c=="word")return G="attribute",me;if(c=="endTag"||c=="selfcloseTag"){var v=b.tagName,g=b.tagStart;return b.tagName=b.tagStart=null,c=="selfcloseTag"||M.autoSelfClosers.hasOwnProperty(ae(v))?xe(b,v):(xe(b,v),b.context=new V(b,v,g==b.indented)),_e}return G="error",X}function me(c,x,b){return c=="equals"?T:(M.allowMissing||(G="error"),X(c,x,b))}function T(c,x,b){return c=="string"?H:c=="word"&&M.allowUnquoted?(G="string",X):(G="error",X(c,x,b))}function H(c,x,b){return c=="string"?H:X(c,x,b)}return{startState:function(c){var x={tokenize:se,state:_e,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(x.baseIndent=c),x},token:function(c,x){if(!x.tagName&&c.sol()&&(x.indented=c.indentation()),c.eatSpace())return null;ie=null;var b=x.tokenize(c,x);return(b||ie)&&b!="comment"&&(G=null,x.state=x.state(ie||b,c,x),G&&(b=G=="error"?b+" error":G)),b},indent:function(c,x,b){var v=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+Ce;if(v&&v.noIndent)return F.Pass;if(c.tokenize!=ce&&c.tokenize!=se)return b?b.match(/^(\s*)/)[0].length:0;if(c.tagName)return M.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+Ce*(M.multilineTagIndentFactor||1);if(M.alignCDATA&&/$/,blockCommentStart:"",configuration:M.htmlMode?"html":"xml",helperType:M.htmlMode?"html":"xml",skipAttribute:function(c){c.state==T&&(c.state=X)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var x=[],b=c.context;b;b=b.prev)x.push(b.tagName);return x.reverse()}}}),F.defineMIME("text/xml","xml"),F.defineMIME("application/xml","xml"),F.mimeModes.hasOwnProperty("text/html")||F.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),pa.exports}var ga={exports:{}},ya;function ma(){return ya||(ya=1,function(yr,Or){(function(F){F(Ar())})(function(F){F.defineMode("javascript",function(Ee,Se){var We=Ee.indentUnit,Qe=Se.statementIndent,Ce=Se.jsonld,M=Se.json||Ce,j=Se.trackScope!==!1,_=Se.typescript,ie=Se.wordCharacters||/[\w$\xa1-\uffff]/,G=function(){function f(et){return{type:et,style:"keyword"}}var h=f("keyword a"),L=f("keyword b"),O=f("keyword c"),k=f("keyword d"),I=f("operator"),De={type:"atom",style:"atom"};return{if:f("if"),while:h,with:h,else:L,do:L,try:L,finally:L,return:k,break:k,continue:k,new:f("new"),delete:O,void:O,throw:O,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:I,typeof:I,instanceof:I,true:De,false:De,null:De,undefined:De,NaN:De,Infinity:De,this:f("this"),class:f("class"),super:f("atom"),yield:O,export:f("export"),import:f("import"),extends:O,await:O}}(),se=/[+\-*&%=<>!?|~^@]/,ce=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function Ie(f){for(var h=!1,L,O=!1;(L=f.next())!=null;){if(!h){if(L=="/"&&!O)return;L=="["?O=!0:O&&L=="]"&&(O=!1)}h=!h&&L=="\\"}}var Te,Oe;function ae(f,h,L){return Te=f,Oe=L,h}function V(f,h){var L=f.next();if(L=='"'||L=="'")return h.tokenize=oe(L),h.tokenize(f,h);if(L=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return ae("number","number");if(L=="."&&f.match(".."))return ae("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(L))return ae(L);if(L=="="&&f.eat(">"))return ae("=>","operator");if(L=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return ae("number","number");if(/\d/.test(L))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),ae("number","number");if(L=="/")return f.eat("*")?(h.tokenize=xe,xe(f,h)):f.eat("/")?(f.skipToEnd(),ae("comment","comment")):Dt(f,h,1)?(Ie(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),ae("regexp","string-2")):(f.eat("="),ae("operator","operator",f.current()));if(L=="`")return h.tokenize=_e,_e(f,h);if(L=="#"&&f.peek()=="!")return f.skipToEnd(),ae("meta","meta");if(L=="#"&&f.eatWhile(ie))return ae("variable","property");if(L=="<"&&f.match("!--")||L=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),ae("comment","comment");if(se.test(L))return(L!=">"||!h.lexical||h.lexical.type!=">")&&(f.eat("=")?(L=="!"||L=="=")&&f.eat("="):/[<>*+\-|&?]/.test(L)&&(f.eat(L),L==">"&&f.eat(L))),L=="?"&&f.eat(".")?ae("."):ae("operator","operator",f.current());if(ie.test(L)){f.eatWhile(ie);var O=f.current();if(h.lastType!="."){if(G.propertyIsEnumerable(O)){var k=G[O];return ae(k.type,k.style,O)}if(O=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return ae("async","keyword",O)}return ae("variable","variable",O)}}function oe(f){return function(h,L){var O=!1,k;if(Ce&&h.peek()=="@"&&h.match(ce))return L.tokenize=V,ae("jsonld-keyword","meta");for(;(k=h.next())!=null&&!(k==f&&!O);)O=!O&&k=="\\";return O||(L.tokenize=V),ae("string","string")}}function xe(f,h){for(var L=!1,O;O=f.next();){if(O=="/"&&L){h.tokenize=V;break}L=O=="*"}return ae("comment","comment")}function _e(f,h){for(var L=!1,O;(O=f.next())!=null;){if(!L&&(O=="`"||O=="$"&&f.eat("{"))){h.tokenize=V;break}L=!L&&O=="\\"}return ae("quasi","string-2",f.current())}var ye="([{}])";function Me(f,h){h.fatArrowAt&&(h.fatArrowAt=null);var L=f.string.indexOf("=>",f.start);if(!(L<0)){if(_){var O=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,L));O&&(L=O.index)}for(var k=0,I=!1,De=L-1;De>=0;--De){var et=f.string.charAt(De),mt=ye.indexOf(et);if(mt>=0&&mt<3){if(!k){++De;break}if(--k==0){et=="("&&(I=!0);break}}else if(mt>=3&&mt<6)++k;else if(ie.test(et))I=!0;else if(/["'\/`]/.test(et))for(;;--De){if(De==0)return;var Hr=f.string.charAt(De-1);if(Hr==et&&f.string.charAt(De-2)!="\\"){De--;break}}else if(I&&!k){++De;break}}I&&!k&&(h.fatArrowAt=De)}}var He={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ee(f,h,L,O,k,I){this.indented=f,this.column=h,this.type=L,this.prev=k,this.info=I,O!=null&&(this.align=O)}function X(f,h){if(!j)return!1;for(var L=f.localVars;L;L=L.next)if(L.name==h)return!0;for(var O=f.context;O;O=O.prev)for(var L=O.vars;L;L=L.next)if(L.name==h)return!0}function me(f,h,L,O,k){var I=f.cc;for(T.state=f,T.stream=k,T.marked=null,T.cc=I,T.style=h,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var De=I.length?I.pop():M?q:he;if(De(L,O)){for(;I.length&&I[I.length-1].lex;)I.pop()();return T.marked?T.marked:L=="variable"&&X(f,O)?"variable-2":h}}}var T={state:null,column:null,marked:null,cc:null};function H(){for(var f=arguments.length-1;f>=0;f--)T.cc.push(arguments[f])}function c(){return H.apply(null,arguments),!0}function x(f,h){for(var L=h;L;L=L.next)if(L.name==f)return!0;return!1}function b(f){var h=T.state;if(T.marked="def",!!j){if(h.context){if(h.lexical.info=="var"&&h.context&&h.context.block){var L=v(f,h.context);if(L!=null){h.context=L;return}}else if(!x(f,h.localVars)){h.localVars=new K(f,h.localVars);return}}Se.globalVars&&!x(f,h.globalVars)&&(h.globalVars=new K(f,h.globalVars))}}function v(f,h){if(h)if(h.block){var L=v(f,h.prev);return L?L==h.prev?h:new D(L,h.vars,!0):null}else return x(f,h.vars)?h:new D(h.prev,new K(f,h.vars),!1);else return null}function g(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function D(f,h,L){this.prev=f,this.vars=h,this.block=L}function K(f,h){this.name=f,this.next=h}var $=new K("this",new K("arguments",null));function pe(){T.state.context=new D(T.state.context,T.state.localVars,!1),T.state.localVars=$}function Re(){T.state.context=new D(T.state.context,T.state.localVars,!0),T.state.localVars=null}pe.lex=Re.lex=!0;function ze(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}ze.lex=!0;function le(f,h){var L=function(){var O=T.state,k=O.indented;if(O.lexical.type=="stat")k=O.lexical.indented;else for(var I=O.lexical;I&&I.type==")"&&I.align;I=I.prev)k=I.indented;O.lexical=new ee(k,T.stream.column(),f,null,O.lexical,h)};return L.lex=!0,L}function te(){var f=T.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}te.lex=!0;function de(f){function h(L){return L==f?c():f==";"||L=="}"||L==")"||L=="]"?H():c(h)}return h}function he(f,h){return f=="var"?c(le("vardef",h),zr,de(";"),te):f=="keyword a"?c(le("form"),Ct,he,te):f=="keyword b"?c(le("form"),he,te):f=="keyword d"?T.stream.match(/^\s*$/,!1)?c():c(le("stat"),gt,de(";"),te):f=="debugger"?c(de(";")):f=="{"?c(le("}"),Re,Ot,te,ze):f==";"?c():f=="if"?(T.state.lexical.info=="else"&&T.state.cc[T.state.cc.length-1]==te&&T.state.cc.pop()(),c(le("form"),Ct,he,te,Pr)):f=="function"?c(Pt):f=="for"?c(le("form"),Re,_n,he,ze,te):f=="class"||_&&h=="interface"?(T.marked="keyword",c(le("form",f=="class"?f:h),Er,te)):f=="variable"?_&&h=="declare"?(T.marked="keyword",c(he)):_&&(h=="module"||h=="enum"||h=="type")&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword",h=="enum"?c(U):h=="type"?c(Hn,de("operator"),ke,de(";")):c(le("form"),yt,de("{"),le("}"),Ot,te,te)):_&&h=="namespace"?(T.marked="keyword",c(le("form"),q,he,te)):_&&h=="abstract"?(T.marked="keyword",c(he)):c(le("stat"),be):f=="switch"?c(le("form"),Ct,de("{"),le("}","switch"),Re,Ot,te,te,ze):f=="case"?c(q,de(":")):f=="default"?c(de(":")):f=="catch"?c(le("form"),pe,ue,he,te,ze):f=="export"?c(le("stat"),Ir,te):f=="import"?c(le("stat"),ar,te):f=="async"?c(he):h=="@"?c(q,he):H(le("stat"),q,de(";"),te)}function ue(f){if(f=="(")return c(Ft,de(")"))}function q(f,h){return st(f,h,!1)}function Ve(f,h){return st(f,h,!0)}function Ct(f){return f!="("?H():c(le(")"),gt,de(")"),te)}function st(f,h,L){if(T.state.fatArrowAt==T.stream.start){var O=L?Ne:re;if(f=="(")return c(pe,le(")"),ve(Ft,")"),te,de("=>"),O,ze);if(f=="variable")return H(pe,yt,de("=>"),O,ze)}var k=L?Ke:Le;return He.hasOwnProperty(f)?c(k):f=="function"?c(Pt,k):f=="class"||_&&h=="interface"?(T.marked="keyword",c(le("form"),mi,te)):f=="keyword c"||f=="async"?c(L?Ve:q):f=="("?c(le(")"),gt,de(")"),te,k):f=="operator"||f=="spread"?c(L?Ve:q):f=="["?c(le("]"),je,te,k):f=="{"?Tt(ne,"}",null,k):f=="quasi"?H(lt,k):f=="new"?c(w(L)):c()}function gt(f){return f.match(/[;\}\)\],]/)?H():H(q)}function Le(f,h){return f==","?c(gt):Ke(f,h,!1)}function Ke(f,h,L){var O=L==!1?Le:Ke,k=L==!1?q:Ve;if(f=="=>")return c(pe,L?Ne:re,ze);if(f=="operator")return/\+\+|--/.test(h)||_&&h=="!"?c(O):_&&h=="<"&&T.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(le(">"),ve(ke,">"),te,O):h=="?"?c(q,de(":"),k):c(k);if(f=="quasi")return H(lt,O);if(f!=";"){if(f=="(")return Tt(Ve,")","call",O);if(f==".")return c(R,O);if(f=="[")return c(le("]"),gt,de("]"),te,O);if(_&&h=="as")return T.marked="keyword",c(ke,O);if(f=="regexp")return T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),c(k)}}function lt(f,h){return f!="quasi"?H():h.slice(h.length-2)!="${"?c(lt):c(gt,ht)}function ht(f){if(f=="}")return T.marked="string-2",T.state.tokenize=_e,c(lt)}function re(f){return Me(T.stream,T.state),H(f=="{"?he:q)}function Ne(f){return Me(T.stream,T.state),H(f=="{"?he:Ve)}function w(f){return function(h){return h=="."?c(f?C:A):h=="variable"&&_?c(Lt,f?Ke:Le):H(f?Ve:q)}}function A(f,h){if(h=="target")return T.marked="keyword",c(Le)}function C(f,h){if(h=="target")return T.marked="keyword",c(Ke)}function be(f){return f==":"?c(te,he):H(Le,de(";"),te)}function R(f){if(f=="variable")return T.marked="property",c()}function ne(f,h){if(f=="async")return T.marked="property",c(ne);if(f=="variable"||T.style=="keyword"){if(T.marked="property",h=="get"||h=="set")return c(Y);var L;return _&&T.state.fatArrowAt==T.stream.start&&(L=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+L[0].length),c(we)}else{if(f=="number"||f=="string")return T.marked=Ce?"property":T.style+" property",c(we);if(f=="jsonld-keyword")return c(we);if(_&&g(h))return T.marked="keyword",c(ne);if(f=="[")return c(q,rr,de("]"),we);if(f=="spread")return c(Ve,we);if(h=="*")return T.marked="keyword",c(ne);if(f==":")return H(we)}}function Y(f){return f!="variable"?H(we):(T.marked="property",c(Pt))}function we(f){if(f==":")return c(Ve);if(f=="(")return H(Pt)}function ve(f,h,L){function O(k,I){if(L?L.indexOf(k)>-1:k==","){var De=T.state.lexical;return De.info=="call"&&(De.pos=(De.pos||0)+1),c(function(et,mt){return et==h||mt==h?H():H(f)},O)}return k==h||I==h?c():L&&L.indexOf(";")>-1?H(f):c(de(h))}return function(k,I){return k==h||I==h?c():H(f,O)}}function Tt(f,h,L){for(var O=3;O"),ke);if(f=="quasi")return H(ut,zt)}function Wn(f){if(f=="=>")return c(ke)}function J(f){return f.match(/[\}\)\]]/)?c():f==","||f==";"?c(J):H(Yt,J)}function Yt(f,h){if(f=="variable"||T.style=="keyword")return T.marked="property",c(Yt);if(h=="?"||f=="number"||f=="string")return c(Yt);if(f==":")return c(ke);if(f=="[")return c(de("variable"),mr,de("]"),Yt);if(f=="(")return H(lr,Yt);if(!f.match(/[;\}\)\],]/))return c()}function ut(f,h){return f!="quasi"?H():h.slice(h.length-2)!="${"?c(ut):c(ke,qe)}function qe(f){if(f=="}")return T.marked="string-2",T.state.tokenize=_e,c(ut)}function Ge(f,h){return f=="variable"&&T.stream.match(/^\s*[?:]/,!1)||h=="?"?c(Ge):f==":"?c(ke):f=="spread"?c(Ge):H(ke)}function zt(f,h){if(h=="<")return c(le(">"),ve(ke,">"),te,zt);if(h=="|"||f=="."||h=="&")return c(ke);if(f=="[")return c(ke,de("]"),zt);if(h=="extends"||h=="implements")return T.marked="keyword",c(ke);if(h=="?")return c(ke,de(":"),ke)}function Lt(f,h){if(h=="<")return c(le(">"),ve(ke,">"),te,zt)}function Et(){return H(ke,ft)}function ft(f,h){if(h=="=")return c(ke)}function zr(f,h){return h=="enum"?(T.marked="keyword",c(U)):H(yt,rr,It,yi)}function yt(f,h){if(_&&g(h))return T.marked="keyword",c(yt);if(f=="variable")return b(h),c();if(f=="spread")return c(yt);if(f=="[")return Tt(ln,"]");if(f=="{")return Tt(ir,"}")}function ir(f,h){return f=="variable"&&!T.stream.match(/^\s*:/,!1)?(b(h),c(It)):(f=="variable"&&(T.marked="property"),f=="spread"?c(yt):f=="}"?H():f=="["?c(q,de("]"),de(":"),ir):c(de(":"),yt,It))}function ln(){return H(yt,It)}function It(f,h){if(h=="=")return c(Ve)}function yi(f){if(f==",")return c(zr)}function Pr(f,h){if(f=="keyword b"&&h=="else")return c(le("form","else"),he,te)}function _n(f,h){if(h=="await")return c(_n);if(f=="(")return c(le(")"),an,te)}function an(f){return f=="var"?c(zr,or):f=="variable"?c(or):H(or)}function or(f,h){return f==")"?c():f==";"?c(or):h=="in"||h=="of"?(T.marked="keyword",c(q,or)):H(q,or)}function Pt(f,h){if(h=="*")return T.marked="keyword",c(Pt);if(f=="variable")return b(h),c(Pt);if(f=="(")return c(pe,le(")"),ve(Ft,")"),te,nr,he,ze);if(_&&h=="<")return c(le(">"),ve(Et,">"),te,Pt)}function lr(f,h){if(h=="*")return T.marked="keyword",c(lr);if(f=="variable")return b(h),c(lr);if(f=="(")return c(pe,le(")"),ve(Ft,")"),te,nr,ze);if(_&&h=="<")return c(le(">"),ve(Et,">"),te,lr)}function Hn(f,h){if(f=="keyword"||f=="variable")return T.marked="type",c(Hn);if(h=="<")return c(le(">"),ve(Et,">"),te)}function Ft(f,h){return h=="@"&&c(q,Ft),f=="spread"?c(Ft):_&&g(h)?(T.marked="keyword",c(Ft)):_&&f=="this"?c(rr,It):H(yt,rr,It)}function mi(f,h){return f=="variable"?Er(f,h):Wt(f,h)}function Er(f,h){if(f=="variable")return b(h),c(Wt)}function Wt(f,h){if(h=="<")return c(le(">"),ve(Et,">"),te,Wt);if(h=="extends"||h=="implements"||_&&f==",")return h=="implements"&&(T.marked="keyword"),c(_?ke:q,Wt);if(f=="{")return c(le("}"),_t,te)}function _t(f,h){if(f=="async"||f=="variable"&&(h=="static"||h=="get"||h=="set"||_&&g(h))&&T.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return T.marked="keyword",c(_t);if(f=="variable"||T.style=="keyword")return T.marked="property",c(br,_t);if(f=="number"||f=="string")return c(br,_t);if(f=="[")return c(q,rr,de("]"),br,_t);if(h=="*")return T.marked="keyword",c(_t);if(_&&f=="(")return H(lr,_t);if(f==";"||f==",")return c(_t);if(f=="}")return c();if(h=="@")return c(q,_t)}function br(f,h){if(h=="!"||h=="?")return c(br);if(f==":")return c(ke,It);if(h=="=")return c(Ve);var L=T.state.lexical.prev,O=L&&L.info=="interface";return H(O?lr:Pt)}function Ir(f,h){return h=="*"?(T.marked="keyword",c(_r,de(";"))):h=="default"?(T.marked="keyword",c(q,de(";"))):f=="{"?c(ve(Fr,"}"),_r,de(";")):H(he)}function Fr(f,h){if(h=="as")return T.marked="keyword",c(de("variable"));if(f=="variable")return H(Ve,Fr)}function ar(f){return f=="string"?c():f=="("?H(q):f=="."?H(Le):H(Wr,Ut,_r)}function Wr(f,h){return f=="{"?Tt(Wr,"}"):(f=="variable"&&b(h),h=="*"&&(T.marked="keyword"),c(sn))}function Ut(f){if(f==",")return c(Wr,Ut)}function sn(f,h){if(h=="as")return T.marked="keyword",c(Wr)}function _r(f,h){if(h=="from")return T.marked="keyword",c(q)}function je(f){return f=="]"?c():H(ve(Ve,"]"))}function U(){return H(le("form"),yt,de("{"),le("}"),ve(Zt,"}"),te,te)}function Zt(){return H(yt,It)}function un(f,h){return f.lastType=="operator"||f.lastType==","||se.test(h.charAt(0))||/[,.]/.test(h.charAt(0))}function Dt(f,h,L){return h.tokenize==V&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(h.lastType)||h.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(L||0)))}return{startState:function(f){var h={tokenize:V,lastType:"sof",cc:[],lexical:new ee((f||0)-We,0,"block",!1),localVars:Se.localVars,context:Se.localVars&&new D(null,null,!1),indented:f||0};return Se.globalVars&&typeof Se.globalVars=="object"&&(h.globalVars=Se.globalVars),h},token:function(f,h){if(f.sol()&&(h.lexical.hasOwnProperty("align")||(h.lexical.align=!1),h.indented=f.indentation(),Me(f,h)),h.tokenize!=xe&&f.eatSpace())return null;var L=h.tokenize(f,h);return Te=="comment"?L:(h.lastType=Te=="operator"&&(Oe=="++"||Oe=="--")?"incdec":Te,me(h,L,Te,Oe,f))},indent:function(f,h){if(f.tokenize==xe||f.tokenize==_e)return F.Pass;if(f.tokenize!=V)return 0;var L=h&&h.charAt(0),O=f.lexical,k;if(!/^\s*else\b/.test(h))for(var I=f.cc.length-1;I>=0;--I){var De=f.cc[I];if(De==te)O=O.prev;else if(De!=Pr&&De!=ze)break}for(;(O.type=="stat"||O.type=="form")&&(L=="}"||(k=f.cc[f.cc.length-1])&&(k==Le||k==Ke)&&!/^[,\.=+\-*:?[\(]/.test(h));)O=O.prev;Qe&&O.type==")"&&O.prev.type=="stat"&&(O=O.prev);var et=O.type,mt=L==et;return et=="vardef"?O.indented+(f.lastType=="operator"||f.lastType==","?O.info.length+1:0):et=="form"&&L=="{"?O.indented:et=="form"?O.indented+We:et=="stat"?O.indented+(un(f,h)?Qe||We:0):O.info=="switch"&&!mt&&Se.doubleIndentSwitch!=!1?O.indented+(/^(?:case|default)\b/.test(h)?We:2*We):O.align?O.column+(mt?0:1):O.indented+(mt?0:We)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:M?null:"/*",blockCommentEnd:M?null:"*/",blockCommentContinue:M?null:" * ",lineComment:M?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:M?"json":"javascript",jsonldMode:Ce,jsonMode:M,expressionAllowed:Dt,skipExpression:function(f){me(f,"atom","atom","true",new F.StringStream("",2,null))}}}),F.registerHelper("wordChars","javascript",/[\w$]/),F.defineMIME("text/javascript","javascript"),F.defineMIME("text/ecmascript","javascript"),F.defineMIME("application/javascript","javascript"),F.defineMIME("application/x-javascript","javascript"),F.defineMIME("application/ecmascript","javascript"),F.defineMIME("application/json",{name:"javascript",json:!0}),F.defineMIME("application/x-json",{name:"javascript",json:!0}),F.defineMIME("application/manifest+json",{name:"javascript",json:!0}),F.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),F.defineMIME("text/typescript",{name:"javascript",typescript:!0}),F.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}()),ga.exports}(function(yr,Or){(function(F){F(Ar(),Su(),ma(),ku)})(function(F){var Ee={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function Se(ie,G,se){var ce=ie.current(),Ie=ce.search(G);return Ie>-1?ie.backUp(ce.length-Ie):ce.match(/<\/?$/)&&(ie.backUp(ce.length),ie.match(G,!1)||ie.match(ce)),se}var We={};function Qe(ie){var G=We[ie];return G||(We[ie]=new RegExp("\\s+"+ie+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function Ce(ie,G){var se=ie.match(Qe(G));return se?/^\s*(.*?)\s*$/.exec(se[2])[1]:""}function M(ie,G){return new RegExp((G?"^":"")+"","i")}function j(ie,G){for(var se in ie)for(var ce=G[se]||(G[se]=[]),Ie=ie[se],Te=Ie.length-1;Te>=0;Te--)ce.unshift(Ie[Te])}function _(ie,G){for(var se=0;se=0;Oe--)ce.script.unshift(["type",Te[Oe].matches,Te[Oe].mode]);function ae(V,oe){var xe=se.token(V,oe.htmlState),_e=/\btag\b/.test(xe),ye;if(_e&&!/[<>\s\/]/.test(V.current())&&(ye=oe.htmlState.tagName&&oe.htmlState.tagName.toLowerCase())&&ce.hasOwnProperty(ye))oe.inTag=ye+" ";else if(oe.inTag&&_e&&/>$/.test(V.current())){var Me=/^([\S]+) (.*)/.exec(oe.inTag);oe.inTag=null;var He=V.current()==">"&&_(ce[Me[1]],Me[2]),ee=F.getMode(ie,He),X=M(Me[1],!0),me=M(Me[1],!1);oe.token=function(T,H){return T.match(X,!1)?(H.token=ae,H.localState=H.localMode=null,null):Se(T,me,H.localMode.token(T,H.localState))},oe.localMode=ee,oe.localState=F.startState(ee,se.indent(oe.htmlState,"",""))}else oe.inTag&&(oe.inTag+=V.current(),V.eol()&&(oe.inTag+=" "));return xe}return{startState:function(){var V=F.startState(se);return{token:ae,inTag:null,localMode:null,localState:null,htmlState:V}},copyState:function(V){var oe;return V.localState&&(oe=F.copyState(V.localMode,V.localState)),{token:V.token,inTag:V.inTag,localMode:V.localMode,localState:oe,htmlState:F.copyState(se,V.htmlState)}},token:function(V,oe){return oe.token(V,oe)},indent:function(V,oe,xe){return!V.localMode||/^\s*<\//.test(oe)?se.indent(V.htmlState,oe,xe):V.localMode.indent?V.localMode.indent(V.localState,oe,xe):F.Pass},innerMode:function(V){return{state:V.localState||V.htmlState,mode:V.localMode||se}}}},"xml","javascript","css"),F.defineMIME("text/html","htmlmixed")})})();ma();(function(yr,Or){(function(F){F(Ar())})(function(F){function Ee(j){return new RegExp("^(("+j.join(")|(")+"))\\b")}var Se=Ee(["and","or","not","is"]),We=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"],Qe=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];F.registerHelper("hintWords","python",We.concat(Qe).concat(["exec","print"]));function Ce(j){return j.scopes[j.scopes.length-1]}F.defineMode("python",function(j,_){for(var ie="error",G=_.delimiters||_.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,se=[_.singleOperators,_.doubleOperators,_.doubleDelimiters,_.tripleDelimiters,_.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],ce=0;ceg?X(b):D0&&T(x,b)&&(K+=" "+ie),K}}return Me(x,b)}function Me(x,b,v){if(x.eatSpace())return null;if(!v&&x.match(/^#.*/))return"comment";if(x.match(/^[0-9\.]/,!1)){var g=!1;if(x.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(g=!0),x.match(/^[\d_]+\.\d*/)&&(g=!0),x.match(/^\.\d+/)&&(g=!0),g)return x.eat(/J/i),"number";var D=!1;if(x.match(/^0x[0-9a-f_]+/i)&&(D=!0),x.match(/^0b[01_]+/i)&&(D=!0),x.match(/^0o[0-7_]+/i)&&(D=!0),x.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(x.eat(/J/i),D=!0),x.match(/^0(?![\dx])/i)&&(D=!0),D)return x.eat(/L/i),"number"}if(x.match(oe)){var K=x.current().toLowerCase().indexOf("f")!==-1;return K?(b.tokenize=He(x.current(),b.tokenize),b.tokenize(x,b)):(b.tokenize=ee(x.current(),b.tokenize),b.tokenize(x,b))}for(var $=0;$=0;)x=x.substr(1);var v=x.length==1,g="string";function D($){return function(pe,Re){var ze=Me(pe,Re,!0);return ze=="punctuation"&&(pe.current()=="{"?Re.tokenize=D($+1):pe.current()=="}"&&($>1?Re.tokenize=D($-1):Re.tokenize=K)),ze}}function K($,pe){for(;!$.eol();)if($.eatWhile(/[^'"\{\}\\]/),$.eat("\\")){if($.next(),v&&$.eol())return g}else{if($.match(x))return pe.tokenize=b,g;if($.match("{{"))return g;if($.match("{",!1))return pe.tokenize=D(0),$.current()?g:pe.tokenize($,pe);if($.match("}}"))return g;if($.match("}"))return ie;$.eat(/['"]/)}if(v){if(_.singleLineStringErrors)return ie;pe.tokenize=b}return g}return K.isString=!0,K}function ee(x,b){for(;"rubf".indexOf(x.charAt(0).toLowerCase())>=0;)x=x.substr(1);var v=x.length==1,g="string";function D(K,$){for(;!K.eol();)if(K.eatWhile(/[^'"\\]/),K.eat("\\")){if(K.next(),v&&K.eol())return g}else{if(K.match(x))return $.tokenize=b,g;K.eat(/['"]/)}if(v){if(_.singleLineStringErrors)return ie;$.tokenize=b}return g}return D.isString=!0,D}function X(x){for(;Ce(x).type!="py";)x.scopes.pop();x.scopes.push({offset:Ce(x).offset+j.indentUnit,type:"py",align:null})}function me(x,b,v){var g=x.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:x.column()+1;b.scopes.push({offset:b.indent+Ie,type:v,align:g})}function T(x,b){for(var v=x.indentation();b.scopes.length>1&&Ce(b).offset>v;){if(Ce(b).type!="py")return!0;b.scopes.pop()}return Ce(b).offset!=v}function H(x,b){x.sol()&&(b.beginningOfLine=!0,b.dedent=!1);var v=b.tokenize(x,b),g=x.current();if(b.beginningOfLine&&g=="@")return x.match(V,!1)?"meta":ae?"operator":ie;if(/\S/.test(g)&&(b.beginningOfLine=!1),(v=="variable"||v=="builtin")&&b.lastToken=="meta"&&(v="meta"),(g=="pass"||g=="return")&&(b.dedent=!0),g=="lambda"&&(b.lambda=!0),g==":"&&!b.lambda&&Ce(b).type=="py"&&x.match(/^\s*(?:#|$)/,!1)&&X(b),g.length==1&&!/string|comment/.test(v)){var D="[({".indexOf(g);if(D!=-1&&me(x,b,"])}".slice(D,D+1)),D="])}".indexOf(g),D!=-1)if(Ce(b).type==g)b.indent=b.scopes.pop().offset-Ie;else return ie}return b.dedent&&x.eol()&&Ce(b).type=="py"&&b.scopes.length>1&&b.scopes.pop(),v}var c={startState:function(x){return{tokenize:ye,scopes:[{offset:x||0,type:"py",align:null}],indent:x||0,lastToken:null,lambda:!1,dedent:0}},token:function(x,b){var v=b.errorToken;v&&(b.errorToken=!1);var g=H(x,b);return g&&g!="comment"&&(b.lastToken=g=="keyword"||g=="punctuation"?x.current():g),g=="punctuation"&&(g=null),x.eol()&&b.lambda&&(b.lambda=!1),v?g+" "+ie:g},indent:function(x,b){if(x.tokenize!=ye)return x.tokenize.isString?F.Pass:0;var v=Ce(x),g=v.type==b.charAt(0)||v.type=="py"&&!x.dedent&&/^(else:|elif |except |finally:)/.test(b);return v.align!=null?v.align-(g?1:0):v.offset-(g?Ie:0)},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:`'"`},lineComment:"#",fold:"indent"};return c}),F.defineMIME("text/x-python","python");var M=function(j){return j.split(" ")};F.defineMIME("text/x-cython",{name:"python",extra_keywords:M("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})})})();(function(yr,Or){(function(F){F(Ar())})(function(F){function Ee(v,g,D,K,$,pe){this.indented=v,this.column=g,this.type=D,this.info=K,this.align=$,this.prev=pe}function Se(v,g,D,K){var $=v.indented;return v.context&&v.context.type=="statement"&&D!="statement"&&($=v.context.indented),v.context=new Ee($,g,D,K,null,v.context)}function We(v){var g=v.context.type;return(g==")"||g=="]"||g=="}")&&(v.indented=v.context.indented),v.context=v.context.prev}function Qe(v,g,D){if(g.prevToken=="variable"||g.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(v.string.slice(0,D))||g.typeAtEndOfLine&&v.column()==v.indentation())return!0}function Ce(v){for(;;){if(!v||v.type=="top")return!0;if(v.type=="}"&&v.prev.info!="namespace")return!1;v=v.prev}}F.defineMode("clike",function(v,g){var D=v.indentUnit,K=g.statementIndentUnit||D,$=g.dontAlignCalls,pe=g.keywords||{},Re=g.types||{},ze=g.builtin||{},le=g.blockKeywords||{},te=g.defKeywords||{},de=g.atoms||{},he=g.hooks||{},ue=g.multiLineStrings,q=g.indentStatements!==!1,Ve=g.indentSwitch!==!1,Ct=g.namespaceSeparator,st=g.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,gt=g.numberStart||/[\d\.]/,Le=g.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,Ke=g.isOperatorChar||/[+\-*&%=<>!?|\/]/,lt=g.isIdentifierChar||/[\w\$_\xa1-\uffff]/,ht=g.isReservedIdentifier||!1,re,Ne;function w(R,ne){var Y=R.next();if(he[Y]){var we=he[Y](R,ne);if(we!==!1)return we}if(Y=='"'||Y=="'")return ne.tokenize=A(Y),ne.tokenize(R,ne);if(gt.test(Y)){if(R.backUp(1),R.match(Le))return"number";R.next()}if(st.test(Y))return re=Y,null;if(Y=="/"){if(R.eat("*"))return ne.tokenize=C,C(R,ne);if(R.eat("/"))return R.skipToEnd(),"comment"}if(Ke.test(Y)){for(;!R.match(/^\/[\/*]/,!1)&&R.eat(Ke););return"operator"}if(R.eatWhile(lt),Ct)for(;R.match(Ct);)R.eatWhile(lt);var ve=R.current();return j(pe,ve)?(j(le,ve)&&(re="newstatement"),j(te,ve)&&(Ne=!0),"keyword"):j(Re,ve)?"type":j(ze,ve)||ht&&ht(ve)?(j(le,ve)&&(re="newstatement"),"builtin"):j(de,ve)?"atom":"variable"}function A(R){return function(ne,Y){for(var we=!1,ve,Tt=!1;(ve=ne.next())!=null;){if(ve==R&&!we){Tt=!0;break}we=!we&&ve=="\\"}return(Tt||!(we||ue))&&(Y.tokenize=null),"string"}}function C(R,ne){for(var Y=!1,we;we=R.next();){if(we=="/"&&Y){ne.tokenize=null;break}Y=we=="*"}return"comment"}function be(R,ne){g.typeFirstDefinitions&&R.eol()&&Ce(ne.context)&&(ne.typeAtEndOfLine=Qe(R,ne,R.pos))}return{startState:function(R){return{tokenize:null,context:new Ee((R||0)-D,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(R,ne){var Y=ne.context;if(R.sol()&&(Y.align==null&&(Y.align=!1),ne.indented=R.indentation(),ne.startOfLine=!0),R.eatSpace())return be(R,ne),null;re=Ne=null;var we=(ne.tokenize||w)(R,ne);if(we=="comment"||we=="meta")return we;if(Y.align==null&&(Y.align=!0),re==";"||re==":"||re==","&&R.match(/^\s*(?:\/\/.*)?$/,!1))for(;ne.context.type=="statement";)We(ne);else if(re=="{")Se(ne,R.column(),"}");else if(re=="[")Se(ne,R.column(),"]");else if(re=="(")Se(ne,R.column(),")");else if(re=="}"){for(;Y.type=="statement";)Y=We(ne);for(Y.type=="}"&&(Y=We(ne));Y.type=="statement";)Y=We(ne)}else re==Y.type?We(ne):q&&((Y.type=="}"||Y.type=="top")&&re!=";"||Y.type=="statement"&&re=="newstatement")&&Se(ne,R.column(),"statement",R.current());if(we=="variable"&&(ne.prevToken=="def"||g.typeFirstDefinitions&&Qe(R,ne,R.start)&&Ce(ne.context)&&R.match(/^\s*\(/,!1))&&(we="def"),he.token){var ve=he.token(R,ne,we);ve!==void 0&&(we=ve)}return we=="def"&&g.styleDefs===!1&&(we="variable"),ne.startOfLine=!1,ne.prevToken=Ne?"def":we||re,be(R,ne),we},indent:function(R,ne){if(R.tokenize!=w&&R.tokenize!=null||R.typeAtEndOfLine&&Ce(R.context))return F.Pass;var Y=R.context,we=ne&&ne.charAt(0),ve=we==Y.type;if(Y.type=="statement"&&we=="}"&&(Y=Y.prev),g.dontIndentStatements)for(;Y.type=="statement"&&g.dontIndentStatements.test(Y.info);)Y=Y.prev;if(he.indent){var Tt=he.indent(R,Y,ne,D);if(typeof Tt=="number")return Tt}var Ot=Y.prev&&Y.prev.info=="switch";if(g.allmanIndentation&&/[{(]/.test(we)){for(;Y.type!="top"&&Y.type!="}";)Y=Y.prev;return Y.indented}return Y.type=="statement"?Y.indented+(we=="{"?0:K):Y.align&&(!$||Y.type!=")")?Y.column+(ve?0:1):Y.type==")"&&!ve?Y.indented+K:Y.indented+(ve?0:D)+(!ve&&Ot&&!/^(?:case|default)\b/.test(ne)?D:0)},electricInput:Ve?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function M(v){for(var g={},D=v.split(" "),K=0;K!?|\/#:@]/,hooks:{"@":function(v){return v.eatWhile(/[\w\$_]/),"meta"},'"':function(v,g){return v.match('""')?(g.tokenize=T,g.tokenize(v,g)):!1},"'":function(v){return v.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(v.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(v,g){var D=g.context;return D.type=="}"&&D.align&&v.eat(">")?(g.context=new Ee(D.indented,D.column,D.type,D.info,null,D.prev),"operator"):!1},"/":function(v,g){return v.eat("*")?(g.tokenize=H(1),g.tokenize(v,g)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function c(v){return function(g,D){for(var K=!1,$,pe=!1;!g.eol();){if(!v&&!K&&g.match('"')){pe=!0;break}if(v&&g.match('"""')){pe=!0;break}$=g.next(),!K&&$=="$"&&g.match("{")&&g.skipTo("}"),K=!K&&$=="\\"&&!v}return(pe||!v)&&(D.tokenize=null),"string"}}me("text/x-kotlin",{name:"clike",keywords:M("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:M("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:M("catch class do else finally for if where try while enum"),defKeywords:M("class val var object interface fun"),atoms:M("true false null this"),hooks:{"@":function(v){return v.eatWhile(/[\w\$_]/),"meta"},"*":function(v,g){return g.prevToken=="."?"variable":"operator"},'"':function(v,g){return g.tokenize=c(v.match('""')),g.tokenize(v,g)},"/":function(v,g){return v.eat("*")?(g.tokenize=H(1),g.tokenize(v,g)):!1},indent:function(v,g,D,K){var $=D&&D.charAt(0);if((v.prevToken=="}"||v.prevToken==")")&&D=="")return v.indented;if(v.prevToken=="operator"&&D!="}"&&v.context.type!="}"||v.prevToken=="variable"&&$=="."||(v.prevToken=="}"||v.prevToken==")")&&$==".")return K*2+g.indented;if(g.align&&g.type=="}")return g.indented+(v.context.type==(D||"").charAt(0)?0:K)}},modeProps:{closeBrackets:{triples:'"'}}}),me(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:M("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:M("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:M("for while do if else struct"),builtin:M("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:M("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":oe},modeProps:{fold:["brace","include"]}}),me("text/x-nesc",{name:"clike",keywords:M(_+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:Te,blockKeywords:M(ae),atoms:M("null true false"),hooks:{"#":oe},modeProps:{fold:["brace","include"]}}),me("text/x-objectivec",{name:"clike",keywords:M(_+" "+G),types:Oe,builtin:M(se),blockKeywords:M(ae+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:M(V+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:M("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:_e,hooks:{"#":oe,"*":xe},modeProps:{fold:["brace","include"]}}),me("text/x-objectivec++",{name:"clike",keywords:M(_+" "+G+" "+ie),types:Oe,builtin:M(se),blockKeywords:M(ae+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:M(V+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:M("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:_e,hooks:{"#":oe,"*":xe,u:Me,U:Me,L:Me,R:Me,0:ye,1:ye,2:ye,3:ye,4:ye,5:ye,6:ye,7:ye,8:ye,9:ye,token:function(v,g,D){if(D=="variable"&&v.peek()=="("&&(g.prevToken==";"||g.prevToken==null||g.prevToken=="}")&&He(v.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),me("text/x-squirrel",{name:"clike",keywords:M("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:Te,blockKeywords:M("case catch class else for foreach if switch try while"),defKeywords:M("function local class"),typeFirstDefinitions:!0,atoms:M("true false null"),hooks:{"#":oe},modeProps:{fold:["brace","include"]}});var x=null;function b(v){return function(g,D){for(var K=!1,$,pe=!1;!g.eol();){if(!K&&g.match('"')&&(v=="single"||g.match('""'))){pe=!0;break}if(!K&&g.match("``")){x=b(v),pe=!0;break}$=g.next(),K=v=="single"&&!K&&$=="\\"}return pe&&(D.tokenize=null),"string"}}me("text/x-ceylon",{name:"clike",keywords:M("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(v){var g=v.charAt(0);return g===g.toUpperCase()&&g!==g.toLowerCase()},blockKeywords:M("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:M("class dynamic function interface module object package value"),builtin:M("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:M("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(v){return v.eatWhile(/[\w\$_]/),"meta"},'"':function(v,g){return g.tokenize=b(v.match('""')?"triple":"single"),g.tokenize(v,g)},"`":function(v,g){return!x||!v.match("`")?!1:(g.tokenize=x,x=null,g.tokenize(v,g))},"'":function(v){return v.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(v,g,D){if((D=="variable"||D=="type")&&g.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})();export{Tu as default}; diff --git a/priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/inspectorTab-B4Iw34Ow.js b/priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/inspectorTab-B4Iw34Ow.js new file mode 100644 index 00000000..dd4621d7 --- /dev/null +++ b/priv/static/node_modules/playwright-core/lib/vite/traceViewer/assets/inspectorTab-B4Iw34Ow.js @@ -0,0 +1,68 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./codeMirrorModule-BBCX0spr.js","../codeMirrorModule.ez37Vkbh.css"])))=>i.map(i=>d[i]); +var Fp=Object.defineProperty;var Hp=(e,t,n)=>t in e?Fp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var H=(e,t,n)=>Hp(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var tw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Up(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vc={exports:{}},Es={},Bc={exports:{}},j={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Xr=Symbol.for("react.element"),Vp=Symbol.for("react.portal"),Bp=Symbol.for("react.fragment"),qp=Symbol.for("react.strict_mode"),Wp=Symbol.for("react.profiler"),Qp=Symbol.for("react.provider"),Kp=Symbol.for("react.context"),Gp=Symbol.for("react.forward_ref"),Xp=Symbol.for("react.suspense"),Jp=Symbol.for("react.memo"),Yp=Symbol.for("react.lazy"),eu=Symbol.iterator;function Zp(e){return e===null||typeof e!="object"?null:(e=eu&&e[eu]||e["@@iterator"],typeof e=="function"?e:null)}var qc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wc=Object.assign,Qc={};function Kn(e,t,n){this.props=e,this.context=t,this.refs=Qc,this.updater=n||qc}Kn.prototype.isReactComponent={};Kn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Kn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Kc(){}Kc.prototype=Kn.prototype;function Dl(e,t,n){this.props=e,this.context=t,this.refs=Qc,this.updater=n||qc}var Fl=Dl.prototype=new Kc;Fl.constructor=Dl;Wc(Fl,Kn.prototype);Fl.isPureReactComponent=!0;var tu=Array.isArray,Gc=Object.prototype.hasOwnProperty,Hl={current:null},Xc={key:!0,ref:!0,__self:!0,__source:!0};function Jc(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Gc.call(t,r)&&!Xc.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1{let o=!1;return e().then(l=>{o||s(l)}),()=>{o=!0}},t),i}function ks(){const e=et.useRef(null),[t,n]=et.useState(new DOMRect(0,0,10,10));return et.useLayoutEffect(()=>{const r=e.current;if(!r)return;const i=new ResizeObserver(s=>{const o=s[s.length-1];o&&o.contentRect&&n(o.contentRect)});return i.observe(r),()=>i.disconnect()},[e]),[t,e]}function Ro(e){if(e<0||!isFinite(e))return"-";if(e===0)return"0";if(e<1e3)return e.toFixed(0)+"ms";const t=e/1e3;if(t<60)return t.toFixed(1)+"s";const n=t/60;if(n<60)return n.toFixed(1)+"m";const r=n/60;return r<24?r.toFixed(1)+"h":(r/24).toFixed(1)+"d"}function dg(e){if(e<0||!isFinite(e))return"-";if(e===0)return"0";if(e<1e3)return e.toFixed(0);const t=e/1024;if(t<1e3)return t.toFixed(1)+"K";const n=t/1024;return n<1e3?n.toFixed(1)+"M":(n/1024).toFixed(1)+"G"}function nw(e,t,n,r,i){let s=0,o=i!==void 0?i:e.length;for(;s>1;n(t,e[l])>=0?s=l+1:o=l}return o}function fg(e){const t=document.createElement("textarea");t.style.position="absolute",t.style.zIndex="-1000",t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}function ru(e,t){e&&(t=Yt.getObject(e,t));const[n,r]=et.useState(t),i=et.useCallback(s=>{e?Yt.setObject(e,s):r(s)},[e,r]);return et.useEffect(()=>{if(e){const s=()=>r(Yt.getObject(e,t));return Yt.onChangeEmitter.addEventListener(e,s),()=>Yt.onChangeEmitter.removeEventListener(e,s)}},[t,e]),[n,i]}class hg{constructor(){this.onChangeEmitter=new EventTarget}getString(t,n){return localStorage[t]||n}setString(t,n){var r;localStorage[t]=n,this.onChangeEmitter.dispatchEvent(new Event(t)),(r=window.saveSettings)==null||r.call(window)}getObject(t,n){if(!localStorage[t])return n;try{return JSON.parse(localStorage[t])}catch{return n}}setObject(t,n){var r;localStorage[t]=JSON.stringify(n),this.onChangeEmitter.dispatchEvent(new Event(t)),(r=window.saveSettings)==null||r.call(window)}}const Yt=new hg;function tt(...e){return e.filter(Boolean).join(" ")}async function rw(e){const t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-1",t))).map(n=>n.toString(16).padStart(2,"0")).join("")}function pg(e){e&&(e!=null&&e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!1):e==null||e.scrollIntoView())}const iu="\\u0000-\\u0020\\u007f-\\u009f",gg=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|www\\.)[^\\s"+iu+'"]{2,}[^\\s'+iu+`"')}\\],:;.!?]`,"ug");function iw(){if(document.playwrightThemeInitialized)return;document.playwrightThemeInitialized=!0,document.defaultView.addEventListener("focus",n=>{n.target.document.nodeType===Node.DOCUMENT_NODE&&document.body.classList.remove("inactive")},!1),document.defaultView.addEventListener("blur",n=>{document.body.classList.add("inactive")},!1);const e=Yt.getString("theme","light-mode"),t=window.matchMedia("(prefers-color-scheme: dark)");(e==="dark-mode"||t.matches)&&document.body.classList.add("dark-mode")}const Vl=new Set;function mg(){const e=$o(),t=e==="dark-mode"?"light-mode":"dark-mode";e&&document.body.classList.remove(e),document.body.classList.add(t),Yt.setString("theme",t);for(const n of Vl)n(t)}function sw(e){Vl.add(e)}function ow(e){Vl.delete(e)}function $o(){return document.body.classList.contains("dark-mode")?"dark-mode":"light-mode"}function lw(){const[e,t]=et.useState($o()==="dark-mode");return[e,n=>{$o()==="dark-mode"!==n&&mg(),t(n)}]}var Zc={exports:{}},De={},ed={exports:{}},td={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(L,R){var $=L.length;L.push(R);e:for(;0<$;){var Y=$-1>>>1,oe=L[Y];if(0>>1;Yi(Ws,$))Kti(ii,Ws)?(L[Y]=ii,L[Kt]=$,Y=Kt):(L[Y]=Ws,L[Qt]=$,Y=Qt);else if(Kti(ii,$))L[Y]=ii,L[Kt]=$,Y=Kt;else break e}}return R}function i(L,R){var $=L.sortIndex-R.sortIndex;return $!==0?$:L.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var a=[],u=[],c=1,f=null,d=3,g=!1,m=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(L){for(var R=n(u);R!==null;){if(R.callback===null)r(u);else if(R.startTime<=L)r(u),R.sortIndex=R.expirationTime,t(a,R);else break;R=n(u)}}function x(L){if(y=!1,v(L),!m)if(n(a)!==null)m=!0,er(E);else{var R=n(u);R!==null&&tr(x,R.startTime-L)}}function E(L,R){m=!1,y&&(y=!1,p(b),b=-1),g=!0;var $=d;try{for(v(R),f=n(a);f!==null&&(!(f.expirationTime>R)||L&&!O());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,d=f.priorityLevel;var oe=Y(f.expirationTime<=R);R=e.unstable_now(),typeof oe=="function"?f.callback=oe:f===n(a)&&r(a),v(R)}else r(a);f=n(a)}if(f!==null)var ri=!0;else{var Qt=n(u);Qt!==null&&tr(x,Qt.startTime-R),ri=!1}return ri}finally{f=null,d=$,g=!1}}var C=!1,N=null,b=-1,S=5,I=-1;function O(){return!(e.unstable_now()-IL||125Y?(L.sortIndex=$,t(u,L),n(a)===null&&L===n(u)&&(y?(p(b),b=-1):y=!0,tr(x,$-Y))):(L.sortIndex=oe,t(a,L),m||g||(m=!0,er(E))),L},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(L){var R=d;return function(){var $=d;d=R;try{return L.apply(this,arguments)}finally{d=$}}}})(td);ed.exports=td;var vg=ed.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var nd=M,je=vg;function k(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oo=Object.prototype.hasOwnProperty,yg=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,su={},ou={};function wg(e){return Oo.call(ou,e)?!0:Oo.call(su,e)?!1:yg.test(e)?ou[e]=!0:(su[e]=!0,!1)}function _g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function xg(e,t,n,r){if(t===null||typeof t>"u"||_g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Te(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){fe[e]=new Te(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];fe[t]=new Te(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){fe[e]=new Te(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){fe[e]=new Te(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){fe[e]=new Te(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){fe[e]=new Te(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){fe[e]=new Te(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){fe[e]=new Te(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){fe[e]=new Te(e,5,!1,e.toLowerCase(),null,!1,!1)});var Bl=/[\-:]([a-z])/g;function ql(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Bl,ql);fe[t]=new Te(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Bl,ql);fe[t]=new Te(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Bl,ql);fe[t]=new Te(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){fe[e]=new Te(e,1,!1,e.toLowerCase(),null,!1,!1)});fe.xlinkHref=new Te("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){fe[e]=new Te(e,1,!1,e.toLowerCase(),null,!0,!0)});function Wl(e,t,n,r){var i=fe.hasOwnProperty(t)?fe[t]:null;(i!==null?i.type!==0:r||!(2l||i[o]!==s[l]){var a=` +`+i[o].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=o&&0<=l);break}}}finally{Gs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?gr(e):""}function Sg(e){switch(e.tag){case 5:return gr(e.type);case 16:return gr("Lazy");case 13:return gr("Suspense");case 19:return gr("SuspenseList");case 0:case 2:case 15:return e=Xs(e.type,!1),e;case 11:return e=Xs(e.type.render,!1),e;case 1:return e=Xs(e.type,!0),e;default:return""}}function Fo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Sn:return"Fragment";case xn:return"Portal";case jo:return"Profiler";case Ql:return"StrictMode";case zo:return"Suspense";case Do:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sd:return(e.displayName||"Context")+".Consumer";case id:return(e._context.displayName||"Context")+".Provider";case Kl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gl:return t=e.displayName||null,t!==null?t:Fo(e.type)||"Memo";case Ct:t=e._payload,e=e._init;try{return Fo(e(t))}catch{}}return null}function Eg(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Fo(t);case 8:return t===Ql?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ut(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ld(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kg(e){var t=ld(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function li(e){e._valueTracker||(e._valueTracker=kg(e))}function ad(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ld(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Qi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ho(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function au(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ut(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ud(e,t){t=t.checked,t!=null&&Wl(e,"checked",t,!1)}function Uo(e,t){ud(e,t);var n=Ut(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Vo(e,t.type,n):t.hasOwnProperty("defaultValue")&&Vo(e,t.type,Ut(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uu(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Vo(e,t,n){(t!=="number"||Qi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var mr=Array.isArray;function Rn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=ai.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Er={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Tg=["Webkit","ms","Moz","O"];Object.keys(Er).forEach(function(e){Tg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Er[t]=Er[e]})});function hd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Er.hasOwnProperty(e)&&Er[e]?(""+t).trim():t+"px"}function pd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=hd(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Cg=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Wo(e,t){if(t){if(Cg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(k(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(k(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(k(61))}if(t.style!=null&&typeof t.style!="object")throw Error(k(62))}}function Qo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ko=null;function Xl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Go=null,$n=null,On=null;function fu(e){if(e=Zr(e)){if(typeof Go!="function")throw Error(k(280));var t=e.stateNode;t&&(t=As(t),Go(e.stateNode,e.type,t))}}function gd(e){$n?On?On.push(e):On=[e]:$n=e}function md(){if($n){var e=$n,t=On;if(On=$n=null,fu(e),t)for(e=0;e>>=0,e===0?32:31-(jg(e)/zg|0)|0}var ui=64,ci=4194304;function vr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ji(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=vr(l):(s&=o,s!==0&&(r=vr(s)))}else o=n&~i,o!==0?r=vr(o):s!==0&&(r=vr(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Jr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-nt(t),e[t]=n}function Ug(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Tr),xu=" ",Su=!1;function Od(e,t){switch(e){case"keyup":return mm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var En=!1;function ym(e,t){switch(e){case"compositionend":return jd(t);case"keypress":return t.which!==32?null:(Su=!0,xu);case"textInput":return e=t.data,e===xu&&Su?null:e;default:return null}}function wm(e,t){if(En)return e==="compositionend"||!ia&&Od(e,t)?(e=Rd(),Ii=ta=Mt=null,En=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Cu(n)}}function Hd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ud(){for(var e=window,t=Qi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qi(e.document)}return t}function sa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function bm(e){var t=Ud(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Hd(n.ownerDocument.documentElement,n)){if(r!==null&&sa(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Nu(n,s);var o=Nu(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,kn=null,tl=null,Nr=null,nl=!1;function bu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;nl||kn==null||kn!==Qi(r)||(r=kn,"selectionStart"in r&&sa(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&Dr(Nr,r)||(Nr=r,r=es(tl,"onSelect"),0Nn||(e.current=al[Nn],al[Nn]=null,Nn--)}function F(e,t){Nn++,al[Nn]=e.current,e.current=t}var Vt={},we=qt(Vt),Ie=qt(!1),ln=Vt;function Un(e,t){var n=e.type.contextTypes;if(!n)return Vt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Me(e){return e=e.childContextTypes,e!=null}function ns(){V(Ie),V(we)}function $u(e,t,n){if(we.current!==Vt)throw Error(k(168));F(we,t),F(Ie,n)}function Jd(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(k(108,Eg(e)||"Unknown",i));return G({},n,r)}function rs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vt,ln=we.current,F(we,e),F(Ie,Ie.current),!0}function Ou(e,t,n){var r=e.stateNode;if(!r)throw Error(k(169));n?(e=Jd(e,t,ln),r.__reactInternalMemoizedMergedChildContext=e,V(Ie),V(we),F(we,e)):V(Ie),F(Ie,n)}var gt=null,Ls=!1,co=!1;function Yd(e){gt===null?gt=[e]:gt.push(e)}function Fm(e){Ls=!0,Yd(e)}function Wt(){if(!co&>!==null){co=!0;var e=0,t=D;try{var n=gt;for(D=1;e>=o,i-=o,mt=1<<32-nt(t)+i|n<b?(S=N,N=null):S=N.sibling;var I=d(p,N,v[b],x);if(I===null){N===null&&(N=S);break}e&&N&&I.alternate===null&&t(p,N),h=s(I,h,b),C===null?E=I:C.sibling=I,C=I,N=S}if(b===v.length)return n(p,N),W&&Gt(p,b),E;if(N===null){for(;bb?(S=N,N=null):S=N.sibling;var O=d(p,N,I.value,x);if(O===null){N===null&&(N=S);break}e&&N&&O.alternate===null&&t(p,N),h=s(O,h,b),C===null?E=O:C.sibling=O,C=O,N=S}if(I.done)return n(p,N),W&&Gt(p,b),E;if(N===null){for(;!I.done;b++,I=v.next())I=f(p,I.value,x),I!==null&&(h=s(I,h,b),C===null?E=I:C.sibling=I,C=I);return W&&Gt(p,b),E}for(N=r(p,N);!I.done;b++,I=v.next())I=g(N,p,b,I.value,x),I!==null&&(e&&I.alternate!==null&&N.delete(I.key===null?b:I.key),h=s(I,h,b),C===null?E=I:C.sibling=I,C=I);return e&&N.forEach(function(T){return t(p,T)}),W&&Gt(p,b),E}function _(p,h,v,x){if(typeof v=="object"&&v!==null&&v.type===Sn&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case oi:e:{for(var E=v.key,C=h;C!==null;){if(C.key===E){if(E=v.type,E===Sn){if(C.tag===7){n(p,C.sibling),h=i(C,v.props.children),h.return=p,p=h;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ct&&Vu(E)===C.type){n(p,C.sibling),h=i(C,v.props),h.ref=lr(p,C,v),h.return=p,p=h;break e}n(p,C);break}else t(p,C);C=C.sibling}v.type===Sn?(h=sn(v.props.children,p.mode,x,v.key),h.return=p,p=h):(x=Di(v.type,v.key,v.props,null,p.mode,x),x.ref=lr(p,h,v),x.return=p,p=x)}return o(p);case xn:e:{for(C=v.key;h!==null;){if(h.key===C)if(h.tag===4&&h.stateNode.containerInfo===v.containerInfo&&h.stateNode.implementation===v.implementation){n(p,h.sibling),h=i(h,v.children||[]),h.return=p,p=h;break e}else{n(p,h);break}else t(p,h);h=h.sibling}h=wo(v,p.mode,x),h.return=p,p=h}return o(p);case Ct:return C=v._init,_(p,h,C(v._payload),x)}if(mr(v))return m(p,h,v,x);if(nr(v))return y(p,h,v,x);vi(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,h!==null&&h.tag===6?(n(p,h.sibling),h=i(h,v),h.return=p,p=h):(n(p,h),h=yo(v,p.mode,x),h.return=p,p=h),o(p)):n(p,h)}return _}var Bn=lf(!0),af=lf(!1),ei={},dt=qt(ei),Vr=qt(ei),Br=qt(ei);function tn(e){if(e===ei)throw Error(k(174));return e}function pa(e,t){switch(F(Br,t),F(Vr,e),F(dt,ei),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:qo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=qo(t,e)}V(dt),F(dt,t)}function qn(){V(dt),V(Vr),V(Br)}function uf(e){tn(Br.current);var t=tn(dt.current),n=qo(t,e.type);t!==n&&(F(Vr,e),F(dt,n))}function ga(e){Vr.current===e&&(V(dt),V(Vr))}var Q=qt(0);function us(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fo=[];function ma(){for(var e=0;en?n:4,e(!0);var r=ho.transition;ho.transition={};try{e(!1),t()}finally{D=n,ho.transition=r}}function Tf(){return Ke().memoizedState}function Bm(e,t,n){var r=Ft(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cf(e))Nf(t,n);else if(n=nf(e,t,n,r),n!==null){var i=Ee();rt(n,e,r,i),bf(n,t,r)}}function qm(e,t,n){var r=Ft(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cf(e))Nf(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,it(l,o)){var a=t.interleaved;a===null?(i.next=i,fa(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=nf(e,t,i,r),n!==null&&(i=Ee(),rt(n,e,r,i),bf(n,t,r))}}function Cf(e){var t=e.alternate;return e===K||t!==null&&t===K}function Nf(e,t){br=cs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Yl(e,n)}}var ds={readContext:Qe,useCallback:he,useContext:he,useEffect:he,useImperativeHandle:he,useInsertionEffect:he,useLayoutEffect:he,useMemo:he,useReducer:he,useRef:he,useState:he,useDebugValue:he,useDeferredValue:he,useTransition:he,useMutableSource:he,useSyncExternalStore:he,useId:he,unstable_isNewReconciler:!1},Wm={readContext:Qe,useCallback:function(e,t){return lt().memoizedState=[e,t===void 0?null:t],e},useContext:Qe,useEffect:qu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$i(4194308,4,_f.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $i(4194308,4,e,t)},useInsertionEffect:function(e,t){return $i(4,2,e,t)},useMemo:function(e,t){var n=lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=lt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Bm.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=lt();return e={current:e},t.memoizedState=e},useState:Bu,useDebugValue:xa,useDeferredValue:function(e){return lt().memoizedState=e},useTransition:function(){var e=Bu(!1),t=e[0];return e=Vm.bind(null,e[1]),lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=K,i=lt();if(W){if(n===void 0)throw Error(k(407));n=n()}else{if(n=t(),ae===null)throw Error(k(349));un&30||ff(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,qu(pf.bind(null,r,s,e),[e]),r.flags|=2048,Qr(9,hf.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=lt(),t=ae.identifierPrefix;if(W){var n=vt,r=mt;n=(r&~(1<<32-nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ut]=t,e[Ur]=r,jf(e,t,!1,!1),t.stateNode=e;e:{switch(o=Qo(n,r),n){case"dialog":U("cancel",e),U("close",e),i=r;break;case"iframe":case"object":case"embed":U("load",e),i=r;break;case"video":case"audio":for(i=0;iQn&&(t.flags|=128,r=!0,ar(s,!1),t.lanes=4194304)}else{if(!r)if(e=us(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ar(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!W)return pe(t),null}else 2*Z()-s.renderingStartTime>Qn&&n!==1073741824&&(t.flags|=128,r=!0,ar(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Z(),t.sibling=null,n=Q.current,F(Q,r?n&1|2:n&1),t):(pe(t),null);case 22:case 23:return Na(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Re&1073741824&&(pe(t),t.subtreeFlags&6&&(t.flags|=8192)):pe(t),null;case 24:return null;case 25:return null}throw Error(k(156,t.tag))}function ev(e,t){switch(la(t),t.tag){case 1:return Me(t.type)&&ns(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qn(),V(Ie),V(we),ma(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ga(t),null;case 13:if(V(Q),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(k(340));Vn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(Q),null;case 4:return qn(),null;case 10:return da(t.type._context),null;case 22:case 23:return Na(),null;case 24:return null;default:return null}}var wi=!1,me=!1,tv=typeof WeakSet=="function"?WeakSet:Set,A=null;function In(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){X(e,t,r)}else n.current=null}function _l(e,t,n){try{n()}catch(r){X(e,t,r)}}var ec=!1;function nv(e,t){if(rl=Yi,e=Ud(),sa(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var g;f!==n||i!==0&&f.nodeType!==3||(l=o+i),f!==s||r!==0&&f.nodeType!==3||(a=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(g=f.firstChild)!==null;)d=f,f=g;for(;;){if(f===e)break t;if(d===n&&++u===i&&(l=o),d===s&&++c===r&&(a=o),(g=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(il={focusedElem:e,selectionRange:n},Yi=!1,A=t;A!==null;)if(t=A,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,A=e;else for(;A!==null;){t=A;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,_=m.memoizedState,p=t.stateNode,h=p.getSnapshotBeforeUpdate(t.elementType===t.type?y:Xe(t.type,y),_);p.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(k(163))}}catch(x){X(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,A=e;break}A=t.return}return m=ec,ec=!1,m}function Ar(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&_l(t,n,s)}i=i.next}while(i!==r)}}function Ps(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ff(e){var t=e.alternate;t!==null&&(e.alternate=null,Ff(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ut],delete t[Ur],delete t[ll],delete t[zm],delete t[Dm])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Hf(e){return e.tag===5||e.tag===3||e.tag===4}function tc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ts));else if(r!==4&&(e=e.child,e!==null))for(Sl(e,t,n),e=e.sibling;e!==null;)Sl(e,t,n),e=e.sibling}function El(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(El(e,t,n),e=e.sibling;e!==null;)El(e,t,n),e=e.sibling}var ue=null,Je=!1;function Tt(e,t,n){for(n=n.child;n!==null;)Uf(e,t,n),n=n.sibling}function Uf(e,t,n){if(ct&&typeof ct.onCommitFiberUnmount=="function")try{ct.onCommitFiberUnmount(Ts,n)}catch{}switch(n.tag){case 5:me||In(n,t);case 6:var r=ue,i=Je;ue=null,Tt(e,t,n),ue=r,Je=i,ue!==null&&(Je?(e=ue,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ue.removeChild(n.stateNode));break;case 18:ue!==null&&(Je?(e=ue,n=n.stateNode,e.nodeType===8?uo(e.parentNode,n):e.nodeType===1&&uo(e,n),jr(e)):uo(ue,n.stateNode));break;case 4:r=ue,i=Je,ue=n.stateNode.containerInfo,Je=!0,Tt(e,t,n),ue=r,Je=i;break;case 0:case 11:case 14:case 15:if(!me&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&_l(n,t,o),i=i.next}while(i!==r)}Tt(e,t,n);break;case 1:if(!me&&(In(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){X(n,t,l)}Tt(e,t,n);break;case 21:Tt(e,t,n);break;case 22:n.mode&1?(me=(r=me)||n.memoizedState!==null,Tt(e,t,n),me=r):Tt(e,t,n);break;default:Tt(e,t,n)}}function nc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new tv),t.forEach(function(r){var i=dv.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ge(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=Z()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*iv(r/1960))-r,10e?16:e,Pt===null)var r=!1;else{if(e=Pt,Pt=null,ps=0,z&6)throw Error(k(331));var i=z;for(z|=4,A=e.current;A!==null;){var s=A,o=s.child;if(A.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aZ()-Ta?rn(e,0):ka|=n),Pe(e,t)}function Xf(e,t){t===0&&(e.mode&1?(t=ci,ci<<=1,!(ci&130023424)&&(ci=4194304)):t=1);var n=Ee();e=St(e,t),e!==null&&(Jr(e,t,n),Pe(e,n))}function cv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xf(e,n)}function dv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(k(314))}r!==null&&r.delete(t),Xf(e,n)}var Jf;Jf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ie.current)Le=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Le=!1,Ym(e,t,n);Le=!!(e.flags&131072)}else Le=!1,W&&t.flags&1048576&&Zd(t,ss,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Oi(e,t),e=t.pendingProps;var i=Un(t,we.current);zn(t,n),i=ya(null,t,r,e,i,n);var s=wa();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Me(r)?(s=!0,rs(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ha(t),i.updater=Is,t.stateNode=i,i._reactInternals=t,hl(t,r,e,n),t=ml(null,t,r,!0,s,n)):(t.tag=0,W&&s&&oa(t),_e(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Oi(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=hv(r),e=Xe(r,e),i){case 0:t=gl(null,t,r,e,n);break e;case 1:t=Ju(null,t,r,e,n);break e;case 11:t=Gu(null,t,r,e,n);break e;case 14:t=Xu(null,t,r,Xe(r.type,e),n);break e}throw Error(k(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Xe(r,i),gl(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Xe(r,i),Ju(e,t,r,i,n);case 3:e:{if(Rf(t),e===null)throw Error(k(387));r=t.pendingProps,s=t.memoizedState,i=s.element,rf(e,t),as(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Wn(Error(k(423)),t),t=Yu(e,t,r,n,i);break e}else if(r!==i){i=Wn(Error(k(424)),t),t=Yu(e,t,r,n,i);break e}else for($e=jt(t.stateNode.containerInfo.firstChild),Oe=t,W=!0,Ye=null,n=af(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vn(),r===i){t=Et(e,t,n);break e}_e(e,t,r,n)}t=t.child}return t;case 5:return uf(t),e===null&&cl(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,sl(r,i)?o=null:s!==null&&sl(r,s)&&(t.flags|=32),Pf(e,t),_e(e,t,o,n),t.child;case 6:return e===null&&cl(t),null;case 13:return $f(e,t,n);case 4:return pa(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Bn(t,null,r,n):_e(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Xe(r,i),Gu(e,t,r,i,n);case 7:return _e(e,t,t.pendingProps,n),t.child;case 8:return _e(e,t,t.pendingProps.children,n),t.child;case 12:return _e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,F(os,r._currentValue),r._currentValue=o,s!==null)if(it(s.value,o)){if(s.children===i.children&&!Ie.current){t=Et(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=wt(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),dl(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(k(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),dl(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}_e(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,zn(t,n),i=Qe(i),r=r(i),t.flags|=1,_e(e,t,r,n),t.child;case 14:return r=t.type,i=Xe(r,t.pendingProps),i=Xe(r.type,i),Xu(e,t,r,i,n);case 15:return If(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Xe(r,i),Oi(e,t),t.tag=1,Me(r)?(e=!0,rs(t)):e=!1,zn(t,n),of(t,r,i),hl(t,r,i,n),ml(null,t,r,!0,e,n);case 19:return Of(e,t,n);case 22:return Mf(e,t,n)}throw Error(k(156,t.tag))};function Yf(e,t){return Ed(e,t)}function fv(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Be(e,t,n,r){return new fv(e,t,n,r)}function Aa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hv(e){if(typeof e=="function")return Aa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Kl)return 11;if(e===Gl)return 14}return 2}function Ht(e,t){var n=e.alternate;return n===null?(n=Be(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Di(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Aa(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Sn:return sn(n.children,i,s,t);case Ql:o=8,i|=8;break;case jo:return e=Be(12,n,t,i|2),e.elementType=jo,e.lanes=s,e;case zo:return e=Be(13,n,t,i),e.elementType=zo,e.lanes=s,e;case Do:return e=Be(19,n,t,i),e.elementType=Do,e.lanes=s,e;case od:return $s(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case id:o=10;break e;case sd:o=9;break e;case Kl:o=11;break e;case Gl:o=14;break e;case Ct:o=16,r=null;break e}throw Error(k(130,e==null?e:typeof e,""))}return t=Be(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function sn(e,t,n,r){return e=Be(7,e,r,t),e.lanes=n,e}function $s(e,t,n,r){return e=Be(22,e,r,t),e.elementType=od,e.lanes=n,e.stateNode={isHidden:!1},e}function yo(e,t,n){return e=Be(6,e,null,t),e.lanes=n,e}function wo(e,t,n){return t=Be(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function pv(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ys(0),this.expirationTimes=Ys(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ys(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function La(e,t,n,r,i,s,o,l,a){return e=new pv(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Be(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ha(s),e}function gv(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nh)}catch(e){console.error(e)}}nh(),Zc.exports=De;var _v=Zc.exports,xv,cc=_v;xv=cc.createRoot,cc.hydrateRoot;const fn=({children:e,title:t="",icon:n,disabled:r=!1,toggled:i=!1,onClick:s=()=>{},style:o,testId:l,className:a,ariaLabel:u})=>w.jsxs("button",{className:tt(a,"toolbar-button",n,i&&"toggled"),onMouseDown:dc,onClick:s,onDoubleClick:dc,title:t,disabled:!!r,style:o,"data-testid":l,"aria-label":u||t,children:[n&&w.jsx("span",{className:`codicon codicon-${n}`,style:e?{marginRight:5}:{}}),e]}),aw=({style:e})=>w.jsx("div",{className:"toolbar-separator",style:e}),dc=e=>{e.stopPropagation(),e.preventDefault()},wr=Symbol("context"),rh=Symbol("next"),ih=Symbol("prev"),fc=Symbol("events");class uw{constructor(t){H(this,"startTime");H(this,"endTime");H(this,"browserName");H(this,"channel");H(this,"platform");H(this,"wallTime");H(this,"title");H(this,"options");H(this,"pages");H(this,"actions");H(this,"events");H(this,"stdio");H(this,"errors");H(this,"errorDescriptors");H(this,"hasSource");H(this,"hasStepData");H(this,"sdkLanguage");H(this,"testIdAttributeName");H(this,"sources");H(this,"resources");t.forEach(r=>Sv(r));const n=t.find(r=>r.origin==="library");this.browserName=(n==null?void 0:n.browserName)||"",this.sdkLanguage=n==null?void 0:n.sdkLanguage,this.channel=n==null?void 0:n.channel,this.testIdAttributeName=n==null?void 0:n.testIdAttributeName,this.platform=(n==null?void 0:n.platform)||"",this.title=(n==null?void 0:n.title)||"",this.options=(n==null?void 0:n.options)||{},this.actions=Ev(t),this.pages=[].concat(...t.map(r=>r.pages)),this.wallTime=t.map(r=>r.wallTime).reduce((r,i)=>Math.min(r||Number.MAX_VALUE,i),Number.MAX_VALUE),this.startTime=t.map(r=>r.startTime).reduce((r,i)=>Math.min(r,i),Number.MAX_VALUE),this.endTime=t.map(r=>r.endTime).reduce((r,i)=>Math.max(r,i),Number.MIN_VALUE),this.events=[].concat(...t.map(r=>r.events)),this.stdio=[].concat(...t.map(r=>r.stdio)),this.errors=[].concat(...t.map(r=>r.errors)),this.hasSource=t.some(r=>r.hasSource),this.hasStepData=t.some(r=>r.origin==="testRunner"),this.resources=[...t.map(r=>r.resources)].flat(),this.events.sort((r,i)=>r.time-i.time),this.resources.sort((r,i)=>r._monotonicTime-i._monotonicTime),this.errorDescriptors=this.hasStepData?this._errorDescriptorsFromTestRunner():this._errorDescriptorsFromActions(),this.sources=Iv(this.actions,this.errorDescriptors)}failedAction(){return this.actions.findLast(t=>t.error)}_errorDescriptorsFromActions(){var n;const t=[];for(const r of this.actions||[])(n=r.error)!=null&&n.message&&t.push({action:r,stack:r.stack,message:r.error.message});return t}_errorDescriptorsFromTestRunner(){const t=[];for(const n of this.errors||[])n.message&&t.push({stack:n.stack,message:n.message});return t}}function Sv(e){for(const n of e.pages)n[wr]=e;for(let n=0;n=0;n--){const r=e.actions[n];r[rh]=t,r.apiName.includes("route.")||(t=r)}for(const n of e.events)n[wr]=e;for(const n of e.resources)n[wr]=e}function Ev(e){const t=new Map;for(const i of e){const s=i.traceUrl;let o=t.get(s);o||(o=[],t.set(s,o)),o.push(i)}const n=[];let r=0;for(const[,i]of t){t.size>1&&kv(i,++r);const s=Tv(i);n.push(...s)}n.sort((i,s)=>s.parentId===i.callId?-1:i.parentId===s.callId?1:i.startTime-s.startTime);for(let i=1;il.origin==="library"),r=e.filter(l=>l.origin==="testRunner");if(!r.length||!n.length)return e.map(l=>l.actions.map(a=>({...a,context:l}))).flat();const i=n.some(l=>l.actions.some(a=>!!a.stepId));for(const l of n)for(const a of l.actions){const u=i?a.stepId:`${a.apiName}@${a.wallTime}`;t.set(u,{...a,context:l})}const s=Nv(r,t,i);s&&Cv(n,s);const o=new Map;for(const l of r)for(const a of l.actions){const u=i?a.callId:`${a.apiName}@${a.wallTime}`,c=t.get(u);if(c){o.set(a.callId,c.callId),a.error&&(c.error=a.error),a.attachments&&(c.attachments=a.attachments),a.parentId&&(c.parentId=o.get(a.parentId)??a.parentId),c.startTime=a.startTime,c.endTime=a.endTime;continue}a.parentId&&(a.parentId=o.get(a.parentId)??a.parentId),t.set(u,{...a,context:l})}return[...t.values()]}function Cv(e,t){for(const n of e){n.startTime+=t,n.endTime+=t;for(const r of n.actions)r.startTime&&(r.startTime+=t),r.endTime&&(r.endTime+=t);for(const r of n.events)r.time+=t;for(const r of n.stdio)r.timestamp+=t;for(const r of n.pages)for(const i of r.screencastFrames)i.timestamp+=t;for(const r of n.resources)r._monotonicTime&&(r._monotonicTime+=t)}}function Nv(e,t,n){for(const r of e)for(const i of r.actions){if(!i.startTime)continue;const s=n?i.callId:`${i.apiName}@${i.wallTime}`,o=t.get(s);if(o)return i.startTime-o.startTime}return 0}function cw(e){const t=new Map;for(const r of e)t.set(r.callId,{id:r.callId,parent:void 0,children:[],action:r});const n={id:"",parent:void 0,children:[]};for(const r of t.values()){const i=r.action.parentId&&t.get(r.action.parentId)||n;i.children.push(r),r.parent=i}return{rootItem:n,itemMap:t}}function vs(e){return e[wr]}function bv(e){return e[rh]}function Av(e){return e[ih]}function dw(e){let t=0,n=0;for(const r of Lv(e)){if(r.type==="console"){const i=r.messageType;i==="warning"?++n:i==="error"&&++t}r.type==="event"&&r.method==="pageError"&&++t}return{errors:t,warnings:n}}function Lv(e){let t=e[fc];if(t)return t;const n=bv(e);return t=vs(e).events.filter(r=>r.time>=e.startTime&&(!n||r.time{const a=Math.max(i,e)*window.devicePixelRatio,[u,c]=ru(s?s+"."+r+":size":void 0,a),[f,d]=ru(s?s+"."+r+":size":void 0,a),[g,m]=M.useState(null),[y,_]=ks();let p;r==="vertical"?(p=f/window.devicePixelRatio,y&&y.heightm({offset:r==="vertical"?v.clientY:v.clientX,size:p}),onMouseUp:()=>m(null),onMouseMove:v=>{if(!v.buttons)m(null);else if(g){const E=(r==="vertical"?v.clientY:v.clientX)-g.offset,C=n?g.size+E:g.size-E,b=v.target.parentElement.getBoundingClientRect(),S=Math.min(Math.max(i,C),(r==="vertical"?b.height:b.width)-i);r==="vertical"?d(S*window.devicePixelRatio):c(S*window.devicePixelRatio)}}})]})};function Fs(e,t="'"){const n=JSON.stringify(e),r=n.substring(1,n.length-1).replace(/\\"/g,'"');if(t==="'")return t+r.replace(/[']/g,"\\'")+t;if(t==='"')return t+r.replace(/["]/g,'\\"')+t;if(t==="`")return t+r.replace(/[`]/g,"`")+t;throw new Error("Invalid escape char")}function ys(e){return e.charAt(0).toUpperCase()+e.substring(1)}function oh(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").toLowerCase()}function Ve(e){let t="";for(let n=0;n=1&&n<=31||n>=48&&n<=57&&(t===0||t===1&&e.charCodeAt(0)===45)?"\\"+n.toString(16)+" ":t===0&&n===45&&e.length===1?"\\"+e.charAt(t):n>=128||n===45||n===95||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122?e.charAt(t):"\\"+e.charAt(t)}let Jt;function Rv(){Jt=new Map}function ze(e){let t=Jt==null?void 0:Jt.get(e);return t===void 0&&(t=e.replace(/\u200b/g,"").trim().replace(/\s+/g," "),Jt==null||Jt.set(e,t)),t}function Hs(e){return e.replace(/(^|[^\\])(\\\\)*\\(['"`])/g,"$1$2$3")}function lh(e){return e.unicode||e.unicodeSets?String(e):String(e).replace(/(^|[^\\])(\\\\)*(["'`])/g,"$1$2\\$3").replace(/>>/g,"\\>\\>")}function qe(e,t){return typeof e!="string"?lh(e):`${JSON.stringify(e)}${t?"s":"i"}`}function xe(e,t){return typeof e!="string"?lh(e):`"${e.replace(/\\/g,"\\\\").replace(/["]/g,'\\"')}"${t?"s":"i"}`}function $v(e,t,n=""){if(e.length<=t)return e;const r=[...e];return r.length>t?r.slice(0,t-n.length).join("")+n:r.join("")}function hc(e,t){return $v(e,t,"…")}function bl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ov(e,t){const n=e.length,r=t.length;let i=0,s=0;const o=Array(n+1).fill(null).map(()=>Array(r+1).fill(0));for(let l=1;l<=n;l++)for(let a=1;a<=r;a++)e[l-1]===t[a-1]&&(o[l][a]=o[l-1][a-1]+1,o[l][a]>i&&(i=o[l][a],s=l));return e.slice(s-i,s)}const te=function(e,t,n){return e>=t&&e<=n};function Ce(e){return te(e,48,57)}function pc(e){return Ce(e)||te(e,65,70)||te(e,97,102)}function jv(e){return te(e,65,90)}function zv(e){return te(e,97,122)}function Dv(e){return jv(e)||zv(e)}function Fv(e){return e>=128}function Fi(e){return Dv(e)||Fv(e)||e===95}function gc(e){return Fi(e)||Ce(e)||e===45}function Hv(e){return te(e,0,8)||e===11||te(e,14,31)||e===127}function Hi(e){return e===10}function ft(e){return Hi(e)||e===9||e===32}const Uv=1114111;class Ra extends Error{constructor(t){super(t),this.name="InvalidCharacterError"}}function Vv(e){const t=[];for(let n=0;n=t.length?-1:t[T]},o=function(T){if(T===void 0&&(T=1),T>3)throw"Spec Error: no more than three codepoints of lookahead.";return s(n+T)},l=function(T){return T===void 0&&(T=1),n+=T,i=s(n),!0},a=function(){return n-=1,!0},u=function(T){return T===void 0&&(T=i),T===-1},c=function(){if(f(),l(),ft(i)){for(;ft(o());)l();return new Al}else{if(i===34)return m();if(i===35)if(gc(o())||p(o(1),o(2))){const T=new Sh("");return v(o(1),o(2),o(3))&&(T.type="id"),T.value=N(),T}else return new ge(i);else return i===36?o()===61?(l(),new Kv):new ge(i):i===39?m():i===40?new vh:i===41?new yh:i===42?o()===61?(l(),new Gv):new ge(i):i===43?C()?(a(),d()):new ge(i):i===44?new hh:i===45?C()?(a(),d()):o(1)===45&&o(2)===62?(l(2),new ch):x()?(a(),g()):new ge(i):i===46?C()?(a(),d()):new ge(i):i===58?new dh:i===59?new fh:i===60?o(1)===33&&o(2)===45&&o(3)===45?(l(3),new uh):new ge(i):i===64?v(o(1),o(2),o(3))?new xh(N()):new ge(i):i===91?new mh:i===92?h()?(a(),g()):new ge(i):i===93?new Ll:i===94?o()===61?(l(),new Qv):new ge(i):i===123?new ph:i===124?o()===61?(l(),new Wv):o()===124?(l(),new wh):new ge(i):i===125?new gh:i===126?o()===61?(l(),new qv):new ge(i):Ce(i)?(a(),d()):Fi(i)?(a(),g()):u()?new Vi:new ge(i)}},f=function(){for(;o(1)===47&&o(2)===42;)for(l(2);;)if(l(),i===42&&o()===47){l();break}else if(u())return},d=function(){const T=b();if(v(o(1),o(2),o(3))){const P=new Xv;return P.value=T.value,P.repr=T.repr,P.type=T.type,P.unit=N(),P}else if(o()===37){l();const P=new Ch;return P.value=T.value,P.repr=T.repr,P}else{const P=new Th;return P.value=T.value,P.repr=T.repr,P.type=T.type,P}},g=function(){const T=N();if(T.toLowerCase()==="url"&&o()===40){for(l();ft(o(1))&&ft(o(2));)l();return o()===34||o()===39?new Bi(T):ft(o())&&(o(2)===34||o(2)===39)?new Bi(T):y()}else return o()===40?(l(),new Bi(T)):new _h(T)},m=function(T){T===void 0&&(T=i);let P="";for(;l();){if(i===T||u())return new Eh(P);if(Hi(i))return a(),new ah;i===92?u(o())||(Hi(o())?l():P+=re(_())):P+=re(i)}throw new Error("Internal error")},y=function(){const T=new kh("");for(;ft(o());)l();if(u(o()))return T;for(;l();){if(i===41||u())return T;if(ft(i)){for(;ft(o());)l();return o()===41||u(o())?(l(),T):(I(),new Ui)}else{if(i===34||i===39||i===40||Hv(i))return I(),new Ui;if(i===92)if(h())T.value+=re(_());else return I(),new Ui;else T.value+=re(i)}}throw new Error("Internal error")},_=function(){if(l(),pc(i)){const T=[i];for(let J=0;J<5&&pc(o());J++)l(),T.push(i);ft(o())&&l();let P=parseInt(T.map(function(J){return String.fromCharCode(J)}).join(""),16);return P>Uv&&(P=65533),P}else return u()?65533:i},p=function(T,P){return!(T!==92||Hi(P))},h=function(){return p(i,o())},v=function(T,P,J){return T===45?Fi(P)||P===45||p(P,J):Fi(T)?!0:T===92?p(T,P):!1},x=function(){return v(i,o(1),o(2))},E=function(T,P,J){return T===43||T===45?!!(Ce(P)||P===46&&Ce(J)):T===46?!!Ce(P):!!Ce(T)},C=function(){return E(i,o(1),o(2))},N=function(){let T="";for(;l();)if(gc(i))T+=re(i);else if(h())T+=re(_());else return a(),T;throw new Error("Internal parse error")},b=function(){let T="",P="integer";for((o()===43||o()===45)&&(l(),T+=re(i));Ce(o());)l(),T+=re(i);if(o(1)===46&&Ce(o(2)))for(l(),T+=re(i),l(),T+=re(i),P="number";Ce(o());)l(),T+=re(i);const J=o(1),st=o(2),er=o(3);if((J===69||J===101)&&Ce(st))for(l(),T+=re(i),l(),T+=re(i),P="number";Ce(o());)l(),T+=re(i);else if((J===69||J===101)&&(st===43||st===45)&&Ce(er))for(l(),T+=re(i),l(),T+=re(i),l(),T+=re(i),P="number";Ce(o());)l(),T+=re(i);const tr=S(T);return{type:P,value:tr,repr:T}},S=function(T){return+T},I=function(){for(;l();){if(i===41||u())return;h()&&_()}};let O=0;for(;!u(o());)if(r.push(c()),O++,O>t.length*2)throw new Error("I'm infinite-looping!");return r}class ee{constructor(){this.tokenType=""}toJSON(){return{token:this.tokenType}}toString(){return this.tokenType}toSource(){return""+this}}class ah extends ee{constructor(){super(...arguments),this.tokenType="BADSTRING"}}class Ui extends ee{constructor(){super(...arguments),this.tokenType="BADURL"}}class Al extends ee{constructor(){super(...arguments),this.tokenType="WHITESPACE"}toString(){return"WS"}toSource(){return" "}}class uh extends ee{constructor(){super(...arguments),this.tokenType="CDO"}toSource(){return""}}class dh extends ee{constructor(){super(...arguments),this.tokenType=":"}}class fh extends ee{constructor(){super(...arguments),this.tokenType=";"}}class hh extends ee{constructor(){super(...arguments),this.tokenType=","}}class Jn extends ee{constructor(){super(...arguments),this.value="",this.mirror=""}}class ph extends Jn{constructor(){super(),this.tokenType="{",this.value="{",this.mirror="}"}}class gh extends Jn{constructor(){super(),this.tokenType="}",this.value="}",this.mirror="{"}}class mh extends Jn{constructor(){super(),this.tokenType="[",this.value="[",this.mirror="]"}}class Ll extends Jn{constructor(){super(),this.tokenType="]",this.value="]",this.mirror="["}}class vh extends Jn{constructor(){super(),this.tokenType="(",this.value="(",this.mirror=")"}}class yh extends Jn{constructor(){super(),this.tokenType=")",this.value=")",this.mirror="("}}class qv extends ee{constructor(){super(...arguments),this.tokenType="~="}}class Wv extends ee{constructor(){super(...arguments),this.tokenType="|="}}class Qv extends ee{constructor(){super(...arguments),this.tokenType="^="}}class Kv extends ee{constructor(){super(...arguments),this.tokenType="$="}}class Gv extends ee{constructor(){super(...arguments),this.tokenType="*="}}class wh extends ee{constructor(){super(...arguments),this.tokenType="||"}}class Vi extends ee{constructor(){super(...arguments),this.tokenType="EOF"}toSource(){return""}}class ge extends ee{constructor(t){super(),this.tokenType="DELIM",this.value="",this.value=re(t)}toString(){return"DELIM("+this.value+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t}toSource(){return this.value==="\\"?`\\ +`:this.value}}class Yn extends ee{constructor(){super(...arguments),this.value=""}ASCIIMatch(t){return this.value.toLowerCase()===t.toLowerCase()}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t}}class _h extends Yn{constructor(t){super(),this.tokenType="IDENT",this.value=t}toString(){return"IDENT("+this.value+")"}toSource(){return ti(this.value)}}class Bi extends Yn{constructor(t){super(),this.tokenType="FUNCTION",this.value=t,this.mirror=")"}toString(){return"FUNCTION("+this.value+")"}toSource(){return ti(this.value)+"("}}class xh extends Yn{constructor(t){super(),this.tokenType="AT-KEYWORD",this.value=t}toString(){return"AT("+this.value+")"}toSource(){return"@"+ti(this.value)}}class Sh extends Yn{constructor(t){super(),this.tokenType="HASH",this.value=t,this.type="unrestricted"}toString(){return"HASH("+this.value+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t.type=this.type,t}toSource(){return this.type==="id"?"#"+ti(this.value):"#"+Jv(this.value)}}class Eh extends Yn{constructor(t){super(),this.tokenType="STRING",this.value=t}toString(){return'"'+Nh(this.value)+'"'}}class kh extends Yn{constructor(t){super(),this.tokenType="URL",this.value=t}toString(){return"URL("+this.value+")"}toSource(){return'url("'+Nh(this.value)+'")'}}class Th extends ee{constructor(){super(),this.tokenType="NUMBER",this.type="integer",this.repr=""}toString(){return this.type==="integer"?"INT("+this.value+")":"NUMBER("+this.value+")"}toJSON(){const t=super.toJSON();return t.value=this.value,t.type=this.type,t.repr=this.repr,t}toSource(){return this.repr}}class Ch extends ee{constructor(){super(),this.tokenType="PERCENTAGE",this.repr=""}toString(){return"PERCENTAGE("+this.value+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t.repr=this.repr,t}toSource(){return this.repr+"%"}}class Xv extends ee{constructor(){super(),this.tokenType="DIMENSION",this.type="integer",this.repr="",this.unit=""}toString(){return"DIM("+this.value+","+this.unit+")"}toJSON(){const t=this.constructor.prototype.constructor.prototype.toJSON.call(this);return t.value=this.value,t.type=this.type,t.repr=this.repr,t.unit=this.unit,t}toSource(){const t=this.repr;let n=ti(this.unit);return n[0].toLowerCase()==="e"&&(n[1]==="-"||te(n.charCodeAt(1),48,57))&&(n="\\65 "+n.slice(1,n.length)),t+n}}function ti(e){e=""+e;let t="";const n=e.charCodeAt(0);for(let r=0;r=128||i===45||i===95||te(i,48,57)||te(i,65,90)||te(i,97,122)?t+=e[r]:t+="\\"+e[r]}return t}function Jv(e){e=""+e;let t="";for(let n=0;n=128||r===45||r===95||te(r,48,57)||te(r,65,90)||te(r,97,122)?t+=e[n]:t+="\\"+r.toString(16)+" "}return t}function Nh(e){e=""+e;let t="";for(let n=0;nS instanceof xh||S instanceof ah||S instanceof Ui||S instanceof wh||S instanceof uh||S instanceof ch||S instanceof fh||S instanceof ph||S instanceof gh||S instanceof kh||S instanceof Ch);if(r)throw new be(`Unsupported token "${r.toSource()}" while parsing selector "${e}"`);let i=0;const s=new Set;function o(){return new be(`Unexpected token "${n[i].toSource()}" while parsing selector "${e}"`)}function l(){for(;n[i]instanceof Al;)i++}function a(S=i){return n[S]instanceof _h}function u(S=i){return n[S]instanceof Eh}function c(S=i){return n[S]instanceof Th}function f(S=i){return n[S]instanceof hh}function d(S=i){return n[S]instanceof vh}function g(S=i){return n[S]instanceof yh}function m(S=i){return n[S]instanceof Bi}function y(S=i){return n[S]instanceof ge&&n[S].value==="*"}function _(S=i){return n[S]instanceof Vi}function p(S=i){return n[S]instanceof ge&&[">","+","~"].includes(n[S].value)}function h(S=i){return f(S)||g(S)||_(S)||p(S)||n[S]instanceof Al}function v(){const S=[x()];for(;l(),!!f();)i++,S.push(x());return S}function x(){return l(),c()||u()?n[i++].value:E()}function E(){const S={simples:[]};for(l(),p()?S.simples.push({selector:{functions:[{name:"scope",args:[]}]},combinator:""}):S.simples.push({selector:C(),combinator:""});;){if(l(),p())S.simples[S.simples.length-1].combinator=n[i++].value,l();else if(h())break;S.simples.push({combinator:"",selector:C()})}return S}function C(){let S="";const I=[];for(;!h();)if(a()||y())S+=n[i++].toSource();else if(n[i]instanceof Sh)S+=n[i++].toSource();else if(n[i]instanceof ge&&n[i].value===".")if(i++,a())S+="."+n[i++].toSource();else throw o();else if(n[i]instanceof dh)if(i++,a())if(!t.has(n[i].value.toLowerCase()))S+=":"+n[i++].toSource();else{const O=n[i++].value.toLowerCase();I.push({name:O,args:[]}),s.add(O)}else if(m()){const O=n[i++].value.toLowerCase();if(t.has(O)?(I.push({name:O,args:v()}),s.add(O)):S+=`:${O}(${N()})`,l(),!g())throw o();i++}else throw o();else if(n[i]instanceof mh){for(S+="[",i++;!(n[i]instanceof Ll)&&!_();)S+=n[i++].toSource();if(!(n[i]instanceof Ll))throw o();S+="]",i++}else throw o();if(!S&&!I.length)throw o();return{css:S||void 0,functions:I}}function N(){let S="",I=1;for(;!_()&&((d()||m())&&I++,g()&&I--,!!I);)S+=n[i++].toSource();return S}const b=v();if(!_())throw o();if(b.some(S=>typeof S!="object"||!("simples"in S)))throw new be(`Error while parsing selector "${e}"`);return{selector:b,names:Array.from(s)}}const Il=new Set(["internal:has","internal:has-not","internal:and","internal:or","internal:chain","left-of","right-of","above","below","near"]),Zv=new Set(["left-of","right-of","above","below","near"]),bh=new Set(["not","is","where","has","scope","light","visible","text","text-matches","text-is","has-text","above","below","right-of","left-of","near","nth-match"]);function Us(e){const t=n0(e),n=[];for(const r of t.parts){if(r.name==="css"||r.name==="css:light"){r.name==="css:light"&&(r.body=":light("+r.body+")");const i=Yv(r.body,bh);n.push({name:"css",body:i.selector,source:r.body});continue}if(Il.has(r.name)){let i,s;try{const u=JSON.parse("["+r.body+"]");if(!Array.isArray(u)||u.length<1||u.length>2||typeof u[0]!="string")throw new be(`Malformed selector: ${r.name}=`+r.body);if(i=u[0],u.length===2){if(typeof u[1]!="number"||!Zv.has(r.name))throw new be(`Malformed selector: ${r.name}=`+r.body);s=u[1]}}catch{throw new be(`Malformed selector: ${r.name}=`+r.body)}const o={name:r.name,source:r.body,body:{parsed:Us(i),distance:s}},l=[...o.body.parsed.parts].reverse().find(u=>u.name==="internal:control"&&u.body==="enter-frame"),a=l?o.body.parsed.parts.indexOf(l):-1;a!==-1&&e0(o.body.parsed.parts.slice(0,a+1),n.slice(0,a+1))&&o.body.parsed.parts.splice(0,a+1),n.push(o);continue}n.push({...r,source:r.body})}if(Il.has(n[0].name))throw new be(`"${n[0].name}" selector cannot be first`);return{capture:t.capture,parts:n}}function e0(e,t){return yt({parts:e})===yt({parts:t})}function yt(e,t){return typeof e=="string"?e:e.parts.map((n,r)=>{let i=!0;!t&&r!==e.capture&&(n.name==="css"||n.name==="xpath"&&n.source.startsWith("//")||n.source.startsWith(".."))&&(i=!1);const s=i?n.name+"=":"";return`${r===e.capture?"*":""}${s}${n.source}`}).join(" >> ")}function t0(e,t){const n=(r,i)=>{for(const s of r.parts)t(s,i),Il.has(s.name)&&n(s.body.parsed,!0)};n(e,!1)}function n0(e){let t=0,n,r=0;const i={parts:[]},s=()=>{const l=e.substring(r,t).trim(),a=l.indexOf("=");let u,c;a!==-1&&l.substring(0,a).trim().match(/^[a-zA-Z_0-9-+:*]+$/)?(u=l.substring(0,a).trim(),c=l.substring(a+1)):l.length>1&&l[0]==='"'&&l[l.length-1]==='"'||l.length>1&&l[0]==="'"&&l[l.length-1]==="'"?(u="text",c=l):/^\(*\/\//.test(l)||l.startsWith("..")?(u="xpath",c=l):(u="css",c=l);let f=!1;if(u[0]==="*"&&(f=!0,u=u.substring(1)),i.parts.push({name:u,body:c}),f){if(i.capture!==void 0)throw new be("Only one of the selectors can capture using * modifier");i.capture=i.parts.length-1}};if(!e.includes(">>"))return t=e.length,s(),i;const o=()=>{const a=e.substring(r,t).match(/^\s*text\s*=(.*)$/);return!!a&&!!a[1]};for(;t"&&e[t+1]===">"?(s(),t+=2,r=t):t++}return s(),i}function on(e,t){let n=0,r=e.length===0;const i=()=>e[n]||"",s=()=>{const _=i();return++n,r=n>=e.length,_},o=_=>{throw r?new be(`Unexpected end of selector while parsing selector \`${e}\``):new be(`Error while parsing selector \`${e}\` - unexpected symbol "${i()}" at position ${n}`+(_?" during "+_:""))};function l(){for(;!r&&/\s/.test(i());)s()}function a(_){return _>="€"||_>="0"&&_<="9"||_>="A"&&_<="Z"||_>="a"&&_<="z"||_>="0"&&_<="9"||_==="_"||_==="-"}function u(){let _="";for(l();!r&&a(i());)_+=s();return _}function c(_){let p=s();for(p!==_&&o("parsing quoted string");!r&&i()!==_;)i()==="\\"&&s(),p+=s();return i()!==_&&o("parsing quoted string"),p+=s(),p}function f(){s()!=="/"&&o("parsing regular expression");let _="",p=!1;for(;!r;){if(i()==="\\")_+=s(),r&&o("parsing regular expression");else if(p&&i()==="]")p=!1;else if(!p&&i()==="[")p=!0;else if(!p&&i()==="/")break;_+=s()}s()!=="/"&&o("parsing regular expression");let h="";for(;!r&&i().match(/[dgimsuy]/);)h+=s();try{return new RegExp(_,h)}catch(v){throw new be(`Error while parsing selector \`${e}\`: ${v.message}`)}}function d(){let _="";return l(),i()==="'"||i()==='"'?_=c(i()).slice(1,-1):_=u(),_||o("parsing property path"),_}function g(){l();let _="";return r||(_+=s()),!r&&_!=="="&&(_+=s()),["=","*=","^=","$=","|=","~="].includes(_)||o("parsing operator"),_}function m(){s();const _=[];for(_.push(d()),l();i()===".";)s(),_.push(d()),l();if(i()==="]")return s(),{name:_.join("."),jsonPath:_,op:"",value:null,caseSensitive:!1};const p=g();let h,v=!0;if(l(),i()==="/"){if(p!=="=")throw new be(`Error while parsing selector \`${e}\` - cannot use ${p} in attribute with regular expression`);h=f()}else if(i()==="'"||i()==='"')h=c(i()).slice(1,-1),l(),i()==="i"||i()==="I"?(v=!1,s()):(i()==="s"||i()==="S")&&(v=!0,s());else{for(h="";!r&&(a(i())||i()==="+"||i()===".");)h+=s();h==="true"?h=!0:h==="false"?h=!1:t||(h=+h,Number.isNaN(h)&&o("parsing attribute value"))}if(l(),i()!=="]"&&o("parsing attribute value"),s(),p!=="="&&typeof h!="string")throw new be(`Error while parsing selector \`${e}\` - cannot use ${p} in attribute with non-string matching value - ${h}`);return{name:_.join("."),jsonPath:_,op:p,value:h,caseSensitive:v}}const y={name:"",attributes:[]};for(y.name=u(),l();i()==="[";)y.attributes.push(m()),l();if(r||o(void 0),!y.name&&!y.attributes.length)throw new be(`Error while parsing selector \`${e}\` - selector cannot be empty`);return y}function Fn(e,t,n=!1){return Ah(e,t,n)[0]}function Ah(e,t,n=!1,r=20,i){try{return _n(new u0[e](i),Us(t),n,r)}catch{return[t]}}function _n(e,t,n=!1,r=20){const i=[...t.parts],s=[];let o=n?"frame-locator":"page";for(let l=0;le.generateLocator(u,"has",y)));continue}if(a.name==="internal:has-not"){const m=_n(e,a.body.parsed,!1,r);s.push(m.map(y=>e.generateLocator(u,"hasNot",y)));continue}if(a.name==="internal:and"){const m=_n(e,a.body.parsed,!1,r);s.push(m.map(y=>e.generateLocator(u,"and",y)));continue}if(a.name==="internal:or"){const m=_n(e,a.body.parsed,!1,r);s.push(m.map(y=>e.generateLocator(u,"or",y)));continue}if(a.name==="internal:chain"){const m=_n(e,a.body.parsed,!1,r);s.push(m.map(y=>e.generateLocator(u,"chain",y)));continue}if(a.name==="internal:label"){const{exact:m,text:y}=dr(a.body);s.push([e.generateLocator(u,"label",y,{exact:m})]);continue}if(a.name==="internal:role"){const m=on(a.body,!0),y={attrs:[]};for(const _ of m.attributes)_.name==="name"?(y.exact=_.caseSensitive,y.name=_.value):(_.name==="level"&&typeof _.value=="string"&&(_.value=+_.value),y.attrs.push({name:_.name==="include-hidden"?"includeHidden":_.name,value:_.value}));s.push([e.generateLocator(u,"role",m.name,y)]);continue}if(a.name==="internal:testid"){const m=on(a.body,!0),{value:y}=m.attributes[0];s.push([e.generateLocator(u,"test-id",y)]);continue}if(a.name==="internal:attr"){const m=on(a.body,!0),{name:y,value:_,caseSensitive:p}=m.attributes[0],h=_,v=!!p;if(y==="placeholder"){s.push([e.generateLocator(u,"placeholder",h,{exact:v})]);continue}if(y==="alt"){s.push([e.generateLocator(u,"alt",h,{exact:v})]);continue}if(y==="title"){s.push([e.generateLocator(u,"title",h,{exact:v})]);continue}}if(a.name==="internal:control"&&a.body==="enter-frame"){const m=s[s.length-1],y=i[l-1],_=m.map(p=>e.chainLocators([p,e.generateLocator(u,"frame","")]));["xpath","css"].includes(y.name)&&_.push(e.generateLocator(u,"frame-locator",yt({parts:[y]})),e.generateLocator(u,"frame-locator",yt({parts:[y]},!0))),m.splice(0,m.length,..._),o="frame-locator";continue}const c=i[l+1],f=yt({parts:[a]}),d=e.generateLocator(u,"default",f);if(c&&["internal:has-text","internal:has-not-text"].includes(c.name)){const{exact:m,text:y}=dr(c.body);if(!m){const _=e.generateLocator("locator",c.name==="internal:has-text"?"has-text":"has-not-text",y,{exact:m}),p={};c.name==="internal:has-text"?p.hasText=y:p.hasNotText=y;const h=e.generateLocator(u,"default",f,p);s.push([e.chainLocators([d,_]),h]),l++;continue}}let g;if(["xpath","css"].includes(a.name)){const m=yt({parts:[a]},!0);g=e.generateLocator(u,"default",m)}s.push([d,g].filter(Boolean))}return r0(e,s,r)}function r0(e,t,n){const r=t.map(()=>""),i=[],s=o=>{if(o===t.length)return i.push(e.chainLocators(r)),r.lengthJSON.parse(r));for(let r=0;r{const[n,r]=M.useState("copy"),i=M.useCallback(()=>{(typeof e=="function"?e():Promise.resolve(e)).then(o=>{navigator.clipboard.writeText(o).then(()=>{r("check"),setTimeout(()=>{r("copy")},3e3)},()=>{r("close")})},()=>{r("close")})},[e]);return w.jsx(fn,{title:t||"Copy",icon:n,onClick:i})},mc=({value:e,description:t})=>{const n=M.useCallback(async()=>{const r=typeof e=="function"?await e():e;await navigator.clipboard.writeText(r)},[e]);return w.jsx(fn,{title:t,onClick:n,className:"copy-to-clipboard-text-button",children:t})},Lh=({text:e})=>w.jsx("div",{className:"fill",style:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:24,fontWeight:"bold",opacity:.5},children:e}),vc=new Map;function $a({name:e,items:t=[],id:n,render:r,icon:i,isError:s,isWarning:o,isInfo:l,selectedItem:a,onAccepted:u,onSelected:c,onHighlighted:f,onIconClicked:d,noItemsMessage:g,dataTestId:m,notSelectable:y}){const _=M.useRef(null),[p,h]=M.useState();return M.useEffect(()=>{f==null||f(p)},[f,p]),M.useEffect(()=>{const v=_.current;if(!v)return;const x=()=>{vc.set(e,v.scrollTop)};return v.addEventListener("scroll",x,{passive:!0}),()=>v.removeEventListener("scroll",x)},[e]),M.useEffect(()=>{_.current&&(_.current.scrollTop=vc.get(e)||0)},[e]),w.jsx("div",{className:tt("list-view vbox",e+"-list-view"),role:t.length>0?"list":void 0,"data-testid":m||e+"-list",children:w.jsxs("div",{className:tt("list-view-content",y&&"not-selectable"),tabIndex:0,onKeyDown:v=>{var N;if(a&&v.key==="Enter"){u==null||u(a,t.indexOf(a));return}if(v.key!=="ArrowDown"&&v.key!=="ArrowUp")return;v.stopPropagation(),v.preventDefault();const x=a?t.indexOf(a):-1;let E=x;v.key==="ArrowDown"&&(x===-1?E=0:E=Math.min(x+1,t.length-1)),v.key==="ArrowUp"&&(x===-1?E=t.length-1:E=Math.max(x-1,0));const C=(N=_.current)==null?void 0:N.children.item(E);pg(C||void 0),f==null||f(void 0),c==null||c(t[E],E),h(void 0)},ref:_,children:[g&&t.length===0&&w.jsx("div",{className:"list-view-empty",children:g}),t.map((v,x)=>{const E=r(v,x);return w.jsxs("div",{onDoubleClick:()=>u==null?void 0:u(v,x),role:"listitem",className:tt("list-view-entry",a===v&&"selected",!y&&p===v&&"highlighted",(s==null?void 0:s(v,x))&&"error",(o==null?void 0:o(v,x))&&"warning",(l==null?void 0:l(v,x))&&"info"),onClick:()=>c==null?void 0:c(v,x),onMouseEnter:()=>h(v),onMouseLeave:()=>h(void 0),children:[i&&w.jsx("div",{className:"codicon "+(i(v,x)||"codicon-blank"),style:{minWidth:16,marginRight:4},onDoubleClick:C=>{C.preventDefault(),C.stopPropagation()},onClick:C=>{C.stopPropagation(),C.preventDefault(),d==null||d(v,x)}}),typeof E=="string"?w.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:E}):E]},(n==null?void 0:n(v,x))||x)})]})})}function ws(e,t){const n=/(\x1b\[(\d+(;\d+)*)m)|([^\x1b]+)/g,r=[];let i,s={},o=!1,l=t==null?void 0:t.fg,a=t==null?void 0:t.bg;for(;(i=n.exec(e))!==null;){const[,,u,,c]=i;if(u){const f=+u;switch(f){case 0:s={};break;case 1:s["font-weight"]="bold";break;case 2:s.opacity="0.8";break;case 3:s["font-style"]="italic";break;case 4:s["text-decoration"]="underline";break;case 7:o=!0;break;case 8:s.display="none";break;case 9:s["text-decoration"]="line-through";break;case 22:delete s["font-weight"],delete s["font-style"],delete s.opacity,delete s["text-decoration"];break;case 23:delete s["font-weight"],delete s["font-style"],delete s.opacity;break;case 24:delete s["text-decoration"];break;case 27:o=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:l=yc[f-30];break;case 39:l=t==null?void 0:t.fg;break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:a=yc[f-40];break;case 49:a=t==null?void 0:t.bg;break;case 53:s["text-decoration"]="overline";break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:l=wc[f-90];break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:a=wc[f-100];break}}else if(c){const f={...s},d=o?a:l;d!==void 0&&(f.color=d);const g=o?l:a;g!==void 0&&(f["background-color"]=g),r.push(`${d0(c)}`)}}return r.join("")}const yc={0:"var(--vscode-terminal-ansiBlack)",1:"var(--vscode-terminal-ansiRed)",2:"var(--vscode-terminal-ansiGreen)",3:"var(--vscode-terminal-ansiYellow)",4:"var(--vscode-terminal-ansiBlue)",5:"var(--vscode-terminal-ansiMagenta)",6:"var(--vscode-terminal-ansiCyan)",7:"var(--vscode-terminal-ansiWhite)"},wc={0:"var(--vscode-terminal-ansiBrightBlack)",1:"var(--vscode-terminal-ansiBrightRed)",2:"var(--vscode-terminal-ansiBrightGreen)",3:"var(--vscode-terminal-ansiBrightYellow)",4:"var(--vscode-terminal-ansiBrightBlue)",5:"var(--vscode-terminal-ansiBrightMagenta)",6:"var(--vscode-terminal-ansiBrightCyan)",7:"var(--vscode-terminal-ansiBrightWhite)"};function d0(e){return e.replace(/[&"<>]/g,t=>({"&":"&",'"':""","<":"<",">":">"})[t])}function f0(e){return Object.entries(e).map(([t,n])=>`${t}: ${n}`).join("; ")}const h0=$a;function fw(e,t){const{entries:n}=M.useMemo(()=>{if(!e)return{entries:[]};const i=[];for(const s of e.events){if(s.type==="console"){const o=s.args&&s.args.length?p0(s.args):Ih(s.text),l=s.location.url,u=`${l?l.substring(l.lastIndexOf("/")+1):""}:${s.location.lineNumber}`;i.push({browserMessage:{body:o,location:u},isError:s.messageType==="error",isWarning:s.messageType==="warning",timestamp:s.time})}s.type==="event"&&s.method==="pageError"&&i.push({browserError:s.params.error,isError:!0,isWarning:!1,timestamp:s.time})}for(const s of e.stdio){let o="";s.text&&(o=ws(s.text.trim())||""),s.base64&&(o=ws(atob(s.base64).trim())||""),i.push({nodeMessage:{html:o},isError:s.type==="stderr",isWarning:!1,timestamp:s.timestamp})}return i.sort((s,o)=>s.timestamp-o.timestamp),{entries:i}},[e]);return{entries:M.useMemo(()=>t?n.filter(i=>i.timestamp>=t.minimum&&i.timestamp<=t.maximum):n,[n,t])}}const hw=({consoleModel:e,boundaries:t,onEntryHovered:n,onAccepted:r})=>e.entries.length?w.jsx("div",{className:"console-tab",children:w.jsx(h0,{name:"console",onAccepted:r,onHighlighted:n,items:e.entries,isError:i=>i.isError,isWarning:i=>i.isWarning,render:i=>{const s=Ro(i.timestamp-t.minimum),o=w.jsx("span",{className:"console-time",children:s}),l=i.isError?"status-error":i.isWarning?"status-warning":"status-none",a=i.browserMessage||i.browserError?w.jsx("span",{className:tt("codicon","codicon-browser",l),title:"Browser message"}):w.jsx("span",{className:tt("codicon","codicon-file",l),title:"Runner message"});let u,c,f,d;const{browserMessage:g,browserError:m,nodeMessage:y}=i;if(g&&(u=g.location,c=g.body),m){const{error:_,value:p}=m;_?(c=_.message,d=_.stack):c=String(p)}return y&&(f=y.html),w.jsxs("div",{className:"console-line",children:[o,a,u&&w.jsx("span",{className:"console-location",children:u}),c&&w.jsx("span",{className:"console-line-message",children:c}),f&&w.jsx("span",{className:"console-line-message",dangerouslySetInnerHTML:{__html:f}}),d&&w.jsx("div",{className:"console-stack",children:d})]})}})}):w.jsx(Lh,{text:"No console entries"});function p0(e){if(e.length===1)return Ih(e[0].preview);const t=typeof e[0].value=="string"&&e[0].value.includes("%"),n=t?e[0].value:"",r=t?e.slice(1):e;let i=0;const s=/%([%sdifoOc])/g;let o;const l=[];let a=[];l.push(w.jsx("span",{children:a}));let u=0;for(;(o=s.exec(n))!==null;){const c=n.substring(u,o.index);a.push(w.jsx("span",{children:c})),u=o.index+2;const f=o[0][1];if(f==="%")a.push(w.jsx("span",{children:"%"}));else if(f==="s"||f==="o"||f==="O"||f==="d"||f==="i"||f==="f"){const d=r[i++],g={};typeof(d==null?void 0:d.value)!="string"&&(g.color="var(--vscode-debugTokenExpression-number)"),a.push(w.jsx("span",{style:g,children:(d==null?void 0:d.preview)||""}))}else if(f==="c"){a=[];const d=r[i++],g=d?g0(d.preview):{};l.push(w.jsx("span",{style:g,children:a}))}}for(ua[1].toUpperCase());t[l]=o}return t}catch{return{}}}function m0(e){return["background","border","color","font","line","margin","padding","text"].some(n=>e.startsWith(n))}const Oa=({noShadow:e,children:t,noMinHeight:n,className:r,sidebarBackground:i,onClick:s})=>w.jsx("div",{className:tt("toolbar",e&&"no-shadow",n&&"no-min-height",r,i&&"toolbar-sidebar-background"),onClick:s,children:t}),v0=({tabs:e,selectedTab:t,setSelectedTab:n,leftToolbar:r,rightToolbar:i,dataTestId:s,mode:o})=>{const l=M.useId();return t||(t=e[0].id),o||(o="default"),w.jsx("div",{className:"tabbed-pane","data-testid":s,children:w.jsxs("div",{className:"vbox",children:[w.jsxs(Oa,{children:[r&&w.jsxs("div",{style:{flex:"none",display:"flex",margin:"0 4px",alignItems:"center"},children:[...r]}),o==="default"&&w.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",children:[...e.map(a=>w.jsx(Mh,{id:a.id,ariaControls:`${l}-${a.id}`,title:a.title,count:a.count,errorCount:a.errorCount,selected:t===a.id,onSelect:n},a.id))]}),o==="select"&&w.jsx("div",{style:{flex:"auto",display:"flex",height:"100%",overflow:"hidden"},role:"tablist",children:w.jsx("select",{style:{width:"100%",background:"none",cursor:"pointer"},onChange:a=>{n==null||n(e[a.currentTarget.selectedIndex].id)},children:e.map(a=>{let u="";return a.count&&(u=` (${a.count})`),a.errorCount&&(u=` (${a.errorCount})`),w.jsxs("option",{value:a.id,selected:a.id===t,role:"tab","aria-controls":`${l}-${a.id}`,children:[a.title,u]},a.id)})})}),i&&w.jsxs("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:[...i]})]}),e.map(a=>{const u="tab-content tab-"+a.id;if(a.component)return w.jsx("div",{id:`${l}-${a.id}`,role:"tabpanel","aria-label":a.title,className:u,style:{display:t===a.id?"inherit":"none"},children:a.component},a.id);if(t===a.id)return w.jsx("div",{id:`${l}-${a.id}`,role:"tabpanel","aria-label":a.title,className:u,children:a.render()},a.id)})]})})},Mh=({id:e,title:t,count:n,errorCount:r,selected:i,onSelect:s,ariaControls:o})=>w.jsxs("div",{className:tt("tabbed-pane-tab",i&&"selected"),onClick:()=>s==null?void 0:s(e),role:"tab",title:t,"aria-controls":o,children:[w.jsx("div",{className:"tabbed-pane-tab-label",children:t}),!!n&&w.jsx("div",{className:"tabbed-pane-tab-counter",children:n}),!!r&&w.jsx("div",{className:"tabbed-pane-tab-counter error",children:r})]}),y0="modulepreload",w0=function(e,t){return new URL(e,t).href},_c={},_0=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),a=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=w0(u,r),u in _c)return;_c[u]=!0;const c=u.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(!!r)for(let m=o.length-1;m>=0;m--){const y=o[m];if(y.href===u&&(!c||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${f}`))return;const g=document.createElement("link");if(g.rel=c?"stylesheet":y0,c||(g.as="script"),g.crossOrigin="",g.href=u,a&&g.setAttribute("nonce",a),document.head.appendChild(g),c)return new Promise((m,y)=>{g.addEventListener("load",m),g.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})},pw=20,Vs=({text:e,language:t,mimeType:n,linkify:r,readOnly:i,highlight:s,revealLine:o,lineNumbers:l,isFocused:a,focusOnChange:u,wrapLines:c,onChange:f,dataTestId:d,placeholder:g})=>{const[m,y]=ks(),[_]=M.useState(_0(()=>import("./codeMirrorModule-BBCX0spr.js"),__vite__mapDeps([0,1]),import.meta.url).then(x=>x.default)),p=M.useRef(null),[h,v]=M.useState();return M.useEffect(()=>{(async()=>{var b,S;const x=await _;S0(x);const E=y.current;if(!E)return;const C=k0(t)||E0(n)||(r?"text/linkified":"");if(p.current&&C===p.current.cm.getOption("mode")&&!!i===p.current.cm.getOption("readOnly")&&l===p.current.cm.getOption("lineNumbers")&&c===p.current.cm.getOption("lineWrapping")&&g===p.current.cm.getOption("placeholder"))return;(S=(b=p.current)==null?void 0:b.cm)==null||S.getWrapperElement().remove();const N=x(E,{value:"",mode:C,readOnly:!!i,lineNumbers:l,lineWrapping:c,placeholder:g});return p.current={cm:N},a&&N.focus(),v(N),N})()},[_,h,y,t,n,r,l,c,i,a,g]),M.useEffect(()=>{p.current&&p.current.cm.setSize(m.width,m.height)},[m]),M.useLayoutEffect(()=>{var C;if(!h)return;let x=!1;if(h.getValue()!==e&&(h.setValue(e),x=!0,u&&(h.execCommand("selectAll"),h.focus())),x||JSON.stringify(s)!==JSON.stringify(p.current.highlight)){for(const S of p.current.highlight||[])h.removeLineClass(S.line-1,"wrap");for(const S of s||[])h.addLineClass(S.line-1,"wrap",`source-line-${S.type}`);for(const S of p.current.widgets||[])h.removeLineWidget(S);for(const S of p.current.markers||[])S.clear();const N=[],b=[];for(const S of s||[]){if(S.type!=="subtle-error"&&S.type!=="error")continue;const I=(C=p.current)==null?void 0:C.cm.getLine(S.line-1);if(I){const O={};O.title=S.message||"",b.push(h.markText({line:S.line-1,ch:0},{line:S.line-1,ch:S.column||I.length},{className:"source-line-error-underline",attributes:O}))}if(S.type==="error"){const O=document.createElement("div");O.innerHTML=ws(S.message||""),O.className="source-line-error-widget",N.push(h.addLineWidget(S.line,O,{above:!0,coverGutter:!1}))}}p.current.highlight=s,p.current.widgets=N,p.current.markers=b}typeof o=="number"&&p.current.cm.lineCount()>=o&&h.scrollIntoView({line:Math.max(0,o-1),ch:0},50);let E;return f&&(E=()=>f(h.getValue()),h.on("change",E)),()=>{E&&h.off("change",E)}},[h,e,s,o,u,f]),w.jsx("div",{"data-testid":d,className:"cm-wrapper",ref:y,onClick:x0})};function x0(e){var n;if(!(e.target instanceof HTMLElement))return;let t;e.target.classList.contains("cm-linkified")?t=e.target.textContent:e.target.classList.contains("cm-link")&&((n=e.target.nextElementSibling)!=null&&n.classList.contains("cm-url"))&&(t=e.target.nextElementSibling.textContent.slice(1,-1)),t&&(e.preventDefault(),e.stopPropagation(),window.open(t,"_blank"))}let xc=!1;function S0(e){xc||(xc=!0,e.defineSimpleMode("text/linkified",{start:[{regex:gg,token:"linkified"}]}))}function E0(e){if(e){if(e.includes("javascript")||e.includes("json"))return"javascript";if(e.includes("python"))return"python";if(e.includes("csharp"))return"text/x-csharp";if(e.includes("java"))return"text/x-java";if(e.includes("markdown"))return"markdown";if(e.includes("html")||e.includes("svg"))return"htmlmixed";if(e.includes("css"))return"css"}}function k0(e){if(e)return{javascript:"javascript",jsonl:"javascript",python:"python",csharp:"text/x-csharp",java:"text/x-java",markdown:"markdown",html:"htmlmixed",css:"css",yaml:"yaml"}[e]}async function T0(e){const t=navigator.platform.includes("Win")?"win":"unix";let n=[];const r=new Set(["accept-encoding","host","method","path","scheme","version","authority","protocol"]);function i(f){const d='^"';return d+f.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/[^a-zA-Z0-9\s_\-:=+~'\/.',?;()*`]/g,"^$&").replace(/%(?=[a-zA-Z0-9_])/g,"%^").replace(/\r?\n/g,`^ + +`)+d}function s(f){function d(g){let y=g.charCodeAt(0).toString(16);for(;y.length<4;)y="0"+y;return"\\u"+y}return/[\0-\x1F\x7F-\x9F!]|\'/.test(f)?"$'"+f.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\0-\x1F\x7F-\x9F!]/g,d)+"'":"'"+f+"'"}const o=t==="win"?i:s;n.push(o(e.request.url).replace(/[[{}\]]/g,"\\$&"));let l="GET";const a=[],u=await Ph(e);u&&(a.push("--data-raw "+o(u)),r.add("content-length"),l="POST"),e.request.method!==l&&n.push("-X "+o(e.request.method));const c=e.request.headers;for(let f=0;f=3?t==="win"?` ^ + `:` \\ + `:" ")}async function C0(e,t=0){const n=new Set(["method","path","scheme","version","accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via","user-agent"]),r=new Set(["cookie","authorization"]),i=JSON.stringify(e.request.url),s=e.request.headers,o=s.reduce((m,y)=>{const _=y.name;return!n.has(_.toLowerCase())&&!_.includes(":")&&m.append(_,y.value),m},new Headers),l={};for(const m of o)l[m[0]]=m[1];const a=e.request.cookies.length||s.some(({name:m})=>r.has(m.toLowerCase()))?"include":"omit",u=s.find(({name:m})=>m.toLowerCase()==="referer"),c=u?u.value:void 0,f=await Ph(e),d={headers:Object.keys(l).length?l:void 0,referrer:c,body:f,method:e.request.method,mode:"cors"};if(t===1){const m=s.find(_=>_.name.toLowerCase()==="cookie"),y={};delete d.mode,m&&(y.cookie=m.value),c&&(delete d.referrer,y.Referer=c),Object.keys(y).length&&(d.headers={...l,...y})}else d.credentials=a;const g=JSON.stringify(d,null,2);return`fetch(${i}, ${g});`}async function Ph(e){var t,n;return(t=e.request.postData)!=null&&t._sha1?await fetch(`sha1/${e.request.postData._sha1}`).then(r=>r.text()):(n=e.request.postData)==null?void 0:n.text}const N0=({resource:e,onClose:t})=>{const[n,r]=M.useState("request");return w.jsx(v0,{dataTestId:"network-request-details",leftToolbar:[w.jsx(fn,{icon:"close",title:"Close",onClick:t},"close")],tabs:[{id:"request",title:"Request",render:()=>w.jsx(b0,{resource:e})},{id:"response",title:"Response",render:()=>w.jsx(A0,{resource:e})},{id:"body",title:"Body",render:()=>w.jsx(L0,{resource:e})}],selectedTab:n,setSelectedTab:r})},b0=({resource:e})=>{const[t,n]=M.useState(null);return M.useEffect(()=>{(async()=>{if(e.request.postData){const i=e.request.headers.find(o=>o.name.toLowerCase()==="content-type"),s=i?i.value:"";if(e.request.postData._sha1){const o=await fetch(`sha1/${e.request.postData._sha1}`);n({text:Ml(await o.text(),s),mimeType:s})}else n({text:Ml(e.request.postData.text,s),mimeType:s})}else n(null)})()},[e]),w.jsxs("div",{className:"network-request-details-tab",children:[w.jsx("div",{className:"network-request-details-header",children:"General"}),w.jsx("div",{className:"network-request-details-url",children:`URL: ${e.request.url}`}),w.jsx("div",{className:"network-request-details-general",children:`Method: ${e.request.method}`}),e.response.status!==-1&&w.jsxs("div",{className:"network-request-details-general",style:{display:"flex"},children:["Status Code: ",w.jsx("span",{className:M0(e.response.status),style:{display:"inline-flex"},children:`${e.response.status} ${e.response.statusText}`})]}),e.request.queryString.length?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"network-request-details-header",children:"Query String Parameters"}),w.jsx("div",{className:"network-request-details-headers",children:e.request.queryString.map(r=>`${r.name}: ${r.value}`).join(` +`)})]}):null,w.jsx("div",{className:"network-request-details-header",children:"Request Headers"}),w.jsx("div",{className:"network-request-details-headers",children:e.request.headers.map(r=>`${r.name}: ${r.value}`).join(` +`)}),w.jsxs("div",{className:"network-request-details-copy",children:[w.jsx(mc,{description:"Copy as cURL",value:()=>T0(e)}),w.jsx(mc,{description:"Copy as Fetch",value:()=>C0(e)})]}),t&&w.jsx("div",{className:"network-request-details-header",children:"Request Body"}),t&&w.jsx(Vs,{text:t.text,mimeType:t.mimeType,readOnly:!0,lineNumbers:!0})]})},A0=({resource:e})=>w.jsxs("div",{className:"network-request-details-tab",children:[w.jsx("div",{className:"network-request-details-header",children:"Response Headers"}),w.jsx("div",{className:"network-request-details-headers",children:e.response.headers.map(t=>`${t.name}: ${t.value}`).join(` +`)})]}),L0=({resource:e})=>{const[t,n]=M.useState(null);return M.useEffect(()=>{(async()=>{if(e.response.content._sha1){const i=e.response.content.mimeType.includes("image"),s=e.response.content.mimeType.includes("font"),o=await fetch(`sha1/${e.response.content._sha1}`);if(i){const l=await o.blob(),a=new FileReader,u=new Promise(c=>a.onload=c);a.readAsDataURL(l),n({dataUrl:(await u).target.result})}else if(s){const l=await o.arrayBuffer();n({font:l})}else{const l=Ml(await o.text(),e.response.content.mimeType);n({text:l,mimeType:e.response.content.mimeType})}}else n(null)})()},[e]),w.jsxs("div",{className:"network-request-details-tab",children:[!e.response.content._sha1&&w.jsx("div",{children:"Response body is not available for this request."}),t&&t.font&&w.jsx(I0,{font:t.font}),t&&t.dataUrl&&w.jsx("img",{draggable:"false",src:t.dataUrl}),t&&t.text&&w.jsx(Vs,{text:t.text,mimeType:t.mimeType,readOnly:!0,lineNumbers:!0})]})},I0=({font:e})=>{const[t,n]=M.useState(!1);return M.useEffect(()=>{let r;try{r=new FontFace("font-preview",e),r.status==="loaded"&&document.fonts.add(r),r.status==="error"&&n(!0)}catch{n(!0)}return()=>{document.fonts.delete(r)}},[e]),t?w.jsx("div",{className:"network-font-preview-error",children:"Could not load font preview"}):w.jsxs("div",{className:"network-font-preview",children:["ABCDEFGHIJKLM",w.jsx("br",{}),"NOPQRSTUVWXYZ",w.jsx("br",{}),"abcdefghijklm",w.jsx("br",{}),"nopqrstuvwxyz",w.jsx("br",{}),"1234567890"]})};function M0(e){return e<300||e===304?"green-circle":e<400?"yellow-circle":"red-circle"}function Ml(e,t){if(e===null)return"Loading...";const n=e;if(n==="")return"";if(t.includes("application/json"))try{return JSON.stringify(JSON.parse(n),null,2)}catch{return n}return t.includes("application/x-www-form-urlencoded")?decodeURIComponent(n):n}const P0=({cursor:e,onPaneMouseMove:t,onPaneMouseUp:n,onPaneDoubleClick:r})=>(et.useEffect(()=>{const i=document.createElement("div");return i.style.position="fixed",i.style.top="0",i.style.right="0",i.style.bottom="0",i.style.left="0",i.style.zIndex="9999",i.style.cursor=e,document.body.appendChild(i),t&&i.addEventListener("mousemove",t),n&&i.addEventListener("mouseup",n),r&&document.body.addEventListener("dblclick",r),()=>{t&&i.removeEventListener("mousemove",t),n&&i.removeEventListener("mouseup",n),r&&document.body.removeEventListener("dblclick",r),document.body.removeChild(i)}},[e,t,n,r]),w.jsx(w.Fragment,{})),R0={position:"absolute",top:0,right:0,bottom:0,left:0},$0=({orientation:e,offsets:t,setOffsets:n,resizerColor:r,resizerWidth:i,minColumnWidth:s})=>{const o=s||0,[l,a]=et.useState(null),[u,c]=ks(),f={position:"absolute",right:e==="horizontal"?void 0:0,bottom:e==="horizontal"?0:void 0,width:e==="horizontal"?7:void 0,height:e==="horizontal"?void 0:7,borderTopWidth:e==="horizontal"?void 0:(7-i)/2,borderRightWidth:e==="horizontal"?(7-i)/2:void 0,borderBottomWidth:e==="horizontal"?void 0:(7-i)/2,borderLeftWidth:e==="horizontal"?(7-i)/2:void 0,borderColor:"transparent",borderStyle:"solid",cursor:e==="horizontal"?"ew-resize":"ns-resize"};return w.jsxs("div",{style:{position:"absolute",top:0,right:0,bottom:0,left:-(7-i)/2,zIndex:100,pointerEvents:"none"},ref:c,children:[!!l&&w.jsx(P0,{cursor:e==="horizontal"?"ew-resize":"ns-resize",onPaneMouseUp:()=>a(null),onPaneMouseMove:d=>{if(!d.buttons)a(null);else if(l){const g=e==="horizontal"?d.clientX-l.clientX:d.clientY-l.clientY,m=l.offset+g,y=l.index>0?t[l.index-1]:0,_=e==="horizontal"?u.width:u.height,p=Math.min(Math.max(y+o,m),_-o)-t[l.index];for(let h=l.index;hw.jsx("div",{style:{...f,top:e==="horizontal"?0:d,left:e==="horizontal"?d:0,pointerEvents:"initial"},onMouseDown:m=>a({clientX:m.clientX,clientY:m.clientY,offset:d,index:g}),children:w.jsx("div",{style:{...R0,background:r}})},g))]})};function O0(e){const[t,n]=M.useState([]);M.useEffect(()=>{const s=[];for(let o=0;o{var o,l;(l=e.setSorting)==null||l.call(e,{by:s,negate:((o=e.sorting)==null?void 0:o.by)===s?!e.sorting.negate:!1})},[e]);return w.jsxs("div",{className:`grid-view ${e.name}-grid-view`,children:[w.jsx($0,{orientation:"horizontal",offsets:t,setOffsets:r,resizerColor:"var(--vscode-panel-border)",resizerWidth:1,minColumnWidth:25}),w.jsxs("div",{className:"vbox",children:[w.jsx("div",{className:"grid-view-header",children:e.columns.map((s,o)=>w.jsxs("div",{className:"grid-view-header-cell "+j0(s,e.sorting),style:{width:oe.setSorting&&i(s),children:[w.jsx("span",{className:"grid-view-header-cell-title",children:e.columnTitle(s)}),w.jsx("span",{className:"codicon codicon-triangle-up"}),w.jsx("span",{className:"codicon codicon-triangle-down"})]},e.columnTitle(s)))}),w.jsx($a,{name:e.name,items:e.items,id:e.id,render:(s,o)=>w.jsx(w.Fragment,{children:e.columns.map((l,a)=>{const{body:u,title:c}=e.render(s,l,o);return w.jsx("div",{className:`grid-view-cell grid-view-column-${String(l)}`,title:c,style:{width:aw.jsxs("div",{className:"network-filters",children:[w.jsx("input",{type:"search",placeholder:"Filter network",spellCheck:!1,value:e.searchValue,onChange:n=>t({...e,searchValue:n.target.value})}),w.jsx("div",{className:"network-filters-resource-types",children:z0.map(n=>w.jsx("div",{title:n,onClick:()=>t({...e,resourceType:n}),className:`network-filters-resource-type ${e.resourceType===n?"selected":""}`,children:n},n))})]}),H0=O0;function gw(e,t){const n=M.useMemo(()=>((e==null?void 0:e.resources)||[]).filter(o=>t?!!o._monotonicTime&&o._monotonicTime>=t.minimum&&o._monotonicTime<=t.maximum:!0),[e,t]),r=M.useMemo(()=>new W0(e),[e]);return{resources:n,contextIdMap:r}}const mw=({boundaries:e,networkModel:t,onEntryHovered:n})=>{const[r,i]=M.useState(void 0),[s,o]=M.useState(void 0),[l,a]=M.useState(D0),{renderedEntries:u}=M.useMemo(()=>{const m=t.resources.map(y=>Q0(y,e,t.contextIdMap)).filter(Y0(l));return r&&G0(m,r),{renderedEntries:m}},[t.resources,t.contextIdMap,l,r,e]),[c,f]=M.useState(()=>new Map(Rh().map(m=>[m,V0(m)]))),d=M.useCallback(m=>{a(m),o(void 0)},[]);if(!t.resources.length)return w.jsx(Lh,{text:"No network calls"});const g=w.jsx(H0,{name:"network",items:u,selectedItem:s,onSelected:m=>o(m),onHighlighted:m=>n==null?void 0:n(m==null?void 0:m.resource),columns:B0(!!s,u),columnTitle:U0,columnWidths:c,setColumnWidths:f,isError:m=>m.status.code>=400||m.status.code===-1,isInfo:m=>!!m.route,render:(m,y)=>q0(m,y),sorting:r,setSorting:i});return w.jsxs(w.Fragment,{children:[w.jsx(F0,{filterState:l,onFilterStateChange:d}),!s&&g,s&&w.jsx(sh,{sidebarSize:c.get("name"),sidebarIsFirst:!0,orientation:"horizontal",settingName:"networkResourceDetails",main:w.jsx(N0,{resource:s.resource,onClose:()=>o(void 0)}),sidebar:g})]})},U0=e=>e==="contextId"?"Source":e==="name"?"Name":e==="method"?"Method":e==="status"?"Status":e==="contentType"?"Content Type":e==="duration"?"Duration":e==="size"?"Size":e==="start"?"Start":e==="route"?"Route":"",V0=e=>e==="name"?200:e==="method"||e==="status"?60:e==="contentType"?200:e==="contextId"?60:100;function B0(e,t){if(e){const r=["name"];return Sc(t)&&r.unshift("contextId"),r}let n=Rh();return Sc(t)||(n=n.filter(r=>r!=="contextId")),n}function Rh(){return["contextId","name","method","status","contentType","duration","size","start","route"]}const q0=(e,t)=>t==="contextId"?{body:e.contextId,title:e.name.url}:t==="name"?{body:e.name.name,title:e.name.url}:t==="method"?{body:e.method}:t==="status"?{body:e.status.code>0?e.status.code:"",title:e.status.text}:t==="contentType"?{body:e.contentType}:t==="duration"?{body:Ro(e.duration)}:t==="size"?{body:dg(e.size)}:t==="start"?{body:Ro(e.start)}:t==="route"?{body:e.route}:{body:""};class W0{constructor(t){H(this,"_pagerefToShortId",new Map);H(this,"_contextToId",new Map);H(this,"_lastPageId",0);H(this,"_lastApiRequestContextId",0)}contextId(t){return t.pageref?this._pageId(t.pageref):t._apiRequest?this._apiRequestContextId(t):""}_pageId(t){let n=this._pagerefToShortId.get(t);return n||(++this._lastPageId,n="page#"+this._lastPageId,this._pagerefToShortId.set(t,n)),n}_apiRequestContextId(t){const n=vs(t);if(!n)return"";let r=this._contextToId.get(n);return r||(++this._lastApiRequestContextId,r="api#"+this._lastApiRequestContextId,this._contextToId.set(n,r)),r}}function Sc(e){const t=new Set;for(const n of e)if(t.add(n.contextId),t.size>1)return!0;return!1}const Q0=(e,t,n)=>{const r=K0(e);let i;try{const l=new URL(e.request.url);i=l.pathname.substring(l.pathname.lastIndexOf("/")+1),i||(i=l.host)}catch{i=e.request.url}let s=e.response.content.mimeType;const o=s.match(/^(.*);\s*charset=.*$/);return o&&(s=o[1]),{name:{name:i,url:e.request.url},method:e.request.method,status:{code:e.response.status,text:e.response.statusText},contentType:s,duration:e.time,size:e.response._transferSize>0?e.response._transferSize:e.response.bodySize,start:e._monotonicTime-t.minimum,route:r,resource:e,contextId:n.contextId(e)}};function K0(e){return e._wasAborted?"aborted":e._wasContinued?"continued":e._wasFulfilled?"fulfilled":e._apiRequest?"api":""}function G0(e,t){const n=X0(t==null?void 0:t.by);n&&e.sort(n),t.negate&&e.reverse()}function X0(e){if(e==="start")return(t,n)=>t.start-n.start;if(e==="duration")return(t,n)=>t.duration-n.duration;if(e==="status")return(t,n)=>t.status.code-n.status.code;if(e==="method")return(t,n)=>{const r=t.method,i=n.method;return r.localeCompare(i)};if(e==="size")return(t,n)=>t.size-n.size;if(e==="contentType")return(t,n)=>t.contentType.localeCompare(n.contentType);if(e==="name")return(t,n)=>t.name.name.localeCompare(n.name.name);if(e==="route")return(t,n)=>t.route.localeCompare(n.route);if(e==="contextId")return(t,n)=>t.contextId.localeCompare(n.contextId)}const J0={All:()=>!0,Fetch:e=>e==="application/json",HTML:e=>e==="text/html",CSS:e=>e==="text/css",JS:e=>e.includes("javascript"),Font:e=>e.includes("font"),Image:e=>e.includes("image")};function Y0({searchValue:e,resourceType:t}){return n=>{const r=J0[t];return r(n.contentType)&&n.name.url.toLowerCase().includes(e.toLowerCase())}}const Ec={queryAll(e,t){t.startsWith("/")&&e.nodeType!==Node.DOCUMENT_NODE&&(t="."+t);const n=[],r=e.ownerDocument||e;if(!r)return n;const i=r.evaluate(t,e,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE);for(let s=i.iterateNext();s;s=i.iterateNext())s.nodeType===Node.ELEMENT_NODE&&n.push(s);return n}};let $h="";function Z0(e){$h=e}function Bs(e,t){for(;t;){if(e.contains(t))return!0;t=jh(t)}return!1}function Se(e){if(e.parentElement)return e.parentElement;if(e.parentNode&&e.parentNode.nodeType===11&&e.parentNode.host)return e.parentNode.host}function Oh(e){let t=e;for(;t.parentNode;)t=t.parentNode;if(t.nodeType===11||t.nodeType===9)return t}function jh(e){for(;e.parentElement;)e=e.parentElement;return Se(e)}function _r(e,t,n){for(;e;){const r=e.closest(t);if(n&&r!==n&&(r!=null&&r.contains(n)))return;if(r)return r;e=jh(e)}}function gn(e,t){return e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,t):void 0}function zh(e,t){if(t=t??gn(e),!t)return!0;if(Element.prototype.checkVisibility&&$h!=="webkit"){if(!e.checkVisibility())return!1}else{const n=e.closest("details,summary");if(n!==e&&(n==null?void 0:n.nodeName)==="DETAILS"&&!n.open)return!1}return t.visibility==="visible"}function nn(e){const t=gn(e);if(!t)return!0;if(t.display==="contents"){for(let r=e.firstChild;r;r=r.nextSibling)if(r.nodeType===1&&nn(r)||r.nodeType===3&&Dh(r))return!0;return!1}if(!zh(e,t))return!1;const n=e.getBoundingClientRect();return n.width>0&&n.height>0}function Dh(e){const t=e.ownerDocument.createRange();t.selectNode(e);const n=t.getBoundingClientRect();return n.width>0&&n.height>0}function ve(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function kc(e){return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")}const Tc="article:not([role]), aside:not([role]), main:not([role]), nav:not([role]), section:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]",ey=new Map([["aria-atomic",void 0],["aria-busy",void 0],["aria-controls",void 0],["aria-current",void 0],["aria-describedby",void 0],["aria-details",void 0],["aria-dropeffect",void 0],["aria-flowto",void 0],["aria-grabbed",void 0],["aria-hidden",void 0],["aria-keyshortcuts",void 0],["aria-label",new Set(["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"])],["aria-labelledby",new Set(["caption","code","deletion","emphasis","generic","insertion","paragraph","presentation","strong","subscript","superscript"])],["aria-live",void 0],["aria-owns",void 0],["aria-relevant",void 0],["aria-roledescription",new Set(["generic"])]]);function Fh(e,t){return[...ey].some(([n,r])=>!(r!=null&&r.has(t||""))&&e.hasAttribute(n))}function Hh(e){return!Number.isNaN(Number(String(e.getAttribute("tabindex"))))}function ty(e){return!ep(e)&&(ny(e)||Hh(e))}function ny(e){const t=ve(e);return["BUTTON","DETAILS","SELECT","TEXTAREA"].includes(t)?!0:t==="A"||t==="AREA"?e.hasAttribute("href"):t==="INPUT"?!e.hidden:!1}const xo={A:e=>e.hasAttribute("href")?"link":null,AREA:e=>e.hasAttribute("href")?"link":null,ARTICLE:()=>"article",ASIDE:()=>"complementary",BLOCKQUOTE:()=>"blockquote",BUTTON:()=>"button",CAPTION:()=>"caption",CODE:()=>"code",DATALIST:()=>"listbox",DD:()=>"definition",DEL:()=>"deletion",DETAILS:()=>"group",DFN:()=>"term",DIALOG:()=>"dialog",DT:()=>"term",EM:()=>"emphasis",FIELDSET:()=>"group",FIGURE:()=>"figure",FOOTER:e=>_r(e,Tc)?null:"contentinfo",FORM:e=>kc(e)?"form":null,H1:()=>"heading",H2:()=>"heading",H3:()=>"heading",H4:()=>"heading",H5:()=>"heading",H6:()=>"heading",HEADER:e=>_r(e,Tc)?null:"banner",HR:()=>"separator",HTML:()=>"document",IMG:e=>e.getAttribute("alt")===""&&!e.getAttribute("title")&&!Fh(e)&&!Hh(e)?"presentation":"img",INPUT:e=>{const t=e.type.toLowerCase();if(t==="search")return e.hasAttribute("list")?"combobox":"searchbox";if(["email","tel","text","url",""].includes(t)){const n=ni(e,e.getAttribute("list"))[0];return n&&ve(n)==="DATALIST"?"combobox":"textbox"}return t==="hidden"?null:ay[t]||"textbox"},INS:()=>"insertion",LI:()=>"listitem",MAIN:()=>"main",MARK:()=>"mark",MATH:()=>"math",MENU:()=>"list",METER:()=>"meter",NAV:()=>"navigation",OL:()=>"list",OPTGROUP:()=>"group",OPTION:()=>"option",OUTPUT:()=>"status",P:()=>"paragraph",PROGRESS:()=>"progressbar",SECTION:e=>kc(e)?"region":null,SELECT:e=>e.hasAttribute("multiple")||e.size>1?"listbox":"combobox",STRONG:()=>"strong",SUB:()=>"subscript",SUP:()=>"superscript",SVG:()=>"img",TABLE:()=>"table",TBODY:()=>"rowgroup",TD:e=>{const t=_r(e,"table"),n=t?_s(t):"";return n==="grid"||n==="treegrid"?"gridcell":"cell"},TEXTAREA:()=>"textbox",TFOOT:()=>"rowgroup",TH:e=>{if(e.getAttribute("scope")==="col")return"columnheader";if(e.getAttribute("scope")==="row")return"rowheader";const t=_r(e,"table"),n=t?_s(t):"";return n==="grid"||n==="treegrid"?"gridcell":"cell"},THEAD:()=>"rowgroup",TIME:()=>"time",TR:()=>"row",UL:()=>"list"},ry={DD:["DL","DIV"],DIV:["DL"],DT:["DL","DIV"],LI:["OL","UL"],TBODY:["TABLE"],TD:["TR"],TFOOT:["TABLE"],TH:["TR"],THEAD:["TABLE"],TR:["THEAD","TBODY","TFOOT","TABLE"]};function Cc(e){var r;const t=((r=xo[ve(e)])==null?void 0:r.call(xo,e))||"";if(!t)return null;let n=e;for(;n;){const i=Se(n),s=ry[ve(n)];if(!s||!i||!s.includes(ve(i)))break;const o=_s(i);if((o==="none"||o==="presentation")&&!Uh(i,o))return o;n=i}return t}const iy=["alert","alertdialog","application","article","banner","blockquote","button","caption","cell","checkbox","code","columnheader","combobox","complementary","contentinfo","definition","deletion","dialog","directory","document","emphasis","feed","figure","form","generic","grid","gridcell","group","heading","img","insertion","link","list","listbox","listitem","log","main","mark","marquee","math","meter","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","navigation","none","note","option","paragraph","presentation","progressbar","radio","radiogroup","region","row","rowgroup","rowheader","scrollbar","search","searchbox","separator","slider","spinbutton","status","strong","subscript","superscript","switch","tab","table","tablist","tabpanel","term","textbox","time","timer","toolbar","tooltip","tree","treegrid","treeitem"];function _s(e){return(e.getAttribute("role")||"").split(" ").map(n=>n.trim()).find(n=>iy.includes(n))||null}function Uh(e,t){return Fh(e,t)||ty(e)}function ye(e){const t=_s(e);if(!t)return Cc(e);if(t==="none"||t==="presentation"){const n=Cc(e);if(Uh(e,n))return n}return t}function Vh(e){return e===null?void 0:e.toLowerCase()==="true"}function Bh(e){return["STYLE","SCRIPT","NOSCRIPT","TEMPLATE"].includes(ve(e))}function Ze(e){if(Bh(e))return!0;const t=gn(e),n=e.nodeName==="SLOT";if((t==null?void 0:t.display)==="contents"&&!n){for(let i=e.firstChild;i;i=i.nextSibling)if(i.nodeType===1&&!Ze(i)||i.nodeType===3&&Dh(i))return!1;return!0}return!(e.nodeName==="OPTION"&&!!e.closest("select"))&&!n&&!zh(e,t)?!0:qh(e)}function qh(e){let t=bt==null?void 0:bt.get(e);if(t===void 0){if(t=!1,e.parentElement&&e.parentElement.shadowRoot&&!e.assignedSlot&&(t=!0),!t){const n=gn(e);t=!n||n.display==="none"||Vh(e.getAttribute("aria-hidden"))===!0}if(!t){const n=Se(e);n&&(t=qh(n))}bt==null||bt.set(e,t)}return t}function ni(e,t){if(!t)return[];const n=Oh(e);if(!n)return[];try{const r=t.split(" ").filter(s=>!!s),i=new Set;for(const s of r){const o=n.querySelector("#"+CSS.escape(s));o&&i.add(o)}return[...i]}catch{return[]}}function ht(e){return e.trim()}function qi(e){return e.split(" ").map(t=>t.replace(/\r\n/g,` +`).replace(/\s\s*/g," ")).join(" ").trim()}function Nc(e,t){const n=[...e.querySelectorAll(t)];for(const r of ni(e,e.getAttribute("aria-owns")))r.matches(t)&&n.push(r),n.push(...r.querySelectorAll(t));return n}function xs(e,t){const n=t==="::before"?Qa:Ka;if(n!=null&&n.has(e))return(n==null?void 0:n.get(e))||"";const r=gn(e,t),i=sy(r);return n&&n.set(e,i),i}function sy(e){if(!e||e.display==="none"||e.visibility==="hidden")return"";const t=e.content;if(t[0]==="'"&&t[t.length-1]==="'"||t[0]==='"'&&t[t.length-1]==='"'){const n=t.substring(1,t.length-1);return(e.display||"inline")!=="inline"?" "+n+" ":n}return""}function Wh(e){const t=e.getAttribute("aria-labelledby");if(t===null)return null;const n=ni(e,t);return n.length?n:null}function oy(e,t){const n=["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"].includes(e),r=t&&["","caption","code","contentinfo","definition","deletion","emphasis","insertion","list","listitem","mark","none","paragraph","presentation","region","row","rowgroup","section","strong","subscript","superscript","table","term","time"].includes(e);return n||r}function Gr(e,t){const n=t?Ba:Va;let r=n==null?void 0:n.get(e);return r===void 0&&(r="",["caption","code","definition","deletion","emphasis","generic","insertion","mark","paragraph","presentation","strong","subscript","suggestion","superscript","term","time"].includes(ye(e)||"")||(r=qi(at(e,{includeHidden:t,visitedElements:new Set,embeddedInTargetElement:"self"}))),n==null||n.set(e,r)),r}function bc(e,t){const n=t?Wa:qa;let r=n==null?void 0:n.get(e);if(r===void 0){if(r="",e.hasAttribute("aria-describedby")){const i=ni(e,e.getAttribute("aria-describedby"));r=qi(i.map(s=>at(s,{includeHidden:t,visitedElements:new Set,embeddedInDescribedBy:{element:s,hidden:Ze(s)}})).join(" "))}else e.hasAttribute("aria-description")?r=qi(e.getAttribute("aria-description")||""):r=qi(e.getAttribute("title")||"");n==null||n.set(e,r)}return r}function at(e,t){var a,u,c,f;if(t.visitedElements.has(e))return"";const n={...t,embeddedInTargetElement:t.embeddedInTargetElement==="self"?"descendant":t.embeddedInTargetElement};if(!t.includeHidden){const d=!!((a=t.embeddedInLabelledBy)!=null&&a.hidden)||!!((u=t.embeddedInDescribedBy)!=null&&u.hidden)||!!((c=t.embeddedInNativeTextAlternative)!=null&&c.hidden)||!!((f=t.embeddedInLabel)!=null&&f.hidden);if(Bh(e)||!d&&Ze(e))return t.visitedElements.add(e),""}const r=Wh(e);if(!t.embeddedInLabelledBy){const d=(r||[]).map(g=>at(g,{...t,embeddedInLabelledBy:{element:g,hidden:Ze(g)},embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0,embeddedInLabel:void 0,embeddedInNativeTextAlternative:void 0})).join(" ");if(d)return d}const i=ye(e)||"",s=ve(e);if(t.embeddedInLabel||t.embeddedInLabelledBy||t.embeddedInTargetElement==="descendant"){const d=[...e.labels||[]].includes(e),g=(r||[]).includes(e);if(!d&&!g){if(i==="textbox")return t.visitedElements.add(e),s==="INPUT"||s==="TEXTAREA"?e.value:e.textContent||"";if(["combobox","listbox"].includes(i)){t.visitedElements.add(e);let m;if(s==="SELECT")m=[...e.selectedOptions],!m.length&&e.options.length&&m.push(e.options[0]);else{const y=i==="combobox"?Nc(e,"*").find(_=>ye(_)==="listbox"):e;m=y?Nc(y,'[aria-selected="true"]').filter(_=>ye(_)==="option"):[]}return!m.length&&s==="INPUT"?e.value:m.map(y=>at(y,n)).join(" ")}if(["progressbar","scrollbar","slider","spinbutton","meter"].includes(i))return t.visitedElements.add(e),e.hasAttribute("aria-valuetext")?e.getAttribute("aria-valuetext")||"":e.hasAttribute("aria-valuenow")?e.getAttribute("aria-valuenow")||"":e.getAttribute("value")||"";if(["menu"].includes(i))return t.visitedElements.add(e),""}}const o=e.getAttribute("aria-label")||"";if(ht(o))return t.visitedElements.add(e),o;if(!["presentation","none"].includes(i)){if(s==="INPUT"&&["button","submit","reset"].includes(e.type)){t.visitedElements.add(e);const d=e.value||"";return ht(d)?d:e.type==="submit"?"Submit":e.type==="reset"?"Reset":e.getAttribute("title")||""}if(s==="INPUT"&&e.type==="image"){t.visitedElements.add(e);const d=e.labels||[];if(d.length&&!t.embeddedInLabelledBy)return Si(d,t);const g=e.getAttribute("alt")||"";if(ht(g))return g;const m=e.getAttribute("title")||"";return ht(m)?m:"Submit"}if(!r&&s==="BUTTON"){t.visitedElements.add(e);const d=e.labels||[];if(d.length)return Si(d,t)}if(!r&&s==="OUTPUT"){t.visitedElements.add(e);const d=e.labels||[];return d.length?Si(d,t):e.getAttribute("title")||""}if(!r&&(s==="TEXTAREA"||s==="SELECT"||s==="INPUT")){t.visitedElements.add(e);const d=e.labels||[];if(d.length)return Si(d,t);const g=s==="INPUT"&&["text","password","search","tel","email","url"].includes(e.type)||s==="TEXTAREA",m=e.getAttribute("placeholder")||"",y=e.getAttribute("title")||"";return!g||y?y:m}if(!r&&s==="FIELDSET"){t.visitedElements.add(e);for(let g=e.firstElementChild;g;g=g.nextElementSibling)if(ve(g)==="LEGEND")return at(g,{...n,embeddedInNativeTextAlternative:{element:g,hidden:Ze(g)}});return e.getAttribute("title")||""}if(!r&&s==="FIGURE"){t.visitedElements.add(e);for(let g=e.firstElementChild;g;g=g.nextElementSibling)if(ve(g)==="FIGCAPTION")return at(g,{...n,embeddedInNativeTextAlternative:{element:g,hidden:Ze(g)}});return e.getAttribute("title")||""}if(s==="IMG"){t.visitedElements.add(e);const d=e.getAttribute("alt")||"";return ht(d)?d:e.getAttribute("title")||""}if(s==="TABLE"){t.visitedElements.add(e);for(let g=e.firstElementChild;g;g=g.nextElementSibling)if(ve(g)==="CAPTION")return at(g,{...n,embeddedInNativeTextAlternative:{element:g,hidden:Ze(g)}});const d=e.getAttribute("summary")||"";if(d)return d}if(s==="AREA"){t.visitedElements.add(e);const d=e.getAttribute("alt")||"";return ht(d)?d:e.getAttribute("title")||""}if(s==="SVG"||e.ownerSVGElement){t.visitedElements.add(e);for(let d=e.firstElementChild;d;d=d.nextElementSibling)if(ve(d)==="TITLE"&&d.ownerSVGElement)return at(d,{...n,embeddedInLabelledBy:{element:d,hidden:Ze(d)}})}if(e.ownerSVGElement&&s==="A"){const d=e.getAttribute("xlink:title")||"";if(ht(d))return t.visitedElements.add(e),d}}const l=s==="SUMMARY"&&!["presentation","none"].includes(i);if(oy(i,t.embeddedInTargetElement==="descendant")||l||t.embeddedInLabelledBy||t.embeddedInDescribedBy||t.embeddedInLabel||t.embeddedInNativeTextAlternative){t.visitedElements.add(e);const d=ly(e,n);if(t.embeddedInTargetElement==="self"?ht(d):d)return d}if(!["presentation","none"].includes(i)||s==="IFRAME"){t.visitedElements.add(e);const d=e.getAttribute("title")||"";if(ht(d))return d}return t.visitedElements.add(e),""}function ly(e,t){const n=[],r=(s,o)=>{var l;if(!(o&&s.assignedSlot))if(s.nodeType===1){const a=((l=gn(s))==null?void 0:l.display)||"inline";let u=at(s,t);(a!=="inline"||s.nodeName==="BR")&&(u=" "+u+" "),n.push(u)}else s.nodeType===3&&n.push(s.textContent||"")};n.push(xs(e,"::before"));const i=e.nodeName==="SLOT"?e.assignedNodes():[];if(i.length)for(const s of i)r(s,!1);else{for(let s=e.firstChild;s;s=s.nextSibling)r(s,!0);if(e.shadowRoot)for(let s=e.shadowRoot.firstChild;s;s=s.nextSibling)r(s,!0);for(const s of ni(e,e.getAttribute("aria-owns")))r(s,!0)}return n.push(xs(e,"::after")),n.join("")}const ja=["gridcell","option","row","tab","rowheader","columnheader","treeitem"];function Qh(e){return ve(e)==="OPTION"?e.selected:ja.includes(ye(e)||"")?Vh(e.getAttribute("aria-selected"))===!0:!1}const za=["checkbox","menuitemcheckbox","option","radio","switch","menuitemradio","treeitem"];function Kh(e){const t=Gh(e,!0);return t==="error"?!1:t}function Gh(e,t){const n=ve(e);if(t&&n==="INPUT"&&e.indeterminate)return"mixed";if(n==="INPUT"&&["checkbox","radio"].includes(e.type))return e.checked;if(za.includes(ye(e)||"")){const r=e.getAttribute("aria-checked");return r==="true"?!0:t&&r==="mixed"?"mixed":!1}return"error"}const Da=["button"];function Xh(e){if(Da.includes(ye(e)||"")){const t=e.getAttribute("aria-pressed");if(t==="true")return!0;if(t==="mixed")return"mixed"}return!1}const Fa=["application","button","checkbox","combobox","gridcell","link","listbox","menuitem","row","rowheader","tab","treeitem","columnheader","menuitemcheckbox","menuitemradio","rowheader","switch"];function Jh(e){if(ve(e)==="DETAILS")return e.open;if(Fa.includes(ye(e)||"")){const t=e.getAttribute("aria-expanded");return t===null?void 0:t==="true"}}const Ha=["heading","listitem","row","treeitem"];function Yh(e){const t={H1:1,H2:2,H3:3,H4:4,H5:5,H6:6}[ve(e)];if(t)return t;if(Ha.includes(ye(e)||"")){const n=e.getAttribute("aria-level"),r=n===null?Number.NaN:Number(n);if(Number.isInteger(r)&&r>=1)return r}return 0}const Zh=["application","button","composite","gridcell","group","input","link","menuitem","scrollbar","separator","tab","checkbox","columnheader","combobox","grid","listbox","menu","menubar","menuitemcheckbox","menuitemradio","option","radio","radiogroup","row","rowheader","searchbox","select","slider","spinbutton","switch","tablist","textbox","toolbar","tree","treegrid","treeitem"];function Ua(e){return ep(e)||np(e)}function ep(e){return["BUTTON","INPUT","SELECT","TEXTAREA","OPTION","OPTGROUP"].includes(e.tagName)&&(e.hasAttribute("disabled")||tp(e))}function tp(e){return e?ve(e)==="FIELDSET"&&e.hasAttribute("disabled")?!0:tp(e.parentElement):!1}function np(e){if(!e)return!1;if(Zh.includes(ye(e)||"")){const t=(e.getAttribute("aria-disabled")||"").toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return np(Se(e))}function Si(e,t){return[...e].map(n=>at(n,{...t,embeddedInLabel:{element:n,hidden:Ze(n)},embeddedInNativeTextAlternative:void 0,embeddedInLabelledBy:void 0,embeddedInDescribedBy:void 0,embeddedInTargetElement:void 0})).filter(n=>!!n).join(" ")}let Va,Ba,qa,Wa,bt,Qa,Ka,rp=0;function Ga(){++rp,Va??(Va=new Map),Ba??(Ba=new Map),qa??(qa=new Map),Wa??(Wa=new Map),bt??(bt=new Map),Qa??(Qa=new Map),Ka??(Ka=new Map)}function Xa(){--rp||(Va=void 0,Ba=void 0,qa=void 0,Wa=void 0,bt=void 0,Qa=void 0,Ka=void 0)}const ay={button:"button",checkbox:"checkbox",image:"button",number:"spinbutton",radio:"radio",range:"slider",reset:"button",submit:"button"};function ip(e,t){for(const n of t.jsonPath)e!=null&&(e=e[n]);return sp(e,t)}function sp(e,t){const n=typeof e=="string"&&!t.caseSensitive?e.toUpperCase():e,r=typeof t.value=="string"&&!t.caseSensitive?t.value.toUpperCase():t.value;return t.op===""?!!n:t.op==="="?r instanceof RegExp?typeof n=="string"&&!!n.match(r):n===r:typeof n!="string"||typeof r!="string"?!1:t.op==="*="?n.includes(r):t.op==="^="?n.startsWith(r):t.op==="$="?n.endsWith(r):t.op==="|="?n===r||n.startsWith(r+"-"):t.op==="~="?n.split(" ").includes(r):!1}function Ja(e){const t=e.ownerDocument;return e.nodeName==="SCRIPT"||e.nodeName==="NOSCRIPT"||e.nodeName==="STYLE"||t.head&&t.head.contains(e)}function Ae(e,t){let n=e.get(t);if(n===void 0){if(n={full:"",normalized:"",immediate:[]},!Ja(t)){let r="";if(t instanceof HTMLInputElement&&(t.type==="submit"||t.type==="button"))n={full:t.value,normalized:ze(t.value),immediate:[t.value]};else{for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType===Node.TEXT_NODE?(n.full+=i.nodeValue||"",r+=i.nodeValue||""):(r&&n.immediate.push(r),r="",i.nodeType===Node.ELEMENT_NODE&&(n.full+=Ae(e,i).full));r&&n.immediate.push(r),t.shadowRoot&&(n.full+=Ae(e,t.shadowRoot).full),n.full&&(n.normalized=ze(n.full))}}e.set(t,n)}return n}function qs(e,t,n){if(Ja(t)||!n(Ae(e,t)))return"none";for(let r=t.firstChild;r;r=r.nextSibling)if(r.nodeType===Node.ELEMENT_NODE&&n(Ae(e,r)))return"selfAndChildren";return t.shadowRoot&&n(Ae(e,t.shadowRoot))?"selfAndChildren":"self"}function op(e,t){const n=Wh(t);if(n)return n.map(s=>Ae(e,s));const r=t.getAttribute("aria-label");if(r!==null&&r.trim())return[{full:r,normalized:ze(r),immediate:[r]}];const i=t.nodeName==="INPUT"&&t.type!=="hidden";if(["BUTTON","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA"].includes(t.nodeName)||i){const s=t.labels;if(s)return[...s].map(o=>Ae(e,o))}return[]}function Ac(e){return e.displayName||e.name||"Anonymous"}function uy(e){if(e.type)switch(typeof e.type){case"function":return Ac(e.type);case"string":return e.type;case"object":return e.type.displayName||(e.type.render?Ac(e.type.render):"")}if(e._currentElement){const t=e._currentElement.type;if(typeof t=="string")return t;if(typeof t=="function")return t.displayName||t.name||"Anonymous"}return""}function cy(e){var t;return e.key??((t=e._currentElement)==null?void 0:t.key)}function dy(e){if(e.child){const n=[];for(let r=e.child;r;r=r.sibling)n.push(r);return n}if(!e._currentElement)return[];const t=n=>{var i;const r=(i=n._currentElement)==null?void 0:i.type;return typeof r=="function"||typeof r=="string"};if(e._renderedComponent){const n=e._renderedComponent;return t(n)?[n]:[]}return e._renderedChildren?[...Object.values(e._renderedChildren)].filter(t):[]}function fy(e){var r;const t=e.memoizedProps||((r=e._currentElement)==null?void 0:r.props);if(!t||typeof t=="string")return t;const n={...t};return delete n.children,n}function lp(e){var r;const t={key:cy(e),name:uy(e),children:dy(e).map(lp),rootElements:[],props:fy(e)},n=e.stateNode||e._hostNode||((r=e._renderedComponent)==null?void 0:r._hostNode);if(n instanceof Element)t.rootElements.push(n);else for(const i of t.children)t.rootElements.push(...i.rootElements);return t}function ap(e,t,n=[]){t(e)&&n.push(e);for(const r of e.children)ap(r,t,n);return n}function up(e,t=[]){const r=(e.ownerDocument||e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);do{const i=r.currentNode,s=i,o=Object.keys(s).find(a=>a.startsWith("__reactContainer")&&s[a]!==null);if(o)t.push(s[o].stateNode.current);else{const a="_reactRootContainer";s.hasOwnProperty(a)&&s[a]!==null&&t.push(s[a]._internalRoot.current)}if(i instanceof Element&&i.hasAttribute("data-reactroot"))for(const a of Object.keys(i))(a.startsWith("__reactInternalInstance")||a.startsWith("__reactFiber"))&&t.push(i[a]);const l=i instanceof Element?i.shadowRoot:null;l&&up(l,t)}while(r.nextNode());return t}const hy={queryAll(e,t){const{name:n,attributes:r}=on(t,!1),o=up(e.ownerDocument||e).map(a=>lp(a)).map(a=>ap(a,u=>{const c=u.props??{};if(u.key!==void 0&&(c.key=u.key),n&&u.name!==n||u.rootElements.some(f=>!Bs(e,f)))return!1;for(const f of r)if(!ip(c,f))return!1;return!0})).flat(),l=new Set;for(const a of o)for(const u of a.rootElements)l.add(u);return[...l]}};function cp(e,t){const n=e.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/");let r=n.substring(n.lastIndexOf("/")+1);return r.endsWith(t)&&(r=r.substring(0,r.length-t.length)),r}function py(e,t){return t?t.toUpperCase():""}const gy=/(?:^|[-_/])(\w)/g,dp=e=>e&&e.replace(gy,py);function my(e){function t(c){const f=c.name||c._componentTag||c.__playwright_guessedName;if(f)return f;const d=c.__file;if(d)return dp(cp(d,".vue"))}function n(c,f){return c.type.__playwright_guessedName=f,f}function r(c){var d,g,m,y;const f=t(c.type||{});if(f)return f;if(c.root===c)return"Root";for(const _ in(g=(d=c.parent)==null?void 0:d.type)==null?void 0:g.components)if(((m=c.parent)==null?void 0:m.type.components[_])===c.type)return n(c,_);for(const _ in(y=c.appContext)==null?void 0:y.components)if(c.appContext.components[_]===c.type)return n(c,_);return"Anonymous Component"}function i(c){return c._isBeingDestroyed||c.isUnmounted}function s(c){return c.subTree.type.toString()==="Symbol(Fragment)"}function o(c){const f=[];return c.component&&f.push(c.component),c.suspense&&f.push(...o(c.suspense.activeBranch)),Array.isArray(c.children)&&c.children.forEach(d=>{d.component?f.push(d.component):f.push(...o(d))}),f.filter(d=>{var g;return!i(d)&&!((g=d.type.devtools)!=null&&g.hide)})}function l(c){return s(c)?a(c.subTree):[c.subTree.el]}function a(c){if(!c.children)return[];const f=[];for(let d=0,g=c.children.length;d!!o.component).map(o=>o.component):[]}function i(s){return{name:n(s),children:r(s).map(i),rootElements:[s.$el],props:s._props}}return i(e)}function fp(e,t,n=[]){t(e)&&n.push(e);for(const r of e.children)fp(r,t,n);return n}function hp(e,t=[]){const r=(e.ownerDocument||e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT),i=new Set;do{const s=r.currentNode;s.__vue__&&i.add(s.__vue__.$root),s.__vue_app__&&s._vnode&&s._vnode.component&&t.push({root:s._vnode.component,version:3});const o=s instanceof Element?s.shadowRoot:null;o&&hp(o,t)}while(r.nextNode());for(const s of i)t.push({version:2,root:s});return t}const yy={queryAll(e,t){const n=e.ownerDocument||e,{name:r,attributes:i}=on(t,!1),l=hp(n).map(u=>u.version===3?my(u.root):vy(u.root)).map(u=>fp(u,c=>{if(r&&c.name!==r||c.rootElements.some(f=>!Bs(e,f)))return!1;for(const f of i)if(!ip(c.props,f))return!1;return!0})).flat(),a=new Set;for(const u of l)for(const c of u.rootElements)a.add(c);return[...a]}},pp=["selected","checked","pressed","expanded","level","disabled","name","include-hidden"];pp.sort();function fr(e,t,n){if(!t.includes(n))throw new Error(`"${e}" attribute is only supported for roles: ${t.slice().sort().map(r=>`"${r}"`).join(", ")}`)}function vn(e,t){if(e.op!==""&&!t.includes(e.value))throw new Error(`"${e.name}" must be one of ${t.map(n=>JSON.stringify(n)).join(", ")}`)}function yn(e,t){if(!t.includes(e.op))throw new Error(`"${e.name}" does not support "${e.op}" matcher`)}function wy(e,t){const n={role:t};for(const r of e)switch(r.name){case"checked":{fr(r.name,za,t),vn(r,[!0,!1,"mixed"]),yn(r,["","="]),n.checked=r.op===""?!0:r.value;break}case"pressed":{fr(r.name,Da,t),vn(r,[!0,!1,"mixed"]),yn(r,["","="]),n.pressed=r.op===""?!0:r.value;break}case"selected":{fr(r.name,ja,t),vn(r,[!0,!1]),yn(r,["","="]),n.selected=r.op===""?!0:r.value;break}case"expanded":{fr(r.name,Fa,t),vn(r,[!0,!1]),yn(r,["","="]),n.expanded=r.op===""?!0:r.value;break}case"level":{if(fr(r.name,Ha,t),typeof r.value=="string"&&(r.value=+r.value),r.op!=="="||typeof r.value!="number"||Number.isNaN(r.value))throw new Error('"level" attribute must be compared to a number');n.level=r.value;break}case"disabled":{vn(r,[!0,!1]),yn(r,["","="]),n.disabled=r.op===""?!0:r.value;break}case"name":{if(r.op==="")throw new Error('"name" attribute must have a value');if(typeof r.value!="string"&&!(r.value instanceof RegExp))throw new Error('"name" attribute must be a string or a regular expression');n.name=r.value,n.nameOp=r.op,n.exact=r.caseSensitive;break}case"include-hidden":{vn(r,[!0,!1]),yn(r,["","="]),n.includeHidden=r.op===""?!0:r.value;break}default:throw new Error(`Unknown attribute "${r.name}", must be one of ${pp.map(i=>`"${i}"`).join(", ")}.`)}return n}function _y(e,t,n){const r=[],i=o=>{if(ye(o)===t.role&&!(t.selected!==void 0&&Qh(o)!==t.selected)&&!(t.checked!==void 0&&Kh(o)!==t.checked)&&!(t.pressed!==void 0&&Xh(o)!==t.pressed)&&!(t.expanded!==void 0&&Jh(o)!==t.expanded)&&!(t.level!==void 0&&Yh(o)!==t.level)&&!(t.disabled!==void 0&&Ua(o)!==t.disabled)&&!(!t.includeHidden&&Ze(o))){if(t.name!==void 0){const l=ze(Gr(o,!!t.includeHidden));if(typeof t.name=="string"&&(t.name=ze(t.name)),n&&!t.exact&&t.nameOp==="="&&(t.nameOp="*="),!sp(l,{name:"",jsonPath:[],op:t.nameOp||"=",value:t.name,caseSensitive:!!t.exact}))return}r.push(o)}},s=o=>{const l=[];o.shadowRoot&&l.push(o.shadowRoot);for(const a of o.querySelectorAll("*"))i(a),a.shadowRoot&&l.push(a.shadowRoot);l.forEach(s)};return s(e),r}function Lc(e){return{queryAll:(t,n)=>{const r=on(n,!0),i=r.name.toLowerCase();if(!i)throw new Error("Role must not be empty");const s=wy(r.attributes,i);Ga();try{return _y(t,s,e)}finally{Xa()}}}}function xy(e,t,n){const r=e.left-t.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function Sy(e,t,n){const r=t.left-e.right;if(!(r<0||n!==void 0&&r>n))return r+Math.max(t.bottom-e.bottom,0)+Math.max(e.top-t.top,0)}function Ey(e,t,n){const r=t.top-e.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function ky(e,t,n){const r=e.top-t.bottom;if(!(r<0||n!==void 0&&r>n))return r+Math.max(e.left-t.left,0)+Math.max(t.right-e.right,0)}function Ty(e,t,n){const r=n===void 0?50:n;let i=0;return e.left-t.right>=0&&(i+=e.left-t.right),t.left-e.right>=0&&(i+=t.left-e.right),t.top-e.bottom>=0&&(i+=t.top-e.bottom),e.top-t.bottom>=0&&(i+=e.top-t.bottom),i>r?void 0:i}const Cy=["left-of","right-of","above","below","near"];function gp(e,t,n,r){const i=t.getBoundingClientRect(),s={"left-of":Sy,"right-of":xy,above:Ey,below:ky,near:Ty}[e];let o;for(const l of n){if(l===t)continue;const a=s(i,l.getBoundingClientRect(),r);a!==void 0&&(o===void 0||ar.every((u,c)=>a.rest[c]===u));if(o)return o.result;const l=i();return s.push({rest:r,result:l}),l}_checkSelector(t){if(!(typeof t=="object"&&t&&(Array.isArray(t)||"simples"in t&&t.simples.length)))throw new Error(`Malformed selector "${t}"`);return t}matches(t,n,r){const i=this._checkSelector(n);this.begin();try{return this._cached(this._cacheMatches,t,[i,r.scope,r.pierceShadow,r.originalScope],()=>Array.isArray(i)?this._matchesEngine(xr,t,i,r):(this._hasScopeClause(i)&&(r=this._expandContextForScopeMatching(r)),this._matchesSimple(t,i.simples[i.simples.length-1].selector,r)?this._matchesParents(t,i,i.simples.length-2,r):!1))}finally{this.end()}}query(t,n){const r=this._checkSelector(n);this.begin();try{return this._cached(this._cacheQuery,r,[t.scope,t.pierceShadow,t.originalScope],()=>{if(Array.isArray(r))return this._queryEngine(xr,t,r);this._hasScopeClause(r)&&(t=this._expandContextForScopeMatching(t));const i=this._scoreMap;this._scoreMap=new Map;let s=this._querySimple(t,r.simples[r.simples.length-1].selector);return s=s.filter(o=>this._matchesParents(o,r,r.simples.length-2,t)),this._scoreMap.size&&s.sort((o,l)=>{const a=this._scoreMap.get(o),u=this._scoreMap.get(l);return a===u?0:a===void 0?1:u===void 0?-1:a-u}),this._scoreMap=i,s})}finally{this.end()}}_markScore(t,n){this._scoreMap&&this._scoreMap.set(t,n)}_hasScopeClause(t){return t.simples.some(n=>n.selector.functions.some(r=>r.name==="scope"))}_expandContextForScopeMatching(t){if(t.scope.nodeType!==1)return t;const n=Se(t.scope);return n?{...t,scope:n,originalScope:t.originalScope||t.scope}:t}_matchesSimple(t,n,r){return this._cached(this._cacheMatchesSimple,t,[n,r.scope,r.pierceShadow,r.originalScope],()=>{if(t===r.scope||n.css&&!this._matchesCSS(t,n.css))return!1;for(const i of n.functions)if(!this._matchesEngine(this._getEngine(i.name),t,i.args,r))return!1;return!0})}_querySimple(t,n){return n.functions.length?this._cached(this._cacheQuerySimple,n,[t.scope,t.pierceShadow,t.originalScope],()=>{let r=n.css;const i=n.functions;r==="*"&&i.length&&(r=void 0);let s,o=-1;r!==void 0?s=this._queryCSS(t,r):(o=i.findIndex(l=>this._getEngine(l.name).query!==void 0),o===-1&&(o=0),s=this._queryEngine(this._getEngine(i[o].name),t,i[o].args));for(let l=0;lthis._matchesEngine(a,u,i[l].args,t)))}for(let l=0;lthis._matchesEngine(a,u,i[l].args,t)))}return s}):this._queryCSS(t,n.css||"*")}_matchesParents(t,n,r,i){return r<0?!0:this._cached(this._cacheMatchesParents,t,[n,r,i.scope,i.pierceShadow,i.originalScope],()=>{const{selector:s,combinator:o}=n.simples[r];if(o===">"){const l=Ei(t,i);return!l||!this._matchesSimple(l,s,i)?!1:this._matchesParents(l,n,r-1,i)}if(o==="+"){const l=So(t,i);return!l||!this._matchesSimple(l,s,i)?!1:this._matchesParents(l,n,r-1,i)}if(o===""){let l=Ei(t,i);for(;l;){if(this._matchesSimple(l,s,i)){if(this._matchesParents(l,n,r-1,i))return!0;if(n.simples[r-1].combinator==="")break}l=Ei(l,i)}return!1}if(o==="~"){let l=So(t,i);for(;l;){if(this._matchesSimple(l,s,i)){if(this._matchesParents(l,n,r-1,i))return!0;if(n.simples[r-1].combinator==="~")break}l=So(l,i)}return!1}if(o===">="){let l=t;for(;l;){if(this._matchesSimple(l,s,i)){if(this._matchesParents(l,n,r-1,i))return!0;if(n.simples[r-1].combinator==="")break}l=Ei(l,i)}return!1}throw new Error(`Unsupported combinator "${o}"`)})}_matchesEngine(t,n,r,i){if(t.matches)return this._callMatches(t,n,r,i);if(t.query)return this._callQuery(t,r,i).includes(n);throw new Error('Selector engine should implement "matches" or "query"')}_queryEngine(t,n,r){if(t.query)return this._callQuery(t,r,n);if(t.matches)return this._queryCSS(n,"*").filter(i=>this._callMatches(t,i,r,n));throw new Error('Selector engine should implement "matches" or "query"')}_callMatches(t,n,r,i){return this._cached(this._cacheCallMatches,n,[t,i.scope,i.pierceShadow,i.originalScope,...r],()=>t.matches(n,r,i,this))}_callQuery(t,n,r){return this._cached(this._cacheCallQuery,t,[r.scope,r.pierceShadow,r.originalScope,...n],()=>t.query(r,n,this))}_matchesCSS(t,n){return t.matches(n)}_queryCSS(t,n){return this._cached(this._cacheQueryCSS,n,[t.scope,t.pierceShadow,t.originalScope],()=>{let r=[];function i(s){if(r=r.concat([...s.querySelectorAll(n)]),!!t.pierceShadow){s.shadowRoot&&i(s.shadowRoot);for(const o of s.querySelectorAll("*"))o.shadowRoot&&i(o.shadowRoot)}}return i(t.scope),r})}_getEngine(t){const n=this._engines.get(t);if(!n)throw new Error(`Unknown selector engine "${t}"`);return n}}const xr={matches(e,t,n,r){if(t.length===0)throw new Error('"is" engine expects non-empty selector list');return t.some(i=>r.matches(e,i,n))},query(e,t,n){if(t.length===0)throw new Error('"is" engine expects non-empty selector list');let r=[];for(const i of t)r=r.concat(n.query(e,i));return t.length===1?r:mp(r)}},by={matches(e,t,n,r){if(t.length===0)throw new Error('"has" engine expects non-empty selector list');return r.query({...n,scope:e},t).length>0}},Ay={matches(e,t,n,r){if(t.length!==0)throw new Error('"scope" engine expects no arguments');const i=n.originalScope||n.scope;return i.nodeType===9?e===i.documentElement:e===i},query(e,t,n){if(t.length!==0)throw new Error('"scope" engine expects no arguments');const r=e.originalScope||e.scope;if(r.nodeType===9){const i=r.documentElement;return i?[i]:[]}return r.nodeType===1?[r]:[]}},Ly={matches(e,t,n,r){if(t.length===0)throw new Error('"not" engine expects non-empty selector list');return!r.matches(e,t,n)}},Iy={query(e,t,n){return n.query({...e,pierceShadow:!1},t)},matches(e,t,n,r){return r.matches(e,t,{...n,pierceShadow:!1})}},My={matches(e,t,n,r){if(t.length)throw new Error('"visible" engine expects no arguments');return nn(e)}},Py={matches(e,t,n,r){if(t.length!==1||typeof t[0]!="string")throw new Error('"text" engine expects a single string');const i=ze(t[0]).toLowerCase(),s=o=>o.normalized.toLowerCase().includes(i);return qs(r._cacheText,e,s)==="self"}},Ry={matches(e,t,n,r){if(t.length!==1||typeof t[0]!="string")throw new Error('"text-is" engine expects a single string');const i=ze(t[0]),s=o=>!i&&!o.immediate.length?!0:o.immediate.some(l=>ze(l)===i);return qs(r._cacheText,e,s)!=="none"}},$y={matches(e,t,n,r){if(t.length===0||typeof t[0]!="string"||t.length>2||t.length===2&&typeof t[1]!="string")throw new Error('"text-matches" engine expects a regexp body and optional regexp flags');const i=new RegExp(t[0],t.length===2?t[1]:void 0),s=o=>i.test(o.full);return qs(r._cacheText,e,s)==="self"}},Oy={matches(e,t,n,r){if(t.length!==1||typeof t[0]!="string")throw new Error('"has-text" engine expects a single string');if(Ja(e))return!1;const i=ze(t[0]).toLowerCase();return(o=>o.normalized.toLowerCase().includes(i))(Ae(r._cacheText,e))}};function hr(e){return{matches(t,n,r,i){const s=n.length&&typeof n[n.length-1]=="number"?n[n.length-1]:void 0,o=s===void 0?n:n.slice(0,n.length-1);if(n.length<1+(s===void 0?0:1))throw new Error(`"${e}" engine expects a selector list and optional maximum distance in pixels`);const l=i.query(r,o),a=gp(e,t,l,s);return a===void 0?!1:(i._markScore(t,a),!0)}}}const jy={query(e,t,n){let r=t[t.length-1];if(t.length<2)throw new Error('"nth-match" engine expects non-empty selector list and an index argument');if(typeof r!="number"||r<1)throw new Error('"nth-match" engine expects a one-based index as the last argument');const i=xr.query(e,t.slice(0,t.length-1),n);return r--,r1){const a=new Set(l.children);l.children=[];let u=o.firstElementChild;for(;u&&l.children.lengthWi(u)))]}else{const o=wn(e,t,n)||ki(e,t,n);r=[Wi(o)]}}const i=r[0],s=e.parseSelector(i);return{selector:i,selectors:r,elements:e.querySelectorAll(s,n.root??t.ownerDocument)}}finally{Pl.clear(),Rl.clear(),Xa(),e._evaluator.end()}}function Pc(e){return e.filter(t=>t[0].selector[0]!=="/")}function wn(e,t,n){if(n.root&&!Bs(n.root,t))throw new Error("Target element must belong to the root's subtree");if(t===n.root)return[{engine:"css",selector:":scope",score:1}];if(t.ownerDocument.documentElement===t)return[{engine:"css",selector:"html",score:1}];const r=(s,o)=>{const l=s===t;let a=o?e1(e,s,s===t):[];s!==t&&(a=Pc(a));const u=Zy(e,s,n).filter(d=>!n.omitInternalEngines||!d.engine.startsWith("internal:")).map(d=>[d]);let c=Rc(e,n.root??t.ownerDocument,s,[...a,...u],l);a=Pc(a);const f=d=>{const g=o&&!d.length,m=[...d,...u].filter(_=>c?At(_)=At(c))continue;if(y=Rc(e,_,s,m,l),!y)return;const h=[...p,...y];(!c||At(h){const l=o?Pl:Rl;let a=l.get(s);return a===void 0&&(a=r(s,o),l.set(s,a)),a};return r(t,!n.noText)}function Zy(e,t,n){const r=[];{for(const o of["data-testid","data-test-id","data-test"])o!==n.testIdAttributeName&&t.getAttribute(o)&&r.push({engine:"css",selector:`[${o}=${cr(t.getAttribute(o))}]`,score:zy});if(!n.noCSSId){const o=t.getAttribute("id");o&&!t1(o)&&r.push({engine:"css",selector:Tp(o),score:Gy})}r.push({engine:"css",selector:Ve(t.nodeName.toLowerCase()),score:Ep})}if(t.nodeName==="IFRAME"){for(const o of["name","title"])t.getAttribute(o)&&r.push({engine:"css",selector:`${Ve(t.nodeName.toLowerCase())}[${o}=${cr(t.getAttribute(o))}]`,score:Dy});return t.getAttribute(n.testIdAttributeName)&&r.push({engine:"css",selector:`[${n.testIdAttributeName}=${cr(t.getAttribute(n.testIdAttributeName))}]`,score:Ic}),Ol([r]),r}if(t.getAttribute(n.testIdAttributeName)&&r.push({engine:"internal:testid",selector:`[${n.testIdAttributeName}=${xe(t.getAttribute(n.testIdAttributeName),!0)}]`,score:Ic}),t.nodeName==="INPUT"||t.nodeName==="TEXTAREA"){const o=t;if(o.placeholder){r.push({engine:"internal:attr",selector:`[placeholder=${xe(o.placeholder,!0)}]`,score:Uy});for(const l of Pn(o.placeholder))r.push({engine:"internal:attr",selector:`[placeholder=${xe(l.text,!1)}]`,score:yp-l.scoreBouns})}}const i=op(e._evaluator._cacheText,t);for(const o of i){const l=o.normalized;r.push({engine:"internal:label",selector:qe(l,!0),score:Vy});for(const a of Pn(l))r.push({engine:"internal:label",selector:qe(a.text,!1),score:wp-a.scoreBouns})}const s=ye(t);return s&&!["none","presentation"].includes(s)&&r.push({engine:"internal:role",selector:s,score:Xy}),t.getAttribute("name")&&["BUTTON","FORM","FIELDSET","FRAME","IFRAME","INPUT","KEYGEN","OBJECT","OUTPUT","SELECT","TEXTAREA","MAP","META","PARAM"].includes(t.nodeName)&&r.push({engine:"css",selector:`${Ve(t.nodeName.toLowerCase())}[name=${cr(t.getAttribute("name"))}]`,score:Eo}),["INPUT","TEXTAREA"].includes(t.nodeName)&&t.getAttribute("type")!=="hidden"&&t.getAttribute("type")&&r.push({engine:"css",selector:`${Ve(t.nodeName.toLowerCase())}[type=${cr(t.getAttribute("type"))}]`,score:Eo}),["INPUT","TEXTAREA","SELECT"].includes(t.nodeName)&&t.getAttribute("type")!=="hidden"&&r.push({engine:"css",selector:Ve(t.nodeName.toLowerCase()),score:Eo+1}),Ol([r]),r}function e1(e,t,n){if(t.nodeName==="SELECT")return[];const r=[],i=t.getAttribute("title");if(i){r.push([{engine:"internal:attr",selector:`[title=${xe(i,!0)}]`,score:Qy}]);for(const a of Pn(i))r.push([{engine:"internal:attr",selector:`[title=${xe(a.text,!1)}]`,score:Sp-a.scoreBouns}])}const s=t.getAttribute("alt");if(s&&["APPLET","AREA","IMG","INPUT"].includes(t.nodeName)){r.push([{engine:"internal:attr",selector:`[alt=${xe(s,!0)}]`,score:qy}]);for(const a of Pn(s))r.push([{engine:"internal:attr",selector:`[alt=${xe(a.text,!1)}]`,score:xp-a.scoreBouns}])}const o=Ae(e._evaluator._cacheText,t).normalized;if(o){const a=Pn(o);if(n){o.length<=80&&r.push([{engine:"internal:text",selector:qe(o,!0),score:Wy}]);for(const c of a)r.push([{engine:"internal:text",selector:qe(c.text,!1),score:$l-c.scoreBouns}])}const u={engine:"css",selector:Ve(t.nodeName.toLowerCase()),score:Ep};for(const c of a)r.push([u,{engine:"internal:has-text",selector:qe(c.text,!1),score:$l-c.scoreBouns}]);if(o.length<=80){const c=new RegExp("^"+bl(o)+"$");r.push([u,{engine:"internal:has-text",selector:qe(c,!1),score:Hy}])}}const l=ye(t);if(l&&!["none","presentation"].includes(l)){const a=Gr(t,!1);if(a){r.push([{engine:"internal:role",selector:`${l}[name=${xe(a,!0)}]`,score:By}]);for(const u of Pn(a))r.push([{engine:"internal:role",selector:`${l}[name=${xe(u.text,!1)}]`,score:_p-u.scoreBouns}])}}return Ol(r),r}function Tp(e){return/^[a-zA-Z][a-zA-Z0-9\-\_]+$/.test(e)?"#"+e:`[id="${Ve(e)}"]`}function ko(e){return e.some(t=>t.engine==="css"&&(t.selector.startsWith("#")||t.selector.startsWith('[id="')))}function ki(e,t,n){const r=n.root??t.ownerDocument,i=[];function s(l){const a=i.slice();l&&a.unshift(l);const u=a.join(" > "),c=e.parseSelector(u);return e.querySelector(c,r,!1)===t?u:void 0}function o(l){const a={engine:"css",selector:l,score:Jy},u=e.parseSelector(l),c=e.querySelectorAll(u,r);if(c.length===1)return[a];const f={engine:"nth",selector:String(c.indexOf(t)),score:kp};return[a,f]}for(let l=t;l&&l!==r;l=Se(l)){const a=l.nodeName.toLowerCase();let u="";if(l.id&&!n.noCSSId){const d=Tp(l.id),g=s(d);if(g)return o(g);u=d}const c=l.parentNode,f=[...l.classList];for(let d=0;d_.nodeName.toLowerCase()===a).indexOf(l)===0?Ve(a):`${Ve(a)}:nth-child(${1+d.indexOf(l)})`,y=s(m);if(y)return o(y);u||(u=m)}else u||(u=Ve(a));i.unshift(u)}return o(s())}function Ol(e){for(const t of e)for(const n of t)n.score>Fy&&n.score>"),n=r,r==="css"?t.push(i):t.push(`${r}=${i}`);return t.join(" ")}function At(e){let t=0;for(let n=0;n({tokens:l,score:At(l)}));s.sort((l,a)=>l.score-a.score);let o=null;for(const{tokens:l}of s){const a=e.parseSelector(Wi(l)),u=e.querySelectorAll(a,t);if(u[0]===n&&u.length===1)return l;const c=u.indexOf(n);if(!i||o||c===-1||u.length>5)continue;const f={engine:"nth",selector:String(c),score:kp};o=[...l,f]}return o}function t1(e){let t,n=0;for(let r=0;r="a"&&i<="z"?s="lower":i>="A"&&i<="Z"?s="upper":i>="0"&&i<="9"?s="digit":s="other",s==="lower"&&t==="upper"){t=s;continue}t&&t!==s&&++n,t=s}}return n>=e.length/4}function Ti(e,t){if(e.length<=t)return e;e=e.substring(0,t);const n=e.match(/^(.*)\b(.+?)$/);return n?n[1].trimEnd():""}function Pn(e){let t=[];{const n=e.match(/^([\d.,]+)[^.,\w]/),r=n?n[1].length:0;if(r){const i=Ti(e.substring(r).trimStart(),80);t.push({text:i,scoreBouns:i.length<=30?2:1})}}{const n=e.match(/[^.,\w]([\d.,]+)$/),r=n?n[1].length:0;if(r){const i=Ti(e.substring(0,e.length-r).trimEnd(),80);t.push({text:i,scoreBouns:i.length<=30?2:1})}}return e.length<=30?t.push({text:e,scoreBouns:0}):(t.push({text:Ti(e,80),scoreBouns:0}),t.push({text:Ti(e,30),scoreBouns:1})),t=t.filter(n=>n.text),t.length||t.push({text:e.substring(0,80),scoreBouns:0}),t}const $c=":host{font-size:13px;font-family:system-ui,Ubuntu,Droid Sans,sans-serif;color:#333}svg{position:absolute;height:0}x-pw-tooltip{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fff;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:none;font-size:12.8px;font-weight:400;left:0;line-height:1.5;max-width:600px;position:absolute;top:0;padding:0;flex-direction:column;overflow:hidden}x-pw-tooltip-line{display:flex;max-width:600px;padding:6px;-webkit-user-select:none;user-select:none;cursor:pointer}x-pw-tooltip-line.selectable:hover{background-color:#f2f2f2;overflow:hidden}x-pw-tooltip-footer{display:flex;max-width:600px;padding:6px;-webkit-user-select:none;user-select:none;color:#777}x-pw-dialog{background-color:#fff;pointer-events:auto;border-radius:6px;box-shadow:0 .5rem 1.2rem #0000004d;display:flex;flex-direction:column;position:absolute;width:400px;height:150px;z-index:10;font-size:13px}x-pw-dialog-body{display:flex;flex-direction:column;flex:auto}x-pw-dialog-body label{margin:5px 8px;display:flex;flex-direction:row;align-items:center}x-pw-highlight{position:absolute;top:0;left:0;width:0;height:0}x-pw-action-point{position:absolute;width:20px;height:20px;background:red;border-radius:10px;margin:-10px 0 0 -10px;z-index:2}x-pw-separator{height:1px;margin:6px 9px;background:#949494e5}x-pw-tool-gripper{height:28px;width:24px;margin:2px 0;cursor:grab}x-pw-tool-gripper:active{cursor:grabbing}x-pw-tool-gripper>x-div{width:16px;height:16px;margin:6px 4px;clip-path:url(#icon-gripper);background-color:#555}x-pw-tools-list>label{display:flex;align-items:center;margin:0 10px;-webkit-user-select:none;user-select:none}x-pw-tools-list{display:flex;width:100%;border-bottom:1px solid #dddddd}x-pw-tool-item{pointer-events:auto;cursor:pointer;height:28px;width:28px;border-radius:3px}x-pw-tool-item:not(.disabled):hover{background-color:#dbdbdb}x-pw-tool-item.active{background-color:#8acae480}x-pw-tool-item.active:not(.disabled):hover{background-color:#8acae4c4}x-pw-tool-item>x-div{width:16px;height:16px;margin:6px;background-color:#3a3a3a}x-pw-tool-item.disabled>x-div{background-color:#61616180;cursor:default}x-pw-tool-item.record.active{background-color:transparent}x-pw-tool-item.record.active:hover{background-color:#dbdbdb}x-pw-tool-item.record.active>x-div{background-color:#a1260d}x-pw-tool-item.accept>x-div{background-color:#388a34}x-pw-tool-item.record>x-div{clip-path:url(#icon-circle-large-filled)}x-pw-tool-item.pick-locator>x-div{clip-path:url(#icon-inspect)}x-pw-tool-item.text>x-div{clip-path:url(#icon-whole-word)}x-pw-tool-item.visibility>x-div{clip-path:url(#icon-eye)}x-pw-tool-item.value>x-div{clip-path:url(#icon-symbol-constant)}x-pw-tool-item.snapshot>x-div{clip-path:url(#icon-gist)}x-pw-tool-item.accept>x-div{clip-path:url(#icon-check)}x-pw-tool-item.cancel>x-div{clip-path:url(#icon-close)}x-pw-tool-item.succeeded>x-div{clip-path:url(#icon-pass);background-color:#388a34!important}x-pw-overlay{position:absolute;top:0;max-width:min-content;z-index:2147483647;background:transparent;pointer-events:auto}x-pw-overlay x-pw-tools-list{background-color:#fffd;box-shadow:#0000001a 0 5px 5px;border-radius:3px;border-bottom:none}x-pw-overlay x-pw-tool-item{margin:2px}textarea.text-editor{font-family:system-ui,Ubuntu,Droid Sans,sans-serif;flex:auto;border:none;margin:6px 10px;color:#333;outline:1px solid transparent!important;resize:none;padding:0;font-size:13px}textarea.text-editor.does-not-match{outline:1px solid red!important}x-div{display:block}x-spacer{flex:auto}*{box-sizing:border-box}*[hidden]{display:none!important}x-locator-editor{flex:none;width:100%;height:60px;padding:4px;border-bottom:1px solid #dddddd;outline:1px solid transparent}x-locator-editor.does-not-match{outline:1px solid red}.CodeMirror{width:100%!important;height:100%!important}";class To{constructor(t){this._highlightEntries=[],this._highlightOptions={},this._language="javascript",this._injectedScript=t;const n=t.document;this._isUnderTest=t.isUnderTest,this._glassPaneElement=n.createElement("x-pw-glass"),this._glassPaneElement.style.position="fixed",this._glassPaneElement.style.top="0",this._glassPaneElement.style.right="0",this._glassPaneElement.style.bottom="0",this._glassPaneElement.style.left="0",this._glassPaneElement.style.zIndex="2147483646",this._glassPaneElement.style.pointerEvents="none",this._glassPaneElement.style.display="flex",this._glassPaneElement.style.backgroundColor="transparent";for(const r of["click","auxclick","dragstart","input","keydown","keyup","pointerdown","pointerup","mousedown","mouseup","mouseleave","focus","scroll"])this._glassPaneElement.addEventListener(r,i=>{i.stopPropagation(),i.stopImmediatePropagation(),i.type==="click"&&i.button===0&&this._highlightOptions.tooltipListItemSelected&&this._highlightOptions.tooltipListItemSelected(void 0)});if(this._actionPointElement=n.createElement("x-pw-action-point"),this._actionPointElement.setAttribute("hidden","true"),this._glassPaneShadow=this._glassPaneElement.attachShadow({mode:this._isUnderTest?"open":"closed"}),typeof this._glassPaneShadow.adoptedStyleSheets.push=="function"){const r=new this._injectedScript.window.CSSStyleSheet;r.replaceSync($c),this._glassPaneShadow.adoptedStyleSheets.push(r)}else{const r=this._injectedScript.document.createElement("style");r.textContent=$c,this._glassPaneShadow.appendChild(r)}this._glassPaneShadow.appendChild(this._actionPointElement)}install(){this._injectedScript.document.documentElement&&!this._injectedScript.document.documentElement.contains(this._glassPaneElement)&&this._injectedScript.document.documentElement.appendChild(this._glassPaneElement)}setLanguage(t){this._language=t}runHighlightOnRaf(t){this._rafRequest&&cancelAnimationFrame(this._rafRequest),this.updateHighlight(this._injectedScript.querySelectorAll(t,this._injectedScript.document.documentElement),{tooltipText:Fn(this._language,yt(t))}),this._rafRequest=this._injectedScript.builtinRequestAnimationFrame(()=>this.runHighlightOnRaf(t))}uninstall(){this._rafRequest&&cancelAnimationFrame(this._rafRequest),this._glassPaneElement.remove()}showActionPoint(t,n){this._actionPointElement.style.top=n+"px",this._actionPointElement.style.left=t+"px",this._actionPointElement.hidden=!1}hideActionPoint(){this._actionPointElement.hidden=!0}clearHighlight(){var t,n;for(const r of this._highlightEntries)(t=r.highlightElement)==null||t.remove(),(n=r.tooltipElement)==null||n.remove();this._highlightEntries=[],this._highlightOptions={},this._glassPaneElement.style.pointerEvents="none"}updateHighlight(t,n){this._innerUpdateHighlight(t,n)}maskElements(t,n){this._innerUpdateHighlight(t,{color:n})}_innerUpdateHighlight(t,n){let r=n.color;if(r||(r=t.length>1?"#f6b26b7f":"#6fa8dc7f"),!this._highlightIsUpToDate(t,n)){this.clearHighlight(),this._highlightOptions=n,this._glassPaneElement.style.pointerEvents=n.tooltipListItemSelected?"initial":"none";for(let i=0;i1?` [${i+1} of ${t.length}]`:"";l=[n.tooltipText+a]}for(let a=0;a{var c;return(c=n.tooltipListItemSelected)==null?void 0:c.call(n,a)}))}if(n.tooltipFooter){const a=this._injectedScript.document.createElement("x-pw-tooltip-footer");a.textContent=n.tooltipFooter,o.appendChild(a)}}this._highlightEntries.push({targetElement:t[i],tooltipElement:o,highlightElement:s})}for(const i of this._highlightEntries){if(i.box=i.targetElement.getBoundingClientRect(),!i.tooltipElement)continue;const{anchorLeft:s,anchorTop:o}=this.tooltipPosition(i.box,i.tooltipElement);i.tooltipTop=o,i.tooltipLeft=s}for(const i of this._highlightEntries){i.tooltipElement&&(i.tooltipElement.style.top=i.tooltipTop+"px",i.tooltipElement.style.left=i.tooltipLeft+"px");const s=i.box;i.highlightElement.style.backgroundColor=r,i.highlightElement.style.left=s.x+"px",i.highlightElement.style.top=s.y+"px",i.highlightElement.style.width=s.width+"px",i.highlightElement.style.height=s.height+"px",i.highlightElement.style.display="block",this._isUnderTest&&console.error("Highlight box for test: "+JSON.stringify({x:s.x,y:s.y,width:s.width,height:s.height}))}}}firstBox(){var t;return(t=this._highlightEntries[0])==null?void 0:t.box}tooltipPosition(t,n){const r=n.offsetWidth,i=n.offsetHeight,s=this._glassPaneElement.offsetWidth,o=this._glassPaneElement.offsetHeight;let l=t.left;l+r>s-5&&(l=s-r-5);let a=t.bottom+5;return a+i>o-5&&(t.top>i+5?a=t.top-i-5:a=o-5-i),{anchorLeft:l,anchorTop:a}}_highlightIsUpToDate(t,n){var r,i;if(n.tooltipText!==this._highlightOptions.tooltipText||n.tooltipListItemSelected!==this._highlightOptions.tooltipListItemSelected||n.tooltipFooter!==this._highlightOptions.tooltipFooter||((r=n.tooltipList)==null?void 0:r.length)!==((i=this._highlightOptions.tooltipList)==null?void 0:i.length))return!1;if(n.tooltipList&&this._highlightOptions.tooltipList){for(let s=0;s{switch(t){case"\\":return"\\\\";case'"':return'\\"';case"\b":return"\\b";case"\f":return"\\f";case` +`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return"\\x"+t.charCodeAt(0).toString(16).padStart(2,"0")}})+'"':e}function Cp(e){return!!(e.length===0||/^\s|\s$/.test(e)||/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(e)||/^-\s/.test(e)||/[\n:](\s|$)/.test(e)||/\s#/.test(e)||/[\n\r]/.test(e)||/^[&*\],?!>|@"'#%]/.test(e)||/[{}`]/.test(e)||!isNaN(Number(e))||["y","n","yes","no","true","false","on","off","null"].includes(e.toLowerCase()))}function Ya(e){const t=new Set,n=(s,o)=>{if(t.has(o))return;if(t.add(o),o.nodeType===Node.TEXT_NODE&&o.nodeValue){o.nodeValue&&s.children.push(o.nodeValue||"");return}if(o.nodeType!==Node.ELEMENT_NODE)return;const l=o;if(Ze(l))return;const a=[];if(l.hasAttribute("aria-owns")){const c=l.getAttribute("aria-owns").split(/\s+/);for(const f of c){const d=e.ownerDocument.getElementById(f);d&&a.push(d)}}const u=r1(l);u&&s.children.push(u),r(u||s,l,a)};function r(s,o,l=[]){var f;const u=(((f=gn(o))==null?void 0:f.display)||"inline")!=="inline"||o.nodeName==="BR"?" ":"";u&&s.children.push(u),s.children.push(xs(o,"::before"));const c=o.nodeName==="SLOT"?o.assignedNodes():[];if(c.length)for(const d of c)n(s,d);else{for(let d=o.firstChild;d;d=d.nextSibling)d.assignedSlot||n(s,d);if(o.shadowRoot)for(let d=o.shadowRoot.firstChild;d;d=d.nextSibling)n(s,d)}for(const d of l)n(s,d);s.children.push(xs(o,"::after")),u&&s.children.push(u),s.children.length===1&&s.name===s.children[0]&&(s.children=[])}Ga();const i={role:"fragment",name:"",children:[],element:e};try{n(i,e)}finally{Xa()}return s1(i),i}function r1(e){const t=ye(e);if(!t||t==="presentation"||t==="none")return null;const n=Gr(e,!1)||"",r={role:t,name:n,children:[],element:e};return za.includes(t)&&(r.checked=Kh(e)),Zh.includes(t)&&(r.disabled=Ua(e)),Fa.includes(t)&&(r.expanded=Jh(e)),Ha.includes(t)&&(r.level=Yh(e)),Da.includes(t)&&(r.pressed=Xh(e)),ja.includes(t)&&(r.selected=Qh(e)),(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&(r.children=[e.value]),r}function i1(e,t){return jl(Ya(e),t)}function s1(e){const t=(r,i)=>{if(!r.length)return;const s=o1(r.join("")).trim();s&&i.push(s),r.length=0},n=r=>{const i=[],s=[];for(const o of r.children||[])typeof o=="string"?s.push(o):(t(s,i),n(o),i.push(o));t(s,i),r.children=i.length?i:[],r.children.length===1&&r.children[0]===r.name&&(r.children=[])};n(e)}const o1=e=>e.replace(/[\u200b\s\t\r\n]+/g," ");function Np(e,t){return t?e?typeof t=="string"?e===t:!!e.match(t):!1:!0}function l1(e,t){return Np(e,t.text)}function a1(e,t){return Np(e,t.name)}function u1(e,t){const n=Ya(e);return{matches:Ap(n,t,!1),received:{raw:jl(n,{mode:"raw"}),regex:jl(n,{mode:"regex"})}}}function c1(e,t){const n=Ya(e);return Ap(n,t,!0).map(i=>i.element)}function bp(e,t,n){return typeof e=="string"&&t.kind==="text"?l1(e,t):typeof e=="object"&&t.kind==="role"?!(t.role!=="fragment"&&t.role!==e.role||t.checked!==void 0&&t.checked!==e.checked||t.disabled!==void 0&&t.disabled!==e.disabled||t.expanded!==void 0&&t.expanded!==e.expanded||t.level!==void 0&&t.level!==e.level||t.pressed!==void 0&&t.pressed!==e.pressed||t.selected!==void 0&&t.selected!==e.selected||!a1(e.name,t)||!d1(e.children||[],t.children||[])):!1}function d1(e,t,n){if(t.length>e.length)return!1;const r=e.slice(),i=t.slice();for(const s of i){let o=r.shift();for(;o&&!bp(o,s);)o=r.shift();if(!o)return!1}return!0}function Ap(e,t,n){const r=[],i=s=>{if(bp(s,t))return r.push(s),!n;if(typeof s=="string")return!1;for(const o of s.children||[])if(i(o))return!0;return!1};return i(e),r}function jl(e,t){const n=[],r=(t==null?void 0:t.mode)==="regex"?h1:()=>!0,i=(t==null?void 0:t.mode)==="regex"?f1:o=>o,s=(o,l,a)=>{if(typeof o=="string"){if(l&&!r(l,o))return;const f=Oc(i(o));f&&n.push(a+"- text: "+f);return}let u=o.role;if(o.name&&o.name.length<=900){const f=i(o.name);if(f){const d=f.startsWith("/")&&f.endsWith("/")?f:JSON.stringify(f);u+=" "+d}}o.checked==="mixed"&&(u+=" [checked=mixed]"),o.checked===!0&&(u+=" [checked]"),o.disabled&&(u+=" [disabled]"),o.expanded&&(u+=" [expanded]"),o.level&&(u+=` [level=${o.level}]`),o.pressed==="mixed"&&(u+=" [pressed=mixed]"),o.pressed===!0&&(u+=" [pressed]"),o.selected===!0&&(u+=" [selected]");const c=a+"- "+n1(u);if(!o.children.length)n.push(c);else if(o.children.length===1&&typeof o.children[0]=="string"){const f=r(o,o.children[0])?i(o.children[0]):null;f?n.push(c+": "+Oc(f)):n.push(c)}else{n.push(c+":");for(const f of o.children||[])s(f,o,a+" ")}};if(e.role==="fragment")for(const o of e.children||[])s(o,e,"");else s(e,null,"");return n.join(` +`)}function f1(e){const t=[{regex:/\b[\d,.]+[bkmBKM]+\b/,replacement:"[\\d,.]+[bkmBKM]+"},{regex:/\b\d+[hmsp]+\b/,replacement:"\\d+[hmsp]+"},{regex:/\b[\d,.]+[hmsp]+\b/,replacement:"[\\d,.]+[hmsp]+"},{regex:/\b\d+,\d+\b/,replacement:"\\d+,\\d+"},{regex:/\b\d+\.\d{2,}\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\.\d+\b/,replacement:"\\d+\\.\\d+"},{regex:/\b\d{2,}\b/,replacement:"\\d+"}];let n="",r=0;const i=new RegExp(t.map(s=>"("+s.regex.source+")").join("|"),"g");return e.replace(i,(s,...o)=>{const l=o[o.length-2],a=o.slice(0,-2);n+=bl(e.slice(r,l));for(let u=0;ut.length)return!1;const n=t.length<=200&&e.name.length<=200?Ov(t,e.name):"";let r=t;for(;n&&r.includes(n);)r=r.replace(n,"");return r.trim().length/t.length>.1}function p1(e){const t={kind:"role",role:"fragment"};return Lp(t,e),t.children&&t.children.length===1?t.children[0]:t}function Lp(e,t){for(const n of t){if(typeof n=="string"){const r=Ss.parse(n);e.children=e.children||[],e.children.push(r);continue}for(const r of Object.keys(n)){e.children=e.children||[];const i=n[r];if(r==="text"){e.children.push({kind:"text",text:Co(i)});continue}const s=Ss.parse(r);if(s.kind==="text"){e.children.push({kind:"text",text:Co(i)});continue}if(typeof i=="string"){e.children.push({...s,children:[{kind:"text",text:Co(i)}]});continue}e.children.push(s),Lp(s,i)}}}function g1(e){return e.replace(/[\r\n\s\t]+/g," ").trim()}function Co(e){return e.startsWith("/")&&e.endsWith("/")?new RegExp(e.slice(1,-1)):g1(e)}class Ss{static parse(t){return new Ss(t)._parse()}constructor(t){this._input=t,this._pos=0,this._length=t.length}_peek(){return this._input[this._pos]||""}_next(){return this._pos=this._length}_isWhitespace(){return!this._eof()&&/\s/.test(this._peek())}_skipWhitespace(){for(;this._isWhitespace();)this._pos++}_readIdentifier(t){this._eof()&&this._throwError(`Unexpected end of input when expecting ${t}`);const n=this._pos;for(;!this._eof()&&/[a-zA-Z]/.test(this._peek());)this._pos++;return this._input.slice(n,this._pos)}_readString(){let t="",n=!1;for(;!this._eof();){const r=this._next();if(n)t+=r,n=!1;else if(r==="\\")n=!0;else{if(r==='"')return t;t+=r}}this._throwError("Unterminated string")}_throwError(t,n){throw new m1(t,this._input,n||this._pos)}_readRegex(){let t="",n=!1,r=!1;for(;!this._eof();){const i=this._next();if(n)t+=i,n=!1;else if(i==="\\")n=!0,t+=i;else{if(i==="/"&&!r)return t;i==="["?(r=!0,t+=i):i==="]"&&r?(t+=i,r=!1):t+=i}}this._throwError("Unterminated regex")}_readStringOrRegex(){const t=this._peek();return t==='"'?(this._next(),this._readString()):t==="/"?(this._next(),new RegExp(this._readRegex())):null}_readAttributes(t){let n=this._pos;for(;this._skipWhitespace(),this._peek()==="[";){this._next(),this._skipWhitespace(),n=this._pos;const r=this._readIdentifier("attribute");this._skipWhitespace();let i="";if(this._peek()==="=")for(this._next(),this._skipWhitespace(),n=this._pos;this._peek()!=="]"&&!this._isWhitespace()&&!this._eof();)i+=this._next();this._skipWhitespace(),this._peek()!=="]"&&this._throwError("Expected ]"),this._next(),this._applyAttribute(t,r,i||"true",n)}}_parse(){this._skipWhitespace();const t=this._readIdentifier("role");this._skipWhitespace();const n=this._readStringOrRegex()||"",r={kind:"role",role:t,name:n};return this._readAttributes(r),this._skipWhitespace(),this._eof()||this._throwError("Unexpected input"),r}_applyAttribute(t,n,r,i){if(n==="checked"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "checked" attribute must be a boolean or "mixed"',i),t.checked=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="disabled"){this._assert(r==="true"||r==="false",'Value of "disabled" attribute must be a boolean',i),t.disabled=r==="true";return}if(n==="expanded"){this._assert(r==="true"||r==="false",'Value of "expanded" attribute must be a boolean',i),t.expanded=r==="true";return}if(n==="level"){this._assert(!isNaN(Number(r)),'Value of "level" attribute must be a number',i),t.level=Number(r);return}if(n==="pressed"){this._assert(r==="true"||r==="false"||r==="mixed",'Value of "pressed" attribute must be a boolean or "mixed"',i),t.pressed=r==="true"?!0:r==="false"?!1:"mixed";return}if(n==="selected"){this._assert(r==="true"||r==="false",'Value of "selected" attribute must be a boolean',i),t.selected=r==="true";return}this._assert(!1,`Unsupported attribute [${n}]`,i)}_assert(t,n,r){t||this._throwError(n||"Assertion error",r)}}class m1 extends Error{constructor(t,n,r){super(t+`: + +`+n+` +`+" ".repeat(r)+`^ +`),this.shortMessage=t,this.pos=r,this.stack=void 0}}class Ip{constructor(t,n,r,i,s,o,l){this.onGlobalListenersRemoved=new Set,this._testIdAttributeNameForStrictErrorAndConsoleCodegen="data-testid",this.utils={asLocator:Fn,cacheNormalizedWhitespaces:Rv,elementText:Ae,getAriaRole:ye,getElementAccessibleDescription:bc,getElementAccessibleName:Gr,isElementVisible:nn,isInsideScope:Bs,normalizeWhiteSpace:ze,parseYamlTemplate:p1},this.window=t,this.document=t.document,this.isUnderTest=n,this._sdkLanguage=r,this._testIdAttributeNameForStrictErrorAndConsoleCodegen=i,this._evaluator=new Ny(new Map),this._engines=new Map,this._engines.set("xpath",Ec),this._engines.set("xpath:light",Ec),this._engines.set("_react",hy),this._engines.set("_vue",yy),this._engines.set("role",Lc(!1)),this._engines.set("text",this._createTextEngine(!0,!1)),this._engines.set("text:light",this._createTextEngine(!1,!1)),this._engines.set("id",this._createAttributeEngine("id",!0)),this._engines.set("id:light",this._createAttributeEngine("id",!1)),this._engines.set("data-testid",this._createAttributeEngine("data-testid",!0)),this._engines.set("data-testid:light",this._createAttributeEngine("data-testid",!1)),this._engines.set("data-test-id",this._createAttributeEngine("data-test-id",!0)),this._engines.set("data-test-id:light",this._createAttributeEngine("data-test-id",!1)),this._engines.set("data-test",this._createAttributeEngine("data-test",!0)),this._engines.set("data-test:light",this._createAttributeEngine("data-test",!1)),this._engines.set("css",this._createCSSEngine()),this._engines.set("nth",{queryAll:()=>[]}),this._engines.set("visible",this._createVisibleEngine()),this._engines.set("internal:control",this._createControlEngine()),this._engines.set("internal:has",this._createHasEngine()),this._engines.set("internal:has-not",this._createHasNotEngine()),this._engines.set("internal:and",{queryAll:()=>[]}),this._engines.set("internal:or",{queryAll:()=>[]}),this._engines.set("internal:chain",this._createInternalChainEngine()),this._engines.set("internal:label",this._createInternalLabelEngine()),this._engines.set("internal:text",this._createTextEngine(!0,!0)),this._engines.set("internal:has-text",this._createInternalHasTextEngine()),this._engines.set("internal:has-not-text",this._createInternalHasNotTextEngine()),this._engines.set("internal:attr",this._createNamedAttributeEngine()),this._engines.set("internal:testid",this._createNamedAttributeEngine()),this._engines.set("internal:role",Lc(!0));for(const{name:a,engine:u}of l)this._engines.set(a,u);this._stableRafCount=s,this._browserName=o,Z0(o),this._setupGlobalListenersRemovalDetection(),this._setupHitTargetInterceptors(),n&&(this.window.__injectedScript=this)}builtinSetTimeout(t,n){var r;return(r=this.window.__pwClock)!=null&&r.builtin?this.window.__pwClock.builtin.setTimeout(t,n):this.window.setTimeout(t,n)}builtinClearTimeout(t){var n;return(n=this.window.__pwClock)!=null&&n.builtin?this.window.__pwClock.builtin.clearTimeout(t):this.window.clearTimeout(t)}builtinRequestAnimationFrame(t){var n;return(n=this.window.__pwClock)!=null&&n.builtin?this.window.__pwClock.builtin.requestAnimationFrame(t):this.window.requestAnimationFrame(t)}eval(t){return this.window.eval(t)}testIdAttributeNameForStrictErrorAndConsoleCodegen(){return this._testIdAttributeNameForStrictErrorAndConsoleCodegen}parseSelector(t){const n=Us(t);return t0(n,r=>{if(!this._engines.has(r.name))throw this.createStacklessError(`Unknown engine "${r.name}" while parsing selector ${t}`)}),n}generateSelector(t,n){return Mc(this,t,n)}generateSelectorSimple(t,n){return Mc(this,t,{...n,testIdAttributeName:this._testIdAttributeNameForStrictErrorAndConsoleCodegen}).selector}querySelector(t,n,r){const i=this.querySelectorAll(t,n);if(r&&i.length>1)throw this.strictModeViolationError(t,i);return i[0]}_queryNth(t,n){const r=[...t];let i=+n.body;return i===-1&&(i=r.length-1),new Set(r.slice(i,i+1))}_queryLayoutSelector(t,n,r){const i=n.name,s=n.body,o=[],l=this.querySelectorAll(s.parsed,r);for(const a of t){const u=gp(i,a,l,s.distance);u!==void 0&&o.push({element:a,score:u})}return o.sort((a,u)=>a.score-u.score),new Set(o.map(a=>a.element))}ariaSnapshot(t,n){if(t.nodeType!==Node.ELEMENT_NODE)throw this.createStacklessError("Can only capture aria snapshot of Element nodes.");return i1(t,n)}getAllByAria(t,n){return c1(t.documentElement,n)}querySelectorAll(t,n){if(t.capture!==void 0){if(t.parts.some(i=>i.name==="nth"))throw this.createStacklessError("Can't query n-th element in a request with the capture.");const r={parts:t.parts.slice(0,t.capture+1)};if(t.capturer.has(o)))}else if(i.name==="internal:or"){const s=this.querySelectorAll(i.body.parsed,n);r=new Set(mp(new Set([...r,...s])))}else if(Cy.includes(i.name))r=this._queryLayoutSelector(r,i,n);else{const s=new Set;for(const o of r){const l=this._queryEngineAll(i,o);for(const a of l)s.add(a)}r=s}return[...r]}finally{this._evaluator.end()}}_queryEngineAll(t,n){const r=this._engines.get(t.name).queryAll(n,t.body);for(const i of r)if(!("nodeName"in i))throw this.createStacklessError(`Expected a Node but got ${Object.prototype.toString.call(i)}`);return r}_createAttributeEngine(t,n){const r=i=>[{simples:[{selector:{css:`[${t}=${JSON.stringify(i)}]`,functions:[]},combinator:""}]}];return{queryAll:(i,s)=>this._evaluator.query({scope:i,pierceShadow:n},r(s))}}_createCSSEngine(){return{queryAll:(t,n)=>this._evaluator.query({scope:t,pierceShadow:!0},n)}}_createTextEngine(t,n){return{queryAll:(i,s)=>{const{matcher:o,kind:l}=Ni(s,n),a=[];let u=null;const c=d=>{if(l==="lax"&&u&&u.contains(d))return!1;const g=qs(this._evaluator._cacheText,d,o);g==="none"&&(u=d),(g==="self"||g==="selfAndChildren"&&l==="strict"&&!n)&&a.push(d)};i.nodeType===Node.ELEMENT_NODE&&c(i);const f=this._evaluator._queryCSS({scope:i,pierceShadow:t},"*");for(const d of f)c(d);return a}}}_createInternalHasTextEngine(){return{queryAll:(t,n)=>{if(t.nodeType!==1)return[];const r=t,i=Ae(this._evaluator._cacheText,r),{matcher:s}=Ni(n,!0);return s(i)?[r]:[]}}}_createInternalHasNotTextEngine(){return{queryAll:(t,n)=>{if(t.nodeType!==1)return[];const r=t,i=Ae(this._evaluator._cacheText,r),{matcher:s}=Ni(n,!0);return s(i)?[]:[r]}}}_createInternalLabelEngine(){return{queryAll:(t,n)=>{const{matcher:r}=Ni(n,!0);return this._evaluator._queryCSS({scope:t,pierceShadow:!0},"*").filter(s=>op(this._evaluator._cacheText,s).some(o=>r(o)))}}}_createNamedAttributeEngine(){return{queryAll:(n,r)=>{const i=on(r,!0);if(i.name||i.attributes.length!==1)throw new Error("Malformed attribute selector: "+r);const{name:s,value:o,caseSensitive:l}=i.attributes[0],a=l?null:o.toLowerCase();let u;return o instanceof RegExp?u=f=>!!f.match(o):l?u=f=>f===o:u=f=>f.toLowerCase().includes(a),this._evaluator._queryCSS({scope:n,pierceShadow:!0},`[${s}]`).filter(f=>u(f.getAttribute(s)))}}}_createControlEngine(){return{queryAll(t,n){if(n==="enter-frame")return[];if(n==="return-empty")return[];if(n==="component")return t.nodeType!==1?[]:[t.childElementCount===1?t.firstElementChild:t];throw new Error(`Internal error, unknown internal:control selector ${n}`)}}}_createHasEngine(){return{queryAll:(n,r)=>n.nodeType!==1?[]:!!this.querySelector(r.parsed,n,!1)?[n]:[]}}_createHasNotEngine(){return{queryAll:(n,r)=>n.nodeType!==1?[]:!!this.querySelector(r.parsed,n,!1)?[]:[n]}}_createVisibleEngine(){return{queryAll:(n,r)=>n.nodeType!==1?[]:nn(n)===!!r?[n]:[]}}_createInternalChainEngine(){return{queryAll:(n,r)=>this.querySelectorAll(r.parsed,n)}}extend(t,n){const r=this.window.eval(` + (() => { + const module = {}; + ${t} + return module.exports.default(); + })()`);return new r(this,n)}async viewportRatio(t){return await new Promise(n=>{const r=new IntersectionObserver(i=>{n(i[0].intersectionRatio),r.disconnect()});r.observe(t),this.builtinRequestAnimationFrame(()=>{})})}getElementBorderWidth(t){if(t.nodeType!==Node.ELEMENT_NODE||!t.ownerDocument||!t.ownerDocument.defaultView)return{left:0,top:0};const n=t.ownerDocument.defaultView.getComputedStyle(t);return{left:parseInt(n.borderLeftWidth||"",10),top:parseInt(n.borderTopWidth||"",10)}}describeIFrameStyle(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return"error:notconnected";const n=t.ownerDocument.defaultView;for(let i=t;i;i=Se(i))if(n.getComputedStyle(i).transform!=="none")return"transformed";const r=n.getComputedStyle(t);return{left:parseInt(r.borderLeftWidth||"",10)+parseInt(r.paddingLeft||"",10),top:parseInt(r.borderTopWidth||"",10)+parseInt(r.paddingTop||"",10)}}retarget(t,n){let r=t.nodeType===Node.ELEMENT_NODE?t:t.parentElement;return r?(n==="none"||(!r.matches("input, textarea, select")&&!r.isContentEditable&&(n==="button-link"?r=r.closest("button, [role=button], a, [role=link]")||r:r=r.closest("button, [role=button], [role=checkbox], [role=radio]")||r),n==="follow-label"&&(!r.matches("a, input, textarea, button, select, [role=link], [role=button], [role=checkbox], [role=radio]")&&!r.isContentEditable&&(r=r.closest("label")||r),r.nodeName==="LABEL"&&(r=r.control||r))),r):null}async checkElementStates(t,n){if(n.includes("stable")){const r=await this._checkElementIsStable(t);if(r===!1)return{missingState:"stable"};if(r==="error:notconnected")return r}for(const r of n)if(r!=="stable"){const i=this.elementState(t,r);if(i===!1)return{missingState:r};if(i==="error:notconnected")return i}}async _checkElementIsStable(t){const n=Symbol("continuePolling");let r,i=0,s=0;const o=()=>{const f=this.retarget(t,"no-follow-label");if(!f)return"error:notconnected";const d=performance.now();if(this._stableRafCount>1&&d-s<15)return n;s=d;const g=f.getBoundingClientRect(),m={x:g.top,y:g.left,width:g.width,height:g.height};if(r){if(!(m.x===r.x&&m.y===r.y&&m.width===r.width&&m.height===r.height))return!1;if(++i>=this._stableRafCount)return!0}return r=m,n};let l,a;const u=new Promise((f,d)=>{l=f,a=d}),c=()=>{try{const f=o();f!==n?l(f):this.builtinRequestAnimationFrame(c)}catch(f){a(f)}};return this.builtinRequestAnimationFrame(c),u}elementState(t,n){const r=this.retarget(t,["stable","visible","hidden"].includes(n)?"none":"follow-label");if(!r||!r.isConnected)return n==="hidden"?!0:"error:notconnected";if(n==="visible")return nn(r);if(n==="hidden")return!nn(r);const i=Ua(r);if(n==="disabled")return i;if(n==="enabled")return!i;const s=!(["INPUT","TEXTAREA","SELECT"].includes(r.nodeName)&&r.hasAttribute("readonly"));if(n==="editable")return!i&&s;if(n==="checked"||n==="unchecked"){const o=n==="checked",l=Gh(r,!1);if(l==="error")throw this.createStacklessError("Not a checkbox or radio button");return o===l}throw this.createStacklessError(`Unexpected element state "${n}"`)}selectOptions(t,n){const r=this.retarget(t,"follow-label");if(!r)return"error:notconnected";if(r.nodeName.toLowerCase()!=="select")throw this.createStacklessError("Element is not a ,