@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,864 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* SJS 6.11.0
|
|
3
|
-
* Minimal SystemJS Build
|
|
4
|
-
*/
|
|
5
|
-
(function () {
|
|
6
|
-
|
|
7
|
-
function errMsg(errCode, msg) {
|
|
8
|
-
return (msg || "") + " (SystemJS https://git.io/JvFET#" + errCode + ")";
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
var hasSymbol = typeof Symbol !== 'undefined';
|
|
12
|
-
var hasSelf = typeof self !== 'undefined';
|
|
13
|
-
var hasDocument = typeof document !== 'undefined';
|
|
14
|
-
|
|
15
|
-
var envGlobal = hasSelf ? self : global;
|
|
16
|
-
|
|
17
|
-
var baseUrl;
|
|
18
|
-
|
|
19
|
-
if (hasDocument) {
|
|
20
|
-
var baseEl = document.querySelector('base[href]');
|
|
21
|
-
if (baseEl)
|
|
22
|
-
baseUrl = baseEl.href;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (!baseUrl && typeof location !== 'undefined') {
|
|
26
|
-
baseUrl = location.href.split('#')[0].split('?')[0];
|
|
27
|
-
var lastSepIndex = baseUrl.lastIndexOf('/');
|
|
28
|
-
if (lastSepIndex !== -1)
|
|
29
|
-
baseUrl = baseUrl.slice(0, lastSepIndex + 1);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var backslashRegEx = /\\/g;
|
|
33
|
-
function resolveIfNotPlainOrUrl (relUrl, parentUrl) {
|
|
34
|
-
if (relUrl.indexOf('\\') !== -1)
|
|
35
|
-
relUrl = relUrl.replace(backslashRegEx, '/');
|
|
36
|
-
// protocol-relative
|
|
37
|
-
if (relUrl[0] === '/' && relUrl[1] === '/') {
|
|
38
|
-
return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl;
|
|
39
|
-
}
|
|
40
|
-
// relative-url
|
|
41
|
-
else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
|
|
42
|
-
relUrl.length === 1 && (relUrl += '/')) ||
|
|
43
|
-
relUrl[0] === '/') {
|
|
44
|
-
var parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
|
|
45
|
-
// Disabled, but these cases will give inconsistent results for deep backtracking
|
|
46
|
-
//if (parentUrl[parentProtocol.length] !== '/')
|
|
47
|
-
// throw Error('Cannot resolve');
|
|
48
|
-
// read pathname from parent URL
|
|
49
|
-
// pathname taken to be part after leading "/"
|
|
50
|
-
var pathname;
|
|
51
|
-
if (parentUrl[parentProtocol.length + 1] === '/') {
|
|
52
|
-
// resolving to a :// so we need to read out the auth and host
|
|
53
|
-
if (parentProtocol !== 'file:') {
|
|
54
|
-
pathname = parentUrl.slice(parentProtocol.length + 2);
|
|
55
|
-
pathname = pathname.slice(pathname.indexOf('/') + 1);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
pathname = parentUrl.slice(8);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
// resolving to :/ so pathname is the /... part
|
|
63
|
-
pathname = parentUrl.slice(parentProtocol.length + (parentUrl[parentProtocol.length] === '/'));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (relUrl[0] === '/')
|
|
67
|
-
return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl;
|
|
68
|
-
|
|
69
|
-
// join together and split for removal of .. and . segments
|
|
70
|
-
// looping the string instead of anything fancy for perf reasons
|
|
71
|
-
// '../../../../../z' resolved to 'x/y' is just 'z'
|
|
72
|
-
var segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl;
|
|
73
|
-
|
|
74
|
-
var output = [];
|
|
75
|
-
var segmentIndex = -1;
|
|
76
|
-
for (var i = 0; i < segmented.length; i++) {
|
|
77
|
-
// busy reading a segment - only terminate on '/'
|
|
78
|
-
if (segmentIndex !== -1) {
|
|
79
|
-
if (segmented[i] === '/') {
|
|
80
|
-
output.push(segmented.slice(segmentIndex, i + 1));
|
|
81
|
-
segmentIndex = -1;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// new segment - check if it is relative
|
|
86
|
-
else if (segmented[i] === '.') {
|
|
87
|
-
// ../ segment
|
|
88
|
-
if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
|
|
89
|
-
output.pop();
|
|
90
|
-
i += 2;
|
|
91
|
-
}
|
|
92
|
-
// ./ segment
|
|
93
|
-
else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
|
|
94
|
-
i += 1;
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
// the start of a new segment as below
|
|
98
|
-
segmentIndex = i;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
// it is the start of a new segment
|
|
102
|
-
else {
|
|
103
|
-
segmentIndex = i;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// finish reading out the last segment
|
|
107
|
-
if (segmentIndex !== -1)
|
|
108
|
-
output.push(segmented.slice(segmentIndex));
|
|
109
|
-
return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join('');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/*
|
|
114
|
-
* Import maps implementation
|
|
115
|
-
*
|
|
116
|
-
* To make lookups fast we pre-resolve the entire import map
|
|
117
|
-
* and then match based on backtracked hash lookups
|
|
118
|
-
*
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
function resolveUrl (relUrl, parentUrl) {
|
|
122
|
-
return resolveIfNotPlainOrUrl(relUrl, parentUrl) || (relUrl.indexOf(':') !== -1 ? relUrl : resolveIfNotPlainOrUrl('./' + relUrl, parentUrl));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function resolveAndComposePackages (packages, outPackages, baseUrl, parentMap, parentUrl) {
|
|
126
|
-
for (var p in packages) {
|
|
127
|
-
var resolvedLhs = resolveIfNotPlainOrUrl(p, baseUrl) || p;
|
|
128
|
-
var rhs = packages[p];
|
|
129
|
-
// package fallbacks not currently supported
|
|
130
|
-
if (typeof rhs !== 'string')
|
|
131
|
-
continue;
|
|
132
|
-
var mapped = resolveImportMap(parentMap, resolveIfNotPlainOrUrl(rhs, baseUrl) || rhs, parentUrl);
|
|
133
|
-
if (!mapped) {
|
|
134
|
-
targetWarning('W1', p, rhs);
|
|
135
|
-
}
|
|
136
|
-
else
|
|
137
|
-
outPackages[resolvedLhs] = mapped;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function resolveAndComposeImportMap (json, baseUrl, outMap) {
|
|
142
|
-
if (json.imports)
|
|
143
|
-
resolveAndComposePackages(json.imports, outMap.imports, baseUrl, outMap, null);
|
|
144
|
-
|
|
145
|
-
var u;
|
|
146
|
-
for (u in json.scopes || {}) {
|
|
147
|
-
var resolvedScope = resolveUrl(u, baseUrl);
|
|
148
|
-
resolveAndComposePackages(json.scopes[u], outMap.scopes[resolvedScope] || (outMap.scopes[resolvedScope] = {}), baseUrl, outMap, resolvedScope);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
for (u in json.depcache || {})
|
|
152
|
-
outMap.depcache[resolveUrl(u, baseUrl)] = json.depcache[u];
|
|
153
|
-
|
|
154
|
-
for (u in json.integrity || {})
|
|
155
|
-
outMap.integrity[resolveUrl(u, baseUrl)] = json.integrity[u];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function getMatch (path, matchObj) {
|
|
159
|
-
if (matchObj[path])
|
|
160
|
-
return path;
|
|
161
|
-
var sepIndex = path.length;
|
|
162
|
-
do {
|
|
163
|
-
var segment = path.slice(0, sepIndex + 1);
|
|
164
|
-
if (segment in matchObj)
|
|
165
|
-
return segment;
|
|
166
|
-
} while ((sepIndex = path.lastIndexOf('/', sepIndex - 1)) !== -1)
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function applyPackages (id, packages) {
|
|
170
|
-
var pkgName = getMatch(id, packages);
|
|
171
|
-
if (pkgName) {
|
|
172
|
-
var pkg = packages[pkgName];
|
|
173
|
-
if (pkg === null) return;
|
|
174
|
-
if (id.length > pkgName.length && pkg[pkg.length - 1] !== '/') {
|
|
175
|
-
targetWarning('W2', pkgName, pkg);
|
|
176
|
-
}
|
|
177
|
-
else
|
|
178
|
-
return pkg + id.slice(pkgName.length);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function targetWarning (code, match, target, msg) {
|
|
183
|
-
console.warn(errMsg(code, [target, match].join(', ') ));
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function resolveImportMap (importMap, resolvedOrPlain, parentUrl) {
|
|
187
|
-
var scopes = importMap.scopes;
|
|
188
|
-
var scopeUrl = parentUrl && getMatch(parentUrl, scopes);
|
|
189
|
-
while (scopeUrl) {
|
|
190
|
-
var packageResolution = applyPackages(resolvedOrPlain, scopes[scopeUrl]);
|
|
191
|
-
if (packageResolution)
|
|
192
|
-
return packageResolution;
|
|
193
|
-
scopeUrl = getMatch(scopeUrl.slice(0, scopeUrl.lastIndexOf('/')), scopes);
|
|
194
|
-
}
|
|
195
|
-
return applyPackages(resolvedOrPlain, importMap.imports) || resolvedOrPlain.indexOf(':') !== -1 && resolvedOrPlain;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/*
|
|
199
|
-
* SystemJS Core
|
|
200
|
-
*
|
|
201
|
-
* Provides
|
|
202
|
-
* - System.import
|
|
203
|
-
* - System.register support for
|
|
204
|
-
* live bindings, function hoisting through circular references,
|
|
205
|
-
* reexports, dynamic import, import.meta.url, top-level await
|
|
206
|
-
* - System.getRegister to get the registration
|
|
207
|
-
* - Symbol.toStringTag support in Module objects
|
|
208
|
-
* - Hookable System.createContext to customize import.meta
|
|
209
|
-
* - System.onload(err, id, deps) handler for tracing / hot-reloading
|
|
210
|
-
*
|
|
211
|
-
* Core comes with no System.prototype.resolve or
|
|
212
|
-
* System.prototype.instantiate implementations
|
|
213
|
-
*/
|
|
214
|
-
|
|
215
|
-
var toStringTag = hasSymbol && Symbol.toStringTag;
|
|
216
|
-
var REGISTRY = hasSymbol ? Symbol() : '@';
|
|
217
|
-
|
|
218
|
-
function SystemJS () {
|
|
219
|
-
this[REGISTRY] = {};
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
var systemJSPrototype = SystemJS.prototype;
|
|
223
|
-
|
|
224
|
-
systemJSPrototype.import = function (id, parentUrl) {
|
|
225
|
-
var loader = this;
|
|
226
|
-
return Promise.resolve(loader.prepareImport())
|
|
227
|
-
.then(function() {
|
|
228
|
-
return loader.resolve(String(id), parentUrl);
|
|
229
|
-
})
|
|
230
|
-
.then(function (id) {
|
|
231
|
-
var load = getOrCreateLoad(loader, id);
|
|
232
|
-
return load.C || topLevelLoad(loader, load);
|
|
233
|
-
});
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
// Hookable createContext function -> allowing eg custom import meta
|
|
237
|
-
systemJSPrototype.createContext = function (parentId) {
|
|
238
|
-
var loader = this;
|
|
239
|
-
return {
|
|
240
|
-
url: parentId,
|
|
241
|
-
resolve: function (id, parentUrl) {
|
|
242
|
-
return Promise.resolve(loader.resolve(id, parentUrl || parentId));
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
};
|
|
246
|
-
function loadToId (load) {
|
|
247
|
-
return load.id;
|
|
248
|
-
}
|
|
249
|
-
function triggerOnload (loader, load, err, isErrSource) {
|
|
250
|
-
loader.onload(err, load.id, load.d && load.d.map(loadToId), !!isErrSource);
|
|
251
|
-
if (err)
|
|
252
|
-
throw err;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
var lastRegister;
|
|
256
|
-
systemJSPrototype.register = function (deps, declare) {
|
|
257
|
-
lastRegister = [deps, declare];
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
/*
|
|
261
|
-
* getRegister provides the last anonymous System.register call
|
|
262
|
-
*/
|
|
263
|
-
systemJSPrototype.getRegister = function () {
|
|
264
|
-
var _lastRegister = lastRegister;
|
|
265
|
-
lastRegister = undefined;
|
|
266
|
-
return _lastRegister;
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
function getOrCreateLoad (loader, id, firstParentUrl) {
|
|
270
|
-
var load = loader[REGISTRY][id];
|
|
271
|
-
if (load)
|
|
272
|
-
return load;
|
|
273
|
-
|
|
274
|
-
var importerSetters = [];
|
|
275
|
-
var ns = Object.create(null);
|
|
276
|
-
if (toStringTag)
|
|
277
|
-
Object.defineProperty(ns, toStringTag, { value: 'Module' });
|
|
278
|
-
|
|
279
|
-
var instantiatePromise = Promise.resolve()
|
|
280
|
-
.then(function () {
|
|
281
|
-
return loader.instantiate(id, firstParentUrl);
|
|
282
|
-
})
|
|
283
|
-
.then(function (registration) {
|
|
284
|
-
if (!registration)
|
|
285
|
-
throw Error(errMsg(2, id ));
|
|
286
|
-
function _export (name, value) {
|
|
287
|
-
// note if we have hoisted exports (including reexports)
|
|
288
|
-
load.h = true;
|
|
289
|
-
var changed = false;
|
|
290
|
-
if (typeof name === 'string') {
|
|
291
|
-
if (!(name in ns) || ns[name] !== value) {
|
|
292
|
-
ns[name] = value;
|
|
293
|
-
changed = true;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
for (var p in name) {
|
|
298
|
-
var value = name[p];
|
|
299
|
-
if (!(p in ns) || ns[p] !== value) {
|
|
300
|
-
ns[p] = value;
|
|
301
|
-
changed = true;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
if (name && name.__esModule) {
|
|
306
|
-
ns.__esModule = name.__esModule;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
if (changed)
|
|
310
|
-
for (var i = 0; i < importerSetters.length; i++) {
|
|
311
|
-
var setter = importerSetters[i];
|
|
312
|
-
if (setter) setter(ns);
|
|
313
|
-
}
|
|
314
|
-
return value;
|
|
315
|
-
}
|
|
316
|
-
var declared = registration[1](_export, registration[1].length === 2 ? {
|
|
317
|
-
import: function (importId) {
|
|
318
|
-
return loader.import(importId, id);
|
|
319
|
-
},
|
|
320
|
-
meta: loader.createContext(id)
|
|
321
|
-
} : undefined);
|
|
322
|
-
load.e = declared.execute || function () {};
|
|
323
|
-
return [registration[0], declared.setters || []];
|
|
324
|
-
}, function (err) {
|
|
325
|
-
load.e = null;
|
|
326
|
-
load.er = err;
|
|
327
|
-
throw err;
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
var linkPromise = instantiatePromise
|
|
331
|
-
.then(function (instantiation) {
|
|
332
|
-
return Promise.all(instantiation[0].map(function (dep, i) {
|
|
333
|
-
var setter = instantiation[1][i];
|
|
334
|
-
return Promise.resolve(loader.resolve(dep, id))
|
|
335
|
-
.then(function (depId) {
|
|
336
|
-
var depLoad = getOrCreateLoad(loader, depId, id);
|
|
337
|
-
// depLoad.I may be undefined for already-evaluated
|
|
338
|
-
return Promise.resolve(depLoad.I)
|
|
339
|
-
.then(function () {
|
|
340
|
-
if (setter) {
|
|
341
|
-
depLoad.i.push(setter);
|
|
342
|
-
// only run early setters when there are hoisted exports of that module
|
|
343
|
-
// the timing works here as pending hoisted export calls will trigger through importerSetters
|
|
344
|
-
if (depLoad.h || !depLoad.I)
|
|
345
|
-
setter(depLoad.n);
|
|
346
|
-
}
|
|
347
|
-
return depLoad;
|
|
348
|
-
});
|
|
349
|
-
});
|
|
350
|
-
}))
|
|
351
|
-
.then(function (depLoads) {
|
|
352
|
-
load.d = depLoads;
|
|
353
|
-
});
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
// Capital letter = a promise function
|
|
357
|
-
return load = loader[REGISTRY][id] = {
|
|
358
|
-
id: id,
|
|
359
|
-
// importerSetters, the setters functions registered to this dependency
|
|
360
|
-
// we retain this to add more later
|
|
361
|
-
i: importerSetters,
|
|
362
|
-
// module namespace object
|
|
363
|
-
n: ns,
|
|
364
|
-
|
|
365
|
-
// instantiate
|
|
366
|
-
I: instantiatePromise,
|
|
367
|
-
// link
|
|
368
|
-
L: linkPromise,
|
|
369
|
-
// whether it has hoisted exports
|
|
370
|
-
h: false,
|
|
371
|
-
|
|
372
|
-
// On instantiate completion we have populated:
|
|
373
|
-
// dependency load records
|
|
374
|
-
d: undefined,
|
|
375
|
-
// execution function
|
|
376
|
-
e: undefined,
|
|
377
|
-
|
|
378
|
-
// On execution we have populated:
|
|
379
|
-
// the execution error if any
|
|
380
|
-
er: undefined,
|
|
381
|
-
// in the case of TLA, the execution promise
|
|
382
|
-
E: undefined,
|
|
383
|
-
|
|
384
|
-
// On execution, L, I, E cleared
|
|
385
|
-
|
|
386
|
-
// Promise for top-level completion
|
|
387
|
-
C: undefined,
|
|
388
|
-
|
|
389
|
-
// parent instantiator / executor
|
|
390
|
-
p: undefined
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
function instantiateAll (loader, load, parent, loaded) {
|
|
395
|
-
if (!loaded[load.id]) {
|
|
396
|
-
loaded[load.id] = true;
|
|
397
|
-
// load.L may be undefined for already-instantiated
|
|
398
|
-
return Promise.resolve(load.L)
|
|
399
|
-
.then(function () {
|
|
400
|
-
if (!load.p || load.p.e === null)
|
|
401
|
-
load.p = parent;
|
|
402
|
-
return Promise.all(load.d.map(function (dep) {
|
|
403
|
-
return instantiateAll(loader, dep, parent, loaded);
|
|
404
|
-
}));
|
|
405
|
-
})
|
|
406
|
-
.catch(function (err) {
|
|
407
|
-
if (load.er)
|
|
408
|
-
throw err;
|
|
409
|
-
load.e = null;
|
|
410
|
-
throw err;
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
function topLevelLoad (loader, load) {
|
|
416
|
-
return load.C = instantiateAll(loader, load, load, {})
|
|
417
|
-
.then(function () {
|
|
418
|
-
return postOrderExec(loader, load, {});
|
|
419
|
-
})
|
|
420
|
-
.then(function () {
|
|
421
|
-
return load.n;
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
// the closest we can get to call(undefined)
|
|
426
|
-
var nullContext = Object.freeze(Object.create(null));
|
|
427
|
-
|
|
428
|
-
// returns a promise if and only if a top-level await subgraph
|
|
429
|
-
// throws on sync errors
|
|
430
|
-
function postOrderExec (loader, load, seen) {
|
|
431
|
-
if (seen[load.id])
|
|
432
|
-
return;
|
|
433
|
-
seen[load.id] = true;
|
|
434
|
-
|
|
435
|
-
if (!load.e) {
|
|
436
|
-
if (load.er)
|
|
437
|
-
throw load.er;
|
|
438
|
-
if (load.E)
|
|
439
|
-
return load.E;
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
// deps execute first, unless circular
|
|
444
|
-
var depLoadPromises;
|
|
445
|
-
load.d.forEach(function (depLoad) {
|
|
446
|
-
try {
|
|
447
|
-
var depLoadPromise = postOrderExec(loader, depLoad, seen);
|
|
448
|
-
if (depLoadPromise)
|
|
449
|
-
(depLoadPromises = depLoadPromises || []).push(depLoadPromise);
|
|
450
|
-
}
|
|
451
|
-
catch (err) {
|
|
452
|
-
load.e = null;
|
|
453
|
-
load.er = err;
|
|
454
|
-
throw err;
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
if (depLoadPromises)
|
|
458
|
-
return Promise.all(depLoadPromises).then(doExec);
|
|
459
|
-
|
|
460
|
-
return doExec();
|
|
461
|
-
|
|
462
|
-
function doExec () {
|
|
463
|
-
try {
|
|
464
|
-
var execPromise = load.e.call(nullContext);
|
|
465
|
-
if (execPromise) {
|
|
466
|
-
execPromise = execPromise.then(function () {
|
|
467
|
-
load.C = load.n;
|
|
468
|
-
load.E = null; // indicates completion
|
|
469
|
-
if (!true) ;
|
|
470
|
-
}, function (err) {
|
|
471
|
-
load.er = err;
|
|
472
|
-
load.E = null;
|
|
473
|
-
if (!true) ;
|
|
474
|
-
throw err;
|
|
475
|
-
});
|
|
476
|
-
return load.E = execPromise;
|
|
477
|
-
}
|
|
478
|
-
// (should be a promise, but a minify optimization to leave out Promise.resolve)
|
|
479
|
-
load.C = load.n;
|
|
480
|
-
load.L = load.I = undefined;
|
|
481
|
-
}
|
|
482
|
-
catch (err) {
|
|
483
|
-
load.er = err;
|
|
484
|
-
throw err;
|
|
485
|
-
}
|
|
486
|
-
finally {
|
|
487
|
-
load.e = null;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
envGlobal.System = new SystemJS();
|
|
493
|
-
|
|
494
|
-
/*
|
|
495
|
-
* SystemJS browser attachments for script and import map processing
|
|
496
|
-
*/
|
|
497
|
-
|
|
498
|
-
var importMapPromise = Promise.resolve();
|
|
499
|
-
var importMap = { imports: {}, scopes: {}, depcache: {}, integrity: {} };
|
|
500
|
-
systemJSPrototype.importMap = importMap;
|
|
501
|
-
systemJSPrototype.baseUrl = baseUrl;
|
|
502
|
-
|
|
503
|
-
// Scripts are processed immediately, on the first System.import, and on DOMReady.
|
|
504
|
-
// Import map scripts are processed only once (by being marked) and in order for each phase.
|
|
505
|
-
// This is to avoid using DOM mutation observers in core, although that would be an alternative.
|
|
506
|
-
var processFirst = hasDocument;
|
|
507
|
-
systemJSPrototype.prepareImport = function (doProcessScripts) {
|
|
508
|
-
if (processFirst || doProcessScripts) {
|
|
509
|
-
processScripts();
|
|
510
|
-
processFirst = false;
|
|
511
|
-
}
|
|
512
|
-
return importMapPromise;
|
|
513
|
-
};
|
|
514
|
-
if (hasDocument) {
|
|
515
|
-
processScripts();
|
|
516
|
-
window.addEventListener('DOMContentLoaded', processScripts);
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
function processScripts () {
|
|
520
|
-
[].forEach.call(document.querySelectorAll('script'), function (script) {
|
|
521
|
-
if (script.sp) // sp marker = systemjs processed
|
|
522
|
-
return;
|
|
523
|
-
// TODO: deprecate systemjs-module in next major now that we have auto import
|
|
524
|
-
if (script.type === 'systemjs-module') {
|
|
525
|
-
script.sp = true;
|
|
526
|
-
if (!script.src)
|
|
527
|
-
return;
|
|
528
|
-
System.import(script.src.slice(0, 7) === 'import:' ? script.src.slice(7) : resolveUrl(script.src, baseUrl)).catch(function (e) {
|
|
529
|
-
// if there is a script load error, dispatch an "error" event
|
|
530
|
-
// on the script tag.
|
|
531
|
-
if (e.message.indexOf('https://git.io/JvFET#3') > -1) {
|
|
532
|
-
var event = document.createEvent('Event');
|
|
533
|
-
event.initEvent('error', false, false);
|
|
534
|
-
script.dispatchEvent(event);
|
|
535
|
-
}
|
|
536
|
-
return Promise.reject(e);
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
else if (script.type === 'systemjs-importmap') {
|
|
540
|
-
script.sp = true;
|
|
541
|
-
var fetchPromise = script.src ? fetch(script.src, { integrity: script.integrity }).then(function (res) {
|
|
542
|
-
if (!res.ok)
|
|
543
|
-
throw Error( res.status );
|
|
544
|
-
return res.text();
|
|
545
|
-
}).catch(function (err) {
|
|
546
|
-
err.message = errMsg('W4', script.src ) + '\n' + err.message;
|
|
547
|
-
console.warn(err);
|
|
548
|
-
if (typeof script.onerror === 'function') {
|
|
549
|
-
script.onerror();
|
|
550
|
-
}
|
|
551
|
-
return '{}';
|
|
552
|
-
}) : script.innerHTML;
|
|
553
|
-
importMapPromise = importMapPromise.then(function () {
|
|
554
|
-
return fetchPromise;
|
|
555
|
-
}).then(function (text) {
|
|
556
|
-
extendImportMap(importMap, text, script.src || baseUrl);
|
|
557
|
-
return importMap
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
function extendImportMap (importMap, newMapText, newMapUrl) {
|
|
564
|
-
var newMap = {};
|
|
565
|
-
try {
|
|
566
|
-
newMap = JSON.parse(newMapText);
|
|
567
|
-
} catch (err) {
|
|
568
|
-
console.warn(Error(( errMsg('W5') )));
|
|
569
|
-
}
|
|
570
|
-
resolveAndComposeImportMap(newMap, newMapUrl, importMap);
|
|
571
|
-
}
|
|
572
|
-
System.extendImportMap = extendImportMap
|
|
573
|
-
|
|
574
|
-
/*
|
|
575
|
-
* Script instantiation loading
|
|
576
|
-
*/
|
|
577
|
-
|
|
578
|
-
if (hasDocument) {
|
|
579
|
-
window.addEventListener('error', function (evt) {
|
|
580
|
-
lastWindowErrorUrl = evt.filename;
|
|
581
|
-
lastWindowError = evt.error;
|
|
582
|
-
});
|
|
583
|
-
var baseOrigin = location.origin;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
systemJSPrototype.createScript = function (url) {
|
|
587
|
-
var script = document.createElement('script');
|
|
588
|
-
script.async = true;
|
|
589
|
-
// Only add cross origin for actual cross origin
|
|
590
|
-
// this is because Safari triggers for all
|
|
591
|
-
// - https://bugs.webkit.org/show_bug.cgi?id=171566
|
|
592
|
-
if (url.indexOf(baseOrigin + '/'))
|
|
593
|
-
script.crossOrigin = 'anonymous';
|
|
594
|
-
var integrity = importMap.integrity[url];
|
|
595
|
-
if (integrity)
|
|
596
|
-
script.integrity = integrity;
|
|
597
|
-
script.src = url;
|
|
598
|
-
return script;
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
// Auto imports -> script tags can be inlined directly for load phase
|
|
602
|
-
var lastAutoImportDeps, lastAutoImportTimeout;
|
|
603
|
-
var autoImportCandidates = {};
|
|
604
|
-
var systemRegister = systemJSPrototype.register;
|
|
605
|
-
var inlineScriptCount = 0;
|
|
606
|
-
systemJSPrototype.register = function (deps, declare, autoUrl) {
|
|
607
|
-
if (hasDocument && document.readyState === 'loading' && typeof deps !== 'string') {
|
|
608
|
-
var scripts = document.querySelectorAll('script[src]');
|
|
609
|
-
var lastScript = scripts[scripts.length - 1];
|
|
610
|
-
var lastAutoImportUrl
|
|
611
|
-
lastAutoImportDeps = deps;
|
|
612
|
-
if (lastScript && lastScript.src) {
|
|
613
|
-
lastAutoImportUrl = lastScript.src;
|
|
614
|
-
}
|
|
615
|
-
else if (autoUrl) {
|
|
616
|
-
lastAutoImportUrl = autoUrl
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
inlineScriptCount++
|
|
620
|
-
lastAutoImportUrl = document.location.href + "__inline_script__" + inlineScriptCount;
|
|
621
|
-
}
|
|
622
|
-
// if this is already a System load, then the instantiate has already begun
|
|
623
|
-
// so this re-import has no consequence
|
|
624
|
-
var loader = this;
|
|
625
|
-
lastAutoImportTimeout = setTimeout(function () {
|
|
626
|
-
autoImportCandidates[lastAutoImportUrl] = [deps, declare];
|
|
627
|
-
loader.import(lastAutoImportUrl);
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
else {
|
|
631
|
-
lastAutoImportDeps = undefined;
|
|
632
|
-
}
|
|
633
|
-
return systemRegister.call(this, deps, declare);
|
|
634
|
-
};
|
|
635
|
-
|
|
636
|
-
var lastWindowErrorUrl, lastWindowError;
|
|
637
|
-
systemJSPrototype.instantiate = function (url, firstParentUrl) {
|
|
638
|
-
var autoImportRegistration = autoImportCandidates[url];
|
|
639
|
-
if (autoImportRegistration) {
|
|
640
|
-
delete autoImportCandidates[url];
|
|
641
|
-
return autoImportRegistration;
|
|
642
|
-
}
|
|
643
|
-
var loader = this;
|
|
644
|
-
return Promise.resolve(systemJSPrototype.createScript(url)).then(function (script) {
|
|
645
|
-
return new Promise(function (resolve, reject) {
|
|
646
|
-
script.addEventListener('error', function () {
|
|
647
|
-
reject(Error(errMsg(3, [url, firstParentUrl].join(', ') )));
|
|
648
|
-
});
|
|
649
|
-
script.addEventListener('load', function () {
|
|
650
|
-
document.head.removeChild(script);
|
|
651
|
-
// Note that if an error occurs that isn't caught by this if statement,
|
|
652
|
-
// that getRegister will return null and a "did not instantiate" error will be thrown.
|
|
653
|
-
if (lastWindowErrorUrl === url) {
|
|
654
|
-
reject(lastWindowError);
|
|
655
|
-
}
|
|
656
|
-
else {
|
|
657
|
-
var register = loader.getRegister(url);
|
|
658
|
-
// Clear any auto import registration for dynamic import scripts during load
|
|
659
|
-
if (register && register[0] === lastAutoImportDeps)
|
|
660
|
-
clearTimeout(lastAutoImportTimeout);
|
|
661
|
-
resolve(register);
|
|
662
|
-
}
|
|
663
|
-
});
|
|
664
|
-
document.head.appendChild(script);
|
|
665
|
-
});
|
|
666
|
-
});
|
|
667
|
-
};
|
|
668
|
-
|
|
669
|
-
/*
|
|
670
|
-
* Fetch loader, sets up shouldFetch and fetch hooks
|
|
671
|
-
*/
|
|
672
|
-
systemJSPrototype.shouldFetch = function () {
|
|
673
|
-
return false;
|
|
674
|
-
};
|
|
675
|
-
if (typeof fetch !== 'undefined')
|
|
676
|
-
systemJSPrototype.fetch = fetch;
|
|
677
|
-
|
|
678
|
-
var instantiate = systemJSPrototype.instantiate;
|
|
679
|
-
var jsContentTypeRegEx = /^(text|application)\/(x-)?javascript(;|$)/;
|
|
680
|
-
systemJSPrototype.instantiate = function (url, parent) {
|
|
681
|
-
var loader = this;
|
|
682
|
-
if (!this.shouldFetch(url))
|
|
683
|
-
return instantiate.apply(this, arguments);
|
|
684
|
-
return this.fetch(url, {
|
|
685
|
-
credentials: 'same-origin',
|
|
686
|
-
integrity: importMap.integrity[url]
|
|
687
|
-
})
|
|
688
|
-
.then(function (res) {
|
|
689
|
-
if (!res.ok)
|
|
690
|
-
throw Error(errMsg(7, [res.status, res.statusText, url, parent].join(', ') ));
|
|
691
|
-
var contentType = res.headers.get('content-type');
|
|
692
|
-
if (!contentType || !jsContentTypeRegEx.test(contentType))
|
|
693
|
-
throw Error(errMsg(4, contentType ));
|
|
694
|
-
return res.text().then(function (source) {
|
|
695
|
-
if (source.indexOf('//# sourceURL=') < 0)
|
|
696
|
-
source += '\n//# sourceURL=' + url;
|
|
697
|
-
(0, eval)(source);
|
|
698
|
-
return loader.getRegister(url);
|
|
699
|
-
});
|
|
700
|
-
});
|
|
701
|
-
};
|
|
702
|
-
|
|
703
|
-
systemJSPrototype.resolve = function (id, parentUrl) {
|
|
704
|
-
parentUrl = parentUrl || !true || baseUrl;
|
|
705
|
-
return resolveImportMap(( importMap), resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl) || throwUnresolved(id, parentUrl);
|
|
706
|
-
};
|
|
707
|
-
|
|
708
|
-
function throwUnresolved (id, parentUrl) {
|
|
709
|
-
throw Error(errMsg(8, [id, parentUrl].join(', ') ));
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
var systemInstantiate = systemJSPrototype.instantiate;
|
|
713
|
-
systemJSPrototype.instantiate = function (url, firstParentUrl) {
|
|
714
|
-
var preloads = ( importMap).depcache[url];
|
|
715
|
-
if (preloads) {
|
|
716
|
-
for (var i = 0; i < preloads.length; i++)
|
|
717
|
-
getOrCreateLoad(this, this.resolve(preloads[i], url), url);
|
|
718
|
-
}
|
|
719
|
-
return systemInstantiate.call(this, url, firstParentUrl);
|
|
720
|
-
};
|
|
721
|
-
|
|
722
|
-
/*
|
|
723
|
-
* Supports loading System.register in workers
|
|
724
|
-
*/
|
|
725
|
-
|
|
726
|
-
if (hasSelf && typeof importScripts === 'function') {
|
|
727
|
-
systemJSPrototype.instantiate = function (url) {
|
|
728
|
-
var loader = this;
|
|
729
|
-
return self.fetch(url, {
|
|
730
|
-
credentials: 'same-origin',
|
|
731
|
-
}).then(function (response) {
|
|
732
|
-
if (!response.ok) {
|
|
733
|
-
throw Error(errMsg(7, [response.status, response.statusText, url].join(', ') ));
|
|
734
|
-
}
|
|
735
|
-
return response.text()
|
|
736
|
-
}).then(function (source) {
|
|
737
|
-
if (source.indexOf('//# sourceURL=') < 0) source += '\n//# sourceURL=' + url;
|
|
738
|
-
(0, eval)(source);
|
|
739
|
-
return loader.getRegister(url);
|
|
740
|
-
})
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
}());
|
|
745
|
-
|
|
746
|
-
(function(){
|
|
747
|
-
var envGlobal = typeof self !== 'undefined' ? self : global;
|
|
748
|
-
var System = envGlobal.System;
|
|
749
|
-
|
|
750
|
-
var registerRegistry = Object.create(null)
|
|
751
|
-
var register = System.register;
|
|
752
|
-
System.registerRegistry = registerRegistry;
|
|
753
|
-
System.register = function (name, deps, declare) {
|
|
754
|
-
if (typeof name !== 'string') return register.apply(this, arguments);
|
|
755
|
-
var define = [deps, declare];
|
|
756
|
-
return System.prepareImport().then(function () {
|
|
757
|
-
var url = System.resolve(`./${name}`);
|
|
758
|
-
registerRegistry[url] = define;
|
|
759
|
-
return register.call(System, deps, declare, url);
|
|
760
|
-
})
|
|
761
|
-
};
|
|
762
|
-
|
|
763
|
-
var instantiate = System.instantiate;
|
|
764
|
-
System.instantiate = function (url, firstParentUrl) {
|
|
765
|
-
var result = registerRegistry[url];
|
|
766
|
-
|
|
767
|
-
if (result) {
|
|
768
|
-
registerRegistry[url] = null;
|
|
769
|
-
return result;
|
|
770
|
-
} else {
|
|
771
|
-
return instantiate.call(this, url, firstParentUrl);
|
|
772
|
-
}
|
|
773
|
-
};
|
|
774
|
-
|
|
775
|
-
var getRegister = System.getRegister;
|
|
776
|
-
System.getRegister = function (url) {
|
|
777
|
-
// Calling getRegister() because other extras need to know it was called so they can perform side effects
|
|
778
|
-
var register = getRegister.call(this, url);
|
|
779
|
-
var result = registerRegistry[url] || register;
|
|
780
|
-
return result;
|
|
781
|
-
};
|
|
782
|
-
}());
|
|
783
|
-
|
|
784
|
-
(function () {
|
|
785
|
-
// worker or service worker
|
|
786
|
-
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {
|
|
787
|
-
var importMapFromParentPromise = new Promise((resolve) => {
|
|
788
|
-
var importmapMessageCallback = function (e) {
|
|
789
|
-
if (e.data === "__importmap_init__") {
|
|
790
|
-
self.removeEventListener("message", importmapMessageCallback)
|
|
791
|
-
e.ports[0].onmessage = (message) => {
|
|
792
|
-
resolve(message.data)
|
|
793
|
-
}
|
|
794
|
-
e.ports[0].postMessage('__importmap_request__')
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
self.addEventListener("message", importmapMessageCallback)
|
|
798
|
-
})
|
|
799
|
-
// var prepareImport = System.prepareImport
|
|
800
|
-
System.prepareImport = function () {
|
|
801
|
-
return importMapFromParentPromise.then(function (importmap) {
|
|
802
|
-
System.extendImportMap(System.importMap, JSON.stringify(importmap), System.baseUrl)
|
|
803
|
-
})
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
// auto import first register
|
|
807
|
-
var messageEvents = []
|
|
808
|
-
var messageCallback = (event) => {
|
|
809
|
-
messageEvents.push(event)
|
|
810
|
-
}
|
|
811
|
-
self.addEventListener('message', messageCallback)
|
|
812
|
-
var register = System.register;
|
|
813
|
-
System.register = function(deps, declare) {
|
|
814
|
-
System.register = register;
|
|
815
|
-
System.registerRegistry[self.location.href] = [deps, declare];
|
|
816
|
-
return System.import(self.location.href).then((result) => {
|
|
817
|
-
self.removeEventListener('message', messageCallback)
|
|
818
|
-
messageEvents.forEach((messageEvent) => {
|
|
819
|
-
self.dispatchEvent(messageEvent)
|
|
820
|
-
})
|
|
821
|
-
messageEvents = null
|
|
822
|
-
return result
|
|
823
|
-
})
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
else if (typeof window === 'object') {
|
|
827
|
-
var WorkerConstructor = window.Worker;
|
|
828
|
-
if (typeof WorkerConstructor === 'function') {
|
|
829
|
-
window.Worker = function (url, options) {
|
|
830
|
-
var worker = new WorkerConstructor(url, options);
|
|
831
|
-
var importmapChannel = new MessageChannel();
|
|
832
|
-
importmapChannel.port1.onmessage = function (message) {
|
|
833
|
-
System.prepareImport().then(function (importmap) {
|
|
834
|
-
message.target.postMessage(importmap);
|
|
835
|
-
});
|
|
836
|
-
}
|
|
837
|
-
worker.postMessage('__importmap_init__', [importmapChannel.port2]);
|
|
838
|
-
return worker
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
var serviceWorker = navigator.serviceWorker;
|
|
843
|
-
if (serviceWorker) {
|
|
844
|
-
var register = serviceWorker.register;
|
|
845
|
-
serviceWorker.register = function(url, options) {
|
|
846
|
-
var registrationPromise = register.call(this, url, options);
|
|
847
|
-
registrationPromise.then(function(registration) {
|
|
848
|
-
var installing = registration.installing;
|
|
849
|
-
var waiting = registration.waiting;
|
|
850
|
-
var active = registration.active;
|
|
851
|
-
var worker = installing || waiting || active;
|
|
852
|
-
var importmapChannel = new MessageChannel();
|
|
853
|
-
importmapChannel.port1.onmessage = function (message) {
|
|
854
|
-
System.prepareImport().then(function (importmap) {
|
|
855
|
-
message.target.postMessage(importmap)
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
worker.postMessage('__importmap_init__', [importmapChannel.port2]);
|
|
859
|
-
})
|
|
860
|
-
return registrationPromise
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
}());
|