@stablyai/internal-playwright-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +3 -0
- package/ThirdPartyNotices.txt +1134 -0
- package/bin/install_media_pack.ps1 +5 -0
- package/bin/install_webkit_wsl.ps1 +35 -0
- package/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/browsers.json +80 -0
- package/cli.js +18 -0
- package/index.d.ts +17 -0
- package/index.js +32 -0
- package/index.mjs +28 -0
- package/lib/androidServerImpl.js +65 -0
- package/lib/browserServerImpl.js +120 -0
- package/lib/cli/cli.js +58 -0
- package/lib/cli/driver.js +97 -0
- package/lib/cli/program.js +634 -0
- package/lib/cli/programWithTestStub.js +74 -0
- package/lib/client/accessibility.js +49 -0
- package/lib/client/android.js +361 -0
- package/lib/client/api.js +137 -0
- package/lib/client/artifact.js +79 -0
- package/lib/client/browser.js +163 -0
- package/lib/client/browserContext.js +529 -0
- package/lib/client/browserType.js +184 -0
- package/lib/client/cdpSession.js +51 -0
- package/lib/client/channelOwner.js +194 -0
- package/lib/client/clientHelper.js +64 -0
- package/lib/client/clientInstrumentation.js +55 -0
- package/lib/client/clientStackTrace.js +69 -0
- package/lib/client/clock.js +68 -0
- package/lib/client/connection.js +314 -0
- package/lib/client/consoleMessage.js +54 -0
- package/lib/client/coverage.js +44 -0
- package/lib/client/dialog.js +56 -0
- package/lib/client/download.js +62 -0
- package/lib/client/electron.js +138 -0
- package/lib/client/elementHandle.js +281 -0
- package/lib/client/errors.js +77 -0
- package/lib/client/eventEmitter.js +314 -0
- package/lib/client/events.js +99 -0
- package/lib/client/fetch.js +369 -0
- package/lib/client/fileChooser.js +46 -0
- package/lib/client/fileUtils.js +34 -0
- package/lib/client/frame.js +408 -0
- package/lib/client/harRouter.js +87 -0
- package/lib/client/input.js +84 -0
- package/lib/client/jsHandle.js +109 -0
- package/lib/client/jsonPipe.js +39 -0
- package/lib/client/localUtils.js +60 -0
- package/lib/client/locator.js +368 -0
- package/lib/client/network.js +747 -0
- package/lib/client/page.js +721 -0
- package/lib/client/platform.js +74 -0
- package/lib/client/playwright.js +71 -0
- package/lib/client/selectors.js +55 -0
- package/lib/client/stream.js +39 -0
- package/lib/client/timeoutSettings.js +79 -0
- package/lib/client/tracing.js +117 -0
- package/lib/client/types.js +28 -0
- package/lib/client/video.js +59 -0
- package/lib/client/waiter.js +142 -0
- package/lib/client/webError.js +39 -0
- package/lib/client/webSocket.js +93 -0
- package/lib/client/worker.js +63 -0
- package/lib/client/writableStream.js +39 -0
- package/lib/common/debugLogger.js +90 -0
- package/lib/common/socksProxy.js +569 -0
- package/lib/common/timeoutSettings.js +73 -0
- package/lib/common/types.js +5 -0
- package/lib/generated/bindingsControllerSource.js +28 -0
- package/lib/generated/clockSource.js +28 -0
- package/lib/generated/consoleApiSource.js +28 -0
- package/lib/generated/injectedScriptSource.js +28 -0
- package/lib/generated/pollingRecorderSource.js +28 -0
- package/lib/generated/recorderSource.js +28 -0
- package/lib/generated/storageScriptSource.js +28 -0
- package/lib/generated/utilityScriptSource.js +28 -0
- package/lib/generated/webSocketMockSource.js +336 -0
- package/lib/image_tools/colorUtils.js +98 -0
- package/lib/image_tools/compare.js +108 -0
- package/lib/image_tools/imageChannel.js +70 -0
- package/lib/image_tools/stats.js +102 -0
- package/lib/inProcessFactory.js +60 -0
- package/lib/index.js +19 -0
- package/lib/inprocess.js +3 -0
- package/lib/outofprocess.js +76 -0
- package/lib/protocol/debug.js +27 -0
- package/lib/protocol/serializers.js +192 -0
- package/lib/protocol/transport.js +82 -0
- package/lib/protocol/validator.js +2919 -0
- package/lib/protocol/validatorPrimitives.js +193 -0
- package/lib/remote/playwrightConnection.js +129 -0
- package/lib/remote/playwrightServer.js +335 -0
- package/lib/server/accessibility.js +69 -0
- package/lib/server/android/android.js +465 -0
- package/lib/server/android/backendAdb.js +177 -0
- package/lib/server/artifact.js +127 -0
- package/lib/server/bidi/bidiBrowser.js +490 -0
- package/lib/server/bidi/bidiChromium.js +153 -0
- package/lib/server/bidi/bidiConnection.js +212 -0
- package/lib/server/bidi/bidiExecutionContext.js +221 -0
- package/lib/server/bidi/bidiFirefox.js +130 -0
- package/lib/server/bidi/bidiInput.js +146 -0
- package/lib/server/bidi/bidiNetworkManager.js +383 -0
- package/lib/server/bidi/bidiOverCdp.js +102 -0
- package/lib/server/bidi/bidiPage.js +552 -0
- package/lib/server/bidi/bidiPdf.js +106 -0
- package/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/lib/server/bidi/third_party/bidiDeserializer.js +98 -0
- package/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
- package/lib/server/bidi/third_party/bidiProtocol.js +24 -0
- package/lib/server/bidi/third_party/bidiProtocolCore.js +179 -0
- package/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
- package/lib/server/bidi/third_party/bidiSerializer.js +148 -0
- package/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
- package/lib/server/browser.js +149 -0
- package/lib/server/browserContext.js +695 -0
- package/lib/server/browserType.js +328 -0
- package/lib/server/callLog.js +82 -0
- package/lib/server/chromium/appIcon.png +0 -0
- package/lib/server/chromium/chromium.js +402 -0
- package/lib/server/chromium/chromiumSwitches.js +95 -0
- package/lib/server/chromium/crAccessibility.js +263 -0
- package/lib/server/chromium/crBrowser.js +501 -0
- package/lib/server/chromium/crConnection.js +202 -0
- package/lib/server/chromium/crCoverage.js +235 -0
- package/lib/server/chromium/crDevTools.js +113 -0
- package/lib/server/chromium/crDragDrop.js +131 -0
- package/lib/server/chromium/crExecutionContext.js +146 -0
- package/lib/server/chromium/crInput.js +187 -0
- package/lib/server/chromium/crNetworkManager.js +666 -0
- package/lib/server/chromium/crPage.js +1069 -0
- package/lib/server/chromium/crPdf.js +121 -0
- package/lib/server/chromium/crProtocolHelper.js +145 -0
- package/lib/server/chromium/crServiceWorker.js +123 -0
- package/lib/server/chromium/defaultFontFamilies.js +162 -0
- package/lib/server/chromium/protocol.d.js +16 -0
- package/lib/server/chromium/videoRecorder.js +113 -0
- package/lib/server/clock.js +149 -0
- package/lib/server/codegen/csharp.js +327 -0
- package/lib/server/codegen/java.js +274 -0
- package/lib/server/codegen/javascript.js +270 -0
- package/lib/server/codegen/jsonl.js +52 -0
- package/lib/server/codegen/language.js +132 -0
- package/lib/server/codegen/languages.js +68 -0
- package/lib/server/codegen/python.js +279 -0
- package/lib/server/codegen/types.js +16 -0
- package/lib/server/console.js +53 -0
- package/lib/server/cookieStore.js +206 -0
- package/lib/server/debugController.js +191 -0
- package/lib/server/debugger.js +119 -0
- package/lib/server/deviceDescriptors.js +39 -0
- package/lib/server/deviceDescriptorsSource.json +1779 -0
- package/lib/server/dialog.js +116 -0
- package/lib/server/dispatchers/androidDispatcher.js +325 -0
- package/lib/server/dispatchers/artifactDispatcher.js +118 -0
- package/lib/server/dispatchers/browserContextDispatcher.js +364 -0
- package/lib/server/dispatchers/browserDispatcher.js +118 -0
- package/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
- package/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
- package/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
- package/lib/server/dispatchers/dialogDispatcher.js +47 -0
- package/lib/server/dispatchers/dispatcher.js +371 -0
- package/lib/server/dispatchers/electronDispatcher.js +89 -0
- package/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
- package/lib/server/dispatchers/frameDispatcher.js +227 -0
- package/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
- package/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
- package/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
- package/lib/server/dispatchers/networkDispatchers.js +213 -0
- package/lib/server/dispatchers/pageDispatcher.js +401 -0
- package/lib/server/dispatchers/playwrightDispatcher.js +108 -0
- package/lib/server/dispatchers/selectorsDispatcher.js +36 -0
- package/lib/server/dispatchers/streamDispatcher.js +67 -0
- package/lib/server/dispatchers/tracingDispatcher.js +68 -0
- package/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
- package/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
- package/lib/server/dom.js +806 -0
- package/lib/server/download.js +70 -0
- package/lib/server/electron/electron.js +270 -0
- package/lib/server/electron/loader.js +29 -0
- package/lib/server/errors.js +69 -0
- package/lib/server/fetch.js +621 -0
- package/lib/server/fileChooser.js +43 -0
- package/lib/server/fileUploadUtils.js +84 -0
- package/lib/server/firefox/ffAccessibility.js +238 -0
- package/lib/server/firefox/ffBrowser.js +428 -0
- package/lib/server/firefox/ffConnection.js +147 -0
- package/lib/server/firefox/ffExecutionContext.js +150 -0
- package/lib/server/firefox/ffInput.js +159 -0
- package/lib/server/firefox/ffNetworkManager.js +256 -0
- package/lib/server/firefox/ffPage.js +503 -0
- package/lib/server/firefox/firefox.js +116 -0
- package/lib/server/firefox/protocol.d.js +16 -0
- package/lib/server/formData.js +147 -0
- package/lib/server/frameSelectors.js +156 -0
- package/lib/server/frames.js +1502 -0
- package/lib/server/har/harRecorder.js +147 -0
- package/lib/server/har/harTracer.js +607 -0
- package/lib/server/harBackend.js +157 -0
- package/lib/server/helper.js +96 -0
- package/lib/server/index.js +58 -0
- package/lib/server/input.js +273 -0
- package/lib/server/instrumentation.js +69 -0
- package/lib/server/isomorphic/utilityScriptSerializers.js +212 -0
- package/lib/server/javascript.js +291 -0
- package/lib/server/launchApp.js +128 -0
- package/lib/server/localUtils.js +218 -0
- package/lib/server/macEditingCommands.js +143 -0
- package/lib/server/network.js +629 -0
- package/lib/server/page.js +871 -0
- package/lib/server/pipeTransport.js +89 -0
- package/lib/server/playwright.js +69 -0
- package/lib/server/progress.js +112 -0
- package/lib/server/protocolError.js +52 -0
- package/lib/server/recorder/chat.js +161 -0
- package/lib/server/recorder/codeGenerator.js +153 -0
- package/lib/server/recorder/csharp.js +310 -0
- package/lib/server/recorder/java.js +248 -0
- package/lib/server/recorder/javascript.js +229 -0
- package/lib/server/recorder/jsonl.js +47 -0
- package/lib/server/recorder/language.js +44 -0
- package/lib/server/recorder/python.js +276 -0
- package/lib/server/recorder/recorderActions.js +5 -0
- package/lib/server/recorder/recorderApp.js +387 -0
- package/lib/server/recorder/recorderRunner.js +138 -0
- package/lib/server/recorder/recorderSignalProcessor.js +83 -0
- package/lib/server/recorder/recorderUtils.js +157 -0
- package/lib/server/recorder/throttledFile.js +57 -0
- package/lib/server/recorder/utils.js +45 -0
- package/lib/server/recorder.js +499 -0
- package/lib/server/registry/browserFetcher.js +175 -0
- package/lib/server/registry/dependencies.js +371 -0
- package/lib/server/registry/index.js +1331 -0
- package/lib/server/registry/nativeDeps.js +1280 -0
- package/lib/server/registry/oopDownloadBrowserMain.js +120 -0
- package/lib/server/screenshotter.js +333 -0
- package/lib/server/selectors.js +112 -0
- package/lib/server/socksClientCertificatesInterceptor.js +383 -0
- package/lib/server/socksInterceptor.js +95 -0
- package/lib/server/stably/ai-tools/http-request.js +70 -0
- package/lib/server/stably/ai-tools/stablyApiCaller.js +137 -0
- package/lib/server/stably/autohealing/elementHandleFromCoordinates.js +64 -0
- package/lib/server/stably/autohealing/healingService.js +228 -0
- package/lib/server/stably/autohealing/screenshotFrame.js +41 -0
- package/lib/server/stably/constants.js +31 -0
- package/lib/server/trace/recorder/snapshotter.js +147 -0
- package/lib/server/trace/recorder/snapshotterInjected.js +541 -0
- package/lib/server/trace/recorder/tracing.js +602 -0
- package/lib/server/trace/test/inMemorySnapshotter.js +87 -0
- package/lib/server/trace/viewer/traceViewer.js +240 -0
- package/lib/server/transport.js +181 -0
- package/lib/server/types.js +28 -0
- package/lib/server/usKeyboardLayout.js +145 -0
- package/lib/server/utils/ascii.js +44 -0
- package/lib/server/utils/comparators.js +161 -0
- package/lib/server/utils/crypto.js +216 -0
- package/lib/server/utils/debug.js +42 -0
- package/lib/server/utils/debugLogger.js +122 -0
- package/lib/server/utils/env.js +73 -0
- package/lib/server/utils/eventsHelper.js +39 -0
- package/lib/server/utils/expectUtils.js +38 -0
- package/lib/server/utils/fileUtils.js +191 -0
- package/lib/server/utils/happyEyeballs.js +207 -0
- package/lib/server/utils/hostPlatform.js +111 -0
- package/lib/server/utils/httpServer.js +218 -0
- package/lib/server/utils/image_tools/colorUtils.js +89 -0
- package/lib/server/utils/image_tools/compare.js +109 -0
- package/lib/server/utils/image_tools/imageChannel.js +78 -0
- package/lib/server/utils/image_tools/stats.js +102 -0
- package/lib/server/utils/linuxUtils.js +71 -0
- package/lib/server/utils/network.js +233 -0
- package/lib/server/utils/nodePlatform.js +148 -0
- package/lib/server/utils/pipeTransport.js +84 -0
- package/lib/server/utils/processLauncher.js +241 -0
- package/lib/server/utils/profiler.js +65 -0
- package/lib/server/utils/socksProxy.js +511 -0
- package/lib/server/utils/spawnAsync.js +41 -0
- package/lib/server/utils/task.js +51 -0
- package/lib/server/utils/userAgent.js +98 -0
- package/lib/server/utils/wsServer.js +121 -0
- package/lib/server/utils/zipFile.js +74 -0
- package/lib/server/utils/zones.js +57 -0
- package/lib/server/webkit/protocol.d.js +16 -0
- package/lib/server/webkit/webkit.js +119 -0
- package/lib/server/webkit/wkAccessibility.js +237 -0
- package/lib/server/webkit/wkBrowser.js +339 -0
- package/lib/server/webkit/wkConnection.js +149 -0
- package/lib/server/webkit/wkExecutionContext.js +154 -0
- package/lib/server/webkit/wkInput.js +181 -0
- package/lib/server/webkit/wkInterceptableRequest.js +169 -0
- package/lib/server/webkit/wkPage.js +1134 -0
- package/lib/server/webkit/wkProvisionalPage.js +83 -0
- package/lib/server/webkit/wkWorkers.js +104 -0
- package/lib/server/webkit/wsl/webkit-wsl-transport-client.js +74 -0
- package/lib/server/webkit/wsl/webkit-wsl-transport-server.js +113 -0
- package/lib/third_party/diff_match_patch.js +2222 -0
- package/lib/third_party/pixelmatch.js +255 -0
- package/lib/utils/ascii.js +31 -0
- package/lib/utils/comparators.js +171 -0
- package/lib/utils/crypto.js +33 -0
- package/lib/utils/debug.js +46 -0
- package/lib/utils/debugLogger.js +89 -0
- package/lib/utils/env.js +49 -0
- package/lib/utils/eventsHelper.js +38 -0
- package/lib/utils/fileUtils.js +205 -0
- package/lib/utils/glob.js +83 -0
- package/lib/utils/happy-eyeballs.js +160 -0
- package/lib/utils/headers.js +52 -0
- package/lib/utils/hostPlatform.js +128 -0
- package/lib/utils/httpServer.js +236 -0
- package/lib/utils/index.js +346 -0
- package/lib/utils/isomorphic/ariaSnapshot.js +392 -0
- package/lib/utils/isomorphic/assert.js +31 -0
- package/lib/utils/isomorphic/colors.js +72 -0
- package/lib/utils/isomorphic/cssParser.js +245 -0
- package/lib/utils/isomorphic/cssTokenizer.js +1051 -0
- package/lib/utils/isomorphic/headers.js +53 -0
- package/lib/utils/isomorphic/locatorGenerators.js +673 -0
- package/lib/utils/isomorphic/locatorParser.js +176 -0
- package/lib/utils/isomorphic/locatorUtils.js +81 -0
- package/lib/utils/isomorphic/manualPromise.js +114 -0
- package/lib/utils/isomorphic/mimeType.js +459 -0
- package/lib/utils/isomorphic/multimap.js +80 -0
- package/lib/utils/isomorphic/protocolFormatter.js +78 -0
- package/lib/utils/isomorphic/protocolMetainfo.js +321 -0
- package/lib/utils/isomorphic/rtti.js +43 -0
- package/lib/utils/isomorphic/selectorParser.js +386 -0
- package/lib/utils/isomorphic/semaphore.js +54 -0
- package/lib/utils/isomorphic/stackTrace.js +158 -0
- package/lib/utils/isomorphic/stringUtils.js +155 -0
- package/lib/utils/isomorphic/time.js +49 -0
- package/lib/utils/isomorphic/timeoutRunner.js +66 -0
- package/lib/utils/isomorphic/traceUtils.js +58 -0
- package/lib/utils/isomorphic/types.js +16 -0
- package/lib/utils/isomorphic/urlMatch.js +176 -0
- package/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
- package/lib/utils/linuxUtils.js +78 -0
- package/lib/utils/manualPromise.js +109 -0
- package/lib/utils/mimeType.js +29 -0
- package/lib/utils/multimap.js +75 -0
- package/lib/utils/network.js +188 -0
- package/lib/utils/processLauncher.js +248 -0
- package/lib/utils/profiler.js +53 -0
- package/lib/utils/rtti.js +44 -0
- package/lib/utils/semaphore.js +51 -0
- package/lib/utils/spawnAsync.js +45 -0
- package/lib/utils/stackTrace.js +121 -0
- package/lib/utils/task.js +58 -0
- package/lib/utils/time.js +37 -0
- package/lib/utils/timeoutRunner.js +66 -0
- package/lib/utils/traceUtils.js +44 -0
- package/lib/utils/userAgent.js +105 -0
- package/lib/utils/wsServer.js +127 -0
- package/lib/utils/zipFile.js +75 -0
- package/lib/utils/zones.js +62 -0
- package/lib/utils.js +107 -0
- package/lib/utilsBundle.js +109 -0
- package/lib/utilsBundleImpl/index.js +218 -0
- package/lib/utilsBundleImpl/xdg-open +1066 -0
- package/lib/vite/htmlReport/index.html +84 -0
- package/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +1 -0
- package/lib/vite/recorder/assets/codeMirrorModule-RJCXzfmE.js +24 -0
- package/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/lib/vite/recorder/assets/index-Ri0uHF7I.css +1 -0
- package/lib/vite/recorder/assets/index-Y-X2TGJv.js +193 -0
- package/lib/vite/recorder/index.html +29 -0
- package/lib/vite/recorder/playwright-logo.svg +9 -0
- package/lib/vite/traceViewer/assets/codeMirrorModule-Bhnc5o2x.js +24 -0
- package/lib/vite/traceViewer/assets/defaultSettingsView-ClwvkA2N.js +265 -0
- package/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
- package/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +1 -0
- package/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/lib/vite/traceViewer/defaultSettingsView.TQ8_7ybu.css +1 -0
- package/lib/vite/traceViewer/index.DFO9NNF5.js +2 -0
- package/lib/vite/traceViewer/index.I8N9v4jT.css +1 -0
- package/lib/vite/traceViewer/index.html +43 -0
- package/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/lib/vite/traceViewer/snapshot.html +21 -0
- package/lib/vite/traceViewer/sw.bundle.js +3 -0
- package/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
- package/lib/vite/traceViewer/uiMode.Shu3QS-1.js +5 -0
- package/lib/vite/traceViewer/uiMode.html +17 -0
- package/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
- package/lib/zipBundle.js +34 -0
- package/lib/zipBundleImpl.js +5 -0
- package/package.json +43 -0
- package/types/protocol.d.ts +23130 -0
- package/types/structs.d.ts +45 -0
- package/types/types.d.ts +22857 -0
@@ -0,0 +1,459 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var mimeType_exports = {};
|
20
|
+
__export(mimeType_exports, {
|
21
|
+
getMimeTypeForPath: () => getMimeTypeForPath,
|
22
|
+
isJsonMimeType: () => isJsonMimeType,
|
23
|
+
isTextualMimeType: () => isTextualMimeType
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(mimeType_exports);
|
26
|
+
function isJsonMimeType(mimeType) {
|
27
|
+
return !!mimeType.match(/^(application\/json|application\/.*?\+json|text\/(x-)?json)(;\s*charset=.*)?$/);
|
28
|
+
}
|
29
|
+
function isTextualMimeType(mimeType) {
|
30
|
+
return !!mimeType.match(/^(text\/.*?|application\/(json|(x-)?javascript|xml.*?|ecmascript|graphql|x-www-form-urlencoded)|image\/svg(\+xml)?|application\/.*?(\+json|\+xml))(;\s*charset=.*)?$/);
|
31
|
+
}
|
32
|
+
function getMimeTypeForPath(path) {
|
33
|
+
const dotIndex = path.lastIndexOf(".");
|
34
|
+
if (dotIndex === -1)
|
35
|
+
return null;
|
36
|
+
const extension = path.substring(dotIndex + 1);
|
37
|
+
return types.get(extension) || null;
|
38
|
+
}
|
39
|
+
const types = /* @__PURE__ */ new Map([
|
40
|
+
["ez", "application/andrew-inset"],
|
41
|
+
["aw", "application/applixware"],
|
42
|
+
["atom", "application/atom+xml"],
|
43
|
+
["atomcat", "application/atomcat+xml"],
|
44
|
+
["atomdeleted", "application/atomdeleted+xml"],
|
45
|
+
["atomsvc", "application/atomsvc+xml"],
|
46
|
+
["dwd", "application/atsc-dwd+xml"],
|
47
|
+
["held", "application/atsc-held+xml"],
|
48
|
+
["rsat", "application/atsc-rsat+xml"],
|
49
|
+
["bdoc", "application/bdoc"],
|
50
|
+
["xcs", "application/calendar+xml"],
|
51
|
+
["ccxml", "application/ccxml+xml"],
|
52
|
+
["cdfx", "application/cdfx+xml"],
|
53
|
+
["cdmia", "application/cdmi-capability"],
|
54
|
+
["cdmic", "application/cdmi-container"],
|
55
|
+
["cdmid", "application/cdmi-domain"],
|
56
|
+
["cdmio", "application/cdmi-object"],
|
57
|
+
["cdmiq", "application/cdmi-queue"],
|
58
|
+
["cu", "application/cu-seeme"],
|
59
|
+
["mpd", "application/dash+xml"],
|
60
|
+
["davmount", "application/davmount+xml"],
|
61
|
+
["dbk", "application/docbook+xml"],
|
62
|
+
["dssc", "application/dssc+der"],
|
63
|
+
["xdssc", "application/dssc+xml"],
|
64
|
+
["ecma", "application/ecmascript"],
|
65
|
+
["es", "application/ecmascript"],
|
66
|
+
["emma", "application/emma+xml"],
|
67
|
+
["emotionml", "application/emotionml+xml"],
|
68
|
+
["epub", "application/epub+zip"],
|
69
|
+
["exi", "application/exi"],
|
70
|
+
["exp", "application/express"],
|
71
|
+
["fdt", "application/fdt+xml"],
|
72
|
+
["pfr", "application/font-tdpfr"],
|
73
|
+
["geojson", "application/geo+json"],
|
74
|
+
["gml", "application/gml+xml"],
|
75
|
+
["gpx", "application/gpx+xml"],
|
76
|
+
["gxf", "application/gxf"],
|
77
|
+
["gz", "application/gzip"],
|
78
|
+
["hjson", "application/hjson"],
|
79
|
+
["stk", "application/hyperstudio"],
|
80
|
+
["ink", "application/inkml+xml"],
|
81
|
+
["inkml", "application/inkml+xml"],
|
82
|
+
["ipfix", "application/ipfix"],
|
83
|
+
["its", "application/its+xml"],
|
84
|
+
["ear", "application/java-archive"],
|
85
|
+
["jar", "application/java-archive"],
|
86
|
+
["war", "application/java-archive"],
|
87
|
+
["ser", "application/java-serialized-object"],
|
88
|
+
["class", "application/java-vm"],
|
89
|
+
["js", "application/javascript"],
|
90
|
+
["mjs", "application/javascript"],
|
91
|
+
["json", "application/json"],
|
92
|
+
["map", "application/json"],
|
93
|
+
["json5", "application/json5"],
|
94
|
+
["jsonml", "application/jsonml+json"],
|
95
|
+
["jsonld", "application/ld+json"],
|
96
|
+
["lgr", "application/lgr+xml"],
|
97
|
+
["lostxml", "application/lost+xml"],
|
98
|
+
["hqx", "application/mac-binhex40"],
|
99
|
+
["cpt", "application/mac-compactpro"],
|
100
|
+
["mads", "application/mads+xml"],
|
101
|
+
["webmanifest", "application/manifest+json"],
|
102
|
+
["mrc", "application/marc"],
|
103
|
+
["mrcx", "application/marcxml+xml"],
|
104
|
+
["ma", "application/mathematica"],
|
105
|
+
["mb", "application/mathematica"],
|
106
|
+
["nb", "application/mathematica"],
|
107
|
+
["mathml", "application/mathml+xml"],
|
108
|
+
["mbox", "application/mbox"],
|
109
|
+
["mscml", "application/mediaservercontrol+xml"],
|
110
|
+
["metalink", "application/metalink+xml"],
|
111
|
+
["meta4", "application/metalink4+xml"],
|
112
|
+
["mets", "application/mets+xml"],
|
113
|
+
["maei", "application/mmt-aei+xml"],
|
114
|
+
["musd", "application/mmt-usd+xml"],
|
115
|
+
["mods", "application/mods+xml"],
|
116
|
+
["m21", "application/mp21"],
|
117
|
+
["mp21", "application/mp21"],
|
118
|
+
["m4p", "application/mp4"],
|
119
|
+
["mp4s", "application/mp4"],
|
120
|
+
["doc", "application/msword"],
|
121
|
+
["dot", "application/msword"],
|
122
|
+
["mxf", "application/mxf"],
|
123
|
+
["nq", "application/n-quads"],
|
124
|
+
["nt", "application/n-triples"],
|
125
|
+
["cjs", "application/node"],
|
126
|
+
["bin", "application/octet-stream"],
|
127
|
+
["bpk", "application/octet-stream"],
|
128
|
+
["buffer", "application/octet-stream"],
|
129
|
+
["deb", "application/octet-stream"],
|
130
|
+
["deploy", "application/octet-stream"],
|
131
|
+
["dist", "application/octet-stream"],
|
132
|
+
["distz", "application/octet-stream"],
|
133
|
+
["dll", "application/octet-stream"],
|
134
|
+
["dmg", "application/octet-stream"],
|
135
|
+
["dms", "application/octet-stream"],
|
136
|
+
["dump", "application/octet-stream"],
|
137
|
+
["elc", "application/octet-stream"],
|
138
|
+
["exe", "application/octet-stream"],
|
139
|
+
["img", "application/octet-stream"],
|
140
|
+
["iso", "application/octet-stream"],
|
141
|
+
["lrf", "application/octet-stream"],
|
142
|
+
["mar", "application/octet-stream"],
|
143
|
+
["msi", "application/octet-stream"],
|
144
|
+
["msm", "application/octet-stream"],
|
145
|
+
["msp", "application/octet-stream"],
|
146
|
+
["pkg", "application/octet-stream"],
|
147
|
+
["so", "application/octet-stream"],
|
148
|
+
["oda", "application/oda"],
|
149
|
+
["opf", "application/oebps-package+xml"],
|
150
|
+
["ogx", "application/ogg"],
|
151
|
+
["omdoc", "application/omdoc+xml"],
|
152
|
+
["onepkg", "application/onenote"],
|
153
|
+
["onetmp", "application/onenote"],
|
154
|
+
["onetoc", "application/onenote"],
|
155
|
+
["onetoc2", "application/onenote"],
|
156
|
+
["oxps", "application/oxps"],
|
157
|
+
["relo", "application/p2p-overlay+xml"],
|
158
|
+
["xer", "application/patch-ops-error+xml"],
|
159
|
+
["pdf", "application/pdf"],
|
160
|
+
["pgp", "application/pgp-encrypted"],
|
161
|
+
["asc", "application/pgp-signature"],
|
162
|
+
["sig", "application/pgp-signature"],
|
163
|
+
["prf", "application/pics-rules"],
|
164
|
+
["p10", "application/pkcs10"],
|
165
|
+
["p7c", "application/pkcs7-mime"],
|
166
|
+
["p7m", "application/pkcs7-mime"],
|
167
|
+
["p7s", "application/pkcs7-signature"],
|
168
|
+
["p8", "application/pkcs8"],
|
169
|
+
["ac", "application/pkix-attr-cert"],
|
170
|
+
["cer", "application/pkix-cert"],
|
171
|
+
["crl", "application/pkix-crl"],
|
172
|
+
["pkipath", "application/pkix-pkipath"],
|
173
|
+
["pki", "application/pkixcmp"],
|
174
|
+
["pls", "application/pls+xml"],
|
175
|
+
["ai", "application/postscript"],
|
176
|
+
["eps", "application/postscript"],
|
177
|
+
["ps", "application/postscript"],
|
178
|
+
["provx", "application/provenance+xml"],
|
179
|
+
["pskcxml", "application/pskc+xml"],
|
180
|
+
["raml", "application/raml+yaml"],
|
181
|
+
["owl", "application/rdf+xml"],
|
182
|
+
["rdf", "application/rdf+xml"],
|
183
|
+
["rif", "application/reginfo+xml"],
|
184
|
+
["rnc", "application/relax-ng-compact-syntax"],
|
185
|
+
["rl", "application/resource-lists+xml"],
|
186
|
+
["rld", "application/resource-lists-diff+xml"],
|
187
|
+
["rs", "application/rls-services+xml"],
|
188
|
+
["rapd", "application/route-apd+xml"],
|
189
|
+
["sls", "application/route-s-tsid+xml"],
|
190
|
+
["rusd", "application/route-usd+xml"],
|
191
|
+
["gbr", "application/rpki-ghostbusters"],
|
192
|
+
["mft", "application/rpki-manifest"],
|
193
|
+
["roa", "application/rpki-roa"],
|
194
|
+
["rsd", "application/rsd+xml"],
|
195
|
+
["rss", "application/rss+xml"],
|
196
|
+
["rtf", "application/rtf"],
|
197
|
+
["sbml", "application/sbml+xml"],
|
198
|
+
["scq", "application/scvp-cv-request"],
|
199
|
+
["scs", "application/scvp-cv-response"],
|
200
|
+
["spq", "application/scvp-vp-request"],
|
201
|
+
["spp", "application/scvp-vp-response"],
|
202
|
+
["sdp", "application/sdp"],
|
203
|
+
["senmlx", "application/senml+xml"],
|
204
|
+
["sensmlx", "application/sensml+xml"],
|
205
|
+
["setpay", "application/set-payment-initiation"],
|
206
|
+
["setreg", "application/set-registration-initiation"],
|
207
|
+
["shf", "application/shf+xml"],
|
208
|
+
["sieve", "application/sieve"],
|
209
|
+
["siv", "application/sieve"],
|
210
|
+
["smi", "application/smil+xml"],
|
211
|
+
["smil", "application/smil+xml"],
|
212
|
+
["rq", "application/sparql-query"],
|
213
|
+
["srx", "application/sparql-results+xml"],
|
214
|
+
["gram", "application/srgs"],
|
215
|
+
["grxml", "application/srgs+xml"],
|
216
|
+
["sru", "application/sru+xml"],
|
217
|
+
["ssdl", "application/ssdl+xml"],
|
218
|
+
["ssml", "application/ssml+xml"],
|
219
|
+
["swidtag", "application/swid+xml"],
|
220
|
+
["tei", "application/tei+xml"],
|
221
|
+
["teicorpus", "application/tei+xml"],
|
222
|
+
["tfi", "application/thraud+xml"],
|
223
|
+
["tsd", "application/timestamped-data"],
|
224
|
+
["toml", "application/toml"],
|
225
|
+
["trig", "application/trig"],
|
226
|
+
["ttml", "application/ttml+xml"],
|
227
|
+
["ubj", "application/ubjson"],
|
228
|
+
["rsheet", "application/urc-ressheet+xml"],
|
229
|
+
["td", "application/urc-targetdesc+xml"],
|
230
|
+
["vxml", "application/voicexml+xml"],
|
231
|
+
["wasm", "application/wasm"],
|
232
|
+
["wgt", "application/widget"],
|
233
|
+
["hlp", "application/winhlp"],
|
234
|
+
["wsdl", "application/wsdl+xml"],
|
235
|
+
["wspolicy", "application/wspolicy+xml"],
|
236
|
+
["xaml", "application/xaml+xml"],
|
237
|
+
["xav", "application/xcap-att+xml"],
|
238
|
+
["xca", "application/xcap-caps+xml"],
|
239
|
+
["xdf", "application/xcap-diff+xml"],
|
240
|
+
["xel", "application/xcap-el+xml"],
|
241
|
+
["xns", "application/xcap-ns+xml"],
|
242
|
+
["xenc", "application/xenc+xml"],
|
243
|
+
["xht", "application/xhtml+xml"],
|
244
|
+
["xhtml", "application/xhtml+xml"],
|
245
|
+
["xlf", "application/xliff+xml"],
|
246
|
+
["rng", "application/xml"],
|
247
|
+
["xml", "application/xml"],
|
248
|
+
["xsd", "application/xml"],
|
249
|
+
["xsl", "application/xml"],
|
250
|
+
["dtd", "application/xml-dtd"],
|
251
|
+
["xop", "application/xop+xml"],
|
252
|
+
["xpl", "application/xproc+xml"],
|
253
|
+
["*xsl", "application/xslt+xml"],
|
254
|
+
["xslt", "application/xslt+xml"],
|
255
|
+
["xspf", "application/xspf+xml"],
|
256
|
+
["mxml", "application/xv+xml"],
|
257
|
+
["xhvml", "application/xv+xml"],
|
258
|
+
["xvm", "application/xv+xml"],
|
259
|
+
["xvml", "application/xv+xml"],
|
260
|
+
["yang", "application/yang"],
|
261
|
+
["yin", "application/yin+xml"],
|
262
|
+
["zip", "application/zip"],
|
263
|
+
["*3gpp", "audio/3gpp"],
|
264
|
+
["adp", "audio/adpcm"],
|
265
|
+
["amr", "audio/amr"],
|
266
|
+
["au", "audio/basic"],
|
267
|
+
["snd", "audio/basic"],
|
268
|
+
["kar", "audio/midi"],
|
269
|
+
["mid", "audio/midi"],
|
270
|
+
["midi", "audio/midi"],
|
271
|
+
["rmi", "audio/midi"],
|
272
|
+
["mxmf", "audio/mobile-xmf"],
|
273
|
+
["*mp3", "audio/mp3"],
|
274
|
+
["m4a", "audio/mp4"],
|
275
|
+
["mp4a", "audio/mp4"],
|
276
|
+
["m2a", "audio/mpeg"],
|
277
|
+
["m3a", "audio/mpeg"],
|
278
|
+
["mp2", "audio/mpeg"],
|
279
|
+
["mp2a", "audio/mpeg"],
|
280
|
+
["mp3", "audio/mpeg"],
|
281
|
+
["mpga", "audio/mpeg"],
|
282
|
+
["oga", "audio/ogg"],
|
283
|
+
["ogg", "audio/ogg"],
|
284
|
+
["opus", "audio/ogg"],
|
285
|
+
["spx", "audio/ogg"],
|
286
|
+
["s3m", "audio/s3m"],
|
287
|
+
["sil", "audio/silk"],
|
288
|
+
["wav", "audio/wav"],
|
289
|
+
["*wav", "audio/wave"],
|
290
|
+
["weba", "audio/webm"],
|
291
|
+
["xm", "audio/xm"],
|
292
|
+
["ttc", "font/collection"],
|
293
|
+
["otf", "font/otf"],
|
294
|
+
["ttf", "font/ttf"],
|
295
|
+
["woff", "font/woff"],
|
296
|
+
["woff2", "font/woff2"],
|
297
|
+
["exr", "image/aces"],
|
298
|
+
["apng", "image/apng"],
|
299
|
+
["avif", "image/avif"],
|
300
|
+
["bmp", "image/bmp"],
|
301
|
+
["cgm", "image/cgm"],
|
302
|
+
["drle", "image/dicom-rle"],
|
303
|
+
["emf", "image/emf"],
|
304
|
+
["fits", "image/fits"],
|
305
|
+
["g3", "image/g3fax"],
|
306
|
+
["gif", "image/gif"],
|
307
|
+
["heic", "image/heic"],
|
308
|
+
["heics", "image/heic-sequence"],
|
309
|
+
["heif", "image/heif"],
|
310
|
+
["heifs", "image/heif-sequence"],
|
311
|
+
["hej2", "image/hej2k"],
|
312
|
+
["hsj2", "image/hsj2"],
|
313
|
+
["ief", "image/ief"],
|
314
|
+
["jls", "image/jls"],
|
315
|
+
["jp2", "image/jp2"],
|
316
|
+
["jpg2", "image/jp2"],
|
317
|
+
["jpe", "image/jpeg"],
|
318
|
+
["jpeg", "image/jpeg"],
|
319
|
+
["jpg", "image/jpeg"],
|
320
|
+
["jph", "image/jph"],
|
321
|
+
["jhc", "image/jphc"],
|
322
|
+
["jpm", "image/jpm"],
|
323
|
+
["jpf", "image/jpx"],
|
324
|
+
["jpx", "image/jpx"],
|
325
|
+
["jxr", "image/jxr"],
|
326
|
+
["jxra", "image/jxra"],
|
327
|
+
["jxrs", "image/jxrs"],
|
328
|
+
["jxs", "image/jxs"],
|
329
|
+
["jxsc", "image/jxsc"],
|
330
|
+
["jxsi", "image/jxsi"],
|
331
|
+
["jxss", "image/jxss"],
|
332
|
+
["ktx", "image/ktx"],
|
333
|
+
["ktx2", "image/ktx2"],
|
334
|
+
["png", "image/png"],
|
335
|
+
["sgi", "image/sgi"],
|
336
|
+
["svg", "image/svg+xml"],
|
337
|
+
["svgz", "image/svg+xml"],
|
338
|
+
["t38", "image/t38"],
|
339
|
+
["tif", "image/tiff"],
|
340
|
+
["tiff", "image/tiff"],
|
341
|
+
["tfx", "image/tiff-fx"],
|
342
|
+
["webp", "image/webp"],
|
343
|
+
["wmf", "image/wmf"],
|
344
|
+
["disposition-notification", "message/disposition-notification"],
|
345
|
+
["u8msg", "message/global"],
|
346
|
+
["u8dsn", "message/global-delivery-status"],
|
347
|
+
["u8mdn", "message/global-disposition-notification"],
|
348
|
+
["u8hdr", "message/global-headers"],
|
349
|
+
["eml", "message/rfc822"],
|
350
|
+
["mime", "message/rfc822"],
|
351
|
+
["3mf", "model/3mf"],
|
352
|
+
["gltf", "model/gltf+json"],
|
353
|
+
["glb", "model/gltf-binary"],
|
354
|
+
["iges", "model/iges"],
|
355
|
+
["igs", "model/iges"],
|
356
|
+
["mesh", "model/mesh"],
|
357
|
+
["msh", "model/mesh"],
|
358
|
+
["silo", "model/mesh"],
|
359
|
+
["mtl", "model/mtl"],
|
360
|
+
["obj", "model/obj"],
|
361
|
+
["stpx", "model/step+xml"],
|
362
|
+
["stpz", "model/step+zip"],
|
363
|
+
["stpxz", "model/step-xml+zip"],
|
364
|
+
["stl", "model/stl"],
|
365
|
+
["vrml", "model/vrml"],
|
366
|
+
["wrl", "model/vrml"],
|
367
|
+
["*x3db", "model/x3d+binary"],
|
368
|
+
["x3dbz", "model/x3d+binary"],
|
369
|
+
["x3db", "model/x3d+fastinfoset"],
|
370
|
+
["*x3dv", "model/x3d+vrml"],
|
371
|
+
["x3dvz", "model/x3d+vrml"],
|
372
|
+
["x3d", "model/x3d+xml"],
|
373
|
+
["x3dz", "model/x3d+xml"],
|
374
|
+
["x3dv", "model/x3d-vrml"],
|
375
|
+
["appcache", "text/cache-manifest"],
|
376
|
+
["manifest", "text/cache-manifest"],
|
377
|
+
["ics", "text/calendar"],
|
378
|
+
["ifb", "text/calendar"],
|
379
|
+
["coffee", "text/coffeescript"],
|
380
|
+
["litcoffee", "text/coffeescript"],
|
381
|
+
["css", "text/css"],
|
382
|
+
["csv", "text/csv"],
|
383
|
+
["htm", "text/html"],
|
384
|
+
["html", "text/html"],
|
385
|
+
["shtml", "text/html"],
|
386
|
+
["jade", "text/jade"],
|
387
|
+
["jsx", "text/jsx"],
|
388
|
+
["less", "text/less"],
|
389
|
+
["markdown", "text/markdown"],
|
390
|
+
["md", "text/markdown"],
|
391
|
+
["mml", "text/mathml"],
|
392
|
+
["mdx", "text/mdx"],
|
393
|
+
["n3", "text/n3"],
|
394
|
+
["conf", "text/plain"],
|
395
|
+
["def", "text/plain"],
|
396
|
+
["in", "text/plain"],
|
397
|
+
["ini", "text/plain"],
|
398
|
+
["list", "text/plain"],
|
399
|
+
["log", "text/plain"],
|
400
|
+
["text", "text/plain"],
|
401
|
+
["txt", "text/plain"],
|
402
|
+
["rtx", "text/richtext"],
|
403
|
+
["*rtf", "text/rtf"],
|
404
|
+
["sgm", "text/sgml"],
|
405
|
+
["sgml", "text/sgml"],
|
406
|
+
["shex", "text/shex"],
|
407
|
+
["slim", "text/slim"],
|
408
|
+
["slm", "text/slim"],
|
409
|
+
["spdx", "text/spdx"],
|
410
|
+
["styl", "text/stylus"],
|
411
|
+
["stylus", "text/stylus"],
|
412
|
+
["tsv", "text/tab-separated-values"],
|
413
|
+
["man", "text/troff"],
|
414
|
+
["me", "text/troff"],
|
415
|
+
["ms", "text/troff"],
|
416
|
+
["roff", "text/troff"],
|
417
|
+
["t", "text/troff"],
|
418
|
+
["tr", "text/troff"],
|
419
|
+
["ttl", "text/turtle"],
|
420
|
+
["uri", "text/uri-list"],
|
421
|
+
["uris", "text/uri-list"],
|
422
|
+
["urls", "text/uri-list"],
|
423
|
+
["vcard", "text/vcard"],
|
424
|
+
["vtt", "text/vtt"],
|
425
|
+
["*xml", "text/xml"],
|
426
|
+
["yaml", "text/yaml"],
|
427
|
+
["yml", "text/yaml"],
|
428
|
+
["3gp", "video/3gpp"],
|
429
|
+
["3gpp", "video/3gpp"],
|
430
|
+
["3g2", "video/3gpp2"],
|
431
|
+
["h261", "video/h261"],
|
432
|
+
["h263", "video/h263"],
|
433
|
+
["h264", "video/h264"],
|
434
|
+
["m4s", "video/iso.segment"],
|
435
|
+
["jpgv", "video/jpeg"],
|
436
|
+
["jpm", "video/jpm"],
|
437
|
+
["jpgm", "video/jpm"],
|
438
|
+
["mj2", "video/mj2"],
|
439
|
+
["mjp2", "video/mj2"],
|
440
|
+
["ts", "video/mp2t"],
|
441
|
+
["mp4", "video/mp4"],
|
442
|
+
["mp4v", "video/mp4"],
|
443
|
+
["mpg4", "video/mp4"],
|
444
|
+
["m1v", "video/mpeg"],
|
445
|
+
["m2v", "video/mpeg"],
|
446
|
+
["mpe", "video/mpeg"],
|
447
|
+
["mpeg", "video/mpeg"],
|
448
|
+
["mpg", "video/mpeg"],
|
449
|
+
["ogv", "video/ogg"],
|
450
|
+
["mov", "video/quicktime"],
|
451
|
+
["qt", "video/quicktime"],
|
452
|
+
["webm", "video/webm"]
|
453
|
+
]);
|
454
|
+
// Annotate the CommonJS export names for ESM import in node:
|
455
|
+
0 && (module.exports = {
|
456
|
+
getMimeTypeForPath,
|
457
|
+
isJsonMimeType,
|
458
|
+
isTextualMimeType
|
459
|
+
});
|
@@ -0,0 +1,80 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var multimap_exports = {};
|
20
|
+
__export(multimap_exports, {
|
21
|
+
MultiMap: () => MultiMap
|
22
|
+
});
|
23
|
+
module.exports = __toCommonJS(multimap_exports);
|
24
|
+
class MultiMap {
|
25
|
+
constructor() {
|
26
|
+
this._map = /* @__PURE__ */ new Map();
|
27
|
+
}
|
28
|
+
set(key, value) {
|
29
|
+
let values = this._map.get(key);
|
30
|
+
if (!values) {
|
31
|
+
values = [];
|
32
|
+
this._map.set(key, values);
|
33
|
+
}
|
34
|
+
values.push(value);
|
35
|
+
}
|
36
|
+
get(key) {
|
37
|
+
return this._map.get(key) || [];
|
38
|
+
}
|
39
|
+
has(key) {
|
40
|
+
return this._map.has(key);
|
41
|
+
}
|
42
|
+
delete(key, value) {
|
43
|
+
const values = this._map.get(key);
|
44
|
+
if (!values)
|
45
|
+
return;
|
46
|
+
if (values.includes(value))
|
47
|
+
this._map.set(key, values.filter((v) => value !== v));
|
48
|
+
}
|
49
|
+
deleteAll(key) {
|
50
|
+
this._map.delete(key);
|
51
|
+
}
|
52
|
+
hasValue(key, value) {
|
53
|
+
const values = this._map.get(key);
|
54
|
+
if (!values)
|
55
|
+
return false;
|
56
|
+
return values.includes(value);
|
57
|
+
}
|
58
|
+
get size() {
|
59
|
+
return this._map.size;
|
60
|
+
}
|
61
|
+
[Symbol.iterator]() {
|
62
|
+
return this._map[Symbol.iterator]();
|
63
|
+
}
|
64
|
+
keys() {
|
65
|
+
return this._map.keys();
|
66
|
+
}
|
67
|
+
values() {
|
68
|
+
const result = [];
|
69
|
+
for (const key of this.keys())
|
70
|
+
result.push(...this.get(key));
|
71
|
+
return result;
|
72
|
+
}
|
73
|
+
clear() {
|
74
|
+
this._map.clear();
|
75
|
+
}
|
76
|
+
}
|
77
|
+
// Annotate the CommonJS export names for ESM import in node:
|
78
|
+
0 && (module.exports = {
|
79
|
+
MultiMap
|
80
|
+
});
|
@@ -0,0 +1,78 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var protocolFormatter_exports = {};
|
20
|
+
__export(protocolFormatter_exports, {
|
21
|
+
formatProtocolParam: () => formatProtocolParam,
|
22
|
+
getActionGroup: () => getActionGroup,
|
23
|
+
renderTitleForCall: () => renderTitleForCall
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(protocolFormatter_exports);
|
26
|
+
var import_protocolMetainfo = require("./protocolMetainfo");
|
27
|
+
function formatProtocolParam(params, alternatives) {
|
28
|
+
if (!params)
|
29
|
+
return void 0;
|
30
|
+
for (const name of alternatives.split("|")) {
|
31
|
+
if (name === "url") {
|
32
|
+
try {
|
33
|
+
const urlObject = new URL(params[name]);
|
34
|
+
if (urlObject.protocol === "data:")
|
35
|
+
return urlObject.protocol;
|
36
|
+
if (urlObject.protocol === "about:")
|
37
|
+
return params[name];
|
38
|
+
return urlObject.pathname + urlObject.search;
|
39
|
+
} catch (error) {
|
40
|
+
if (params[name] !== void 0)
|
41
|
+
return params[name];
|
42
|
+
}
|
43
|
+
}
|
44
|
+
if (name === "timeNumber" && params[name] !== void 0) {
|
45
|
+
return new Date(params[name]).toString();
|
46
|
+
}
|
47
|
+
const value = deepParam(params, name);
|
48
|
+
if (value !== void 0)
|
49
|
+
return value;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
function deepParam(params, name) {
|
53
|
+
const tokens = name.split(".");
|
54
|
+
let current = params;
|
55
|
+
for (const token of tokens) {
|
56
|
+
if (typeof current !== "object" || current === null)
|
57
|
+
return void 0;
|
58
|
+
current = current[token];
|
59
|
+
}
|
60
|
+
if (current === void 0)
|
61
|
+
return void 0;
|
62
|
+
return String(current);
|
63
|
+
}
|
64
|
+
function renderTitleForCall(metadata) {
|
65
|
+
const titleFormat = metadata.title ?? import_protocolMetainfo.methodMetainfo.get(metadata.type + "." + metadata.method)?.title ?? metadata.method;
|
66
|
+
return titleFormat.replace(/\{([^}]+)\}/g, (fullMatch, p1) => {
|
67
|
+
return formatProtocolParam(metadata.params, p1) ?? fullMatch;
|
68
|
+
});
|
69
|
+
}
|
70
|
+
function getActionGroup(metadata) {
|
71
|
+
return import_protocolMetainfo.methodMetainfo.get(metadata.type + "." + metadata.method)?.group;
|
72
|
+
}
|
73
|
+
// Annotate the CommonJS export names for ESM import in node:
|
74
|
+
0 && (module.exports = {
|
75
|
+
formatProtocolParam,
|
76
|
+
getActionGroup,
|
77
|
+
renderTitleForCall
|
78
|
+
});
|