@jsenv/core 25.6.2 → 27.0.0-alpha.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/main.js +18 -20
- package/package.json +38 -73
- package/readme.md +32 -44
- package/src/build/build.js +737 -0
- package/src/build/build_urls_generator.js +64 -0
- package/src/build/inject_version_mappings.js +62 -0
- package/src/build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js +225 -0
- package/src/build/plugins/minify_html/jsenv_plugin_minify_html.js +30 -0
- package/src/build/plugins/minify_js/jsenv_plugin_minify_js.js +47 -0
- package/src/dev/plugins/autoreload/babel_plugin_metadata_import_meta_hot.js +98 -0
- package/src/dev/plugins/autoreload/client/autoreload_preference.js +11 -0
- package/src/dev/plugins/autoreload/client/event_source_client.js +186 -0
- package/src/{internal/dev_server/event_source_client → dev/plugins/autoreload/client}/event_source_connection.js +21 -25
- package/src/dev/plugins/autoreload/client/import_meta_hot.js +80 -0
- package/src/dev/plugins/autoreload/client/reload.js +101 -0
- package/src/dev/plugins/autoreload/client/url_helpers.js +20 -0
- package/src/dev/plugins/autoreload/html_hot_dependencies.js +156 -0
- package/src/dev/plugins/autoreload/jsenv_plugin_autoreload.js +374 -0
- package/src/dev/plugins/autoreload/sse_service.js +149 -0
- package/src/dev/plugins/explorer/client/explorer.html +607 -0
- package/src/{internal → dev/plugins/explorer/client}/jsenv.png +0 -0
- package/src/dev/plugins/explorer/jsenv_plugin_explorer.js +74 -0
- package/src/{internal/dev_server/toolbar/animation/toolbar.animation.js → dev/plugins/toolbar/client/animation/toolbar_animation.js} +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/eventsource/eventsource.css +2 -2
- package/src/dev/plugins/toolbar/client/eventsource/toolbar_eventsource.js +57 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/execution/execution.css +0 -0
- package/src/dev/plugins/toolbar/client/execution/toolbar_execution.js +88 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/focus.css +0 -0
- package/src/{internal/dev_server/toolbar/focus/toolbar.focus.js → dev/plugins/toolbar/client/focus/toolbar_focus.js} +0 -0
- package/src/{internal/dev_server/toolbar/jsenv-logo.svg → dev/plugins/toolbar/client/jsenv_logo.svg} +1 -1
- package/src/{internal/dev_server/toolbar/notification/toolbar.notification.js → dev/plugins/toolbar/client/notification/toolbar_notification.js} +0 -0
- package/src/{internal/dev_server/toolbar/responsive/overflow-menu.css → dev/plugins/toolbar/client/responsive/overflow_menu.css} +0 -0
- package/src/{internal/dev_server/toolbar/responsive/toolbar.responsive.js → dev/plugins/toolbar/client/responsive/toolbar_responsive.js} +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/settings.css +0 -0
- package/src/{internal/dev_server/toolbar/settings/toolbar.settings.js → dev/plugins/toolbar/client/settings/toolbar_settings.js} +1 -0
- package/src/{internal/dev_server/toolbar/theme/jsenv-theme.css → dev/plugins/toolbar/client/theme/jsenv_theme.css} +1 -15
- package/src/{internal/dev_server/toolbar/theme/light-theme.css → dev/plugins/toolbar/client/theme/light_theme.css} +0 -17
- package/src/{internal/dev_server/toolbar/theme/toolbar.theme.js → dev/plugins/toolbar/client/theme/toolbar_theme.js} +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar.html +42 -201
- package/src/{internal/dev_server/toolbar/toolbar.injector.js → dev/plugins/toolbar/client/toolbar_injector.js} +10 -29
- package/src/{internal/dev_server/toolbar/toolbar.main.css → dev/plugins/toolbar/client/toolbar_main.css} +2 -26
- package/src/{internal/dev_server/toolbar/toolbar.main.js → dev/plugins/toolbar/client/toolbar_main.js} +18 -64
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.css +1 -1
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/animation.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/dom.js +0 -0
- package/src/{internal/browser_utils/fetchUsingXHR.js → dev/plugins/toolbar/client/util/fetch_using_xhr.js} +0 -2
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/fetching.js +2 -4
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/iframe_to_parent_href.js +0 -0
- package/src/{internal/dev_server/toolbar/util/jsenvLogger.js → dev/plugins/toolbar/client/util/jsenv_logger.js} +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/preferences.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/responsive.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/util.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/variant/variant.js +0 -0
- package/src/dev/plugins/toolbar/jsenv_plugin_toolbar.js +62 -0
- package/src/dev/start_dev_server.js +105 -0
- package/src/execute/execute.js +132 -0
- package/src/execute/run.js +208 -0
- package/src/execute/runtimes/browsers/chromium.js +8 -0
- package/src/execute/runtimes/browsers/firefox.js +7 -0
- package/src/execute/runtimes/browsers/from_playwright.js +464 -0
- package/src/execute/runtimes/browsers/webkit.js +24 -0
- package/src/{internal/node_launcher/createChildProcessOptions.js → execute/runtimes/node/child_exec_options.js} +25 -36
- package/src/{internal/node_runtime/nodeControllableFile.mjs → execute/runtimes/node/controllable_file.mjs} +1 -18
- package/src/{internal/node_launcher/createControllableNodeProcess.js → execute/runtimes/node/controlled_process.js} +128 -150
- package/src/execute/runtimes/node/exec_options.js +44 -0
- package/src/{internal/node_launcher → execute/runtimes/node}/kill_process_tree.js +4 -2
- package/src/execute/runtimes/node/node_process.js +92 -0
- package/src/execute/runtimes/node/node_worker_thread.js +28 -0
- package/src/omega/core_plugins/babel/babel_helper/babel_helper_directory.js +29 -0
- package/src/{internal/compiling/js-compilation-service → omega/core_plugins/babel/babel_helper}/babel_plugin_babel_helpers_as_jsenv_imports.js +16 -19
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/.eslintrc.cjs +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AsyncGenerator/AsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AwaitValue/AwaitValue.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayLikeToArray/arrayLikeToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithHoles/arrayWithHoles.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithoutHoles/arrayWithoutHoles.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/assertThisInitialized/assertThisInitialized.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncIterator/asyncIterator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncToGenerator/asyncToGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCallCheck/classCallCheck.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classNameTDZError/classNameTDZError.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldGet/classPrivateFieldGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldSet/classPrivateFieldSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodGet/classPrivateMethodGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodSet/classPrivateMethodSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/construct/construct.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createClass/createClass.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createRawReactElement/createRawReactElement.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createSuper/createSuper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/decorate/decorate.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defaults/defaults.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineEnumerableProperties/defineEnumerableProperties.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineProperty/defineProperty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/extends/extends.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/get/get.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/getPrototypeOf/getPrototypeOf.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inherits/inherits.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inheritsLoose/inheritsLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerDefineProperty/initializerDefineProperty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerWarningHelper/initializerWarningHelper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/instanceof/instanceof.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireDefault/interopRequireDefault.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireWildcard/interopRequireWildcard.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeFunction/isNativeFunction.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArray/iterableToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimit/iterableToArrayLimit.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/jsx/jsx.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/maybeArrayLike/maybeArrayLike.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/newArrowCheck/newArrowCheck.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableRest/nonIterableRest.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableSpread/nonIterableSpread.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread/objectSpread.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread2/objectSpread2.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutProperties/objectWithoutProperties.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/possibleConstructorReturn/possibleConstructorReturn.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readOnlyError/readOnlyError.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readme.md +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/set/set.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/setPrototypeOf/setPrototypeOf.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArray/slicedToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArrayLoose/slicedToArrayLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/superPropBase/superPropBase.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/tdz/tdz.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalRef/temporalRef.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalUndefined/temporalUndefined.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toArray/toArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toConsumableArray/toConsumableArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPrimitive/toPrimitive.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPropertyKey/toPropertyKey.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/typeof/typeof.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapNativeSuper/wrapNativeSuper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapRegExp/wrapRegExp.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/writeOnlyError/writeOnlyError.js +0 -0
- package/src/omega/core_plugins/babel/global_this/babel_plugin_global_this_as_jsenv_import.js +35 -0
- package/{helpers/global-this/global-this.js → src/omega/core_plugins/babel/global_this/client/global_this.js} +0 -0
- package/src/omega/core_plugins/babel/helpers/babel_plugin_structure.js +187 -0
- package/src/{internal/features → omega/core_plugins/babel/helpers}/babel_plugins_compatibility.js +1 -24
- package/src/omega/core_plugins/babel/jsenv_plugin_babel.js +97 -0
- package/src/omega/core_plugins/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +117 -0
- package/src/omega/core_plugins/babel/new_stylesheet/client/.eslintrc.cjs +24 -0
- package/{helpers/new_stylesheet → src/omega/core_plugins/babel/new_stylesheet/client}/new_stylesheet.js +0 -0
- package/src/omega/core_plugins/babel/regenerator_runtime/babel_plugin_regenerator_runtime_as_jsenv_import.js +34 -0
- package/{helpers/regenerator-runtime/regenerator-runtime.js → src/omega/core_plugins/babel/regenerator_runtime/client/regenerator_runtime.js} +0 -0
- package/src/omega/core_plugins/commonjs_globals/jsenv_plugin_commonjs_globals.js +169 -0
- package/src/omega/core_plugins/file_urls/jsenv_plugin_file_urls.js +67 -0
- package/src/omega/core_plugins/filesystem_magic/jsenv_plugin_filesystem_magic.js +58 -0
- package/src/{internal/browser_runtime/displayErrorInDocument.js → omega/core_plugins/html_supervisor/client/error_in_document.js} +10 -18
- package/src/{internal/browser_runtime/displayErrorNotification.js → omega/core_plugins/html_supervisor/client/error_in_notification.js} +0 -1
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_installer.js +168 -0
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_setup.js +77 -0
- package/src/{internal → omega/core_plugins/html_supervisor/client}/perf_browser.js +0 -2
- package/src/{internal/unevalException.js → omega/core_plugins/html_supervisor/client/uneval_exception.js} +1 -1
- package/src/omega/core_plugins/html_supervisor/jsenv_plugin_html_supervisor.js +233 -0
- package/src/omega/core_plugins/import_assertions/helpers/babel_plugin_metadata_import_assertions.js +98 -0
- package/src/{internal/building → omega/core_plugins/import_assertions/helpers}/json_module.js +3 -2
- package/src/omega/core_plugins/import_assertions/helpers/text_module.js +6 -0
- package/src/omega/core_plugins/import_assertions/jsenv_plugin_import_assertions.js +211 -0
- package/src/omega/core_plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +80 -0
- package/src/omega/core_plugins/importmap/jsenv_plugin_importmap.js +212 -0
- package/src/omega/core_plugins/inline/client/inline_content.js +6 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_data_urls.js +70 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_inline.js +13 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_inline_query_param.js +42 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_js_and_css_inside_html.js +142 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_new_inline_content.js +210 -0
- package/src/omega/core_plugins/leading_slash/jsenv_plugin_leading_slash.js +12 -0
- package/src/omega/core_plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +77 -0
- package/src/omega/core_plugins/url_resolution/jsenv_plugin_url_resolution.js +28 -0
- package/src/omega/core_plugins/url_version/jsenv_plugin_url_version.js +50 -0
- package/src/omega/core_plugins.js +39 -0
- package/src/omega/errors.js +168 -0
- package/src/omega/file_url_converter.js +63 -0
- package/src/omega/kitchen.js +777 -0
- package/src/omega/omega_server.js +129 -0
- package/src/omega/plugin_controller.js +240 -0
- package/src/omega/runtime_support/default_runtime_support.js +13 -0
- package/src/omega/runtime_support/features_compatibility.js +91 -0
- package/src/omega/runtime_support/runtime_support.js +20 -0
- package/src/omega/server/file_service.js +155 -0
- package/src/omega/server/user_agent.js +22 -0
- package/src/omega/url_graph/url_graph_load.js +68 -0
- package/src/omega/url_graph/url_graph_report.js +151 -0
- package/src/omega/url_graph/url_graph_sort.js +29 -0
- package/src/omega/url_graph/url_info_transformations.js +161 -0
- package/src/omega/url_graph.js +132 -0
- package/src/omega/url_mentions/css_url_mentions.js +63 -0
- package/src/omega/url_mentions/html_url_mentions.js +185 -0
- package/src/omega/url_mentions/js_module_url_mentions.js +91 -0
- package/src/omega/url_mentions/parse_url_mentions.js +37 -0
- package/src/omega/url_mentions/worker_classic_url_mentions.js +37 -0
- package/src/{internal/executing/executePlan.js → test/execute_plan.js} +159 -213
- package/src/{executeTestPlan.js → test/execute_test_plan.js} +36 -84
- package/src/{internal/executing → test}/execution_colors.js +0 -0
- package/src/{internal/executing/generateFileExecutionSteps.js → test/execution_steps.js} +25 -4
- package/src/{internal/executing → test}/gc.js +0 -0
- package/src/test/logs_file_execution.js +223 -0
- package/dist/browser_runtime/asset-manifest.json +0 -4
- package/dist/browser_runtime/browser_runtime_c81cd9af.js +0 -5300
- package/dist/browser_runtime/browser_runtime_c81cd9af.js.map +0 -1089
- package/dist/build_manifest.js +0 -12
- package/dist/compile_proxy/asset-manifest.json +0 -4
- package/dist/compile_proxy/compile_proxy.html__inline__20_c05fdc30.js.map +0 -343
- package/dist/compile_proxy/compile_proxy_93ec4247.html +0 -2247
- package/dist/event_source_client/asset-manifest.json +0 -4
- package/dist/event_source_client/event_source_client_69f48287.js +0 -354
- package/dist/event_source_client/event_source_client_69f48287.js.map +0 -128
- package/dist/redirector/asset-manifest.json +0 -4
- package/dist/redirector/redirector.html__inline__12_20421b23.js.map +0 -349
- package/dist/redirector/redirector_ddc79416.html +0 -2292
- package/dist/toolbar/asset-manifest.json +0 -13
- package/dist/toolbar/assets/compilation.css_7421bd55.map +0 -12
- package/dist/toolbar/assets/eventsource.css_c0c71e7b.map +0 -12
- package/dist/toolbar/assets/execution.css_f3377c10.map +0 -12
- package/dist/toolbar/assets/focus.css_896f3e45.map +0 -12
- package/dist/toolbar/assets/light-theme.css_72a60fa3.map +0 -12
- package/dist/toolbar/assets/overflow-menu.css_2859d519.map +0 -12
- package/dist/toolbar/assets/settings.css_942b5a9e.map +0 -12
- package/dist/toolbar/assets/toolbar.main.css_b7d8bec1.map +0 -28
- package/dist/toolbar/assets/tooltip.css_a94a8bdd.map +0 -12
- package/dist/toolbar/toolbar.main_7d7783d3.js.map +0 -776
- package/dist/toolbar/toolbar_d6045dd0.html +0 -4978
- package/dist/toolbar_injector/asset-manifest.json +0 -5
- package/dist/toolbar_injector/assets/jsenv-logo_188b9ca6.svg +0 -95
- package/dist/toolbar_injector/toolbar_injector_c8c214dd.js +0 -977
- package/dist/toolbar_injector/toolbar_injector_c8c214dd.js.map +0 -294
- package/helpers/import-meta/import-meta-url-commonjs.js +0 -9
- package/helpers/import-meta/import-meta-url-global.js +0 -54
- package/src/buildProject.js +0 -336
- package/src/commonJsToJavaScriptModule.js +0 -180
- package/src/dev_server.js +0 -295
- package/src/execute.js +0 -184
- package/src/importUsingChildProcess.js +0 -68
- package/src/internal/argUtils.js +0 -12
- package/src/internal/babel_plugin_replace_expressions.js +0 -101
- package/src/internal/browser_detection/browser_detection.js +0 -68
- package/src/internal/browser_detection/detectAndroid.js +0 -13
- package/src/internal/browser_detection/detectChrome.js +0 -28
- package/src/internal/browser_detection/detectEdge.js +0 -13
- package/src/internal/browser_detection/detectElectron.js +0 -1
- package/src/internal/browser_detection/detectFirefox.js +0 -17
- package/src/internal/browser_detection/detectIOS.js +0 -19
- package/src/internal/browser_detection/detectInternetExplorer.js +0 -14
- package/src/internal/browser_detection/detectOpera.js +0 -27
- package/src/internal/browser_detection/detectSafari.js +0 -13
- package/src/internal/browser_detection/user_agent_data.js +0 -26
- package/src/internal/browser_detection/util.js +0 -13
- package/src/internal/browser_launcher/browser_runtime_profile.js +0 -81
- package/src/internal/browser_launcher/executeHtmlFile.js +0 -354
- package/src/internal/browser_launcher/from_playwright.js +0 -320
- package/src/internal/browser_launcher/trackPageToNotify.js +0 -77
- package/src/internal/browser_runtime/browser_runtime.js +0 -224
- package/src/internal/browser_runtime/browser_system.js +0 -218
- package/src/internal/browser_runtime/createBrowserRuntime.js +0 -146
- package/src/internal/browser_runtime/evalSource.js +0 -11
- package/src/internal/browser_runtime/makeNamespaceTransferable.js +0 -90
- package/src/internal/browser_utils/fetchAndEvalUsingFetch.js +0 -29
- package/src/internal/browser_utils/fetchAndEvalUsingScript.js +0 -49
- package/src/internal/browser_utils/fetchJson.js +0 -7
- package/src/internal/browser_utils/fetch_browser.js +0 -34
- package/src/internal/building/buildToCompilationResult.js +0 -183
- package/src/internal/building/buildUsingRollup.js +0 -359
- package/src/internal/building/build_logs.js +0 -133
- package/src/internal/building/build_stats.js +0 -100
- package/src/internal/building/build_url_generator.js +0 -153
- package/src/internal/building/css/applyPostCss.js +0 -55
- package/src/internal/building/css/moveCssUrls.js +0 -44
- package/src/internal/building/css/parseCssRessource.js +0 -259
- package/src/internal/building/css/parseCssUrls.js +0 -38
- package/src/internal/building/css/postcss_plugin_url_visitor.js +0 -244
- package/src/internal/building/css/replaceCssUrls.js +0 -67
- package/src/internal/building/css_module.js +0 -43
- package/src/internal/building/es_to_system.js +0 -34
- package/src/internal/building/html/htmlScan.js +0 -70
- package/src/internal/building/html/minifyHtml.js +0 -7
- package/src/internal/building/html/parseHtmlRessource.js +0 -814
- package/src/internal/building/import_references.js +0 -80
- package/src/internal/building/importmap/parseImportmapRessource.js +0 -28
- package/src/internal/building/js/babel_plugin_inline_worker_imports.js +0 -96
- package/src/internal/building/js/minifyJs.js +0 -33
- package/src/internal/building/js/parseJsRessource.js +0 -121
- package/src/internal/building/js/transform_worker.js +0 -55
- package/src/internal/building/json/parseJsonRessource.js +0 -11
- package/src/internal/building/parseRessource.js +0 -207
- package/src/internal/building/parsing.utils.js +0 -29
- package/src/internal/building/resolve_import_url_helper.js +0 -12
- package/src/internal/building/ressource_builder.js +0 -1097
- package/src/internal/building/ressource_builder_util.js +0 -194
- package/src/internal/building/rollup_plugin_jsenv.js +0 -1963
- package/src/internal/building/sortObjectByPathnames.js +0 -10
- package/src/internal/building/sourcemap_loader.js +0 -73
- package/src/internal/building/svg/parseSvgRessource.js +0 -111
- package/src/internal/building/url_fetcher.js +0 -85
- package/src/internal/building/url_loader.js +0 -127
- package/src/internal/building/url_trace.js +0 -229
- package/src/internal/building/url_versioning.js +0 -65
- package/src/internal/building/webmanifest/parseWebmanifestRessource.js +0 -48
- package/src/internal/compiling/babel_parse_error.js +0 -9
- package/src/internal/compiling/babel_plugin_global_this_as_jsenv_import.js +0 -34
- package/src/internal/compiling/babel_plugin_import_assertions.js +0 -120
- package/src/internal/compiling/babel_plugin_import_metadata.js +0 -18
- package/src/internal/compiling/babel_plugin_import_visitor.js +0 -84
- package/src/internal/compiling/babel_plugin_new_stylesheet_as_jsenv_import.js +0 -113
- package/src/internal/compiling/babel_plugin_proxy_external_imports.js +0 -31
- package/src/internal/compiling/babel_plugin_transform_import_meta.js +0 -134
- package/src/internal/compiling/babel_plugins.js +0 -37
- package/src/internal/compiling/compileFile.js +0 -271
- package/src/internal/compiling/compileHtml.js +0 -544
- package/src/internal/compiling/createCompiledFileService.js +0 -263
- package/src/internal/compiling/html_source_file_service.js +0 -453
- package/src/internal/compiling/js-compilation-service/ansiToHTML.js +0 -9
- package/src/internal/compiling/js-compilation-service/babelHelper.js +0 -145
- package/src/internal/compiling/js-compilation-service/babel_plugin_regenerator_runtime_as_jsenv_import.js +0 -48
- package/src/internal/compiling/js-compilation-service/babel_plugin_systemjs_prepend.js +0 -23
- package/src/internal/compiling/js-compilation-service/generateBabelHelper.js +0 -36
- package/src/internal/compiling/js-compilation-service/transformJs.js +0 -196
- package/src/internal/compiling/jsenvCompilerForHtml.js +0 -674
- package/src/internal/compiling/jsenvCompilerForImportmap.js +0 -28
- package/src/internal/compiling/jsenvCompilerForJavaScript.js +0 -61
- package/src/internal/compiling/jsenv_directory/comparison_utils.js +0 -27
- package/src/internal/compiling/jsenv_directory/compile_asset.js +0 -24
- package/src/internal/compiling/jsenv_directory/compile_context.js +0 -60
- package/src/internal/compiling/jsenv_directory/compile_profile.js +0 -217
- package/src/internal/compiling/jsenv_directory/file_lock_registry.js +0 -24
- package/src/internal/compiling/jsenv_directory/file_lock_registry.test.js +0 -47
- package/src/internal/compiling/jsenv_directory/fs-optimized-for-cache.js +0 -57
- package/src/internal/compiling/jsenv_directory/getOrGenerateCompiledFile.js +0 -269
- package/src/internal/compiling/jsenv_directory/jsenv_directory.js +0 -174
- package/src/internal/compiling/jsenv_directory/updateMeta.js +0 -150
- package/src/internal/compiling/jsenv_directory/validateCache.js +0 -264
- package/src/internal/compiling/load_babel_plugin_map_from_file.js +0 -49
- package/src/internal/compiling/rollup_plugin_commonjs_named_exports.js +0 -187
- package/src/internal/compiling/sse_service/sse_service.js +0 -369
- package/src/internal/compiling/startCompileServer.js +0 -518
- package/src/internal/compiling/transformResultToCompilationResult.js +0 -242
- package/src/internal/dataUrl.utils.js +0 -55
- package/src/internal/dev_server/event_source_client/event_source_client.js +0 -63
- package/src/internal/dev_server/event_source_client/file_changes.js +0 -82
- package/src/internal/dev_server/event_source_client/livereload_preference.js +0 -13
- package/src/internal/dev_server/exploring/exploring.css +0 -237
- package/src/internal/dev_server/exploring/exploring.html +0 -79
- package/src/internal/dev_server/exploring/exploring.js +0 -243
- package/src/internal/dev_server/exploring/fetchExploringJson.js +0 -19
- package/src/internal/dev_server/toolbar/compilation/compilation.css +0 -23
- package/src/internal/dev_server/toolbar/compilation/toolbar.compilation.js +0 -201
- package/src/internal/dev_server/toolbar/eventsource/toolbar.eventsource.js +0 -83
- package/src/internal/dev_server/toolbar/execution/toolbar.execution.js +0 -91
- package/src/internal/error-stack-remapping/getOriginalCallsites.js +0 -217
- package/src/internal/error-stack-remapping/installBrowserErrorStackRemapping.js +0 -45
- package/src/internal/error-stack-remapping/installErrorStackRemapping.js +0 -141
- package/src/internal/error-stack-remapping/installNodeErrorStackRemapping.js +0 -20
- package/src/internal/error-stack-remapping/remapCallSite.js +0 -314
- package/src/internal/error-stack-remapping/stackToString.js +0 -9
- package/src/internal/escapeRegexpSpecialCharacters.js +0 -34
- package/src/internal/escapeTemplateStringSpecialCharacters.js +0 -20
- package/src/internal/executing/coverage/babel_plugin_instrument.js +0 -90
- package/src/internal/executing/coverage/reportToCoverage.js +0 -198
- package/src/internal/executing/coverage_missing/createEmptyCoverage.js +0 -6
- package/src/internal/executing/coverage_missing/list_files_not_covered.js +0 -20
- package/src/internal/executing/coverage_missing/missing_coverage.js +0 -46
- package/src/internal/executing/coverage_missing/relativeUrlToEmptyCoverage.js +0 -63
- package/src/internal/executing/coverage_reporter/coverage_reporter_html_directory.js +0 -36
- package/src/internal/executing/coverage_reporter/coverage_reporter_json_file.js +0 -22
- package/src/internal/executing/coverage_reporter/coverage_reporter_text_log.js +0 -19
- package/src/internal/executing/coverage_reporter/istanbulCoverageMapFromCoverage.js +0 -16
- package/src/internal/executing/coverage_utils/file_by_file_coverage.js +0 -28
- package/src/internal/executing/coverage_utils/istanbul_coverage_composition.js +0 -28
- package/src/internal/executing/coverage_utils/v8_and_istanbul.js +0 -38
- package/src/internal/executing/coverage_utils/v8_coverage_composition.js +0 -23
- package/src/internal/executing/coverage_utils/v8_coverage_from_directory.js +0 -86
- package/src/internal/executing/coverage_utils/v8_coverage_to_istanbul.js +0 -100
- package/src/internal/executing/createSummaryLog.js +0 -143
- package/src/internal/executing/executionIsPassed.js +0 -2
- package/src/internal/executing/executionLogs.js +0 -159
- package/src/internal/executing/generateExecutionSteps.js +0 -29
- package/src/internal/executing/launchAndExecute.js +0 -458
- package/src/internal/features/browser_feature_detection/browser_feature_detect_dynamic_import.js +0 -20
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_css.js +0 -23
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_json.js +0 -25
- package/src/internal/features/browser_feature_detection/browser_feature_detect_importmap.js +0 -37
- package/src/internal/features/browser_feature_detection/browser_feature_detect_new_stylesheet.js +0 -9
- package/src/internal/features/browser_feature_detection/browser_feature_detect_top_level_await.js +0 -14
- package/src/internal/features/browser_feature_detection/browser_feature_detection.js +0 -89
- package/src/internal/features/browser_feature_detection/compile_proxy.html +0 -27
- package/src/internal/features/browser_feature_detection/execute_with_script_module.js +0 -24
- package/src/internal/features/features_compat_from_runtime.js +0 -38
- package/src/internal/features/features_compat_from_runtime_support.js +0 -31
- package/src/internal/features/features_compatibility.js +0 -37
- package/src/internal/features/node_feature_detection/feature_detect_dynamic_import.mjs +0 -5
- package/src/internal/features/node_feature_detection/feature_detect_top_level_await.mjs +0 -1
- package/src/internal/features/node_feature_detection/node_feature_detect_dynamic_import.js +0 -5
- package/src/internal/features/node_feature_detection/node_feature_detect_top_level_await.js +0 -16
- package/src/internal/features/node_feature_detection/node_feature_detection.js +0 -66
- package/src/internal/fetchUrl.js +0 -28
- package/src/internal/filePathUtils.js +0 -19
- package/src/internal/import-resolution/default-extension.js +0 -40
- package/src/internal/import-resolution/import-resolver-importmap.js +0 -64
- package/src/internal/import-resolution/import-resolver-node.js +0 -254
- package/src/internal/import-resolution/importmap_default.js +0 -37
- package/src/internal/jsenvCoreDirectoryUrl.js +0 -11
- package/src/internal/jsenvInternalFiles.js +0 -36
- package/src/internal/jsenv_builds.js +0 -19
- package/src/internal/jsenv_remote_directory.js +0 -156
- package/src/internal/logs/byte.js +0 -10
- package/src/internal/logs/byteAsFileSize.js +0 -9
- package/src/internal/logs/msAsDuration.js +0 -12
- package/src/internal/memoize.js +0 -24
- package/src/internal/node_launcher/node_runtime_report.js +0 -77
- package/src/internal/node_launcher/processOptions.js +0 -46
- package/src/internal/node_runtime/evalSource.js +0 -6
- package/src/internal/node_runtime/fetchSource.js +0 -8
- package/src/internal/node_runtime/node_execution_dynamic_import.js +0 -74
- package/src/internal/node_runtime/node_execution_performance.js +0 -67
- package/src/internal/node_runtime/node_execution_systemjs.js +0 -125
- package/src/internal/node_runtime/node_system.js +0 -191
- package/src/internal/origin_directory_converter.js +0 -62
- package/src/internal/perf_node.js +0 -13
- package/src/internal/promise_race.js +0 -19
- package/src/internal/redirector/redirector.html +0 -40
- package/src/internal/require.js +0 -3
- package/src/internal/response_validation.js +0 -130
- package/src/internal/runtime/module-registration.js +0 -207
- package/src/internal/runtime/s.js +0 -864
- package/src/internal/runtime/s.js.md +0 -1
- package/src/internal/runtime/valueInstall.js +0 -14
- package/src/internal/runtime_support/jsenv_runtime_support.js +0 -15
- package/src/internal/runtime_support/runtime_support.js +0 -70
- package/src/internal/semantic_versioning/findHighestVersion.js +0 -12
- package/src/internal/semantic_versioning/findLowestVersion.js +0 -12
- package/src/internal/semantic_versioning/index.js +0 -5
- package/src/internal/semantic_versioning/valueToVersion.js +0 -44
- package/src/internal/semantic_versioning/versionCompare.js +0 -32
- package/src/internal/semantic_versioning/versionIsAbove.js +0 -5
- package/src/internal/semantic_versioning/versionIsBelow.js +0 -5
- package/src/internal/semantic_versioning/versionIsEqual.js +0 -3
- package/src/internal/sourceMappingURLUtils.js +0 -112
- package/src/internal/url_conversion.js +0 -313
- package/src/internal/url_utils.js +0 -33
- package/src/internal/url_utils.test.js +0 -39
- package/src/jsenvCoverageConfig.js +0 -7
- package/src/jsenvExplorableConfig.js +0 -9
- package/src/jsenvRuntimeSupportDuringDev.js +0 -12
- package/src/jsenvServiceWorkerFinalizer.js +0 -55
- package/src/jsonToJavaScriptModule.js +0 -12
- package/src/launchBrowser.js +0 -43
- package/src/launchNode.js +0 -227
- package/src/playwright_browser_versions.js +0 -5
- package/src/requireUsingChildProcess.js +0 -67
- package/src/textToJavaScriptModule.js +0 -14
|
@@ -1,977 +0,0 @@
|
|
|
1
|
-
(function () {
|
|
2
|
-
'use strict';
|
|
3
|
-
var nativeTypeOf = function nativeTypeOf(obj) {
|
|
4
|
-
return typeof obj;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
var customTypeOf = function customTypeOf(obj) {
|
|
8
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? nativeTypeOf : customTypeOf;
|
|
12
|
-
|
|
13
|
-
var defineProperty = (function (obj, key, value) {
|
|
14
|
-
// Shortcircuit the slow defineProperty path when possible.
|
|
15
|
-
// We are trying to avoid issues where setters defined on the
|
|
16
|
-
// prototype cause side effects under the fast path of simple
|
|
17
|
-
// assignment. By checking for existence of the property with
|
|
18
|
-
// the in operator, we can optimize most of this overhead away.
|
|
19
|
-
if (key in obj) {
|
|
20
|
-
Object.defineProperty(obj, key, {
|
|
21
|
-
value: value,
|
|
22
|
-
enumerable: true,
|
|
23
|
-
configurable: true,
|
|
24
|
-
writable: true
|
|
25
|
-
});
|
|
26
|
-
} else {
|
|
27
|
-
obj[key] = value;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return obj;
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// filters on symbol properties only. Returned string properties are always
|
|
34
|
-
// enumerable. It is good to use in objectSpread.
|
|
35
|
-
|
|
36
|
-
function ownKeys(object, enumerableOnly) {
|
|
37
|
-
var keys = Object.keys(object);
|
|
38
|
-
|
|
39
|
-
if (Object.getOwnPropertySymbols) {
|
|
40
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
41
|
-
|
|
42
|
-
if (enumerableOnly) {
|
|
43
|
-
symbols = symbols.filter(function (sym) {
|
|
44
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
keys.push.apply(keys, symbols);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return keys;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _objectSpread2(target) {
|
|
55
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
56
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
57
|
-
|
|
58
|
-
if (i % 2) {
|
|
59
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
60
|
-
defineProperty(target, key, source[key]);
|
|
61
|
-
});
|
|
62
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
63
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
64
|
-
} else {
|
|
65
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
66
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return target;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
var objectWithoutPropertiesLoose = (function (source, excluded) {
|
|
75
|
-
if (source === null) return {};
|
|
76
|
-
var target = {};
|
|
77
|
-
var sourceKeys = Object.keys(source);
|
|
78
|
-
var key;
|
|
79
|
-
var i;
|
|
80
|
-
|
|
81
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
82
|
-
key = sourceKeys[i];
|
|
83
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
84
|
-
target[key] = source[key];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return target;
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
var _objectWithoutProperties = (function (source, excluded) {
|
|
91
|
-
if (source === null) return {};
|
|
92
|
-
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
93
|
-
var key;
|
|
94
|
-
var i;
|
|
95
|
-
|
|
96
|
-
if (Object.getOwnPropertySymbols) {
|
|
97
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
98
|
-
|
|
99
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
100
|
-
key = sourceSymbolKeys[i];
|
|
101
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
102
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
103
|
-
target[key] = source[key];
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return target;
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
/* eslint-env browser */
|
|
111
|
-
function _await$4(value, then, direct) {
|
|
112
|
-
if (direct) {
|
|
113
|
-
return then ? then(value) : value;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (!value || !value.then) {
|
|
117
|
-
value = Promise.resolve(value);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return then ? value.then(then) : value;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function _async$4(f) {
|
|
124
|
-
return function () {
|
|
125
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
126
|
-
args[i] = arguments[i];
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
try {
|
|
130
|
-
return Promise.resolve(f.apply(this, args));
|
|
131
|
-
} catch (e) {
|
|
132
|
-
return Promise.reject(e);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function _call$1(body, then, direct) {
|
|
138
|
-
if (direct) {
|
|
139
|
-
return then ? then(body()) : body();
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
try {
|
|
143
|
-
var result = Promise.resolve(body());
|
|
144
|
-
return then ? result.then(then) : result;
|
|
145
|
-
} catch (e) {
|
|
146
|
-
return Promise.reject(e);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
var fetchUsingXHR = _async$4(function (url) {
|
|
151
|
-
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
152
|
-
signal = _ref.signal,
|
|
153
|
-
_ref$method = _ref.method,
|
|
154
|
-
method = _ref$method === void 0 ? "GET" : _ref$method,
|
|
155
|
-
_ref$credentials = _ref.credentials,
|
|
156
|
-
credentials = _ref$credentials === void 0 ? "same-origin" : _ref$credentials,
|
|
157
|
-
_ref$headers = _ref.headers,
|
|
158
|
-
headers = _ref$headers === void 0 ? {} : _ref$headers,
|
|
159
|
-
_ref$body = _ref.body,
|
|
160
|
-
body = _ref$body === void 0 ? null : _ref$body;
|
|
161
|
-
|
|
162
|
-
var headersPromise = createPromiseAndHooks();
|
|
163
|
-
var bodyPromise = createPromiseAndHooks();
|
|
164
|
-
var xhr = new XMLHttpRequest();
|
|
165
|
-
|
|
166
|
-
var failure = function failure(error) {
|
|
167
|
-
// if it was already resolved, we must reject the body promise
|
|
168
|
-
if (headersPromise.settled) {
|
|
169
|
-
bodyPromise.reject(error);
|
|
170
|
-
} else {
|
|
171
|
-
headersPromise.reject(error);
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
var cleanup = function cleanup() {
|
|
176
|
-
xhr.ontimeout = null;
|
|
177
|
-
xhr.onerror = null;
|
|
178
|
-
xhr.onload = null;
|
|
179
|
-
xhr.onreadystatechange = null;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
xhr.ontimeout = function () {
|
|
183
|
-
cleanup();
|
|
184
|
-
failure(new Error("xhr request timeout on ".concat(url, ".")));
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
xhr.onerror = function (error) {
|
|
188
|
-
cleanup(); // unfortunately with have no clue why it fails
|
|
189
|
-
// might be cors for instance
|
|
190
|
-
|
|
191
|
-
failure(createRequestError(error, {
|
|
192
|
-
url: url
|
|
193
|
-
}));
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
xhr.onload = function () {
|
|
197
|
-
cleanup();
|
|
198
|
-
bodyPromise.resolve();
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
signal.addEventListener("abort", function () {
|
|
202
|
-
xhr.abort();
|
|
203
|
-
var abortError = new Error("aborted");
|
|
204
|
-
abortError.name = "AbortError";
|
|
205
|
-
failure(abortError);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
xhr.onreadystatechange = function () {
|
|
209
|
-
// https://developer.mozilla.org/fr/docs/Web/API/XMLHttpRequest/readyState
|
|
210
|
-
var readyState = xhr.readyState;
|
|
211
|
-
|
|
212
|
-
if (readyState === 2) {
|
|
213
|
-
headersPromise.resolve();
|
|
214
|
-
} else if (readyState === 4) {
|
|
215
|
-
cleanup();
|
|
216
|
-
bodyPromise.resolve();
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
xhr.open(method, url, true);
|
|
221
|
-
Object.keys(headers).forEach(function (key) {
|
|
222
|
-
xhr.setRequestHeader(key, headers[key]);
|
|
223
|
-
});
|
|
224
|
-
xhr.withCredentials = computeWithCredentials({
|
|
225
|
-
credentials: credentials,
|
|
226
|
-
url: url
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
if ("responseType" in xhr && hasBlob) {
|
|
230
|
-
xhr.responseType = "blob";
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
xhr.send(body);
|
|
234
|
-
return _await$4(headersPromise, function () {
|
|
235
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseURL
|
|
236
|
-
var responseUrl = "responseURL" in xhr ? xhr.responseURL : headers["x-request-url"];
|
|
237
|
-
var responseStatus = xhr.status;
|
|
238
|
-
var responseStatusText = xhr.statusText;
|
|
239
|
-
var responseHeaders = getHeadersFromXHR(xhr);
|
|
240
|
-
|
|
241
|
-
var readBody = function readBody() {
|
|
242
|
-
return _await$4(bodyPromise, function () {
|
|
243
|
-
var status = xhr.status; // in Chrome on file:/// URLs, status is 0
|
|
244
|
-
|
|
245
|
-
if (status === 0) {
|
|
246
|
-
responseStatus = 200;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
var body = "response" in xhr ? xhr.response : xhr.responseText;
|
|
250
|
-
return {
|
|
251
|
-
responseBody: body,
|
|
252
|
-
responseBodyType: detectBodyType(body)
|
|
253
|
-
};
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
var text = function text() {
|
|
258
|
-
return _call$1(readBody, function (_ref2) {
|
|
259
|
-
var responseBody = _ref2.responseBody,
|
|
260
|
-
responseBodyType = _ref2.responseBodyType;
|
|
261
|
-
|
|
262
|
-
if (responseBodyType === "blob") {
|
|
263
|
-
return blobToText(responseBody);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (responseBodyType === "formData") {
|
|
267
|
-
throw new Error("could not read FormData body as text");
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return responseBodyType === "dataView" ? arrayBufferToText(responseBody.buffer) : responseBodyType === "arrayBuffer" ? arrayBufferToText(responseBody) : String(responseBody);
|
|
271
|
-
});
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
var json = function json() {
|
|
275
|
-
return _call$1(text, JSON.parse);
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
var blob = _async$4(function () {
|
|
279
|
-
if (!hasBlob) {
|
|
280
|
-
throw new Error("blob not supported");
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return _call$1(readBody, function (_ref3) {
|
|
284
|
-
var responseBody = _ref3.responseBody,
|
|
285
|
-
responseBodyType = _ref3.responseBodyType;
|
|
286
|
-
|
|
287
|
-
if (responseBodyType === "blob") {
|
|
288
|
-
return responseBody;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (responseBodyType === "dataView") {
|
|
292
|
-
return new Blob([cloneBuffer(responseBody.buffer)]);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
if (responseBodyType === "arrayBuffer") {
|
|
296
|
-
return new Blob([cloneBuffer(responseBody)]);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
if (responseBodyType === "formData") {
|
|
300
|
-
throw new Error("could not read FormData body as blob");
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return new Blob([String(responseBody)]);
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
var arrayBuffer = function arrayBuffer() {
|
|
308
|
-
return _call$1(readBody, function (_ref4) {
|
|
309
|
-
var responseBody = _ref4.responseBody,
|
|
310
|
-
responseBodyType = _ref4.responseBodyType;
|
|
311
|
-
return responseBodyType === "arrayBuffer" ? cloneBuffer(responseBody) : _call$1(blob, blobToArrayBuffer);
|
|
312
|
-
});
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
var formData = _async$4(function () {
|
|
316
|
-
if (!hasFormData) {
|
|
317
|
-
throw new Error("formData not supported");
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
return _call$1(text, textToFormData);
|
|
321
|
-
});
|
|
322
|
-
|
|
323
|
-
return {
|
|
324
|
-
url: responseUrl,
|
|
325
|
-
status: responseStatus,
|
|
326
|
-
statusText: responseStatusText,
|
|
327
|
-
headers: responseHeaders,
|
|
328
|
-
text: text,
|
|
329
|
-
json: json,
|
|
330
|
-
blob: blob,
|
|
331
|
-
arrayBuffer: arrayBuffer,
|
|
332
|
-
formData: formData
|
|
333
|
-
};
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
var canUseBlob = function canUseBlob() {
|
|
338
|
-
if (typeof window.FileReader !== "function") return false;
|
|
339
|
-
if (typeof window.Blob !== "function") return false;
|
|
340
|
-
|
|
341
|
-
try {
|
|
342
|
-
// eslint-disable-next-line no-new
|
|
343
|
-
new Blob();
|
|
344
|
-
return true;
|
|
345
|
-
} catch (e) {
|
|
346
|
-
return false;
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
var hasBlob = canUseBlob();
|
|
351
|
-
var hasFormData = typeof window.FormData === "function";
|
|
352
|
-
var hasArrayBuffer = typeof window.ArrayBuffer === "function";
|
|
353
|
-
var hasSearchParams = typeof window.URLSearchParams === "function";
|
|
354
|
-
|
|
355
|
-
var createRequestError = function createRequestError(error, _ref5) {
|
|
356
|
-
var url = _ref5.url;
|
|
357
|
-
return new Error("error during xhr request on ".concat(url, ".\n--- error stack ---\n").concat(error.stack));
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
var createPromiseAndHooks = function createPromiseAndHooks() {
|
|
361
|
-
var resolve;
|
|
362
|
-
var reject;
|
|
363
|
-
var promise = new Promise(function (res, rej) {
|
|
364
|
-
resolve = function resolve(value) {
|
|
365
|
-
promise.settled = true;
|
|
366
|
-
res(value);
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
reject = function reject(value) {
|
|
370
|
-
promise.settled = true;
|
|
371
|
-
rej(value);
|
|
372
|
-
};
|
|
373
|
-
});
|
|
374
|
-
promise.resolve = resolve;
|
|
375
|
-
promise.reject = reject;
|
|
376
|
-
return promise;
|
|
377
|
-
}; // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
var computeWithCredentials = function computeWithCredentials(_ref6) {
|
|
381
|
-
var credentials = _ref6.credentials,
|
|
382
|
-
url = _ref6.url;
|
|
383
|
-
|
|
384
|
-
if (credentials === "same-origin") {
|
|
385
|
-
return originSameAsGlobalOrigin(url);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
return credentials === "include";
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
var originSameAsGlobalOrigin = function originSameAsGlobalOrigin(url) {
|
|
392
|
-
// if we cannot read globalOrigin from window.location.origin, let's consider it's ok
|
|
393
|
-
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) !== "object") return true;
|
|
394
|
-
if (_typeof(window.location) !== "object") return true;
|
|
395
|
-
var globalOrigin = window.location.origin;
|
|
396
|
-
if (globalOrigin === "null") return true;
|
|
397
|
-
return hrefToOrigin(url) === globalOrigin;
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
var detectBodyType = function detectBodyType(body) {
|
|
401
|
-
if (!body) {
|
|
402
|
-
return "";
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
if (typeof body === "string") {
|
|
406
|
-
return "text";
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
if (hasBlob && Blob.prototype.isPrototypeOf(body)) {
|
|
410
|
-
return "blob";
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
if (hasFormData && FormData.prototype.isPrototypeOf(body)) {
|
|
414
|
-
return "formData";
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
if (hasArrayBuffer) {
|
|
418
|
-
if (hasBlob && isDataView(body)) {
|
|
419
|
-
return "dataView";
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
if (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body)) {
|
|
423
|
-
return "arrayBuffer";
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
if (hasSearchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
428
|
-
return "searchParams";
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
return "";
|
|
432
|
-
}; // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#Example
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
var getHeadersFromXHR = function getHeadersFromXHR(xhr) {
|
|
436
|
-
var headerMap = {};
|
|
437
|
-
var headersString = xhr.getAllResponseHeaders();
|
|
438
|
-
if (headersString === "") return headerMap;
|
|
439
|
-
var lines = headersString.trim().split(/[\r\n]+/);
|
|
440
|
-
lines.forEach(function (line) {
|
|
441
|
-
var parts = line.split(": ");
|
|
442
|
-
var name = parts.shift();
|
|
443
|
-
var value = parts.join(": ");
|
|
444
|
-
headerMap[name.toLowerCase()] = value;
|
|
445
|
-
});
|
|
446
|
-
return headerMap;
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
var hrefToOrigin = function hrefToOrigin(href) {
|
|
450
|
-
var scheme = hrefToScheme(href);
|
|
451
|
-
|
|
452
|
-
if (scheme === "file") {
|
|
453
|
-
return "file://";
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
if (scheme === "http" || scheme === "https") {
|
|
457
|
-
var secondProtocolSlashIndex = scheme.length + "://".length;
|
|
458
|
-
var pathnameSlashIndex = href.indexOf("/", secondProtocolSlashIndex);
|
|
459
|
-
if (pathnameSlashIndex === -1) return href;
|
|
460
|
-
return href.slice(0, pathnameSlashIndex);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
return href.slice(0, scheme.length + 1);
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
var hrefToScheme = function hrefToScheme(href) {
|
|
467
|
-
var colonIndex = href.indexOf(":");
|
|
468
|
-
if (colonIndex === -1) return "";
|
|
469
|
-
return href.slice(0, colonIndex);
|
|
470
|
-
};
|
|
471
|
-
|
|
472
|
-
var isDataView = function isDataView(obj) {
|
|
473
|
-
return obj && DataView.prototype.isPrototypeOf(obj);
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
var isArrayBufferView = ArrayBuffer.isView || function () {
|
|
477
|
-
var viewClasses = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"];
|
|
478
|
-
return function (value) {
|
|
479
|
-
return value && viewClasses.includes(Object.prototype.toString.call(value));
|
|
480
|
-
};
|
|
481
|
-
}();
|
|
482
|
-
|
|
483
|
-
var textToFormData = function textToFormData(text) {
|
|
484
|
-
var form = new FormData();
|
|
485
|
-
text.trim().split("&").forEach(function (bytes) {
|
|
486
|
-
if (bytes) {
|
|
487
|
-
var split = bytes.split("=");
|
|
488
|
-
var name = split.shift().replace(/\+/g, " ");
|
|
489
|
-
var value = split.join("=").replace(/\+/g, " ");
|
|
490
|
-
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
return form;
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
var blobToArrayBuffer = _async$4(function (blob) {
|
|
497
|
-
var reader = new FileReader();
|
|
498
|
-
var promise = fileReaderReady(reader);
|
|
499
|
-
reader.readAsArrayBuffer(blob);
|
|
500
|
-
return promise;
|
|
501
|
-
});
|
|
502
|
-
|
|
503
|
-
var blobToText = function blobToText(blob) {
|
|
504
|
-
var reader = new FileReader();
|
|
505
|
-
var promise = fileReaderReady(reader);
|
|
506
|
-
reader.readAsText(blob);
|
|
507
|
-
return promise;
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
var arrayBufferToText = function arrayBufferToText(arrayBuffer) {
|
|
511
|
-
var view = new Uint8Array(arrayBuffer);
|
|
512
|
-
var chars = new Array(view.length);
|
|
513
|
-
var i = 0;
|
|
514
|
-
|
|
515
|
-
while (i < view.length) {
|
|
516
|
-
chars[i] = String.fromCharCode(view[i]);
|
|
517
|
-
i++;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
return chars.join("");
|
|
521
|
-
};
|
|
522
|
-
|
|
523
|
-
var fileReaderReady = function fileReaderReady(reader) {
|
|
524
|
-
return new Promise(function (resolve, reject) {
|
|
525
|
-
reader.onload = function () {
|
|
526
|
-
resolve(reader.result);
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
reader.onerror = function () {
|
|
530
|
-
reject(reader.error);
|
|
531
|
-
};
|
|
532
|
-
});
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
var cloneBuffer = function cloneBuffer(buffer) {
|
|
536
|
-
if (buffer.slice) {
|
|
537
|
-
return buffer.slice(0);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
var view = new Uint8Array(buffer.byteLength);
|
|
541
|
-
view.set(new Uint8Array(buffer));
|
|
542
|
-
return view.buffer;
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
var _excluded = ["mode"];
|
|
546
|
-
|
|
547
|
-
function _await$3(value, then, direct) {
|
|
548
|
-
if (direct) {
|
|
549
|
-
return then ? then(value) : value;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
if (!value || !value.then) {
|
|
553
|
-
value = Promise.resolve(value);
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
return then ? value.then(then) : value;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
function _async$3(f) {
|
|
560
|
-
return function () {
|
|
561
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
562
|
-
args[i] = arguments[i];
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
try {
|
|
566
|
-
return Promise.resolve(f.apply(this, args));
|
|
567
|
-
} catch (e) {
|
|
568
|
-
return Promise.reject(e);
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
var fetchNative = _async$3(function (url) {
|
|
574
|
-
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
575
|
-
|
|
576
|
-
var _ref$mode = _ref.mode,
|
|
577
|
-
mode = _ref$mode === void 0 ? "cors" : _ref$mode,
|
|
578
|
-
options = _objectWithoutProperties(_ref, _excluded);
|
|
579
|
-
|
|
580
|
-
return _await$3(window.fetch(url, _objectSpread2({
|
|
581
|
-
mode: mode
|
|
582
|
-
}, options)), function (response) {
|
|
583
|
-
return {
|
|
584
|
-
url: response.url,
|
|
585
|
-
status: response.status,
|
|
586
|
-
statusText: "",
|
|
587
|
-
headers: responseToHeaders(response),
|
|
588
|
-
text: function text() {
|
|
589
|
-
return response.text();
|
|
590
|
-
},
|
|
591
|
-
json: function json() {
|
|
592
|
-
return response.json();
|
|
593
|
-
},
|
|
594
|
-
blob: function blob() {
|
|
595
|
-
return response.blob();
|
|
596
|
-
},
|
|
597
|
-
arrayBuffer: function arrayBuffer() {
|
|
598
|
-
return response.arrayBuffer();
|
|
599
|
-
},
|
|
600
|
-
formData: function formData() {
|
|
601
|
-
return response.formData();
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
});
|
|
605
|
-
});
|
|
606
|
-
|
|
607
|
-
var responseToHeaders = function responseToHeaders(response) {
|
|
608
|
-
var headers = {};
|
|
609
|
-
response.headers.forEach(function (value, name) {
|
|
610
|
-
headers[name] = value;
|
|
611
|
-
});
|
|
612
|
-
return headers;
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
var fetchUrl = typeof window.fetch === "function" && typeof window.AbortController === "function" ? fetchNative : fetchUsingXHR;
|
|
616
|
-
|
|
617
|
-
function _await$2(value, then, direct) {
|
|
618
|
-
if (direct) {
|
|
619
|
-
return then ? then(value) : value;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
if (!value || !value.then) {
|
|
623
|
-
value = Promise.resolve(value);
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
return then ? value.then(then) : value;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
function _async$2(f) {
|
|
630
|
-
return function () {
|
|
631
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
632
|
-
args[i] = arguments[i];
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
try {
|
|
636
|
-
return Promise.resolve(f.apply(this, args));
|
|
637
|
-
} catch (e) {
|
|
638
|
-
return Promise.reject(e);
|
|
639
|
-
}
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
var fetchJson = _async$2(function (url) {
|
|
644
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
645
|
-
return _await$2(fetchUrl(url, options), function (response) {
|
|
646
|
-
return _await$2(response.json());
|
|
647
|
-
});
|
|
648
|
-
});
|
|
649
|
-
|
|
650
|
-
function _await$1(value, then, direct) {
|
|
651
|
-
if (direct) {
|
|
652
|
-
return then ? then(value) : value;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
if (!value || !value.then) {
|
|
656
|
-
value = Promise.resolve(value);
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
return then ? value.then(then) : value;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
function _catch(body, recover) {
|
|
663
|
-
try {
|
|
664
|
-
var result = body();
|
|
665
|
-
} catch (e) {
|
|
666
|
-
return recover(e);
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
if (result && result.then) {
|
|
670
|
-
return result.then(void 0, recover);
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
return result;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
function _async$1(f) {
|
|
677
|
-
return function () {
|
|
678
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
679
|
-
args[i] = arguments[i];
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
try {
|
|
683
|
-
return Promise.resolve(f.apply(this, args));
|
|
684
|
-
} catch (e) {
|
|
685
|
-
return Promise.reject(e);
|
|
686
|
-
}
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
var fetchExploringJson = _async$1(function () {
|
|
691
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
692
|
-
signal = _ref.signal;
|
|
693
|
-
|
|
694
|
-
return _catch(function () {
|
|
695
|
-
return _await$1(fetchJson("/.jsenv/exploring.json", {
|
|
696
|
-
signal: signal
|
|
697
|
-
}));
|
|
698
|
-
}, function (e) {
|
|
699
|
-
if (signal && signal.aborted && e.name === "AbortError") {
|
|
700
|
-
throw e;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
throw new Error("Cannot communicate with exploring server due to a network error\n--- error stack ---\n".concat(e.stack));
|
|
704
|
-
});
|
|
705
|
-
});
|
|
706
|
-
|
|
707
|
-
var setStyles = function setStyles(element, styles) {
|
|
708
|
-
var elementStyle = element.style;
|
|
709
|
-
var restoreStyles = Object.keys(styles).map(function (styleName) {
|
|
710
|
-
var restore;
|
|
711
|
-
|
|
712
|
-
if (styleName in elementStyle) {
|
|
713
|
-
var currentStyle = elementStyle[styleName];
|
|
714
|
-
|
|
715
|
-
restore = function restore() {
|
|
716
|
-
elementStyle[styleName] = currentStyle;
|
|
717
|
-
};
|
|
718
|
-
} else {
|
|
719
|
-
restore = function restore() {
|
|
720
|
-
delete elementStyle[styleName];
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
elementStyle[styleName] = styles[styleName];
|
|
725
|
-
return restore;
|
|
726
|
-
});
|
|
727
|
-
return function () {
|
|
728
|
-
restoreStyles.forEach(function (restore) {
|
|
729
|
-
return restore();
|
|
730
|
-
});
|
|
731
|
-
};
|
|
732
|
-
};
|
|
733
|
-
var setAttributes = function setAttributes(element, attributes) {
|
|
734
|
-
Object.keys(attributes).forEach(function (name) {
|
|
735
|
-
element.setAttribute(name, attributes[name]);
|
|
736
|
-
});
|
|
737
|
-
};
|
|
738
|
-
|
|
739
|
-
function _await(value, then, direct) {
|
|
740
|
-
if (direct) {
|
|
741
|
-
return then ? then(value) : value;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
if (!value || !value.then) {
|
|
745
|
-
value = Promise.resolve(value);
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
return then ? value.then(then) : value;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
var TOOLBAR_BUILD_RELATIVE_URL = "dist/toolbar/toolbar_d6045dd0.html";
|
|
752
|
-
|
|
753
|
-
function _call(body, then, direct) {
|
|
754
|
-
if (direct) {
|
|
755
|
-
return then ? then(body()) : body();
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
try {
|
|
759
|
-
var result = Promise.resolve(body());
|
|
760
|
-
return then ? result.then(then) : result;
|
|
761
|
-
} catch (e) {
|
|
762
|
-
return Promise.reject(e);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
var jsenvLogoSvgUrl = new URL("assets/jsenv-logo_188b9ca6.svg", document.currentScript && document.currentScript.src || document.baseURI);
|
|
767
|
-
|
|
768
|
-
function _async(f) {
|
|
769
|
-
return function () {
|
|
770
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
771
|
-
args[i] = arguments[i];
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
try {
|
|
775
|
-
return Promise.resolve(f.apply(this, args));
|
|
776
|
-
} catch (e) {
|
|
777
|
-
return Promise.reject(e);
|
|
778
|
-
}
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
var injectToolbar = _async(function () {
|
|
783
|
-
return _await(new Promise(function (resolve) {
|
|
784
|
-
if (window.requestIdleCallback) {
|
|
785
|
-
window.requestIdleCallback(resolve, {
|
|
786
|
-
timeout: 400
|
|
787
|
-
});
|
|
788
|
-
} else {
|
|
789
|
-
window.requestAnimationFrame(resolve);
|
|
790
|
-
}
|
|
791
|
-
}), function () {
|
|
792
|
-
return _call(fetchExploringJson, function (exploringJSON) {
|
|
793
|
-
var placeholder = getToolbarPlaceholder();
|
|
794
|
-
var iframe = document.createElement("iframe");
|
|
795
|
-
setAttributes(iframe, {
|
|
796
|
-
tabindex: -1,
|
|
797
|
-
// sandbox: "allow-forms allow-modals allow-pointer-lock allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation",
|
|
798
|
-
// allow: "accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; microphone; midi; payment; vr",
|
|
799
|
-
allowtransparency: true
|
|
800
|
-
});
|
|
801
|
-
setStyles(iframe, {
|
|
802
|
-
"position": "fixed",
|
|
803
|
-
"zIndex": 1000,
|
|
804
|
-
"bottom": 0,
|
|
805
|
-
"left": 0,
|
|
806
|
-
"width": "100%",
|
|
807
|
-
"height": 0,
|
|
808
|
-
|
|
809
|
-
/* ensure toolbar children are not focusable when hidden */
|
|
810
|
-
"visibility": "hidden",
|
|
811
|
-
"transition-duration": "300ms",
|
|
812
|
-
"transition-property": "height, visibility",
|
|
813
|
-
"border": "none"
|
|
814
|
-
});
|
|
815
|
-
var iframeLoadedPromise = iframeToLoadedPromise(iframe);
|
|
816
|
-
var jsenvCoreDirectoryServerUrl = new URL(exploringJSON.jsenvCoreDirectoryRelativeUrl, document.location.origin).href;
|
|
817
|
-
var jsenvToolbarHtmlServerUrl = new URL(TOOLBAR_BUILD_RELATIVE_URL, jsenvCoreDirectoryServerUrl); // set iframe src BEFORE putting it into the DOM (prevent firefox adding an history entry)
|
|
818
|
-
|
|
819
|
-
iframe.setAttribute("src", jsenvToolbarHtmlServerUrl);
|
|
820
|
-
placeholder.parentNode.replaceChild(iframe, placeholder);
|
|
821
|
-
addToolbarEventCallback(iframe, "toolbar_ready", function () {
|
|
822
|
-
sendCommandToToolbar(iframe, "renderToolbar", {
|
|
823
|
-
exploringJSON: exploringJSON
|
|
824
|
-
});
|
|
825
|
-
});
|
|
826
|
-
return _await(iframeLoadedPromise, function () {
|
|
827
|
-
iframe.removeAttribute("tabindex");
|
|
828
|
-
var div = document.createElement("div");
|
|
829
|
-
div.innerHTML = "\n<div id=\"jsenv-toolbar-trigger\">\n <svg id=\"jsenv-toolbar-trigger-icon\">\n <use xlink:href=\"".concat(jsenvLogoSvgUrl, "#jsenv-logo\"></use>\n </svg>\n <style>\n #jsenv-toolbar-trigger {\n display: block;\n overflow: hidden;\n position: fixed;\n z-index: 1000;\n bottom: -32px;\n right: 20px;\n height: 40px;\n width: 40px;\n padding: 0;\n margin: 0;\n border-radius: 5px 5px 0 0;\n border: 1px solid rgba(0, 0, 0, 0.33);\n border-bottom: none;\n box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.46);\n background: transparent;\n text-align: center;\n transition: 600ms;\n }\n\n #jsenv-toolbar-trigger:hover {\n cursor: pointer;\n }\n\n #jsenv-toolbar-trigger[data-expanded] {\n bottom: 0;\n }\n\n #jsenv-toolbar-trigger-icon {\n width: 35px;\n height: 35px;\n opacity: 0;\n transition: 600ms;\n }\n\n #jsenv-toolbar-trigger[data-expanded] #jsenv-toolbar-trigger-icon {\n opacity: 1;\n }\n </style>\n</div>");
|
|
830
|
-
var toolbarTrigger = div.firstElementChild;
|
|
831
|
-
iframe.parentNode.appendChild(toolbarTrigger);
|
|
832
|
-
var timer;
|
|
833
|
-
|
|
834
|
-
toolbarTrigger.onmouseenter = function () {
|
|
835
|
-
toolbarTrigger.setAttribute("data-animate", "");
|
|
836
|
-
timer = setTimeout(expandToolbarTrigger, 500);
|
|
837
|
-
};
|
|
838
|
-
|
|
839
|
-
toolbarTrigger.onmouseleave = function () {
|
|
840
|
-
clearTimeout(timer);
|
|
841
|
-
collapseToolbarTrigger();
|
|
842
|
-
};
|
|
843
|
-
|
|
844
|
-
toolbarTrigger.onfocus = function () {
|
|
845
|
-
toolbarTrigger.removeAttribute("data-animate");
|
|
846
|
-
expandToolbarTrigger();
|
|
847
|
-
};
|
|
848
|
-
|
|
849
|
-
toolbarTrigger.onblur = function () {
|
|
850
|
-
toolbarTrigger.removeAttribute("data-animate");
|
|
851
|
-
clearTimeout(timer);
|
|
852
|
-
collapseToolbarTrigger();
|
|
853
|
-
};
|
|
854
|
-
|
|
855
|
-
toolbarTrigger.onclick = function () {
|
|
856
|
-
sendCommandToToolbar(iframe, "showToolbar");
|
|
857
|
-
};
|
|
858
|
-
|
|
859
|
-
var showToolbarTrigger = function showToolbarTrigger() {
|
|
860
|
-
toolbarTrigger.style.display = "block";
|
|
861
|
-
};
|
|
862
|
-
|
|
863
|
-
var hideToolbarTrigger = function hideToolbarTrigger() {
|
|
864
|
-
toolbarTrigger.style.display = "none";
|
|
865
|
-
};
|
|
866
|
-
|
|
867
|
-
var expandToolbarTrigger = function expandToolbarTrigger() {
|
|
868
|
-
toolbarTrigger.setAttribute("data-expanded", "");
|
|
869
|
-
};
|
|
870
|
-
|
|
871
|
-
var collapseToolbarTrigger = function collapseToolbarTrigger() {
|
|
872
|
-
toolbarTrigger.removeAttribute("data-expanded", "");
|
|
873
|
-
};
|
|
874
|
-
|
|
875
|
-
hideToolbarTrigger();
|
|
876
|
-
addToolbarEventCallback(iframe, "toolbar-visibility-change", function (visible) {
|
|
877
|
-
if (visible) {
|
|
878
|
-
hideToolbarTrigger();
|
|
879
|
-
} else {
|
|
880
|
-
showToolbarTrigger();
|
|
881
|
-
}
|
|
882
|
-
});
|
|
883
|
-
return iframe;
|
|
884
|
-
});
|
|
885
|
-
});
|
|
886
|
-
});
|
|
887
|
-
});
|
|
888
|
-
|
|
889
|
-
var addToolbarEventCallback = function addToolbarEventCallback(iframe, eventName, callback) {
|
|
890
|
-
var messageEventCallback = function messageEventCallback(messageEvent) {
|
|
891
|
-
var data = messageEvent.data;
|
|
892
|
-
|
|
893
|
-
if (_typeof(data) !== "object") {
|
|
894
|
-
return;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
var __jsenv__ = data.__jsenv__;
|
|
898
|
-
|
|
899
|
-
if (!__jsenv__) {
|
|
900
|
-
return;
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
if (__jsenv__.event !== eventName) {
|
|
904
|
-
return;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
callback(__jsenv__.data);
|
|
908
|
-
};
|
|
909
|
-
|
|
910
|
-
window.addEventListener("message", messageEventCallback, false);
|
|
911
|
-
return function () {
|
|
912
|
-
window.removeEventListener("message", messageEventCallback, false);
|
|
913
|
-
};
|
|
914
|
-
};
|
|
915
|
-
|
|
916
|
-
var sendCommandToToolbar = function sendCommandToToolbar(iframe, command) {
|
|
917
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
918
|
-
args[_key - 2] = arguments[_key];
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
iframe.contentWindow.postMessage({
|
|
922
|
-
__jsenv__: {
|
|
923
|
-
command: command,
|
|
924
|
-
args: args
|
|
925
|
-
}
|
|
926
|
-
}, window.origin);
|
|
927
|
-
};
|
|
928
|
-
|
|
929
|
-
var getToolbarPlaceholder = function getToolbarPlaceholder() {
|
|
930
|
-
var placeholder = queryPlaceholder();
|
|
931
|
-
|
|
932
|
-
if (placeholder) {
|
|
933
|
-
if (document.body.contains(placeholder)) {
|
|
934
|
-
return placeholder;
|
|
935
|
-
} // otherwise iframe would not be visible because in <head>
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
console.warn("element with [data-jsenv-toolbar-placeholder] must be inside document.body");
|
|
939
|
-
return createTooolbarPlaceholder();
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
return createTooolbarPlaceholder();
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
var queryPlaceholder = function queryPlaceholder() {
|
|
946
|
-
return document.querySelector("[data-jsenv-toolbar-placeholder]");
|
|
947
|
-
};
|
|
948
|
-
|
|
949
|
-
var createTooolbarPlaceholder = function createTooolbarPlaceholder() {
|
|
950
|
-
var placeholder = document.createElement("span");
|
|
951
|
-
document.body.appendChild(placeholder);
|
|
952
|
-
return placeholder;
|
|
953
|
-
};
|
|
954
|
-
|
|
955
|
-
var iframeToLoadedPromise = function iframeToLoadedPromise(iframe) {
|
|
956
|
-
return new Promise(function (resolve) {
|
|
957
|
-
var onload = function onload() {
|
|
958
|
-
iframe.removeEventListener("load", onload, true);
|
|
959
|
-
resolve();
|
|
960
|
-
};
|
|
961
|
-
|
|
962
|
-
iframe.addEventListener("load", onload, true);
|
|
963
|
-
});
|
|
964
|
-
};
|
|
965
|
-
|
|
966
|
-
if (document.readyState === "complete") {
|
|
967
|
-
injectToolbar();
|
|
968
|
-
} else {
|
|
969
|
-
window.addEventListener("load", injectToolbar); // document.addEventListener("readystatechange", () => {
|
|
970
|
-
// if (document.readyState === "complete") {
|
|
971
|
-
// injectToolbar()
|
|
972
|
-
// }
|
|
973
|
-
// })
|
|
974
|
-
}
|
|
975
|
-
})();
|
|
976
|
-
|
|
977
|
-
//# sourceMappingURL=toolbar_injector_c8c214dd.js.map
|